dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
dnl 02110-1301, USA.
-dnl
-dnl $Id: configure.ac 8001 2007-06-02 17:47:30Z pm $
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(cacao, 0.98rc, cacao@cacaojvm.org)
+AC_INIT(cacao, 0.98+svn, cacao@cacaojvm.org)
AC_CONFIG_SRCDIR(src/cacao/cacao.c)
AC_CANONICAL_HOST
AC_PREREQ(2.59)
dnl set optimization and debugging for all architectures and systems
if test x"$CFLAGS" = "x"; then
- OPT_CFLAGS="-O2 -g3"
+ OPT_CFLAGS="-O0 -g3"
else
OPT_CFLAGS=$CFLAGS
fi
alpha | alphaev56 | alphapca56 )
ARCH_DIR="alpha"
ARCH_CFLAGS="-mieee -D__ALPHA__"
+ JAVA_ARCH="alpha"
;;
arm | armv4 | armv4tl | armv5b | armv5l )
ARCH_DIR="arm"
ARCH_CFLAGS="-D__ARM__"
+ JAVA_ARCH="arm"
;;
hppa2.0 )
ARCH_DIR="parisc"
ARCH_CFLAGS="-D__PARISC__"
+ JAVA_ARCH="hppa"
;;
i386 | i486 | i586 | i686 )
ARCH_DIR="i386"
ARCH_CFLAGS="-D__I386__"
+ JAVA_ARCH="i386"
;;
m68k )
ARCH_DIR="m68k"
ARCH_CFLAGS="-D__M68K__"
+ JAVA_ARCH="m68k"
;;
mips | mipsel )
ARCH_DIR="mips"
ARCH_CFLAGS="-D__MIPS__"
+ dnl Is this correct for mipsel?
+ JAVA_ARCH="mips"
;;
powerpc )
ARCH_DIR="powerpc"
ARCH_CFLAGS="-D__POWERPC__"
+ JAVA_ARCH="ppc"
;;
powerpc64 )
ARCH_DIR="powerpc64"
ARCH_CFLAGS="-D__POWERPC64__"
+ JAVA_ARCH="ppc64"
;;
s390 )
ARCH_DIR="s390"
ARCH_CFLAGS="-D__S390__"
+ JAVA_ARCH="s390"
;;
sparc | sparc64 )
ARCH_DIR="sparc64"
ARCH_CFLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
+ dnl Is this correct for 64-bits?
+ JAVA_ARCH="sparc"
;;
x86_64 )
ARCH_DIR="x86_64"
ARCH_CFLAGS="-D__X86_64__"
+ JAVA_ARCH="amd64"
;;
xdspcore )
dnl define and substitute some architecture specific variables
AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
+AC_DEFINE_UNQUOTED([JAVA_ARCH], "${JAVA_ARCH}", [Java architecture name])
AC_SUBST(ARCH_DIR)
AC_SUBST(OS_DIR)
AC_SUBST(USE_SCHEDULER)
dnl keep them alpha-sorted!
AC_CHECK_HEADERS([fcntl.h])
+AC_CHECK_HEADERS([libgen.h])
+AC_CHECK_HEADERS([netdb.h])
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([string.h])
AC_CHECK_HEADERS([time.h])
+AC_CHECK_HEADERS([ucontext.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([sys/ioctl.h])
AC_CHECK_HEADERS([sys/mman.h])
AC_CHECK_HEADERS([sys/resource.h])
+AC_CHECK_HEADERS([sys/select.h])
+AC_CHECK_HEADERS([sys/socket.h])
+AC_CHECK_HEADERS([sys/stat.h])
AC_CHECK_HEADERS([sys/time.h])
+AC_CHECK_HEADERS([sys/types.h])
dnl this is for fdlibm
AC_CHECK_HEADERS([stdint.h])
AC_HEADER_TIME
AC_STRUCT_TM
+dnl Checks for libraries (NOTE: Should be done before function checks,
+dnl as some functions may be in libraries we check for).
+AC_CHECK_LIB(dl, dlopen,,)
+
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_MMAP
dnl keep them alpha-sorted!
+AC_CHECK_FUNCS([accept])
+AC_CHECK_FUNCS([access])
+AC_CHECK_FUNCS([atoi])
+AC_CHECK_FUNCS([atol])
AC_CHECK_FUNCS([calloc])
+AC_CHECK_FUNCS([close])
AC_CHECK_FUNCS([confstr])
-AC_CHECK_FUNCS([getpagesize])
+AC_CHECK_FUNCS([connect])
+AC_CHECK_FUNCS([dirname])
+AC_CHECK_FUNCS([fflush])
+AC_CHECK_FUNCS([fopen])
+AC_CHECK_FUNCS([fprintf])
AC_CHECK_FUNCS([free])
+AC_CHECK_FUNCS([fstat])
AC_CHECK_FUNCS([getcwd])
-AC_CHECK_FUNCS([gettimeofday])
+AC_CHECK_FUNCS([gethostbyname])
+AC_CHECK_FUNCS([gethostname])
+AC_CHECK_FUNCS([getpagesize])
AC_CHECK_FUNCS([getrusage])
+AC_CHECK_FUNCS([getsockname])
+AC_CHECK_FUNCS([gettimeofday])
+AC_CHECK_FUNCS([htons])
+AC_CHECK_FUNCS([ioctl])
AC_CHECK_FUNCS([isnan])
+AC_CHECK_FUNCS([listen])
AC_CHECK_FUNCS([localtime])
AC_CHECK_FUNCS([localtime_r])
+AC_CHECK_FUNCS([lseek])
+AC_CHECK_FUNCS([malloc])
AC_CHECK_FUNCS([mmap])
AC_CHECK_FUNCS([mprotect])
+AC_CHECK_FUNCS([open])
+AC_CHECK_FUNCS([readlink])
+AC_CHECK_FUNCS([recv])
AC_CHECK_FUNCS([scandir])
+AC_CHECK_FUNCS([select])
+AC_CHECK_FUNCS([send])
+AC_CHECK_FUNCS([setsockopt])
+AC_CHECK_FUNCS([shutdown])
+AC_CHECK_FUNCS([socket])
+AC_CHECK_FUNCS([strchr])
AC_CHECK_FUNCS([strdup])
+AC_CHECK_FUNCS([strerror])
+AC_CHECK_FUNCS([strncmp])
AC_CHECK_FUNCS([strstr])
AC_CHECK_FUNCS([time])
;;
esac
+ case "${OS_DIR}" in
+ solaris)
+ AC_CHECK_LIB(rt, sem_init,, [AC_MSG_ERROR(cannot find librt)])
+ ;;
+ esac
+
+
AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from binutils))])
AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from binutils))])
AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(cannot find libopcodes (from binutils))])
fi
-dnl check if zlib should be used
-AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
-AC_ARG_ENABLE([zlib],
- [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
- [case "${enableval}" in
- no) ENABLE_ZLIB=no;;
- *) ENABLE_ZLIB=yes;;
- esac],
- [ENABLE_ZLIB=yes])
-AC_MSG_RESULT(${ENABLE_ZLIB})
-
-if test x"${ENABLE_ZLIB}" = "xyes"; then
- AC_CHECK_HEADERS([zconf.h],, [AC_MSG_ERROR(cannot find zconf.h)])
- AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR(cannot find zlib.h)])
- AC_CHECK_LIB(z, inflate,, [AC_MSG_ERROR(cannot find libz)])
- AC_DEFINE([ENABLE_ZLIB], 1, [use zlib])
-fi
-AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
-
+AC_CHECK_ENABLE_ZLIB
dnl check for stuff to be built
AC_CHECK_ENABLE_JNI
+AC_CHECK_ENABLE_LIBJVM
-
-dnl check if a libjvm.so should be built
-AC_MSG_CHECKING(whether to build a libjvm.so)
-AC_ARG_ENABLE([libjvm],
- [AS_HELP_STRING(--disable-libjvm,build a libjvm.so [[default=yes]])],
- [case "${enableval}" in
- no) ENABLE_LIBJVM=no;;
- *) ENABLE_LIBJVM=yes;;
- esac],
- [ENABLE_LIBJVM=yes])
-AC_MSG_RESULT(${ENABLE_LIBJVM})
-AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
-AC_SUBST(ENABLE_LIBJVM)
-
-if test x"${ENABLE_LIBJVM}" = "xyes"; then
- AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
-
- dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
- enable_shared=yes
- enable_static=no
-else
- enable_shared=no
- enable_static=yes
-fi
-
-dnl libtool stuff
+dnl ATTENTION: These check must be after setting
+dnl enable_shared/enable_static (happens in AC_CHECK_ENABLE_LIBJVM),
+dnl because libtool uses them to build the correct libraries.
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
-
-dnl check if CACAO should be linked statically
-AC_MSG_CHECKING(whether to link CACAO statically)
-AC_ARG_ENABLE([staticvm],
- [AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
- [case "${enableval}" in
- yes) ENABLE_STATICVM=yes
- AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
- ;;
- *) ENABLE_STATICVM=no;;
- esac],
- [ENABLE_STATICVM=no])
-AC_MSG_RESULT(${ENABLE_STATICVM})
-AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
-AC_SUBST(ENABLE_STATICVM)
+AC_CHECK_ENABLE_STATICVM
+AC_CHECK_ENABLE_ANNOTATIONS
dnl where is CACAO's vm.zip
AC_CHECK_WITH_CLASSPATH_LIBDIR
AC_CHECK_WITH_CLASSPATH_INCLUDEDIR
-
-dnl if we compile for a JRE-style directory layout
-AC_MSG_CHECKING(if we compile for a JRE-style directory layout)
-AC_ARG_WITH([jre-layout],
- [AS_HELP_STRING(--with-jre-layout,compile for JRE-style directory layout [[default=no]])],
- [case "${enableval}" in
- yes) WITH_JRE_LAYOUT=yes
- AC_DEFINE([WITH_JRE_LAYOUT], 1, [with JRE layout])
- ;;
- *) WITH_JRE_LAYOUT=no;;
- esac],
- [WITH_JRE_LAYOUT=no])
-AC_MSG_RESULT(${WITH_JRE_LAYOUT})
+AC_CHECK_WITH_JRE_LAYOUT
dnl check if GNU Classpath should be linked statically into CACAO
dnl check for some classpath related stuff when we link statically
AM_ICONV_LINK
else
- dnl we need this check for --enable-staticvm, otherwise ltdl can't find dlopen
- if test x"${ENABLE_STATICVM}" = "xyes"; then
- AC_CHECK_LIB(dl, dlopen,, [AC_MSG_ERROR(cannot find libdl)])
- fi
-
- AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
- AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
+ AC_CHECK_ENABLE_LTDL
fi
AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
AC_SUBST(WITH_STATIC_CLASSPATH)
dnl check for some programs we need
-AC_PROG_JAVAC
-AC_PROG_JAR
+
+case "${WITH_CLASSPATH}" in
+ cldc1.1 | gnu)
+ AC_PROG_JAVAC
+ AC_PROG_JAR
+ ;;
+ sun)
+ ;;
+ *)
+ AC_MSG_ERROR(unknown classpath configuration ${WITH_CLASSPATH})
+ ;;
+esac
+
AC_CHECK_HEADERS(
[regex.h],
AC_DEFINE(ENABLE_DEBUG_FILTER, 1, [debug filter])
fi
dnl If vmlog enambled and regex.h available, enable vmlogfilter
- if test x"${ENABLE_VMLOG}" = "xyes"; then
- AM_CONDITIONAL([ENABLE_VMLOGFILTER], true)
- fi
+ AM_CONDITIONAL([ENABLE_VMLOGFILTER], [test x"${ENABLE_VMLOG}" = "xyes"])
+ ],
+ [
+ AM_CONDITIONAL([ENABLE_VMLOGFILTER], [false])
]
)
[src/native/vm/Makefile]
[src/native/vm/cldc1.1/Makefile]
[src/native/vm/gnu/Makefile]
+ [src/native/vm/sun/Makefile]
[src/scripts/Makefile]
[src/scripts/java]
[src/threads/Makefile]
[src/vm/jit/sparc64/Makefile]
[src/vm/jit/sparc64/linux/Makefile]
[src/vm/jit/sparc64/solaris/Makefile]
- [src/vm/jit/tools/Makefile]
[src/vm/jit/verify/Makefile]
[src/vm/jit/x86_64/Makefile]
[src/vm/jit/x86_64/freebsd/Makefile]
[tests/regression/resolving/classes1/Makefile]
[tests/regression/resolving/classes2/Makefile]
[tests/regression/resolving/classes3/Makefile]
- )
+)
dnl now configure subpackages with OPT_CFLAGS and ARCH_CFLAGS