Ensure timestamp on saved contents of configure.ac is not changed.
[oota-llvm.git] / autoconf / configure.am
1 dnl -- configure.am - Automake based configuration --------------------------===
2 dnl
3 dnl                   The LLVM Compiler Infrastructure
4 dnl
5 dnl This file was developed by Reid Spencer and is distributed under the 
6 dnl University of Illinois Open Source License. See LICENSE.TXT for details.
7 dnl 
8 dnl ===----------------------------------------------------------------------===
9 dnl
10
11 dnl ===----------------------------------------------------------------------===
12 dnl --
13 dnl -- SECTION 1: Initialization & Setup
14 dnl --
15 dnl ===----------------------------------------------------------------------===
16
17 dnl Initialize autoconf
18 AC_INIT([[LLVM]],[[1.4]],[llvmbugs@cs.uiuc.edu])
19
20 dnl Place all of the extra autoconf files into the config subdirectory
21 dnl Tell various tools where the m4 autoconf macros are
22 dnl Have configure verify that the source directory is valid.
23 AC_CONFIG_AUX_DIR([autoconf])
24
25 dnl AC_CONFIG_MACRO_DIR(autoconf/m4)
26 dnl Verify that the source directory is valid
27 AC_CONFIG_SRCDIR(["lib/VMCore/Module.cpp"])
28
29 dnl Check which host/target for which we're compiling.  This will tell us which 
30 dnl LLVM compiler will be used for compiling SSA into object code.
31 AC_CANONICAL_TARGET
32
33 dnl Quit if the source directory has already been configured.
34 dnl NOTE: This relies upon undocumented autoconf behavior.
35 if test ${srcdir} != "." ; then
36         if test -f ${srcdir}/include/llvm/Config/config.h ; then
37                 AC_MSG_ERROR([Already configured in ${srcdir}])
38         fi
39 fi
40
41 dnl Initialize automake
42 AM_INIT_AUTOMAKE([foreign dejagnu dist-zip nostdinc -Wnone -Wunsupported -Wsyntax -Wobsolete])
43
44 dnl Make sure we are using the right version of autoconf
45 AC_PREREQ(2.59)
46
47 dnl ===----------------------------------------------------------------------===
48 dnl --
49 dnl -- SECTION 2: Setup The Command Line Arguments For "configure"
50 dnl --
51 dnl ===----------------------------------------------------------------------===
52
53 dnl Specify where to find the llvm-gcc install directory
54 AC_ARG_WITH(llvmgccdir,
55   AS_HELP_STRING([--with-llvmgccdir],[Location of LLVM GCC front-end]),
56   [case "${withval}" in
57     /*|*/*) LLVMGCCDIR=$withval ;;
58     *) AC_MSG_ERROR([bad value ${withval} for --with-llvmgccdir]) ;;
59   esac],
60   [LLVMGCCDIR=/usr/local/llvm-gcc])
61 AC_SUBST(LLVMGCCDIR)
62
63 dnl Specify whether to build optimized or not
64 AC_ARG_ENABLE(optimized,
65   AS_HELP_STRING([--enable-optimized],[Build an optimized version of LLVM
66   (default=no)]),
67   [case "${withval}" in
68     yes) ENABLE_OPTIMIZED=1 ;;
69     no)  ENABLE_OPTIMIZED=0 ;;
70     "")  ENABLE_OPTIMIZED=0 ;;
71     *)   AC_MSG_ERROR([bad value ${withval} for --enable-optimized]) ;;
72   esac],
73   [ENABLE_OPTIMIZED=0])
74 AC_SUBST(ENABLE_OPTIMIZED)
75 AM_CONDITIONAL(ENABLE_OPTIMIZED,test $ENABLE_OPTIMIZED = 1)
76
77 dnl Specify whether to build profiled or not
78 AC_ARG_ENABLE(profiled,
79   AS_HELP_STRING([--enable-profiled],[Build a profiled version of LLVM
80   (default=no)]),
81   [case "${withval}" in
82     yes) ENABLE_PROFILED=1 ;;
83     no)  ENABLE_PROFILED=0 ;;
84     "")  ENABLE_PROFILED=0 ;;
85     *)   AC_MSG_ERROR([bad value ${withval} for --enable-profiled]) ;;
86   esac],
87   [ENABLE_PROFILED=0])
88 AC_SUBST(ENABLE_PROFILED,$ENABLE_PROFILED)
89 AM_CONDITIONAL(ENABLE_PROFILED,test $ENABLE_PROFILED = 1)
90
91 dnl JIT Option
92 AC_ARG_ENABLE(jit,
93   AS_HELP_STRING([--enable-jit],
94     [Enable Just In Time Compiling (default is YES)]),,
95   enableval=default)
96
97 if test ${enableval} = "no"
98 then
99   AC_SUBST(JIT,[[]])
100 else
101   case $target in
102     *i*86*) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;;
103     *sparc*) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;;
104           *) AC_SUBST(JIT,[[]]) ;;
105   esac
106 fi
107
108 dnl ===----------------------------------------------------------------------===
109 dnl --
110 dnl -- SECTION 3: Platform/Architecture Configuration
111 dnl --
112 dnl ===----------------------------------------------------------------------===
113
114 dnl Set the "OS" Makefile variable based on the system we are building on.
115 AC_MSG_CHECKING([support for generic build operating system])
116 case $build in
117   *-*-aix*)      llvm_platform_type="AIX" ;;
118   *-*-cygwin*)   llvm_platform_type="Cygwin" ;;
119   *-*-darwin*)   llvm_platform_type="Darwin" ;;
120   *-*-freebsd*)  llvm_platform_type="FreeBSD" ;;
121   *-*-interix*)  llvm_platform_type="Interix" ;;
122   *-*-linux*)    llvm_platform_type="Linux" ;;
123   *-*-solaris*)  llvm_platform_type="SunOS" ;;
124   *-*-win32*)    llvm_platform_type="Win32" ;;
125   *-*-mingw*)    llvm_platform_type="Win32" ;;
126   *)   
127     AC_MSG_ERROR([Platform is unknown, configure can't continue])
128     llvm_platform_type="Unknown"
129     ;;
130 esac
131 AC_SUBST(OS,$llvm_platform_type)
132 AC_MSG_RESULT($llvm_platform_type)
133
134 AC_MSG_CHECKING(target architecture)
135 dnl If we are targetting a Sparc machine running Solaris, pretend that it is
136 dnl V9, since that is all that we support at the moment, and autoconf will only
137 dnl tell us we're a sparc.
138 case $target in
139   sparc*-*-solaris*)  AC_SUBST(target,[[sparcv9-sun-solaris2.8]]) ;;
140 esac
141
142 dnl Determine what our target architecture is and configure accordingly.
143 dnl This will allow Makefiles to make a distinction between the hardware and
144 dnl the OS.
145 case $target in
146   i*86-*)      ARCH="x86" ;;
147   sparc*-*)    ARCH="Sparc" ;;
148   powerpc*-*)  ARCH="PowerPC" ;;
149         *)     ARCH="Unknown";;
150 esac
151 AM_CONDITIONAL(ARCH_X86,test $ARCH = "x86")
152 AM_CONDITIONAL(ARCH_SPARC,test $ARCH = "Sparc")
153 AM_CONDITIONAL(ARCH_PPC,test $ARCH = "PowerPC")
154 AM_CONDITIONAL(ARCH_UNKNOWN,test $ARCH = "Unknown")
155 AC_SUBST(ARCH,$ARCH)
156 AC_MSG_RESULT($ARCH)
157
158 dnl Check for the endianness of the target
159 AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
160
161 dnl ===----------------------------------------------------------------------===
162 dnl --
163 dnl -- SECTION 4: Check For Programs We Need
164 dnl --
165 dnl ===----------------------------------------------------------------------===
166
167 dnl Find the install program (needs to be done before canonical stuff)
168 AC_PROG_INSTALL
169
170 dnl Check for compilation tools
171 AC_PROG_CXX
172 AC_PROG_CC(gcc)
173 AC_PROG_CPP
174
175 dnl Checks for other build tools
176 AC_PROG_FLEX
177 AC_PROG_BISON
178 AC_PROG_LIBTOOL
179
180 dnl Checks for tools we can get away with not having:
181 AC_PATH_PROG(DOT,[dot],[true dot])
182 AC_PATH_PROG(ETAGS,[etags],[true etags])
183 AC_PATH_PROG(PYTHON,[python],[true python])
184 AC_PATH_PROG(QMTEST,[qmtest],[true qmtest])
185
186 dnl ===----------------------------------------------------------------------===
187 dnl --
188 dnl -- SECTION 5: Basic sanity checks on dependent programs we need
189 dnl --
190 dnl ===----------------------------------------------------------------------===
191
192 dnl Ensure that compilation tools are GCC; we use GCC specific extensions
193 if test "$GCC" != "yes"
194 then
195   AC_MSG_ERROR([gcc required but not found])
196 fi
197
198 dnl Ensure that compilation tools are GCC; we use GCC specific extensions
199 if test "$GXX" != "yes"
200 then
201   AC_MSG_ERROR([g++ required but not found])
202 fi
203
204 dnl Verify that GCC is version 3.0 or higher
205 gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1`
206 if test "$gccmajor" -lt "3"
207 then
208   AC_MSG_ERROR([gcc 3.x required, but you have a lower version])
209 fi
210
211 dnl Check for GNU Make.  We use its extensions too, so don't build without it
212 AC_CHECK_GNU_MAKE
213 if test -z "$_cv_gnu_make_command"
214 then
215   AC_MSG_ERROR([GNU Make required but not found])
216 fi
217
218 dnl Find the LLVM GCC-based C/C++ front end
219 AC_MSG_CHECKING([for llvm-gcc])
220 LLVM_GCC_CHECK=no
221 if test -d "$LLVMGCCDIR"
222 then
223   if test -x "$LLVMGCCDIR/bin/gcc"
224   then
225     LLVM_GCC_CHECK="$LLVMGCCDIR/bin/gcc"
226   fi
227 fi
228 llvmgccwarn=no
229 AC_MSG_RESULT($LLVM_GCC_CHECK)
230 if test "$LLVM_GCC_CHECK" = "no"
231 then
232     llvmgccwarn=yes
233 fi
234
235 dnl Determine if the "gcc" found produces LLVM assembly. If so its "sane"
236 AC_MSG_CHECKING([whether llvm-gcc is sane])
237 LLVM_GCC_SANE=no
238 if test -x "$LLVM_GCC_CHECK"
239 then
240   cp /dev/null conftest.c
241   "$LLVM_GCC_CHECK" -S -o - conftest.c | grep implementation > /dev/null 2>&1
242   if test $? -eq 0
243   then
244     LLVM_GCC_SANE=yes
245   fi
246   rm conftest.c
247   llvmcc1path=`"$LLVM_GCC_CHECK" --print-prog-name=cc1`
248   AC_SUBST(LLVMCC1,$llvmcc1path)
249   llvmcc1pluspath=`"$LLVM_GCC_CHECK" --print-prog-name=cc1plus`
250   AC_SUBST(LLVMCC1PLUS,$llvmcc1pluspath)
251 fi
252 AC_MSG_RESULT($LLVM_GCC_SANE)
253 if test "$LLVM_GCC_SANE" = "no"
254 then
255   llvmgccwarn=yes
256 fi
257
258 dnl Check if we know how to tell etags we are using C++:
259 etags_version=`$ETAGS --version 2>&1`
260 case "$etags_version" in
261   *[Ee]xuberant*) ETAGSFLAGS="--language-force=c++" ;;
262   *GNU\ Emacs*) ETAGSFLAGS="-l c++" ;;
263   *) ETAGSFLAGS="" ;;
264 esac
265 AC_SUBST(ETAGSFLAGS,$ETAGSFLAGS)
266
267 if test "$PYTHON" = "false"
268 then
269   AC_MSG_WARN([Python is required for the test suite, but it was not found])
270 fi
271 if test "$QMTEST" = "false"
272 then
273   AC_MSG_WARN([QMTest is required for the test suite, but it was not found])
274 fi
275
276 dnl Verify that the version of python available is high enough for qmtest
277 pyversion=`$PYTHON -V 2>&1 | cut -d\  -f2`
278 pymajor=`echo $pyversion | cut -d. -f1`
279 pyminor=`echo $pyversion | cut -d. -f2`
280
281 if test "$pymajor" -ge "2"
282 then
283   if test "$pymajor" -eq "2"
284   then
285     if test "$pyminor" -lt "2"
286     then
287       AC_MSG_WARN([QMTest requires Python 2.2 or later])
288     fi
289   fi
290 else
291   AC_MSG_WARN([QMTest requires Python 2.2 or later])
292 fi
293
294 dnl ===----------------------------------------------------------------------===
295 dnl --
296 dnl -- SECTION 6: Check For Needed Libraries
297 dnl --
298 dnl ===----------------------------------------------------------------------===
299
300 dnl libelf is for sparc only; we can ignore it if we don't have it
301 AC_CHECK_LIB(elf, elf_begin)
302
303 dnl Check for bzip2 and zlib compression libraries needed for archive 
304 dnl reading/writing
305 AC_CHECK_LIB(bz2,BZ2_bzCompressInit,[bzip2_found=1],[bzip2_found=0])
306 AC_CHECK_LIB(z,gzopen,[zlib_found=1],[zlib_found=0])
307
308 dnl dlopen() is required for plugin support.
309 AC_SEARCH_LIBS(dlopen,dl,
310   AC_DEFINE([HAVE_DLOPEN],[1],
311             [Define if dlopen() is available on this platform.]),
312     AC_MSG_WARN([dlopen() not found - disabling plugin support]))
313
314 dnl mallinfo is optional; the code can compile (minus features) without it
315 AC_SEARCH_LIBS(mallinfo,malloc,
316   AC_DEFINE([HAVE_MALLINFO],[1],
317     [Define if mallinfo() is available on this platform.]))
318
319 dnl pthread locking functions are optional - but llvm will not be thread-safe
320 dnl without locks.
321 AC_SEARCH_LIBS(pthread_mutex_lock,pthread,
322   AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],[Have pthread_mutex_lock]))
323
324
325 dnl ===----------------------------------------------------------------------===
326 dnl --
327 dnl -- SECTION 7: Check For Needed Header Files
328 dnl --
329 dnl ===----------------------------------------------------------------------===
330
331 dnl We don't check for ancient stuff or things that are guaranteed to be there
332 dnl by the C++ standard. We always use the <cfoo> versions of <foo.h> C headers.
333 AC_HEADER_STDC
334 AC_HEADER_SYS_WAIT
335 AC_HEADER_TIME
336 AC_HEADER_MMAP_ANONYMOUS
337
338 dnl Checks for POSIX and other various system-specific header files
339 AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h malloc.h sys/mman.h)
340 AC_CHECK_HEADERS(sys/resource.h dlfcn.h link.h execinfo.h windows.h)
341
342 dnl Check for things that need to be included in public headers, and so
343 dnl for which we may not have access to a HAVE_* preprocessor #define.
344 dnl (primarily used in DataTypes.h)
345 AC_CHECK_HEADER([sys/types.h])
346 AC_CHECK_HEADER([inttypes.h])
347 AC_CHECK_HEADER([stdint.h])
348
349 dnl Checks for compression headers:
350 AC_CHECK_HEADERS([bzlib.h],[bzlib_h_found=1],[bzlib_h_found=0],[])
351 AC_CHECK_HEADERS([zlib.h],[zlib_h_found=1],[zlib_h_found=0],[])
352
353 dnl ===----------------------------------------------------------------------===
354 dnl --
355 dnl -- SECTION 8: Check for specific features (types/functions/options/etc)
356 dnl --
357 dnl ===----------------------------------------------------------------------===
358
359 dnl Check for types
360 AC_TYPE_PID_T
361 AC_TYPE_SIZE_T
362 AC_TYPE_SIGNAL
363 AC_STRUCT_TM
364 AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found]))
365 AC_CHECK_TYPES([uint64_t],,
366   AC_CHECK_TYPES([u_int64_t],,
367     AC_MSG_ERROR([Type uint64_t or u_int64_t required but not found])))
368
369 dnl Check for various C features
370 AC_C_PRINTF_A
371 AC_FUNC_ISNAN
372 AC_FUNC_ISINF
373 AC_FUNC_ALLOCA
374 AC_FUNC_MMAP
375 if test "$ac_cv_func_mmap_fixed_mapped" = "no"
376 then
377   AC_MSG_WARN([mmap() required but not found])
378 fi
379 AC_FUNC_MMAP_FILE
380 if test "$ac_cv_func_mmap_file" = "no"
381 then
382   AC_MSG_WARN([mmap() of files required but not found])
383 fi
384 AC_CHECK_FUNCS(getcwd gettimeofday strdup strtoq strtoll backtrace isatty)
385 AC_CHECK_FUNCS(mkstemp getrusage)
386 AC_CHECK_FUNC(mprotect,,
387   AC_MSG_ERROR([Function mprotect() required but not found]))
388
389 dnl Check for C++ extensions
390 AC_CXX_HAVE_HASH_MAP
391 AC_CXX_HAVE_HASH_SET
392 AC_CXX_HAVE_STD_ITERATOR
393 AC_CXX_HAVE_BI_ITERATOR
394 AC_CXX_HAVE_FWD_ITERATOR
395
396 dnl Determine if the linker supports the -R option.
397 AC_LINK_USE_R
398
399 dnl ===----------------------------------------------------------------------===
400 dnl --
401 dnl -- SECTION 9: Remaining LLVM specific configuration items
402 dnl --
403 dnl ===----------------------------------------------------------------------===
404
405 dnl Set up substitutions for compression libraries 
406 if test $zlib_found -eq 1 -a $zlib_h_found -eq 1; then
407   AC_DEFINE([HAVE_ZLIB],[1],
408     [Define if zlib library is available on this platform.])
409   AC_SUBST([HAVE_ZLIB],[1])
410 else
411   AC_SUBST([HAVE_ZLIB],[0])
412 fi
413 if test $bzip2_found -eq 1 -a $bzlib_h_found -eq 1 ; then
414   AC_DEFINE([HAVE_BZIP2],[1],
415     [Define if bzip2 library is available on this platform.])
416   AC_SUBST([HAVE_BZIP2],[1])
417 else
418   AC_SUBST([HAVE_BZIP2],[0])
419 fi
420
421 dnl Get libtool's idea of what the shared library suffix is.
422 dnl This is a hack; it relies on undocumented behavior.
423 AC_MSG_CHECKING([for shared library suffix])
424 eval "SHLIBEXT=$shrext_cmds"
425 AC_MSG_RESULT($SHLIBEXT)
426
427 dnl Propagate it to the Makefiles and config.h (for gccld & bugpoint).
428 AC_SUBST(SHLIBEXT,$SHLIBEXT)
429 AC_DEFINE_UNQUOTED(SHLIBEXT,"$SHLIBEXT",
430   [Extension that shared libraries have, e.g., ".so".])
431
432 # Translate the various configuration directories and other basic
433 # information into substitutions that will end up in config.h.in so
434 # that these configured values can be hard-wired into a program.
435 eval LLVM_PREFIX="${prefix}";
436 eval LLVM_BINDIR="${prefix}/bin";
437 eval LLVM_LIBDIR="${prefix}/lib";
438 eval LLVM_DATADIR="${prefix}/data";
439 eval LLVM_DOCSDIR="${prefix}/docs";
440 eval LLVM_ETCDIR="${prefix}/etc";
441 eval LLVM_INCLUDEDIR="${prefix}/include";
442 eval LLVM_INFODIR="${prefix}/info";
443 eval LLVM_MANDIR="${prefix}/man";
444 LLVM_CONFIGTIME=`date`
445
446 AC_SUBST(LLVM_PREFIX)
447 AC_SUBST(LLVM_BINDIR)
448 AC_SUBST(LLVM_LIBDIR)
449 AC_SUBST(LLVM_DATADIR)
450 AC_SUBST(LLVM_DOCSDIR)
451 AC_SUBST(LLVM_ETCDIR)
452 AC_SUBST(LLVM_INCLUDEDIR)
453 AC_SUBST(LLVM_INFODIR)
454 AC_SUBST(LLVM_MANDIR)
455 AC_SUBST(LLVM_CONFIGTIME)
456
457 AC_DEFINE_UNQUOTED(LLVM_PREFIX,"$LLVM_PREFIX", 
458   [Installation prefix directory])
459 AC_DEFINE_UNQUOTED(LLVM_BINDIR, "$LLVM_BINDIR", 
460   [Installation directory for binary executables])
461 AC_DEFINE_UNQUOTED(LLVM_LIBDIR, "$LLVM_LIBDIR", 
462   [Installation directory for libraries])
463 AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DATADIR", 
464   [Installation directory for data files])
465 AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DOCSDIR", 
466   [Installation directory for documentation])
467 AC_DEFINE_UNQUOTED(LLVM_ETCDIR, "$LLVM_ETCDIR", 
468   [Installation directory for config files])
469 AC_DEFINE_UNQUOTED(LLVM_INCLUDEDIR, "$LLVM_INCLUDEDIR", 
470   [Installation directory for include files])
471 AC_DEFINE_UNQUOTED(LLVM_INFODIR, "$LLVM_INFODIR", 
472   [Installation directory for .info files])
473 AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR", 
474   [Installation directory for man pages])
475 AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME", 
476   [Time at which LLVM was configured])
477
478 dnl ===----------------------------------------------------------------------===
479 dnl -- SECTION 10: Define the output and put it out
480 dnl ===----------------------------------------------------------------------===
481
482 dnl Configure header files
483 AC_CONFIG_HEADERS([include/llvm/Config/config.h])
484 AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
485 AC_CONFIG_HEADERS([include/llvm/ADT/hash_map])
486 AC_CONFIG_HEADERS([include/llvm/ADT/hash_set])
487 AC_CONFIG_HEADERS([include/llvm/Support/ThreadSupport.h])
488 AC_CONFIG_HEADERS([include/llvm/ADT/iterator])
489
490 dnl Configure makefiles
491 AC_CONFIG_FILES([Makefile])
492 AC_CONFIG_FILES([lib/Makefile])
493 AC_CONFIG_FILES([lib/Analysis/IPA/Makefile])
494 AC_CONFIG_FILES([lib/Analysis/Makefile])
495 AC_CONFIG_FILES([lib/Analysis/DataStructure/Makefile])
496 AC_CONFIG_FILES([lib/AsmParser/Makefile])
497 AC_CONFIG_FILES([lib/System/Makefile])
498 AC_CONFIG_FILES([lib/Bytecode/Reader/Makefile])
499 AC_CONFIG_FILES([lib/Bytecode/Makefile])
500 AC_CONFIG_FILES([lib/Bytecode/Writer/Makefile])
501 AC_CONFIG_FILES([lib/Bytecode/Archive/Makefile])
502 AC_CONFIG_FILES([lib/CodeGen/InstrSched/Makefile])
503 AC_CONFIG_FILES([lib/CodeGen/Makefile])
504 AC_CONFIG_FILES([lib/CodeGen/ModuloScheduling/Makefile])
505 AC_CONFIG_FILES([lib/CodeGen/SelectionDAG/Makefile])
506 AC_CONFIG_FILES([lib/Debugger/Makefile])
507 AC_CONFIG_FILES([lib/ExecutionEngine/Interpreter/Makefile])
508 AC_CONFIG_FILES([lib/ExecutionEngine/Makefile])
509 AC_CONFIG_FILES([lib/ExecutionEngine/JIT/Makefile])
510 AC_CONFIG_FILES([lib/Support/Makefile])
511 AC_CONFIG_FILES([lib/Target/CBackend/Makefile])
512 AC_CONFIG_FILES([lib/Target/Makefile])
513 AC_CONFIG_FILES([lib/Target/Skeleton/Makefile])
514 AC_CONFIG_FILES([lib/Target/PowerPC/Makefile])
515 AC_CONFIG_FILES([lib/Target/SparcV9/Makefile])
516 AC_CONFIG_FILES([lib/Target/SparcV9/LiveVar/Makefile])
517 AC_CONFIG_FILES([lib/Target/SparcV9/RegAlloc/Makefile])
518 AC_CONFIG_FILES([lib/Target/X86/Makefile])
519 AC_CONFIG_FILES([lib/Transforms/Hello/Makefile])
520 AC_CONFIG_FILES([lib/Transforms/Makefile])
521 AC_CONFIG_FILES([lib/Transforms/IPO/Makefile])
522 AC_CONFIG_FILES([lib/Transforms/Instrumentation/ProfilePaths/Makefile])
523 AC_CONFIG_FILES([lib/Transforms/Instrumentation/Makefile])
524 AC_CONFIG_FILES([lib/Transforms/Scalar/Makefile])
525 AC_CONFIG_FILES([lib/Transforms/Utils/Makefile])
526 AC_CONFIG_FILES([lib/VMCore/Makefile])
527 AC_CONFIG_FILES([utils/Makefile])
528 AC_CONFIG_FILES([utils/Burg/Makefile])
529 AC_CONFIG_FILES([utils/fpcmp/Makefile])
530 AC_CONFIG_FILES([utils/TableGen/Makefile])
531 AC_CONFIG_FILES([tools/Makefile])
532 AC_CONFIG_FILES([tools/analyze/Makefile])
533 AC_CONFIG_FILES([tools/llvmc/Makefile])
534 AC_CONFIG_FILES([tools/bugpoint/Makefile])
535 AC_CONFIG_FILES([tools/extract/Makefile])
536 AC_CONFIG_FILES([tools/gccas/Makefile])
537 AC_CONFIG_FILES([tools/gccld/Makefile])
538 AC_CONFIG_FILES([tools/llvm-bcanalyzer/Makefile])
539 AC_CONFIG_FILES([tools/llc/Makefile])
540 AC_CONFIG_FILES([tools/llee/Makefile])
541 AC_CONFIG_FILES([tools/lli/Makefile])
542 AC_CONFIG_FILES([tools/llvm-ar/Makefile])
543 AC_CONFIG_FILES([tools/llvm-as/Makefile])
544 AC_CONFIG_FILES([tools/llvm-db/Makefile])
545 AC_CONFIG_FILES([tools/llvm-dis/Makefile])
546 AC_CONFIG_FILES([tools/llvm-link/Makefile])
547 AC_CONFIG_FILES([tools/llvm-nm/Makefile])
548 AC_CONFIG_FILES([tools/llvm-prof/Makefile])
549 AC_CONFIG_FILES([tools/opt/Makefile])
550 AC_CONFIG_FILES([tools/llvm-ld/Makefile])
551 AC_CONFIG_FILES([tools/llvm-stub/Makefile])
552
553 dnl Make a link from lib/System/platform to lib/System/$llvm_platform_type
554 dnl This helps the #inclusion of the system specific include files
555 dnl for the operating system abstraction library
556 AC_CONFIG_LINKS(lib/System/platform:lib/System/$llvm_platform_type)
557
558 dnl Configure all of the projects present in our source tree.
559 for i in `ls ${srcdir}/projects`
560 do
561   if test -d ${srcdir}/projects/${i} ; then
562     case ${i} in
563       "CVS") ;;
564       "sample")       AC_CONFIG_SUBDIRS([projects/sample])    ;;
565       "Stacker")      AC_CONFIG_SUBDIRS([projects/Stacker])   ;;
566       "llvm-test")    AC_CONFIG_SUBDIRS([projects/llvm-test]) ;;
567       "llvm-reopt")   AC_CONFIG_SUBDIRS([projects/llvm-reopt]);;
568       "llvm-gcc")     AC_CONFIG_SUBDIRS([projects/llvm-gcc])  ;;
569       "Java")         AC_CONFIG_SUBDIRS([projects/Java])      ;;
570       "llvm-tv")      AC_CONFIG_SUBDIRS([projects/llvm-tv])   ;;
571       "llvm-fefw")    AC_CONFIG_SUBDIRS([projects/llvm-fefw]) ;;
572       *)              
573         AC_MSG_WARN([Unknown project (${i}) won't be configured automatically])
574         ;;
575     esac
576   fi
577 done
578 dnl Create the output files
579 AC_OUTPUT
580
581 dnl ===----------------------------------------------------------------------===
582 dnl -- SECTION 11: Output warnings to user (always last so they see it)
583 dnl ===----------------------------------------------------------------------===
584
585 dnl Warn if we don't have a compression library
586 if test $bzip2_found -ne 1 ; then
587   if test $zlib_found -ne 1 ; then
588     AC_MSG_WARN([*** Neither zlib nor bzip2 compression libraries were found.])
589     AC_MSG_WARN([*** Bytecode archives will not support compression!])
590     AC_MSG_WARN([*** To correct, install the libraries and re-run configure.])
591   fi
592 fi
593
594 dnl Warn loudly if llvm-gcc was not obviously working
595 if test $llvmgccwarn = yes
596 then
597   AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not])
598   AC_MSG_WARN([***** appear to be working.])
599   AC_MSG_WARN([***** ])
600   AC_MSG_WARN([***** Please check configure's --with-llvmgccdir option.])
601   AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,])
602   AC_MSG_WARN([***** but you should be able to build the llvm tools.])
603 fi