gcc.c (process_command): Update copyright notice dates.
[gcc.git] / libjava / classpath / configure.ac
index 247b17af2f4ac6ab68028461291af88f0de281a1..ab72c161c5289d20dea53882b1f559463d0e463b 100644 (file)
@@ -6,8 +6,13 @@ dnl -----------------------------------------------------------
 dnl define([AC_CACHE_LOAD], )dnl
 dnl define([AC_CACHE_SAVE], )dnl
 
-AC_INIT([GNU Classpath],[0.94-pre],[classpath@gnu.org],[classpath])
+AC_INIT([GNU Classpath],[0.99-pre],[classpath@gnu.org],[classpath])
 AC_CONFIG_SRCDIR(java/lang/System.java)
+AC_CONFIG_MACRO_DIR([m4])
+
+dnl GCJ LOCAL
+AC_CONFIG_AUX_DIR(../..)
+dnl END GCJ LOCAL
 
 AC_CANONICAL_TARGET
 
@@ -42,6 +47,8 @@ dnl END GCJ LOCAL
 # Find the rest of the source tree framework.
 AM_ENABLE_MULTILIB(, ../..)
 
+AM_CONDITIONAL(INSTALL_BINARIES, test -z "${with_multisubdir}")
+
 dnl -----------------------------------------------------------
 dnl Fold all IA-32 CPU architectures into "x86"
 dnl -----------------------------------------------------------
@@ -67,8 +74,8 @@ AC_SUBST(CLASSPATH_MODULE)
 CLASSPATH_CONVENIENCE="-no-undefined"
 AC_SUBST(CLASSPATH_CONVENIENCE)
 
-AC_PREREQ(2.59)
-AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar])
+AC_PREREQ(2.64)
+AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar -Wno-portability])
 AC_CONFIG_HEADERS([include/config.h])
 AC_PREFIX_DEFAULT(/usr/local/classpath)
 
@@ -146,10 +153,28 @@ AC_ARG_ENABLE([gconf-peer],
 AM_CONDITIONAL(CREATE_GCONF_PEER_LIBRARIES, test "x${COMPILE_GCONF_PEER}" = xyes)
 
 dnl -----------------------------------------------------------
-dnl GTK native peer error checking
+dnl GConf native peer error checking
 dnl -----------------------------------------------------------
 AC_ARG_ENABLE([gconf-peers],,AC_MSG_ERROR([No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer]))
 
+dnl ------------------------------------------------------------
+dnl GStreamer based sound provider backend (disabled by default)
+dnl ------------------------------------------------------------
+AC_ARG_ENABLE([gstreamer-peer],
+              [AS_HELP_STRING(--enable-gstreamer-peer,compile GStreamer native peers (disabled by --disable-jni) [default=no])],
+              [case "${enableval}" in
+                yes) COMPILE_GSTREAMER_PEER=yes ;;
+                no) COMPILE_GSTREAMER_PEER=no ;;
+                *) COMPILE_GSTREAMER_PEER=default ;;
+              esac],
+              [COMPILE_GSTREAMER_PEER=default])
+AM_CONDITIONAL(CREATE_GSTREAMER_PEER_LIBRARIES, test "x${COMPILE_GSTREAMER_PEER}" = xyes)
+
+dnl -----------------------------------------------------------
+dnl GStreamer native peer error checking
+dnl -----------------------------------------------------------
+AC_ARG_ENABLE([gstreamer-peers],,AC_MSG_ERROR([No --enable-gstreamer-peers (or --disable-gstreamer-peers) option; you want --enable-gstreamer-peer]))
+
 dnl ------------------------------------------------------------
 dnl Whether to compile with -Werror or not (disabled by default)
 dnl ------------------------------------------------------------
@@ -249,7 +274,7 @@ AC_ARG_ENABLE([qt-peer],
 AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
 
 dnl -----------------------------------------------------------
-dnl Plugin (enabled by default)
+dnl Plugin (disabled by default)
 dnl -----------------------------------------------------------
 AC_ARG_ENABLE([plugin],
               [AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
@@ -258,10 +283,35 @@ AC_ARG_ENABLE([plugin],
                 no) COMPILE_PLUGIN=no ;;
                 *) COMPILE_PLUGIN=yes ;;
               esac],
-              [COMPILE_PLUGIN=yes])
+              [COMPILE_PLUGIN=no])
 AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
 
 dnl -----------------------------------------------------------
+dnl Native java.math.BigInteger (enabled by default)
+dnl -----------------------------------------------------------
+AC_ARG_ENABLE([gmp],
+              [AS_HELP_STRING(--enable-gmp,
+                              compile native java.math.BigInteger library (disabled by --disable-gmp) [default=yes])],
+              [case "${enableval}" in
+                yes|true) COMPILE_GMP=yes ;;
+                no|false) COMPILE_GMP=no ;;
+                *) COMPILE_GMP=yes ;;
+              esac],
+              [COMPILE_GMP=yes])
+
+dnl -----------------------------------------------------------
+dnl GJDoc (enabled by default)
+dnl -----------------------------------------------------------
+AC_ARG_ENABLE([gjdoc],
+              [AS_HELP_STRING(--disable-gjdoc,compile GJDoc (disabled by --disable-gjdoc) [default=yes])],
+              [case "${enableval}" in
+                yes) COMPILE_GJDOC=yes ;;
+                no) COMPILE_GJDOC=no ;;
+                *) COMPILE_GJDOC=yes ;;
+              esac],
+              [COMPILE_GJDOC=yes])
+AM_CONDITIONAL(CREATE_GJDOC, test "x${COMPILE_GJDOC}" = xyes)
+
 dnl GCJ LOCAL: Calculates and substitutes toolexeclibdir.  $libdir is
 dnl defined to the same value for all multilibs.  We define toolexeclibdir
 dnl so that we can refer to the multilib installation directories from
@@ -272,14 +322,14 @@ CLASSPATH_TOOLEXECLIBDIR
 dnl -----------------------------------------------------------
 dnl Sets the native libraries installation dir
 dnl -----------------------------------------------------------
-dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}
+dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}-${libgcj_soversion}
 AC_ARG_WITH([native-libdir],
            [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
            [
             nativeexeclibdir=${withval}
            ],
            [
-            nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`
+            nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`-`awk -F: '/^[[^#]].*:/ { print $1 }' ${srcdir}/../libtool-version`
            ])
 
 AC_SUBST(nativeexeclibdir)
@@ -299,33 +349,55 @@ AC_ARG_WITH([glibj-dir],
 AC_SUBST(glibjdir)
 
 dnl -----------------------------------------------------------
-dnl Sets the VM name for use in tool wrapper scripts
+dnl Sets the Antlr jar to use for compiling gjdoc
 dnl -----------------------------------------------------------
-AC_ARG_WITH([vm],
-           [AS_HELP_STRING(--with-vm,sets the VM binary name [default='${prefix}/bin/jamvm'])],
-           [
-            VM_BINARY=${withval}
-           ],
-           [
-            VM_BINARY='${prefix}/bin/jamvm'
-           ])
-
-AC_SUBST(VM_BINARY)
-AM_CONDITIONAL(FOUND_CACAO, test "x`basename $VM_BINARY`" = xcacao)
+AC_ARG_WITH([antlr-jar],
+            [AS_HELP_STRING([--with-antlr-jar=file],[Use ANTLR from the specified jar file])],
+            [
+             ANTLR_JAR=$withval
+            ],
+            [
+             ANTLR_JAR="$ANTLR_JAR"
+            ])
 
 dnl -----------------------------------------------------------
-dnl Regenerate headers at build time (disabled by default)
+dnl Regenerate headers at build time (enabled if not found)
 dnl -----------------------------------------------------------
+AC_MSG_CHECKING([whether to regenerate the headers])
 AC_ARG_ENABLE([regen-headers],
-              [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=no])],
+              [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=yes if headers don't exist])],
               [case "${enableval}" in
                 yes) REGENERATE_JNI_HEADERS=yes ;;
                 no) REGENERATE_JNI_HEADERS=no ;;
-                *) REGENERATE_JNI_HEADERS=no ;;
+                *) REGENERATE_JNI_HEADERS=yes ;;
               esac],
-              [REGENERATE_JNI_HEADERS=no])
+              [if test -e ${srcdir}/include/java_lang_VMSystem.h; then
+                       REGENERATE_JNI_HEADERS=no ;
+                  else
+                       REGENERATE_JNI_HEADERS=yes ;
+              fi])
+AC_MSG_RESULT(${REGENERATE_JNI_HEADERS})
 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
 
+dnl ------------------------------------------------------------------------
+dnl Regenerate GJDoc parser at build time (enabled if not found)
+dnl ------------------------------------------------------------------------
+AC_MSG_CHECKING([whether to regenerate the GJDoc parser])
+AC_ARG_ENABLE([regen-gjdoc-parser],
+              [AS_HELP_STRING(--enable-regen-gjdoc-parser,automatically regenerate the GJDoc parser [default=yes if generated source doesn't exist])],
+              [case "${enableval}" in
+                yes) REGENERATE_GJDOC_PARSER=yes ;;
+                no) REGENERATE_GJDOC_PARSER=no ;;
+                *) REGENERATE_GJDOC_PARSER=yes ;;
+              esac],
+              [if test -e ${srcdir}/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.java; then
+                       REGENERATE_GJDOC_PARSER=no ;
+                  else
+                       REGENERATE_GJDOC_PARSER=yes ;
+              fi])
+AC_MSG_RESULT(${REGENERATE_GJDOC_PARSER})
+AM_CONDITIONAL(CREATE_GJDOC_PARSER, test "x${REGENERATE_GJDOC_PARSER}" = xyes)
+
 dnl -----------------------------------------------------------
 dnl Enable tool wrapper binaries (disabled by default)
 dnl -----------------------------------------------------------
@@ -353,9 +425,10 @@ dnl -----------------------------------------------------------
 
 dnl Initialize libtool
 AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
-dnl AC_PROG_AWK
+LT_INIT
+AC_PROG_AWK
 AC_PROG_CC
+AM_PROG_CC_C_O
 AC_PROG_CPP
 AC_PROG_CXX
 
@@ -394,6 +467,9 @@ if test "x${COMPILE_JNI}" = xyes; then
   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.
   dnl Check for crt_externs.h on Darwin.
+  dnl Check for netinet/in_systm.h, netinet/ip.h and net/if.h for Windows CE.
+  dnl Check for sys/loadavg.h for getloadavg() on Solaris 9.
+  dnl Check for sys/sockio.h for SIOCGIFFLAGS on OpenSolaris.
   AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
                    asm/ioctls.h \
                    inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
@@ -404,13 +480,17 @@ if test "x${COMPILE_JNI}" = xyes; then
                    sys/mman.h \
                    magic.h \
                     sys/event.h sys/epoll.h \
-                   ifaddrs.h])
+                   ifaddrs.h \
+                   netinet/in_systm.h netinet/ip.h net/if.h \
+                   sys/loadavg.h sys/sockio.h])
 
   AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
   AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
   AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
   AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
 
+  AC_SEARCH_LIBS([inet_pton],[nsl])
+  AC_CHECK_LIB([socket], [gethostname]) 
   AC_CHECK_FUNCS([ftruncate fsync select \
                  gethostname socket strerror fork pipe execve open close \
                  lseek fstat read readv write writev htonl memset htons connect \
@@ -419,11 +499,12 @@ if test "x${COMPILE_JNI}" = xyes; then
                  gethostbyname_r localtime_r \
                  strerror_r \
                   fcntl \
+                 statvfs \  
                  mmap munmap mincore msync madvise getpagesize sysconf \
                  lstat readlink \
                  inet_aton inet_addr inet_pton \
                  getifaddrs kqueue kevent epoll_create \
-                  readdir_r ])
+                  getloadavg])
 
   LIBMAGIC=
   AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
@@ -463,7 +544,9 @@ if test "x${COMPILE_JNI}" = xyes; then
           [AC_MSG_RESULT(no)])])])
 
   AC_C_CONST
+  AC_C_INLINE
   AC_C_ATTRIBUTE
+  AX_FUNC_WHICH_GETHOSTBYNAME_R
 
   dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
   AM_ICONV
@@ -478,6 +561,12 @@ if test "x${COMPILE_JNI}" = xyes; then
     WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
     AC_SUBST(WARNING_CFLAGS)
 
+    dnl CFLAGS that are used for all native code.  We want to compile
+    dnl everything with unwinder data so that backtrace() will always
+    dnl work.
+    EXTRA_CFLAGS='-fexceptions -fasynchronous-unwind-tables'
+    AC_SUBST(EXTRA_CFLAGS)
+
     dnl Strict warning flags which not every module uses.
     dnl Should probably be configurable.
     STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
@@ -508,15 +597,18 @@ if test "x${COMPILE_JNI}" = xyes; then
     if test "$no_x" = yes; then
         AC_MSG_ERROR([GTK+ peers requested but no X library available])
     fi
-    dnl We explicitly want the XTest Extension for Robot support.
+    dnl Check if we can link against the XTest library and set
+    dnl HAVE_XTEST accordingly.
     AC_CHECK_LIB([Xtst], [XTestQueryExtension],
-                [XTEST_LIBS="$XTEST_LIBS -lX11 -lXtst"],
-                [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
-                [${X_LIBS}])
+                 [AC_DEFINE(HAVE_XTEST, 1, [Define to 1 if you have libXtst.])[XTEST_LIBS="$XTEST_LIBS -X11 -lXtst"]],
+                 [true],
+                 [${X_LIBS}])
+
 
     PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
     PKG_CHECK_MODULES(FREETYPE2, freetype2)
     PKG_CHECK_MODULES(PANGOFT2, pangoft2)
+    PKG_CHECK_MODULES(CAIRO, cairo >= 1.1.8)
     dnl Check if we can link against the XRender library and set
     dnl HAVE_XRENDER accordingly.
     AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
@@ -542,7 +634,7 @@ if test "x${COMPILE_JNI}" = xyes; then
 
   dnl gconf-peer
   if  test "x${COMPILE_GCONF_PEER}" = xyes; then
-    PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.11.2)
+    PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6.0)
     AC_SUBST(GCONF_CFLAGS)
     AC_SUBST(GCONF_LIBS)
     dnl we also need gdk for locking
@@ -554,10 +646,47 @@ if test "x${COMPILE_JNI}" = xyes; then
     dnl compiled in
     USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
     if test "$USE_GCONF_PREFS_PEER" = ""; then
-       DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
+      DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
     fi
   fi
 
+  dnl gstreamer-peer
+  if  test "x${COMPILE_GSTREAMER_PEER}" = xyes; then
+    GST_MAJORMINOR=0.10
+    GST_REQUIRED=0.10.10
+
+    dnl gstreamer
+    PKG_CHECK_MODULES(GSTREAMER, gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED)
+    AC_SUBST(GSTREAMER_CFLAGS)
+    AC_SUBST(GSTREAMER_LIBS)
+
+    dnl gstreamer-base
+    PKG_CHECK_MODULES(GSTREAMER_BASE,
+                      gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED)
+    AC_SUBST(GSTREAMER_BASE_CFLAGS)
+    AC_SUBST(GSTREAMER_BASE_LIBS)
+
+    dnl gstreamer-plugin-base
+    PKG_CHECK_MODULES(GSTREAMER_PLUGINS_BASE,
+                      gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_REQUIRED)
+    AC_SUBST(GSTREAMER_PLUGINS_BASE_CFLAGS)
+    AC_SUBST(GSTREAMER_PLUGINS_BASE_LIBS)
+
+       GST_PLUGIN_LDFLAGS='-module -avoid-version -Wno-unused-parameter -no-undefined'
+       AC_SUBST(GST_PLUGIN_LDFLAGS)
+
+    PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
+    AC_SUBST(GDK_CFLAGS)
+    AC_SUBST(GDK_LIBS)
+       
+       dnl set the gstreamer based file reader, writer and mixer
+       GSTREAMER_FILE_READER=gnu.javax.sound.sampled.gstreamer.io.GstAudioFileReader
+       GSTREAMER_MIXER_PROVIDER=gnu.javax.sound.sampled.gstreamer.GStreamerMixerProvider
+  fi
+  dnl add the gstreamer resources 
+  AC_SUBST(GSTREAMER_FILE_READER)
+  AC_SUBST(GSTREAMER_MIXER_PROVIDER)
+
   dnl Check for AWT related Qt4
   if test "x${COMPILE_QT_PEER}" = xyes; then
     PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
@@ -611,28 +740,33 @@ if test "x${COMPILE_JNI}" = xyes; then
   dnl Check for MSG_NOSIGNAL
   dnl **********************************************************************
   AC_MSG_CHECKING(for MSG_NOSIGNAL)
-  AC_TRY_COMPILE([#include <sys/socket.h>],
-   [ int f = MSG_NOSIGNAL; ],
-   [ AC_MSG_RESULT(yes)
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = MSG_NOSIGNAL; ]])],[ AC_MSG_RESULT(yes)
      AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
-              [Define this symbol if you have MSG_NOSIGNAL]) ],
-   [ AC_MSG_RESULT(no)]
-  )
+              [Define this symbol if you have MSG_NOSIGNAL]) ],[ AC_MSG_RESULT(no)
+  ])
  dnl **********************************************************************
  dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
  dnl **********************************************************************
  AC_MSG_CHECKING(for SO_NOSIGPIPE )
- AC_TRY_COMPILE([#include <sys/socket.h>],
-  [ int f = SO_NOSIGPIPE; ],
-  [ AC_MSG_RESULT(yes)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = SO_NOSIGPIPE; ]])],[ AC_MSG_RESULT(yes)
     AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
-             [Define this symbol if you have SO_NOSIGPIPE]) ],
-  [ AC_MSG_RESULT(no)]
- )
+             [Define this symbol if you have SO_NOSIGPIPE]) ],[ AC_MSG_RESULT(no)
+ ])
+  dnl **********************************************************************
+  dnl Check for MSG_WAITALL
+  dnl **********************************************************************
+  AC_MSG_CHECKING(for MSG_WAITALL)
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = MSG_WAITALL; ]])],[ AC_MSG_RESULT(yes)
+     AC_DEFINE(HAVE_MSG_WAITALL, 1,
+              [Define this symbol if you have MSG_WAITALL]) ],[ AC_MSG_RESULT(no)
+  ])
 
   dnl Check for plugin support headers and libraries.
   if test "x${COMPILE_PLUGIN}" = xyes; then
-    PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
+    PKG_CHECK_MODULES(MOZILLA, mozilla-plugin libxul-unstable, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
+    if test "x${MOZILLA_FOUND}" = xno; then
+      PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
+    fi
     if test "x${MOZILLA_FOUND}" = xno; then
       PKG_CHECK_MODULES(MOZILLA, firefox-plugin firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
     fi
@@ -645,18 +779,88 @@ if test "x${COMPILE_JNI}" = xyes; then
     if test "x${MOZILLA_FOUND}" = xno; then
       PKG_CHECK_MODULES(MOZILLA, seamonkey-plugin seamonkey-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
     fi
+    if test "x${MOZILLA_FOUND}" = xno; then
+      PKG_CHECK_MODULES(MOZILLA, iceape-plugin iceape-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
+    fi
+    if test "x${MOZILLA_FOUND}" = xno; then
+      AC_MSG_ERROR([Couldn't find plugin support headers and libraries, try --disable-plugin])
+    fi
+
     PKG_CHECK_MODULES(GLIB, glib-2.0)
+    PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
 
     AC_SUBST(MOZILLA_CFLAGS)
     AC_SUBST(MOZILLA_LIBS)
     AC_SUBST(GLIB_CFLAGS)
     AC_SUBST(GLIB_LIBS)
+    AC_SUBST(GTK_CFLAGS)
+    AC_SUBST(GTK_LIBS)
 
     AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
   fi
+
+  dnl Check for GNU MP library and header file
+  dnl for GNU MP versions >= 4.2 use __gmpz_combit; otherwise look for
+  dnl __gmpz_mul_si for earlier versions (>= 3.1).
+  dnl IMPORTANT: if you decide to look for __gmpz_combit, don't forget to
+  dnl change the name of the corresponding ac_ variable on lines 860...
+  AC_ARG_WITH(gmp, [  --with-gmp=PATH         specify prefix directory for the installed GMP package.
+                          Equivalent to --with-gmp-include=PATH/include
+                          plus --with-gmp-lib=PATH/lib])
+  AC_ARG_WITH(gmp_include, [  --with-gmp-include=PATH specify directory for installed GMP include files])
+  AC_ARG_WITH(gmp_lib, [  --with-gmp-lib=PATH     specify directory for the installed GMP library])
+
+  if test "x$with_gmp" != x; then
+    gmplibs=-lgmp
+    gmpinc=
+    gmplibs="-L$with_gmp/lib $gmplibs"
+    gmpinc="-I$with_gmp/include $gmpinc"
+    if test "x$with_gmp_include" != x; then
+      gmpinc="-I$with_gmp_include $gmpinc"
+    fi
+    if test "x$with_gmp_lib" != x; then
+      gmplibs="-L$with_gmp_lib $gmplibs"
+    fi
+  else
+    gmplibs="-lgmp"
+    gmpinc="-I/usr/include"
+  fi
+
+  if test "x${COMPILE_GMP}" = xyes; then
+    AC_MSG_CHECKING([for GMP directories])
+    if test "x$with_gmp" != x; then
+       gmplibs="-L$with_gmp/lib -lgmp"
+       gmpinc="-I$with_gmp/include"
+       if test "x$with_gmp_include" != x; then
+                 gmpinc="-I$with_gmp_include $gmpinc"
+       fi
+       if test "x$with_gmp_lib" != x; then
+                 gmplibs="-L$with_gmp_lib $gmplibs"
+       fi
+    else
+        with_gmp="/usr"
+       gmplibs="-lgmp"
+       gmpinc="-I/usr/include"
+    fi
+    AC_MSG_RESULT([prefix=$with_gmp, libs=$gmplibs, inc=$gmpinc])
+    AC_CHECK_LIB(gmp, __gmpz_mul_si,
+      [GMP_CFLAGS="$gmpinc"
+       GMP_LIBS="$gmplibs" ],
+      [GMP_CFLAGS=
+       GMP_LIBS= ])
+    AC_SUBST(GMP_CFLAGS)
+    AC_SUBST(GMP_LIBS)
+
+    AC_CHECK_HEADERS([gmp.h])
+  fi
+
+else
+  COMPILE_GMP=no
 fi
 
-CLASSPATH_WITH_JAVAH
+if test "x${REGENERATE_JNI_HEADERS}" = xyes; then
+  CLASSPATH_WITH_JAVAH
+fi
 
 dnl ----------------------------------------------------------- 
 dnl Add the include files for the native abstraction layer.
@@ -685,8 +889,6 @@ if test "x${COMPILE_JNI}" = xyes; then
   AC_CONFIG_LINKS([$ac_config_links_1])
 fi
 
-CLASSPATH_FIND_JAVAC
-
 CLASSPATH_WITH_CLASSLIB
 
 dnl -----------------------------------------------------------
@@ -847,6 +1049,36 @@ esac;
 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
 AC_SUBST(PATH_TO_GLIBJ_ZIP)
 
+if test "x${TOOLSDIR}" != x; then
+  dnl GCJ LOCAL
+  if test "x${COMPILE_WRAPPERS}" = xno && test "x${enable_java_maintainer_mode}" = xyes; then
+    AC_PROG_JAVA_WORKS
+  fi
+  dnl END GCJ LOCAL
+  if test "x${COMPILE_GJDOC}" = xyes; then
+    AC_LIB_ANTLR
+    dnl GCJ LOCAL
+    if test "x${REGENERATE_GJDOC_PARSER}" = xyes && test "x${enable_java_maintainer_mode}" = xyes; then
+    dnl END GCJ LOCAL
+       AC_PROG_ANTLR(2,7,1)
+    fi
+  fi
+fi
+
+
+# Check for javac if we need to build either the class library,
+# the examples or the tools
+if test "x${use_glibj_zip}" = xfalse || \
+   test "x${EXAMPLESDIR}" != x || \
+   test "x${TOOLSDIR}" != x && \
+   test "x${build_class_files}" != xno && \
+   test "${enable_java_maintainer_mode}" = yes; then dnl GCJ_LOCAL
+       AC_PROG_JAVAC_WORKS
+       CLASSPATH_JAVAC_MEM_CHECK
+else
+   AM_CONDITIONAL(GCJ_JAVAC, no)
+fi
+
 dnl -----------------------------------------------------------
 dnl Build with Escher based X peers.
 dnl -----------------------------------------------------------
@@ -900,6 +1132,25 @@ dnl Add the default preference peer
 dnl -----------------------------------------------------------
 AC_SUBST(DEFAULT_PREFS_PEER)
 
+dnl -----------------------------------------------------------
+dnl Set GNU MP related params
+dnl -----------------------------------------------------------
+WANT_NATIVE_BIG_INTEGER=false
+if test "x${COMPILE_GMP}" = xyes; then
+  if test "x${ac_cv_lib_gmp___gmpz_mul_si}" = xyes; then
+    if test "x${ac_cv_header_gmp_h}" = xyes; then
+      WANT_NATIVE_BIG_INTEGER=true
+      AC_DEFINE(WITH_GNU_MP, 1, [Define to 1 if gmp is usable])
+    else
+      COMPILE_GMP=no
+    fi
+  else
+    COMPILE_GMP=no
+  fi
+fi
+AC_SUBST(WANT_NATIVE_BIG_INTEGER)
+AM_CONDITIONAL(CREATE_GMPBI_LIBRARY, test "x${COMPILE_GMP}" = xyes)
+
 dnl -----------------------------------------------------------
 dnl output files
 dnl -----------------------------------------------------------
@@ -921,11 +1172,13 @@ native/jni/Makefile
 native/jni/classpath/Makefile
 native/jni/java-io/Makefile
 native/jni/java-lang/Makefile
+native/jni/java-math/Makefile
 native/jni/java-net/Makefile
 native/jni/java-nio/Makefile
 native/jni/java-util/Makefile
 native/jni/gtk-peer/Makefile
 native/jni/gconf-peer/Makefile
+native/jni/gstreamer-peer/Makefile
 native/jni/qt-peer/Makefile
 native/jni/xmlj/Makefile
 native/jni/midi-alsa/Makefile
@@ -934,19 +1187,21 @@ native/jni/native-lib/Makefile
 native/plugin/Makefile
 resource/Makefile
 resource/META-INF/services/java.util.prefs.PreferencesFactory
+resource/META-INF/services/javax.sound.sampled.spi.AudioFileReader
+resource/META-INF/services/javax.sound.sampled.spi.MixerProvider
 scripts/Makefile
 scripts/classpath.spec
 lib/Makefile
 lib/gen-classlist.sh
 lib/copy-vmresources.sh
+scripts/check_jni_methods.sh
 tools/Makefile
 examples/Makefile
 examples/Makefile.jawt
 examples/Makefile.java2d])
 
-if test "x${COMPILE_WRAPPERS}" = xno
-then
-AC_CONFIG_FILES([tools/gappletviewer
+CLASSPATH_COND_IF([CREATE_WRAPPERS], [test "x${COMPILE_WRAPPERS}" = xyes], [],
+[AC_CONFIG_FILES([tools/gappletviewer
 tools/gjarsigner
 tools/gkeytool
 tools/gjar
@@ -958,6 +1213,7 @@ tools/gorbd
 tools/grmid
 tools/grmic
 tools/gjavah])
+
 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
@@ -970,6 +1226,12 @@ AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd])
 AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
 AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
 AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
+])
+
+if test "x${COMPILE_GJDOC}" = xyes
+then
+AC_CONFIG_FILES([tools/gjdoc])
+AC_CONFIG_COMMANDS([gjdoc], [chmod 755 tools/gjdoc])
 fi
 
 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
@@ -981,3 +1243,7 @@ cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
 if test x$use_escher != xtrue; then
    echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit
 fi
+
+if test "x${COMPILE_PLUGIN}" = "xyes" ; then
+  AC_MSG_WARN([You have enabled the browser plugin.  Please note that this is no longer maintained as part of GNU Classpath; development has moved to the IcedTea project.])
+fi