Skip to content

Commit

Permalink
For PR814:
Browse files Browse the repository at this point in the history
Provide support for making cross-compiling builds. See the PR for details.
Patch provided by Anton Korobeynikov. Thanks, Anton!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29309 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Reid Spencer committed Jul 26, 2006
1 parent 7686b57 commit e2cfe5d
Show file tree
Hide file tree
Showing 4 changed files with 240 additions and 40 deletions.
11 changes: 9 additions & 2 deletions Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ OS=@OS@
# Target hardware architecture
ARCH=@ARCH@

# Indicates, whether we're cross-compiling LLVM or not
LLVM_CROSS_COMPILING=@LLVM_CROSS_COMPILING@

# Executable file extension for build platform (mainly for
# tablegen call if we're cross-compiling).
BUILD_EXEEXT=@BUILD_EXEEXT@

# Target triple (cpu-vendor-os) for which we should generate code
TARGET_TRIPLE=@target@

Expand Down Expand Up @@ -214,10 +221,10 @@ ENABLE_THREADS := @ENABLE_THREADS@
# Enable JIT for this platform
TARGET_HAS_JIT = @TARGET_HAS_JIT@

# Shared library extension for this platform.
# Shared library extension for host platform.
SHLIBEXT = @SHLIBEXT@

# Executable file extension for this platform.
# Executable file extension for host platform.
EXEEXT = @EXEEXT@

# Things we just assume are "there"
Expand Down
6 changes: 5 additions & 1 deletion Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ ifndef LLVMAS
LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
endif
ifndef TBLGEN
TBLGEN := $(LLVMToolDir)/tblgen$(EXEEXT)
ifeq ($(LLVM_CROSS_COMPILING),1)
TBLGEN := $(LLVMToolDir)/tblgen$(BUILD_EXEEXT)
else
TBLGEN := $(LLVMToolDir)/tblgen$(EXEEXT)
endif
endif
ifndef GCCAS
GCCAS := $(LLVMToolDir)/gccas$(EXEEXT)
Expand Down
12 changes: 10 additions & 2 deletions autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ AC_CANONICAL_TARGET

dnl Determine the platform type and cache its value. This helps us configure
dnl the System library to the correct build platform.
AC_CACHE_CHECK([type of operating system we're on],
AC_CACHE_CHECK([type of operating system we're going to host on],
[llvm_cv_os_type],
[case $build in
[case $host in
*-*-aix*)
llvm_cv_os_type="AIX"
llvm_cv_platform_type="Unix" ;;
Expand Down Expand Up @@ -188,6 +188,14 @@ AC_SUBST(ARCH,$llvm_cv_target_arch)
dnl Check for the endianness of the target
AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))

dnl Check for build platform executable suffix if we're crosscompiling
if test "$cross_compiling" = yes; then
AC_SUBST(LLVM_CROSS_COMPILING, [1])
AC_BUILD_EXEEXT
else
AC_SUBST(LLVM_CROSS_COMPILING, [0])
fi

dnl Check to see if there's a "CVS" directory indicating that this build is
dnl being done from a CVS checkout. This sets up several defaults for the
dnl command line switches. When we build with a CVS directory, we get a
Expand Down
Loading

0 comments on commit e2cfe5d

Please sign in to comment.