llvm.org GIT mirror llvm / 790e11c
Add target triple to include/llvm/Config/config.h.in. Regenerate all files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44478 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 11 years ago
3 changed file(s) with 97 addition(s) and 89 deletion(s). Raw diff Collapse all Expand all
22 dnl
33 dnl This file was developed by the LLVM research group and is distributed under
44 dnl the University of Illinois Open Source License. See LICENSE.TXT for details.
5 dnl
5 dnl
66 dnl===-----------------------------------------------------------------------===
77 dnl This is the LLVM configuration script. It is processed by the autoconf
8 dnl program to produce a script named configure. This script contains the
8 dnl program to produce a script named configure. This script contains the
99 dnl configuration checks that LLVM needs in order to support multiple platforms.
1010 dnl This file is composed of 10 sections per the recommended organization of
1111 dnl autoconf input defined in the autoconf documentation. As this file evolves,
4545 dnl configuring LLVM and not some other package (it validates --srcdir argument)
4646 AC_CONFIG_SRCDIR([lib/VMCore/Module.cpp])
4747
48 dnl Place all of the extra autoconf files into the config subdirectory. Tell
49 dnl various tools where the m4 autoconf macros are.
48 dnl Place all of the extra autoconf files into the config subdirectory. Tell
49 dnl various tools where the m4 autoconf macros are.
5050 AC_CONFIG_AUX_DIR([autoconf])
5151
5252 dnl Quit if the source directory has already been configured.
7777 llvm-poolalloc) AC_CONFIG_SUBDIRS([projects/llvm-poolalloc]) ;;
7878 poolalloc) AC_CONFIG_SUBDIRS([projects/poolalloc]) ;;
7979 llvm-kernel) AC_CONFIG_SUBDIRS([projects/llvm-kernel]) ;;
80 *)
80 *)
8181 AC_MSG_WARN([Unknown project (${i}) won't be configured automatically])
8282 ;;
8383 esac
9191 dnl===-----------------------------------------------------------------------===
9292
9393 dnl Check the target for which we're compiling and the host that will do the
94 dnl compilations. This will tell us which LLVM compiler will be used for
95 dnl compiling SSA into object code. This needs to be done early because
94 dnl compilations. This will tell us which LLVM compiler will be used for
95 dnl compiling SSA into object code. This needs to be done early because
9696 dnl following tests depend on it.
9797 AC_CANONICAL_TARGET
9898
101101 AC_CACHE_CHECK([type of operating system we're going to host on],
102102 [llvm_cv_os_type],
103103 [case $host in
104 *-*-aix*)
105 llvm_cv_link_all_option="-Wl,--whole-archive"
106 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
107 llvm_cv_os_type="AIX"
108 llvm_cv_platform_type="Unix" ;;
109 *-*-irix*)
110 llvm_cv_link_all_option="-Wl,--whole-archive"
111 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
112 llvm_cv_os_type="IRIX"
113 llvm_cv_platform_type="Unix" ;;
114 *-*-cygwin*)
115 llvm_cv_link_all_option="-Wl,--whole-archive"
116 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
117 llvm_cv_os_type="Cygwin"
118 llvm_cv_platform_type="Unix" ;;
119 *-*-darwin*)
104 *-*-aix*)
105 llvm_cv_link_all_option="-Wl,--whole-archive"
106 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
107 llvm_cv_os_type="AIX"
108 llvm_cv_platform_type="Unix" ;;
109 *-*-irix*)
110 llvm_cv_link_all_option="-Wl,--whole-archive"
111 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
112 llvm_cv_os_type="IRIX"
113 llvm_cv_platform_type="Unix" ;;
114 *-*-cygwin*)
115 llvm_cv_link_all_option="-Wl,--whole-archive"
116 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
117 llvm_cv_os_type="Cygwin"
118 llvm_cv_platform_type="Unix" ;;
119 *-*-darwin*)
120120 llvm_cv_link_all_option="-Wl,-all_load"
121121 llvm_cv_link_all_option="-Wl,-noall_load"
122122 llvm_cv_os_type="Darwin"
123123 llvm_cv_platform_type="Unix" ;;
124 *-*-freebsd*)
125 llvm_cv_link_all_option="-Wl,--whole-archive"
126 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
127 llvm_cv_os_type="FreeBSD"
128 llvm_cv_platform_type="Unix" ;;
129 *-*-openbsd*)
130 llvm_cv_link_all_option="-Wl,--whole-archive"
131 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
132 llvm_cv_os_type="OpenBSD"
133 llvm_cv_platform_type="Unix" ;;
134 *-*-netbsd*)
135 llvm_cv_link_all_option="-Wl,--whole-archive"
136 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
137 llvm_cv_os_type="NetBSD"
138 llvm_cv_platform_type="Unix" ;;
139 *-*-hpux*)
140 llvm_cv_link_all_option="-Wl,--whole-archive"
141 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
142 llvm_cv_os_type="HP-UX"
143 llvm_cv_platform_type="Unix" ;;
144 *-*-interix*)
124 *-*-freebsd*)
125 llvm_cv_link_all_option="-Wl,--whole-archive"
126 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
127 llvm_cv_os_type="FreeBSD"
128 llvm_cv_platform_type="Unix" ;;
129 *-*-openbsd*)
130 llvm_cv_link_all_option="-Wl,--whole-archive"
131 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
132 llvm_cv_os_type="OpenBSD"
133 llvm_cv_platform_type="Unix" ;;
134 *-*-netbsd*)
135 llvm_cv_link_all_option="-Wl,--whole-archive"
136 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
137 llvm_cv_os_type="NetBSD"
138 llvm_cv_platform_type="Unix" ;;
139 *-*-hpux*)
140 llvm_cv_link_all_option="-Wl,--whole-archive"
141 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
142 llvm_cv_os_type="HP-UX"
143 llvm_cv_platform_type="Unix" ;;
144 *-*-interix*)
145145 llvm_cv_link_all_option="-Wl,--whole-archive"
146146 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
147147 llvm_cv_os_type="Interix"
148148 llvm_cv_platform_type="Unix" ;;
149 *-*-linux*)
149 *-*-linux*)
150150 llvm_cv_link_all_option="-Wl,--whole-archive"
151151 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
152152 llvm_cv_os_type="Linux"
153153 llvm_cv_platform_type="Unix" ;;
154 *-*-solaris*)
154 *-*-solaris*)
155155 llvm_cv_link_all_option="-Wl,-z,allextract"
156156 llvm_cv_no_link_all_option="-Wl,-z,defaultextract"
157157 llvm_cv_os_type="SunOS"
158158 llvm_cv_platform_type="Unix" ;;
159 *-*-win32*)
159 *-*-win32*)
160160 llvm_cv_link_all_option="-Wl,--whole-archive"
161161 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
162162 llvm_cv_os_type="Win32"
163163 llvm_cv_platform_type="Win32" ;;
164 *-*-mingw*)
165 llvm_cv_link_all_option="-Wl,--whole-archive"
166 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
167 llvm_cv_os_type="MingW"
164 *-*-mingw*)
165 llvm_cv_link_all_option="-Wl,--whole-archive"
166 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
167 llvm_cv_os_type="MingW"
168168 llvm_cv_platform_type="Win32" ;;
169 *)
170 llvm_cv_link_all_option=""
169 *)
170 llvm_cv_link_all_option=""
171171 llvm_cv_no_link_all_option=""
172 llvm_cv_os_type="Unknown"
172 llvm_cv_os_type="Unknown"
173173 llvm_cv_platform_type="Unknown" ;;
174174 esac])
175175
190190 dnl This is used by lib/System to determine the basic kind of implementation
191191 dnl to use.
192192 case $llvm_cv_platform_type in
193 Unix)
194 AC_DEFINE([LLVM_ON_UNIX],[1],[Define if this is Unixish platform])
193 Unix)
194 AC_DEFINE([LLVM_ON_UNIX],[1],[Define if this is Unixish platform])
195195 AC_SUBST(LLVM_ON_UNIX,[1])
196196 AC_SUBST(LLVM_ON_WIN32,[0])
197197 ;;
198 Win32)
199 AC_DEFINE([LLVM_ON_WIN32],[1],[Define if this is Win32ish platform])
198 Win32)
199 AC_DEFINE([LLVM_ON_WIN32],[1],[Define if this is Win32ish platform])
200200 AC_SUBST(LLVM_ON_UNIX,[0])
201201 AC_SUBST(LLVM_ON_WIN32,[1])
202202 ;;
230230
231231 dnl Check for build platform executable suffix if we're crosscompiling
232232 if test "$cross_compiling" = yes; then
233 AC_SUBST(LLVM_CROSS_COMPILING, [1])
233 AC_SUBST(LLVM_CROSS_COMPILING, [1])
234234 AC_BUILD_EXEEXT
235235 else
236236 AC_SUBST(LLVM_CROSS_COMPILING, [0])
237237 fi
238238
239 dnl Check to see if there's a "CVS" (or .svn) directory indicating that this
239 dnl Check to see if there's a "CVS" (or .svn) directory indicating that this
240240 dnl build is being done from a checkout. This sets up several defaults for the
241 dnl command line switches. When we build with a CVS directory, we get a
241 dnl command line switches. When we build with a CVS directory, we get a
242242 dnl debug with assertions turned on. Without, we assume a source release and we
243243 dnl get an optimized build without assertions. See --enable-optimized and
244244 dnl --enable-assertions below
374374 ARM) TARGETS_TO_BUILD="ARM" ;;
375375 Mips) TARGETS_TO_BUILD="Mips" ;;
376376 *) AC_MSG_ERROR([Can not set target to build]) ;;
377 esac
377 esac
378378 ;;
379379 *)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
380380 case "$a_target" in
388388 mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
389389 *) AC_MSG_ERROR([Unrecognized target $a_target]) ;;
390390 esac
391 done
391 done
392392 ;;
393393 esac
394394 TARGETS_TO_BUILD="CBackend MSIL $TARGETS_TO_BUILD"
445445 ocaml) BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD" ;;
446446 *) AC_MSG_ERROR([Unrecognized binding $a_binding]) ;;
447447 esac
448 done
448 done
449449 ;;
450450 esac
451451
552552
553553 dnl Checks for documentation and testing tools that we can do without. If these
554554 dnl are not found then they are set to "true" which always succeeds but does
555 dnl nothing. This just lets the build output show that we could have done
556 dnl something if the tool was available.
555 dnl nothing. This just lets the build output show that we could have done
556 dnl something if the tool was available.
557557 AC_PATH_PROG(BZIP2,[bzip2],[echo "Skipped: bzip2 not found"])
558558 AC_PATH_PROG(DOXYGEN,[doxygen],[echo "Skipped: doxygen not found"])
559559 AC_PATH_PROG(GROFF,[groff],[echo "Skipped: groff not found"])
593593 AC_SUBST(LLVMGCC,$LLVMGCC)
594594 AC_SUBST(LLVMGXX,$LLVMGXX)
595595 fi
596
596
597597 AC_MSG_CHECKING([tool compatibility])
598598
599599 dnl Ensure that compilation tools are GCC or a GNU compatible compiler such as
604604 ICC=no
605605 IXX=no
606606 case $CC in
607 icc*|icpc*)
607 icc*|icpc*)
608608 ICC=yes
609609 IXX=yes
610610 ;;
626626 dnl Verify that GCC is version 3.0 or higher
627627 if test "$GCC" = "yes"
628628 then
629 gccmajor=`$CC --version | head -n 1 | sed 's/[[^0-9]]*\([[0-9.]]\).*/\1/'`
629 gccmajor=`$CC --version | head -n 1 | sed 's/[[^0-9]]*\([[0-9.]]\).*/\1/'`
630630 if test "$gccmajor" -lt "3"
631631 then
632632 AC_MSG_ERROR([gcc 3.x required, but you have a lower version])
659659 dnl lt_dlopen may be required for plugin support.
660660 AC_SEARCH_LIBS(lt_dlopen,ltdl,AC_DEFINE([HAVE_LT_DLOPEN],[1],
661661 [Define if lt_dlopen() is available on this platform]),
662 AC_MSG_WARN([lt_dlopen() not found - plugin support might
662 AC_MSG_WARN([lt_dlopen() not found - plugin support might
663663 not be available]))
664664
665665 dnl dlopen() is required for plugin support.
772772 AC_FUNC_ISNAN
773773 AC_FUNC_ISINF
774774
775 dnl Check for mmap support.We also need to know if /dev/zero is required to
776 dnl be opened for allocating RWX memory.
775 dnl Check for mmap support.We also need to know if /dev/zero is required to
776 dnl be opened for allocating RWX memory.
777777 dnl Make sure we aren't attempting to configure for an unknown system
778778 if test "$llvm_cv_platform_type" = "Unix" ; then
779 AC_FUNC_MMAP
779 AC_FUNC_MMAP
780780 AC_FUNC_MMAP_FILE
781781 AC_NEED_DEV_ZERO_FOR_MMAP
782782
812812 rm conftest.c
813813 fi])
814814
815 dnl Since we have a sane llvm-gcc, identify it and its sub-tools
815 dnl Since we have a sane llvm-gcc, identify it and its sub-tools
816816 if test "$llvm_cv_llvmgcc_sanity" = "yes" ; then
817817 AC_MSG_CHECKING([llvm-gcc component support])
818818 llvmcc1path=`"$LLVMGCC" --print-prog-name=cc1`
832832 AC_MSG_RESULT([ok])
833833 fi
834834
835 dnl Propagate the shared library extension that the libltdl checks did to
835 dnl Propagate the shared library extension that the libltdl checks did to
836836 dnl the Makefiles so we can use it there too
837837 AC_SUBST(SHLIBEXT,$libltdl_cv_shlibext)
838838
839839 # Translate the various configuration directories and other basic
840 # information into substitutions that will end up in Makefile.config.in
840 # information into substitutions that will end up in Makefile.config.in
841841 # that these configured values can be used by the makefiles
842842 if test "${prefix}" = "NONE" ; then
843843 prefix="/usr/local"
865865
866866 # Place the various directores into the config.h file as #defines so that we
867867 # can know about the installation paths within LLVM.
868 AC_DEFINE_UNQUOTED(LLVM_PREFIX,"$LLVM_PREFIX",
868 AC_DEFINE_UNQUOTED(LLVM_PREFIX,"$LLVM_PREFIX",
869869 [Installation prefix directory])
870 AC_DEFINE_UNQUOTED(LLVM_BINDIR, "$LLVM_BINDIR",
870 AC_DEFINE_UNQUOTED(LLVM_BINDIR, "$LLVM_BINDIR",
871871 [Installation directory for binary executables])
872 AC_DEFINE_UNQUOTED(LLVM_LIBDIR, "$LLVM_LIBDIR",
872 AC_DEFINE_UNQUOTED(LLVM_LIBDIR, "$LLVM_LIBDIR",
873873 [Installation directory for libraries])
874 AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DATADIR",
874 AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DATADIR",
875875 [Installation directory for data files])
876 AC_DEFINE_UNQUOTED(LLVM_DOCSDIR, "$LLVM_DOCSDIR",
876 AC_DEFINE_UNQUOTED(LLVM_DOCSDIR, "$LLVM_DOCSDIR",
877877 [Installation directory for documentation])
878 AC_DEFINE_UNQUOTED(LLVM_ETCDIR, "$LLVM_ETCDIR",
878 AC_DEFINE_UNQUOTED(LLVM_ETCDIR, "$LLVM_ETCDIR",
879879 [Installation directory for config files])
880 AC_DEFINE_UNQUOTED(LLVM_INCLUDEDIR, "$LLVM_INCLUDEDIR",
880 AC_DEFINE_UNQUOTED(LLVM_INCLUDEDIR, "$LLVM_INCLUDEDIR",
881881 [Installation directory for include files])
882 AC_DEFINE_UNQUOTED(LLVM_INFODIR, "$LLVM_INFODIR",
882 AC_DEFINE_UNQUOTED(LLVM_INFODIR, "$LLVM_INFODIR",
883883 [Installation directory for .info files])
884 AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR",
884 AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR",
885885 [Installation directory for man pages])
886 AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME",
886 AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME",
887887 [Time at which LLVM was configured])
888 AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$host",
889 [Host triple we were built on])
888890
889891 # Determine which bindings to build.
890892 if test "$BINDINGS_TO_BUILD" = auto ; then
914916 fi
915917 if test "x$OCAMLOPT" = x ; then
916918 AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt])
917 dnl ocamlopt is optional!
919 dnl ocamlopt is optional!
918920 fi
919921 if test "x$with_ocaml_libdir" != xauto ; then
920922 AC_SUBST(OCAML_LIBDIR,$with_ocaml_libdir)
983985
984986 dnl Finally, crank out the output
985987 AC_OUTPUT
986
3416034160 _ACEOF
3416134161
3416234162
34163 cat >>confdefs.h <<_ACEOF
34164 #define LLVM_HOSTTRIPLE "$host"
34165 _ACEOF
34166
34167
3416334168 # Determine which bindings to build.
3416434169 if test "$BINDINGS_TO_BUILD" = auto ; then
3416534170 BINDINGS_TO_BUILD=""
3578035785 done
3578135786 fi
3578235787
35783
456456
457457 /* Installation directory for config files */
458458 #undef LLVM_ETCDIR
459
460 /* Host triple we were built on */
461 #undef LLVM_HOSTTRIPLE
459462
460463 /* Installation directory for include files */
461464 #undef LLVM_INCLUDEDIR