blob: fd4870c520aa8a01382cce2ede758f96a4a6556a [file] [log] [blame]
Brian Gaeke26be9c52004-01-13 06:43:16 +00001dnl Initialize autoconf
John Criswelld000e1d2003-12-18 16:43:17 +00002AC_INIT([[[LLVM]]],[[[1.1]]],[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)
43AC_CONFIG_MAKEFILE(test/Programs/TEST.micro.report)
44AC_CONFIG_MAKEFILE(test/Programs/TEST.aa.report)
45AC_CONFIG_MAKEFILE(test/Programs/TEST.example.Makefile)
46AC_CONFIG_MAKEFILE(test/Programs/TEST.nightly.Makefile)
47AC_CONFIG_MAKEFILE(test/Programs/TEST.buildrepo.Makefile)
48AC_CONFIG_MAKEFILE(test/Programs/TEST.jit.Makefile)
49AC_CONFIG_MAKEFILE(test/Programs/TEST.nightly.report)
50AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.Makefile)
51AC_CONFIG_MAKEFILE(test/Programs/TEST.jit.report)
52AC_CONFIG_MAKEFILE(test/Programs/TEST.typesafe.Makefile)
53AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.gnuplot)
54AC_CONFIG_MAKEFILE(test/Programs/TEST.micro.Makefile)
55AC_CONFIG_MAKEFILE(test/Programs/External/Makefile)
56AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile)
John Criswell27bb35e2003-09-11 18:04:00 +000057AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec)
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)
John Criswell2d533082003-09-06 14:46:19 +000076AC_CONFIG_MAKEFILE(tools/Makefile)
Chris Lattner5c866e12003-10-06 02:09:25 +000077AC_CONFIG_MAKEFILE(utils/Makefile)
John Criswell2d533082003-09-06 14:46:19 +000078AC_CONFIG_MAKEFILE(projects/Makefile)
John Criswell4ea390d2003-07-22 19:13:20 +000079
Brian Gaeke26be9c52004-01-13 06:43:16 +000080dnl Find the install program (needs to be done before canonical stuff)
John Criswell4ea390d2003-07-22 19:13:20 +000081AC_PROG_INSTALL
82
83dnl Check which host for which we're compiling. This will tell us which LLVM
84dnl compiler will be used for compiling SSA into object code.
85AC_CANONICAL_TARGET
86
Brian Gaeke3e66e8b2003-11-17 00:30:48 +000087dnl Set the "OS" Makefile variable based on the system we are building on.
John Criswell4ea390d2003-07-22 19:13:20 +000088dnl We will use the build machine information to set some variables.
John Criswell4ea390d2003-07-22 19:13:20 +000089case $build in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +000090 *-*-linux*)
91 AC_SUBST(OS,[Linux])
Brian Gaeke908647f2003-11-16 18:37:46 +000092 if test -d /home/vadve/lattner/local/x86/llvm-gcc
93 then
94 AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/])
95 fi
John Criswell4ea390d2003-07-22 19:13:20 +000096 ;;
97
Brian Gaeke3e66e8b2003-11-17 00:30:48 +000098 *-*-solaris*)
99 AC_SUBST(OS,[SunOS])
Brian Gaeke908647f2003-11-16 18:37:46 +0000100 if test -d /home/vadve/lattner/local/sparc/llvm-gcc
101 then
102 AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/])
103 fi
John Criswell4ea390d2003-07-22 19:13:20 +0000104 ;;
105
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000106 *-*-darwin*)
107 AC_SUBST(OS,[Darwin])
108 ;;
109
John Criswell4ea390d2003-07-22 19:13:20 +0000110 *) AC_SUBST(OS,[Unknown])
111 ;;
112esac
113
John Criswell4ea390d2003-07-22 19:13:20 +0000114dnl If we are targetting a Sparc machine running Solaris, pretend that it is
115dnl V9, since that is all that we support at the moment, and autoconf will only
116dnl tell us we're a sparc.
John Criswell4ea390d2003-07-22 19:13:20 +0000117case $target in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000118 sparc*-*-solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]])
119 ;;
John Criswell4ea390d2003-07-22 19:13:20 +0000120esac
121
John Criswell4ea390d2003-07-22 19:13:20 +0000122dnl Determine what our target architecture is and configure accordingly.
123dnl This will allow Makefiles to make a distinction between the hardware and
124dnl the OS.
John Criswell4ea390d2003-07-22 19:13:20 +0000125case $target in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000126 i*86-*) AC_SUBST(ARCH,[x86])
John Criswell4ea390d2003-07-22 19:13:20 +0000127 ;;
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000128 sparc*-*) AC_SUBST(ARCH,[Sparc])
129 ;;
130 powerpc*-*) AC_SUBST(ARCH,[PowerPC])
131 ;;
132 *) AC_SUBST(ARCH,[Unknown])
John Criswell4ea390d2003-07-22 19:13:20 +0000133 ;;
134esac
135
John Criswell4ea390d2003-07-22 19:13:20 +0000136dnl Check for compilation tools
137AC_PROG_CXX
138AC_PROG_CC(gcc)
139AC_PROG_CPP
140
141dnl Ensure that compilation tools are GCC; we use GCC specific extensions
142if test "$GCC" != "yes"
143then
144 AC_MSG_ERROR([gcc required but not found])
145fi
John Criswell4ea390d2003-07-22 19:13:20 +0000146if test "$GXX" != "yes"
147then
148 AC_MSG_ERROR([g++ required but not found])
149fi
150
John Criswellde00db22003-08-25 16:49:54 +0000151dnl Verify that GCC is version 3.0 or higher
152gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1`
153if test "$gccmajor" -lt "3"
154then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000155 AC_MSG_ERROR([gcc 3.x required, but you have a lower version])
John Criswellde00db22003-08-25 16:49:54 +0000156fi
157
Brian Gaeke26be9c52004-01-13 06:43:16 +0000158dnl Check for GNU Make. We use its extensions too, so don't build without it
John Criswell4ea390d2003-07-22 19:13:20 +0000159CHECK_GNU_MAKE
160if test -z "$_cv_gnu_make_command"
161then
162 AC_MSG_ERROR([GNU Make required but not found])
163fi
164
Brian Gaeke26be9c52004-01-13 06:43:16 +0000165dnl Checks for other tools
John Criswell4ea390d2003-07-22 19:13:20 +0000166AC_PROG_FLEX
167AC_PROG_BISON
John Criswell4ea390d2003-07-22 19:13:20 +0000168AC_PROG_LIBTOOL
169
Brian Gaeke26be9c52004-01-13 06:43:16 +0000170dnl Checks for tools we can get away with not having:
171AC_PATH_PROG(DOT,[dot],[true dot])
172AC_PATH_PROG(ETAGS,[etags],[true etags])
Brian Gaeke027b7462004-01-22 21:55:15 +0000173dnl Check if we know how to tell etags we are using C++:
174etags_version=`$ETAGS --version 2>&1`
175case "$etags_version" in
176 *[Ee]xuberant*) ETAGSFLAGS="--language-force=c++" ;;
177 *GNU\ Emacs*) ETAGSFLAGS="-l c++" ;;
178 *) ETAGSFLAGS="" ;;
179esac
180AC_SUBST(ETAGSFLAGS,$ETAGSFLAGS)
Brian Gaeke26be9c52004-01-13 06:43:16 +0000181AC_PATH_PROG(PYTHON,[python],[true python])
182if test "$PYTHON" = "false"
John Criswell39827c82003-09-23 15:28:52 +0000183then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000184 AC_MSG_WARN([Python is required for the test suite, but it was not found])
John Criswell39827c82003-09-23 15:28:52 +0000185fi
Brian Gaeke26be9c52004-01-13 06:43:16 +0000186AC_PATH_PROG(QMTEST,[qmtest],[true qmtest])
187if test "$QMTEST" = "false"
John Criswell39827c82003-09-23 15:28:52 +0000188then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000189 AC_MSG_WARN([QMTest is required for the test suite, but it was not found])
John Criswell39827c82003-09-23 15:28:52 +0000190fi
John Criswellde00db22003-08-25 16:49:54 +0000191
192dnl Verify that the version of python available is high enough for qmtest
193pyversion=`$PYTHON -V 2>&1 | cut -d\ -f2`
194pymajor=`echo $pyversion | cut -d. -f1`
195pyminor=`echo $pyversion | cut -d. -f2`
196
197if test "$pymajor" -ge "2"
198then
199 if test "$pymajor" -eq "2"
200 then
201 if test "$pyminor" -lt "2"
202 then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000203 AC_MSG_WARN([QMTest requires Python 2.2 or later])
John Criswellde00db22003-08-25 16:49:54 +0000204 fi
205 fi
206else
Brian Gaeke26be9c52004-01-13 06:43:16 +0000207 AC_MSG_WARN([QMTest requires Python 2.2 or later])
John Criswellde00db22003-08-25 16:49:54 +0000208fi
John Criswell4ea390d2003-07-22 19:13:20 +0000209
210dnl Verify that the source directory is valid
211AC_CONFIG_SRCDIR(["Makefile.config.in"])
212
Brian Gaeke26be9c52004-01-13 06:43:16 +0000213dnl Checks for libraries:
John Criswell4ea390d2003-07-22 19:13:20 +0000214dnl libelf is for sparc only; we can ignore it if we don't have it
215AC_CHECK_LIB(elf, elf_begin)
216
Brian Gaeke4c423782003-10-07 05:03:36 +0000217dnl dlopen() is required for plugin support.
Brian Gaekea25d7ca2003-10-08 21:44:07 +0000218AC_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 +0000219
220dnl mallinfo is optional; the code can compile (minus features) without it
Brian Gaekea25d7ca2003-10-08 21:44:07 +0000221AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo() is available on this platform.]))
John Criswell4ea390d2003-07-22 19:13:20 +0000222
Brian Gaeke5f268f72003-12-05 19:29:01 +0000223dnl pthread locking functions are optional - but llvm will not be thread-safe
224dnl without locks.
Brian Gaeke2e3bdba2004-02-23 21:30:36 +0000225AC_SEARCH_LIBS(pthread_mutex_lock,pthread,HAVE_PTHREAD_MUTEX_LOCK=1,HAVE_PTHREAD_MUTEX_LOCK=0)
226AC_SUBST(HAVE_PTHREAD_MUTEX_LOCK)
Brian Gaeke5f268f72003-12-05 19:29:01 +0000227
Brian Gaeke26be9c52004-01-13 06:43:16 +0000228dnl Checks for header files.
229dnl We don't check for ancient stuff or things that are guaranteed to be there
230dnl by the C++ standard. We always use the <cfoo> versions of <foo.h> C headers.
John Criswell4ea390d2003-07-22 19:13:20 +0000231AC_HEADER_STDC
232AC_HEADER_SYS_WAIT
233
Brian Gaeke26be9c52004-01-13 06:43:16 +0000234dnl Checks for POSIX and other various system-specific header files
Brian Gaeke22f76462004-02-20 06:41:59 +0000235AC_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 +0000236
Brian Gaeke1133eaf2004-02-23 22:07:01 +0000237dnl Check for things that need to be included in public headers, and so
238dnl for which we may not have access to a HAVE_* preprocessor #define.
239dnl (primarily used in DataTypes.h)
240AC_CHECK_HEADER([sys/types.h],
241 [INCLUDE_SYS_TYPES_H='#include <sys/types.h>'],
242 [INCLUDE_SYS_TYPES_H=''])
243AC_SUBST(INCLUDE_SYS_TYPES_H)
244AC_CHECK_HEADER([inttypes.h],
245 [INCLUDE_INTTYPES_H='#include <inttypes.h>'],
246 [INCLUDE_INTTYPES_H=''])
247AC_SUBST(INCLUDE_INTTYPES_H)
248
John Criswell4ea390d2003-07-22 19:13:20 +0000249dnl Check for types
250AC_TYPE_PID_T
251AC_TYPE_SIZE_T
252AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found]))
253AC_CHECK_TYPES([uint64_t],,AC_MSG_ERROR([Type uint64_t required but not found]))
254AC_HEADER_TIME
255AC_STRUCT_TM
256
John Criswella0137d32003-10-13 16:22:01 +0000257dnl Check for various C features
258AC_C_PRINTF_A
259
John Criswell0021c312004-02-13 21:57:29 +0000260dnl Check for the endianness of the target
261AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
262
John Criswell4ea390d2003-07-22 19:13:20 +0000263dnl Check for C++ extensions
Brian Gaeke278a4ac2003-11-10 03:06:09 +0000264AC_CXX_HAVE_HASH_MAP
265AC_CXX_HAVE_HASH_SET
John Criswell4ea390d2003-07-22 19:13:20 +0000266AC_CXX_HAVE_STD_ITERATOR
267AC_CXX_HAVE_BI_ITERATOR
268AC_CXX_HAVE_FWD_ITERATOR
269
Brian Gaeke26be9c52004-01-13 06:43:16 +0000270dnl Checks for library functions.
John Criswell4ea390d2003-07-22 19:13:20 +0000271AC_FUNC_ALLOCA
John Criswell4ea390d2003-07-22 19:13:20 +0000272AC_FUNC_MMAP
Brian Gaeke26be9c52004-01-13 06:43:16 +0000273if test "$ac_cv_func_mmap_fixed_mapped" = "no"
274then
275 AC_MSG_ERROR([mmap() required but not found])
276fi
John Criswell4ea390d2003-07-22 19:13:20 +0000277AC_FUNC_MMAP_FILE
Brian Gaeke26be9c52004-01-13 06:43:16 +0000278if test "$ac_cv_func_mmap_file" = "no"
John Criswell4ea390d2003-07-22 19:13:20 +0000279then
280 AC_MSG_ERROR([mmap() of files required but not found])
281fi
282AC_HEADER_MMAP_ANONYMOUS
283AC_TYPE_SIGNAL
Brian Gaeke22f76462004-02-20 06:41:59 +0000284AC_CHECK_FUNCS(getcwd gettimeofday strdup strtoq strtoll backtrace)
John Criswell4ea390d2003-07-22 19:13:20 +0000285AC_CHECK_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found]))
286
John Criswellcb7a1eb2003-11-17 19:46:02 +0000287dnl Determine if the linker supports the -R option.
Brian Gaeke26be9c52004-01-13 06:43:16 +0000288AC_LINK_USE_R
John Criswellcb7a1eb2003-11-17 19:46:02 +0000289
Brian Gaeke26be9c52004-01-13 06:43:16 +0000290dnl --enable/--with command-line options:
291dnl Check whether they want to do an optimized build:
John Criswell79a8f092003-07-22 20:59:52 +0000292AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]),,enableval=no)
293if test ${enableval} = "no"
294then
295 AC_SUBST(ENABLE_OPTIMIZED,[[]])
296else
297 AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
298fi
299
John Criswellb607cc82004-02-10 22:29:06 +0000300dnl Spec 2000 Benchmarks
Alkis Evlogimenos3e58e482003-12-20 21:35:15 +0000301AC_ARG_ENABLE(spec2000,AC_HELP_STRING([--enable-spec2000],[Compile SPEC 2000 benchmarks (default is NO)]),,enableval=no)
John Criswell79a8f092003-07-22 20:59:52 +0000302if test ${enableval} = "no"
303then
John Criswell55126592003-10-07 21:57:39 +0000304 if test -d /home/vadve/shared/benchmarks/speccpu2000/benchspec
305 then
306 AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec])
307 AC_SUBST(USE_SPEC,[[USE_SPEC=1]])
308 else
309 AC_SUBST(USE_SPEC,[[]])
310 AC_SUBST(SPEC_ROOT,[])
311 fi
John Criswell79a8f092003-07-22 20:59:52 +0000312else
John Criswell55126592003-10-07 21:57:39 +0000313 if test ${enableval} = ""
314 then
315 AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec])
316 else
317 AC_SUBST(SPEC_ROOT,[${enableval}])
318 fi
John Criswell79a8f092003-07-22 20:59:52 +0000319 AC_SUBST(USE_SPEC,[[USE_SPEC=1]])
320fi
321
John Criswellb607cc82004-02-10 22:29:06 +0000322dnl Spec 95 Benchmarks
323AC_ARG_ENABLE(spec95,AC_HELP_STRING([--enable-spec95],[Compile SPEC 95 benchmarks (default is NO)]),,enableval=no)
324if test ${enableval} = "no"
325then
John Criswell542af5f2004-02-16 14:55:18 +0000326 if test -d /home/vadve/shared/benchmarks/spec95/benchspec
John Criswellb607cc82004-02-10 22:29:06 +0000327 then
John Criswell542af5f2004-02-16 14:55:18 +0000328 AC_SUBST(SPEC95_ROOT,[/home/vadve/shared/benchmarks/spec95/benchspec])
John Criswellb607cc82004-02-10 22:29:06 +0000329 AC_SUBST(USE_SPEC95,[[USE_SPEC95=1]])
330 else
331 AC_SUBST(USE_SPEC95,[[]])
332 AC_SUBST(SPEC95_ROOT,[])
333 fi
334else
335 if test ${enableval} = ""
336 then
John Criswell542af5f2004-02-16 14:55:18 +0000337 AC_SUBST(SPEC95_ROOT,[/home/vadve/shared/benchmarks/spec95/benchspec])
John Criswellb607cc82004-02-10 22:29:06 +0000338 else
339 AC_SUBST(SPEC95_ROOT,[${enableval}])
340 fi
341 AC_SUBST(USE_SPEC95,[[USE_SPEC95=1]])
342fi
343
John Criswell0538d422004-02-20 22:30:22 +0000344dnl Povray External Benchmark
345AC_ARG_ENABLE(povray,AC_HELP_STRING([--enable-povray],[Compile Povray benchmark (default is NO)]),,enableval=no)
346if test ${enableval} = "no"
347then
348 if test -d /home/vadve/criswell/Downloads/povray-3.50c
349 then
350 AC_SUBST(POVRAY_ROOT,[/home/vadve/criswell/Downloads/povray-3.50c])
351 AC_SUBST(USE_POVRAY,[[USE_POVRAY=1]])
352 else
353 AC_SUBST(USE_POVRAY,[[]])
354 AC_SUBST(POVRAY_ROOT,[])
355 fi
356else
357 if test ${enableval} = ""
358 then
359 AC_SUBST(POVRAY_ROOT,[/home/vadve/criswell/Downloads/povray-3.50c])
360 else
361 AC_SUBST(POVRAY_ROOT,[${enableval}])
362 fi
363 AC_SUBST(USE_POVRAY,[[USE_POVRAY=1]])
364fi
365
366
John Criswell79a8f092003-07-22 20:59:52 +0000367dnl Precompiled Bytecode Option
368AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]),,enableval=no)
369if test ${enableval} = "no"
370then
371 AC_SUBST(UPB,[[]])
372else
373 AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]])
374fi
375
John Criswell79a8f092003-07-22 20:59:52 +0000376dnl LLC Diff Option
377AC_ARG_ENABLE(llc_diffs,AC_HELP_STRING([--enable-llc_diffs],[Enable LLC Diffs when testing (default is YES)]),,enableval=yes)
378if test ${enableval} = "no"
379then
380 AC_SUBST(DISABLE_LLC_DIFFS,[DISABLE_LLC_DIFFS:=1])
381else
382 AC_SUBST(DISABLE_LLC_DIFFS,[[]])
383fi
384
385dnl JIT Option
John Criswellc78022e2003-07-29 19:11:58 +0000386AC_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 +0000387if test ${enableval} = "no"
388then
389 AC_SUBST(JIT,[[]])
390else
John Criswellc78022e2003-07-29 19:11:58 +0000391 case $target in
392 *i*86*)
393 AC_SUBST(JIT,[[TARGET_HAS_JIT=1]])
394 ;;
395 *sparc*)
396 AC_SUBST(JIT,[[TARGET_HAS_JIT=1]])
397 ;;
398 *)
399 AC_SUBST(JIT,[[]])
400 ;;
401 esac
John Criswell79a8f092003-07-22 20:59:52 +0000402fi
John Criswell4ea390d2003-07-22 19:13:20 +0000403
Brian Gaeke26be9c52004-01-13 06:43:16 +0000404dnl Find the LLVM GCC-based C/C++ front end
John Criswell4ea390d2003-07-22 19:13:20 +0000405AC_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 +0000406AC_MSG_CHECKING([for llvm-gcc])
407LLVM_GCC_CHECK=no
408if test -d "$LLVMGCCDIR"
409then
410 if test -x "$LLVMGCCDIR/bin/gcc"
411 then
412 LLVM_GCC_CHECK="$LLVMGCCDIR/bin/gcc"
413 fi
414fi
415llvmgccwarn=no
416AC_MSG_RESULT($LLVM_GCC_CHECK)
417if test "$LLVM_GCC_CHECK" = "no"
418then
419 llvmgccwarn=yes
420fi
Brian Gaeke908647f2003-11-16 18:37:46 +0000421AC_MSG_CHECKING([whether llvm-gcc is sane])
422LLVM_GCC_SANE=no
423if test -x "$LLVM_GCC_CHECK"
424then
425 cp /dev/null conftest.c
426 "$LLVM_GCC_CHECK" -S -o - conftest.c | grep implementation > /dev/null 2>&1
427 if test $? -eq 0
428 then
429 LLVM_GCC_SANE=yes
430 fi
431 rm conftest.c
Brian Gaeked05e39d2004-01-16 21:31:22 +0000432 llvmcc1path=`"$LLVM_GCC_CHECK" --print-prog-name=cc1`
433 AC_SUBST(LLVMCC1,$llvmcc1path)
434 llvmcc1pluspath=`"$LLVM_GCC_CHECK" --print-prog-name=cc1plus`
435 AC_SUBST(LLVMCC1PLUS,$llvmcc1pluspath)
Brian Gaeke908647f2003-11-16 18:37:46 +0000436fi
437AC_MSG_RESULT($LLVM_GCC_SANE)
438if test "$LLVM_GCC_SANE" = "no"
439then
440 llvmgccwarn=yes
441fi
442
John Criswellc78022e2003-07-29 19:11:58 +0000443dnl Location of the bytecode repository
John Criswell4ea390d2003-07-22 19:13:20 +0000444AC_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 +0000445
446dnl Location of PAPI
Chris Lattner1b9ddd52003-08-14 18:59:53 +0000447AC_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 +0000448
Brian Gaekecea9a602004-01-21 19:38:56 +0000449dnl Get libtool's idea of what the shared library suffix is.
450dnl (This is a hack; it relies on undocumented behavior.)
451AC_MSG_CHECKING([for shared library suffix])
452eval "SHLIBEXT=$shrext"
453AC_MSG_RESULT($SHLIBEXT)
454dnl Propagate it to the Makefiles and config.h (for gccld & bugpoint).
455AC_SUBST(SHLIBEXT,$SHLIBEXT)
456AC_DEFINE_UNQUOTED(SHLIBEXT,"$SHLIBEXT",
457 [Extension that shared libraries have, e.g., ".so".])
458
Brian Gaeke26be9c52004-01-13 06:43:16 +0000459dnl Create the output files
Brian Gaekec1cf4242004-02-23 18:56:05 +0000460AC_OUTPUT(Makefile.config
Brian Gaeke1133eaf2004-02-23 22:07:01 +0000461 include/Support/DataTypes.h
462 include/Support/ThreadSupport.h
Brian Gaekec1cf4242004-02-23 18:56:05 +0000463 include/Support/hash_map
Brian Gaeke2e3bdba2004-02-23 21:30:36 +0000464 include/Support/hash_set
Brian Gaeke1133eaf2004-02-23 22:07:01 +0000465 include/Support/iterator)
Brian Gaeke908647f2003-11-16 18:37:46 +0000466
Brian Gaeke26be9c52004-01-13 06:43:16 +0000467dnl Warn loudly if llvm-gcc was not obviously working
Brian Gaeke908647f2003-11-16 18:37:46 +0000468if test $llvmgccwarn = yes
469then
470 AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not])
471 AC_MSG_WARN([***** appear to be working.])
472 AC_MSG_WARN([***** ])
473 AC_MSG_WARN([***** Please check configure's --with-llvmgccdir option.])
474 AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,])
475 AC_MSG_WARN([***** but you should be able to build the llvm tools.])
476fi
Brian Gaekecea9a602004-01-21 19:38:56 +0000477