| 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 | LIBGCJ_CONFIGURE(.)
|
|---|
| 20 |
|
|---|
| 21 | AM_CONFIG_HEADER(include/config.h gcj/libgcj-config.h)
|
|---|
| 22 |
|
|---|
| 23 | # Only use libltdl for native builds.
|
|---|
| 24 | if test -z "${with_cross_host}"; then
|
|---|
| 25 | AC_LIBLTDL_CONVENIENCE
|
|---|
| 26 | AC_LIBTOOL_DLOPEN
|
|---|
| 27 | DIRLTDL=libltdl
|
|---|
| 28 | AC_DEFINE(USE_LTDL)
|
|---|
| 29 | # Sigh. Libtool's macro doesn't do the right thing.
|
|---|
| 30 | INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
|
|---|
| 31 | # FIXME: this is a hack.
|
|---|
| 32 | sub_auxdir="`cd $ac_aux_dir && pwd`"
|
|---|
| 33 | ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir"
|
|---|
| 34 | fi
|
|---|
| 35 | AC_SUBST(INCLTDL)
|
|---|
| 36 | AC_SUBST(LIBLTDL)
|
|---|
| 37 | AC_SUBST(DIRLTDL)
|
|---|
| 38 | AM_PROG_LIBTOOL
|
|---|
| 39 | AC_CONFIG_SUBDIRS($DIRLTDL)
|
|---|
| 40 |
|
|---|
| 41 | if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
|
|---|
| 42 | COMPPATH=.
|
|---|
| 43 | else
|
|---|
| 44 | COMPPATH=..
|
|---|
| 45 | fi
|
|---|
| 46 | AC_SUBST(COMPPATH)
|
|---|
| 47 |
|
|---|
| 48 | dnl The -no-testsuite modules omit the test subdir.
|
|---|
| 49 | AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
|
|---|
| 50 |
|
|---|
| 51 | dnl Should the runtime set system properties by examining the
|
|---|
| 52 | dnl environment variable GCJ_PROPERTIES?
|
|---|
| 53 | AC_ARG_ENABLE(getenv-properties,
|
|---|
| 54 | [ --disable-getenv-properties
|
|---|
| 55 | don't set system properties from GCJ_PROPERTIES])
|
|---|
| 56 |
|
|---|
| 57 | dnl Whether GCJ_PROPERTIES is used depends on the target.
|
|---|
| 58 | if test -z "$enable_getenv_properties"; then
|
|---|
| 59 | enable_getenv_properties=${enable_getenv_properties_default-yes}
|
|---|
| 60 | fi
|
|---|
| 61 | if test "$enable_getenv_properties" = no; then
|
|---|
| 62 | AC_DEFINE(DISABLE_GETENV_PROPERTIES)
|
|---|
| 63 | fi
|
|---|
| 64 |
|
|---|
| 65 | dnl Whether we should use arguments to main()
|
|---|
| 66 | if test -z "$enable_main_args"; then
|
|---|
| 67 | enable_main_args=${enable_main_args_default-yes}
|
|---|
| 68 | fi
|
|---|
| 69 | if test "$enable_main_args" = no; then
|
|---|
| 70 | AC_DEFINE(DISABLE_MAIN_ARGS)
|
|---|
| 71 | fi
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 | dnl Should we use hashtable-based synchronization?
|
|---|
| 75 | dnl Currently works only for Linux X86/ia64
|
|---|
| 76 | dnl Typically faster and more space-efficient
|
|---|
| 77 | AC_ARG_ENABLE(hash-synchronization,
|
|---|
| 78 | [ --enable-hash-synchronization
|
|---|
| 79 | Use global hash table for monitor locks])
|
|---|
| 80 |
|
|---|
| 81 | if test -z "$enable_hash_synchronization"; then
|
|---|
| 82 | enable_hash_synchronization=$enable_hash_synchronization_default
|
|---|
| 83 | fi
|
|---|
| 84 |
|
|---|
| 85 | dnl configure.host sets slow_pthread_self if the synchronization code should
|
|---|
| 86 | dnl try to avoid pthread_self calls by caching thread IDs in a hashtable.
|
|---|
| 87 | if test "${slow_pthread_self}" = "yes"; then
|
|---|
| 88 | AC_DEFINE(SLOW_PTHREAD_SELF)
|
|---|
| 89 | fi
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 | dnl See if the user has requested runtime debugging.
|
|---|
| 93 | LIBGCJDEBUG="false"
|
|---|
| 94 | AC_SUBST(LIBGCJDEBUG)
|
|---|
| 95 | AC_ARG_ENABLE(libgcj-debug,
|
|---|
| 96 | [ --enable-libgcj-debug enable runtime debugging code],
|
|---|
| 97 | if test "$enable_libgcj_debug" = yes; then
|
|---|
| 98 | AC_DEFINE(DEBUG)
|
|---|
| 99 | LIBGCJDEBUG="true"
|
|---|
| 100 | fi)
|
|---|
| 101 |
|
|---|
| 102 | dnl See if the user has the interpreter included.
|
|---|
| 103 | AC_ARG_ENABLE(interpreter,
|
|---|
| 104 | [ --enable-interpreter enable interpreter],
|
|---|
| 105 | if test "$enable_interpreter" = yes; then
|
|---|
| 106 | # This can also be set in configure.host.
|
|---|
| 107 | libgcj_interpreter=yes
|
|---|
| 108 | elif test "$enable_interpreter" = no; then
|
|---|
| 109 | libgcj_interpreter=no
|
|---|
| 110 | fi)
|
|---|
| 111 |
|
|---|
| 112 | if test "$libgcj_interpreter" = yes; then
|
|---|
| 113 | AC_DEFINE(INTERPRETER)
|
|---|
| 114 | fi
|
|---|
| 115 |
|
|---|
| 116 | AC_MSG_CHECKING([for exception model to use])
|
|---|
| 117 | AC_LANG_SAVE
|
|---|
| 118 | AC_LANG_CPLUSPLUS
|
|---|
| 119 | AC_ARG_ENABLE(sjlj-exceptions,
|
|---|
| 120 | [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
|
|---|
| 121 | [:],
|
|---|
| 122 | [dnl Botheration. Now we've got to detect the exception model.
|
|---|
| 123 | dnl Link tests against libgcc.a are problematic since -- at least
|
|---|
| 124 | dnl as of this writing -- we've not been given proper -L bits for
|
|---|
| 125 | dnl single-tree newlib and libgloss.
|
|---|
| 126 | dnl
|
|---|
| 127 | dnl This is what AC_TRY_COMPILE would do if it didn't delete the
|
|---|
| 128 | dnl conftest files before we got a change to grep them first.
|
|---|
| 129 | cat > conftest.$ac_ext << EOF
|
|---|
| 130 | [#]line __oline__ "configure"
|
|---|
| 131 | struct S { ~S(); };
|
|---|
| 132 | void bar();
|
|---|
| 133 | void foo()
|
|---|
| 134 | {
|
|---|
|
|---|