11dnl **************************************************************************
22dnl * Initialize
33dnl **************************************************************************
4- AC_INIT ( [ SMACK] , [ 1.0 ] , [ zvonimir@cs.utah.edu ] )
4+ AC_INIT ( [ [ SMACK] ] , [ [ 1.4.0 ] ] , [ smack-dev@googlegroups.com ] , [ smack ] , [ http://github.com/smackers/smack ] )
55
66dnl Identify where LLVM source tree is
77LLVM_SRC_ROOT="../.."
@@ -304,13 +304,14 @@ AC_CACHE_CHECK([target architecture],[llvm_cv_target_arch],
304304 sparc*-*) llvm_cv_target_arch="Sparc" ;;
305305 powerpc*-*) llvm_cv_target_arch="PowerPC" ;;
306306 arm*-*) llvm_cv_target_arch="ARM" ;;
307+ aarch64*-*) llvm_cv_target_arch="AArch64" ;;
307308 mips-* | mips64-*) llvm_cv_target_arch="Mips" ;;
308309 mipsel-* | mips64el-*) llvm_cv_target_arch="Mips" ;;
309310 xcore-*) llvm_cv_target_arch="XCore" ;;
310311 msp430-*) llvm_cv_target_arch="MSP430" ;;
311312 hexagon-*) llvm_cv_target_arch="Hexagon" ;;
312- mblaze-*) llvm_cv_target_arch="MBlaze" ;;
313313 nvptx-*) llvm_cv_target_arch="NVPTX" ;;
314+ s390x-*) llvm_cv_target_arch="SystemZ" ;;
314315 *) llvm_cv_target_arch="Unknown" ;;
315316esac] )
316317
@@ -380,6 +381,18 @@ case "$enableval" in
380381 *) AC_MSG_ERROR ( [ Invalid setting for --enable-libcpp. Use "yes" or "no"] ) ;;
381382esac
382383
384+ dnl --enable-cxx11 : check whether or not to use -std=c++11 on the command line
385+ AC_ARG_ENABLE ( cxx11 ,
386+ AS_HELP_STRING ( [ --enable-cxx11] ,
387+ [ Use c++11 if available (default is NO)] ) ,,
388+ enableval=default )
389+ case "$enableval" in
390+ yes) AC_SUBST ( ENABLE_CXX11 ,[ 1] ) ;;
391+ no) AC_SUBST ( ENABLE_CXX11 ,[ 0] ) ;;
392+ default) AC_SUBST ( ENABLE_CXX11 ,[ 0] ) ;;
393+ *) AC_MSG_ERROR ( [ Invalid setting for --enable-cxx11. Use "yes" or "no"] ) ;;
394+ esac
395+
383396dnl --enable-optimized : check whether they want to do an optimized build:
384397AC_ARG_ENABLE ( optimized , AS_HELP_STRING (
385398 -- enable-optimized ,[ Compile with optimizations enabled (default is NO)] ) ,,enableval=$optimize )
@@ -407,6 +420,16 @@ else
407420 AC_SUBST ( DISABLE_ASSERTIONS ,[ [ DISABLE_ASSERTIONS=1] ] )
408421fi
409422
423+ dnl --enable-werror : check whether we want Werror on by default
424+ AC_ARG_ENABLE ( werror ,AS_HELP_STRING (
425+ -- enable-werror ,[ Compile with -Werror enabled (default is NO)] ) ,, enableval="no" )
426+ case "$enableval" in
427+ yes) AC_SUBST ( ENABLE_WERROR ,[ 1] ) ;;
428+ no) AC_SUBST ( ENABLE_WERROR ,[ 0] ) ;;
429+ default) AC_SUBST ( ENABLE_WERROR ,[ 0] ) ;;
430+ *) AC_MSG_ERROR ( [ Invalid setting for --enable-werror. Use "yes" or "no"] ) ;;
431+ esac
432+
410433dnl --enable-expensive-checks : check whether they want to turn on expensive debug checks:
411434AC_ARG_ENABLE ( expensive-checks ,AS_HELP_STRING (
412435 -- enable-expensive-checks ,[ Compile with expensive debug checks enabled (default is NO)] ) ,, enableval="no" )
@@ -452,12 +475,13 @@ else
452475 PowerPC) AC_SUBST ( TARGET_HAS_JIT ,1 ) ;;
453476 x86_64) AC_SUBST ( TARGET_HAS_JIT ,1 ) ;;
454477 ARM) AC_SUBST ( TARGET_HAS_JIT ,1 ) ;;
478+ AArch64) AC_SUBST ( TARGET_HAS_JIT ,0 ) ;;
455479 Mips) AC_SUBST ( TARGET_HAS_JIT ,1 ) ;;
456480 XCore) AC_SUBST ( TARGET_HAS_JIT ,0 ) ;;
457481 MSP430) AC_SUBST ( TARGET_HAS_JIT ,0 ) ;;
458482 Hexagon) AC_SUBST ( TARGET_HAS_JIT ,0 ) ;;
459- MBlaze) AC_SUBST ( TARGET_HAS_JIT ,0 ) ;;
460483 NVPTX) AC_SUBST ( TARGET_HAS_JIT ,0 ) ;;
484+ SystemZ) AC_SUBST ( TARGET_HAS_JIT ,1 ) ;;
461485 *) AC_SUBST ( TARGET_HAS_JIT ,0 ) ;;
462486 esac
463487fi
@@ -511,6 +535,21 @@ case "$enableval" in
511535 *) AC_MSG_ERROR ( [ Invalid setting for --enable-pthreads. Use "yes" or "no"] ) ;;
512536esac
513537
538+ dnl Allow disablement of zlib
539+ AC_ARG_ENABLE ( zlib ,
540+ AS_HELP_STRING ( [ --enable-zlib] ,
541+ [ Use zlib for compression/decompression if
542+ available (default is YES)] ) ,,
543+ enableval=default )
544+ case "$enableval" in
545+ yes) AC_SUBST ( LLVM_ENABLE_ZLIB ,[ 1] ) ;;
546+ no) AC_SUBST ( LLVM_ENABLE_ZLIB ,[ 0] ) ;;
547+ default) AC_SUBST ( LLVM_ENABLE_ZLIB ,[ 1] ) ;;
548+ *) AC_MSG_ERROR ( [ Invalid setting for --enable-zlib. Use "yes" or "no"] ) ;;
549+ esac
550+ AC_DEFINE_UNQUOTED ( [ LLVM_ENABLE_ZLIB] ,$LLVM_ENABLE_ZLIB ,
551+ [ Define if zlib is enabled] )
552+
514553dnl Allow building without position independent code
515554AC_ARG_ENABLE ( pic ,
516555 AS_HELP_STRING ( [ --enable-pic] ,
@@ -567,42 +606,46 @@ dnl Allow specific targets to be specified for building (or not)
567606TARGETS_TO_BUILD=""
568607AC_ARG_ENABLE ( [ targets] ,AS_HELP_STRING ( [ --enable-targets] ,
569608 [ Build specific host targets: all or target1,target2,... Valid targets are:
570- host, x86, x86_64, sparc, powerpc, arm, mips, spu , hexagon,
571- xcore, msp430, nvptx, cbe , and cpp (default=all)] ) ,,
609+ host, x86, x86_64, sparc, powerpc, arm, aarch64, mips , hexagon,
610+ xcore, msp430, nvptx, systemz, r600 , and cpp (default=all)] ) ,,
572611 enableval=all )
573612if test "$enableval" = host-only ; then
574613 enableval=host
575614fi
576615case "$enableval" in
577- all) TARGETS_TO_BUILD="X86 Sparc PowerPC ARM Mips CellSPU XCore MSP430 Hexagon CppBackend MBlaze NVPTX" ;;
616+ all) TARGETS_TO_BUILD="X86 Sparc PowerPC AArch64 ARM Mips XCore MSP430 CppBackend NVPTX Hexagon SystemZ R600 " ;;
578617 *)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
579618 case "$a_target" in
580619 x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
581620 x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
582621 sparc) TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;;
583622 powerpc) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;;
623+ aarch64) TARGETS_TO_BUILD="AArch64 $TARGETS_TO_BUILD" ;;
584624 arm) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
585625 mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
586- spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
626+ mipsel) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
627+ mips64) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
628+ mips64el) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
587629 xcore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
588630 msp430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
589- hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
590631 cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
591- mblaze ) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
632+ hexagon ) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
592633 nvptx) TARGETS_TO_BUILD="NVPTX $TARGETS_TO_BUILD" ;;
634+ systemz) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;;
635+ r600) TARGETS_TO_BUILD="R600 $TARGETS_TO_BUILD" ;;
593636 host) case "$llvm_cv_target_arch" in
594637 x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
595638 x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
596639 Sparc) TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;;
597640 PowerPC) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;;
641+ AArch64) TARGETS_TO_BUILD="AArch64 $TARGETS_TO_BUILD" ;;
598642 ARM) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
599643 Mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
600- MBlaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
601- CellSPU|SPU) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
602644 XCore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
603645 MSP430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
604646 Hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
605647 NVPTX) TARGETS_TO_BUILD="NVPTX $TARGETS_TO_BUILD" ;;
648+ SystemZ) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;;
606649 *) AC_MSG_ERROR ( [ Can not set target to build] ) ;;
607650 esac ;;
608651 *) AC_MSG_ERROR ( [ Unrecognized target $a_target] ) ;;
@@ -792,6 +835,17 @@ AC_ARG_WITH(bug-report-url,
792835AC_DEFINE_UNQUOTED ( BUG_REPORT_URL ,"$withval" ,
793836 [ Bug report URL.] )
794837
838+ dnl --enable-terminfo: check whether the user wants to control use of terminfo:
839+ AC_ARG_ENABLE ( terminfo ,AS_HELP_STRING (
840+ [ --enable-terminfo] ,
841+ [ Query the terminfo database if available (default is YES)] ) ,
842+ [ case "$enableval" in
843+ yes) llvm_cv_enable_terminfo="yes" ;;
844+ no) llvm_cv_enable_terminfo="no" ;;
845+ *) AC_MSG_ERROR ( [ Invalid setting for --enable-terminfo. Use "yes" or "no"] ) ;;
846+ esac] ,
847+ llvm_cv_enable_terminfo="yes" )
848+
795849dnl --enable-libffi : check whether the user wants to turn off libffi:
796850AC_ARG_ENABLE ( libffi ,AS_HELP_STRING (
797851 -- enable-libffi ,[ Check for the presence of libffi (default is NO)] ) ,
@@ -801,29 +855,6 @@ AC_ARG_ENABLE(libffi,AS_HELP_STRING(
801855 *) AC_MSG_ERROR ( [ Invalid setting for --enable-libffi. Use "yes" or "no"] ) ;;
802856 esac] ,
803857 llvm_cv_enable_libffi=no )
804-
805- dnl **************************************************************************
806- dnl * Set the location of various third-party software packages
807- dnl **************************************************************************
808-
809- dnl Specify the location of the poolalloc project
810- AC_ARG_WITH ( poolallocsrc ,
811- AS_HELP_STRING ( [ --with-poolallocsrc] ,
812- [ Specify location of Pool Allocation source code] ) ,
813- AC_SUBST ( poolallocsrc ,"$withval" ) ,
814- AC_SUBST ( poolallocsrc ,"$LLVM_SRC_ROOT/projects/poolalloc"
815- ) )
816-
817- AC_ARG_WITH ( poolallocobj ,
818- AS_HELP_STRING ( [ --with-poolallocobj] ,
819- [ Specify location of Pool Allocation object code] ) ,
820- AC_SUBST ( poolallocobj ,"$withval" ) ,
821- AC_SUBST ( poolallocobj ,"$LLVM_OBJ_ROOT/projects/poolalloc"
822- ) )
823-
824- dnl Ensure that all pathnames are absolute pathnames
825- poolallocsrc=`cd $poolallocsrc && pwd`
826- poolallocobj=`cd $poolallocobj && pwd`
827858
828859dnl ===-----------------------------------------------------------------------===
829860dnl ===
@@ -980,7 +1011,7 @@ AC_LINK_GET_VERSION
9801011dnl Determine whether the linker supports the -R option.
9811012AC_LINK_USE_R
9821013
983- dnl Determine whether the linker supports the -export-dynamic option.
1014+ dnl Determine whether the compiler supports the -rdynamic option.
9841015AC_LINK_EXPORT_DYNAMIC
9851016
9861017dnl Determine whether the linker supports the --version-script option.
@@ -1056,13 +1087,27 @@ AC_CHECK_LIB(m,sin)
10561087if test "$llvm_cv_os_type" = "MingW" ; then
10571088 AC_CHECK_LIB ( imagehlp , main )
10581089 AC_CHECK_LIB ( psapi , main )
1090+ AC_CHECK_LIB ( shell32 , main )
10591091fi
10601092
10611093dnl dlopen() is required for plugin support.
10621094AC_SEARCH_LIBS ( dlopen ,dl ,AC_DEFINE ( [ HAVE_DLOPEN] ,[ 1] ,
10631095 [ Define if dlopen() is available on this platform.] ) ,
10641096 AC_MSG_WARN ( [ dlopen() not found - disabling plugin support] ) )
10651097
1098+ dnl Search for the clock_gettime() function. Note that we rely on the POSIX
1099+ dnl macros to detect whether clock_gettime is available, this just finds the
1100+ dnl right libraries to link with.
1101+ AC_SEARCH_LIBS ( clock_gettime ,rt )
1102+
1103+ dnl The curses library is optional; used for querying terminal info
1104+ if test "$llvm_cv_enable_terminfo" = "yes" ; then
1105+ dnl We need the has_color functionality in curses for it to be useful.
1106+ AC_SEARCH_LIBS ( setupterm ,tinfo curses ncurses ncursesw ,
1107+ AC_DEFINE ( [ HAVE_TERMINFO] ,[ 1] ,
1108+ [ Define if the setupterm() function is supported this platform.] ) )
1109+ fi
1110+
10661111dnl libffi is optional; used to call external functions from the interpreter
10671112if test "$llvm_cv_enable_libffi" = "yes" ; then
10681113 AC_SEARCH_LIBS ( ffi_call ,ffi ,AC_DEFINE ( [ HAVE_FFI_CALL] ,[ 1] ,
@@ -1089,6 +1134,11 @@ if test "$ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then
10891134 [ Have pthread_getspecific] ) )
10901135fi
10911136
1137+ dnl zlib is optional; used for compression/uncompression
1138+ if test "$LLVM_ENABLE_ZLIB" -eq 1 ; then
1139+ AC_CHECK_LIB ( z , compress2 )
1140+ fi
1141+
10921142dnl Allow extra x86-disassembler library
10931143AC_ARG_WITH ( udis86 ,
10941144 AS_HELP_STRING ( [ --with-udis86=<path>] ,
@@ -1174,6 +1224,13 @@ if test "$ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then
11741224else
11751225 AC_SUBST ( HAVE_PTHREAD , 0 )
11761226fi
1227+ if test "$LLVM_ENABLE_ZLIB" -eq 1 ; then
1228+ AC_CHECK_HEADERS ( zlib.h ,
1229+ AC_SUBST ( HAVE_LIBZ , 1 ) ,
1230+ AC_SUBST ( HAVE_LIBZ , 0 ) )
1231+ else
1232+ AC_SUBST ( HAVE_LIBZ , 0 )
1233+ fi
11771234
11781235dnl Try to find ffi.h.
11791236if test "$llvm_cv_enable_libffi" = "yes" ; then
@@ -1356,7 +1413,6 @@ if test "${prefix}" = "NONE" ; then
13561413fi
13571414eval LLVM_PREFIX="${prefix}";
13581415eval LLVM_BINDIR="${prefix}/bin";
1359- eval LLVM_LIBDIR="${prefix}/lib";
13601416eval LLVM_DATADIR="${prefix}/share/llvm";
13611417eval LLVM_DOCSDIR="${prefix}/share/doc/llvm";
13621418eval LLVM_ETCDIR="${prefix}/etc/llvm";
@@ -1366,7 +1422,6 @@ eval LLVM_MANDIR="${prefix}/man";
13661422LLVM_CONFIGTIME=`date`
13671423AC_SUBST ( LLVM_PREFIX )
13681424AC_SUBST ( LLVM_BINDIR )
1369- AC_SUBST ( LLVM_LIBDIR )
13701425AC_SUBST ( LLVM_DATADIR )
13711426AC_SUBST ( LLVM_DOCSDIR )
13721427AC_SUBST ( LLVM_ETCDIR )
@@ -1381,8 +1436,6 @@ AC_DEFINE_UNQUOTED(LLVM_PREFIX,"$LLVM_PREFIX",
13811436 [ Installation prefix directory] )
13821437AC_DEFINE_UNQUOTED ( LLVM_BINDIR , "$LLVM_BINDIR" ,
13831438 [ Installation directory for binary executables] )
1384- AC_DEFINE_UNQUOTED ( LLVM_LIBDIR , "$LLVM_LIBDIR" ,
1385- [ Installation directory for libraries] )
13861439AC_DEFINE_UNQUOTED ( LLVM_DATADIR , "$LLVM_DATADIR" ,
13871440 [ Installation directory for data files] )
13881441AC_DEFINE_UNQUOTED ( LLVM_DOCSDIR , "$LLVM_DOCSDIR" ,
@@ -1440,7 +1493,7 @@ for a_binding in $BINDINGS_TO_BUILD ; do
14401493 AC_SUBST ( OCAML_LIBDIR ,$ocaml_stdlib )
14411494 else
14421495 # ocaml stdlib is outside our prefix; use libdir/ocaml
1443- AC_SUBST ( OCAML_LIBDIR ,$LLVM_LIBDIR /ocaml )
1496+ AC_SUBST ( OCAML_LIBDIR ,${prefix}/lib /ocaml )
14441497 fi
14451498 fi
14461499 ;;
@@ -1463,7 +1516,7 @@ AC_SUBST(RPATH)
14631516
14641517dnl Determine linker rdynamic flag
14651518if test "$llvm_cv_link_use_export_dynamic" = "yes" ; then
1466- RDYNAMIC="-Wl,-export-dynamic "
1519+ RDYNAMIC="-rdynamic "
14671520else
14681521 RDYNAMIC=""
14691522fi
@@ -1487,6 +1540,8 @@ dnl Configure project makefiles
14871540dnl List every Makefile that exists within your source tree
14881541AC_CONFIG_MAKEFILE(Makefile)
14891542AC_CONFIG_MAKEFILE(lib/Makefile)
1543+ AC_CONFIG_MAKEFILE(lib/AssistDS/Makefile)
1544+ AC_CONFIG_MAKEFILE(lib/DSA/Makefile)
14901545AC_CONFIG_MAKEFILE(lib/smack/Makefile)
14911546AC_CONFIG_MAKEFILE(tools/Makefile)
14921547AC_CONFIG_MAKEFILE(tools/smack/Makefile)
0 commit comments