source: trunk/src/gcc/libjava/configure.in@ 1614

Last change on this file since 1614 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
RevLine 
[2]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
[1391]19AC_ARG_WITH(newlib,
20[ --with-newlib Configuring with newlib])
21
[2]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.
[1391]35 sub_auxdir="`cd $ac_aux_dir && ${PWDCMD-pwd}`"
[2]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
[1391]118INTERPRETER="$libgcj_interpreter"
119AC_SUBST(INTERPRETER)
[2]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
176dnl ugly way that we admit that target-side configuration sucks.
177AC_ARG_ENABLE(java-net,
178[ --disable-java-net disable java.net])
179
180dnl Whether java.net is built by default can depend on the target.
181if test -z "$enable_java_net"; then
182 enable_java_net=${enable_java_net_default-yes}
183fi
184if test "$enable_java_net" = no; then
185 AC_DEFINE(DISABLE_JAVA_NET)
186fi
187
188dnl See if the user wants to configure without libffi. Some
189dnl architectures don't support it, and default values are set in
190dnl configure.host.
191AC_ARG_WITH(libffi,
192[ --without-libffi don't use libffi],,with_libffi=${with_libffi_default-yes})
193
194LIBFFI=
195LIBFFIINCS=
196if test "$with_libffi" != no; then
197 AC_DEFINE(USE_LIBFFI)
198 LIBFFI=../libffi/libffi_convenience.la
[1391]199 LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I../libffi/include'
[2]200fi
201AC_SUBST(LIBFFI)
202AC_SUBST(LIBFFIINCS)
203
204dnl See if the user wants to disable JVMPI support.
205AC_ARG_ENABLE(jvmpi,
206[ --disable-jvmpi disable JVMPI support])
207
208if test "$enable_jvmpi" != no; then
209 AC_DEFINE(ENABLE_JVMPI)
210fi
211
212dnl If the target is an eCos system, use the appropriate eCos
213dnl I/O routines.
214dnl FIXME: this should not be a local option but a global target
215dnl system; at present there is no eCos target.
216TARGET_ECOS=${PROCESS-"no"}
217AC_ARG_WITH(ecos,
218[ --with-ecos enable runtime eCos target support],
219TARGET_ECOS="$with_ecos"
220)
221
222PLATFORMOBJS=
223case "$TARGET_ECOS" in
224 no) case "$host" in
225 *mingw*)
226 PLATFORM=Win32
227 PLATFORMOBJS=win32.lo
228 PLATFORMH=win32.h
[1391]229 CHECK_FOR_BROKEN_MINGW_LD
[2]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 ;;
244esac
245AC_SUBST(PLATFORMOBJS)
246AC_LINK_FILES(include/$PLATFORMH, include/platform.h)
247
248AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED))
249AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED))
250AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
251AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
252
253
254dnl These may not be defined in a non-ANS conformant embedded system.
255dnl FIXME: Should these case a runtime exception in that case?
256AC_EGREP_HEADER(mktime, time.h, AC_DEFINE(HAVE_MKTIME))
257AC_EGREP_HEADER(localtime, time.h, AC_DEFINE(HAVE_LOCALTIME))
258
259dnl Create the subdirectory for natFileDescriptor.cc, or the attempt
260dnl to create the link will fail.
261test -d java || mkdir java
262test -d java/io || mkdir java/io
263test -d gnu || mkdir gnu
264AC_LINK_FILES(java/io/natFile${FILE-${PLATFORM}}.cc, java/io/natFile.cc)
265AC_LINK_FILES(java/io/natFileDescriptor${FILE-${PLATFORM}}.cc, java/io/natFileDescriptor.cc)
266
267dnl Likewise for ConcreteProcess.java and natConcreteProcess.cc.
268test -d java/lang || mkdir java/lang
269AC_LINK_FILES(java/lang/${PLATFORM}Process.java, java/lang/ConcreteProcess.java)
270AC_LINK_FILES(java/lang/nat${PLATFORM}Process.cc, java/lang/natConcreteProcess.cc)
271
272case "${host}" in
273 *mingw*)
274 SYSTEMSPEC="-lgdi32 -lwsock32 -lws2_32"
275 ;;
276 *)
277 SYSTEMSPEC=
278 ;;
279esac
280AC_SUBST(SYSTEMSPEC)
281
[1391]282LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -rpath `${PWDCMD-pwd}`/.libs"
[2]283AC_SUBST(LIBGCJTESTSPEC)
284
285AC_ARG_WITH(system-zlib,
286[ --with-system-zlib use installed libz])
287ZLIBSPEC=
288AC_SUBST(ZLIBSPEC)
289ZLIBTESTSPEC=
290AC_SUBST(ZLIBTESTSPEC)
291
292dnl FIXME: this should be _libs on some hosts.
293libsubdir=.libs
294
295dnl Allow the GC to be disabled. Can be useful when debugging.
296AC_MSG_CHECKING([for garbage collector to use])
297AC_ARG_ENABLE(java-gc,
298changequote(<<,>>)dnl
299<< --enable-java-gc=TYPE choose garbage collector [boehm]>>,
300changequote([,])
301 GC=$enableval,
302 GC=boehm)
303GCLIBS=
304GCINCS=
305GCDEPS=
306GCOBJS=
307GCSPEC=
308JC1GCSPEC=
309GCTESTSPEC=
310case "$GC" in
311 boehm)
312 AC_MSG_RESULT(boehm)
313 GCLIBS=../boehm-gc/libgcjgc_convenience.la
314 GCINCS='-I$(top_srcdir)/../boehm-gc/include'
315 JC1GCSPEC='-fuse-boehm-gc'
[1391]316 GCTESTSPEC="-L`${PWDCMD-pwd}`/../boehm-gc/.libs -rpath `${PWDCMD-pwd}`/../boehm-gc/.libs"
[2]317
318 dnl We also want to pick up some cpp flags required when including
319 dnl boehm-config.h. Yuck.
320 GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`"
321 GCOBJS=boehm.lo
322 GCHDR=boehm-gc.h
323 dnl The POSIX thread support needs to know this.
324 AC_DEFINE(HAVE_BOEHM_GC)
325 ;;
326 no)
327 AC_MSG_RESULT(none)
328 GCOBJS=nogc.lo
329 GCHDR=no-gc.h
330 ;;
331 *)
332 AC_MSG_ERROR(unrecognized collector \"$GC\")
333 ;;
334esac
335AC_SUBST(GCLIBS)
336AC_SUBST(GCINCS)
337AC_SUBST(GCDEPS)
338AC_SUBST(GCOBJS)
339AC_SUBST(GCSPEC)
340AC_SUBST(JC1GCSPEC)
341AC_SUBST(GCTESTSPEC)
342AC_LINK_FILES(include/$GCHDR, include/java-gc.h)
343
344
345AC_MSG_CHECKING([for thread model used by GCC])
346THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
347AC_MSG_RESULT([$THREADS])
348
349case "$THREADS" in
350 no | none | single)
351 THREADS=none
352 ;;
353 posix | pthreads)
354 THREADS=posix
355 case "$host" in
356 *-*-linux*)
357 AC_DEFINE(LINUX_THREADS)
358 ;;
359 esac
360 ;;