blob: 8b4aef57887bb85b5a3ea21dd38f8a8fe93d648c [file] [log] [blame]
Brian Gaeke26be9c52004-01-13 06:43:16 +00001dnl Initialize autoconf
Chris Lattnerac847282004-04-14 16:32:34 +00002AC_INIT([[[LLVM]]],[[[1.3]]],[llvmbugs@cs.uiuc.edu])
John Criswell4ea390d2003-07-22 19:13:20 +00003
4dnl Place all of the extra autoconf files into the config subdirectory
5AC_CONFIG_AUX_DIR([autoconf])
6
John Criswell93e1c722003-09-15 17:04:06 +00007dnl Quit if the source directory has already been configured.
John Criswell1b824322003-09-15 17:19:42 +00008dnl NOTE: This relies upon undocumented autoconf behavior.
9if test ${srcdir} != "."
John Criswell93e1c722003-09-15 17:04:06 +000010then
John Criswell1b824322003-09-15 17:19:42 +000011 if test -f ${srcdir}/include/Config/config.h
12 then
13 AC_MSG_ERROR([Already configured in ${srcdir}])
14 fi
John Criswell93e1c722003-09-15 17:04:06 +000015fi
16
John Criswell33a911a2003-11-25 20:36:46 +000017dnl Configure all of the projects present in our source tree.
John Criswell33a911a2003-11-25 20:36:46 +000018for i in `ls ${srcdir}/projects`
19do
20 if test ${i} != "CVS"
21 then
John Criswell9493c972003-12-12 20:09:33 +000022 if test -f ${srcdir}/projects/${i}/configure
John Criswell33a911a2003-11-25 20:36:46 +000023 then
24 AC_CONFIG_SUBDIRS(projects/${i})
25 fi
26 fi
27done
John Criswell559a6c12003-09-30 16:31:48 +000028
John Criswell4ea390d2003-07-22 19:13:20 +000029dnl Configure a header file
30AC_CONFIG_HEADERS(include/Config/config.h)
John Criswell2d533082003-09-06 14:46:19 +000031AC_CONFIG_MAKEFILE(Makefile)
32AC_CONFIG_MAKEFILE(Makefile.common)
John Criswell2d533082003-09-06 14:46:19 +000033AC_CONFIG_MAKEFILE(lib/Makefile)
John Criswell2d533082003-09-06 14:46:19 +000034AC_CONFIG_MAKEFILE(runtime/Makefile)
John Criswell2d533082003-09-06 14:46:19 +000035AC_CONFIG_MAKEFILE(test/Makefile)
36AC_CONFIG_MAKEFILE(test/Makefile.tests)
John Criswellf424d742003-10-07 21:13:47 +000037AC_CONFIG_MAKEFILE(test/QMTest/llvm.py)
38AC_CONFIG_MAKEFILE(test/QMTest/llvmdb.py)
John Criswell2d533082003-09-06 14:46:19 +000039AC_CONFIG_MAKEFILE(test/Programs/Makefile)
40AC_CONFIG_MAKEFILE(test/Programs/Makefile.programs)
41AC_CONFIG_MAKEFILE(test/Programs/TEST.aa.Makefile)
42AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.report)
John Criswell2d533082003-09-06 14:46:19 +000043AC_CONFIG_MAKEFILE(test/Programs/TEST.aa.report)
44AC_CONFIG_MAKEFILE(test/Programs/TEST.example.Makefile)
45AC_CONFIG_MAKEFILE(test/Programs/TEST.nightly.Makefile)
46AC_CONFIG_MAKEFILE(test/Programs/TEST.buildrepo.Makefile)
47AC_CONFIG_MAKEFILE(test/Programs/TEST.jit.Makefile)
48AC_CONFIG_MAKEFILE(test/Programs/TEST.nightly.report)
49AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.Makefile)
50AC_CONFIG_MAKEFILE(test/Programs/TEST.jit.report)
51AC_CONFIG_MAKEFILE(test/Programs/TEST.typesafe.Makefile)
52AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.gnuplot)
John Criswell878be7d2004-02-24 21:43:38 +000053AC_CONFIG_MAKEFILE(test/Programs/TEST.vtl.Makefile)
John Criswell2d533082003-09-06 14:46:19 +000054AC_CONFIG_MAKEFILE(test/Programs/External/Makefile)
55AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile)
John Criswell27bb35e2003-09-11 18:04:00 +000056AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec)
Alkis Evlogimenos271143f2004-02-26 04:14:10 +000057AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec2000)
John Criswellb607cc82004-02-10 22:29:06 +000058AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec95)
John Criswell2d533082003-09-06 14:46:19 +000059AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile)
60AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile.multisrc)
Misha Brukman960624b2003-11-12 22:16:23 +000061AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/analyzer/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000062AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000063AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000064AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000065AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000066AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000067AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000068AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000069AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000070AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000071AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000072AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000073AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/test.in)
John Criswell2d533082003-09-06 14:46:19 +000074AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile)
75AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile.singlesrc)
Alkis Evlogimenos271143f2004-02-26 04:14:10 +000076AC_CONFIG_MAKEFILE(test/Programs/SingleSource/UnitTests/SetjmpLongjmp/Makefile)
John Criswell2d533082003-09-06 14:46:19 +000077AC_CONFIG_MAKEFILE(tools/Makefile)
Chris Lattner5c866e12003-10-06 02:09:25 +000078AC_CONFIG_MAKEFILE(utils/Makefile)
John Criswell2d533082003-09-06 14:46:19 +000079AC_CONFIG_MAKEFILE(projects/Makefile)
John Criswell4ea390d2003-07-22 19:13:20 +000080
Brian Gaeke26be9c52004-01-13 06:43:16 +000081dnl Find the install program (needs to be done before canonical stuff)
John Criswell4ea390d2003-07-22 19:13:20 +000082AC_PROG_INSTALL
83
84dnl Check which host for which we're compiling. This will tell us which LLVM
85dnl compiler will be used for compiling SSA into object code.
86AC_CANONICAL_TARGET
87
Brian Gaeke3e66e8b2003-11-17 00:30:48 +000088dnl Set the "OS" Makefile variable based on the system we are building on.
John Criswell4ea390d2003-07-22 19:13:20 +000089dnl We will use the build machine information to set some variables.
John Criswell4ea390d2003-07-22 19:13:20 +000090case $build in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +000091 *-*-linux*)
92 AC_SUBST(OS,[Linux])
Brian Gaeke908647f2003-11-16 18:37:46 +000093 if test -d /home/vadve/lattner/local/x86/llvm-gcc
94 then
95 AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/])
96 fi
John Criswell4ea390d2003-07-22 19:13:20 +000097 ;;
98
Brian Gaeke3e66e8b2003-11-17 00:30:48 +000099 *-*-solaris*)
100 AC_SUBST(OS,[SunOS])
Brian Gaeke908647f2003-11-16 18:37:46 +0000101 if test -d /home/vadve/lattner/local/sparc/llvm-gcc
102 then
103 AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/])
104 fi
John Criswell4ea390d2003-07-22 19:13:20 +0000105 ;;
106
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000107 *-*-darwin*)
108 AC_SUBST(OS,[Darwin])
109 ;;
110
John Criswell4ea390d2003-07-22 19:13:20 +0000111 *) AC_SUBST(OS,[Unknown])
112 ;;
113esac
114
John Criswell4ea390d2003-07-22 19:13:20 +0000115dnl If we are targetting a Sparc machine running Solaris, pretend that it is
116dnl V9, since that is all that we support at the moment, and autoconf will only
117dnl tell us we're a sparc.
John Criswell4ea390d2003-07-22 19:13:20 +0000118case $target in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000119 sparc*-*-solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]])
120 ;;
John Criswell4ea390d2003-07-22 19:13:20 +0000121esac
122
John Criswell4ea390d2003-07-22 19:13:20 +0000123dnl Determine what our target architecture is and configure accordingly.
124dnl This will allow Makefiles to make a distinction between the hardware and
125dnl the OS.
John Criswell4ea390d2003-07-22 19:13:20 +0000126case $target in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000127 i*86-*) AC_SUBST(ARCH,[x86])
John Criswell4ea390d2003-07-22 19:13:20 +0000128 ;;
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000129 sparc*-*) AC_SUBST(ARCH,[Sparc])
130 ;;
131 powerpc*-*) AC_SUBST(ARCH,[PowerPC])
132 ;;
133 *) AC_SUBST(ARCH,[Unknown])
John Criswell4ea390d2003-07-22 19:13:20 +0000134 ;;
135esac
136
John Criswell4ea390d2003-07-22 19:13:20 +0000137dnl Check for compilation tools
138AC_PROG_CXX
139AC_PROG_CC(gcc)
140AC_PROG_CPP
141
142dnl Ensure that compilation tools are GCC; we use GCC specific extensions
143if test "$GCC" != "yes"
144then
145 AC_MSG_ERROR([gcc required but not found])
146fi
John Criswell4ea390d2003-07-22 19:13:20 +0000147if test "$GXX" != "yes"
148then
149 AC_MSG_ERROR([g++ required but not found])
150fi
151
John Criswellde00db22003-08-25 16:49:54 +0000152dnl Verify that GCC is version 3.0 or higher
153gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1`
154if test "$gccmajor" -lt "3"
155then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000156 AC_MSG_ERROR([gcc 3.x required, but you have a lower version])
John Criswellde00db22003-08-25 16:49:54 +0000157fi
158
Brian Gaeke26be9c52004-01-13 06:43:16 +0000159dnl Check for GNU Make. We use its extensions too, so don't build without it
John Criswell4ea390d2003-07-22 19:13:20 +0000160CHECK_GNU_MAKE
161if test -z "$_cv_gnu_make_command"
162then
163 AC_MSG_ERROR([GNU Make required but not found])
164fi
165
Brian Gaeke26be9c52004-01-13 06:43:16 +0000166dnl Checks for other tools
John Criswell4ea390d2003-07-22 19:13:20 +0000167AC_PROG_FLEX
168AC_PROG_BISON
John Criswell4ea390d2003-07-22 19:13:20 +0000169AC_PROG_LIBTOOL
170
Brian Gaeke26be9c52004-01-13 06:43:16 +0000171dnl Checks for tools we can get away with not having:
172AC_PATH_PROG(DOT,[dot],[true dot])
173AC_PATH_PROG(ETAGS,[etags],[true etags])
Brian Gaeke027b7462004-01-22 21:55:15 +0000174dnl Check if we know how to tell etags we are using C++:
175etags_version=`$ETAGS --version 2>&1`
176case "$etags_version" in
177 *[Ee]xuberant*) ETAGSFLAGS="--language-force=c++" ;;
178 *GNU\ Emacs*) ETAGSFLAGS="-l c++" ;;
179 *) ETAGSFLAGS="" ;;
180esac
181AC_SUBST(ETAGSFLAGS,$ETAGSFLAGS)
Brian Gaeke26be9c52004-01-13 06:43:16 +0000182AC_PATH_PROG(PYTHON,[python],[true python])
183if test "$PYTHON" = "false"
John Criswell39827c82003-09-23 15:28:52 +0000184then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000185 AC_MSG_WARN([Python is required for the test suite, but it was not found])
John Criswell39827c82003-09-23 15:28:52 +0000186fi
Brian Gaeke26be9c52004-01-13 06:43:16 +0000187AC_PATH_PROG(QMTEST,[qmtest],[true qmtest])
188if test "$QMTEST" = "false"
John Criswell39827c82003-09-23 15:28:52 +0000189then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000190 AC_MSG_WARN([QMTest is required for the test suite, but it was not found])
John Criswell39827c82003-09-23 15:28:52 +0000191fi
John Criswellde00db22003-08-25 16:49:54 +0000192
193dnl Verify that the version of python available is high enough for qmtest
194pyversion=`$PYTHON -V 2>&1 | cut -d\ -f2`
195pymajor=`echo $pyversion | cut -d. -f1`
196pyminor=`echo $pyversion | cut -d. -f2`
197
198if test "$pymajor" -ge "2"
199then
200 if test "$pymajor" -eq "2"
201 then
202 if test "$pyminor" -lt "2"
203 then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000204 AC_MSG_WARN([QMTest requires Python 2.2 or later])
John Criswellde00db22003-08-25 16:49:54 +0000205 fi
206 fi
207else
Brian Gaeke26be9c52004-01-13 06:43:16 +0000208 AC_MSG_WARN([QMTest requires Python 2.2 or later])
John Criswellde00db22003-08-25 16:49:54 +0000209fi
John Criswell4ea390d2003-07-22 19:13:20 +0000210
211dnl Verify that the source directory is valid
212AC_CONFIG_SRCDIR(["Makefile.config.in"])
213
Brian Gaeke26be9c52004-01-13 06:43:16 +0000214dnl Checks for libraries:
John Criswell4ea390d2003-07-22 19:13:20 +0000215dnl libelf is for sparc only; we can ignore it if we don't have it
216AC_CHECK_LIB(elf, elf_begin)
217
Brian Gaeke4c423782003-10-07 05:03:36 +0000218dnl dlopen() is required for plugin support.
Brian Gaekea25d7ca2003-10-08 21:44:07 +0000219AC_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 Criswell4ea390d2003-07-22 19:13:20 +0000220
221dnl mallinfo is optional; the code can compile (minus features) without it
Brian Gaekea25d7ca2003-10-08 21:44:07 +0000222AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo() is available on this platform.]))
John Criswell4ea390d2003-07-22 19:13:20 +0000223
Brian Gaeke5f268f72003-12-05 19:29:01 +0000224dnl pthread locking functions are optional - but llvm will not be thread-safe
225dnl without locks.
Brian Gaeke2e3bdba2004-02-23 21:30:36 +0000226AC_SEARCH_LIBS(pthread_mutex_lock,pthread,HAVE_PTHREAD_MUTEX_LOCK=1,HAVE_PTHREAD_MUTEX_LOCK=0)
227AC_SUBST(HAVE_PTHREAD_MUTEX_LOCK)
Brian Gaeke5f268f72003-12-05 19:29:01 +0000228
Brian Gaeke26be9c52004-01-13 06:43:16 +0000229dnl Checks for header files.
230dnl We don't check for ancient stuff or things that are guaranteed to be there
231dnl by the C++ standard. We always use the <cfoo> versions of <foo.h> C headers.
John Criswell4ea390d2003-07-22 19:13:20 +0000232AC_HEADER_STDC
233AC_HEADER_SYS_WAIT
234
Brian Gaeke26be9c52004-01-13 06:43:16 +0000235dnl Checks for POSIX and other various system-specific header files
Brian Gaeke22f76462004-02-20 06:41:59 +0000236AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h malloc.h sys/mman.h sys/resource.h dlfcn.h link.h execinfo.h)
John Criswell4ea390d2003-07-22 19:13:20 +0000237
Brian Gaeke1133eaf2004-02-23 22:07:01 +0000238dnl Check for things that need to be included in public headers, and so
239dnl for which we may not have access to a HAVE_* preprocessor #define.
240dnl (primarily used in DataTypes.h)
241AC_CHECK_HEADER([sys/types.h],
242 [INCLUDE_SYS_TYPES_H='#include <sys/types.h>'],
243 [INCLUDE_SYS_TYPES_H=''])
244AC_SUBST(INCLUDE_SYS_TYPES_H)
245AC_CHECK_HEADER([inttypes.h],
246 [INCLUDE_INTTYPES_H='#include <inttypes.h>'],
247 [INCLUDE_INTTYPES_H=''])
248AC_SUBST(INCLUDE_INTTYPES_H)
249
John Criswell4ea390d2003-07-22 19:13:20 +0000250dnl Check for types
251AC_TYPE_PID_T
252AC_TYPE_SIZE_T
253AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found]))
254AC_CHECK_TYPES([uint64_t],,AC_MSG_ERROR([Type uint64_t required but not found]))
255AC_HEADER_TIME
256AC_STRUCT_TM
257
John Criswella0137d32003-10-13 16:22:01 +0000258dnl Check for various C features
259AC_C_PRINTF_A
260
John Criswell0021c312004-02-13 21:57:29 +0000261dnl Check for the endianness of the target
262AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
263
John Criswell4ea390d2003-07-22 19:13:20 +0000264dnl Check for C++ extensions
Brian Gaeke278a4ac2003-11-10 03:06:09 +0000265AC_CXX_HAVE_HASH_MAP
266AC_CXX_HAVE_HASH_SET
John Criswell4ea390d2003-07-22 19:13:20 +0000267AC_CXX_HAVE_STD_ITERATOR
268AC_CXX_HAVE_BI_ITERATOR
269AC_CXX_HAVE_FWD_ITERATOR
270
Brian Gaeke26be9c52004-01-13 06:43:16 +0000271dnl Checks for library functions.
John Criswell4ea390d2003-07-22 19:13:20 +0000272AC_FUNC_ALLOCA
John Criswell4ea390d2003-07-22 19:13:20 +0000273AC_FUNC_MMAP
Brian Gaeke26be9c52004-01-13 06:43:16 +0000274if test "$ac_cv_func_mmap_fixed_mapped" = "no"
275then
276 AC_MSG_ERROR([mmap() required but not found])
277fi
John Criswell4ea390d2003-07-22 19:13:20 +0000278AC_FUNC_MMAP_FILE
Brian Gaeke26be9c52004-01-13 06:43:16 +0000279if test "$ac_cv_func_mmap_file" = "no"
John Criswell4ea390d2003-07-22 19:13:20 +0000280then
281 AC_MSG_ERROR([mmap() of files required but not found])
282fi
283AC_HEADER_MMAP_ANONYMOUS
284AC_TYPE_SIGNAL
Brian Gaeke8d36db12004-04-02 21:06:44 +0000285AC_CHECK_FUNCS(getcwd gettimeofday strdup strtoq strtoll backtrace isatty)
John Criswell4ea390d2003-07-22 19:13:20 +0000286AC_CHECK_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found]))
287
John Criswellcb7a1eb2003-11-17 19:46:02 +0000288dnl Determine if the linker supports the -R option.
Brian Gaeke26be9c52004-01-13 06:43:16 +0000289AC_LINK_USE_R
John Criswellcb7a1eb2003-11-17 19:46:02 +0000290
Brian Gaeke26be9c52004-01-13 06:43:16 +0000291dnl --enable/--with command-line options:
292dnl Check whether they want to do an optimized build:
John Criswell79a8f092003-07-22 20:59:52 +0000293AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]),,enableval=no)
294if test ${enableval} = "no"
295then
296 AC_SUBST(ENABLE_OPTIMIZED,[[]])
297else
298 AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
299fi
300
Brian Gaekedbaf9812004-04-16 17:13:33 +0000301AC_DEFUN(EXTERNAL_BENCHMARK,
302[m4_define([allcapsname],translit($1,a-z,A-Z))
303 AC_ARG_ENABLE($1,
304 AC_HELP_STRING([--enable-$1=ARG],
305 [Use $1 as a benchmark (srcs in DIR)]),
306 checkresult=$enableval,
307 checkresult=auto)
308AC_MSG_CHECKING([for $1 benchmark sources])
309case "$checkresult" in
Chris Lattnerac847282004-04-14 16:32:34 +0000310auto|yes)
Brian Gaekedbaf9812004-04-16 17:13:33 +0000311 defaultdir=$2
312 if test -d "$defaultdir"
John Criswell0538d422004-02-20 22:30:22 +0000313 then
Brian Gaekedbaf9812004-04-16 17:13:33 +0000314 AC_SUBST(allcapsname()[_ROOT],[$defaultdir])
315 AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1)
316 checkresult="yes, found in $defaultdir"
Brian Gaekebc7b85f2004-04-13 19:02:51 +0000317 else
Brian Gaekedbaf9812004-04-16 17:13:33 +0000318 checkresult=no
Brian Gaekebc7b85f2004-04-13 19:02:51 +0000319 fi
320 ;;
Chris Lattnerac847282004-04-14 16:32:34 +0000321no)
Brian Gaekedbaf9812004-04-16 17:13:33 +0000322 AC_SUBST(allcapsname()[_ROOT],[])
323 AC_SUBST([USE_]allcapsname(),[])
324 checkresult=no
Brian Gaekebc7b85f2004-04-13 19:02:51 +0000325 ;;
Brian Gaekedbaf9812004-04-16 17:13:33 +0000326*) if test -d "$checkresult"
Brian Gaekebc7b85f2004-04-13 19:02:51 +0000327 then
Brian Gaekedbaf9812004-04-16 17:13:33 +0000328 AC_SUBST(allcapsname()[_ROOT],"$checkresult")
329 AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1)
330 checkresult="yes, in $checkresult"
Brian Gaekebc7b85f2004-04-13 19:02:51 +0000331 else
Brian Gaekedbaf9812004-04-16 17:13:33 +0000332 AC_SUBST(allcapsname()[_ROOT],[])
333 AC_SUBST([USE_]allcapsname(),[])
334 checkresult="no, not found in $checkresult"
Brian Gaekebc7b85f2004-04-13 19:02:51 +0000335 fi
336 ;;
337esac
Brian Gaekedbaf9812004-04-16 17:13:33 +0000338AC_MSG_RESULT($checkresult)
339m4_undefine([allcapsname])
340])
341
342EXTERNAL_BENCHMARK(spec95,/home/vadve/shared/benchmarks/spec95/benchspec)
343EXTERNAL_BENCHMARK(spec2000,/home/vadve/shared/benchmarks/speccpu2000/benchspec)
344EXTERNAL_BENCHMARK(povray,/home/vadve/shared/benchmarks/povray31)
John Criswell0538d422004-02-20 22:30:22 +0000345
John Criswell79a8f092003-07-22 20:59:52 +0000346dnl Precompiled Bytecode Option
347AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]),,enableval=no)
348if test ${enableval} = "no"
349then
350 AC_SUBST(UPB,[[]])
351else
352 AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]])
353fi
354
John Criswell79a8f092003-07-22 20:59:52 +0000355dnl LLC Diff Option
356AC_ARG_ENABLE(llc_diffs,AC_HELP_STRING([--enable-llc_diffs],[Enable LLC Diffs when testing (default is YES)]),,enableval=yes)
357if test ${enableval} = "no"
358then
359 AC_SUBST(DISABLE_LLC_DIFFS,[DISABLE_LLC_DIFFS:=1])
360else
361 AC_SUBST(DISABLE_LLC_DIFFS,[[]])
362fi
363
364dnl JIT Option
John Criswellc78022e2003-07-29 19:11:58 +0000365AC_ARG_ENABLE(jit,AC_HELP_STRING([--enable-jit],[Enable Just In Time Compiling (default is YES)]),,enableval=default)
John Criswell79a8f092003-07-22 20:59:52 +0000366if test ${enableval} = "no"
367then
368 AC_SUBST(JIT,[[]])
369else
John Criswellc78022e2003-07-29 19:11:58 +0000370 case $target in
371 *i*86*)
372 AC_SUBST(JIT,[[TARGET_HAS_JIT=1]])
373 ;;
374 *sparc*)
375 AC_SUBST(JIT,[[TARGET_HAS_JIT=1]])
376 ;;
377 *)
378 AC_SUBST(JIT,[[]])
379 ;;
380 esac
John Criswell79a8f092003-07-22 20:59:52 +0000381fi
John Criswell4ea390d2003-07-22 19:13:20 +0000382
Brian Gaeke26be9c52004-01-13 06:43:16 +0000383dnl Find the LLVM GCC-based C/C++ front end
John Criswell4ea390d2003-07-22 19:13:20 +0000384AC_ARG_WITH(llvmgccdir,AC_HELP_STRING([--with-llvmgccdir],[Location of LLVM GCC front-end]),AC_SUBST(LLVMGCCDIR,[$withval]))
Brian Gaeke908647f2003-11-16 18:37:46 +0000385AC_MSG_CHECKING([for llvm-gcc])
386LLVM_GCC_CHECK=no
387if test -d "$LLVMGCCDIR"
388then
389 if test -x "$LLVMGCCDIR/bin/gcc"
390 then
391 LLVM_GCC_CHECK="$LLVMGCCDIR/bin/gcc"
392 fi
393fi
394llvmgccwarn=no
395AC_MSG_RESULT($LLVM_GCC_CHECK)
396if test "$LLVM_GCC_CHECK" = "no"
397then
398 llvmgccwarn=yes
399fi
Brian Gaeke908647f2003-11-16 18:37:46 +0000400AC_MSG_CHECKING([whether llvm-gcc is sane])
401LLVM_GCC_SANE=no
402if test -x "$LLVM_GCC_CHECK"
403then
404 cp /dev/null conftest.c
405 "$LLVM_GCC_CHECK" -S -o - conftest.c | grep implementation > /dev/null 2>&1
406 if test $? -eq 0
407 then
408 LLVM_GCC_SANE=yes
409 fi
410 rm conftest.c
Brian Gaeked05e39d2004-01-16 21:31:22 +0000411 llvmcc1path=`"$LLVM_GCC_CHECK" --print-prog-name=cc1`
412 AC_SUBST(LLVMCC1,$llvmcc1path)
413 llvmcc1pluspath=`"$LLVM_GCC_CHECK" --print-prog-name=cc1plus`
414 AC_SUBST(LLVMCC1PLUS,$llvmcc1pluspath)
Brian Gaeke908647f2003-11-16 18:37:46 +0000415fi
416AC_MSG_RESULT($LLVM_GCC_SANE)
417if test "$LLVM_GCC_SANE" = "no"
418then
419 llvmgccwarn=yes
420fi
421
John Criswellc78022e2003-07-29 19:11:58 +0000422dnl Location of the bytecode repository
John Criswell4ea390d2003-07-22 19:13:20 +0000423AC_ARG_WITH(bcrepos,AC_HELP_STRING([--with-bcrepos],[Location of Bytecode Repository]),AC_SUBST(BCR,[$withval]),AC_SUBST(BCR,[/home/vadve/lattner/LLVMPrograms]))
John Criswellc78022e2003-07-29 19:11:58 +0000424
425dnl Location of PAPI
Chris Lattner1b9ddd52003-08-14 18:59:53 +0000426AC_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 Criswellc78022e2003-07-29 19:11:58 +0000427
Brian Gaekecea9a602004-01-21 19:38:56 +0000428dnl Get libtool's idea of what the shared library suffix is.
429dnl (This is a hack; it relies on undocumented behavior.)
430AC_MSG_CHECKING([for shared library suffix])
431eval "SHLIBEXT=$shrext"
432AC_MSG_RESULT($SHLIBEXT)
433dnl Propagate it to the Makefiles and config.h (for gccld & bugpoint).
434AC_SUBST(SHLIBEXT,$SHLIBEXT)
435AC_DEFINE_UNQUOTED(SHLIBEXT,"$SHLIBEXT",
436 [Extension that shared libraries have, e.g., ".so".])
437
Brian Gaeke26be9c52004-01-13 06:43:16 +0000438dnl Create the output files
Brian Gaekec1cf4242004-02-23 18:56:05 +0000439AC_OUTPUT(Makefile.config
Brian Gaeke1133eaf2004-02-23 22:07:01 +0000440 include/Support/DataTypes.h
441 include/Support/ThreadSupport.h
Brian Gaekec1cf4242004-02-23 18:56:05 +0000442 include/Support/hash_map
Brian Gaeke2e3bdba2004-02-23 21:30:36 +0000443 include/Support/hash_set
Brian Gaeke1133eaf2004-02-23 22:07:01 +0000444 include/Support/iterator)
Brian Gaeke908647f2003-11-16 18:37:46 +0000445
Brian Gaeke26be9c52004-01-13 06:43:16 +0000446dnl Warn loudly if llvm-gcc was not obviously working
Brian Gaeke908647f2003-11-16 18:37:46 +0000447if test $llvmgccwarn = yes
448then
449 AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not])
450 AC_MSG_WARN([***** appear to be working.])
451 AC_MSG_WARN([***** ])
452 AC_MSG_WARN([***** Please check configure's --with-llvmgccdir option.])
453 AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,])
454 AC_MSG_WARN([***** but you should be able to build the llvm tools.])
455fi
Brian Gaekecea9a602004-01-21 19:38:56 +0000456