configure.ac
author Stefan Ring <stefan@complang.tuwien.ac.at>
Wed, 29 Feb 2012 19:02:11 +0100
changeset 9454 532286ef9f3e
parent 9386 da81b20b5dd5
child 9458 75b2b23e443c
permissions -rw-r--r--
* configure.ac: New switch for disabling -O2 (--disable-optimizations).
     1 dnl configure.ac
     2 dnl
     3 dnl Copyright (C) 1996-2012
     4 dnl CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
     5 dnl 
     6 dnl This file is part of CACAO.
     7 dnl 
     8 dnl This program is free software; you can redistribute it and/or
     9 dnl modify it under the terms of the GNU General Public License as
    10 dnl published by the Free Software Foundation; either version 2, or (at
    11 dnl your option) any later version.
    12 dnl 
    13 dnl This program is distributed in the hope that it will be useful, but
    14 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
    15 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    16 dnl General Public License for more details.
    17 dnl 
    18 dnl You should have received a copy of the GNU General Public License
    19 dnl along with this program; if not, write to the Free Software
    20 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    21 dnl 02110-1301, USA.
    22 
    23 dnl Process this file with autoconf to produce a configure script.
    24 
    25 
    26 AC_INIT(cacao, 1.1.0pre2, cacao@cacaojvm.org)
    27 AC_CONFIG_SRCDIR(src/cacao/cacao.cpp)
    28 AC_CONFIG_AUX_DIR([.])
    29 AC_CANONICAL_HOST
    30 AC_PREREQ(2.59)
    31 AM_INIT_AUTOMAKE([1.9.0 dist-bzip2 tar-ustar])
    32 AM_MAINTAINER_MODE
    33 
    34 AM_CONFIG_HEADER([config.h])
    35 
    36 AC_PREFIX_DEFAULT(/usr/local/cacao)
    37 
    38 
    39 dnl Host CPU type.
    40 case "$host_cpu" in
    41 alpha | alphaev56 | alphapca56 )
    42     ARCH_DIR="alpha"
    43     ARCH_FLAGS="-mieee -D__ALPHA__"
    44     JAVA_ARCH="alpha"
    45     ;;
    46 
    47 arm | armv4* | armv5* | armv6* | armv7* )
    48     ARCH_DIR="arm"
    49     ARCH_FLAGS="-D__ARM__"
    50     JAVA_ARCH="arm"
    51     ;;
    52 
    53 hppa2.0 )
    54     ARCH_DIR="parisc"
    55     ARCH_FLAGS="-D__PARISC__"
    56     JAVA_ARCH="hppa"
    57     ;;
    58 
    59 i386 | i486 | i586 | i686 )
    60     ARCH_DIR="i386"
    61     ARCH_FLAGS="-m32 -D__I386__"
    62     JAVA_ARCH="i386"
    63     ;;
    64 
    65 m68k )
    66     ARCH_DIR="m68k"
    67     ARCH_FLAGS="-D__M68K__"
    68     JAVA_ARCH="m68k"
    69     ;;
    70 
    71 mips )
    72     ARCH_DIR="mips"
    73     ARCH_FLAGS="-D__MIPS__"
    74     JAVA_ARCH="mips"
    75     ;;
    76 
    77 mipsel )
    78     ARCH_DIR="mips"
    79     ARCH_FLAGS="-D__MIPS__"
    80     JAVA_ARCH="mipsel"
    81     ;;
    82 
    83 powerpc )
    84     ARCH_DIR="powerpc"
    85     ARCH_FLAGS="-m32 -D__POWERPC__"
    86     JAVA_ARCH="ppc"
    87     ;;
    88 
    89 powerpc64 )
    90     ARCH_DIR="powerpc64"
    91     ARCH_FLAGS="-m64 -D__POWERPC64__"
    92     JAVA_ARCH="ppc64"
    93     ;;
    94 
    95 s390 )
    96     ARCH_DIR="s390"
    97     ARCH_FLAGS="-D__S390__"
    98     JAVA_ARCH="s390"
    99     ;;
   100 
   101 sparc | sparc64 )
   102     ARCH_DIR="sparc64"
   103     ARCH_FLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
   104     dnl Is this correct for 64-bits?
   105     JAVA_ARCH="sparc"
   106     ;;
   107 
   108 x86_64 )
   109     ARCH_DIR="x86_64"
   110     ARCH_FLAGS="-m64 -D__X86_64__"
   111     JAVA_ARCH="amd64"
   112     ;;
   113 
   114 xdspcore )
   115     ARCH_DIR="xdspcore"
   116     ENABLE_STATICVM="yes"
   117     ARCH_FLAGS="-D__XDSPCORE__"
   118     USE_SCHEDULER="1"
   119     ;;
   120 
   121 * )
   122     AC_MSG_ERROR([$host_cpu systems are currently not supported.])
   123     ;;
   124 esac
   125 
   126 
   127 dnl Host operating system type.
   128 case "$host_os" in
   129 *cygwin* )
   130     OS_DIR="cygwin"
   131     OS_FLAGS="-D__WINDOWS__ -D__CYGWIN__"
   132     INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
   133     ;;
   134 
   135 *darwin* )
   136     OS_DIR="darwin"
   137     OS_FLAGS="-D__DARWIN__ -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE"
   138     INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
   139     ;;
   140 
   141 dnl Must be BEFORE *freebsd*.
   142 *kfreebsd*-gnu)
   143     OS_DIR="freebsd"
   144     OS_FLAGS="-D__FREEBSD__ -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
   145     INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
   146     ;;
   147 
   148 *freebsd* )
   149     OS_DIR="freebsd"
   150     OS_FLAGS="-D__FREEBSD__ -D_XOPEN_SOURCE_EXTENDED"
   151     INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
   152     ;;
   153 
   154 *irix* )
   155     OS_DIR="irix"
   156     OS_FLAGS="-D__IRIX__"
   157     INTRP_CFLAGS="$ARCH_FLAGS $OS_FLAGS"
   158     ;;
   159 
   160 dnl Must be BEFORE *linux*.
   161 *uclinux | *elf )
   162     OS_DIR="uclinux"
   163     OS_FLAGS="-D__LINUX__ -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
   164     INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
   165     ;;
   166 
   167 *linux* | *Linux* )
   168     OS_DIR="linux"
   169     OS_FLAGS="-D__LINUX__ -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
   170     INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
   171     ;;
   172 
   173 *netbsd* )
   174     OS_DIR="netbsd"
   175     OS_FLAGS="-D__NETBSD__ -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
   176     INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
   177     ;;
   178 
   179 *solaris* )
   180     OS_DIR="solaris"
   181     dnl On solaris the architecture defines 'sparc', 'sun', 'unix' are
   182     dnl not set when cpp is called with -std=c99, therefore we add them
   183     dnl here.
   184     OS_FLAGS="-D__SOLARIS__ -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -D_BSD_SOURCE"
   185     CC_FLAGS="-D_XOPEN_SOURCE=600"
   186     CXX_FLAGS="-D_XOPEN_SOURCE=500"
   187     INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
   188     ;;
   189 
   190 * )
   191     AC_MSG_ERROR([$host_os operating systems are currently not supported.])
   192     ;;
   193 esac
   194 
   195 
   196 AC_MSG_CHECKING(whether to disable optimizations and build with -g -O0)
   197 AC_ARG_ENABLE([optimizations],
   198               [AS_HELP_STRING(--disable-optimizations,build with -g -O0 [[default=no]])],
   199               [case "${enableval}" in
   200                    no) disable_optimizations=yes;;
   201                    *) disable_optimizations=no;;
   202                esac],
   203               [disable_optimizations=no])
   204 AC_MSG_RESULT(${disable_optimizations})
   205 
   206 dnl Set optimization and debugging for all architectures and systems.
   207 dnl NOTE: Setting the CFLAGS/CXXFLAGS only works before calling AC_PROG_CC/AC_PROG_CXX.
   208 if test x"$CFLAGS" = "x"; then
   209     OPT_CFLAGS="-g"
   210 else
   211     OPT_CFLAGS=$CFLAGS
   212 fi
   213 if test x"${disable_optimizations}" = "xyes"; then
   214     OPT_CFLAGS="$OPT_CFLAGS -O0"
   215 else
   216     OPT_CFLAGS="$OPT_CFLAGS -O2"
   217 fi
   218 OPT_CFLAGS="$OPT_CFLAGS -fno-strict-aliasing"
   219 
   220 if test x"$CXXFLAGS" = "x"; then
   221     OPT_CXXFLAGS="-g"
   222 else
   223     OPT_CXXFLAGS=$CXXFLAGS
   224 fi
   225 if test x"${disable_optimizations}" = "xyes"; then
   226     OPT_CXXFLAGS="$OPT_CXXFLAGS -O0"
   227 else
   228     OPT_CXXFLAGS="$OPT_CXXFLAGS -O2"
   229 fi
   230 OPT_CXXFLAGS="$OPT_CXXFLAGS -fno-strict-aliasing"
   231 
   232 dnl Check for compiler.
   233 AC_PROG_CC
   234 AC_PROG_CXX
   235 
   236 dnl Check compiler vendor.
   237 AX_COMPILER_VENDOR
   238 
   239 dnl Set compiler flags depending on the compiler vendor.
   240 case "$ax_cv_c_compiler_vendor" in
   241 gnu )
   242     CC_FLAGS="-std=c99 -pedantic -Wall -Wno-long-long $CC_FLAGS"
   243     CXX_FLAGS="-std=c++98 -pedantic -Wall -Wno-long-long $CXX_FLAGS"
   244     ;;
   245 
   246 sgi )
   247     CC_FLAGS="-c99 $CC_FLAGS"
   248     CXX_FLAGS="$CXX_FLAGS"
   249     ;;
   250 
   251 sun )
   252     CC_FLAGS="-xc99 $CC_FLAGS"
   253     CXX_FLAGS="$CXX_FLAGS"
   254     ;;
   255 
   256 * )    
   257     AC_MSG_ERROR([$ax_cv_c_compiler_vendor compilers are currently not supported.])
   258     ;;
   259 esac
   260 
   261 dnl Temporary set the CFLAGS for configure tests (e.g. inline keyword)
   262 dnl we set it properly at the end of this file.
   263 CFLAGS="$OPT_CFLAGS $ARCH_FLAGS $OS_FLAGS $CC_FLAGS"
   264 CXXFLAGS="$OPT_CXXFLAGS $ARCH_FLAGS $OS_FLAGS $CXX_FLAGS"
   265 
   266 dnl set interpreter flags
   267 AC_SUBST(INTRP_CFLAGS)
   268 
   269 dnl define and substitute some architecture specific variables
   270 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
   271 AC_DEFINE_UNQUOTED([JAVA_ARCH], "${JAVA_ARCH}", [Java architecture name])
   272 AC_SUBST(ARCH_DIR)
   273 AC_SUBST(JAVA_ARCH)
   274 AC_SUBST(OS_DIR)
   275 AC_SUBST(USE_SCHEDULER)
   276 
   277 dnl Checks for programs.
   278 AM_PROG_AS
   279 AC_PROG_LD
   280 AC_PROG_LD_GNU
   281 AC_PROG_LN_S
   282 AC_PROG_MAKE_SET
   283 AM_PROG_MKDIR_P
   284 
   285 AM_CONDITIONAL([WITH_GNU_LD], [test x"$with_gnu_ld" = "xyes"])
   286 
   287 dnl Checks for header files.
   288 AC_HEADER_DIRENT
   289 AC_HEADER_STDC
   290 
   291 dnl Crucial header files.
   292 AC_CHECK_HEADERS([stdbool.h],, [AC_MSG_ERROR(cannot find stdbool.h)])
   293 AC_CHECK_HEADERS([stdint.h],, [AC_MSG_ERROR(cannot find stdint.h)])
   294 
   295 dnl keep them alpha-sorted!
   296 AC_CHECK_HEADERS([assert.h])
   297 AC_CHECK_HEADERS([errno.h])
   298 AC_CHECK_HEADERS([execinfo.h])
   299 AC_CHECK_HEADERS([fcntl.h])
   300 AC_CHECK_HEADERS([libgen.h])
   301 AC_CHECK_HEADERS([locale.h])
   302 AC_CHECK_HEADERS([netdb.h])
   303 AC_CHECK_HEADERS([signal.h])
   304 AC_CHECK_HEADERS([stdarg.h])
   305 AC_CHECK_HEADERS([stdint.h])
   306 AC_CHECK_HEADERS([stdio.h])
   307 AC_CHECK_HEADERS([stdlib.h])
   308 AC_CHECK_HEADERS([string.h])
   309 AC_CHECK_HEADERS([time.h])
   310 AC_CHECK_HEADERS([ucontext.h])
   311 AC_CHECK_HEADERS([unistd.h])
   312 AC_CHECK_HEADERS([mach/mach.h])
   313 AC_CHECK_HEADERS([sys/ioctl.h])
   314 AC_CHECK_HEADERS([sys/loadavg.h])
   315 AC_CHECK_HEADERS([sys/mman.h])
   316 AC_CHECK_HEADERS([sys/resource.h])
   317 AC_CHECK_HEADERS([sys/select.h])
   318 AC_CHECK_HEADERS([sys/socket.h])
   319 AC_CHECK_HEADERS([sys/stat.h])
   320 AC_CHECK_HEADERS([sys/time.h])
   321 AC_CHECK_HEADERS([sys/types.h])
   322 AC_CHECK_HEADERS([sys/utsname.h])
   323 
   324 dnl Checks for typedefs, structures, and compiler characteristics.
   325 AC_C_CONST
   326 AC_C_INLINE
   327 AC_C_ATTRIBUTE
   328 AC_TYPE_OFF_T
   329 AC_TYPE_SIZE_T
   330 AC_HEADER_TIME
   331 AC_STRUCT_TM
   332 
   333 dnl Checks for libraries (NOTE: Should be done before function checks,
   334 dnl as some functions may be in libraries we check for).
   335 case "${OS_DIR}" in
   336     solaris )
   337          AC_CHECK_LIB([socket], [gethostname],, [AC_MSG_ERROR(cannot find libsocket)])
   338          ;;
   339 esac
   340 
   341 dnl Checks for library functions.
   342 AC_PROG_GCC_TRADITIONAL
   343 AC_TYPE_SIGNAL
   344 AC_FUNC_MEMCMP
   345 AC_FUNC_MMAP
   346 
   347 dnl keep them alpha-sorted!
   348 AC_CHECK_FUNCS([abort])
   349 AC_CHECK_FUNCS([accept])
   350 AC_CHECK_FUNCS([access])
   351 AC_CHECK_FUNCS([atoi])
   352 AC_CHECK_FUNCS([atol])
   353 AC_CHECK_FUNCS([backtrace])
   354 AC_CHECK_FUNCS([backtrace_symbols])
   355 AC_CHECK_FUNCS([calloc])
   356 AC_CHECK_FUNCS([close])
   357 AC_CHECK_FUNCS([confstr])
   358 AC_CHECK_FUNCS([connect])
   359 AC_CHECK_FUNCS([dirname])
   360 AC_CHECK_FUNCS([fclose])
   361 AC_CHECK_FUNCS([fflush])
   362 AC_CHECK_FUNCS([fopen])
   363 AC_CHECK_FUNCS([fprintf])
   364 AC_CHECK_FUNCS([vfprintf])
   365 AC_CHECK_FUNCS([fread])
   366 AC_CHECK_FUNCS([free])
   367 AC_CHECK_FUNCS([fstat])
   368 AC_CHECK_FUNCS([fsync])
   369 AC_CHECK_FUNCS([ftruncate])
   370 AC_CHECK_FUNCS([getcwd])
   371 AC_CHECK_FUNCS([getenv])
   372 AC_CHECK_FUNCS([gethostbyname])
   373 AC_CHECK_FUNCS([gethostname])
   374 AC_CHECK_FUNCS([getloadavg])
   375 AC_CHECK_FUNCS([getpagesize])
   376 AC_CHECK_FUNCS([getpid])
   377 AC_CHECK_FUNCS([getrusage])
   378 AC_CHECK_FUNCS([getsockname])
   379 AC_CHECK_FUNCS([getsockopt])
   380 AC_CHECK_FUNCS([gettimeofday])
   381 AC_CHECK_FUNCS([htons])
   382 AC_CHECK_FUNCS([ioctl])
   383 AC_CHECK_FUNCS([isnan])
   384 AC_CHECK_FUNCS([listen])
   385 AC_CHECK_FUNCS([localtime])
   386 AC_CHECK_FUNCS([localtime_r])
   387 AC_CHECK_FUNCS([lseek])
   388 AC_CHECK_FUNCS([malloc])
   389 AC_CHECK_FUNCS([memcpy])
   390 AC_CHECK_FUNCS([memset])
   391 AC_CHECK_FUNCS([mmap])
   392 AC_CHECK_FUNCS([mprotect])
   393 AC_CHECK_FUNCS([open])
   394 AC_CHECK_FUNCS([printf])
   395 AC_CHECK_FUNCS([read])
   396 AC_CHECK_FUNCS([readlink])
   397 AC_CHECK_FUNCS([realloc])
   398 AC_CHECK_FUNCS([recv])
   399 AC_CHECK_FUNCS([scandir])
   400 AC_CHECK_FUNCS([select])
   401 AC_CHECK_FUNCS([send])
   402 AC_CHECK_FUNCS([setlocale])
   403 AC_CHECK_FUNCS([setsockopt])
   404 AC_CHECK_FUNCS([shutdown])
   405 AC_CHECK_FUNCS([socket])
   406 AC_CHECK_FUNCS([stat])
   407 AC_CHECK_FUNCS([str2sig])
   408 AC_CHECK_FUNCS([strcat])
   409 AC_CHECK_FUNCS([strchr])
   410 AC_CHECK_FUNCS([strcpy])
   411 AC_CHECK_FUNCS([strcmp])
   412 AC_CHECK_FUNCS([strdup])
   413 AC_CHECK_FUNCS([strerror])
   414 AC_CHECK_FUNCS([strlen])
   415 AC_CHECK_FUNCS([strncmp])
   416 AC_CHECK_FUNCS([strstr])
   417 AC_CHECK_FUNCS([time])
   418 AC_CHECK_FUNCS([write])
   419 
   420 AM_LC_MESSAGES
   421 
   422 dnl Checks for libraries.
   423 
   424 dnl Checking sizeof void *
   425 AC_CHECK_SIZEOF(void *)
   426 AC_C_BIGENDIAN
   427 
   428 
   429 dnl define install prefix
   430 if test "x$prefix" = "xNONE"; then
   431     CACAO_PREFIX=$ac_default_prefix
   432 else
   433     CACAO_PREFIX=$prefix
   434 fi
   435 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
   436 AC_SUBST(CACAO_PREFIX)
   437 
   438 dnl define libdir prefix
   439 if test "x$libdir" = "xNONE"; then
   440     CACAO_LIBDIR=$ac_default_libdir
   441 else
   442     CACAO_LIBDIR=$libdir
   443 fi
   444 dnl expand CACAO_LIBDIR to something that is usable in C code
   445 AS_AC_EXPAND([CACAO_LIBDIR], ${CACAO_LIBDIR})
   446 AC_DEFINE_UNQUOTED([CACAO_LIBDIR], "${CACAO_LIBDIR}", [library installation prefix])
   447 AC_SUBST(CACAO_LIBDIR)
   448 
   449 
   450 AC_CHECK_ENABLE_DL
   451 AC_CHECK_ENABLE_JAVA
   452 
   453 AC_CHECK_ENABLE_JIT
   454 AC_CHECK_ENABLE_INTRP
   455 
   456 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
   457     AC_ERROR(You have to enable at least the JIT or the interpreter.)
   458 fi
   459 
   460 AC_CHECK_SOFTFLOAT
   461 AC_CHECK_SOFT_FLOAT_CMP
   462 AC_CHECK_SOFT_DOUBLE_CMP
   463 
   464 AC_CHECK_ENABLE_GC
   465 AC_CHECK_ENABLE_DEBUG
   466 AC_CHECK_ENABLE_DUMP
   467 AC_CHECK_ENABLE_MEMCHECK
   468 AC_CHECK_ENABLE_HANDLES
   469 AC_CHECK_ENABLE_VMLOG
   470 AC_CHECK_ENABLE_DISASSEMBLER
   471 AC_CHECK_ENABLE_STATISTICS
   472 AC_CHECK_ENABLE_VERIFIER
   473 AC_CHECK_ENABLE_RT_TIMING
   474 AC_CHECK_ENABLE_CYCLE_STATS
   475 AC_CHECK_ENABLE_JVMTI
   476 AC_CHECK_ENABLE_THREADS
   477 if test x"${ENABLE_THREADS}" != "xno"; then
   478     AC_CHECK_USE___THREAD
   479 fi
   480 AC_CHECK_ENABLE_IFCONV
   481 AC_CHECK_ENABLE_INLINING
   482 AC_CHECK_ENABLE_INLINING_DEBUG
   483 AC_CHECK_ENABLE_REPLACEMENT
   484 
   485 dnl check for loop optimization
   486 AC_MSG_CHECKING(whether loop optimization should be supported)
   487 AC_ARG_ENABLE([loop],
   488               [AS_HELP_STRING(--enable-loop,enable loop optimization [[default=no]])],
   489               [case "${enableval}" in
   490                    yes) ENABLE_LOOP=yes;;
   491                    *) ENABLE_LOOP=no;;
   492                esac],
   493               [ENABLE_LOOP=no])
   494 AC_MSG_RESULT(${ENABLE_LOOP})
   495 AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
   496 
   497 if test x"${ENABLE_LOOP}" = "xyes"; then
   498     AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
   499 fi
   500 
   501 
   502 dnl check if linear scan register allocator(lsra) with SSA should be used
   503 AC_MSG_CHECKING(whether lsra with ssa should be supported)
   504 AC_ARG_ENABLE([ssa],
   505               [AS_HELP_STRING(--disable-ssa,disable ssa [[default=disabled]])],
   506               [case "${enableval}" in
   507                    no) ENABLE_SSA=no;;
   508                    *) ENABLE_SSA=yes;;
   509                esac],
   510               [ENABLE_SSA=no])
   511 AC_MSG_RESULT(${ENABLE_SSA})
   512 AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
   513 AM_CONDITIONAL([ENABLE_ESCAPE], test x"${ENABLE_SSA}" = "xyes")
   514 AM_CONDITIONAL([ENABLE_ESCAPE_CHECK], test x"${ENABLE_SSA}" = "xyes")
   515 AM_CONDITIONAL([ENABLE_TLH], test x"${ENABLE_SSA}" = "xyes")
   516 
   517 if test x"${ENABLE_SSA}" = "xyes"; then
   518     AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
   519     AC_DEFINE([ENABLE_ESCAPE], 1, [enable escape analysis with ssa])
   520     AC_DEFINE([ENABLE_ESCAPE_CHECK], 1, [enable generating code to validate escape analysis results])
   521     AC_DEFINE([ENABLE_TLH], 1, [enable thread local heap])
   522     ENABLE_LSRA="no"
   523 fi
   524 
   525 
   526 dnl check if linear scan register allocator(lsra) should be used
   527 AC_MSG_CHECKING(whether lsra should be supported)
   528 AC_ARG_ENABLE([lsra],
   529               [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=no]])],
   530               [case "${enableval}" in
   531                    yes) ENABLE_LSRA=yes;;
   532                    *) ENABLE_LSRA=no;;
   533                esac],
   534               [ENABLE_LSRA=no])
   535    
   536 if test x"${ENABLE_LSRA}" = "xyes"; then
   537     if test x"${ENABLE_SSA}" = "xyes"; then
   538         ENABLE_LSRA="no"
   539     fi
   540 fi
   541 AC_MSG_RESULT(${ENABLE_LSRA})
   542 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
   543  
   544 if test x"${ENABLE_LSRA}" = "xyes"; then
   545     AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
   546 fi
   547 
   548 dnl check if profiling should be supported
   549 AC_MSG_CHECKING(whether profiling should be supported)
   550 AC_ARG_ENABLE([profiling],
   551               [AS_HELP_STRING(--enable-profiling,enable profiling [[default=no]])],
   552               [case "${enableval}" in
   553                    yes) ENABLE_PROFILING=yes;;
   554                    *) ENABLE_PROFILING=no;;
   555                esac],
   556               [ENABLE_PROFILING=no])
   557 AC_MSG_RESULT(${ENABLE_PROFILING})
   558 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
   559    
   560 if test x"${ENABLE_PROFILING}" = "xyes"; then
   561     AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
   562 fi
   563 
   564 
   565 dnl check for instruction scheduler
   566 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
   567 
   568 AC_MSG_CHECKING(whether instruction scheduler should be supported)
   569 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
   570 	case "${ARCH_DIR}" in
   571 		xdspcore )
   572 			;;
   573 		* )
   574 			AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
   575 			;;
   576 	esac
   577 
   578 	AC_MSG_RESULT(yes)
   579 	AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
   580 	AM_CONDITIONAL([USE_SCHEDULER], [true])
   581 else
   582 	AC_MSG_RESULT(no)
   583 	AM_CONDITIONAL([USE_SCHEDULER], [false])
   584 fi
   585 
   586 AC_CHECK_ENABLE_OPAGENT
   587 
   588 AC_CHECK_ENABLE_ZLIB
   589 
   590 dnl check for stuff to be built
   591 AC_CHECK_ENABLE_JNI
   592 AC_CHECK_ENABLE_LIBJVM
   593 
   594 dnl ATTENTION: These check must be after setting
   595 dnl enable_shared/enable_static (happens in AC_CHECK_ENABLE_LIBJVM),
   596 dnl because libtool uses them to build the correct libraries.
   597 AC_LIBTOOL_DLOPEN
   598 AC_PROG_LIBTOOL
   599 
   600 AC_CHECK_ENABLE_STATICVM
   601 AC_CHECK_ENABLE_ANNOTATIONS
   602 AC_CHECK_ENABLE_ASSERTION
   603 
   604 dnl This one depends on AC_CHECK_ENABLE_ZLIB.
   605 AC_CHECK_WITH_VM_ZIP
   606 AC_CHECK_WITH_HGREV
   607 
   608 AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY
   609 
   610 dnl Now we check for jre-layout so we can skip some checks that are
   611 dnl not required.
   612 AC_CHECK_ENABLE_JRE_LAYOUT
   613 
   614 AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY_PREFIX
   615 AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY_CLASSES
   616 AC_CHECK_WITH_BUILD_JAVA_RUNTIME_LIBRARY_CLASSES
   617 
   618 if test x"${ENABLE_JRE_LAYOUT}" = "xno"; then
   619    AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY_LIBDIR
   620 fi
   621 
   622 dnl The check for jni_md.h must be before jni.h.
   623 AC_CHECK_WITH_JNI_MD_H
   624 AC_CHECK_WITH_JNI_H
   625 
   626 dnl The jvmti.h header is only required if JVMTI is enabled.
   627 if test x"${ENABLE_JVMTI}" = "xyes"; then
   628     AC_CHECK_WITH_JVMTI_H
   629 fi
   630 
   631 dnl JVM, HPI, and JMM is only required for OpenJDK.
   632 case "${WITH_JAVA_RUNTIME_LIBRARY}" in
   633     openjdk)
   634         AC_CHECK_WITH_JVM_MD_H
   635         AC_CHECK_WITH_JVM_H
   636         AC_CHECK_WITH_HPI_MD_H
   637         AC_CHECK_WITH_HPI_H
   638         AC_CHECK_WITH_JMM_H
   639         ;;
   640     *)
   641         ;;
   642 esac
   643 
   644 dnl check for some programs we need
   645 
   646 case "${WITH_JAVA_RUNTIME_LIBRARY}" in
   647     cldc1.1 | gnuclasspath)
   648         AC_PROG_JAVAC
   649         AC_PROG_JAR
   650         ;;
   651     openjdk)
   652         ;;
   653     *)
   654         AC_MSG_ERROR(unknown classpath configuration ${WITH_JAVA_RUNTIME_LIBRARY})
   655         ;;
   656 esac
   657 
   658 AC_CHECK_WITH_JASMIN_JAR
   659 AC_CHECK_WITH_JUNIT_JAR
   660 
   661 AC_CHECK_HEADERS(
   662 	[regex.h], 
   663 	[
   664 		dnl If debug build and regex.h available, enable debug filter
   665 		if test x"${NDEBUG}" = "xno"; then
   666 			AC_DEFINE(ENABLE_DEBUG_FILTER, 1, [debug filter])
   667 		fi
   668 		dnl If vmlog enambled and regex.h available, enable vmlogfilter
   669 		AM_CONDITIONAL([ENABLE_VMLOGFILTER], [test x"${ENABLE_VMLOG}" = "xyes"])
   670 	],
   671 	[
   672 		AM_CONDITIONAL([ENABLE_VMLOGFILTER], [false])
   673 	]
   674 )
   675 
   676 dnl python
   677 
   678 AZ_PYTHON_DEFAULT
   679 AZ_PYTHON_ENABLE
   680 AZ_PYTHON_WITH
   681 AZ_PYTHON_VERSION_ENSURE( [2.4] )
   682 AZ_PYTHON_CSPEC
   683 AZ_PYTHON_LSPEC
   684 
   685 AC_CHECK_ENABLE_GCC_PR40134
   686 
   687 AC_CHECK_ENABLE_PIC_ASM
   688 
   689 dnl Define version numbers.
   690 AC_VERSION_DETAIL
   691 AC_VERSION_CONFIG
   692 
   693 dnl Finally pass flags to Makefiles.
   694 CFLAGS="$OPT_CFLAGS"
   695 CXXFLAGS="$OPT_CXXFLAGS"
   696 
   697 AM_CFLAGS="$CC_FLAGS $ARCH_FLAGS $OS_FLAGS"
   698 AM_CXXFLAGS="$CXX_FLAGS $ARCH_FLAGS $OS_FLAGS"
   699 AM_CPPFLAGS="$CPPFLAGS"
   700 
   701 AC_SUBST(AM_CFLAGS)
   702 AC_SUBST(AM_CXXFLAGS)
   703 AC_SUBST(AM_CPPFLAGS)
   704 
   705 
   706 AC_CONFIG_FILES([Makefile]
   707 		[contrib/Makefile]
   708 		[contrib/setenvinstalled]
   709 		[contrib/setenvsource]
   710 		[contrib/vmlog/Makefile]
   711 		[contrib/vmlog/t/Makefile]
   712 		[doc/Makefile]
   713 		[doc/doxygen/Makefile]
   714 		[doc/handbook/Makefile]
   715 		[man/Makefile]
   716 		[src/Makefile]
   717 		[src/cacao/Makefile]
   718 		[src/classes/Makefile]
   719 		[src/fdlibm/Makefile]
   720 		[src/mm/Makefile]
   721 		[src/mm/cacao-gc/Makefile]
   722 		[src/native/Makefile]
   723 		[src/native/jvmti/Makefile]
   724 		[src/native/vm/Makefile]
   725 		[src/native/vm/cldc1.1/Makefile]
   726 		[src/native/vm/gnuclasspath/Makefile]
   727 		[src/native/vm/openjdk/Makefile]
   728 		[src/scripts/Makefile]
   729 		[src/scripts/java]
   730 		[src/threads/Makefile]
   731 		[src/threads/none/Makefile]
   732 		[src/threads/posix/Makefile]
   733 		[src/toolbox/Makefile]
   734 		[src/vm/Makefile]
   735 		[src/vm/jit/Makefile]
   736 		[src/vm/jit/allocator/Makefile]
   737 		[src/vm/jit/alpha/Makefile]
   738 		[src/vm/jit/alpha/freebsd/Makefile]
   739 		[src/vm/jit/alpha/linux/Makefile]
   740 		[src/vm/jit/arm/Makefile]
   741 		[src/vm/jit/arm/linux/Makefile]
   742 		[src/vm/jit/i386/Makefile]
   743 		[src/vm/jit/i386/cygwin/Makefile]
   744 		[src/vm/jit/i386/darwin/Makefile]
   745 		[src/vm/jit/i386/freebsd/Makefile]
   746 		[src/vm/jit/i386/linux/Makefile]
   747 		[src/vm/jit/i386/solaris/Makefile]
   748 		[src/vm/jit/intrp/Makefile]
   749 		[src/vm/jit/inline/Makefile]
   750 		[src/vm/jit/ir/Makefile]
   751 		[src/vm/jit/loop/Makefile]
   752 		[src/vm/jit/m68k/Makefile]
   753 		[src/vm/jit/m68k/linux/Makefile]
   754 		[src/vm/jit/mips/Makefile]
   755 		[src/vm/jit/mips/irix/Makefile]
   756 		[src/vm/jit/mips/linux/Makefile]
   757 		[src/vm/jit/mips/uclinux/Makefile]
   758 		[src/vm/jit/optimizing/Makefile]
   759 		[src/vm/jit/parisc/Makefile]
   760 		[src/vm/jit/parisc/linux/Makefile]
   761 		[src/vm/jit/powerpc/Makefile]
   762 		[src/vm/jit/powerpc/darwin/Makefile]
   763 		[src/vm/jit/powerpc/linux/Makefile]
   764 		[src/vm/jit/powerpc/netbsd/Makefile]
   765 		[src/vm/jit/powerpc64/Makefile]
   766 		[src/vm/jit/powerpc64/linux/Makefile]
   767 		[src/vm/jit/s390/Makefile]
   768 		[src/vm/jit/schedule/Makefile]
   769 		[src/vm/jit/sparc64/Makefile]
   770 		[src/vm/jit/sparc64/linux/Makefile]
   771 		[src/vm/jit/sparc64/solaris/Makefile]
   772 		[src/vm/jit/verify/Makefile]
   773 		[src/vm/jit/x86_64/Makefile]
   774 		[src/vm/jit/x86_64/freebsd/Makefile]
   775 		[src/vm/jit/x86_64/linux/Makefile]
   776 		[src/vm/jit/x86_64/solaris/Makefile]
   777 		[tests/Makefile]
   778 		[tests/regression/Makefile]
   779 		[tests/regression/assertion/Makefile]
   780 		[tests/regression/base/Makefile]
   781 		[tests/regression/bugzilla/Makefile]
   782 		[tests/regression/jasmin/Makefile]
   783 		[tests/regression/native/Makefile]
   784 		[tests/regression/resolving/Makefile]
   785 		[tests/regression/resolving/classes1/Makefile]
   786 		[tests/regression/resolving/classes2/Makefile]
   787 		[tests/regression/resolving/classes3/Makefile]
   788 )
   789 
   790 
   791 dnl We only build the shared library objects but we use it as
   792 dnl noinst_LTLIBRARIES.
   793 ac_configure_args="$ac_configure_args --disable-static"
   794 AC_CONFIG_SUBDIRS(src/mm/boehm-gc)
   795 
   796 
   797 AC_OUTPUT
   798 
   799 
   800 ## Local variables:
   801 ## mode: m4
   802 ## indent-tabs-mode: t
   803 ## c-basic-offset: 4
   804 ## tab-width: 8
   805 ## compile-command: "automake --add-missing"
   806 ## End: