| 1 | dnl Process this with autoconf to create configure
|
|---|
| 2 | AC_INIT(java/lang/System.java)
|
|---|
| 3 |
|
|---|
| 4 | # This works around the fact that libtool configuration may change LD
|
|---|
| 5 | # for this particular configuration, but some shells, instead of
|
|---|
| 6 | # keeping the changes in LD private, export them just because LD is
|
|---|
| 7 | # exported.
|
|---|
| 8 | ORIGINAL_LD_FOR_MULTILIBS=$LD
|
|---|
| 9 |
|
|---|
| 10 | AC_PROG_LN_S
|
|---|
| 11 |
|
|---|
| 12 | dnl We use these options to decide which functions to include.
|
|---|
| 13 | AC_ARG_WITH(target-subdir,
|
|---|
| 14 | [ --with-target-subdir=SUBDIR
|
|---|
| 15 | configuring in a subdirectory])
|
|---|
| 16 | AC_ARG_WITH(cross-host,
|
|---|
| 17 | [ --with-cross-host=HOST configuring with a cross compiler])
|
|---|
| 18 |
|
|---|
| 19 | AC_ARG_WITH(newlib,
|
|---|
| 20 | [ --with-newlib Configuring with newlib])
|
|---|
| 21 |
|
|---|
| 22 | LIBGCJ_CONFIGURE(.)
|
|---|
| 23 |
|
|---|
| 24 | AM_CONFIG_HEADER(include/config.h gcj/libgcj-config.h)
|
|---|
| 25 |
|
|---|
| 26 | # Only use libltdl for native builds.
|
|---|
| 27 | if test -z "${with_cross_host}"; then
|
|---|
| 28 | AC_LIBLTDL_CONVENIENCE
|
|---|
| 29 | AC_LIBTOOL_DLOPEN
|
|---|
| 30 | DIRLTDL=libltdl
|
|---|
| 31 | AC_DEFINE(USE_LTDL)
|
|---|
| 32 | # Sigh. Libtool's macro doesn't do the right thing.
|
|---|
| 33 | INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
|
|---|
| 34 | # FIXME: this is a hack.
|
|---|
| 35 | sub_auxdir="`cd $ac_aux_dir && ${PWDCMD-pwd}`"
|
|---|
| 36 | ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir"
|
|---|
| 37 | fi
|
|---|
| 38 | AC_SUBST(INCLTDL)
|
|---|
| 39 | AC_SUBST(LIBLTDL)
|
|---|
| 40 | AC_SUBST(DIRLTDL)
|
|---|
| 41 | AM_PROG_LIBTOOL
|
|---|
| 42 | AC_CONFIG_SUBDIRS($DIRLTDL)
|
|---|
| 43 |
|
|---|
| 44 | if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
|
|---|
| 45 | COMPPATH=.
|
|---|
| 46 | else
|
|---|
| 47 | COMPPATH=..
|
|---|
| 48 | fi
|
|---|
| 49 | AC_SUBST(COMPPATH)
|
|---|
| 50 |
|
|---|
| 51 | dnl The -no-testsuite modules omit the test subdir.
|
|---|
| 52 | AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
|
|---|
| 53 |
|
|---|
| 54 | dnl Should the runtime set system properties by examining the
|
|---|
| 55 | dnl environment variable GCJ_PROPERTIES?
|
|---|
| 56 | AC_ARG_ENABLE(getenv-properties,
|
|---|
| 57 | [ --disable-getenv-properties
|
|---|
| 58 | don't set system properties from GCJ_PROPERTIES])
|
|---|
| 59 |
|
|---|
| 60 | dnl Whether GCJ_PROPERTIES is used depends on the target.
|
|---|
| 61 | if test -z "$enable_getenv_properties"; then
|
|---|
| 62 | enable_getenv_properties=${enable_getenv_properties_default-yes}
|
|---|
| 63 | fi
|
|---|
| 64 | if test "$enable_getenv_properties" = no; then
|
|---|
| 65 | AC_DEFINE(DISABLE_GETENV_PROPERTIES)
|
|---|
| 66 | fi
|
|---|
| 67 |
|
|---|
| 68 | dnl Whether we should use arguments to main()
|
|---|
| 69 | if test -z "$enable_main_args"; then
|
|---|
| 70 | enable_main_args=${enable_main_args_default-yes}
|
|---|
| 71 | fi
|
|---|
| 72 | if test "$enable_main_args" = no; then
|
|---|
| 73 | AC_DEFINE(DISABLE_MAIN_ARGS)
|
|---|
| 74 | fi
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 | dnl Should we use hashtable-based synchronization?
|
|---|
| 78 | dnl Currently works only for Linux X86/ia64
|
|---|
| 79 | dnl Typically faster and more space-efficient
|
|---|
| 80 | AC_ARG_ENABLE(hash-synchronization,
|
|---|
| 81 | [ --enable-hash-synchronization
|
|---|
| 82 | Use global hash table for monitor locks])
|
|---|
| 83 |
|
|---|
| 84 | if test -z "$enable_hash_synchronization"; then
|
|---|
| 85 | enable_hash_synchronization=$enable_hash_synchronization_default
|
|---|
| 86 | fi
|
|---|
| 87 |
|
|---|
| 88 | dnl configure.host sets slow_pthread_self if the synchronization code should
|
|---|
| 89 | dnl try to avoid pthread_self calls by caching thread IDs in a hashtable.
|
|---|
| 90 | if test "${slow_pthread_self}" = "yes"; then
|
|---|
| 91 | AC_DEFINE(SLOW_PTHREAD_SELF)
|
|---|
| 92 | fi
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 | dnl See if the user has requested runtime debugging.
|
|---|
| 96 | LIBGCJDEBUG="false"
|
|---|
| 97 | AC_SUBST(LIBGCJDEBUG)
|
|---|
| 98 | AC_ARG_ENABLE(libgcj-debug,
|
|---|
| 99 | [ --enable-libgcj-debug enable runtime debugging code],
|
|---|
| 100 | if test "$enable_libgcj_debug" = yes; then
|
|---|
| 101 | AC_DEFINE(DEBUG)
|
|---|
| 102 | LIBGCJDEBUG="true"
|
|---|
| 103 | fi)
|
|---|
| 104 |
|
|---|
| 105 | dnl See if the user has the interpreter included.
|
|---|
| 106 | AC_ARG_ENABLE(interpreter,
|
|---|
| 107 | [ --enable-interpreter enable interpreter],
|
|---|
| 108 | if test "$enable_interpreter" = yes; then
|
|---|
| 109 | # This can also be set in configure.host.
|
|---|
| 110 | libgcj_interpreter=yes
|
|---|
| 111 | elif test "$enable_interpreter" = no; then
|
|---|
| 112 | libgcj_interpreter=no
|
|---|
| 113 | fi)
|
|---|
| 114 |
|
|---|
| 115 | if test "$libgcj_interpreter" = yes; then
|
|---|
| 116 | AC_DEFINE(INTERPRETER)
|
|---|
| 117 | fi
|
|---|
| 118 | INTERPRETER="$libgcj_interpreter"
|
|---|
| 119 | AC_SUBST(INTERPRETER)
|
|---|
| 120 |
|
|---|
| 121 | AC_MSG_CHECKING([for exception model to use])
|
|---|
| 122 | AC_LANG_SAVE
|
|---|
| 123 | AC_LANG_CPLUSPLUS
|
|---|
| 124 | AC_ARG_ENABLE(sjlj-exceptions,
|
|---|
| 125 | [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
|
|---|
| 126 | [:],
|
|---|
| 127 | [dnl Botheration. Now we've got to detect the exception model.
|
|---|
| 128 | dnl Link tests against libgcc.a are problematic since -- at least
|
|---|
| 129 | dnl as of this writing -- we've not been given proper -L bits for
|
|---|
| 130 | dnl single-tree newlib and libgloss.
|
|---|
| 131 | dnl
|
|---|
| 132 | dnl This is what AC_TRY_COMPILE would do if it didn't delete the
|
|---|
| 133 | dnl conftest files before we got a change to grep them first.
|
|---|
| 134 | cat > conftest.$ac_ext << EOF
|
|---|
| 135 | [#]line __oline__ "configure"
|
|---|
| 136 | struct S { ~S(); };
|
|---|
| 137 | void bar();
|
|---|
| 138 | void foo()
|
|---|
| 139 | {
|
|---|
| 140 | S s;
|
|---|
| 141 | bar();
|
|---|
| 142 | }
|
|---|
| 143 | EOF
|
|---|
| 144 | old_CXXFLAGS="$CXXFLAGS"
|
|---|
| 145 | CXXFLAGS=-S
|
|---|
| 146 | if AC_TRY_EVAL(ac_compile); then
|
|---|
| 147 | if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
|
|---|
| 148 | enable_sjlj_exceptions=yes
|
|---|
| 149 | elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
|
|---|
| 150 | enable_sjlj_exceptions=no
|
|---|
| 151 | fi
|
|---|
| 152 | fi
|
|---|
| 153 | CXXFLAGS="$old_CXXFLAGS"
|
|---|
| 154 | rm -f conftest*])
|
|---|
| 155 | if test x$enable_sjlj_exceptions = xyes; then
|
|---|
| 156 | AC_DEFINE(SJLJ_EXCEPTIONS, 1,
|
|---|
| 157 | [Define if the compiler is configured for setjmp/longjmp exceptions.])
|
|---|
| 158 | ac_exception_model_name=sjlj
|
|---|
| 159 | elif test x$enable_sjlj_exceptions = xno; then
|
|---|
| 160 | ac_exception_model_name="call frame"
|
|---|
| 161 | else
|
|---|
| 162 | AC_MSG_ERROR([unable to detect exception model])
|
|---|
| 163 | fi
|
|---|
| 164 | AC_LANG_RESTORE
|
|---|
| 165 | AC_MSG_RESULT($ac_exception_model_name)
|
|---|
| 166 |
|
|---|
| 167 | # If we are non using SJLJ exceptions, and this host does not have support
|
|---|
| 168 | # for unwinding from a signal handler, enable checked dereferences and divides.
|
|---|
| 169 | if test $can_unwind_signal = no && test $enable_sjlj_exceptions = no; then
|
|---|
| 170 | CHECKREFSPEC=-fcheck-references
|
|---|
| 171 | DIVIDESPEC=-fuse-divide-subroutine
|
|---|
| 172 | EXCEPTIONSPEC=
|
|---|
| 173 | fi
|
|---|
| 174 |
|
|---|
| 175 | dnl See if the user wants to disable java.net. This is the mildly
|
|---|
|
|---|