blob: 64c5b627c725826c4f57236e13ba4f1ad4cbd504 [file] [log] [blame]
Brian Gaeke2abe7ae2004-01-13 06:43:16 +00001dnl Initialize autoconf
Chris Lattnercea7f662004-04-14 16:32:34 +00002AC_INIT([[[LLVM]]],[[[1.3]]],[llvmbugs@cs.uiuc.edu])
John Criswell7a3334d2003-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 Criswell22107a72003-09-15 17:04:06 +00007dnl Quit if the source directory has already been configured.
John Criswellf6778b62003-09-15 17:19:42 +00008dnl NOTE: This relies upon undocumented autoconf behavior.
9if test ${srcdir} != "."
John Criswell22107a72003-09-15 17:04:06 +000010then
John Criswellf6778b62003-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 Criswell22107a72003-09-15 17:04:06 +000015fi
16
John Criswell297baed2003-11-25 20:36:46 +000017dnl Configure all of the projects present in our source tree.
John Criswell297baed2003-11-25 20:36:46 +000018for i in `ls ${srcdir}/projects`
19do
20 if test ${i} != "CVS"
21 then
John Criswell6f73d282003-12-12 20:09:33 +000022 if test -f ${srcdir}/projects/${i}/configure
John Criswell297baed2003-11-25 20:36:46 +000023 then
24 AC_CONFIG_SUBDIRS(projects/${i})
25 fi
26 fi
27done
John Criswellee7ebdc2003-09-30 16:31:48 +000028
John Criswell7a3334d2003-07-22 19:13:20 +000029dnl Configure a header file
30AC_CONFIG_HEADERS(include/Config/config.h)
John Criswell2970d522003-09-06 14:46:19 +000031AC_CONFIG_MAKEFILE(Makefile)
32AC_CONFIG_MAKEFILE(Makefile.common)
John Criswell2970d522003-09-06 14:46:19 +000033AC_CONFIG_MAKEFILE(lib/Makefile)
John Criswell2970d522003-09-06 14:46:19 +000034AC_CONFIG_MAKEFILE(runtime/Makefile)
John Criswell2970d522003-09-06 14:46:19 +000035AC_CONFIG_MAKEFILE(test/Makefile)
36AC_CONFIG_MAKEFILE(test/Makefile.tests)
John Criswelle078b432003-10-07 21:13:47 +000037AC_CONFIG_MAKEFILE(test/QMTest/llvm.py)
38AC_CONFIG_MAKEFILE(test/QMTest/llvmdb.py)
John Criswell2970d522003-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 Criswell2970d522003-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 Criswell47c54592004-02-24 21:43:38 +000053AC_CONFIG_MAKEFILE(test/Programs/TEST.vtl.Makefile)
John Criswell2970d522003-09-06 14:46:19 +000054AC_CONFIG_MAKEFILE(test/Programs/External/Makefile)
55AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile)
John Criswell7e0a65d2003-09-11 18:04:00 +000056AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec)
Alkis Evlogimenose008a4b2004-02-26 04:14:10 +000057AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec2000)
John Criswell43fc5c12004-02-10 22:29:06 +000058AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec95)
John Criswell2970d522003-09-06 14:46:19 +000059AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile)
60AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile.multisrc)
Misha Brukman77a8be82003-11-12 22:16:23 +000061AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/analyzer/test.in)
Misha Brukmandc6863a2003-11-12 19:39:10 +000062AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/Makefile)
Misha Brukman77a8be82003-11-12 22:16:23 +000063AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/test.in)
Misha Brukmandc6863a2003-11-12 19:39:10 +000064AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/Makefile)
Misha Brukman77a8be82003-11-12 22:16:23 +000065AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/test.in)
Misha Brukmandc6863a2003-11-12 19:39:10 +000066AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/Makefile)
Misha Brukman77a8be82003-11-12 22:16:23 +000067AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/test.in)
Misha Brukmandc6863a2003-11-12 19:39:10 +000068AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/Makefile)
Misha Brukman77a8be82003-11-12 22:16:23 +000069AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/test.in)
Misha Brukmandc6863a2003-11-12 19:39:10 +000070AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/Makefile)
Misha Brukman77a8be82003-11-12 22:16:23 +000071AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/test.in)
Misha Brukmandc6863a2003-11-12 19:39:10 +000072AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/Makefile)
Misha Brukman77a8be82003-11-12 22:16:23 +000073AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/test.in)
John Criswell2970d522003-09-06 14:46:19 +000074AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile)
75AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile.singlesrc)
Alkis Evlogimenose008a4b2004-02-26 04:14:10 +000076AC_CONFIG_MAKEFILE(test/Programs/SingleSource/UnitTests/SetjmpLongjmp/Makefile)
John Criswell2970d522003-09-06 14:46:19 +000077AC_CONFIG_MAKEFILE(tools/Makefile)
Chris Lattner672edbc2003-10-06 02:09:25 +000078AC_CONFIG_MAKEFILE(utils/Makefile)
John Criswell2970d522003-09-06 14:46:19 +000079AC_CONFIG_MAKEFILE(projects/Makefile)
John Criswell7a3334d2003-07-22 19:13:20 +000080
Brian Gaeke2abe7ae2004-01-13 06:43:16 +000081dnl Find the install program (needs to be done before canonical stuff)
John Criswell7a3334d2003-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 Gaeke7027ed82003-11-17 00:30:48 +000088dnl Set the "OS" Makefile variable based on the system we are building on.
John Criswell7a3334d2003-07-22 19:13:20 +000089dnl We will use the build machine information to set some variables.
John Criswell7a3334d2003-07-22 19:13:20 +000090case $build in
Brian Gaeke7027ed82003-11-17 00:30:48 +000091 *-*-linux*)
92 AC_SUBST(OS,[Linux])
Brian Gaekedfbd3d42003-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 Criswell7a3334d2003-07-22 19:13:20 +000097 ;;
98
Brian Gaeke7027ed82003-11-17 00:30:48 +000099 *-*-solaris*)
100 AC_SUBST(OS,[SunOS])
Brian Gaekedfbd3d42003-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 Criswell7a3334d2003-07-22 19:13:20 +0000105 ;;
Chris Lattnerf55aa9c2004-06-02 23:32:17 +0000106 *-*-cygwin*)
107 AC_SUBST(OS,[Cygwin])
108 ;;
John Criswell7a3334d2003-07-22 19:13:20 +0000109
Brian Gaeke7027ed82003-11-17 00:30:48 +0000110 *-*-darwin*)
111 AC_SUBST(OS,[Darwin])
112 ;;
113
John Criswell7a3334d2003-07-22 19:13:20 +0000114 *) AC_SUBST(OS,[Unknown])
115 ;;
116esac
117
John Criswell7a3334d2003-07-22 19:13:20 +0000118dnl If we are targetting a Sparc machine running Solaris, pretend that it is
119dnl V9, since that is all that we support at the moment, and autoconf will only
120dnl tell us we're a sparc.
John Criswell7a3334d2003-07-22 19:13:20 +0000121case $target in
Brian Gaeke7027ed82003-11-17 00:30:48 +0000122 sparc*-*-solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]])
123 ;;
John Criswell7a3334d2003-07-22 19:13:20 +0000124esac
125
John Criswell7a3334d2003-07-22 19:13:20 +0000126dnl Determine what our target architecture is and configure accordingly.
127dnl This will allow Makefiles to make a distinction between the hardware and
128dnl the OS.
John Criswell7a3334d2003-07-22 19:13:20 +0000129case $target in
Brian Gaeke7027ed82003-11-17 00:30:48 +0000130 i*86-*) AC_SUBST(ARCH,[x86])
John Criswell7a3334d2003-07-22 19:13:20 +0000131 ;;
Brian Gaeke7027ed82003-11-17 00:30:48 +0000132 sparc*-*) AC_SUBST(ARCH,[Sparc])
133 ;;
134 powerpc*-*) AC_SUBST(ARCH,[PowerPC])
135 ;;
136 *) AC_SUBST(ARCH,[Unknown])
John Criswell7a3334d2003-07-22 19:13:20 +0000137 ;;
138esac
139
John Criswell7a3334d2003-07-22 19:13:20 +0000140dnl Check for compilation tools
141AC_PROG_CXX
142AC_PROG_CC(gcc)
143AC_PROG_CPP
144
145dnl Ensure that compilation tools are GCC; we use GCC specific extensions
146if test "$GCC" != "yes"
147then
148 AC_MSG_ERROR([gcc required but not found])
149fi
John Criswell7a3334d2003-07-22 19:13:20 +0000150if test "$GXX" != "yes"
151then
152 AC_MSG_ERROR([g++ required but not found])
153fi
154
John Criswell6a47a972003-08-25 16:49:54 +0000155dnl Verify that GCC is version 3.0 or higher
156gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1`
157if test "$gccmajor" -lt "3"
158then
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000159 AC_MSG_ERROR([gcc 3.x required, but you have a lower version])
John Criswell6a47a972003-08-25 16:49:54 +0000160fi
161
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000162dnl Check for GNU Make. We use its extensions too, so don't build without it
John Criswell7a3334d2003-07-22 19:13:20 +0000163CHECK_GNU_MAKE
164if test -z "$_cv_gnu_make_command"
165then
166 AC_MSG_ERROR([GNU Make required but not found])
167fi
168
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000169dnl Checks for other tools
John Criswell7a3334d2003-07-22 19:13:20 +0000170AC_PROG_FLEX
171AC_PROG_BISON
John Criswell7a3334d2003-07-22 19:13:20 +0000172AC_PROG_LIBTOOL
173
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000174dnl Checks for tools we can get away with not having:
175AC_PATH_PROG(DOT,[dot],[true dot])
176AC_PATH_PROG(ETAGS,[etags],[true etags])
Brian Gaeke3f58a872004-01-22 21:55:15 +0000177dnl Check if we know how to tell etags we are using C++:
178etags_version=`$ETAGS --version 2>&1`
179case "$etags_version" in
180 *[Ee]xuberant*) ETAGSFLAGS="--language-force=c++" ;;
181 *GNU\ Emacs*) ETAGSFLAGS="-l c++" ;;
182 *) ETAGSFLAGS="" ;;
183esac
184AC_SUBST(ETAGSFLAGS,$ETAGSFLAGS)
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000185AC_PATH_PROG(PYTHON,[python],[true python])
186if test "$PYTHON" = "false"
John Criswell31494482003-09-23 15:28:52 +0000187then
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000188 AC_MSG_WARN([Python is required for the test suite, but it was not found])
John Criswell31494482003-09-23 15:28:52 +0000189fi
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000190AC_PATH_PROG(QMTEST,[qmtest],[true qmtest])
191if test "$QMTEST" = "false"
John Criswell31494482003-09-23 15:28:52 +0000192then
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000193 AC_MSG_WARN([QMTest is required for the test suite, but it was not found])
John Criswell31494482003-09-23 15:28:52 +0000194fi
John Criswell6a47a972003-08-25 16:49:54 +0000195
196dnl Verify that the version of python available is high enough for qmtest
197pyversion=`$PYTHON -V 2>&1 | cut -d\ -f2`
198pymajor=`echo $pyversion | cut -d. -f1`
199pyminor=`echo $pyversion | cut -d. -f2`
200
201if test "$pymajor" -ge "2"
202then
203 if test "$pymajor" -eq "2"
204 then
205 if test "$pyminor" -lt "2"
206 then
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000207 AC_MSG_WARN([QMTest requires Python 2.2 or later])
John Criswell6a47a972003-08-25 16:49:54 +0000208 fi
209 fi
210else
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000211 AC_MSG_WARN([QMTest requires Python 2.2 or later])
John Criswell6a47a972003-08-25 16:49:54 +0000212fi
John Criswell7a3334d2003-07-22 19:13:20 +0000213
214dnl Verify that the source directory is valid
215AC_CONFIG_SRCDIR(["Makefile.config.in"])
216
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000217dnl Checks for libraries:
John Criswell7a3334d2003-07-22 19:13:20 +0000218dnl libelf is for sparc only; we can ignore it if we don't have it
219AC_CHECK_LIB(elf, elf_begin)
220
Brian Gaeke25f2a372003-10-07 05:03:36 +0000221dnl dlopen() is required for plugin support.
Brian Gaeked7a702d2003-10-08 21:44:07 +0000222AC_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 Criswell7a3334d2003-07-22 19:13:20 +0000223
224dnl mallinfo is optional; the code can compile (minus features) without it
Brian Gaeked7a702d2003-10-08 21:44:07 +0000225AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo() is available on this platform.]))
John Criswell7a3334d2003-07-22 19:13:20 +0000226
Brian Gaeke7ee7b402003-12-05 19:29:01 +0000227dnl pthread locking functions are optional - but llvm will not be thread-safe
228dnl without locks.
Brian Gaeke01cc3d82004-02-23 21:30:36 +0000229AC_SEARCH_LIBS(pthread_mutex_lock,pthread,HAVE_PTHREAD_MUTEX_LOCK=1,HAVE_PTHREAD_MUTEX_LOCK=0)
230AC_SUBST(HAVE_PTHREAD_MUTEX_LOCK)
Brian Gaeke7ee7b402003-12-05 19:29:01 +0000231
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000232dnl Checks for header files.
233dnl We don't check for ancient stuff or things that are guaranteed to be there
234dnl by the C++ standard. We always use the <cfoo> versions of <foo.h> C headers.
John Criswell7a3334d2003-07-22 19:13:20 +0000235AC_HEADER_STDC
236AC_HEADER_SYS_WAIT
237
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000238dnl Checks for POSIX and other various system-specific header files
John Criswell1cd5f922004-05-27 20:40:39 +0000239AC_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 windows.h)
John Criswell7a3334d2003-07-22 19:13:20 +0000240
Brian Gaeke090ed132004-02-23 22:07:01 +0000241dnl Check for things that need to be included in public headers, and so
242dnl for which we may not have access to a HAVE_* preprocessor #define.
243dnl (primarily used in DataTypes.h)
244AC_CHECK_HEADER([sys/types.h],
245 [INCLUDE_SYS_TYPES_H='#include <sys/types.h>'],
246 [INCLUDE_SYS_TYPES_H=''])
247AC_SUBST(INCLUDE_SYS_TYPES_H)
248AC_CHECK_HEADER([inttypes.h],
249 [INCLUDE_INTTYPES_H='#include <inttypes.h>'],
250 [INCLUDE_INTTYPES_H=''])
251AC_SUBST(INCLUDE_INTTYPES_H)
252
John Criswell7a3334d2003-07-22 19:13:20 +0000253dnl Check for types
254AC_TYPE_PID_T
255AC_TYPE_SIZE_T
256AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found]))
257AC_CHECK_TYPES([uint64_t],,AC_MSG_ERROR([Type uint64_t required but not found]))
258AC_HEADER_TIME
259AC_STRUCT_TM
260
John Criswell42859552003-10-13 16:22:01 +0000261dnl Check for various C features
262AC_C_PRINTF_A
263
John Criswell3b4195f32004-02-13 21:57:29 +0000264dnl Check for the endianness of the target
265AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
266
John Criswell7a3334d2003-07-22 19:13:20 +0000267dnl Check for C++ extensions
Brian Gaekeb6218572003-11-10 03:06:09 +0000268AC_CXX_HAVE_HASH_MAP
269AC_CXX_HAVE_HASH_SET
John Criswell7a3334d2003-07-22 19:13:20 +0000270AC_CXX_HAVE_STD_ITERATOR
271AC_CXX_HAVE_BI_ITERATOR
272AC_CXX_HAVE_FWD_ITERATOR
273
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000274dnl Checks for library functions.
John Criswell7a3334d2003-07-22 19:13:20 +0000275AC_FUNC_ALLOCA
John Criswell7a3334d2003-07-22 19:13:20 +0000276AC_FUNC_MMAP
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000277if test "$ac_cv_func_mmap_fixed_mapped" = "no"
278then
John Criswellb82cbbf2004-05-27 00:57:50 +0000279 AC_MSG_WARN([mmap() required but not found])
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000280fi
John Criswell7a3334d2003-07-22 19:13:20 +0000281AC_FUNC_MMAP_FILE
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000282if test "$ac_cv_func_mmap_file" = "no"
John Criswell7a3334d2003-07-22 19:13:20 +0000283then
John Criswellb82cbbf2004-05-27 00:57:50 +0000284 AC_MSG_WARN([mmap() of files required but not found])
John Criswell7a3334d2003-07-22 19:13:20 +0000285fi
286AC_HEADER_MMAP_ANONYMOUS
287AC_TYPE_SIGNAL
Brian Gaekec6dba952004-04-02 21:06:44 +0000288AC_CHECK_FUNCS(getcwd gettimeofday strdup strtoq strtoll backtrace isatty)
John Criswell7a3334d2003-07-22 19:13:20 +0000289AC_CHECK_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found]))
290
John Criswell6ee0ed52003-11-17 19:46:02 +0000291dnl Determine if the linker supports the -R option.
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000292AC_LINK_USE_R
John Criswell6ee0ed52003-11-17 19:46:02 +0000293
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000294dnl --enable/--with command-line options:
295dnl Check whether they want to do an optimized build:
John Criswell5ec24d82003-07-22 20:59:52 +0000296AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]),,enableval=no)
297if test ${enableval} = "no"
298then
299 AC_SUBST(ENABLE_OPTIMIZED,[[]])
300else
301 AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
302fi
303
Brian Gaekefe766052004-04-16 17:13:33 +0000304AC_DEFUN(EXTERNAL_BENCHMARK,
305[m4_define([allcapsname],translit($1,a-z,A-Z))
306 AC_ARG_ENABLE($1,
307 AC_HELP_STRING([--enable-$1=ARG],
308 [Use $1 as a benchmark (srcs in DIR)]),
309 checkresult=$enableval,
310 checkresult=auto)
311AC_MSG_CHECKING([for $1 benchmark sources])
312case "$checkresult" in
Chris Lattnercea7f662004-04-14 16:32:34 +0000313auto|yes)
Brian Gaekefe766052004-04-16 17:13:33 +0000314 defaultdir=$2
315 if test -d "$defaultdir"
John Criswellacbd6572004-02-20 22:30:22 +0000316 then
Brian Gaekefe766052004-04-16 17:13:33 +0000317 AC_SUBST(allcapsname()[_ROOT],[$defaultdir])
318 AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1)
319 checkresult="yes, found in $defaultdir"
Brian Gaekefca47202004-04-13 19:02:51 +0000320 else
Brian Gaekefe766052004-04-16 17:13:33 +0000321 checkresult=no
Brian Gaekefca47202004-04-13 19:02:51 +0000322 fi
323 ;;
Chris Lattnercea7f662004-04-14 16:32:34 +0000324no)
Brian Gaekefe766052004-04-16 17:13:33 +0000325 AC_SUBST(allcapsname()[_ROOT],[])
326 AC_SUBST([USE_]allcapsname(),[])
327 checkresult=no
Brian Gaekefca47202004-04-13 19:02:51 +0000328 ;;
Brian Gaekefe766052004-04-16 17:13:33 +0000329*) if test -d "$checkresult"
Brian Gaekefca47202004-04-13 19:02:51 +0000330 then
Brian Gaekefe766052004-04-16 17:13:33 +0000331 AC_SUBST(allcapsname()[_ROOT],"$checkresult")
332 AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1)
333 checkresult="yes, in $checkresult"
Brian Gaekefca47202004-04-13 19:02:51 +0000334 else
Brian Gaekefe766052004-04-16 17:13:33 +0000335 AC_SUBST(allcapsname()[_ROOT],[])
336 AC_SUBST([USE_]allcapsname(),[])
337 checkresult="no, not found in $checkresult"
Brian Gaekefca47202004-04-13 19:02:51 +0000338 fi
339 ;;
340esac
Brian Gaekefe766052004-04-16 17:13:33 +0000341AC_MSG_RESULT($checkresult)
342m4_undefine([allcapsname])
343])
344
345EXTERNAL_BENCHMARK(spec95,/home/vadve/shared/benchmarks/spec95/benchspec)
346EXTERNAL_BENCHMARK(spec2000,/home/vadve/shared/benchmarks/speccpu2000/benchspec)
347EXTERNAL_BENCHMARK(povray,/home/vadve/shared/benchmarks/povray31)
John Criswellacbd6572004-02-20 22:30:22 +0000348
John Criswell5ec24d82003-07-22 20:59:52 +0000349dnl Precompiled Bytecode Option
350AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]),,enableval=no)
351if test ${enableval} = "no"
352then
353 AC_SUBST(UPB,[[]])
354else
355 AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]])
356fi
357
John Criswell5ec24d82003-07-22 20:59:52 +0000358dnl LLC Diff Option
359AC_ARG_ENABLE(llc_diffs,AC_HELP_STRING([--enable-llc_diffs],[Enable LLC Diffs when testing (default is YES)]),,enableval=yes)
360if test ${enableval} = "no"
361then
362 AC_SUBST(DISABLE_LLC_DIFFS,[DISABLE_LLC_DIFFS:=1])
363else
364 AC_SUBST(DISABLE_LLC_DIFFS,[[]])
365fi
366
367dnl JIT Option
John Criswell4f376922003-07-29 19:11:58 +0000368AC_ARG_ENABLE(jit,AC_HELP_STRING([--enable-jit],[Enable Just In Time Compiling (default is YES)]),,enableval=default)
John Criswell5ec24d82003-07-22 20:59:52 +0000369if test ${enableval} = "no"
370then
371 AC_SUBST(JIT,[[]])
372else
John Criswell4f376922003-07-29 19:11:58 +0000373 case $target in
374 *i*86*)
375 AC_SUBST(JIT,[[TARGET_HAS_JIT=1]])
376 ;;
377 *sparc*)
378 AC_SUBST(JIT,[[TARGET_HAS_JIT=1]])
379 ;;
380 *)
381 AC_SUBST(JIT,[[]])
382 ;;
383 esac
John Criswell5ec24d82003-07-22 20:59:52 +0000384fi
John Criswell7a3334d2003-07-22 19:13:20 +0000385
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000386dnl Find the LLVM GCC-based C/C++ front end
John Criswell7a3334d2003-07-22 19:13:20 +0000387AC_ARG_WITH(llvmgccdir,AC_HELP_STRING([--with-llvmgccdir],[Location of LLVM GCC front-end]),AC_SUBST(LLVMGCCDIR,[$withval]))
Brian Gaekedfbd3d42003-11-16 18:37:46 +0000388AC_MSG_CHECKING([for llvm-gcc])
389LLVM_GCC_CHECK=no
390if test -d "$LLVMGCCDIR"
391then
392 if test -x "$LLVMGCCDIR/bin/gcc"
393 then
394 LLVM_GCC_CHECK="$LLVMGCCDIR/bin/gcc"
395 fi
396fi
397llvmgccwarn=no
398AC_MSG_RESULT($LLVM_GCC_CHECK)
399if test "$LLVM_GCC_CHECK" = "no"
400then
401 llvmgccwarn=yes
402fi
Brian Gaekedfbd3d42003-11-16 18:37:46 +0000403AC_MSG_CHECKING([whether llvm-gcc is sane])
404LLVM_GCC_SANE=no
405if test -x "$LLVM_GCC_CHECK"
406then
407 cp /dev/null conftest.c
408 "$LLVM_GCC_CHECK" -S -o - conftest.c | grep implementation > /dev/null 2>&1
409 if test $? -eq 0
410 then
411 LLVM_GCC_SANE=yes
412 fi
413 rm conftest.c
Brian Gaeke423ceca2004-01-16 21:31:22 +0000414 llvmcc1path=`"$LLVM_GCC_CHECK" --print-prog-name=cc1`
415 AC_SUBST(LLVMCC1,$llvmcc1path)
416 llvmcc1pluspath=`"$LLVM_GCC_CHECK" --print-prog-name=cc1plus`
417 AC_SUBST(LLVMCC1PLUS,$llvmcc1pluspath)
Brian Gaekedfbd3d42003-11-16 18:37:46 +0000418fi
419AC_MSG_RESULT($LLVM_GCC_SANE)
420if test "$LLVM_GCC_SANE" = "no"
421then
422 llvmgccwarn=yes
423fi
424
John Criswell4f376922003-07-29 19:11:58 +0000425dnl Location of the bytecode repository
John Criswell7a3334d2003-07-22 19:13:20 +0000426AC_ARG_WITH(bcrepos,AC_HELP_STRING([--with-bcrepos],[Location of Bytecode Repository]),AC_SUBST(BCR,[$withval]),AC_SUBST(BCR,[/home/vadve/lattner/LLVMPrograms]))
John Criswell4f376922003-07-29 19:11:58 +0000427
428dnl Location of PAPI
Chris Lattner00645502003-08-14 18:59:53 +0000429AC_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 Criswell4f376922003-07-29 19:11:58 +0000430
Brian Gaekecc3676b2004-01-21 19:38:56 +0000431dnl Get libtool's idea of what the shared library suffix is.
432dnl (This is a hack; it relies on undocumented behavior.)
433AC_MSG_CHECKING([for shared library suffix])
434eval "SHLIBEXT=$shrext"
435AC_MSG_RESULT($SHLIBEXT)
436dnl Propagate it to the Makefiles and config.h (for gccld & bugpoint).
437AC_SUBST(SHLIBEXT,$SHLIBEXT)
438AC_DEFINE_UNQUOTED(SHLIBEXT,"$SHLIBEXT",
439 [Extension that shared libraries have, e.g., ".so".])
440
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000441dnl Create the output files
Brian Gaekecc2b8b72004-02-23 18:56:05 +0000442AC_OUTPUT(Makefile.config
Brian Gaeke090ed132004-02-23 22:07:01 +0000443 include/Support/DataTypes.h
444 include/Support/ThreadSupport.h
Brian Gaekecc2b8b72004-02-23 18:56:05 +0000445 include/Support/hash_map
Brian Gaeke01cc3d82004-02-23 21:30:36 +0000446 include/Support/hash_set
Brian Gaeke090ed132004-02-23 22:07:01 +0000447 include/Support/iterator)
Brian Gaekedfbd3d42003-11-16 18:37:46 +0000448
Brian Gaeke2abe7ae2004-01-13 06:43:16 +0000449dnl Warn loudly if llvm-gcc was not obviously working
Brian Gaekedfbd3d42003-11-16 18:37:46 +0000450if test $llvmgccwarn = yes
451then
452 AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not])
453 AC_MSG_WARN([***** appear to be working.])
454 AC_MSG_WARN([***** ])
455 AC_MSG_WARN([***** Please check configure's --with-llvmgccdir option.])
456 AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,])
457 AC_MSG_WARN([***** but you should be able to build the llvm tools.])
458fi
Brian Gaekecc3676b2004-01-21 19:38:56 +0000459