Hello,

Attached is a patch to allow for disable the building of the libnative
libraries.  (I'm finding this useful for building Japhar in association
with Classpath, which provides its own native libraries.)  The current
behavior of building the native libs is default, and can be disabled by
giving configure the --disable-libnative option.

Brian Bassett
diff -u configure.in.orig configure.in
--- configure.in.orig   Sat Aug 21 21:27:57 1999
+++ configure.in        Sun Aug 22 12:29:49 1999
@@ -252,6 +252,20 @@
     
 AM_CONDITIONAL(LIBFFI_SUPPORT, test x$can_use_libffi = xtrue)
 
+dnl
+dnl Test whether or not we should build the native libs (useful for when
+dnl the class library provides its own native libs (ie Classpath))
+dnl
+
+AC_ARG_ENABLE(libnative,
+ [  --enable-libnative      Turn on the native libraries [default=yes] ],
+  [case "${enableval}" in
+    yes) use_libnative=true ;;
+    no)  use_libnative=false ;;
+    *) AC_MSG_ERROR(bad value ${enableval} for --enable-libnative) ;;
+  esac],[use_libnative=true])
+AM_CONDITIONAL(NATIVE_SUPPORT, test x$use_libnative = xtrue)
+
 dnl Testing for functions and libraries has to be done in the correct
 dnl order.  First one test for the existence of a library, then one
 dnl tests for the existence of the wanted function.
diff -u lib/Makefile.am.orig lib/Makefile.am
--- lib/Makefile.am.orig        Sun Aug 22 12:30:08 1999
+++ lib/Makefile.am     Sun Aug 22 12:31:59 1999
@@ -12,7 +12,11 @@
 LIBOJI_DIR=liboji
 endif
 
-SUBDIRS= $(ZLIB_DIR) $(LIBFFI_DIR) libjni libjvmdi libruntime libnative $(LIBOJI_DIR)
+if NATIVE_SUPPORT
+NATIVE_DIR=libnative
+endif
+
+SUBDIRS= $(ZLIB_DIR) $(LIBFFI_DIR) libjni libjvmdi libruntime $(NATIVE_DIR) 
+$(LIBOJI_DIR)
 
 # Make libjava.so.1.0.0 which contains all other libraries
 hack:
diff -u progs/japhar/Makefile.am.orig progs/japhar/Makefile.am
--- progs/japhar/Makefile.am.orig       Sun Aug 22 12:33:41 1999
+++ progs/japhar/Makefile.am    Sun Aug 22 16:28:21 1999
@@ -24,6 +24,20 @@
 japhar_SOURCES=        japhar.c
 
 
+if NATIVE_SUPPORT
+NATIVE_DLOPENS= \
+"-dlopen" $(top_builddir)/lib/libnative/java.io/libjaphar_io.la \
+"-dlopen" $(top_builddir)/lib/libnative/java.lang.reflect/libjaphar_reflect.la \
+"-dlopen" $(top_builddir)/lib/libnative/java.lang/libjaphar_lang.la \
+"-dlopen" $(top_builddir)/lib/libnative/java.net/libjaphar_net.la \
+"-dlopen" $(top_builddir)/lib/libnative/java.security/libjaphar_security.la \
+"-dlopen" $(top_builddir)/lib/libnative/java.util.zip/libjaphar_zip.la \
+"-dlopen" $(top_builddir)/lib/libnative/java.util/libjaphar_util.la \
+"-dlopen" $(top_builddir)/lib/libnative/sun.audio/libjaphar_mmedia.la \
+"-dlopen" $(top_builddir)/lib/libnative/sun.awt.font/libjaphar_fontmanager.la \
+"-dlopen" $(top_builddir)/lib/libnative/sun.awt.motif/libjaphar_awt.la \
+"-dlopen" $(top_builddir)/lib/libnative/sun.debug.agent/libjaphar_agent.la \
+"-dlopen" $(top_builddir)/lib/libnative/sysresource/libjaphar_sysresource.la
 NATIVELIBS= \
        $(top_builddir)/lib/libnative/java.io/libjaphar_io.la \
        $(top_builddir)/lib/libnative/java.lang.reflect/libjaphar_reflect.la \
@@ -37,6 +51,10 @@
        $(top_builddir)/lib/libnative/sun.awt.motif/libjaphar_awt.la \
        $(top_builddir)/lib/libnative/sun.debug.agent/libjaphar_agent.la \
        $(top_builddir)/lib/libnative/sysresource/libjaphar_sysresource.la
+else
+NATIVE_DLOPENS=
+NATIVELIBS=
+endif
 
 if PROFILING
 PRELOADLIBS=$(NATIVELIBS)
@@ -44,20 +62,10 @@
 PRELOADLIBS=
 endif
 
+
 japhar_LDADD= \
        $(PRELOADLIBS) \
-"-dlopen" $(top_builddir)/lib/libnative/java.io/libjaphar_io.la \
-"-dlopen" $(top_builddir)/lib/libnative/java.lang.reflect/libjaphar_reflect.la \
-"-dlopen" $(top_builddir)/lib/libnative/java.lang/libjaphar_lang.la \
-"-dlopen" $(top_builddir)/lib/libnative/java.net/libjaphar_net.la \
-"-dlopen" $(top_builddir)/lib/libnative/java.security/libjaphar_security.la \
-"-dlopen" $(top_builddir)/lib/libnative/java.util.zip/libjaphar_zip.la \
-"-dlopen" $(top_builddir)/lib/libnative/java.util/libjaphar_util.la \
-"-dlopen" $(top_builddir)/lib/libnative/sun.audio/libjaphar_mmedia.la \
-"-dlopen" $(top_builddir)/lib/libnative/sun.awt.font/libjaphar_fontmanager.la \
-"-dlopen" $(top_builddir)/lib/libnative/sun.awt.motif/libjaphar_awt.la \
-"-dlopen" $(top_builddir)/lib/libnative/sun.debug.agent/libjaphar_agent.la \
-"-dlopen" $(top_builddir)/lib/libnative/sysresource/libjaphar_sysresource.la \
+        $(NATIVE_DLOPENS) \
        $(top_builddir)/lib/libjni/src/libjni.la \
        $(top_builddir)/lib/libruntime/libruntime.la \
        $(top_builddir)/arch/libarch.la \

Reply via email to