OSDN Git Service

libjava/classpath/
[pf3gnuchains/gcc-fork.git] / libjava / classpath / configure.ac
index d1f34ca..54a3efc 100644 (file)
@@ -6,7 +6,7 @@ dnl -----------------------------------------------------------
 dnl define([AC_CACHE_LOAD], )dnl
 dnl define([AC_CACHE_SAVE], )dnl
 
-AC_INIT([GNU Classpath],[0.96-pre],[classpath@gnu.org],[classpath])
+AC_INIT([GNU Classpath],[0.97.2],[classpath@gnu.org],[classpath])
 AC_CONFIG_SRCDIR(java/lang/System.java)
 
 dnl GCJ LOCAL
@@ -338,13 +338,17 @@ dnl -----------------------------------------------------------
 dnl Regenerate headers at build time (disabled by default)
 dnl -----------------------------------------------------------
 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 include/java_lang_VMSystem.h; then
+                       REGENERATE_JNI_HEADERS=no ;
+                  else
+                       REGENERATE_JNI_HEADERS=yes ;
+              fi])
 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
 
 dnl -----------------------------------------------------------
@@ -416,6 +420,8 @@ 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.
   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 \
@@ -426,7 +432,9 @@ 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])
 
   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]))
@@ -442,11 +450,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])
+                  getloadavg])
 
   LIBMAGIC=
   AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
@@ -503,6 +512,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'
@@ -533,11 +548,13 @@ 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)
@@ -580,7 +597,7 @@ 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
 
@@ -608,6 +625,10 @@ if test "x${COMPILE_JNI}" = xyes; then
 
        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
@@ -767,8 +788,6 @@ if test "x${COMPILE_JNI}" = xyes; then
   AC_CONFIG_LINKS([$ac_config_links_1])
 fi
 
-CLASSPATH_FIND_JAVAC
-
 CLASSPATH_WITH_CLASSLIB
 
 dnl -----------------------------------------------------------
@@ -929,6 +948,16 @@ esac;
 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
 AC_SUBST(PATH_TO_GLIBJ_ZIP)
 
+# 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; then   
+       AC_PROG_JAVAC
+       CLASSPATH_JAVAC_MEM_CHECK
+fi
+
 dnl -----------------------------------------------------------
 dnl Build with Escher based X peers.
 dnl -----------------------------------------------------------
@@ -1024,14 +1053,14 @@ 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
@@ -1043,6 +1072,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])
@@ -1055,7 +1085,7 @@ 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])
-fi
+])
 
 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])