OSDN Git Service

Mon Aug 9 18:33:38 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
[pf3gnuchains/gcc-fork.git] / libjava / configure.in
1 dnl Process this with autoconf to create configure
2 AC_INIT(java/lang/System.java)
3
4 dnl Can't be done in LIBGCJ_CONFIGURE because that confuses automake.
5 AC_CONFIG_AUX_DIR(..)
6
7 AC_CANONICAL_SYSTEM
8
9 dnl We use these options to decide which functions to include.
10 AC_ARG_WITH(target-subdir,
11 [  --with-target-subdir=SUBDIR      Configuring in a subdirectory])
12 AC_ARG_WITH(cross-host,
13 [  --with-cross-host=HOST           Configuring with a cross compiler])
14
15 LIBGCJ_CONFIGURE(.)
16
17 AM_CONFIG_HEADER(include/config.h)
18
19 AM_PROG_LIBTOOL
20
21 if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
22    COMPPATH=.
23 else
24    COMPPATH=..
25 fi
26 AC_SUBST(COMPPATH)
27
28 dnl The -no-testsuite modules omit the test subdir.
29 AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
30
31 dnl See whether the user prefers size or speed for Character.
32 dnl The default is size.
33 AC_ARG_ENABLE(fast-character,
34 [  --enable-fast-character          Prefer speed over size for Character],
35 # Nothing
36 , AC_DEFINE(COMPACT_CHARACTER))
37
38 dnl See if the user has requested runtime debugging.
39 AC_ARG_ENABLE(libgcj-debug,
40 [  --enable-libgcj-debug           Enable runtime debugging code],
41   if test "$enable_libgcj_debug" = yes; then
42      AC_DEFINE(DEBUG)
43   fi)
44
45 dnl See if the user has the enterpreter included.
46 AC_ARG_ENABLE(interpreter,
47 [  --enable-interpreter            Enable interpreter],
48   if test "$enable_interpreter" = yes; then
49      AC_DEFINE(INTERPRETER)
50   fi)
51
52 dnl This becomes -lffi if the interpreter is enables
53 INTERPSPEC=
54 AC_SUBST(INTERPSPEC)
55
56 dnl If the target is an eCos system, use the appropriate eCos
57 dnl I/O routines.
58 dnl FIXME: this should not be a local option but a global target
59 dnl system; at present there is no eCos target.
60 TARGET_ECOS="no"
61 AC_ARG_WITH(ecos,
62 [  --with-ecos      Enable runtime eCos target support.],
63 TARGET_ECOS="$with_ecos"
64 )
65
66 case "$TARGET_ECOS" in
67    no)
68       FILE_DESCRIPTOR=natFileDescriptorPosix.cc
69       PROCESS=Posix
70       ;;
71    *)
72       FILE_DESCRIPTOR=natFileDescriptorEcos.cc
73       PROCESS=Ecos
74       AC_DEFINE(ECOS)
75       ;;
76 esac
77
78 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED))
79 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED))
80 AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
81 AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
82
83
84 dnl These may not be defined in a non-ANS conformant embedded system.
85 dnl FIXME: Should these case a runtime exception in that case?
86 AC_EGREP_HEADER(mktime, time.h, AC_DEFINE(HAVE_MKTIME))
87 AC_EGREP_HEADER(localtime, time.h, AC_DEFINE(HAVE_LOCALTIME))
88
89 dnl Create the subdirectory for natFileDescriptor.cc, or the attempt
90 dnl to create the link will fail.
91 test -d java || mkdir java
92 test -d java/io || mkdir java/io
93 AC_LINK_FILES(java/io/$FILE_DESCRIPTOR, java/io/natFileDescriptor.cc)
94
95 dnl Likewise for ConcreteProcess.java and natConcreteProcess.cc.
96 test -d java/lang || mkdir java/lang
97 AC_LINK_FILES(java/lang/${PROCESS}Process.java, java/lang/ConcreteProcess.java)
98 AC_LINK_FILES(java/lang/nat${PROCESS}Process.cc, java/lang/natConcreteProcess.cc)
99
100 SYSTEMSPEC=
101 AC_SUBST(SYSTEMSPEC)
102
103 AC_ARG_WITH(system-zlib,
104 [  --with-system-zlib               Use installed libz])
105 ZLIBSPEC=
106 AC_SUBST(ZLIBSPEC)
107
108 dnl FIXME: this should be _libs on some hosts.
109 libsubdir=.libs
110
111 dnl Allow the GC to be disabled.  Can be useful when debugging.
112 AC_MSG_CHECKING([for garbage collector to use])
113 AC_ARG_ENABLE(java-gc,
114 changequote(<<,>>)dnl
115 <<  --enable-java-gc=TYPE    choose garbage collector [boehm]>>,
116 changequote([,])
117   GC=$enableval,
118   GC=boehm)
119 GCLIBS=
120 GCINCS=
121 GCDEPS=
122 GCOBJS=
123 GCSPEC=
124 case "$GC" in
125  boehm)
126     AC_MSG_RESULT(boehm)
127     GCDEPS='$(top_builddir)/../boehm-gc/libgcjgc.la'
128     # We include the path to the boehm-gc build directory.
129     # See Makefile.am to understand why.
130     GCLIBS="$GCDEPS -L\$(here)/../boehm-gc/$libsubdir"
131     GCINCS='-I$(top_srcdir)/../boehm-gc -I$(top_builddir)/../boehm-gc'
132     GCSPEC='-lgcjgc'
133     dnl We also want to pick up some cpp flags required when including
134     dnl boehm-config.h.  Yuck.
135     GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`"
136     GCOBJS=boehm.lo
137     GCHDR=boehm-gc.h
138     dnl The POSIX thread support needs to know this.
139     AC_DEFINE(HAVE_BOEHM_GC)
140     ;;
141  no)
142     AC_MSG_RESULT(none)
143     GCOBJS=nogc.lo
144     GCHDR=no-gc.h
145     ;;
146  *)
147     AC_MSG_ERROR(unrecognized collector \"$GC\")
148     ;;
149 esac
150 AC_SUBST(GCLIBS)
151 AC_SUBST(GCINCS)
152 AC_SUBST(GCDEPS)
153 AC_SUBST(GCOBJS)
154 AC_SUBST(GCSPEC)
155 AC_LINK_FILES(include/$GCHDR, include/java-gc.h)
156
157
158 dnl Note that this code is kept in sync with similar code in gcc/configure.in.
159 dnl In particular both packages must make the same decision about which
160 dnl thread package to use.
161 AC_MSG_CHECKING([for threads package to use])
162 AC_ARG_ENABLE(threads, [  --enable-threads=TYPE    choose threading package],
163   THREADS=$enableval,
164   dnl FIXME: figure out native threads to use here.
165   THREADS=no)
166
167 if test "$THREADS" = yes; then
168    case "$host" in
169     *-*-vxworks*)
170        THREADS=vxworks
171        ;;
172     *-*-linux*)
173        # FIXME: this isn't correct in all cases.
174        THREADS=posix
175        ;;
176     *-*-win*)
177        THREADS=win32
178        ;;
179     *-*-irix*)
180        # FIXME: for now, choose POSIX, because we implement that.
181        # Later, choose irix threads.
182        THREADS=posix
183        ;;
184     *-*-solaris*)
185        # FIXME: for now, choose POSIX, because we implement that.
186        # Later, choose solaris threads.
187        THREADS=posix
188        ;;
189     *)
190        # For now.
191        THREADS=none
192        ;;
193    esac
194 fi
195
196 case "$THREADS" in
197  no | none | single)
198     THREADS=none
199     ;;
200  posix | pthreads)
201     THREADS=posix
202     case "$host" in
203      *-*-linux*)
204         AC_DEFINE(LINUX_THREADS)
205         ;;
206     esac
207     ;;
208  qt)
209     ;;
210  decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
211     AC_MSG_ERROR(thread package $THREADS not yet supported)
212     ;;
213  *)
214     AC_MSG_ERROR($THREADS is an unknown thread package)
215     ;;
216 esac
217 AC_MSG_RESULT($THREADS)
218
219 THREADLIBS=
220 THREADINCS=
221 THREADDEPS=
222 THREADOBJS=
223 THREADH=
224 THREADSPEC=
225 case "$THREADS" in
226  posix)
227     THREADLIBS=-lpthread
228     THREADSPEC=-lpthread
229     THREADOBJS=posix-threads.lo
230     THREADH=posix-threads.h
231     # MIT pthreads doesn't seem to have the mutexattr functions.
232     # But for now we don't check for it.  We just assume you aren't
233     # using MIT pthreads.
234     AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT)
235     ;;
236
237  qt)
238     THREADDEPS='$(top_builddir)/../qthreads/libgcjcoop.la'
239     # We include the path to the qthreads build directory.
240     # See Makefile.am to understand why.
241     THREADLIBS="$THREADDEPS -L\$(here)/../qthreads/$libsubdir"
242     THREADSPEC='-lgcjcoop'
243     THREADOBJS=quick-threads.lo
244     THREADINCS='-I$(top_srcdir)/../qthreads'
245     THREADH=quick-threads.h
246     ;;
247
248  none)
249     THREADOBJS=no-threads.lo
250     THREADH=no-threads.h
251     ;;
252 esac
253 AC_LINK_FILES(include/$THREADH, include/java-threads.h)
254 AC_SUBST(THREADLIBS)
255 AC_SUBST(THREADINCS)
256 AC_SUBST(THREADDEPS)
257 AC_SUBST(THREADOBJS)
258 AC_SUBST(THREADSPEC)
259
260 AM_CONDITIONAL(USING_GCC, test "$GCC" = yes)
261
262 CANADIAN=no
263 NULL_TARGET=no
264
265 # Find eh-common.h and support headers.  If we're in the tree with
266 # gcc, then look there.  Otherwise look in compat-include.  If all else
267 # fails, just hope the user has set things up somehow.
268 if test -r $srcdir/../gcc/eh-common.h; then
269    EH_COMMON_INCLUDE='-I$(top_srcdir)/../gcc -I$(top_srcdir)/../include'
270 else
271    if test -d $srcdir/../compat-include; then
272       EH_COMMON_INCLUDE='-I$(top_srcdir)/../compat-include'
273    else
274       EH_COMMON_INCLUDE=
275    fi
276 fi
277
278 if test -n "${with_cross_host}"; then
279    # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
280    # may not work correctly, because the compiler may not be able to
281    # link executables.
282
283    # We assume newlib.  This lets us hard-code the functions we know
284    # we'll have.
285    AC_DEFINE(HAVE_MEMMOVE)
286    AC_DEFINE(HAVE_MEMCPY)
287    AC_DEFINE(HAVE_STRERROR)
288    AC_DEFINE(HAVE_CTIME_R)
289    AC_DEFINE(HAVE_GMTIME_R)
290    AC_DEFINE(HAVE_LOCALTIME_R)
291    dnl This is only for POSIX threads.
292    AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT)
293    dnl We also assume we are using gcc, which provides alloca.
294    AC_DEFINE(HAVE_ALLOCA)
295
296    ZLIBSPEC=-lgcj
297
298    # If Canadian cross, then don't pick up tools from the build
299    # directory.
300    if test "$build" != "$with_cross_host"; then
301       CANADIAN=yes
302       EH_COMMON_INCLUDE=
303       GCJ="${target_alias}/gcj"
304    else
305       GCJ=
306    fi
307 else
308    # Some POSIX thread systems don't have pthread_mutexattr_settype.
309    # E.g., Solaris.
310    AC_CHECK_FUNCS(strerror ioctl select open fsync sleep)
311    AC_CHECK_FUNCS(ctime_r ctime, break)
312    AC_CHECK_FUNCS(gmtime_r localtime_r readdir_r getpwuid_r)
313    AC_CHECK_FUNCS(access stat mkdir rename rmdir unlink realpath)
314    AC_CHECK_FUNCS(inet_aton inet_addr, break)
315    AC_CHECK_FUNCS(inet_pton uname inet_ntoa)
316
317    AC_CHECK_FUNCS(gethostbyname_r, [
318      AC_DEFINE(HAVE_GETHOSTBYNAME_R)
319      # There are two different kinds of gethostbyname_r.
320      # We look for the one that returns `int'.
321      # Hopefully this check is robust enough.
322      AC_EGREP_HEADER(int.*gethostbyname_r, netdb.h, [
323        AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT)])
324
325      case " $GCINCS " in
326      *" -D_REENTRANT "*) ;;
327      *)
328         dnl On DU4.0, gethostbyname_r is only declared with -D_REENTRANT
329         AC_CACHE_CHECK([whether gethostbyname_r declaration requires -D_REENTRANT],
330         [libjava_cv_gethostbyname_r_needs_reentrant],
331         [ AC_LANG_SAVE
332           AC_LANG_CPLUSPLUS
333           AC_TRY_COMPILE([#include <netdb.h>],
334             [gethostbyname_r("", 0, 0);],
335             [libjava_cv_gethostbyname_r_needs_reentrant=no], [dnl
336                 CPPFLAGS_SAVE="$CPPFLAGS"
337                 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
338                 AC_TRY_COMPILE([#include <netdb.h>], [gethostbyname_r("", 0, 0);],
339                     [libjava_cv_gethostbyname_r_needs_reentrant=yes],
340                     [libjava_cv_gethostbyname_r_needs_reentrant=fail])
341                 CPPFLAGS="$CPPFLAGS_SAVE"
342           ])
343           AC_LANG_RESTORE
344         ])
345         if test "x$libjava_cv_gethostbyname_r_needs_reentrant" = xyes; then
346           AC_DEFINE(GETHOSTBYNAME_R_NEEDS_REENTRANT, 1, [Define if gethostbyname_r is only declared if _REENTRANT is defined])
347         fi
348      ;;
349      esac
350
351      AC_CACHE_CHECK([for struct hostent_data],
352         [libjava_cv_struct_hostent_data], [dnl
353         AC_TRY_COMPILE([
354 #if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
355 # define _REENTRANT 1
356 #endif
357 #include <netdb.h>], [struct hostent_data data;],
358           [libjava_cv_struct_hostent_data=yes],
359           [libjava_cv_struct_hostent_data=no])])
360      if test "x$libjava_cv_struct_hostent_data" = xyes; then
361        AC_DEFINE(HAVE_STRUCT_HOSTENT_DATA, 1,
362          [Define if struct hostent_data is defined in netdb.h])
363      fi
364    ])
365
366    AC_CHECK_FUNCS(gethostbyaddr_r, [
367      AC_DEFINE(HAVE_GETHOSTBYADDR_R)
368      # There are two different kinds of gethostbyaddr_r.
369      # We look for the one that returns `int'.
370      # Hopefully this check is robust enough.
371      AC_EGREP_HEADER(int.*gethostbyaddr_r, netdb.h, [
372        AC_DEFINE(GETHOSTBYADDR_R_RETURNS_INT)])])
373
374    AC_CHECK_FUNCS(gethostname, [
375      AC_DEFINE(HAVE_GETHOSTNAME)
376      AC_EGREP_HEADER(gethostname, unistd.h, [
377        AC_DEFINE(HAVE_GETHOSTNAME_DECL)])])
378
379    # Look for these functions in the thread library.
380    save_LIBS="$LIBS"
381    LIBS="$LIBS $THREADLIBS"
382    AC_CHECK_FUNCS(pthread_mutexattr_settype pthread_mutexattr_setkind_np)
383
384    # Look for sched_yield.  Up to Solaris 2.6, it is in libposix4, since
385    # Solaris 7 the name librt is preferred.
386    AC_CHECK_FUNCS(sched_yield, , [
387      AC_CHECK_LIB(rt, sched_yield, [
388        AC_DEFINE(HAVE_SCHED_YIELD)
389        THREADLIBS="$THREADLIBS -lrt"
390        THREADSPECS="$THREADSPECS -lrt"], [
391        AC_CHECK_LIB(posix4, sched_yield, [
392          AC_DEFINE(HAVE_SCHED_YIELD)
393          THREADLIBS="$THREADLIBS -lposix4"
394          THREADSPECS="$THREADSPECS -lposix4"])])])
395    LIBS="$save_LIBS"
396
397    # We require a way to get the time.
398    time_found=no
399    AC_CHECK_FUNCS(gettimeofday time ftime, time_found=yes)
400    if test "$time_found" = no; then
401       AC_MSG_ERROR([no function found to get the time])
402    fi
403
404    AC_CHECK_FUNCS(memmove)
405
406    # We require memcpy.
407    memcpy_found=no
408    AC_CHECK_FUNCS(memcpy, memcpy_found=yes)
409    if test "$memcpy_found" = no; then
410       AC_MSG_ERROR([memcpy is required])
411    fi
412
413    # Some library-finding code we stole from Tcl.
414    #--------------------------------------------------------------------
415    #    Check for the existence of the -lsocket and -lnsl libraries.
416    #    The order here is important, so that they end up in the right
417    #    order in the command line generated by make.  Here are some
418    #    special considerations:
419    #    1. Use "connect" and "accept" to check for -lsocket, and
420    #       "gethostbyname" to check for -lnsl.
421    #    2. Use each function name only once:  can't redo a check because
422    #       autoconf caches the results of the last check and won't redo it.
423    #    3. Use -lnsl and -lsocket only if they supply procedures that
424    #       aren't already present in the normal libraries.  This is because
425    #       IRIX 5.2 has libraries, but they aren't needed and they're
426    #       bogus:  they goof up name resolution if used.
427    #    4. On some SVR4 systems, can't use -lsocket without -lnsl too.
428    #       To get around this problem, check for both libraries together
429    #       if -lsocket doesn't work by itself.
430    #--------------------------------------------------------------------
431
432    AC_CACHE_CHECK([for socket libraries], gcj_cv_lib_sockets,
433     [gcj_cv_lib_sockets=
434      gcj_checkBoth=0
435      unset ac_cv_func_connect
436      AC_CHECK_FUNC(connect, gcj_checkSocket=0, gcj_checkSocket=1)
437      if test "$gcj_checkSocket" = 1; then
438          unset ac_cv_func_connect
439          AC_CHECK_LIB(socket, main, gcj_cv_lib_sockets="-lsocket",
440                       gcj_checkBoth=1)
441      fi
442      if test "$gcj_checkBoth" = 1; then
443          gcj_oldLibs=$LIBS
444          LIBS="$LIBS -lsocket -lnsl"
445          unset ac_cv_func_accept
446          AC_CHECK_FUNC(accept,
447                        [gcj_checkNsl=0
448                         gcj_cv_lib_sockets="-lsocket -lnsl"])
449          unset ac_cv_func_accept
450          LIBS=$gcj_oldLibs
451      fi
452      unset ac_cv_func_gethostbyname
453      gcj_oldLibs=$LIBS
454      LIBS="$LIBS $gcj_cv_lib_sockets"
455      AC_CHECK_FUNC(gethostbyname, ,
456                    [AC_CHECK_LIB(nsl, main,
457                                  [gcj_cv_lib_sockets="$gcj_cv_lib_sockets -lnsl"])])
458      unset ac_cv_func_gethostbyname
459      LIBS=$gcj_oldLIBS
460    ])
461    SYSTEMSPEC="$SYSTEMSPEC $gcj_cv_lib_sockets"
462
463    if test "$enable_interpreter" = yes; then
464       INTERPSPEC=
465    fi
466
467    if test "$with_system_zlib" = yes; then
468       AC_CHECK_LIB(z, deflate, ZLIBSPEC=-lz, ZLIBSPEC=-lzgcj)
469    else
470       ZLIBSPEC=-lzgcj
471    fi
472
473    # On Solaris, and maybe other architectures, the Boehm collector
474    # requires -ldl.
475    if test "$GC" = boehm; then
476       AC_CHECK_LIB(dl, main, SYSTEMSPEC="$SYSTEMSPEC -ldl")
477    fi
478
479    if test -d "$libgcj_basedir/../gcc/java"; then
480       GCJ=
481    else
482       CANADIAN=yes
483       NULL_TARGET=yes
484       GCJ=gcj
485    fi
486 fi
487
488 ZLIBS=
489 ZDEPS=
490 ZINCS=
491 if test "x$ZLIBSPEC" = "x-lzgcj"; then
492    # We include the path to the zlib build directory.
493    # See Makefile.am to understand why.
494    ZDEPS='$(top_builddir)/../zlib/libzgcj.la'
495    ZLIBS="$ZDEPS -L\$(here)/../zlib/$libsubdir"
496    ZINCS='-I$(top_srcdir)/../zlib'
497 else
498    ZLIBS="$ZLIBSPEC"
499 fi
500 AC_SUBST(ZLIBS)
501 AC_SUBST(ZDEPS)
502 AC_SUBST(ZINCS)
503 AC_SUBST(DIVIDESPEC)
504
505 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
506 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
507 AM_CONDITIONAL(NATIVE, test "$CANADIAN" = no || test "$NULL_TARGET" = yes)
508 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
509 AC_SUBST(EH_COMMON_INCLUDE)
510
511 # Determine gcj version number.
512 if test "$GCJ" = ""; then
513    if test -z "${with_multisubdir}"; then
514       builddotdot=.
515    else
516       builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
517    fi
518    dir="`cd ${builddotdot}/../../gcc && pwd`"
519    GCJ="$dir/gcj -B$dir/"
520 fi
521 changequote(<<,>>)
522 gcjvers="`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`"
523 changequote([,])
524 AC_DEFINE_UNQUOTED(GCJVERSION, "$gcjvers")
525
526 AC_SUBST(AM_RUNTESTFLAGS)
527
528 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
529 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
530 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
531 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)
532 dnl We avoid AC_HEADER_DIRENT since we really only care about dirent.h
533 dnl for now.  If you change this, you also must update natFile.cc.
534 AC_CHECK_HEADERS(dirent.h)
535
536 AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
537 AC_TRY_COMPILE([#include <netinet/in.h>], [struct sockaddr_in6 addr6;],
538   [AC_DEFINE(HAVE_INET6)
539    AC_MSG_RESULT(yes)],
540   [AC_MSG_RESULT(no)])
541
542 AC_MSG_CHECKING([for socklen_t in sys/socket.h])
543 AC_TRY_COMPILE([#include <sys/socket.h>], [socklen_t x = 5;],
544   [AC_DEFINE(HAVE_SOCKLEN_T)
545    AC_MSG_RESULT(yes)],
546   [AC_MSG_RESULT(no)])
547
548 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
549 AC_TRY_COMPILE([#include <time.h>], [struct tm tim; tim.tm_gmtoff = 0;],
550   [AC_DEFINE(STRUCT_TM_HAS_GMTOFF)
551    AC_MSG_RESULT(yes)],
552   [AC_MSG_RESULT(no)
553    AC_MSG_CHECKING([for global timezone variable])
554    dnl FIXME: we don't want a link check here because that won't work
555    dnl when cross-compiling.  So instead we make an assumption that
556    dnl the header file will mention timezone if it exists.
557    AC_TRY_COMPILE([#include <time.h>], [long z2 = timezone;],
558      [AC_DEFINE(HAVE_TIMEZONE)
559       AC_MSG_RESULT(yes)],
560      [AC_MSG_RESULT(no)])])
561
562 AC_FUNC_ALLOCA
563
564 AC_CHECK_PROGS(PERL, perl, false)
565
566 case "${host}" in
567   i?86-*-linux*)
568     SIGNAL_HANDLER=include/i386-signal.h
569         ;;
570   sparc-sun-solaris*)
571     SIGNAL_HANDLER=include/sparc-signal.h
572         ;;
573   *)
574     SIGNAL_HANDLER=include/default-signal.h
575         ;;
576 esac
577
578 AC_LINK_FILES($SIGNAL_HANDLER, include/java-signal.h)
579
580 if test "${multilib}" = "yes"; then
581   multilib_arg="--enable-multilib"
582 else
583   multilib_arg=
584 fi
585
586 here=`pwd`
587 AC_SUBST(here)
588
589 AC_OUTPUT(Makefile libgcj.spec testsuite/Makefile,
590 [if test -n "$CONFIG_FILES"; then
591   ac_file=Makefile . ${libgcj_basedir}/../config-ml.in
592 fi],
593 srcdir=${srcdir}
594 host=${host}
595 target=${target}
596 with_multisubdir=${with_multisubdir}
597 ac_configure_args="${multilib_arg} ${ac_configure_args}"
598 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
599 libgcj_basedir=${libgcj_basedir}
600 CC="${CC}"
601 CXX="${CXX}"
602 )