OSDN Git Service

* config/rs6000/rs6000.md (macho_correct_pic): Correct pattern.
[pf3gnuchains/gcc-fork.git] / libjava / configure.in
index 752739b..5763c80 100644 (file)
@@ -224,11 +224,14 @@ case "$TARGET_ECOS" in
    no) case "$host" in
       *mingw*)
             PLATFORM=Win32
+           PLATFORMNET=Win32
             PLATFORMOBJS=win32.lo
            PLATFORMH=win32.h
+        CHECK_FOR_BROKEN_MINGW_LD
       ;;
       *)
             PLATFORM=Posix
+           PLATFORMNET=Posix
             PLATFORMOBJS=posix.lo
            PLATFORMH=posix.h
       ;;
@@ -236,6 +239,7 @@ case "$TARGET_ECOS" in
       ;;
    *)
       PLATFORM=Ecos
+      PLATFORMNET=NoNet
       AC_DEFINE(ECOS)
       PLATFORMOBJS=posix.lo
       PLATFORMH=posix.h
@@ -268,6 +272,14 @@ test -d java/lang || mkdir java/lang
 AC_LINK_FILES(java/lang/${PLATFORM}Process.java, java/lang/ConcreteProcess.java)
 AC_LINK_FILES(java/lang/nat${PLATFORM}Process.cc, java/lang/natConcreteProcess.cc)
 
+dnl Likewise for natInetAddress.cc, natNetworkInterface.cc, natPlainSocketImpl.cc
+dnl and natPlainDatagramSocketImpl.cc
+test -d java/net || mkdir java/net
+AC_LINK_FILES(java/net/natInetAddress${PLATFORMNET}.cc, java/net/natInetAddress.cc)
+AC_LINK_FILES(java/net/natNetworkInterface${PLATFORMNET}.cc, java/net/natNetworkInterface.cc)
+AC_LINK_FILES(java/net/natPlainSocketImpl${PLATFORMNET}.cc, java/net/natPlainSocketImpl.cc)
+AC_LINK_FILES(java/net/natPlainDatagramSocketImpl${PLATFORMNET}.cc, java/net/natPlainDatagramSocketImpl.cc)
+
 case "${host}" in
     *mingw*)
       SYSTEMSPEC="-lgdi32 -lwsock32 -lws2_32"
@@ -288,6 +300,59 @@ AC_SUBST(ZLIBSPEC)
 ZLIBTESTSPEC=
 AC_SUBST(ZLIBTESTSPEC)
 
+AC_PATH_XTRA
+
+dnl Determine which AWT peer libraries to build
+AC_ARG_ENABLE(java-awt,
+[  --enable-java-awt       list of AWT peer implementations to be built])
+
+peerlibs="`echo ${enable_java_awt} | tr ',' ' '`"
+use_xlib_awt=""
+use_gtk_awt=""
+# The default toolkit to use is the first one specified.
+TOOLKIT=
+AC_SUBST(TOOLKIT)
+
+for peer in $peerlibs ; do
+  case $peer in
+    xlib)
+      if test "$no_x" = yes; then
+        echo "*** xlib peers requested but no X library available" 1>&2
+        exit 1
+      else
+        use_xlib_awt="yes"
+       if test -z "$TOOLKIT"; then
+          TOOLKIT=gnu.awt.xlib.XToolkit
+       fi
+      fi
+      ;;
+    gtk)
+      if test "$no_x" = yes; then
+        echo "*** xlib peers requested but no X library available" 1>&2
+        exit 1
+      else
+        use_gtk_awt=yes
+        if test -z "$TOOLKIT"; then
+           TOOLKIT=gnu.java.awt.peer.gtk.GtkToolkit
+        fi
+        test -d jniinclude || mkdir jniinclude
+      fi
+      ;;
+    no)
+      use_xlib_awt=
+      use_gtk_awt=
+      break
+      ;;
+    *)
+      echo "*** unrecognised argument \"${peer}\" for --enable-java-awt" 1>&2
+      exit 1
+  esac
+done
+
+AM_CONDITIONAL(XLIB_AWT, test "$use_xlib_awt" = yes)
+AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes)
+
+
 dnl FIXME: this should be _libs on some hosts.
 libsubdir=.libs
 
@@ -444,7 +509,7 @@ AC_LINK_FILES(sysdep/$sysdeps_dir/locks.h, sysdep/locks.h)
 
 HASH_SYNC_SPEC=
 # Hash synchronization is only useful with posix threads right now.
-if test "$enable_hash_synchronization" = yes && test "$THREADS" = "posix"; then
+if test "$enable_hash_synchronization" = yes && test "$THREADS" != "none"; then
    HASH_SYNC_SPEC=-fhash-synchronization
    AC_DEFINE(JV_HASH_SYNCHRONIZATION, 1, [Define if hash synchronization is in use])
 fi
@@ -500,6 +565,7 @@ if test "x${with_newlib}" = "xyes"; then
       GCJ="${target_alias}-gcj"
    fi
    NATIVE=no
+   PLATFORMNET=NoNet
 else
    AC_CHECK_FUNCS(strerror ioctl select fstat open fsync sleep opendir)
    AC_CHECK_FUNCS(gmtime_r localtime_r readdir_r getpwuid_r getcwd)
@@ -507,7 +573,7 @@ else
    AC_CHECK_FUNCS(nl_langinfo setlocale)
    AC_CHECK_FUNCS(inet_aton inet_addr, break)
    AC_CHECK_FUNCS(inet_pton uname inet_ntoa)
-   AC_CHECK_FUNCS(fork execvp pipe sigaction)
+   AC_CHECK_FUNCS(fork execvp pipe sigaction ftruncate)
    AC_CHECK_HEADERS(execinfo.h unistd.h dlfcn.h) 
    AC_CHECK_FUNC(backtrace, [
      case "$host" in
@@ -521,6 +587,13 @@ else
          AC_DEFINE(HAVE_BACKTRACE)
         ;;
      esac
+   ], [
+     case "$host" in
+       *mingw*)
+         # Has backtrace() defined in libgcj itself
+         AC_DEFINE(HAVE_BACKTRACE)
+         ;;
+     esac
    ])
 
    AC_CHECK_LIB(dl, dladdr, [
@@ -713,6 +786,15 @@ else
       AC_CHECK_LIB(z, deflate, ZLIBSPEC=-lz, ZLIBSPEC=)
    fi
 
+   # Test for Gtk stuff, if asked for.
+   if test "$use_gtk_awt" = yes; then
+      AM_PATH_GTK(1.2.4,,exit 1)
+      AM_PATH_GLIB(1.2.4,,exit 1,gthread)
+      dnl XXX Fix me when libart.m4 has the compile test fixed!
+      enable_libarttest=no
+      AM_PATH_LIBART(2.1.0,,exit 1)
+   fi
+
    # On Solaris, and maybe other architectures, the Boehm collector
    # requires -ldl.
    if test "$GC" = boehm; then
@@ -749,7 +831,8 @@ CPPFLAGS="$CPPFLAGS -I`${PWDCMD-pwd}` -I`cd $srcdir && ${PWDCMD-pwd}`"
 if test ! -f gnu/classpath/Configuration.java; then
   test -d gnu || mkdir gnu
   test -d gnu/classpath || mkdir gnu/classpath
-  sed 's,@LIBGCJDEBUG@,$LIBGCJDEBUG,' \
+  sed -e 's,@LIBGCJDEBUG@,$LIBGCJDEBUG,' \
+      -e 's,@TOOLKIT@,$TOOLKIT,' \
        < $srcdir/gnu/classpath/Configuration.java.in \
        > gnu/classpath/Configuration.java
   # We do not want to redirect the output of the grep below to /dev/null,
@@ -784,14 +867,31 @@ AC_SUBST(ZINCS)
 AC_SUBST(DIVIDESPEC)
 AC_SUBST(CHECKREFSPEC)
 AC_SUBST(EXCEPTIONSPEC)
+AC_SUBST(IEEESPEC)
 
 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
-AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
 AM_CONDITIONAL(NEEDS_DATA_START, test "$NEEDS_DATA_START" = yes && test "$NATIVE" = yes)
 AC_SUBST(GCC_UNWIND_INCLUDE)
 
+if test -n "$with_cross_host" &&
+   test x"$with_cross_host" != x"no"; then
+  toolexecdir='$(exec_prefix)/$(target_alias)'
+  toolexecmainlibdir='$(toolexecdir)/lib'
+else
+  toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+  toolexecmainlibdir='$(libdir)'
+fi
+multi_os_directory=`$CC -print-multi-os-directory`
+case $multi_os_directory in
+  .) toolexeclibdir=$toolexecmainlibdir ;; # Avoid trailing /.
+  *) toolexeclibdir=$toolexecmainlibdir/$multi_os_directory ;;
+esac
+AC_SUBST(toolexecdir)
+AC_SUBST(toolexecmainlibdir)
+AC_SUBST(toolexeclibdir)
+
 # Determine gcj version number.
 changequote(<<,>>)
 gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`
@@ -813,7 +913,7 @@ CFLAGS="$save_CFLAGS"
 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
-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 stdint.h langinfo.h locale.h)
+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 net/if.h pwd.h sys/config.h stdint.h langinfo.h locale.h)
 dnl We avoid AC_HEADER_DIRENT since we really only care about dirent.h
 dnl for now.  If you change this, you also must update natFile.cc.
 AC_CHECK_HEADERS(dirent.h)
@@ -886,6 +986,7 @@ AC_TRY_COMPILE([#include <time.h>], [struct tm tim; tim.tm_gmtoff = 0;],
           [AC_MSG_RESULT(no)])])])
 
 AC_FUNC_ALLOCA
+AC_FUNC_MMAP
 
 AC_CHECK_PROGS(PERL, perl, false)
 
@@ -915,11 +1016,14 @@ case "${host}" in
     SIGNAL_HANDLER=include/s390-signal.h
     ;;
  x86_64*-*-linux*)
-    SIGNAL_HANDLER=include/dwarf2-signal.h
+    SIGNAL_HANDLER=include/x86_64-signal.h
     ;;
  sparc*-*-linux*)
     SIGNAL_HANDLER=include/dwarf2-signal.h
     ;;
+ sh-*-linux* | sh[[34]]*-*-linux*)
+    SIGNAL_HANDLER=include/dwarf2-signal.h
+    ;;
  *mingw*)
     SIGNAL_HANDLER=include/win32-signal.h
     ;;
@@ -933,6 +1037,15 @@ if test "$enable_sjlj_exceptions" = yes; then
    SIGNAL_HANDLER=include/default-signal.h
 fi
 
+# Define here any compiler flags that you need in order to make backtrace() work.
+BACKTRACESPEC=
+case "${host}" in
+ x86_64*-*-linux*)
+    BACKTRACESPEC=-fno-omit-frame-pointer
+    ;;
+esac
+AC_SUBST(BACKTRACESPEC)
+
 AC_SUBST(SYSDEP_SOURCES)
 
 AC_LINK_FILES($SIGNAL_HANDLER, include/java-signal.h)
@@ -943,42 +1056,6 @@ else
   multilib_arg=
 fi
 
-AC_PATH_XTRA
-
-dnl Determine which AWT peer libraries to build
-AC_ARG_ENABLE(java-awt,
-[  --enable-java-awt       list of AWT peer implementations to be built])
-
-peerlibs="`echo ${enable_java_awt} | tr ',' ' '`"
-use_xlib_awt=""
-use_gtk_awt=""
-
-for peer in $peerlibs ; do
-  case $peer in
-    xlib)
-      if [test "$no_x" = yes]; then
-        echo "*** xlib peers requested but no X library available" 1>&2
-        exit 1
-      else
-        use_xlib_awt="yes"
-      fi
-      ;;
-    gtk)
-      # Nothing, yet...
-      ;;
-    no)
-      use_xlib_awt=
-      use_gtk_awt=
-      break
-      ;;
-    *)
-      echo "*** unrecognised argument \"${peer}\" for --enable-java-awt" 1>&2
-      exit 1
-  esac
-done
-
-AM_CONDITIONAL(XLIB_AWT, test "$use_xlib_awt" = yes)
-AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes)
 
 
 here=`${PWDCMD-pwd}`
@@ -1000,10 +1077,10 @@ esac
 # builddir for the .java files.
 h=`${PWDCMD-pwd}`
 : > deps.mk
-( (cd $srcdir && find . \( -name '*.java' -o -name '*.cc' \) -print) ;
-  find . \( -name '*.java' -o -name '*.cc' \) -print) | \
+( (cd $srcdir && find . \( -name '*.java' -o -name '*.cc' -o -name '*.c' \) -print) ;
+  find . \( -name '*.java' -o -name '*.cc' -o -name '*.c' \) -print) | \
    fgrep -v testsuite | \
-   sed -e 's/\.java/.d/'\;'s/\.cc/.d/' | \
+   sed -e 's/\.java/.d/'\;'s/\.cc/.d/'\;'s/\.c/.d/' | \
    while read f; do
       echo "include $f" >> deps.mk
       test -f $f || {
@@ -1026,4 +1103,5 @@ CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
 libgcj_basedir=${libgcj_basedir}
 CC="${CC}"
 CXX="${CXX}"
+ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
 )