blob: 6534ae7c0d48efea418fb4f67c3ff8d478118ed9 [file] [log] [blame]
John Criswell4ea390d2003-07-22 19:13:20 +00001dnl Autoconf requirements
2dnl AC_INIT(package, version, bug-report-address)
3dnl information on the package
4dnl checks for programs
5dnl checks for libraries
6dnl checks for header files
7dnl checks for types
8dnl checks for structures
9dnl checks for compiler characteristics
10dnl checks for library functions
11dnl checks for system services
12dnl AC_CONFIG_FILES([file...])
13dnl AC_OUTPUT
14
15dnl **************************************************************************
16dnl * Initialize
17dnl **************************************************************************
18AC_INIT([[[LLVM]]],[[[1.0]]],[llvmbugs@cs.uiuc.edu])
19
20dnl Place all of the extra autoconf files into the config subdirectory
21AC_CONFIG_AUX_DIR([autoconf])
22
John Criswell93e1c722003-09-15 17:04:06 +000023dnl Quit if the source directory has already been configured.
John Criswell1b824322003-09-15 17:19:42 +000024dnl NOTE: This relies upon undocumented autoconf behavior.
25if test ${srcdir} != "."
John Criswell93e1c722003-09-15 17:04:06 +000026then
John Criswell1b824322003-09-15 17:19:42 +000027 if test -f ${srcdir}/include/Config/config.h
28 then
29 AC_MSG_ERROR([Already configured in ${srcdir}])
30 fi
John Criswell93e1c722003-09-15 17:04:06 +000031fi
32
John Criswell33a911a2003-11-25 20:36:46 +000033dnl
34dnl Configure all of the projects present in our source tree.
35dnl
36for i in `ls ${srcdir}/projects`
37do
38 if test ${i} != "CVS"
39 then
John Criswell9493c972003-12-12 20:09:33 +000040 if test -f ${srcdir}/projects/${i}/configure
John Criswell33a911a2003-11-25 20:36:46 +000041 then
42 AC_CONFIG_SUBDIRS(projects/${i})
43 fi
44 fi
45done
John Criswell559a6c12003-09-30 16:31:48 +000046
John Criswell4ea390d2003-07-22 19:13:20 +000047dnl Configure a header file
48AC_CONFIG_HEADERS(include/Config/config.h)
John Criswell2d533082003-09-06 14:46:19 +000049AC_CONFIG_MAKEFILE(Makefile)
50AC_CONFIG_MAKEFILE(Makefile.common)
John Criswell2d533082003-09-06 14:46:19 +000051AC_CONFIG_MAKEFILE(lib/Makefile)
John Criswell2d533082003-09-06 14:46:19 +000052AC_CONFIG_MAKEFILE(runtime/Makefile)
John Criswell2d533082003-09-06 14:46:19 +000053AC_CONFIG_MAKEFILE(test/Makefile)
54AC_CONFIG_MAKEFILE(test/Makefile.tests)
John Criswellf424d742003-10-07 21:13:47 +000055AC_CONFIG_MAKEFILE(test/QMTest/llvm.py)
56AC_CONFIG_MAKEFILE(test/QMTest/llvmdb.py)
John Criswell2d533082003-09-06 14:46:19 +000057AC_CONFIG_MAKEFILE(test/Programs/Makefile)
58AC_CONFIG_MAKEFILE(test/Programs/Makefile.programs)
59AC_CONFIG_MAKEFILE(test/Programs/TEST.aa.Makefile)
60AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.report)
61AC_CONFIG_MAKEFILE(test/Programs/TEST.micro.report)
62AC_CONFIG_MAKEFILE(test/Programs/TEST.aa.report)
63AC_CONFIG_MAKEFILE(test/Programs/TEST.example.Makefile)
64AC_CONFIG_MAKEFILE(test/Programs/TEST.nightly.Makefile)
65AC_CONFIG_MAKEFILE(test/Programs/TEST.buildrepo.Makefile)
66AC_CONFIG_MAKEFILE(test/Programs/TEST.jit.Makefile)
67AC_CONFIG_MAKEFILE(test/Programs/TEST.nightly.report)
68AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.Makefile)
69AC_CONFIG_MAKEFILE(test/Programs/TEST.jit.report)
70AC_CONFIG_MAKEFILE(test/Programs/TEST.typesafe.Makefile)
71AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.gnuplot)
72AC_CONFIG_MAKEFILE(test/Programs/TEST.micro.Makefile)
73AC_CONFIG_MAKEFILE(test/Programs/External/Makefile)
74AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile)
John Criswell27bb35e2003-09-11 18:04:00 +000075AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec)
John Criswell2d533082003-09-06 14:46:19 +000076AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile)
77AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile.multisrc)
Misha Brukman960624b2003-11-12 22:16:23 +000078AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/analyzer/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000079AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000080AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000081AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000082AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000083AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000084AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000085AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000086AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000087AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000088AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000089AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000090AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/test.in)
John Criswell2d533082003-09-06 14:46:19 +000091AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile)
92AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile.singlesrc)
John Criswell2d533082003-09-06 14:46:19 +000093AC_CONFIG_MAKEFILE(tools/Makefile)
Chris Lattner5c866e12003-10-06 02:09:25 +000094AC_CONFIG_MAKEFILE(utils/Makefile)
John Criswell2d533082003-09-06 14:46:19 +000095AC_CONFIG_MAKEFILE(projects/Makefile)
John Criswell4ea390d2003-07-22 19:13:20 +000096
97dnl **************************************************************************
98dnl * Determine which system we are building on
99dnl **************************************************************************
100
101dnl Check the install program (needs to be done before canonical stuff)
102AC_PROG_INSTALL
103
104dnl Check which host for which we're compiling. This will tell us which LLVM
105dnl compiler will be used for compiling SSA into object code.
106AC_CANONICAL_TARGET
107
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000108dnl Set the "OS" Makefile variable based on the system we are building on.
John Criswell4ea390d2003-07-22 19:13:20 +0000109dnl We will use the build machine information to set some variables.
John Criswell4ea390d2003-07-22 19:13:20 +0000110case $build in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000111 *-*-linux*)
112 AC_SUBST(OS,[Linux])
Brian Gaeke908647f2003-11-16 18:37:46 +0000113 if test -d /home/vadve/lattner/local/x86/llvm-gcc
114 then
115 AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/])
116 fi
John Criswell4ea390d2003-07-22 19:13:20 +0000117 ;;
118
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000119 *-*-solaris*)
120 AC_SUBST(OS,[SunOS])
Brian Gaeke908647f2003-11-16 18:37:46 +0000121 if test -d /home/vadve/lattner/local/sparc/llvm-gcc
122 then
123 AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/])
124 fi
John Criswell4ea390d2003-07-22 19:13:20 +0000125 ;;
126
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000127 *-*-darwin*)
128 AC_SUBST(OS,[Darwin])
129 ;;
130
John Criswell4ea390d2003-07-22 19:13:20 +0000131 *) AC_SUBST(OS,[Unknown])
132 ;;
133esac
134
John Criswell4ea390d2003-07-22 19:13:20 +0000135dnl If we are targetting a Sparc machine running Solaris, pretend that it is
136dnl V9, since that is all that we support at the moment, and autoconf will only
137dnl tell us we're a sparc.
John Criswell4ea390d2003-07-22 19:13:20 +0000138case $target in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000139 sparc*-*-solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]])
140 ;;
John Criswell4ea390d2003-07-22 19:13:20 +0000141esac
142
John Criswell4ea390d2003-07-22 19:13:20 +0000143dnl Determine what our target architecture is and configure accordingly.
144dnl This will allow Makefiles to make a distinction between the hardware and
145dnl the OS.
John Criswell4ea390d2003-07-22 19:13:20 +0000146case $target in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000147 i*86-*) AC_SUBST(ARCH,[x86])
John Criswell4ea390d2003-07-22 19:13:20 +0000148 ;;
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000149 sparc*-*) AC_SUBST(ARCH,[Sparc])
150 ;;
151 powerpc*-*) AC_SUBST(ARCH,[PowerPC])
152 ;;
153 *) AC_SUBST(ARCH,[Unknown])
John Criswell4ea390d2003-07-22 19:13:20 +0000154 ;;
155esac
156
157dnl **************************************************************************
158dnl * Check for programs.
159dnl **************************************************************************
160
161dnl Check for compilation tools
162AC_PROG_CXX
163AC_PROG_CC(gcc)
164AC_PROG_CPP
165
166dnl Ensure that compilation tools are GCC; we use GCC specific extensions
167if test "$GCC" != "yes"
168then
169 AC_MSG_ERROR([gcc required but not found])
170fi
171
172if test "$GXX" != "yes"
173then
174 AC_MSG_ERROR([g++ required but not found])
175fi
176
John Criswellde00db22003-08-25 16:49:54 +0000177dnl Verify that GCC is version 3.0 or higher
178gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1`
179if test "$gccmajor" -lt "3"
180then
181 AC_MSG_ERROR([gcc 3.x required])
182fi
183
John Criswell4ea390d2003-07-22 19:13:20 +0000184dnl Check for GNU Make. We use its extensions to, so don't build without it
185CHECK_GNU_MAKE
186if test -z "$_cv_gnu_make_command"
187then
188 AC_MSG_ERROR([GNU Make required but not found])
189fi
190
191dnl Check for compiler-compiler tools (reminds me of Little Caesar's Pizza)
192AC_PROG_FLEX
193AC_PROG_BISON
194
195dnl Check for libtool
196AC_PROG_LIBTOOL
197
198dnl Check for our special programs
John Criswell39827c82003-09-23 15:28:52 +0000199AC_PATH_PROG(RPWD,[pwd],[false])
200if test ${RPWD} = "false"
201then
202 AC_MSG_ERROR([pwd required but not found])
203fi
204
205AC_PATH_PROG(AR,[ar],[false])
206if test ${AR} = "false"
207then
208 AC_MSG_ERROR([ar required but not found])
209fi
210
211AC_PATH_PROG(SED,[sed],[false])
212if test ${SED} = "false"
213then
214 AC_MSG_ERROR([sed required but not found])
215fi
216
217AC_PATH_PROG(RM,[rm],[false])
218if test ${RM} = "false"
219then
220 AC_MSG_ERROR([rm required but not found])
221fi
222
223AC_PATH_PROG(ECHO,[echo],[false])
224if test ${ECHO} = "false"
225then
226 AC_MSG_ERROR([echo required but not found])
227fi
228
229AC_PATH_PROG(MKDIR,[mkdir],[false])
230if test ${MKDIR} = "false"
231then
232 AC_MSG_ERROR([mkdir required but not found])
233fi
234
235AC_PATH_PROG(DATE,[date],[false])
236if test ${DATE} = "false"
237then
238 AC_MSG_ERROR([date required but not found])
239fi
240
241AC_PATH_PROG(MV,[mv],[false])
242if test ${MV} = "false"
243then
244 AC_MSG_ERROR([mv required but not found])
245fi
246
247AC_PATH_PROG(DOT,[dot],[false])
248
249AC_PATH_PROG(ETAGS,[etags],[false])
250
John Criswell39827c82003-09-23 15:28:52 +0000251AC_PATH_PROG(PYTHON,[python],[false])
252if test ${PYTHON} = "false"
253then
John Criswell61095982003-09-23 20:46:32 +0000254 AC_MSG_WARN([python required but not found])
John Criswell39827c82003-09-23 15:28:52 +0000255fi
256
257AC_PATH_PROG(QMTEST,[qmtest],[false])
258if test ${QMTEST} = "false"
259then
John Criswell61095982003-09-23 20:46:32 +0000260 AC_MSG_WARN([qmtest required but not found])
John Criswell39827c82003-09-23 15:28:52 +0000261fi
John Criswellde00db22003-08-25 16:49:54 +0000262
263dnl Verify that the version of python available is high enough for qmtest
264pyversion=`$PYTHON -V 2>&1 | cut -d\ -f2`
265pymajor=`echo $pyversion | cut -d. -f1`
266pyminor=`echo $pyversion | cut -d. -f2`
267
268if test "$pymajor" -ge "2"
269then
270 if test "$pymajor" -eq "2"
271 then
272 if test "$pyminor" -lt "2"
273 then
Brian Gaeke908647f2003-11-16 18:37:46 +0000274 AC_MSG_WARN([Python 2.2 or greater required for qmtest])
John Criswellde00db22003-08-25 16:49:54 +0000275 fi
276 fi
277else
Brian Gaeke908647f2003-11-16 18:37:46 +0000278 AC_MSG_WARN([Python 2.2 or greater required for qmtest])
John Criswellde00db22003-08-25 16:49:54 +0000279fi
John Criswell4ea390d2003-07-22 19:13:20 +0000280
281dnl Verify that the source directory is valid
282AC_CONFIG_SRCDIR(["Makefile.config.in"])
283
284dnl **************************************************************************
285dnl * Check for libraries.
286dnl **************************************************************************
287
288dnl libelf is for sparc only; we can ignore it if we don't have it
289AC_CHECK_LIB(elf, elf_begin)
290
Brian Gaeke4c423782003-10-07 05:03:36 +0000291dnl dlopen() is required for plugin support.
Brian Gaekea25d7ca2003-10-08 21:44:07 +0000292AC_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 +0000293
294dnl mallinfo is optional; the code can compile (minus features) without it
Brian Gaekea25d7ca2003-10-08 21:44:07 +0000295AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo() is available on this platform.]))
John Criswell4ea390d2003-07-22 19:13:20 +0000296
Brian Gaeke5f268f72003-12-05 19:29:01 +0000297dnl pthread locking functions are optional - but llvm will not be thread-safe
298dnl without locks.
299AC_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.]))
300
John Criswell4ea390d2003-07-22 19:13:20 +0000301dnl
302dnl The math libraries are used by the test code, but not by the actual LLVM
303dnl code.
304dnl
305dnl AC_CHECK_LIB(m, cos)
306
307dnl **************************************************************************
308dnl * Checks for header files.
309dnl * Chances are, if the standard C or POSIX type header files are missing,
310dnl * then LLVM just isn't going to compile. However, it is possible that
311dnl * the necessary functions/macros will be included from other
312dnl * (non-standard and non-obvious) header files.
313dnl *
314dnl * So, we'll be gracious, give it a chance, and try to go on without
315dnl * them.
316dnl **************************************************************************
317AC_HEADER_STDC
318AC_HEADER_SYS_WAIT
319
320dnl Check for ANSI C/POSIX header files
321AC_CHECK_HEADERS(assert.h fcntl.h limits.h sys/time.h unistd.h errno.h signal.h math.h)
322
323dnl Check for system specific header files
Brian Gaekea493aa32003-10-22 17:52:56 +0000324AC_CHECK_HEADERS(malloc.h sys/mman.h sys/resource.h)
John Criswell4ea390d2003-07-22 19:13:20 +0000325
326dnl Check for header files associated with dlopen and friends
327AC_CHECK_HEADERS(dlfcn.h link.h)
328
329dnl **************************************************************************
330dnl * Checks for typedefs, structures, and compiler characteristics.
331dnl **************************************************************************
332
333dnl Check for const and inline keywords
334AC_C_CONST
335AC_C_INLINE
336
337dnl Check for machine endian-ness
Brian Gaekea25d7ca2003-10-08 21:44:07 +0000338AC_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 Criswell4ea390d2003-07-22 19:13:20 +0000339
340dnl Check for types
341AC_TYPE_PID_T
342AC_TYPE_SIZE_T
343AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found]))
344AC_CHECK_TYPES([uint64_t],,AC_MSG_ERROR([Type uint64_t required but not found]))
345AC_HEADER_TIME
346AC_STRUCT_TM
347
John Criswella0137d32003-10-13 16:22:01 +0000348dnl Check for various C features
349AC_C_PRINTF_A
350
John Criswell4ea390d2003-07-22 19:13:20 +0000351dnl Check for C++ extensions
Brian Gaeke278a4ac2003-11-10 03:06:09 +0000352AC_CXX_HAVE_HASH_MAP
353AC_CXX_HAVE_HASH_SET
John Criswell4ea390d2003-07-22 19:13:20 +0000354AC_CXX_HAVE_EXT_SLIST
355AC_CXX_HAVE_STD_ITERATOR
356AC_CXX_HAVE_BI_ITERATOR
357AC_CXX_HAVE_FWD_ITERATOR
358
359dnl **************************************************************************
360dnl * Checks for library functions.
361dnl **************************************************************************
362AC_FUNC_ALLOCA
363AC_PROG_GCC_TRADITIONAL
364AC_FUNC_MEMCMP
365AC_FUNC_MMAP
366AC_FUNC_MMAP_FILE
367if test ${ac_cv_func_mmap_file} = "no"
368then
369 AC_MSG_ERROR([mmap() of files required but not found])
370fi
371AC_HEADER_MMAP_ANONYMOUS
372AC_TYPE_SIGNAL
Brian Gaeke16edea02003-10-10 17:04:43 +0000373AC_CHECK_FUNCS(getcwd gettimeofday strcspn strdup strerror strspn strstr strtod strtol strtoq strtoll)
John Criswell4ea390d2003-07-22 19:13:20 +0000374
375dnl
376dnl Need to check mmap for MAP_PRIVATE, MAP_ANONYMOUS, MAP_ANON, MAP_FIXED
377dnl MAP_FIXED is only needed for Sparc
378dnl MAP_ANON is used for Sparc and BSD
379dnl Everyone should have MAP_PRIVATE
380dnl
381
382dnl Check for certain functions (even if we've already found them) so that we
383dnl can quit with an error if they are unavailable.
384dnl
385dnl As the code is made more portable (i.e. less reliant on these functions,
386dnl these checks should go away.
387AC_CHECK_FUNC(mmap,,AC_MSG_ERROR([Function mmap() required but not found]))
388AC_CHECK_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found]))
389
John Criswellcb7a1eb2003-11-17 19:46:02 +0000390dnl Determine if the linker supports the -R option.
391AC_LINK_USE_R()
392
John Criswell4ea390d2003-07-22 19:13:20 +0000393dnl **************************************************************************
394dnl * Enable various compile-time options
395dnl **************************************************************************
John Criswell79a8f092003-07-22 20:59:52 +0000396
397dnl Purify Option
398AC_ARG_ENABLE(purify,AC_HELP_STRING([--enable-purify],[Compile with purify (default is NO)]),,enableval="no")
399if test ${enableval} = "no"
400then
401 AC_SUBST(ENABLE_PURIFY,[[]])
402else
403 AC_SUBST(ENABLE_PURIFY,[[ENABLE_PURIFY=1]])
404fi
405
406dnl Optimized Option
407AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]),,enableval=no)
408if test ${enableval} = "no"
409then
410 AC_SUBST(ENABLE_OPTIMIZED,[[]])
411else
412 AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
413fi
414
415dnl Spec Benchmarks
John Criswell55126592003-10-07 21:57:39 +0000416AC_ARG_ENABLE(spec2000,AC_HELP_STRING([--enable-spec],[Compile SPEC 2000 benchmarks (default is NO)]),,enableval=no)
John Criswell79a8f092003-07-22 20:59:52 +0000417if test ${enableval} = "no"
418then
John Criswell55126592003-10-07 21:57:39 +0000419 if test -d /home/vadve/shared/benchmarks/speccpu2000/benchspec
420 then
421 AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec])
422 AC_SUBST(USE_SPEC,[[USE_SPEC=1]])
423 else
424 AC_SUBST(USE_SPEC,[[]])
425 AC_SUBST(SPEC_ROOT,[])
426 fi
John Criswell79a8f092003-07-22 20:59:52 +0000427else
John Criswell55126592003-10-07 21:57:39 +0000428 if test ${enableval} = ""
429 then
430 AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec])
431 else
432 AC_SUBST(SPEC_ROOT,[${enableval}])
433 fi
John Criswell79a8f092003-07-22 20:59:52 +0000434 AC_SUBST(USE_SPEC,[[USE_SPEC=1]])
435fi
436
437dnl Precompiled Bytecode Option
438AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]),,enableval=no)
439if test ${enableval} = "no"
440then
441 AC_SUBST(UPB,[[]])
442else
443 AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]])
444fi
445
446
447dnl LLC Diff Option
448AC_ARG_ENABLE(llc_diffs,AC_HELP_STRING([--enable-llc_diffs],[Enable LLC Diffs when testing (default is YES)]),,enableval=yes)
449if test ${enableval} = "no"
450then
451 AC_SUBST(DISABLE_LLC_DIFFS,[DISABLE_LLC_DIFFS:=1])
452else
453 AC_SUBST(DISABLE_LLC_DIFFS,[[]])
454fi
455
456dnl JIT Option
John Criswellc78022e2003-07-29 19:11:58 +0000457AC_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 +0000458
459if test ${enableval} = "no"
460then
461 AC_SUBST(JIT,[[]])
462else
John Criswellc78022e2003-07-29 19:11:58 +0000463 case $target in
464 *i*86*)
465 AC_SUBST(JIT,[[TARGET_HAS_JIT=1]])
466 ;;
467 *sparc*)
468 AC_SUBST(JIT,[[TARGET_HAS_JIT=1]])
469 ;;
470 *)
471 AC_SUBST(JIT,[[]])
472 ;;
473 esac
John Criswell79a8f092003-07-22 20:59:52 +0000474fi
John Criswell4ea390d2003-07-22 19:13:20 +0000475
476dnl **************************************************************************
477dnl * Set the location of various third-party software packages
478dnl **************************************************************************
John Criswellc78022e2003-07-29 19:11:58 +0000479
John Criswellc78022e2003-07-29 19:11:58 +0000480dnl Location of the LLVM C front end
John Criswell4ea390d2003-07-22 19:13:20 +0000481AC_ARG_WITH(llvmgccdir,AC_HELP_STRING([--with-llvmgccdir],[Location of LLVM GCC front-end]),AC_SUBST(LLVMGCCDIR,[$withval]))
John Criswellc78022e2003-07-29 19:11:58 +0000482
Brian Gaeke908647f2003-11-16 18:37:46 +0000483AC_MSG_CHECKING([for llvm-gcc])
484LLVM_GCC_CHECK=no
485if test -d "$LLVMGCCDIR"
486then
487 if test -x "$LLVMGCCDIR/bin/gcc"
488 then
489 LLVM_GCC_CHECK="$LLVMGCCDIR/bin/gcc"
490 fi
491fi
492llvmgccwarn=no
493AC_MSG_RESULT($LLVM_GCC_CHECK)
494if test "$LLVM_GCC_CHECK" = "no"
495then
496 llvmgccwarn=yes
497fi
498
499AC_MSG_CHECKING([whether llvm-gcc is sane])
500LLVM_GCC_SANE=no
501if test -x "$LLVM_GCC_CHECK"
502then
503 cp /dev/null conftest.c
504 "$LLVM_GCC_CHECK" -S -o - conftest.c | grep implementation > /dev/null 2>&1
505 if test $? -eq 0
506 then
507 LLVM_GCC_SANE=yes
508 fi
509 rm conftest.c
510fi
511AC_MSG_RESULT($LLVM_GCC_SANE)
512if test "$LLVM_GCC_SANE" = "no"
513then
514 llvmgccwarn=yes
515fi
516
John Criswellc78022e2003-07-29 19:11:58 +0000517dnl Location of the bytecode repository
John Criswell4ea390d2003-07-22 19:13:20 +0000518AC_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 +0000519
520dnl Location of PAPI
Chris Lattner1b9ddd52003-08-14 18:59:53 +0000521AC_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 +0000522
523dnl Location of the purify program
John Criswell4ea390d2003-07-22 19:13:20 +0000524AC_ARG_WITH(purify,AC_HELP_STRING([--with-purify],[Location of purify program]),AC_SUBST(PURIFY,[$withval]))
525
John Criswellc78022e2003-07-29 19:11:58 +0000526dnl **************************************************************************
John Criswellde00db22003-08-25 16:49:54 +0000527dnl * Configure other software packages (via AC_CONFIG_SUBDIRS)
528dnl **************************************************************************
529
530dnl **************************************************************************
John Criswellc78022e2003-07-29 19:11:58 +0000531dnl * Create the output files
532dnl **************************************************************************
John Criswell4ea390d2003-07-22 19:13:20 +0000533AC_OUTPUT(Makefile.config)
Brian Gaeke908647f2003-11-16 18:37:46 +0000534
535if test $llvmgccwarn = yes
536then
537 AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not])
538 AC_MSG_WARN([***** appear to be working.])
539 AC_MSG_WARN([***** ])
540 AC_MSG_WARN([***** Please check configure's --with-llvmgccdir option.])
541 AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,])
542 AC_MSG_WARN([***** but you should be able to build the llvm tools.])
543fi