Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 1 | dnl Initialize autoconf |
John Criswell | d000e1d | 2003-12-18 16:43:17 +0000 | [diff] [blame] | 2 | AC_INIT([[[LLVM]]],[[[1.1]]],[llvmbugs@cs.uiuc.edu]) |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 3 | |
| 4 | dnl Place all of the extra autoconf files into the config subdirectory |
| 5 | AC_CONFIG_AUX_DIR([autoconf]) |
| 6 | |
John Criswell | 93e1c72 | 2003-09-15 17:04:06 +0000 | [diff] [blame] | 7 | dnl Quit if the source directory has already been configured. |
John Criswell | 1b82432 | 2003-09-15 17:19:42 +0000 | [diff] [blame] | 8 | dnl NOTE: This relies upon undocumented autoconf behavior. |
| 9 | if test ${srcdir} != "." |
John Criswell | 93e1c72 | 2003-09-15 17:04:06 +0000 | [diff] [blame] | 10 | then |
John Criswell | 1b82432 | 2003-09-15 17:19:42 +0000 | [diff] [blame] | 11 | if test -f ${srcdir}/include/Config/config.h |
| 12 | then |
| 13 | AC_MSG_ERROR([Already configured in ${srcdir}]) |
| 14 | fi |
John Criswell | 93e1c72 | 2003-09-15 17:04:06 +0000 | [diff] [blame] | 15 | fi |
| 16 | |
John Criswell | 33a911a | 2003-11-25 20:36:46 +0000 | [diff] [blame] | 17 | dnl Configure all of the projects present in our source tree. |
John Criswell | 33a911a | 2003-11-25 20:36:46 +0000 | [diff] [blame] | 18 | for i in `ls ${srcdir}/projects` |
| 19 | do |
| 20 | if test ${i} != "CVS" |
| 21 | then |
John Criswell | 9493c97 | 2003-12-12 20:09:33 +0000 | [diff] [blame] | 22 | if test -f ${srcdir}/projects/${i}/configure |
John Criswell | 33a911a | 2003-11-25 20:36:46 +0000 | [diff] [blame] | 23 | then |
| 24 | AC_CONFIG_SUBDIRS(projects/${i}) |
| 25 | fi |
| 26 | fi |
| 27 | done |
John Criswell | 559a6c1 | 2003-09-30 16:31:48 +0000 | [diff] [blame] | 28 | |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 29 | dnl Configure a header file |
| 30 | AC_CONFIG_HEADERS(include/Config/config.h) |
John Criswell | 2d53308 | 2003-09-06 14:46:19 +0000 | [diff] [blame] | 31 | AC_CONFIG_MAKEFILE(Makefile) |
| 32 | AC_CONFIG_MAKEFILE(Makefile.common) |
John Criswell | 2d53308 | 2003-09-06 14:46:19 +0000 | [diff] [blame] | 33 | AC_CONFIG_MAKEFILE(lib/Makefile) |
John Criswell | 2d53308 | 2003-09-06 14:46:19 +0000 | [diff] [blame] | 34 | AC_CONFIG_MAKEFILE(runtime/Makefile) |
John Criswell | 2d53308 | 2003-09-06 14:46:19 +0000 | [diff] [blame] | 35 | AC_CONFIG_MAKEFILE(test/Makefile) |
| 36 | AC_CONFIG_MAKEFILE(test/Makefile.tests) |
John Criswell | f424d74 | 2003-10-07 21:13:47 +0000 | [diff] [blame] | 37 | AC_CONFIG_MAKEFILE(test/QMTest/llvm.py) |
| 38 | AC_CONFIG_MAKEFILE(test/QMTest/llvmdb.py) |
John Criswell | 2d53308 | 2003-09-06 14:46:19 +0000 | [diff] [blame] | 39 | AC_CONFIG_MAKEFILE(test/Programs/Makefile) |
| 40 | AC_CONFIG_MAKEFILE(test/Programs/Makefile.programs) |
| 41 | AC_CONFIG_MAKEFILE(test/Programs/TEST.aa.Makefile) |
| 42 | AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.report) |
| 43 | AC_CONFIG_MAKEFILE(test/Programs/TEST.micro.report) |
| 44 | AC_CONFIG_MAKEFILE(test/Programs/TEST.aa.report) |
| 45 | AC_CONFIG_MAKEFILE(test/Programs/TEST.example.Makefile) |
| 46 | AC_CONFIG_MAKEFILE(test/Programs/TEST.nightly.Makefile) |
| 47 | AC_CONFIG_MAKEFILE(test/Programs/TEST.buildrepo.Makefile) |
| 48 | AC_CONFIG_MAKEFILE(test/Programs/TEST.jit.Makefile) |
| 49 | AC_CONFIG_MAKEFILE(test/Programs/TEST.nightly.report) |
| 50 | AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.Makefile) |
| 51 | AC_CONFIG_MAKEFILE(test/Programs/TEST.jit.report) |
| 52 | AC_CONFIG_MAKEFILE(test/Programs/TEST.typesafe.Makefile) |
| 53 | AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.gnuplot) |
| 54 | AC_CONFIG_MAKEFILE(test/Programs/TEST.micro.Makefile) |
| 55 | AC_CONFIG_MAKEFILE(test/Programs/External/Makefile) |
| 56 | AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile) |
John Criswell | 27bb35e | 2003-09-11 18:04:00 +0000 | [diff] [blame] | 57 | AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec) |
John Criswell | 2d53308 | 2003-09-06 14:46:19 +0000 | [diff] [blame] | 58 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile) |
| 59 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile.multisrc) |
Misha Brukman | 960624b | 2003-11-12 22:16:23 +0000 | [diff] [blame] | 60 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/analyzer/test.in) |
Misha Brukman | 3e910fe | 2003-11-12 19:39:10 +0000 | [diff] [blame] | 61 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/Makefile) |
Misha Brukman | 960624b | 2003-11-12 22:16:23 +0000 | [diff] [blame] | 62 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/test.in) |
Misha Brukman | 3e910fe | 2003-11-12 19:39:10 +0000 | [diff] [blame] | 63 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/Makefile) |
Misha Brukman | 960624b | 2003-11-12 22:16:23 +0000 | [diff] [blame] | 64 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/test.in) |
Misha Brukman | 3e910fe | 2003-11-12 19:39:10 +0000 | [diff] [blame] | 65 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/Makefile) |
Misha Brukman | 960624b | 2003-11-12 22:16:23 +0000 | [diff] [blame] | 66 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/test.in) |
Misha Brukman | 3e910fe | 2003-11-12 19:39:10 +0000 | [diff] [blame] | 67 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/Makefile) |
Misha Brukman | 960624b | 2003-11-12 22:16:23 +0000 | [diff] [blame] | 68 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/test.in) |
Misha Brukman | 3e910fe | 2003-11-12 19:39:10 +0000 | [diff] [blame] | 69 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/Makefile) |
Misha Brukman | 960624b | 2003-11-12 22:16:23 +0000 | [diff] [blame] | 70 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/test.in) |
Misha Brukman | 3e910fe | 2003-11-12 19:39:10 +0000 | [diff] [blame] | 71 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/Makefile) |
Misha Brukman | 960624b | 2003-11-12 22:16:23 +0000 | [diff] [blame] | 72 | AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/test.in) |
John Criswell | 2d53308 | 2003-09-06 14:46:19 +0000 | [diff] [blame] | 73 | AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile) |
| 74 | AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile.singlesrc) |
John Criswell | 2d53308 | 2003-09-06 14:46:19 +0000 | [diff] [blame] | 75 | AC_CONFIG_MAKEFILE(tools/Makefile) |
Chris Lattner | 5c866e1 | 2003-10-06 02:09:25 +0000 | [diff] [blame] | 76 | AC_CONFIG_MAKEFILE(utils/Makefile) |
John Criswell | 2d53308 | 2003-09-06 14:46:19 +0000 | [diff] [blame] | 77 | AC_CONFIG_MAKEFILE(projects/Makefile) |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 78 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 79 | dnl Find the install program (needs to be done before canonical stuff) |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 80 | AC_PROG_INSTALL |
| 81 | |
| 82 | dnl Check which host for which we're compiling. This will tell us which LLVM |
| 83 | dnl compiler will be used for compiling SSA into object code. |
| 84 | AC_CANONICAL_TARGET |
| 85 | |
Brian Gaeke | 3e66e8b | 2003-11-17 00:30:48 +0000 | [diff] [blame] | 86 | dnl Set the "OS" Makefile variable based on the system we are building on. |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 87 | dnl We will use the build machine information to set some variables. |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 88 | case $build in |
Brian Gaeke | 3e66e8b | 2003-11-17 00:30:48 +0000 | [diff] [blame] | 89 | *-*-linux*) |
| 90 | AC_SUBST(OS,[Linux]) |
Brian Gaeke | 908647f | 2003-11-16 18:37:46 +0000 | [diff] [blame] | 91 | if test -d /home/vadve/lattner/local/x86/llvm-gcc |
| 92 | then |
| 93 | AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/]) |
| 94 | fi |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 95 | ;; |
| 96 | |
Brian Gaeke | 3e66e8b | 2003-11-17 00:30:48 +0000 | [diff] [blame] | 97 | *-*-solaris*) |
| 98 | AC_SUBST(OS,[SunOS]) |
Brian Gaeke | 908647f | 2003-11-16 18:37:46 +0000 | [diff] [blame] | 99 | if test -d /home/vadve/lattner/local/sparc/llvm-gcc |
| 100 | then |
| 101 | AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/]) |
| 102 | fi |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 103 | ;; |
| 104 | |
Brian Gaeke | 3e66e8b | 2003-11-17 00:30:48 +0000 | [diff] [blame] | 105 | *-*-darwin*) |
| 106 | AC_SUBST(OS,[Darwin]) |
| 107 | ;; |
| 108 | |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 109 | *) AC_SUBST(OS,[Unknown]) |
| 110 | ;; |
| 111 | esac |
| 112 | |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 113 | dnl If we are targetting a Sparc machine running Solaris, pretend that it is |
| 114 | dnl V9, since that is all that we support at the moment, and autoconf will only |
| 115 | dnl tell us we're a sparc. |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 116 | case $target in |
Brian Gaeke | 3e66e8b | 2003-11-17 00:30:48 +0000 | [diff] [blame] | 117 | sparc*-*-solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]]) |
| 118 | ;; |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 119 | esac |
| 120 | |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 121 | dnl Determine what our target architecture is and configure accordingly. |
| 122 | dnl This will allow Makefiles to make a distinction between the hardware and |
| 123 | dnl the OS. |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 124 | case $target in |
Brian Gaeke | 3e66e8b | 2003-11-17 00:30:48 +0000 | [diff] [blame] | 125 | i*86-*) AC_SUBST(ARCH,[x86]) |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 126 | ;; |
Brian Gaeke | 3e66e8b | 2003-11-17 00:30:48 +0000 | [diff] [blame] | 127 | sparc*-*) AC_SUBST(ARCH,[Sparc]) |
| 128 | ;; |
| 129 | powerpc*-*) AC_SUBST(ARCH,[PowerPC]) |
| 130 | ;; |
| 131 | *) AC_SUBST(ARCH,[Unknown]) |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 132 | ;; |
| 133 | esac |
| 134 | |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 135 | dnl Check for compilation tools |
| 136 | AC_PROG_CXX |
| 137 | AC_PROG_CC(gcc) |
| 138 | AC_PROG_CPP |
| 139 | |
| 140 | dnl Ensure that compilation tools are GCC; we use GCC specific extensions |
| 141 | if test "$GCC" != "yes" |
| 142 | then |
| 143 | AC_MSG_ERROR([gcc required but not found]) |
| 144 | fi |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 145 | if test "$GXX" != "yes" |
| 146 | then |
| 147 | AC_MSG_ERROR([g++ required but not found]) |
| 148 | fi |
| 149 | |
John Criswell | de00db2 | 2003-08-25 16:49:54 +0000 | [diff] [blame] | 150 | dnl Verify that GCC is version 3.0 or higher |
| 151 | gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1` |
| 152 | if test "$gccmajor" -lt "3" |
| 153 | then |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 154 | AC_MSG_ERROR([gcc 3.x required, but you have a lower version]) |
John Criswell | de00db2 | 2003-08-25 16:49:54 +0000 | [diff] [blame] | 155 | fi |
| 156 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 157 | dnl Check for GNU Make. We use its extensions too, so don't build without it |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 158 | CHECK_GNU_MAKE |
| 159 | if test -z "$_cv_gnu_make_command" |
| 160 | then |
| 161 | AC_MSG_ERROR([GNU Make required but not found]) |
| 162 | fi |
| 163 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 164 | dnl Checks for other tools |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 165 | AC_PROG_FLEX |
| 166 | AC_PROG_BISON |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 167 | AC_PROG_LIBTOOL |
| 168 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 169 | dnl Checks for tools we can get away with not having: |
| 170 | AC_PATH_PROG(DOT,[dot],[true dot]) |
| 171 | AC_PATH_PROG(ETAGS,[etags],[true etags]) |
| 172 | AC_PATH_PROG(PYTHON,[python],[true python]) |
| 173 | if test "$PYTHON" = "false" |
John Criswell | 39827c8 | 2003-09-23 15:28:52 +0000 | [diff] [blame] | 174 | then |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 175 | AC_MSG_WARN([Python is required for the test suite, but it was not found]) |
John Criswell | 39827c8 | 2003-09-23 15:28:52 +0000 | [diff] [blame] | 176 | fi |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 177 | AC_PATH_PROG(QMTEST,[qmtest],[true qmtest]) |
| 178 | if test "$QMTEST" = "false" |
John Criswell | 39827c8 | 2003-09-23 15:28:52 +0000 | [diff] [blame] | 179 | then |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 180 | AC_MSG_WARN([QMTest is required for the test suite, but it was not found]) |
John Criswell | 39827c8 | 2003-09-23 15:28:52 +0000 | [diff] [blame] | 181 | fi |
John Criswell | de00db2 | 2003-08-25 16:49:54 +0000 | [diff] [blame] | 182 | |
| 183 | dnl Verify that the version of python available is high enough for qmtest |
| 184 | pyversion=`$PYTHON -V 2>&1 | cut -d\ -f2` |
| 185 | pymajor=`echo $pyversion | cut -d. -f1` |
| 186 | pyminor=`echo $pyversion | cut -d. -f2` |
| 187 | |
| 188 | if test "$pymajor" -ge "2" |
| 189 | then |
| 190 | if test "$pymajor" -eq "2" |
| 191 | then |
| 192 | if test "$pyminor" -lt "2" |
| 193 | then |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 194 | AC_MSG_WARN([QMTest requires Python 2.2 or later]) |
John Criswell | de00db2 | 2003-08-25 16:49:54 +0000 | [diff] [blame] | 195 | fi |
| 196 | fi |
| 197 | else |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 198 | AC_MSG_WARN([QMTest requires Python 2.2 or later]) |
John Criswell | de00db2 | 2003-08-25 16:49:54 +0000 | [diff] [blame] | 199 | fi |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 200 | |
| 201 | dnl Verify that the source directory is valid |
| 202 | AC_CONFIG_SRCDIR(["Makefile.config.in"]) |
| 203 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 204 | dnl Checks for libraries: |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 205 | dnl libelf is for sparc only; we can ignore it if we don't have it |
| 206 | AC_CHECK_LIB(elf, elf_begin) |
| 207 | |
Brian Gaeke | 4c42378 | 2003-10-07 05:03:36 +0000 | [diff] [blame] | 208 | dnl dlopen() is required for plugin support. |
Brian Gaeke | a25d7ca | 2003-10-08 21:44:07 +0000 | [diff] [blame] | 209 | AC_SEARCH_LIBS(dlopen,dl,AC_DEFINE([HAVE_DLOPEN],[1],[Define if dlopen() is available on this platform.]),AC_MSG_WARN([dlopen() not found - disabling plugin support])) |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 210 | |
| 211 | dnl mallinfo is optional; the code can compile (minus features) without it |
Brian Gaeke | a25d7ca | 2003-10-08 21:44:07 +0000 | [diff] [blame] | 212 | AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo() is available on this platform.])) |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 213 | |
Brian Gaeke | 5f268f7 | 2003-12-05 19:29:01 +0000 | [diff] [blame] | 214 | dnl pthread locking functions are optional - but llvm will not be thread-safe |
| 215 | dnl without locks. |
| 216 | AC_SEARCH_LIBS(pthread_mutex_lock,pthread,AC_DEFINE(HAVE_PTHREAD_MUTEX_LOCK,1,[Define if PThread mutexes (e.g., pthread_mutex_lock) are available in the system's thread library.])) |
| 217 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 218 | dnl Checks for header files. |
| 219 | dnl We don't check for ancient stuff or things that are guaranteed to be there |
| 220 | dnl by the C++ standard. We always use the <cfoo> versions of <foo.h> C headers. |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 221 | AC_HEADER_STDC |
| 222 | AC_HEADER_SYS_WAIT |
| 223 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 224 | dnl Checks for POSIX and other various system-specific header files |
| 225 | AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h malloc.h sys/mman.h sys/resource.h dlfcn.h link.h) |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 226 | |
| 227 | dnl Check for machine endian-ness |
Brian Gaeke | a25d7ca | 2003-10-08 21:44:07 +0000 | [diff] [blame] | 228 | AC_C_BIGENDIAN(AC_DEFINE([ENDIAN_BIG],[],[Define if the machine is Big-Endian]),AC_DEFINE([ENDIAN_LITTLE],[],[Define if the machine is Little-Endian])) |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 229 | |
| 230 | dnl Check for types |
| 231 | AC_TYPE_PID_T |
| 232 | AC_TYPE_SIZE_T |
| 233 | AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found])) |
| 234 | AC_CHECK_TYPES([uint64_t],,AC_MSG_ERROR([Type uint64_t required but not found])) |
| 235 | AC_HEADER_TIME |
| 236 | AC_STRUCT_TM |
| 237 | |
John Criswell | a0137d3 | 2003-10-13 16:22:01 +0000 | [diff] [blame] | 238 | dnl Check for various C features |
| 239 | AC_C_PRINTF_A |
| 240 | |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 241 | dnl Check for C++ extensions |
Brian Gaeke | 278a4ac | 2003-11-10 03:06:09 +0000 | [diff] [blame] | 242 | AC_CXX_HAVE_HASH_MAP |
| 243 | AC_CXX_HAVE_HASH_SET |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 244 | AC_CXX_HAVE_EXT_SLIST |
| 245 | AC_CXX_HAVE_STD_ITERATOR |
| 246 | AC_CXX_HAVE_BI_ITERATOR |
| 247 | AC_CXX_HAVE_FWD_ITERATOR |
| 248 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 249 | dnl Checks for library functions. |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 250 | AC_FUNC_ALLOCA |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 251 | AC_FUNC_MMAP |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 252 | if test "$ac_cv_func_mmap_fixed_mapped" = "no" |
| 253 | then |
| 254 | AC_MSG_ERROR([mmap() required but not found]) |
| 255 | fi |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 256 | AC_FUNC_MMAP_FILE |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 257 | if test "$ac_cv_func_mmap_file" = "no" |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 258 | then |
| 259 | AC_MSG_ERROR([mmap() of files required but not found]) |
| 260 | fi |
| 261 | AC_HEADER_MMAP_ANONYMOUS |
| 262 | AC_TYPE_SIGNAL |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 263 | AC_CHECK_FUNCS(getcwd gettimeofday strdup strtoq strtoll) |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 264 | AC_CHECK_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found])) |
| 265 | |
John Criswell | cb7a1eb | 2003-11-17 19:46:02 +0000 | [diff] [blame] | 266 | dnl Determine if the linker supports the -R option. |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 267 | AC_LINK_USE_R |
John Criswell | cb7a1eb | 2003-11-17 19:46:02 +0000 | [diff] [blame] | 268 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 269 | dnl --enable/--with command-line options: |
| 270 | dnl Check whether they want to do an optimized build: |
John Criswell | 79a8f09 | 2003-07-22 20:59:52 +0000 | [diff] [blame] | 271 | AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]),,enableval=no) |
| 272 | if test ${enableval} = "no" |
| 273 | then |
| 274 | AC_SUBST(ENABLE_OPTIMIZED,[[]]) |
| 275 | else |
| 276 | AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]]) |
| 277 | fi |
| 278 | |
| 279 | dnl Spec Benchmarks |
Alkis Evlogimenos | 3e58e48 | 2003-12-20 21:35:15 +0000 | [diff] [blame] | 280 | AC_ARG_ENABLE(spec2000,AC_HELP_STRING([--enable-spec2000],[Compile SPEC 2000 benchmarks (default is NO)]),,enableval=no) |
John Criswell | 79a8f09 | 2003-07-22 20:59:52 +0000 | [diff] [blame] | 281 | if test ${enableval} = "no" |
| 282 | then |
John Criswell | 5512659 | 2003-10-07 21:57:39 +0000 | [diff] [blame] | 283 | if test -d /home/vadve/shared/benchmarks/speccpu2000/benchspec |
| 284 | then |
| 285 | AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec]) |
| 286 | AC_SUBST(USE_SPEC,[[USE_SPEC=1]]) |
| 287 | else |
| 288 | AC_SUBST(USE_SPEC,[[]]) |
| 289 | AC_SUBST(SPEC_ROOT,[]) |
| 290 | fi |
John Criswell | 79a8f09 | 2003-07-22 20:59:52 +0000 | [diff] [blame] | 291 | else |
John Criswell | 5512659 | 2003-10-07 21:57:39 +0000 | [diff] [blame] | 292 | if test ${enableval} = "" |
| 293 | then |
| 294 | AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec]) |
| 295 | else |
| 296 | AC_SUBST(SPEC_ROOT,[${enableval}]) |
| 297 | fi |
John Criswell | 79a8f09 | 2003-07-22 20:59:52 +0000 | [diff] [blame] | 298 | AC_SUBST(USE_SPEC,[[USE_SPEC=1]]) |
| 299 | fi |
| 300 | |
| 301 | dnl Precompiled Bytecode Option |
| 302 | AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]),,enableval=no) |
| 303 | if test ${enableval} = "no" |
| 304 | then |
| 305 | AC_SUBST(UPB,[[]]) |
| 306 | else |
| 307 | AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]]) |
| 308 | fi |
| 309 | |
John Criswell | 79a8f09 | 2003-07-22 20:59:52 +0000 | [diff] [blame] | 310 | dnl LLC Diff Option |
| 311 | AC_ARG_ENABLE(llc_diffs,AC_HELP_STRING([--enable-llc_diffs],[Enable LLC Diffs when testing (default is YES)]),,enableval=yes) |
| 312 | if test ${enableval} = "no" |
| 313 | then |
| 314 | AC_SUBST(DISABLE_LLC_DIFFS,[DISABLE_LLC_DIFFS:=1]) |
| 315 | else |
| 316 | AC_SUBST(DISABLE_LLC_DIFFS,[[]]) |
| 317 | fi |
| 318 | |
| 319 | dnl JIT Option |
John Criswell | c78022e | 2003-07-29 19:11:58 +0000 | [diff] [blame] | 320 | AC_ARG_ENABLE(jit,AC_HELP_STRING([--enable-jit],[Enable Just In Time Compiling (default is YES)]),,enableval=default) |
John Criswell | 79a8f09 | 2003-07-22 20:59:52 +0000 | [diff] [blame] | 321 | if test ${enableval} = "no" |
| 322 | then |
| 323 | AC_SUBST(JIT,[[]]) |
| 324 | else |
John Criswell | c78022e | 2003-07-29 19:11:58 +0000 | [diff] [blame] | 325 | case $target in |
| 326 | *i*86*) |
| 327 | AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) |
| 328 | ;; |
| 329 | *sparc*) |
| 330 | AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) |
| 331 | ;; |
| 332 | *) |
| 333 | AC_SUBST(JIT,[[]]) |
| 334 | ;; |
| 335 | esac |
John Criswell | 79a8f09 | 2003-07-22 20:59:52 +0000 | [diff] [blame] | 336 | fi |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 337 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 338 | dnl Find the LLVM GCC-based C/C++ front end |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 339 | AC_ARG_WITH(llvmgccdir,AC_HELP_STRING([--with-llvmgccdir],[Location of LLVM GCC front-end]),AC_SUBST(LLVMGCCDIR,[$withval])) |
Brian Gaeke | 908647f | 2003-11-16 18:37:46 +0000 | [diff] [blame] | 340 | AC_MSG_CHECKING([for llvm-gcc]) |
| 341 | LLVM_GCC_CHECK=no |
| 342 | if test -d "$LLVMGCCDIR" |
| 343 | then |
| 344 | if test -x "$LLVMGCCDIR/bin/gcc" |
| 345 | then |
| 346 | LLVM_GCC_CHECK="$LLVMGCCDIR/bin/gcc" |
| 347 | fi |
| 348 | fi |
| 349 | llvmgccwarn=no |
| 350 | AC_MSG_RESULT($LLVM_GCC_CHECK) |
| 351 | if test "$LLVM_GCC_CHECK" = "no" |
| 352 | then |
| 353 | llvmgccwarn=yes |
| 354 | fi |
Brian Gaeke | 908647f | 2003-11-16 18:37:46 +0000 | [diff] [blame] | 355 | AC_MSG_CHECKING([whether llvm-gcc is sane]) |
| 356 | LLVM_GCC_SANE=no |
| 357 | if test -x "$LLVM_GCC_CHECK" |
| 358 | then |
| 359 | cp /dev/null conftest.c |
| 360 | "$LLVM_GCC_CHECK" -S -o - conftest.c | grep implementation > /dev/null 2>&1 |
| 361 | if test $? -eq 0 |
| 362 | then |
| 363 | LLVM_GCC_SANE=yes |
| 364 | fi |
| 365 | rm conftest.c |
| 366 | fi |
| 367 | AC_MSG_RESULT($LLVM_GCC_SANE) |
| 368 | if test "$LLVM_GCC_SANE" = "no" |
| 369 | then |
| 370 | llvmgccwarn=yes |
| 371 | fi |
| 372 | |
John Criswell | c78022e | 2003-07-29 19:11:58 +0000 | [diff] [blame] | 373 | dnl Location of the bytecode repository |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 374 | AC_ARG_WITH(bcrepos,AC_HELP_STRING([--with-bcrepos],[Location of Bytecode Repository]),AC_SUBST(BCR,[$withval]),AC_SUBST(BCR,[/home/vadve/lattner/LLVMPrograms])) |
John Criswell | c78022e | 2003-07-29 19:11:58 +0000 | [diff] [blame] | 375 | |
| 376 | dnl Location of PAPI |
Chris Lattner | 1b9ddd5 | 2003-08-14 18:59:53 +0000 | [diff] [blame] | 377 | AC_ARG_WITH(papi,AC_HELP_STRING([--with-papi],[Location of PAPI]),AC_SUBST(PAPIDIR,[$withval]),AC_SUBST(PAPIDIR,[/home/vadve/shared/Sparc/papi-2.3.4.1])) |
John Criswell | c78022e | 2003-07-29 19:11:58 +0000 | [diff] [blame] | 378 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 379 | dnl Create the output files |
John Criswell | 4ea390d | 2003-07-22 19:13:20 +0000 | [diff] [blame] | 380 | AC_OUTPUT(Makefile.config) |
Brian Gaeke | 908647f | 2003-11-16 18:37:46 +0000 | [diff] [blame] | 381 | |
Brian Gaeke | 26be9c5 | 2004-01-13 06:43:16 +0000 | [diff] [blame^] | 382 | dnl Warn loudly if llvm-gcc was not obviously working |
Brian Gaeke | 908647f | 2003-11-16 18:37:46 +0000 | [diff] [blame] | 383 | if test $llvmgccwarn = yes |
| 384 | then |
| 385 | AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not]) |
| 386 | AC_MSG_WARN([***** appear to be working.]) |
| 387 | AC_MSG_WARN([***** ]) |
| 388 | AC_MSG_WARN([***** Please check configure's --with-llvmgccdir option.]) |
| 389 | AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,]) |
| 390 | AC_MSG_WARN([***** but you should be able to build the llvm tools.]) |
| 391 | fi |