source: trunk/gcc/libjava/configure.in@ 2542

Last change on this file since 2542 was 1392, checked in by bird, 22 years ago

This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 31.5 KB
Line 
1dnl Process this with autoconf to create configure
2AC_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.
8ORIGINAL_LD_FOR_MULTILIBS=$LD
9
10AC_PROG_LN_S
11
12dnl We use these options to decide which functions to include.
13AC_ARG_WITH(target-subdir,
14[ --with-target-subdir=SUBDIR
15 configuring in a subdirectory])
16AC_ARG_WITH(cross-host,
17[ --with-cross-host=HOST configuring with a cross compiler])
18
19AC_ARG_WITH(newlib,
20[ --with-newlib Configuring with newlib])
21
22LIBGCJ_CONFIGURE(.)
23
24AM_CONFIG_HEADER(include/config.h gcj/libgcj-config.h)
25
26# Only use libltdl for native builds.
27if 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"
37fi
38AC_SUBST(INCLTDL)
39AC_SUBST(LIBLTDL)
40AC_SUBST(DIRLTDL)
41AM_PROG_LIBTOOL
42AC_CONFIG_SUBDIRS($DIRLTDL)
43
44if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
45 COMPPATH=.
46else
47 COMPPATH=..
48fi
49AC_SUBST(COMPPATH)
50
51dnl The -no-testsuite modules omit the test subdir.
52AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
53
54dnl Should the runtime set system properties by examining the
55dnl environment variable GCJ_PROPERTIES?
56AC_ARG_ENABLE(getenv-properties,
57[ --disable-getenv-properties
58 don't set system properties from GCJ_PROPERTIES])
59
60dnl Whether GCJ_PROPERTIES is used depends on the target.
61if test -z "$enable_getenv_properties"; then
62 enable_getenv_properties=${enable_getenv_properties_default-yes}
63fi
64if test "$enable_getenv_properties" = no; then
65 AC_DEFINE(DISABLE_GETENV_PROPERTIES)
66fi
67
68dnl Whether we should use arguments to main()
69if test -z "$enable_main_args"; then
70 enable_main_args=${enable_main_args_default-yes}
71fi
72if test "$enable_main_args" = no; then
73 AC_DEFINE(DISABLE_MAIN_ARGS)
74fi
75
76
77dnl Should we use hashtable-based synchronization?
78dnl Currently works only for Linux X86/ia64
79dnl Typically faster and more space-efficient
80AC_ARG_ENABLE(hash-synchronization,
81[ --enable-hash-synchronization
82 Use global hash table for monitor locks])
83
84if test -z "$enable_hash_synchronization"; then
85 enable_hash_synchronization=$enable_hash_synchronization_default
86fi
87
88dnl configure.host sets slow_pthread_self if the synchronization code should
89dnl try to avoid pthread_self calls by caching thread IDs in a hashtable.
90if test "${slow_pthread_self}" = "yes"; then
91 AC_DEFINE(SLOW_PTHREAD_SELF)
92fi
93
94
95dnl See if the user has requested runtime debugging.
96LIBGCJDEBUG="false"
97AC_SUBST(LIBGCJDEBUG)
98AC_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
105dnl See if the user has the interpreter included.
106AC_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
115if test "$libgcj_interpreter" = yes; then
116 AC_DEFINE(INTERPRETER)
117fi
118INTERPRETER="$libgcj_interpreter"
119AC_SUBST(INTERPRETER)
120
121AC_MSG_CHECKING([for exception model to use])
122AC_LANG_SAVE
123AC_LANG_CPLUSPLUS
124AC_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.
128dnl Link tests against libgcc.a are problematic since -- at least
129dnl as of this writing -- we've not been given proper -L bits for
130dnl single-tree newlib and libgloss.
131dnl
132dnl This is what AC_TRY_COMPILE would do if it didn't delete the
133dnl conftest files before we got a change to grep them first.
134cat > conftest.$ac_ext << EOF
135[#]line __oline__ "configure"
136struct S { ~S(); };
137void bar();
138void foo()
139{
140 S s;
141 bar();
142}
143EOF
144old_CXXFLAGS="$CXXFLAGS"
145CXXFLAGS=-S
146if 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
152fi
153CXXFLAGS="$old_CXXFLAGS"
154rm -f conftest*])
155if 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
159elif test x$enable_sjlj_exceptions = xno; then
160 ac_exception_model_name="call frame"
161else
162 AC_MSG_ERROR([unable to detect exception model])
163fi
164AC_LANG_RESTORE
165AC_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.
169if test $can_unwind_signal = no && test $enable_sjlj_exceptions = no; then
170 CHECKREFSPEC=-fcheck-references
171 DIVIDESPEC=-fuse-divide-subroutine
172 EXCEPTIONSPEC=
173fi
174
175dnl See if the user wants to disable java.net. This is the mildly