blob: 50c692931845ef6af12d6f29043b4502dd5d7600 [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 Criswell2d533082003-09-06 14:46:19 +000058AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile)
59AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile.multisrc)
Misha Brukman960624b2003-11-12 22:16:23 +000060AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/analyzer/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000061AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000062AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000063AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000064AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000065AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000066AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000067AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000068AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000069AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000070AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/test.in)
Misha Brukman3e910fe2003-11-12 19:39:10 +000071AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/Makefile)
Misha Brukman960624b2003-11-12 22:16:23 +000072AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/test.in)
John Criswell2d533082003-09-06 14:46:19 +000073AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile)
74AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile.singlesrc)
John Criswell2d533082003-09-06 14:46:19 +000075AC_CONFIG_MAKEFILE(tools/Makefile)
Chris Lattner5c866e12003-10-06 02:09:25 +000076AC_CONFIG_MAKEFILE(utils/Makefile)
John Criswell2d533082003-09-06 14:46:19 +000077AC_CONFIG_MAKEFILE(projects/Makefile)
John Criswell4ea390d2003-07-22 19:13:20 +000078
Brian Gaeke26be9c52004-01-13 06:43:16 +000079dnl Find the install program (needs to be done before canonical stuff)
John Criswell4ea390d2003-07-22 19:13:20 +000080AC_PROG_INSTALL
81
82dnl Check which host for which we're compiling. This will tell us which LLVM
83dnl compiler will be used for compiling SSA into object code.
84AC_CANONICAL_TARGET
85
Brian Gaeke3e66e8b2003-11-17 00:30:48 +000086dnl Set the "OS" Makefile variable based on the system we are building on.
John Criswell4ea390d2003-07-22 19:13:20 +000087dnl We will use the build machine information to set some variables.
John Criswell4ea390d2003-07-22 19:13:20 +000088case $build in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +000089 *-*-linux*)
90 AC_SUBST(OS,[Linux])
Brian Gaeke908647f2003-11-16 18:37:46 +000091 if test -d /home/vadve/lattner/local/x86/llvm-gcc
92 then
93 AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/])
94 fi
John Criswell4ea390d2003-07-22 19:13:20 +000095 ;;
96
Brian Gaeke3e66e8b2003-11-17 00:30:48 +000097 *-*-solaris*)
98 AC_SUBST(OS,[SunOS])
Brian Gaeke908647f2003-11-16 18:37:46 +000099 if test -d /home/vadve/lattner/local/sparc/llvm-gcc
100 then
101 AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/])
102 fi
John Criswell4ea390d2003-07-22 19:13:20 +0000103 ;;
104
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000105 *-*-darwin*)
106 AC_SUBST(OS,[Darwin])
107 ;;
108
John Criswell4ea390d2003-07-22 19:13:20 +0000109 *) AC_SUBST(OS,[Unknown])
110 ;;
111esac
112
John Criswell4ea390d2003-07-22 19:13:20 +0000113dnl If we are targetting a Sparc machine running Solaris, pretend that it is
114dnl V9, since that is all that we support at the moment, and autoconf will only
115dnl tell us we're a sparc.
John Criswell4ea390d2003-07-22 19:13:20 +0000116case $target in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000117 sparc*-*-solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]])
118 ;;
John Criswell4ea390d2003-07-22 19:13:20 +0000119esac
120
John Criswell4ea390d2003-07-22 19:13:20 +0000121dnl Determine what our target architecture is and configure accordingly.
122dnl This will allow Makefiles to make a distinction between the hardware and
123dnl the OS.
John Criswell4ea390d2003-07-22 19:13:20 +0000124case $target in
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000125 i*86-*) AC_SUBST(ARCH,[x86])
John Criswell4ea390d2003-07-22 19:13:20 +0000126 ;;
Brian Gaeke3e66e8b2003-11-17 00:30:48 +0000127 sparc*-*) AC_SUBST(ARCH,[Sparc])
128 ;;
129 powerpc*-*) AC_SUBST(ARCH,[PowerPC])
130 ;;
131 *) AC_SUBST(ARCH,[Unknown])
John Criswell4ea390d2003-07-22 19:13:20 +0000132 ;;
133esac
134
John Criswell4ea390d2003-07-22 19:13:20 +0000135dnl Check for compilation tools
136AC_PROG_CXX
137AC_PROG_CC(gcc)
138AC_PROG_CPP
139
140dnl Ensure that compilation tools are GCC; we use GCC specific extensions
141if test "$GCC" != "yes"
142then
143 AC_MSG_ERROR([gcc required but not found])
144fi
John Criswell4ea390d2003-07-22 19:13:20 +0000145if test "$GXX" != "yes"
146then
147 AC_MSG_ERROR([g++ required but not found])
148fi
149
John Criswellde00db22003-08-25 16:49:54 +0000150dnl Verify that GCC is version 3.0 or higher
151gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1`
152if test "$gccmajor" -lt "3"
153then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000154 AC_MSG_ERROR([gcc 3.x required, but you have a lower version])
John Criswellde00db22003-08-25 16:49:54 +0000155fi
156
Brian Gaeke26be9c52004-01-13 06:43:16 +0000157dnl Check for GNU Make. We use its extensions too, so don't build without it
John Criswell4ea390d2003-07-22 19:13:20 +0000158CHECK_GNU_MAKE
159if test -z "$_cv_gnu_make_command"
160then
161 AC_MSG_ERROR([GNU Make required but not found])
162fi
163
Brian Gaeke26be9c52004-01-13 06:43:16 +0000164dnl Checks for other tools
John Criswell4ea390d2003-07-22 19:13:20 +0000165AC_PROG_FLEX
166AC_PROG_BISON
John Criswell4ea390d2003-07-22 19:13:20 +0000167AC_PROG_LIBTOOL
168
Brian Gaeke26be9c52004-01-13 06:43:16 +0000169dnl Checks for tools we can get away with not having:
170AC_PATH_PROG(DOT,[dot],[true dot])
171AC_PATH_PROG(ETAGS,[etags],[true etags])
172AC_PATH_PROG(PYTHON,[python],[true python])
173if test "$PYTHON" = "false"
John Criswell39827c82003-09-23 15:28:52 +0000174then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000175 AC_MSG_WARN([Python is required for the test suite, but it was not found])
John Criswell39827c82003-09-23 15:28:52 +0000176fi
Brian Gaeke26be9c52004-01-13 06:43:16 +0000177AC_PATH_PROG(QMTEST,[qmtest],[true qmtest])
178if test "$QMTEST" = "false"
John Criswell39827c82003-09-23 15:28:52 +0000179then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000180 AC_MSG_WARN([QMTest is required for the test suite, but it was not found])
John Criswell39827c82003-09-23 15:28:52 +0000181fi
John Criswellde00db22003-08-25 16:49:54 +0000182
183dnl Verify that the version of python available is high enough for qmtest
184pyversion=`$PYTHON -V 2>&1 | cut -d\ -f2`
185pymajor=`echo $pyversion | cut -d. -f1`
186pyminor=`echo $pyversion | cut -d. -f2`
187
188if test "$pymajor" -ge "2"
189then
190 if test "$pymajor" -eq "2"
191 then
192 if test "$pyminor" -lt "2"
193 then
Brian Gaeke26be9c52004-01-13 06:43:16 +0000194 AC_MSG_WARN([QMTest requires Python 2.2 or later])
John Criswellde00db22003-08-25 16:49:54 +0000195 fi
196 fi
197else
Brian Gaeke26be9c52004-01-13 06:43:16 +0000198 AC_MSG_WARN([QMTest requires Python 2.2 or later])
John Criswellde00db22003-08-25 16:49:54 +0000199fi
John Criswell4ea390d2003-07-22 19:13:20 +0000200
201dnl Verify that the source directory is valid
202AC_CONFIG_SRCDIR(["Makefile.config.in"])
203
Brian Gaeke26be9c52004-01-13 06:43:16 +0000204dnl Checks for libraries:
John Criswell4ea390d2003-07-22 19:13:20 +0000205dnl libelf is for sparc only; we can ignore it if we don't have it
206AC_CHECK_LIB(elf, elf_begin)
207
Brian Gaeke4c423782003-10-07 05:03:36 +0000208dnl dlopen() is required for plugin support.
Brian Gaekea25d7ca2003-10-08 21:44:07 +0000209AC_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 +0000210
211dnl mallinfo is optional; the code can compile (minus features) without it
Brian Gaekea25d7ca2003-10-08 21:44:07 +0000212AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo() is available on this platform.]))
John Criswell4ea390d2003-07-22 19:13:20 +0000213
Brian Gaeke5f268f72003-12-05 19:29:01 +0000214dnl pthread locking functions are optional - but llvm will not be thread-safe
215dnl without locks.
216AC_SEARCH_LIBS(pthread_mutex_lock,pthread,AC_DEFINE(HAVE_PTHREAD_MUTEX_LOCK,1,[Define if PThread mutexes (e.g., pthread_mutex_lock) are available in the system's thread library.]))
217
Brian Gaeke26be9c52004-01-13 06:43:16 +0000218dnl Checks for header files.
219dnl We don't check for ancient stuff or things that are guaranteed to be there
220dnl by the C++ standard. We always use the <cfoo> versions of <foo.h> C headers.
John Criswell4ea390d2003-07-22 19:13:20 +0000221AC_HEADER_STDC
222AC_HEADER_SYS_WAIT
223
Brian Gaeke26be9c52004-01-13 06:43:16 +0000224dnl Checks for POSIX and other various system-specific header files
225AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h malloc.h sys/mman.h sys/resource.h dlfcn.h link.h)
John Criswell4ea390d2003-07-22 19:13:20 +0000226
John Criswell4ea390d2003-07-22 19:13:20 +0000227dnl Check for types
228AC_TYPE_PID_T
229AC_TYPE_SIZE_T
230AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found]))
231AC_CHECK_TYPES([uint64_t],,AC_MSG_ERROR([Type uint64_t required but not found]))
232AC_HEADER_TIME
233AC_STRUCT_TM
234
John Criswella0137d32003-10-13 16:22:01 +0000235dnl Check for various C features
236AC_C_PRINTF_A
237
John Criswell4ea390d2003-07-22 19:13:20 +0000238dnl Check for C++ extensions
Brian Gaeke278a4ac2003-11-10 03:06:09 +0000239AC_CXX_HAVE_HASH_MAP
240AC_CXX_HAVE_HASH_SET
John Criswell4ea390d2003-07-22 19:13:20 +0000241AC_CXX_HAVE_EXT_SLIST
242AC_CXX_HAVE_STD_ITERATOR
243AC_CXX_HAVE_BI_ITERATOR
244AC_CXX_HAVE_FWD_ITERATOR
245
Brian Gaeke26be9c52004-01-13 06:43:16 +0000246dnl Checks for library functions.
John Criswell4ea390d2003-07-22 19:13:20 +0000247AC_FUNC_ALLOCA
John Criswell4ea390d2003-07-22 19:13:20 +0000248AC_FUNC_MMAP
Brian Gaeke26be9c52004-01-13 06:43:16 +0000249if test "$ac_cv_func_mmap_fixed_mapped" = "no"
250then
251 AC_MSG_ERROR([mmap() required but not found])
252fi
John Criswell4ea390d2003-07-22 19:13:20 +0000253AC_FUNC_MMAP_FILE
Brian Gaeke26be9c52004-01-13 06:43:16 +0000254if test "$ac_cv_func_mmap_file" = "no"
John Criswell4ea390d2003-07-22 19:13:20 +0000255then
256 AC_MSG_ERROR([mmap() of files required but not found])
257fi
258AC_HEADER_MMAP_ANONYMOUS
259AC_TYPE_SIGNAL
Brian Gaeke26be9c52004-01-13 06:43:16 +0000260AC_CHECK_FUNCS(getcwd gettimeofday strdup strtoq strtoll)
John Criswell4ea390d2003-07-22 19:13:20 +0000261AC_CHECK_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found]))
262
John Criswellcb7a1eb2003-11-17 19:46:02 +0000263dnl Determine if the linker supports the -R option.
Brian Gaeke26be9c52004-01-13 06:43:16 +0000264AC_LINK_USE_R
John Criswellcb7a1eb2003-11-17 19:46:02 +0000265
Brian Gaeke26be9c52004-01-13 06:43:16 +0000266dnl --enable/--with command-line options:
267dnl Check whether they want to do an optimized build:
John Criswell79a8f092003-07-22 20:59:52 +0000268AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]),,enableval=no)
269if test ${enableval} = "no"
270then
271 AC_SUBST(ENABLE_OPTIMIZED,[[]])
272else
273 AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
274fi
275
276dnl Spec Benchmarks
Alkis Evlogimenos3e58e482003-12-20 21:35:15 +0000277AC_ARG_ENABLE(spec2000,AC_HELP_STRING([--enable-spec2000],[Compile SPEC 2000 benchmarks (default is NO)]),,enableval=no)
John Criswell79a8f092003-07-22 20:59:52 +0000278if test ${enableval} = "no"
279then
John Criswell55126592003-10-07 21:57:39 +0000280 if test -d /home/vadve/shared/benchmarks/speccpu2000/benchspec
281 then
282 AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec])
283 AC_SUBST(USE_SPEC,[[USE_SPEC=1]])
284 else
285 AC_SUBST(USE_SPEC,[[]])
286 AC_SUBST(SPEC_ROOT,[])
287 fi
John Criswell79a8f092003-07-22 20:59:52 +0000288else
John Criswell55126592003-10-07 21:57:39 +0000289 if test ${enableval} = ""
290 then
291 AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec])
292 else
293 AC_SUBST(SPEC_ROOT,[${enableval}])
294 fi
John Criswell79a8f092003-07-22 20:59:52 +0000295 AC_SUBST(USE_SPEC,[[USE_SPEC=1]])
296fi
297
298dnl Precompiled Bytecode Option
299AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]),,enableval=no)
300if test ${enableval} = "no"
301then
302 AC_SUBST(UPB,[[]])
303else
304 AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]])
305fi
306
John Criswell79a8f092003-07-22 20:59:52 +0000307dnl LLC Diff Option
308AC_ARG_ENABLE(llc_diffs,AC_HELP_STRING([--enable-llc_diffs],[Enable LLC Diffs when testing (default is YES)]),,enableval=yes)
309if test ${enableval} = "no"
310then
311 AC_SUBST(DISABLE_LLC_DIFFS,[DISABLE_LLC_DIFFS:=1])
312else
313 AC_SUBST(DISABLE_LLC_DIFFS,[[]])
314fi
315
316dnl JIT Option
John Criswellc78022e2003-07-29 19:11:58 +0000317AC_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 +0000318if test ${enableval} = "no"
319then
320 AC_SUBST(JIT,[[]])
321else
John Criswellc78022e2003-07-29 19:11:58 +0000322 case $target in
323 *i*86*)
324 AC_SUBST(JIT,[[TARGET_HAS_JIT=1]])
325 ;;
326 *sparc*)
327 AC_SUBST(JIT,[[TARGET_HAS_JIT=1]])
328 ;;
329 *)
330 AC_SUBST(JIT,[[]])
331 ;;
332 esac
John Criswell79a8f092003-07-22 20:59:52 +0000333fi
John Criswell4ea390d2003-07-22 19:13:20 +0000334
Brian Gaeke26be9c52004-01-13 06:43:16 +0000335dnl Find the LLVM GCC-based C/C++ front end
John Criswell4ea390d2003-07-22 19:13:20 +0000336AC_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 +0000337AC_MSG_CHECKING([for llvm-gcc])
338LLVM_GCC_CHECK=no
339if test -d "$LLVMGCCDIR"
340then
341 if test -x "$LLVMGCCDIR/bin/gcc"
342 then
343 LLVM_GCC_CHECK="$LLVMGCCDIR/bin/gcc"
344 fi
345fi
346llvmgccwarn=no
347AC_MSG_RESULT($LLVM_GCC_CHECK)
348if test "$LLVM_GCC_CHECK" = "no"
349then
350 llvmgccwarn=yes
351fi
Brian Gaeke908647f2003-11-16 18:37:46 +0000352AC_MSG_CHECKING([whether llvm-gcc is sane])
353LLVM_GCC_SANE=no
354if test -x "$LLVM_GCC_CHECK"
355then
356 cp /dev/null conftest.c
357 "$LLVM_GCC_CHECK" -S -o - conftest.c | grep implementation > /dev/null 2>&1
358 if test $? -eq 0
359 then
360 LLVM_GCC_SANE=yes
361 fi
362 rm conftest.c
Brian Gaeked05e39d2004-01-16 21:31:22 +0000363 llvmcc1path=`"$LLVM_GCC_CHECK" --print-prog-name=cc1`
364 AC_SUBST(LLVMCC1,$llvmcc1path)
365 llvmcc1pluspath=`"$LLVM_GCC_CHECK" --print-prog-name=cc1plus`
366 AC_SUBST(LLVMCC1PLUS,$llvmcc1pluspath)
Brian Gaeke908647f2003-11-16 18:37:46 +0000367fi
368AC_MSG_RESULT($LLVM_GCC_SANE)
369if test "$LLVM_GCC_SANE" = "no"
370then
371 llvmgccwarn=yes
372fi
373
John Criswellc78022e2003-07-29 19:11:58 +0000374dnl Location of the bytecode repository
John Criswell4ea390d2003-07-22 19:13:20 +0000375AC_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 +0000376
377dnl Location of PAPI
Chris Lattner1b9ddd52003-08-14 18:59:53 +0000378AC_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 +0000379
Brian Gaekecea9a602004-01-21 19:38:56 +0000380dnl Get libtool's idea of what the shared library suffix is.
381dnl (This is a hack; it relies on undocumented behavior.)
382AC_MSG_CHECKING([for shared library suffix])
383eval "SHLIBEXT=$shrext"
384AC_MSG_RESULT($SHLIBEXT)
385dnl Propagate it to the Makefiles and config.h (for gccld & bugpoint).
386AC_SUBST(SHLIBEXT,$SHLIBEXT)
387AC_DEFINE_UNQUOTED(SHLIBEXT,"$SHLIBEXT",
388 [Extension that shared libraries have, e.g., ".so".])
389
Brian Gaeke26be9c52004-01-13 06:43:16 +0000390dnl Create the output files
John Criswell4ea390d2003-07-22 19:13:20 +0000391AC_OUTPUT(Makefile.config)
Brian Gaeke908647f2003-11-16 18:37:46 +0000392
Brian Gaeke26be9c52004-01-13 06:43:16 +0000393dnl Warn loudly if llvm-gcc was not obviously working
Brian Gaeke908647f2003-11-16 18:37:46 +0000394if test $llvmgccwarn = yes
395then
396 AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not])
397 AC_MSG_WARN([***** appear to be working.])
398 AC_MSG_WARN([***** ])
399 AC_MSG_WARN([***** Please check configure's --with-llvmgccdir option.])
400 AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,])
401 AC_MSG_WARN([***** but you should be able to build the llvm tools.])
402fi
Brian Gaekecea9a602004-01-21 19:38:56 +0000403