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