1 dnl Process this with autoconf to create configure
2 AC_INIT(java/lang/System.java)
6 dnl We use these options to decide which functions to include.
7 AC_ARG_WITH(target-subdir,
8 [ --with-target-subdir=SUBDIR
9 configuring in a subdirectory])
10 AC_ARG_WITH(cross-host,
11 [ --with-cross-host=HOST configuring with a cross compiler])
15 AM_CONFIG_HEADER(include/config.h)
17 # Only use libltdl for native builds.
18 if test -z "${with_cross_host}"; then
19 AC_LIBLTDL_CONVENIENCE
23 # Sigh. Libtool's macro doesn't do the right thing.
24 INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
25 # FIXME: this is a hack.
26 sub_auxdir="`cd $ac_aux_dir && pwd`"
27 ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir"
33 AC_CONFIG_SUBDIRS($DIRLTDL)
35 if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
42 dnl The -no-testsuite modules omit the test subdir.
43 AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
45 dnl See whether the user prefers size or speed for Character.
46 dnl The default is size.
47 AC_ARG_ENABLE(fast-character,
48 [ --enable-fast-character prefer speed over size for Character],
50 , AC_DEFINE(COMPACT_CHARACTER))
52 dnl Should the runtime set system properties by examining the
53 dnl environment variable GCJ_PROPERTIES?
54 AC_ARG_ENABLE(getenv-properties,
55 [ --disable-getenv-properties
56 don't set system properties from GCJ_PROPERTIES])
58 dnl Whether GCJ_PROPERTIES is used depends on the target.
59 if test -n "$enable_getenv_properties"; then
60 enable_getenv_properties=${enable_getenv_properties_default-yes}
62 if test "$enable_getenv_properties" = no; then
63 AC_DEFINE(DISABLE_GETENV_PROPERTIES)
66 dnl See if the user has requested runtime debugging.
69 AC_ARG_ENABLE(libgcj-debug,
70 [ --enable-libgcj-debug enable runtime debugging code],
71 if test "$enable_libgcj_debug" = yes; then
76 dnl See if the user has the interpreter included.
77 AC_ARG_ENABLE(interpreter,
78 [ --enable-interpreter enable interpreter],
79 if test "$enable_interpreter" = yes; then
80 # This can also be set in configure.host.
81 libgcj_interpreter=yes
82 elif test "$enable_interpreter" = no; then
86 if test "$libgcj_interpreter" = yes; then
87 AC_DEFINE(INTERPRETER)
90 AC_MSG_CHECKING([for exception model to use])
93 AC_ARG_ENABLE(sjlj-exceptions,
94 [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
96 [dnl Botheration. Now we've got to detect the exception model.
97 dnl Link tests against libgcc.a are problematic since -- at least
98 dnl as of this writing -- we've not been given proper -L bits for
99 dnl single-tree newlib and libgloss.
101 dnl This is what AC_TRY_COMPILE would do if it didn't delete the
102 dnl conftest files before we got a change to grep them first.
103 cat > conftest.$ac_ext << EOF
104 [#]line __oline__ "configure"
113 old_CXXFLAGS="$CXXFLAGS"
115 if AC_TRY_EVAL(ac_compile); then
116 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
117 enable_sjlj_exceptions=yes
118 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
119 enable_sjlj_exceptions=no
122 CXXFLAGS="$old_CXXFLAGS"
124 if test x$enable_sjlj_exceptions = xyes; then
125 AC_DEFINE(SJLJ_EXCEPTIONS, 1,
126 [Define if the compiler is configured for setjmp/longjmp exceptions.])
127 ac_exception_model_name=sjlj
128 elif test x$enable_sjlj_exceptions = xno; then
129 ac_exception_model_name="call frame"
131 AC_MSG_ERROR([unable to detect exception model])
134 AC_MSG_RESULT($ac_exception_model_name)
136 AC_MSG_CHECKING([for data_start])
139 AC_TRY_LINK([extern int data_start;], [return ((int) &data_start);],
140 [AC_MSG_RESULT(found it)],
141 [LIBDATASTARTSPEC="-u data_start libgcjdata.a%s"
143 AC_MSG_RESULT(missing)])
144 AC_SUBST(LIBDATASTARTSPEC)
146 dnl See if the user wants to disable java.net. This is the mildly
147 dnl ugly way that we admit that target-side configuration sucks.
148 AC_ARG_ENABLE(java-net,
149 [ --disable-java-net disable java.net])
151 dnl Whether java.net is built by default can depend on the target.
152 if test -n "$enable_java_net"; then
153 enable_java_net=${enable_java_net_default-yes}
155 if test "$enable_java_net" = no; then
156 AC_DEFINE(DISABLE_JAVA_NET)
159 dnl See if the user wants to disable JVMPI support.
161 [ --disable-jvmpi disable JVMPI support])
163 if test "$enable_jvmpi" != no; then
164 AC_DEFINE(ENABLE_JVMPI)
167 dnl If the target is an eCos system, use the appropriate eCos
169 dnl FIXME: this should not be a local option but a global target
170 dnl system; at present there is no eCos target.
173 [ --with-ecos enable runtime eCos target support],
174 TARGET_ECOS="$with_ecos"
177 case "$TARGET_ECOS" in
179 FILE_DESCRIPTOR=natFileDescriptorPosix.cc
180 PROCESS=${PROCESS-Posix}
183 FILE_DESCRIPTOR=natFileDescriptorEcos.cc
189 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED))
190 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED))
191 AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
192 AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
195 dnl These may not be defined in a non-ANS conformant embedded system.
196 dnl FIXME: Should these case a runtime exception in that case?
197 AC_EGREP_HEADER(mktime, time.h, AC_DEFINE(HAVE_MKTIME))
198 AC_EGREP_HEADER(localtime, time.h, AC_DEFINE(HAVE_LOCALTIME))
200 dnl Create the subdirectory for natFileDescriptor.cc, or the attempt
201 dnl to create the link will fail.
202 test -d java || mkdir java
203 test -d java/io || mkdir java/io
204 test -d gnu || mkdir gnu
205 AC_LINK_FILES(java/io/$FILE_DESCRIPTOR, java/io/natFileDescriptor.cc)
207 dnl Likewise for ConcreteProcess.java and natConcreteProcess.cc.
208 test -d java/lang || mkdir java/lang
209 AC_LINK_FILES(java/lang/${PROCESS}Process.java, java/lang/ConcreteProcess.java)
210 AC_LINK_FILES(java/lang/nat${PROCESS}Process.cc, java/lang/natConcreteProcess.cc)
215 LIBGCJTESTSPEC="-L`pwd`/.libs -rpath `pwd`/.libs"
216 AC_SUBST(LIBGCJTESTSPEC)
218 AC_ARG_WITH(system-zlib,
219 [ --with-system-zlib use installed libz])
223 AC_SUBST(ZLIBTESTSPEC)
225 dnl FIXME: this should be _libs on some hosts.
228 dnl Allow the GC to be disabled. Can be useful when debugging.
229 AC_MSG_CHECKING([for garbage collector to use])
230 AC_ARG_ENABLE(java-gc,
231 changequote(<<,>>)dnl
232 << --enable-java-gc=TYPE choose garbage collector [boehm]>>,
246 GCDEPS='$(top_builddir)/../boehm-gc/libgcjgc.la'
247 # We include the path to the boehm-gc build directory.
248 # See Makefile.am to understand why.
249 GCLIBS="$GCDEPS -L\$(here)/../boehm-gc/$libsubdir"
250 GCINCS='-I$(top_srcdir)/../boehm-gc -I$(top_builddir)/../boehm-gc'
252 JC1GCSPEC='-fuse-boehm-gc'
253 GCTESTSPEC="-L`pwd`/../boehm-gc/.libs -rpath `pwd`/../boehm-gc/.libs"
254 dnl We also want to pick up some cpp flags required when including
255 dnl boehm-config.h. Yuck.
256 GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`"
259 dnl The POSIX thread support needs to know this.
260 AC_DEFINE(HAVE_BOEHM_GC)
268 AC_MSG_ERROR(unrecognized collector \"$GC\")
278 AC_LINK_FILES(include/$GCHDR, include/java-gc.h)
281 AC_MSG_CHECKING([for thread model used by GCC])
282 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
283 AC_MSG_RESULT([$THREADS])
293 AC_DEFINE(LINUX_THREADS)
297 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
298 AC_MSG_ERROR(thread package $THREADS not yet supported)
301 AC_MSG_ERROR($THREADS is an unknown thread package)
315 THREADOBJS=posix-threads.lo
316 THREADH=posix-threads.h
317 # MIT pthreads doesn't seem to have the mutexattr functions.
318 # But for now we don't check for it. We just assume you aren't
319 # using MIT pthreads.
320 AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT)
322 # If we're using the Boehm GC, then we happen to know that it
323 # defines _REENTRANT, so we don't bother. Eww.
324 if test "$GC" != boehm; then
325 AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
327 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Required define if using POSIX threads])
331 THREADOBJS=no-threads.lo
335 AC_LINK_FILES(include/$THREADH, include/java-threads.h)
342 AM_CONDITIONAL(USING_GCC, test "$GCC" = yes)
348 # Find unwind.h and support headers. If we're in the tree with
349 # gcc, then look there. Otherwise look in compat-include. If all else
350 # fails, just hope the user has set things up somehow.
351 echo "probing $srcdir/../gcc/unwind.h"
352 if test -r $libgcj_basedir/../gcc/unwind.h; then
353 GCC_UNWIND_INCLUDE='-I$(libgcj_basedir)/../gcc'
355 if test -d $srcdir/../compat-include; then
356 GCC_UNWIND_INCLUDE='-I$(top_srcdir)/../compat-include'
362 if test -n "${with_cross_host}"; then
363 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
364 # may not work correctly, because the compiler may not be able to
367 # We assume newlib. This lets us hard-code the functions we know
369 AC_DEFINE(HAVE_MEMMOVE)
370 AC_DEFINE(HAVE_MEMCPY)
371 AC_DEFINE(HAVE_STRERROR)
372 AC_DEFINE(HAVE_GMTIME_R)
373 AC_DEFINE(HAVE_LOCALTIME_R)
374 dnl This is only for POSIX threads.
375 AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT)
376 dnl We also assume we are using gcc, which provides alloca.
377 AC_DEFINE(HAVE_ALLOCA)
379 dnl Assume we do not have getuid and friends.
383 ZLIBTESTSPEC="-L`pwd`/../zlib/.libs -rpath `pwd`/../zlib/.libs"
385 # If Canadian cross, then don't pick up tools from the build
387 if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then
390 GCJ="${target_alias}-gcj"
394 AC_CHECK_FUNCS(strerror ioctl select fstat open fsync sleep)
395 AC_CHECK_FUNCS(gmtime_r localtime_r readdir_r getpwuid_r getcwd)
396 AC_CHECK_FUNCS(access stat mkdir rename rmdir unlink realpath utime chmod)
397 AC_CHECK_FUNCS(nl_langinfo setlocale)
398 AC_CHECK_FUNCS(inet_aton inet_addr, break)
399 AC_CHECK_FUNCS(inet_pton uname inet_ntoa)
400 AC_CHECK_FUNCS(backtrace fork execvp pipe)
401 AC_CHECK_HEADERS(execinfo.h unistd.h dlfcn.h)
402 AC_CHECK_LIB(dl, dladdr, [
403 AC_DEFINE(HAVE_DLADDR)])
404 AC_CHECK_FILES(/proc/self/exe, [
405 AC_DEFINE(HAVE_PROC_SELF_EXE)])
409 AC_CHECK_FUNCS(gethostbyname_r, [
410 AC_DEFINE(HAVE_GETHOSTBYNAME_R)
411 # There are two different kinds of gethostbyname_r.
412 # We look for the one that returns `int'.
413 # Hopefully this check is robust enough.
414 AC_EGREP_HEADER(int.*gethostbyname_r, netdb.h, [
415 AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT)])
418 *" -D_REENTRANT "*) ;;
420 dnl On DU4.0, gethostbyname_r is only declared with -D_REENTRANT
421 AC_CACHE_CHECK([whether gethostbyname_r declaration requires -D_REENTRANT],
422 [libjava_cv_gethostbyname_r_needs_reentrant],
425 AC_TRY_COMPILE([#include <netdb.h>],
426 [gethostbyname_r("", 0, 0);],
427 [libjava_cv_gethostbyname_r_needs_reentrant=no], [dnl
428 CPPFLAGS_SAVE="$CPPFLAGS"
429 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
430 AC_TRY_COMPILE([#include <netdb.h>], [gethostbyname_r("", 0, 0);],
431 [libjava_cv_gethostbyname_r_needs_reentrant=yes],
432 [libjava_cv_gethostbyname_r_needs_reentrant=fail])
433 CPPFLAGS="$CPPFLAGS_SAVE"
437 if test "x$libjava_cv_gethostbyname_r_needs_reentrant" = xyes; then
438 AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
443 AC_CACHE_CHECK([for struct hostent_data],
444 [libjava_cv_struct_hostent_data], [dnl
446 #if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
447 # define _REENTRANT 1
449 #include <netdb.h>], [struct hostent_data data;],
450 [libjava_cv_struct_hostent_data=yes],
451 [libjava_cv_struct_hostent_data=no])])
452 if test "x$libjava_cv_struct_hostent_data" = xyes; then
453 AC_DEFINE(HAVE_STRUCT_HOSTENT_DATA, 1,
454 [Define if struct hostent_data is defined in netdb.h])
458 AC_CHECK_FUNCS(gethostbyaddr_r, [
459 AC_DEFINE(HAVE_GETHOSTBYADDR_R)
460 # There are two different kinds of gethostbyaddr_r.
461 # We look for the one that returns `int'.
462 # Hopefully this check is robust enough.
463 AC_EGREP_HEADER(int.*gethostbyaddr_r, netdb.h, [
464 AC_DEFINE(GETHOSTBYADDR_R_RETURNS_INT)])])
466 AC_CHECK_FUNCS(gethostname, [
467 AC_DEFINE(HAVE_GETHOSTNAME)
468 AC_EGREP_HEADER(gethostname, unistd.h, [
469 AC_DEFINE(HAVE_GETHOSTNAME_DECL)])])
471 # Look for these functions in the thread library, but only bother
472 # if using POSIX threads.
473 if test "$THREADS" = posix; then
475 LIBS="$LIBS $THREADLIBS"
476 # Some POSIX thread systems don't have pthread_mutexattr_settype.
478 AC_CHECK_FUNCS(pthread_mutexattr_settype pthread_mutexattr_setkind_np)
480 # Look for sched_yield. Up to Solaris 2.6, it is in libposix4, since
481 # Solaris 7 the name librt is preferred.
482 AC_CHECK_FUNCS(sched_yield, , [
483 AC_CHECK_LIB(rt, sched_yield, [
484 AC_DEFINE(HAVE_SCHED_YIELD)
485 THREADLIBS="$THREADLIBS -lrt"
486 THREADSPEC="$THREADSPEC -lrt"], [
487 AC_CHECK_LIB(posix4, sched_yield, [
488 AC_DEFINE(HAVE_SCHED_YIELD)
489 THREADLIBS="$THREADLIBS -lposix4"
490 THREADSPEC="$THREADSPEC -lposix4"])])])
493 # We can save a little space at runtime if the mutex has m_count
494 # or __m_count. This is a nice hack for Linux.
495 AC_TRY_COMPILE([#include <pthread.h>], [
496 extern pthread_mutex_t *mutex; int q = mutex->m_count;
497 ], AC_DEFINE(PTHREAD_MUTEX_HAVE_M_COUNT), [
498 AC_TRY_COMPILE([#include <pthread.h>], [
499 extern pthread_mutex_t *mutex; int q = mutex->__m_count;
500 ], AC_DEFINE(PTHREAD_MUTEX_HAVE___M_COUNT))])
503 # We require a way to get the time.
505 AC_CHECK_FUNCS(gettimeofday time ftime, time_found=yes)
506 if test "$time_found" = no; then
507 AC_MSG_ERROR([no function found to get the time])
510 AC_CHECK_FUNCS(memmove)
514 AC_CHECK_FUNCS(memcpy, memcpy_found=yes)
515 if test "$memcpy_found" = no; then
516 AC_MSG_ERROR([memcpy is required])
519 # Some library-finding code we stole from Tcl.
520 #--------------------------------------------------------------------
521 # Check for the existence of the -lsocket and -lnsl libraries.
522 # The order here is important, so that they end up in the right
523 # order in the command line generated by make. Here are some
524 # special considerations:
525 # 1. Use "connect" and "accept" to check for -lsocket, and
526 # "gethostbyname" to check for -lnsl.
527 # 2. Use each function name only once: can't redo a check because
528 # autoconf caches the results of the last check and won't redo it.
529 # 3. Use -lnsl and -lsocket only if they supply procedures that
530 # aren't already present in the normal libraries. This is because
531 # IRIX 5.2 has libraries, but they aren't needed and they're
532 # bogus: they goof up name resolution if used.
533 # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
534 # To get around this problem, check for both libraries together
535 # if -lsocket doesn't work by itself.
536 #--------------------------------------------------------------------
538 AC_CACHE_CHECK([for socket libraries], gcj_cv_lib_sockets,
541 unset ac_cv_func_connect
542 AC_CHECK_FUNC(connect, gcj_checkSocket=0, gcj_checkSocket=1)
543 if test "$gcj_checkSocket" = 1; then
544 unset ac_cv_func_connect
545 AC_CHECK_LIB(socket, main, gcj_cv_lib_sockets="-lsocket",
548 if test "$gcj_checkBoth" = 1; then
550 LIBS="$LIBS -lsocket -lnsl"
551 unset ac_cv_func_accept
552 AC_CHECK_FUNC(accept,
554 gcj_cv_lib_sockets="-lsocket -lnsl"])
555 unset ac_cv_func_accept
558 unset ac_cv_func_gethostbyname
560 LIBS="$LIBS $gcj_cv_lib_sockets"
561 AC_CHECK_FUNC(gethostbyname, ,
562 [AC_CHECK_LIB(nsl, main,
563 [gcj_cv_lib_sockets="$gcj_cv_lib_sockets -lnsl"])])
564 unset ac_cv_func_gethostbyname
567 SYSTEMSPEC="$SYSTEMSPEC $gcj_cv_lib_sockets"
569 if test "$with_system_zlib" = yes; then
570 AC_CHECK_LIB(z, deflate, ZLIBSPEC=-lz, ZLIBSPEC=-lzgcj)
573 ZLIBTESTSPEC="-L`pwd`/../zlib/.libs -rpath `pwd`/../zlib/.libs"
576 # On Solaris, and maybe other architectures, the Boehm collector
578 if test "$GC" = boehm; then
579 AC_CHECK_LIB(dl, main, SYSTEMSPEC="$SYSTEMSPEC -ldl")
582 if test -z "${with_multisubdir}"; then
586 builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
589 if test -x "${builddotdot}/../../gcc/gcj"; then
590 dir="`cd ${builddotdot}/../../gcc && pwd`"
591 GCJ="$dir/gcj -B`pwd`/ -B$dir/"
599 # Create it, so that compile/link tests don't fail
600 test -f libgcj.spec || touch libgcj.spec
602 # We must search the source tree for java.lang, since we still don't
603 # have libgcj.jar nor java/lang/*.class
604 GCJ_SAVE_CPPFLAGS=$CPPFLAGS
605 CPPFLAGS="$CPPFLAGS -I`pwd` -I`cd $srcdir && pwd`"
607 # Since some classes depend on this one, we need its source available
608 # before we can do any GCJ compilation test :-(
609 if test ! -f gnu/classpath/Configuration.java; then
610 test -d gnu || mkdir gnu
611 test -d gnu/classpath || mkdir gnu/classpath
612 sed 's,@LIBGCJDEBUG@,$LIBGCJDEBUG,' \
613 < $srcdir/gnu/classpath/Configuration.java.in \
614 > gnu/classpath/Configuration.java
615 # We do not want to redirect the output of the grep below to /dev/null,
616 # but we add /dev/null to the input list so that grep will print the
617 # filename of Configuration.java in case it finds any matches.
618 if grep @ gnu/classpath/Configuration.java /dev/null; then
619 AC_MSG_ERROR([configure.in is missing the substitutions above])
625 CPPFLAGS=$GCJ_SAVE_CPPFLAGS
627 dnl FIXME: cross compilation
628 AC_CHECK_SIZEOF(void *)
633 if test "x$ZLIBSPEC" = "x-lzgcj"; then
634 # We include the path to the zlib build directory.
635 # See Makefile.am to understand why.
636 ZDEPS='$(top_builddir)/../zlib/libzgcj.la'
637 ZLIBS="$ZDEPS -L\$(here)/../zlib/$libsubdir"
638 ZINCS='-I$(top_srcdir)/../zlib'
646 AC_SUBST(EXCEPTIONSPEC)
648 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
649 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
650 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
651 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
652 AM_CONDITIONAL(NEEDS_DATA_START, test "$NEEDS_DATA_START" = yes && test "$NATIVE" = yes)
653 AC_SUBST(GCC_UNWIND_INCLUDE)
655 # Determine gcj version number.
657 gcjvers="`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`"
659 AC_DEFINE_UNQUOTED(GCJVERSION, "$gcjvers")
662 AC_SUBST(AM_RUNTESTFLAGS)
664 dnl Work around a g++ bug. Reported to gcc-bugs@gcc.gnu.org on Jan 22, 2000.
665 AC_MSG_CHECKING([for g++ -ffloat-store bug])
666 save_CFLAGS="$CFLAGS"
667 CFLAGS="-x c++ -O2 -ffloat-store"
668 AC_TRY_COMPILE([#include <math.h>], ,
670 [AC_DEFINE(__NO_MATH_INLINES)
672 CFLAGS="$save_CFLAGS"
674 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
675 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
676 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
677 AC_CHECK_HEADERS(unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/filio.h sys/stat.h sys/select.h sys/socket.h netinet/in.h arpa/inet.h netdb.h pwd.h sys/config.h inttypes.h stdint.h langinfo.h locale.h)
678 dnl We avoid AC_HEADER_DIRENT since we really only care about dirent.h
679 dnl for now. If you change this, you also must update natFile.cc.
680 AC_CHECK_HEADERS(dirent.h)
682 AC_CHECK_TYPE([ssize_t], [int])
684 AC_MSG_CHECKING([for in_addr_t])
685 AC_TRY_COMPILE([#include <sys/types.h>
690 #if HAVE_NETINET_IN_H
691 #include <netinet/in.h>
692 #endif], [in_addr_t foo;],
693 [AC_DEFINE([HAVE_IN_ADDR_T])
697 AC_MSG_CHECKING([whether struct ip_mreq is in netinet/in.h])
698 AC_TRY_COMPILE([#include <netinet/in.h>], [struct ip_mreq mreq;],
699 [AC_DEFINE(HAVE_STRUCT_IP_MREQ)
703 AC_MSG_CHECKING([whether struct ipv6_mreq is in netinet/in.h])
704 AC_TRY_COMPILE([#include <netinet/in.h>], [struct ipv6_mreq mreq6;],
705 [AC_DEFINE(HAVE_STRUCT_IPV6_MREQ)
709 AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
710 AC_TRY_COMPILE([#include <netinet/in.h>], [struct sockaddr_in6 addr6;],
711 [AC_DEFINE(HAVE_INET6)
715 AC_MSG_CHECKING([for socklen_t in sys/socket.h])
716 AC_TRY_COMPILE([#define _POSIX_PII_SOCKET
717 #include <sys/types.h>
718 #include <sys/socket.h>], [socklen_t x = 5;],
719 [AC_DEFINE(HAVE_SOCKLEN_T)
723 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
724 AC_TRY_COMPILE([#include <time.h>], [struct tm tim; tim.tm_gmtoff = 0;],
725 [AC_DEFINE(STRUCT_TM_HAS_GMTOFF)
728 AC_MSG_CHECKING([for global timezone variable])
729 dnl FIXME: we don't want a link check here because that won't work
730 dnl when cross-compiling. So instead we make an assumption that
731 dnl the header file will mention timezone if it exists.
732 AC_TRY_COMPILE([#include <time.h>], [long z2 = timezone;],
733 [AC_DEFINE(HAVE_TIMEZONE)
735 [AC_MSG_RESULT(no)])])
739 AC_CHECK_PROGS(PERL, perl, false)
745 SIGNAL_HANDLER=include/i386-signal.h
748 SIGNAL_HANDLER=include/sparc-signal.h
751 # SYSDEP_SOURCES=sysdep/ia64.c
752 # test -d sysdep || mkdir sysdep
755 SIGNAL_HANDLER=include/dwarf2-signal.h
758 SIGNAL_HANDLER=include/dwarf2-signal.h
761 SIGNAL_HANDLER=include/default-signal.h
765 # If we're using sjlj exceptions, forget what we just learned.
766 if test "$enable_sjlj_exceptions" = yes; then
767 SIGNAL_HANDLER=include/default-signal.h
770 AC_SUBST(SYSDEP_SOURCES)
772 AC_LINK_FILES($SIGNAL_HANDLER, include/java-signal.h)
774 if test "${multilib}" = "yes"; then
775 multilib_arg="--enable-multilib"
782 dnl Determine which AWT peer libraries to build
783 AC_ARG_ENABLE(java-awt,
784 [ --enable-java-awt list of AWT peer implementations to be built])
786 peerlibs="`echo ${enable_java_awt} | tr ',' ' '`"
790 for peer in $peerlibs ; do
793 if [test "$no_x" = yes]; then
794 echo "*** xlib peers requested but no X library available" 1>&2
804 echo "*** unrecognised argument \"${peer}\" for --enable-java-awt" 1>&2
809 AM_CONDITIONAL(XLIB_AWT, test "$use_xlib_awt" = yes)
810 AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes)
816 # We get this from the environment.
819 AC_OUTPUT(Makefile libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile,
820 [if test -n "$CONFIG_FILES"; then
821 ac_file=Makefile . ${libgcj_basedir}/../config-ml.in
824 # Make subdirectories and `.d' files. Look in both srcdir and
825 # builddir for the .java files.
828 ( (cd $srcdir && find . -name '*.java' -print) ;
829 find . -name '*.java' -print) | \
830 fgrep -v testsuite | \
831 sed -e 's/\.java/.d/' | \
833 echo "include $f" >> deps.mk
836 d=`echo $f | sed -e 's,/[^/]*$,,'`
838 $libgcj_basedir/../mkinstalldirs $d
846 with_multisubdir=${with_multisubdir}
847 ac_configure_args="${multilib_arg} ${ac_configure_args}"
848 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
849 libgcj_basedir=${libgcj_basedir}