diff options
author | Tom Tromey <tromey@cygnus.com> | 1999-05-11 12:11:09 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 1999-05-11 12:11:09 +0000 |
commit | f994389bf8e816de08daeb8bfdcf0b75cfe80919 (patch) | |
tree | 741b20a51ca89c071c8fa2ab28990e1c8eae5bc6 /libjava/configure.in | |
parent | 138657ecb0d28fa0c8df47db35f156ea4aa3b590 (diff) | |
download | gcc-f994389bf8e816de08daeb8bfdcf0b75cfe80919.zip gcc-f994389bf8e816de08daeb8bfdcf0b75cfe80919.tar.gz gcc-f994389bf8e816de08daeb8bfdcf0b75cfe80919.tar.bz2 |
Makefile.in, configure: Rebuilt.
* Makefile.in, configure: Rebuilt.
* Makefile.am (jv_convert_LDFLAGS): Removed -nodefaultlibs.
(jv_convert_LDADD): Added ZLIBS. Removed -lm, -lc, -lgcc.
(jv_convert_DEPENDENCIES): Added ZDEPS.
* configure.in (GCSPEC): Added `-L' to point to boehm-gc build
directory.
(THREADSPEC): Added `-L' to point to qthreads build directory.
(ZLIBS): New subst.
(ZDEPS): New subst.
* configure, Makefile.in: Rebuilt.
* Makefile.am (toolexeclib_DATA): New macro.
* configure.in: Create libgcj.spec. Look for -lsocket and -lnsl.
Recognize --with-system-zlib.
(GCSPEC): New subst.
(THREADSPEC): New subst.
(SYSTEMSPEC): New subst.
(ZLIBSPEC): New subst.
* libgcj.spec.in: New file.
From-SVN: r26885
Diffstat (limited to 'libjava/configure.in')
-rw-r--r-- | libjava/configure.in | 99 |
1 files changed, 96 insertions, 3 deletions
diff --git a/libjava/configure.in b/libjava/configure.in index 7877ec1..a564ae3 100644 --- a/libjava/configure.in +++ b/libjava/configure.in @@ -76,6 +76,17 @@ test -d java || mkdir java test -d java/io || mkdir java/io AC_LINK_FILES(java/io/$FILE_DESCRIPTOR, java/io/natFileDescriptor.cc) +SYSTEMSPEC= +AC_SUBST(SYSTEMSPEC) + +AC_ARG_WITH(system-zlib, +[ --with-system-zlib Use installed libz]) +ZLIBSPEC= +AC_SUBST(ZLIBSPEC) + +dnl FIXME: this should be _libs on some hosts. +libsubdir=.libs + dnl Allow the GC to be disabled. Can be useful when debugging. AC_MSG_CHECKING([for garbage collector to use]) AC_ARG_ENABLE(java-gc, @@ -88,12 +99,16 @@ GCLIBS= GCINCS= GCDEPS= GCOBJS= +GCSPEC= case "$GC" in boehm) AC_MSG_RESULT(boehm) GCDEPS='$(top_builddir)/../boehm-gc/libgcjgc.la' - GCLIBS="$GCDEPS" + # We include the path to the boehm-gc build directory. + # See Makefile.am to understand why. + GCLIBS="$GCDEPS -L\$(here)/../boehm-gc/$libsubdir" GCINCS='-I$(top_srcdir)/../boehm-gc -I$(top_builddir)/../boehm-gc' + GCSPEC='-lgcjgc' dnl We also want to pick up some cpp flags required when including dnl boehm-config.h. Yuck. GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`" @@ -115,6 +130,7 @@ AC_SUBST(GCLIBS) AC_SUBST(GCINCS) AC_SUBST(GCDEPS) AC_SUBST(GCOBJS) +AC_SUBST(GCSPEC) AC_LINK_FILES(include/$GCHDR, include/java-gc.h) @@ -184,9 +200,11 @@ THREADINCS= THREADDEPS= THREADOBJS= THREADH= +THREADSPEC= case "$THREADS" in posix) THREADLIBS=-lpthread + THREADSPEC=-lpthread THREADOBJS=posix-threads.lo THREADH=posix-threads.h # MIT pthreads doesn't seem to have the mutexattr functions. @@ -197,7 +215,10 @@ case "$THREADS" in qt) THREADDEPS='$(top_builddir)/../qthreads/libgcjcoop.la' - THREADLIBS="$THREADDEPS" + # We include the path to the qthreads build directory. + # See Makefile.am to understand why. + THREADLIBS="$THREADDEPS -L\$(here)/../qthreads/$libsubdir" + THREADSPEC='-lgcjcoop' THREADOBJS=quick-threads.lo THREADINCS='-I$(top_srcdir)/../qthreads' THREADH=quick-threads.h @@ -213,6 +234,7 @@ AC_SUBST(THREADLIBS) AC_SUBST(THREADINCS) AC_SUBST(THREADDEPS) AC_SUBST(THREADOBJS) +AC_SUBST(THREADSPEC) AM_CONDITIONAL(USING_GCC, test "$GCC" = yes) @@ -250,6 +272,8 @@ if test -n "${with_cross_host}"; then dnl We also assume we are using gcc, which provides alloca. AC_DEFINE(HAVE_ALLOCA) + ZLIBSPEC=-lgcj + # If Canadian cross, then don't pick up tools from the build # directory. if test "$build" != "$with_cross_host"; then @@ -317,6 +341,62 @@ else AC_MSG_ERROR([memcpy is required]) fi + # Some library-finding code we stole from Tcl. + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + AC_CACHE_CHECK([for socket libraries], gcj_cv_lib_sockets, + [gcj_cv_lib_sockets= + gcj_checkBoth=0 + unset ac_cv_func_connect + AC_CHECK_FUNC(connect, gcj_checkSocket=0, gcj_checkSocket=1) + if test "$gcj_checkSocket" = 1; then + unset ac_cv_func_connect + AC_CHECK_LIB(socket, main, gcj_cv_lib_sockets="-lsocket", + gcj_checkBoth=1) + fi + if test "$gcj_checkBoth" = 1; then + gcj_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + unset ac_cv_func_accept + AC_CHECK_FUNC(accept, + [gcj_checkNsl=0 + gcj_cv_lib_sockets="-lsocket -lnsl"]) + unset ac_cv_func_accept + LIBS=$gcj_oldLibs + fi + unset ac_cv_func_gethostbyname + gcj_oldLibs=$LIBS + LIBS="$LIBS $gcj_cv_lib_sockets" + AC_CHECK_FUNC(gethostbyname, , + [AC_CHECK_LIB(nsl, main, + [gcj_cv_lib_sockets="$gcj_cv_lib_sockets -lnsl"])]) + unset ac_cv_func_gethostbyname + LIBS=$gcj_oldLIBS + ]) + SYSTEMSPEC="$SYSTEMSPEC $gcj_cv_lib_sockets" + + if test "$with_system_zlib" = yes; then + AC_CHECK_LIB(z, deflate, ZLIBSPEC=-lz, ZLIBSPEC=-lzgcj) + else + ZLIBSPEC=-lzgcj + fi + if test -d "$libgcj_basedir/../gcc/java"; then GCJ= else @@ -326,6 +406,19 @@ else fi fi +ZLIBS= +ZDEPS= +if test "x$ZLIBSPEC" = "x-lzgcj"; then + # We include the path to the zlib build directory. + # See Makefile.am to understand why. + ZDEPS='$(top_builddir)/../zlib/libzgcj.la' + ZLIBS="$ZDEPS -L\$(here)/../zlib/$libsubdir" +else + ZLIBS="$ZLIBSPEC" +fi +AC_SUBST(ZLIBS) +AC_SUBST(ZDEPS) + AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes) AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes) AM_CONDITIONAL(NATIVE, test "$CANADIAN" = no || test "$NULL_TARGET" = yes) @@ -409,7 +502,7 @@ fi here=`pwd` AC_SUBST(here) -AC_OUTPUT(Makefile testsuite/Makefile, +AC_OUTPUT(Makefile libgcj.spec testsuite/Makefile, [if test -n "$CONFIG_FILES"; then ac_file=Makefile . ${libgcj_basedir}/../config-ml.in fi], |