diff options
Diffstat (limited to 'libjava/configure.in')
-rw-r--r-- | libjava/configure.in | 196 |
1 files changed, 126 insertions, 70 deletions
diff --git a/libjava/configure.in b/libjava/configure.in index 365b0277a59..a13b0084f31 100644 --- a/libjava/configure.in +++ b/libjava/configure.in @@ -1,10 +1,6 @@ dnl Process this with autoconf to create configure AC_INIT(java/lang/System.java) -dnl Can't be done in LIBGCJ_CONFIGURE because that confuses automake. -AC_CONFIG_AUX_DIR(..) - -AC_CANONICAL_SYSTEM AC_PROG_LN_S dnl We use these options to decide which functions to include. @@ -26,6 +22,9 @@ if test -z "${with_cross_host}"; then AC_DEFINE(USE_LTDL) # Sigh. Libtool's macro doesn't do the right thing. INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL" + # FIXME: this is a hack. + sub_auxdir="`cd $ac_aux_dir && pwd`" + ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir" fi AC_SUBST(INCLTDL) AC_SUBST(LIBLTDL) @@ -88,19 +87,51 @@ if test "$libgcj_interpreter" = yes; then AC_DEFINE(INTERPRETER) fi -EXCEPTIONSPEC= -dnl See if we should use setjmp/longjmp exceptions +AC_MSG_CHECKING([for exception model to use]) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS AC_ARG_ENABLE(sjlj-exceptions, -[ --enable-sjlj-exceptions use setjmp/longjmp exceptions], - if test "$enable_sjlj_exceptions" = yes; then - # This can be set in configure.host. - libgcj_sjlj=yes - fi) - -if test "$libgcj_sjlj" = yes; then - EXCEPTIONSPEC="-fsjlj-exceptions" - AC_DEFINE(SJLJ_EXCEPTIONS) +[ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions], +[:], +[dnl Botheration. Now we've got to detect the exception model. +dnl Link tests against libgcc.a are problematic since -- at least +dnl as of this writing -- we've not been given proper -L bits for +dnl single-tree newlib and libgloss. +dnl +dnl This is what AC_TRY_COMPILE would do if it didn't delete the +dnl conftest files before we got a change to grep them first. +cat > conftest.$ac_ext << EOF +[#]line __oline__ "configure" +struct S { ~S(); }; +void bar(); +void foo() +{ + S s; + bar(); +} +EOF +old_CXXFLAGS="$CXXFLAGS" +CXXFLAGS=-S +if AC_TRY_EVAL(ac_compile); then + if grep _Unwind_Sjlj_Resume conftest.s >/dev/null 2>&1 ; then + enable_sjlj_exceptions=yes + elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then + enable_sjlj_exceptions=no + fi +fi +CXXFLAGS="$old_CXXFLAGS" +rm -f conftest*]) +if test x$enable_sjlj_exceptions = xyes; then + AC_DEFINE(SJLJ_EXCEPTIONS, 1, + [Define if the compiler is configured for setjmp/longjmp exceptions.]) + ac_exception_model_name=sjlj +elif test x$enable_sjlj_exceptions = xno; then + ac_exception_model_name="call frame" +else + AC_MSG_ERROR([unable to detect exception model]) fi +AC_LANG_RESTORE +AC_MSG_RESULT($ac_exception_model_name) AC_MSG_CHECKING([for data_start]) LIBDATASTARTSPEC= @@ -247,43 +278,9 @@ AC_SUBST(GCTESTSPEC) AC_LINK_FILES(include/$GCHDR, include/java-gc.h) -dnl Note that this code is kept in sync with similar code in gcc/configure.in. -dnl In particular both packages must make the same decision about which -dnl thread package to use. -AC_MSG_CHECKING([for threads package to use]) -AC_ARG_ENABLE(threads, [ --enable-threads=TYPE choose threading package], - THREADS=$enableval, - dnl FIXME: figure out native threads to use here. - THREADS=no) - -if test "$THREADS" = yes; then - case "$host" in - *-*-vxworks*) - THREADS=vxworks - ;; - *-*-linux*) - # FIXME: this isn't correct in all cases. - THREADS=posix - ;; - *-*-win*) - THREADS=win32 - ;; - *-*-irix*) - # FIXME: for now, choose POSIX, because we implement that. - # Later, choose irix threads. - THREADS=posix - ;; - *-*-solaris*) - # FIXME: for now, choose POSIX, because we implement that. - # Later, choose solaris threads. - THREADS=posix - ;; - *) - # For now. - THREADS=none - ;; - esac -fi +AC_MSG_CHECKING([for thread model used by GCC]) +THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` +AC_MSG_RESULT([$THREADS]) case "$THREADS" in no | none | single) @@ -304,7 +301,6 @@ case "$THREADS" in AC_MSG_ERROR($THREADS is an unknown thread package) ;; esac -AC_MSG_RESULT($THREADS) THREADLIBS= THREADINCS= @@ -349,16 +345,17 @@ CANADIAN=no NULL_TARGET=no NATIVE=yes -# Find eh-common.h and support headers. If we're in the tree with +# Find unwind.h and support headers. If we're in the tree with # gcc, then look there. Otherwise look in compat-include. If all else # fails, just hope the user has set things up somehow. -if test -r $srcdir/../gcc/eh-common.h; then - EH_COMMON_INCLUDE='-I$(top_srcdir)/../gcc -I$(top_srcdir)/../include' +echo "probing $srcdir/../gcc/unwind.h" +if test -r $libgcj_basedir/../gcc/unwind.h; then + GCC_UNWIND_INCLUDE='-I$(libgcj_basedir)/../gcc' else if test -d $srcdir/../compat-include; then - EH_COMMON_INCLUDE='-I$(top_srcdir)/../compat-include' + GCC_UNWIND_INCLUDE='-I$(top_srcdir)/../compat-include' else - EH_COMMON_INCLUDE= + GCC_UNWIND_INCLUDE= fi fi @@ -387,18 +384,16 @@ if test -n "${with_cross_host}"; then # If Canadian cross, then don't pick up tools from the build # directory. - if test "$build" != "$with_cross_host"; then + if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then CANADIAN=yes - EH_COMMON_INCLUDE= + GCC_UNWIND_INCLUDE= GCJ="${target_alias}-gcj" - else - GCJ= fi NATIVE=no else AC_CHECK_FUNCS(strerror ioctl select fstat open fsync sleep) AC_CHECK_FUNCS(gmtime_r localtime_r readdir_r getpwuid_r getcwd) - AC_CHECK_FUNCS(access stat mkdir rename rmdir unlink realpath) + AC_CHECK_FUNCS(access stat mkdir rename rmdir unlink realpath utime chmod) AC_CHECK_FUNCS(iconv nl_langinfo setlocale) AC_CHECK_FUNCS(inet_aton inet_addr, break) AC_CHECK_FUNCS(inet_pton uname inet_ntoa) @@ -602,8 +597,31 @@ fi # Create it, so that compile/link tests don't fail test -f libgcj.spec || touch libgcj.spec +# We must search the source tree for java.lang, since we still don't +# have libgcj.jar nor java/lang/*.class +GCJ_SAVE_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS -I`pwd` -I`cd $srcdir && pwd`" + +# Since some classes depend on this one, we need its source available +# before we can do any GCJ compilation test :-( +if test ! -f gnu/classpath/Configuration.java; then + test -d gnu || mkdir gnu + test -d gnu/classpath || mkdir gnu/classpath + sed 's,@LIBGCJDEBUG@,$LIBGCJDEBUG,' \ + < $srcdir/gnu/classpath/Configuration.java.in \ + > gnu/classpath/Configuration.java + # We do not want to redirect the output of the grep below to /dev/null, + # but we add /dev/null to the input list so that grep will print the + # filename of Configuration.java in case it finds any matches. + if grep @ gnu/classpath/Configuration.java /dev/null; then + AC_MSG_ERROR([configure.in is missing the substitutions above]) + fi +fi + LT_AC_PROG_GCJ +CPPFLAGS=$GCJ_SAVE_CPPFLAGS + dnl FIXME: cross compilation AC_CHECK_SIZEOF(void *) @@ -630,13 +648,14 @@ AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes) AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes) AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host") AM_CONDITIONAL(NEEDS_DATA_START, test "$NEEDS_DATA_START" = yes && test "$NATIVE" = yes) -AC_SUBST(EH_COMMON_INCLUDE) +AC_SUBST(GCC_UNWIND_INCLUDE) # Determine gcj version number. changequote(<<,>>) gcjvers="`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`" changequote([,]) AC_DEFINE_UNQUOTED(GCJVERSION, "$gcjvers") +AC_SUBST(GCJVERSION) AC_SUBST(AM_RUNTESTFLAGS) @@ -719,9 +738,15 @@ case "${host}" in sparc-sun-solaris*) SIGNAL_HANDLER=include/sparc-signal.h ;; - ia64-*) - SYSDEP_SOURCES=sysdep/ia64.c - test -d sysdep || mkdir sysdep +# ia64-*) +# SYSDEP_SOURCES=sysdep/ia64.c +# test -d sysdep || mkdir sysdep +# ;; + powerpc-*-linux*) + SIGNAL_HANDLER=include/dwarf2-signal.h + ;; + alpha*-*-linux*) + SIGNAL_HANDLER=include/dwarf2-signal.h ;; *) SIGNAL_HANDLER=include/default-signal.h @@ -729,7 +754,7 @@ case "${host}" in esac # If we're using sjlj exceptions, forget what we just learned. -if test "$libgcj_sjlj" = yes; then +if test "$enable_sjlj_exceptions" = yes; then SIGNAL_HANDLER=include/default-signal.h fi @@ -745,11 +770,42 @@ fi AC_PATH_XTRA -AM_CONDITIONAL(NO_X, test "$no_x" = yes) +dnl Determine which AWT peer libraries to build +AC_ARG_ENABLE(java-awt, +[ --enable-java-awt list of AWT peer implementations to be built]) + +peerlibs="`echo ${enable_java_awt} | tr ',' ' '`" +use_xlib_awt="" +use_gtk_awt="" + +for peer in $peerlibs ; do + case $peer in + xlib) + if [test "$no_x" = yes]; then + echo "*** xlib peers requested but no X library available" 1>&2 + exit 1 + else + use_xlib_awt="yes" + fi + ;; + gtk) + # Nothing, yet... + ;; + *) + echo "*** unrecognised argument \"${peer}\" for --enable-java-awt" 1>&2 + exit 1 + esac +done + +AM_CONDITIONAL(XLIB_AWT, test "$use_xlib_awt" = yes) +AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes) + here=`pwd` AC_SUBST(here) +# We get this from the environment. +AC_SUBST(GCJFLAGS) AC_OUTPUT(Makefile libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile, [if test -n "$CONFIG_FILES"; then @@ -770,7 +826,7 @@ h=`pwd` changequote(<<,>>) d=`echo $f | sed -e 's,/[^/]*$,,'` changequote([,]) - $srcdir/../mkinstalldirs $d + $libgcj_basedir/../mkinstalldirs $d echo > $f } done |