llvm.org GIT mirror llvm / 2fbf9e2
Add version, arch, system libs, and targets to Makefile.config Teach autoconf/configure.ac to AC_SUBST several additional values in Makefile.config to make them available to Makefile code. These will be useful to generate CMake package modules from the Makefile build. Contributed by Brad King. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201052 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 5 years ago
4 changed file(s) with 100 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
1414 # Define LLVM specific info and directories based on the autoconf variables
1515 LLVMPackageName := @PACKAGE_TARNAME@
1616 LLVMVersion := @PACKAGE_VERSION@
17 LLVM_VERSION_MAJOR := @LLVM_VERSION_MAJOR@
18 LLVM_VERSION_MINOR := @LLVM_VERSION_MINOR@
1719 LLVM_CONFIGTIME := @LLVM_CONFIGTIME@
1820
1921 ###########################################################################
117119 # Target hardware architecture
118120 ARCH=@ARCH@
119121 TARGET_NATIVE_ARCH := $(ARCH)
122 LLVM_NATIVE_ARCH := @LLVM_NATIVE_ARCH@
120123
121124 # Indicates, whether we're cross-compiling LLVM or not
122125 LLVM_CROSS_COMPILING=@LLVM_CROSS_COMPILING@
206209 PDFROFF := @PDFROFF@
207210 ZIP := @ZIP@
208211
212 HAVE_LIBZ := @HAVE_LIBZ@
213 HAVE_DLOPEN := @HAVE_DLOPEN@
209214 HAVE_PTHREAD := @HAVE_PTHREAD@
215 HAVE_TERMINFO := @HAVE_TERMINFO@
210216
211217 LIBS := @LIBS@
218
219 # Targets that are possible to build
220 ALL_TARGETS := @ALL_TARGETS@
212221
213222 # Targets that we should build
214223 TARGETS_TO_BUILD=@TARGETS_TO_BUILD@
224
225 # Targets supporting JIT
226 TARGETS_WITH_JIT := @TARGETS_WITH_JIT@
215227
216228 # Path to directory where object files should be stored during a build.
217229 # Set OBJ_ROOT to "." if you do not want to use a separate place for
248260
249261 # When ENABLE_WERROR is enabled, we'll pass -Werror on the command line
250262 ENABLE_WERROR = @ENABLE_WERROR@
263
264 # When ENABLE_TERMINFO is enabled, we use terminfo.
265 ENABLE_TERMINFO = @ENABLE_TERMINFO@
251266
252267 # When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
253268 # into the "Release" directories. Otherwise, LLVM code is not optimized and
3131 dnl Initialize autoconf and define the package name, version number and
3232 dnl address for reporting bugs.
3333 AC_INIT([LLVM],[3.5svn],[http://llvm.org/bugs/])
34 AC_DEFINE([LLVM_VERSION_MAJOR], [3], [Major version of the LLVM API])
35 AC_DEFINE([LLVM_VERSION_MINOR], [5], [Minor version of the LLVM API])
34 LLVM_DEFINE_SUBST([LLVM_VERSION_MAJOR], [3], [Major version of the LLVM API])
35 LLVM_DEFINE_SUBST([LLVM_VERSION_MINOR], [5], [Minor version of the LLVM API])
3636
3737 dnl Provide a copyright substitution and ensure the copyright notice is included
3838 dnl in the output of --version option of the generated configure script.
431431
432432 dnl Define a substitution, ARCH, for the target architecture
433433 AC_SUBST(ARCH,$llvm_cv_target_arch)
434 AC_SUBST(LLVM_NATIVE_ARCH,$LLVM_NATIVE_ARCH)
434435
435436 dnl Determine what our host architecture.
436437 dnl This will allow MCJIT regress tests runs only for supported
767768 esac
768769 fi
769770
771 TARGETS_WITH_JIT="AArch64 ARM Mips PowerPC SystemZ X86"
772 AC_SUBST(TARGETS_WITH_JIT,$TARGETS_WITH_JIT)
773
770774 dnl Allow enablement of building and installing docs
771775 AC_ARG_ENABLE(docs,
772776 AS_HELP_STRING([--enable-docs],
916920 [Define to enable crash handling overrides])
917921 fi
918922
923 dnl List all possible targets
924 ALL_TARGETS="X86 Sparc PowerPC AArch64 ARM Mips XCore MSP430 CppBackend NVPTX Hexagon SystemZ R600"
925 AC_SUBST(ALL_TARGETS,$ALL_TARGETS)
926
919927 dnl Allow specific targets to be specified for building (or not)
920928 TARGETS_TO_BUILD=""
921929 AC_ARG_ENABLE([targets],AS_HELP_STRING([--enable-targets],
927935 enableval=host
928936 fi
929937 case "$enableval" in
930 all) TARGETS_TO_BUILD="X86 Sparc PowerPC AArch64 ARM Mips XCore MSP430 CppBackend NVPTX Hexagon SystemZ R600" ;;
938 all) TARGETS_TO_BUILD="$ALL_TARGETS" ;;
931939 *)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
932940 case "$a_target" in
933941 x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
11881196 *) AC_MSG_ERROR([Invalid setting for --enable-terminfo. Use "yes" or "no"]) ;;
11891197 esac],
11901198 llvm_cv_enable_terminfo="yes")
1199 case "$llvm_cv_enable_terminfo" in
1200 yes) AC_SUBST(ENABLE_TERMINFO,[1]) ;;
1201 no) AC_SUBST(ENABLE_TERMINFO,[0]) ;;
1202 esac
11911203
11921204 dnl --enable-libedit: check whether the user wants to turn off libedit.
11931205 AC_ARG_ENABLE(libedit,AS_HELP_STRING(
14991511 fi
15001512
15011513 dnl dlopen() is required for plugin support.
1502 AC_SEARCH_LIBS(dlopen,dl,AC_DEFINE([HAVE_DLOPEN],[1],
1514 AC_SEARCH_LIBS(dlopen,dl,LLVM_DEFINE_SUBST([HAVE_DLOPEN],[1],
15031515 [Define if dlopen() is available on this platform.]),
15041516 AC_MSG_WARN([dlopen() not found - disabling plugin support]))
15051517
15121524 if test "$llvm_cv_enable_terminfo" = "yes" ; then
15131525 dnl We need the has_color functionality in curses for it to be useful.
15141526 AC_SEARCH_LIBS(setupterm,tinfo terminfo curses ncurses ncursesw,
1515 AC_DEFINE([HAVE_TERMINFO],[1],
1516 [Define if the setupterm() function is supported this platform.]))
1527 LLVM_DEFINE_SUBST([HAVE_TERMINFO],[1],
1528 [Define if the setupterm() function is supported this platform.]))
15171529 fi
15181530
15191531 dnl The libedit library is optional; used by lib/LineEditor
0 # Combine AC_DEFINE and AC_SUBST
1 AC_DEFUN([LLVM_DEFINE_SUBST], [
2 AC_DEFINE([$1], [$2], [$3])
3 AC_SUBST([$1], ['$2'])
4 ])
638638 build_alias
639639 host_alias
640640 target_alias
641 LLVM_VERSION_MAJOR
642 LLVM_VERSION_MINOR
641643 LLVM_COPYRIGHT
642644 CC
643645 CFLAGS
673675 LLVM_ON_UNIX
674676 LLVM_ON_WIN32
675677 ARCH
678 LLVM_NATIVE_ARCH
676679 HOST_ARCH
677680 LLVM_CROSS_COMPILING
678681 BUILD_CC
696699 KEEP_SYMBOLS
697700 JIT
698701 TARGET_HAS_JIT
702 TARGETS_WITH_JIT
699703 ENABLE_DOCS
700704 ENABLE_DOXYGEN
701705 LLVM_ENABLE_THREADS
705709 ENABLE_SHARED
706710 ENABLE_EMBED_STDCXX
707711 ENABLE_TIMESTAMPS
712 ALL_TARGETS
708713 TARGETS_TO_BUILD
709714 LLVM_ENUM_TARGETS
710715 LLVM_ENUM_ASM_PRINTERS
715720 EXTRA_LD_OPTIONS
716721 CLANG_SRC_ROOT
717722 BINUTILS_INCDIR
723 ENABLE_TERMINFO
718724 INTERNAL_PREFIX
719725 NM
720726 ifGNUmake
769775 NO_MAYBE_UNINITIALIZED
770776 NO_UNINITIALIZED
771777 PYTHON
778 HAVE_DLOPEN
779 HAVE_TERMINFO
772780 USE_UDIS86
773781 USE_OPROFILE
774782 USE_INTEL_JITEVENTS
19291937
19301938
19311939
1940
19321941 cat >>confdefs.h <<\_ACEOF
19331942 #define LLVM_VERSION_MAJOR 3
19341943 _ACEOF
19351944
1945 LLVM_VERSION_MAJOR='3'
1946
1947
1948
19361949
19371950 cat >>confdefs.h <<\_ACEOF
19381951 #define LLVM_VERSION_MINOR 5
19391952 _ACEOF
1953
1954 LLVM_VERSION_MINOR='5'
1955
19401956
19411957
19421958 LLVM_COPYRIGHT="Copyright (c) 2003-2014 University of Illinois at Urbana-Champaign."
41594175
41604176 ARCH=$llvm_cv_target_arch
41614177
4178 LLVM_NATIVE_ARCH=$LLVM_NATIVE_ARCH
4179
41624180
41634181 case $host in
41644182 i?86-*) host_arch="x86" ;;
50785096 esac
50795097 fi
50805098
5099 TARGETS_WITH_JIT="AArch64 ARM Mips PowerPC SystemZ X86"
5100 TARGETS_WITH_JIT=$TARGETS_WITH_JIT
5101
5102
50815103 # Check whether --enable-docs was given.
50825104 if test "${enable_docs+set}" = set; then
50835105 enableval=$enable_docs;
53115333
53125334 fi
53135335
5336 ALL_TARGETS="X86 Sparc PowerPC AArch64 ARM Mips XCore MSP430 CppBackend NVPTX Hexagon SystemZ R600"
5337 ALL_TARGETS=$ALL_TARGETS
5338
5339
53145340 TARGETS_TO_BUILD=""
53155341 # Check whether --enable-targets was given.
53165342 if test "${enable_targets+set}" = set; then
53235349 enableval=host
53245350 fi
53255351 case "$enableval" in
5326 all) TARGETS_TO_BUILD="X86 Sparc PowerPC AArch64 ARM Mips XCore MSP430 CppBackend NVPTX Hexagon SystemZ R600" ;;
5352 all) TARGETS_TO_BUILD="$ALL_TARGETS" ;;
53275353 *)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
53285354 case "$a_target" in
53295355 x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
56805706 llvm_cv_enable_terminfo="yes"
56815707 fi
56825708
5709 case "$llvm_cv_enable_terminfo" in
5710 yes) ENABLE_TERMINFO=1
5711 ;;
5712 no) ENABLE_TERMINFO=0
5713 ;;
5714 esac
56835715
56845716 # Check whether --enable-libedit was given.
56855717 if test "${enable_libedit+set}" = set; then
1067710709 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1067810710 lt_status=$lt_dlunknown
1067910711 cat > conftest.$ac_ext <
10680 #line 10681 "configure"
10712 #line 10713 "configure"
1068110713 #include "confdefs.h"
1068210714
1068310715 #if HAVE_DLFCN_H
1235612388 if test "$ac_res" != no; then
1235712389 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
1235812390
12391
1235912392 cat >>confdefs.h <<\_ACEOF
1236012393 #define HAVE_DLOPEN 1
1236112394 _ACEOF
12395
12396 HAVE_DLOPEN='1'
12397
1236212398
1236312399 else
1236412400 { echo "$as_me:$LINENO: WARNING: dlopen() not found - disabling plugin support" >&5
1256412600 if test "$ac_res" != no; then
1256512601 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
1256612602
12603
1256712604 cat >>confdefs.h <<\_ACEOF
1256812605 #define HAVE_TERMINFO 1
1256912606 _ACEOF
12607
12608 HAVE_TERMINFO='1'
12609
1257012610
1257112611 fi
1257212612
2332323363 build_alias!$build_alias$ac_delim
2332423364 host_alias!$host_alias$ac_delim
2332523365 target_alias!$target_alias$ac_delim
23366 LLVM_VERSION_MAJOR!$LLVM_VERSION_MAJOR$ac_delim
23367 LLVM_VERSION_MINOR!$LLVM_VERSION_MINOR$ac_delim
2332623368 LLVM_COPYRIGHT!$LLVM_COPYRIGHT$ac_delim
2332723369 CC!$CC$ac_delim
2332823370 CFLAGS!$CFLAGS$ac_delim
2335823400 LLVM_ON_UNIX!$LLVM_ON_UNIX$ac_delim
2335923401 LLVM_ON_WIN32!$LLVM_ON_WIN32$ac_delim
2336023402 ARCH!$ARCH$ac_delim
23403 LLVM_NATIVE_ARCH!$LLVM_NATIVE_ARCH$ac_delim
2336123404 HOST_ARCH!$HOST_ARCH$ac_delim
2336223405 LLVM_CROSS_COMPILING!$LLVM_CROSS_COMPILING$ac_delim
2336323406 BUILD_CC!$BUILD_CC$ac_delim
2338023423 DEBUG_SYMBOLS!$DEBUG_SYMBOLS$ac_delim
2338123424 KEEP_SYMBOLS!$KEEP_SYMBOLS$ac_delim
2338223425 JIT!$JIT$ac_delim
23383 TARGET_HAS_JIT!$TARGET_HAS_JIT$ac_delim
23384 ENABLE_DOCS!$ENABLE_DOCS$ac_delim
23385 ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim
2338623426 _ACEOF
2338723427
2338823428 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2342423464 ac_delim='%!_!# '
2342523465 for ac_last_try in false false false false false :; do
2342623466 cat >conf$$subs.sed <<_ACEOF
23467 TARGET_HAS_JIT!$TARGET_HAS_JIT$ac_delim
23468 TARGETS_WITH_JIT!$TARGETS_WITH_JIT$ac_delim
23469 ENABLE_DOCS!$ENABLE_DOCS$ac_delim
23470 ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim
2342723471 LLVM_ENABLE_THREADS!$LLVM_ENABLE_THREADS$ac_delim
2342823472 ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim
2342923473 LLVM_ENABLE_ZLIB!$LLVM_ENABLE_ZLIB$ac_delim
2343123475 ENABLE_SHARED!$ENABLE_SHARED$ac_delim
2343223476 ENABLE_EMBED_STDCXX!$ENABLE_EMBED_STDCXX$ac_delim
2343323477 ENABLE_TIMESTAMPS!$ENABLE_TIMESTAMPS$ac_delim
23478 ALL_TARGETS!$ALL_TARGETS$ac_delim
2343423479 TARGETS_TO_BUILD!$TARGETS_TO_BUILD$ac_delim
2343523480 LLVM_ENUM_TARGETS!$LLVM_ENUM_TARGETS$ac_delim
2343623481 LLVM_ENUM_ASM_PRINTERS!$LLVM_ENUM_ASM_PRINTERS$ac_delim
2344123486 EXTRA_LD_OPTIONS!$EXTRA_LD_OPTIONS$ac_delim
2344223487 CLANG_SRC_ROOT!$CLANG_SRC_ROOT$ac_delim
2344323488 BINUTILS_INCDIR!$BINUTILS_INCDIR$ac_delim
23489 ENABLE_TERMINFO!$ENABLE_TERMINFO$ac_delim
2344423490 INTERNAL_PREFIX!$INTERNAL_PREFIX$ac_delim
2344523491 NM!$NM$ac_delim
2344623492 ifGNUmake!$ifGNUmake$ac_delim
2349523541 NO_MAYBE_UNINITIALIZED!$NO_MAYBE_UNINITIALIZED$ac_delim
2349623542 NO_UNINITIALIZED!$NO_UNINITIALIZED$ac_delim
2349723543 PYTHON!$PYTHON$ac_delim
23544 HAVE_DLOPEN!$HAVE_DLOPEN$ac_delim
23545 HAVE_TERMINFO!$HAVE_TERMINFO$ac_delim
2349823546 USE_UDIS86!$USE_UDIS86$ac_delim
2349923547 USE_OPROFILE!$USE_OPROFILE$ac_delim
2350023548 USE_INTEL_JITEVENTS!$USE_INTEL_JITEVENTS$ac_delim
2351323561 LLVM_DATADIR!$LLVM_DATADIR$ac_delim
2351423562 LLVM_DOCSDIR!$LLVM_DOCSDIR$ac_delim
2351523563 LLVM_ETCDIR!$LLVM_ETCDIR$ac_delim
23516 LLVM_INCLUDEDIR!$LLVM_INCLUDEDIR$ac_delim
23517 LLVM_INFODIR!$LLVM_INFODIR$ac_delim
23518 LLVM_MANDIR!$LLVM_MANDIR$ac_delim
23519 LLVM_CONFIGTIME!$LLVM_CONFIGTIME$ac_delim
23520 BINDINGS_TO_BUILD!$BINDINGS_TO_BUILD$ac_delim
23521 ALL_BINDINGS!$ALL_BINDINGS$ac_delim
23522 OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim
23523 ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim
2352423564 _ACEOF
2352523565
2352623566 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2356223602 ac_delim='%!_!# '
2356323603 for ac_last_try in false false false false false :; do
2356423604 cat >conf$$subs.sed <<_ACEOF
23605 LLVM_INCLUDEDIR!$LLVM_INCLUDEDIR$ac_delim
23606 LLVM_INFODIR!$LLVM_INFODIR$ac_delim
23607 LLVM_MANDIR!$LLVM_MANDIR$ac_delim
23608 LLVM_CONFIGTIME!$LLVM_CONFIGTIME$ac_delim
23609 BINDINGS_TO_BUILD!$BINDINGS_TO_BUILD$ac_delim
23610 ALL_BINDINGS!$ALL_BINDINGS$ac_delim
23611 OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim
23612 ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim
2356523613 RPATH!$RPATH$ac_delim
2356623614 RDYNAMIC!$RDYNAMIC$ac_delim
2356723615 program_prefix!$program_prefix$ac_delim
2356923617 LTLIBOBJS!$LTLIBOBJS$ac_delim
2357023618 _ACEOF
2357123619
23572 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 5; then
23620 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 13; then
2357323621 break
2357423622 elif $ac_last_try; then
2357523623 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5