| 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
|
|---|
| 176 | dnl ugly way that we admit that target-side configuration sucks.
|
|---|
| 177 | AC_ARG_ENABLE(java-net,
|
|---|
| 178 | [ --disable-java-net disable java.net])
|
|---|
| 179 |
|
|---|
| 180 | dnl Whether java.net is built by default can depend on the target.
|
|---|
| 181 | if test -z "$enable_java_net"; then
|
|---|
| 182 | enable_java_net=${enable_java_net_default-yes}
|
|---|
| 183 | fi
|
|---|
| 184 | if test "$enable_java_net" = no; then
|
|---|
| 185 | AC_DEFINE(DISABLE_JAVA_NET)
|
|---|
| 186 | fi
|
|---|
| 187 |
|
|---|
| 188 | dnl See if the user wants to configure without libffi. Some
|
|---|
| 189 | dnl architectures don't support it, and default values are set in
|
|---|
| 190 | dnl configure.host.
|
|---|
| 191 | AC_ARG_WITH(libffi,
|
|---|
| 192 | [ --without-libffi don't use libffi],,with_libffi=${with_libffi_default-yes})
|
|---|
| 193 |
|
|---|
| 194 | LIBFFI=
|
|---|
| 195 | LIBFFIINCS=
|
|---|
| 196 | if test "$with_libffi" != no; then
|
|---|
| 197 | AC_DEFINE(USE_LIBFFI)
|
|---|
| 198 | LIBFFI=../libffi/libffi_convenience.la
|
|---|
| 199 | LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I../libffi/include'
|
|---|
| 200 | fi
|
|---|
| 201 | AC_SUBST(LIBFFI)
|
|---|
| 202 | AC_SUBST(LIBFFIINCS)
|
|---|
| 203 |
|
|---|
| 204 | dnl See if the user wants to disable JVMPI support.
|
|---|
| 205 | AC_ARG_ENABLE(jvmpi,
|
|---|
| 206 | [ --disable-jvmpi disable JVMPI support])
|
|---|
| 207 |
|
|---|
| 208 | if test "$enable_jvmpi" != no; then
|
|---|
| 209 | AC_DEFINE(ENABLE_JVMPI)
|
|---|
| 210 | fi
|
|---|
| 211 |
|
|---|
| 212 | dnl If the target is an eCos system, use the appropriate eCos
|
|---|
| 213 | dnl I/O routines.
|
|---|
| 214 | dnl FIXME: this should not be a local option but a global target
|
|---|
| 215 | dnl system; at present there is no eCos target.
|
|---|
| 216 | TARGET_ECOS=${PROCESS-"no"}
|
|---|
| 217 | AC_ARG_WITH(ecos,
|
|---|
| 218 | [ --with-ecos enable runtime eCos target support],
|
|---|
| 219 | TARGET_ECOS="$with_ecos"
|
|---|
| 220 | )
|
|---|
| 221 |
|
|---|
| 222 | PLATFORMOBJS=
|
|---|
| 223 | case "$TARGET_ECOS" in
|
|---|
| 224 | no) case "$host" in
|
|---|
| 225 | *mingw*)
|
|---|
| 226 | PLATFORM=Win32
|
|---|
| 227 | PLATFORMOBJS=win32.lo
|
|---|
| 228 | PLATFORMH=win32.h
|
|---|
| 229 | CHECK_FOR_BROKEN_MINGW_LD
|
|---|
| 230 | ;;
|
|---|
| 231 | *)
|
|---|
| 232 | PLATFORM=Posix
|
|---|
| 233 | PLATFORMOBJS=posix.lo
|
|---|
| 234 | PLATFORMH=posix.h
|
|---|
| 235 | ;;
|
|---|
| 236 | esac
|
|---|
| 237 | ;;
|
|---|
| 238 | *)
|
|---|
| 239 | PLATFORM=Ecos
|
|---|
| 240 | AC_DEFINE(ECOS)
|
|---|
| 241 | PLATFORMOBJS=posix.lo
|
|---|
| 242 | PLATFORMH=posix.h
|
|---|
| 243 | ;;
|
|---|
| 244 | esac
|
|---|
| 245 | AC_SUBST(PLATFORMOBJS)
|
|---|
| 246 | AC_LINK_FILES(include/$PLATFORMH, include/platform.h)
|
|---|
| 247 |
|
|---|
| 248 | AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED))
|
|---|
|
|---|