This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, take 2] Build java as two separate DLLs on windows.


    Hi all,

  Here's the final version of my libjava-as-dlls patch.  Nobody had anything
much to say about the first draft so I take it there were no obvious massive
flaws; this is basically the same patch, tweaked to add -lgcj-noncore to the
specs when using -lgcj_bc as well as when using ordinary -lgcj, and adding
dependencies on libgcj-noncore.la to the tool executables everywhere they link
against libgcj.la, so as to guarantee both libraries are available at the time
those modified specs get used, preventing the parallel build from breaking.

gcc/ChangeLog:

	* config/i386/cygming.h (TARGET_USE_JCR_SECTION): Enable.
	* config/i386/cygwin.h (LIBGCJ_SONAME): Define.
	* config/i386/mingw32.h (LIBGCJ_SONAME): Likewise.

libjava/ChangeLog:

	* configure.host (enable_libgcj_sublibs_default): New variable,
	set for Cygwin and MinGW.
	* configure.ac (--enable-libgcj-sublibs): New command-line switch.
	(BUILD_SUBLIBS): New AM_CONDITIONAL relating to it.
	(libgcj_spec_lgcj_override): New variable, define if building sublibs.
	(libgcj_spec_lgcj_bc_override): Likewise for when USE_LIBGCJ_BC.
	(LIBGCJ_SPEC_LGCJ): New variable to abstract "-lgcj" from specs.
	(LIBGCJ_SPEC_LGCJ_BC): Likewise for when USE_LIBGCJ_BC.
	(LIBGCJ_SPEC): Use them.
	* configure: Regenerate.
	* Makefile.am (LOWER_PACKAGE_FILES_LO): New variable.
	(ALL_PACKAGE_SOURCE_FILES_LO): Likewise.
	(NONCORE_PACKAGE_SOURCE_FILES_LO): Likewise.
	(CORE_PACKAGE_SOURCE_FILES_LO): Likewise.
	(toolexeclib_LTLIBRARIES): Add libgcj-noncore.la if building sublibs.
	(libgcj_noncore_la_LIBADD_SUBOBJECTS): New variable.
	(libgcj_la_LIBADD_SUBOBJECTS): Likewise.
	(libgcj_la_LDFLAGS_NOUNDEF): Likewise.
	(libgij_la_LDFLAGS): Add DLL-related options.
	(libgcj_la_LDFLAGS): Use libgcj_la_LDFLAGS_NOUNDEF and
	libgcj_la_LIBADD_SUBOBJECTS.
	(libgcj_la_DEPENDENCIES): Adjust to match.
	(libgcj_noncore_la_SOURCES, libgcj_noncore_la_LDFLAGS,
	libgcj_noncore_la_LIBADD, libgcj_noncore_la_DEPENDENCIES,
	libgcj_noncore_la_LINK): New automake variables for sublibrary.
	(libgcj_tools_la_LDFLAGS): Add DLL-related flags.
	(libgcj_tools_la_LIBADD): New variable.
	(libjvm_la_LDFLAGS): Add DLL-related flags.
	(lib_gnu_awt_xlib_la_LDFLAGS): Likewise.
	(libgcj_bc_la_LDFLAGS): Likewise.
	(libgij_la_DEPENDENCIES): Add dependency on libgcj-noncore.la when
	building sublibs.
	(libgcj_tools_la_DEPENDENCIES, libjvm_la_DEPENDENCIES,
	lib_gnu_awt_xlib_la_DEPENDENCIES, jv_convert_DEPENDENCIES,
	gcj_dbtool_DEPENDENCIES, gc_analyze_DEPENDENCIES, ecjx_DEPENDENCIES):
	Likewise.
	* Makefile.in: Regenerate.
	* sysdep/i386/backtrace.h (MAIN_FUNC): New #define for main function,
	set appropriately for Cygwin on that platform or to "main" elsewhere.
	(fallback_backtrace): Use it to limit stack unwind.

libjava/libltdl/ChangeLog:

	* ltdl.h (LT_SCOPE): Change conditional to avoid breaking
	auto-export during libgcj DLL linking.
	* Makefile.am (libltdl_la_LDFLAGS): Remove -bindir switch.
	* Makefile.in: Regenerate.

  Bootstrapped at -j4 on i686-pc-cygwin.  Tests currently running, results
anticipated in a few hours.  Assuming (as I have every reason to expect) no
regressions, OK for HEAD?

    cheers,
      DaveK

Index: gcc/config/i386/cygming.h
===================================================================
--- gcc/config/i386/cygming.h	(revision 151124)
+++ gcc/config/i386/cygming.h	(working copy)
@@ -383,7 +383,7 @@ do {						\
 /* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true,
    but for .jcr section to work we also need crtbegin and crtend
    objects.  */
-#define TARGET_USE_JCR_SECTION 0
+#define TARGET_USE_JCR_SECTION 1
 
 /* Decide whether it is safe to use a local alias for a virtual function
    when constructing thunks.  */
Index: gcc/config/i386/cygwin.h
===================================================================
--- gcc/config/i386/cygwin.h	(revision 151124)
+++ gcc/config/i386/cygwin.h	(working copy)
@@ -267,3 +267,7 @@ while (0)
 #define LIBGCC_EH_EXTN "-sjlj"
 #endif
 #define LIBGCC_SONAME "cyggcc_s" LIBGCC_EH_EXTN "-1.dll"
+
+/* We should find a way to not have to update this manually.  */
+#define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-11.dll"
+
Index: gcc/config/i386/mingw32.h
===================================================================
--- gcc/config/i386/mingw32.h	(revision 151124)
+++ gcc/config/i386/mingw32.h	(working copy)
@@ -221,3 +221,7 @@ __enable_execute_stack (void *addr)					\
 #define LIBGCC_EH_EXTN "_sjlj"
 #endif
 #define LIBGCC_SONAME "libgcc_s" LIBGCC_EH_EXTN "-1.dll"
+
+/* We should find a way to not have to update this manually.  */
+#define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-11.dll"
+
Index: libjava/libltdl/ltdl.h
===================================================================
--- libjava/libltdl/ltdl.h	(revision 151124)
+++ libjava/libltdl/ltdl.h	(working copy)
@@ -128,7 +128,7 @@ LT_BEGIN_C_DECLS
    ridiculous implementation of data symbol exporting. */
 #ifndef LT_SCOPE
 #  ifdef __WINDOWS__
-#    ifdef DLL_EXPORT		/* defined by libtool (if required) */
+#    ifdef LIBLTDL_DLL_EXPORT	/* don't define or ld disables auto-export. */
 #      define LT_SCOPE	__declspec(dllexport)
 #    endif
 #    ifdef LIBLTDL_DLL_IMPORT	/* define if linking with this dll */
Index: libjava/libltdl/Makefile.am
===================================================================
--- libjava/libltdl/Makefile.am	(revision 151124)
+++ libjava/libltdl/Makefile.am	(working copy)
@@ -22,7 +22,7 @@ endif
 CLEANFILES = libltdl.la libltdlc.la
 
 libltdl_la_SOURCES = ltdl.c
-libltdl_la_LDFLAGS = -no-undefined -bindir "$(bindir)" -version-info 4:1:1
+libltdl_la_LDFLAGS = -no-undefined -version-info 4:1:1
 libltdl_la_LIBADD = $(LIBADD_DL)
 
 libltdlc_la_SOURCES = ltdl.c
Index: libjava/configure.host
===================================================================
--- libjava/configure.host	(revision 151124)
+++ libjava/configure.host	(working copy)
@@ -23,6 +23,9 @@
 #                            default.
 #   enable_hash_synchronization_default  If hash synchronization should be
 #                                        enabled by default.
+#   enable_libgcj_sublibs_default  Whether to build libgcj as a bunch of
+#                                  separate shared libraries or in one 
+#                                  monolithic one.
 #   sysdeps_dir		Directory containing system-dependent headers
 #   slow_pthread_self   The synchronization code should try to avoid 
 #			pthread_self calls by caching thread IDs in a hashtable
@@ -41,6 +44,7 @@ libgcj_javaflags=
 libgcj_interpreter=
 enable_java_net_default=yes
 enable_hash_synchronization_default=no
+enable_libgcj_sublibs_default=no
 sysdeps_dir=generic
 slow_pthread_self=
 can_unwind_signal=no
@@ -341,6 +345,8 @@ case "${host}" in
 	fallback_backtrace_h=sysdep/i386/backtrace.h  
 	# We need a frame pointer on Windows, so override BACKTRACESPEC
   	BACKTRACESPEC=
+	# Win32 DLLs are limited to 64k exported symbols each.
+	enable_libgcj_sublibs_default=yes
   ;;
 esac
 
Index: libjava/configure.ac
===================================================================
--- libjava/configure.ac	(revision 151124)
+++ libjava/configure.ac	(working copy)
@@ -206,6 +206,7 @@ AC_EXEEXT
 #	libgcj_cflags    - host specific C compiler flags
 #	libgcj_cxxflags  - host specific C++ compiler flags
 #	libgcj_javaflags - host specific Java compiler flags
+# and a number of others; see the list at the start of the file.
 
 libgcj_cflags=
 libgcj_cxxflags=
@@ -237,6 +238,26 @@ fi
 
 AC_CONFIG_HEADERS([include/config.h gcj/libgcj-config.h])
 
+# Possibly build libgcj as many sub-libraries.
+AC_ARG_ENABLE(libgcj-sublibs,
+  AS_HELP_STRING([--enable-libgcj-sublibs],
+                 [build libgcj as many sub-libraries]))
+
+if test -z "$enable_libgcj_sublibs"; then
+   enable_libgcj_sublibs=$enable_libgcj_sublibs_default
+fi
+AM_CONDITIONAL(BUILD_SUBLIBS, test "$enable_libgcj_sublibs" = yes)
+if test "$enable_libgcj_sublibs" = yes ; then
+  # In theory we could make do with only one override and simply
+  # tag "_bc" onto the end of it when we use it to generate the
+  # spec, but that's an ugly thing to do when there are multiple
+  # words in the string and you're relying on the ordering to
+  # append the correct one.
+  libgcj_spec_lgcj_override="-lgcj-noncore -lgcj"
+  libgcj_spec_lgcj_bc_override="-lgcj-noncore -lgcj_bc"
+fi
+
+
 # See if the user has requested runtime debugging.
 LIBGCJDEBUG="disable"
 AC_SUBST(LIBGCJDEBUG)
@@ -897,6 +918,9 @@ arm*linux*eabi)
     LIBSTDCXXSPEC=-lstdc++
     LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -L`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -rpath `${PWDCMD-pwd}`/.libs:`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -lstdc++"
     ;;
+*-*-cygwin)
+    extra_ldflags_libjava=-liconv
+    ;;
 esac
 AC_SUBST(extra_ldflags_libjava)
 AC_SUBST(extra_gij_ldflags)
@@ -1075,9 +1099,17 @@ AC_CONFIG_LINKS(sysdep/locks.h:sysdep/$sysdeps_dir
 AC_CONFIG_LINKS(sysdep/backtrace.h:$fallback_backtrace_h)
 AC_CONFIG_LINKS(sysdep/descriptor.h:$descriptor_h)
 
-LIBGCJ_SPEC="%{s-bc-abi:} -lgcj"
+LIBGCJ_SPEC_LGCJ=-lgcj
+LIBGCJ_SPEC_LGCJ_BC=-lgcj_bc
+if test x"$libgcj_spec_lgcj_override" != x ; then
+  LIBGCJ_SPEC_LGCJ=$libgcj_spec_lgcj_override
+fi
+if test x"$libgcj_spec_lgcj_bc_override" != x ; then
+  LIBGCJ_SPEC_LGCJ_BC=$libgcj_spec_lgcj_bc_override
+fi
+LIBGCJ_SPEC="%{s-bc-abi:} $LIBGCJ_SPEC_LGCJ"
 if test "$use_libgcj_bc" = yes; then
-  LIBGCJ_SPEC="%{static|static-libgcj|!s-bc-abi:-lgcj;:-lgcj_bc}"
+  LIBGCJ_SPEC="%{static|static-libgcj|!s-bc-abi:$LIBGCJ_SPEC_LGCJ;:$LIBGCJ_SPEC_LGCJ_BC}"
   LIBGCJ_BC_SPEC="%{findirect-dispatch:-fPIC}"
 fi
 AC_SUBST(LIBGCJ_SPEC)
Index: libjava/sysdep/i386/backtrace.h
===================================================================
--- libjava/sysdep/i386/backtrace.h	(revision 151124)
+++ libjava/sysdep/i386/backtrace.h	(working copy)
@@ -13,7 +13,14 @@ details.  */
 
 #include <java-stack.h>
 
-extern int main (int, char **);
+#ifdef __CYGWIN__
+/* To allow this to link as a DLL.  */
+#define MAIN_FUNC dll_crt0__FP11per_process
+extern "C" int MAIN_FUNC () __declspec(dllimport);
+#else /* !__CYGWIN__ */
+#define MAIN_FUNC main
+extern int MAIN_FUNC (int, char **);
+#endif /* ?__CYGWIN__ */
 
 /* The context used to keep track of our position while unwinding through
    the call stack.  */
@@ -104,7 +111,7 @@ fallback_backtrace (_Unwind_Trace_Fn trace_fn, _Jv
                             const char **, bool))_Jv_RunMain;
       if (ctx.meth_addr == (_Jv_uintptr_t)jv_runmain
           || ctx.meth_addr == (_Jv_uintptr_t)_Jv_ThreadStart
-          || (ctx.meth_addr - (_Jv_uintptr_t)main) < 16)
+          || (ctx.meth_addr - (_Jv_uintptr_t)MAIN_FUNC) < 16)
         break;
     }
 
Index: libjava/Makefile.am
===================================================================
--- libjava/Makefile.am	(revision 151124)
+++ libjava/Makefile.am	(working copy)
@@ -45,6 +45,170 @@ libexecsubdir = $(libexecdir)/gcc/$(target_noncano
 toolexeclib_LTLIBRARIES = libgcj.la libgij.la libgcj-tools.la
 toolexecmainlib_DATA = libgcj.spec
 
+##
+## These files form a closed dependency group at the lower
+## edge of libjava's dependency graph, so can be separated out.
+## For details of how the list was generated, see the GCC wiki:
+##
+##   http://gcc.gnu.org/wiki/Internal_dependencies_of_libgcj
+##
+LOWER_PACKAGE_FILES_LO = \
+	$(propertyo_files) \
+	gnu-CORBA.lo \
+	gnu-java-awt-dnd-peer-gtk.lo \
+	gnu-java-awt-peer-gtk.lo \
+	gnu-java-awt-peer-swing.lo \
+	gnu-java-lang-management.lo \
+	gnu-javax-management.lo \
+	gnu-javax-rmi.lo \
+	gnu-javax-sound-midi.lo \
+	gnu-xml-aelfred2.lo \
+	gnu-xml-dom.lo \
+	gnu-xml-libxmlj.lo \
+	gnu-xml-pipeline.lo \
+	gnu-xml-stream.lo \
+	gnu-xml-transform.lo \
+	gnu-xml-util.lo \
+	gnu-xml-validation.lo \
+	gnu-xml-xpath.lo \
+	java-lang-management.lo \
+	javax-imageio.lo \
+	javax-rmi.lo \
+	jni-libjvm.lo \
+	org-omg-CORBA.lo \
+	org-omg-CORBA_2_3.lo \
+	org-omg-CosNaming.lo \
+	org-omg-Dynamic.lo \
+	org-omg-DynamicAny.lo \
+	org-omg-IOP.lo \
+	org-omg-Messaging.lo \
+	org-omg-PortableInterceptor.lo \
+	org-omg-PortableServer.lo \
+	org-omg-SendingContext.lo \
+	org-omg-stub.lo \
+	org-relaxng.lo \
+	org-xml.lo \
+	META-INF/services/java.util.prefs.PreferencesFactory.in.lo \
+	META-INF/services/java.util.prefs.PreferencesFactory.lo \
+	META-INF/services/javax.sound.midi.spi.MidiDeviceProvider.lo \
+	META-INF/services/javax.sound.midi.spi.MidiFileReader.lo \
+	META-INF/services/javax.sound.midi.spi.MidiFileWriter.lo \
+	META-INF/services/javax.sound.sampled.spi.AudioFileReader.lo \
+	classpath/native/jni/classpath/jcl.lo \
+	classpath/native/jni/classpath/jnilink.lo \
+	classpath/native/jni/java-math/gnu_java_math_GMP.lo \
+	classpath/tools/libgcj_tools_la-tools.lo \
+	gnu/awt.lo \
+	gnu/awt/j2d.lo \
+	gnu/gcj/io.lo \
+	gnu/gcj/io/natSimpleSHSStream.lo \
+	gnu/gcj/io/shs.lo \
+	gnu/gcj/tools/gcj_dbtool.lo \
+	gnu/gcj/util/natDebug.lo \
+	gnu/gcj/util/natGCInfo.lo \
+	gnu/java/awt/dnd.lo \
+	gnu/java/awt/font.lo \
+	gnu/java/awt/image.lo \
+	gnu/java/awt/print.lo \
+	gnu/java/awt/font/autofit.lo \
+	gnu/java/awt/font/opentype.lo \
+	gnu/java/awt/font/opentype/truetype.lo \
+	gnu/java/lang/management/natVMClassLoadingMXBeanImpl.lo \
+	gnu/java/lang/management/natVMCompilationMXBeanImpl.lo \
+	gnu/java/lang/management/natVMGarbageCollectorMXBeanImpl.lo \
+	gnu/java/lang/management/natVMMemoryMXBeanImpl.lo \
+	gnu/java/lang/management/natVMMemoryManagerMXBeanImpl.lo \
+	gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.lo \
+	gnu/java/lang/management/natVMOperatingSystemMXBeanImpl.lo \
+	gnu/java/lang/management/natVMRuntimeMXBeanImpl.lo \
+	gnu/java/lang/management/natVMThreadMXBeanImpl.lo \
+	gnu/java/net/local.lo \
+	gnu/java/net/protocol/ftp.lo \
+	gnu/java/net/protocol/gcjlib.lo \
+	gnu/java/net/protocol/https.lo \
+	gnu/javax/imageio.lo \
+	gnu/javax/print.lo \
+	gnu/javax/sound.lo \
+	gnu/javax/activation/viewers.lo \
+	gnu/javax/imageio/bmp.lo \
+	gnu/javax/imageio/gif.lo \
+	gnu/javax/imageio/jpeg.lo \
+	gnu/javax/imageio/png.lo \
+	gnu/javax/naming/giop.lo \
+	gnu/javax/naming/ictxImpl/trans.lo \
+	gnu/javax/naming/jndi/url/corbaname.lo \
+	gnu/javax/naming/jndi/url/rmi.lo \
+	gnu/javax/print/ipp.lo \
+	gnu/javax/print/ipp/attribute.lo \
+	gnu/javax/print/ipp/attribute/defaults.lo \
+	gnu/javax/print/ipp/attribute/job.lo \
+	gnu/javax/print/ipp/attribute/printer.lo \
+	gnu/javax/print/ipp/attribute/supported.lo \
+	gnu/javax/security/auth/login.lo \
+	gnu/javax/sound/sampled/AU.lo \
+	gnu/javax/sound/sampled/WAV.lo \
+	gnu/javax/swing/plaf/gnu.lo \
+	gnu/javax/swing/plaf/metal.lo \
+	java/sql.lo \
+	java/awt/im.lo \
+	java/awt/print.lo \
+	java/awt/im/spi.lo \
+	java/security/acl.lo \
+	javax/activation.lo \
+	javax/activity.lo \
+	javax/management.lo \
+	javax/naming.lo \
+	javax/print.lo \
+	javax/sql.lo \
+	javax/tools.lo \
+	javax/transaction.lo \
+	javax/management/loading.lo \
+	javax/management/openmbean.lo \
+	javax/management/remote.lo \
+	javax/management/remote/rmi.lo \
+	javax/naming/directory.lo \
+	javax/naming/event.lo \
+	javax/naming/ldap.lo \
+	javax/naming/spi.lo \
+	javax/print/attribute.lo \
+	javax/print/event.lo \
+	javax/print/attribute/standard.lo \
+	javax/security/cert.lo \
+	javax/security/auth/kerberos.lo \
+	javax/security/auth/login.lo \
+	javax/security/auth/spi.lo \
+	javax/sound/midi.lo \
+	javax/sound/midi/spi.lo \
+	javax/swing/plaf/multi.lo \
+	javax/swing/plaf/synth.lo \
+	javax/swing/text/rtf.lo \
+	javax/swing/text/html/default.css.lo \
+	javax/transaction/xa.lo \
+	org/ietf/jgss.lo \
+	sun/awt.lo
+
+##
+## Lists of all .lo files, and filtered core and non-core lists.
+## 
+ALL_PACKAGE_SOURCE_FILES_LO = $(all_packages_source_files:.list=.lo) $(propertyo_files) $(bc_objects)
+NONCORE_PACKAGE_SOURCE_FILES_LO = $(filter $(LOWER_PACKAGE_FILES_LO),$(ALL_PACKAGE_SOURCE_FILES_LO))
+CORE_PACKAGE_SOURCE_FILES_LO = $(filter-out $(LOWER_PACKAGE_FILES_LO),$(ALL_PACKAGE_SOURCE_FILES_LO))
+
+##
+## Assign objects to output libraries.
+##
+if BUILD_SUBLIBS
+toolexeclib_LTLIBRARIES += libgcj-noncore.la
+libgcj_noncore_la_LIBADD_SUBOBJECTS = $(NONCORE_PACKAGE_SOURCE_FILES_LO)
+libgcj_la_LIBADD_SUBOBJECTS = $(CORE_PACKAGE_SOURCE_FILES_LO)
+libgcj_la_LDFLAGS_NOUNDEF = -no-undefined -bindir $(bindir)
+else
+# If not building sublibraries, everything goes in libgcj,
+# and it cannot be usefully built shared on PE platforms.
+libgcj_la_LIBADD_SUBOBJECTS = $(ALL_PACKAGE_SOURCE_FILES_LO)
+libgcj_la_LDFLAGS_NOUNDEF = 
+endif
+
 if USE_LIBGCJ_BC
 toolexeclib_LTLIBRARIES += libgcj_bc.la
 endif
@@ -218,10 +382,13 @@ BOOTCLASSPATH = $(srcdir)/classpath/lib
 
 libgij_la_SOURCES = gij.cc
 libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+libgij_la_DEPENDENCIES += libgcj-noncore.la
+endif
 ## See jv_convert_LDADD.
 libgij_la_LIBADD = -L$(here)/.libs libgcj.la
 ## The mysterious backslash in the grep pattern is consumed by make.
-libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
+libgij_la_LDFLAGS = -rpath $(toolexeclibdir) -no-undefined -bindir $(bindir) \
         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
 
 if INTERPRETER
@@ -277,7 +444,7 @@ xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
 # certain linuxthread functions get linked:
 ## The mysterious backslash in the grep pattern is consumed by make.
 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) $(THREADLIBS) \
-	$(LIBLTDL) $(SYS_ZLIBS) \
+	$(LIBLTDL) $(SYS_ZLIBS) $(libgcj_la_LDFLAGS_NOUNDEF) \
 	-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
 	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
 libgcj_la_LIBADD = \
@@ -285,15 +452,13 @@ libgcj_la_LIBADD = \
 	java/lang/Object.lo \
 	java/lang/Class.lo \
 	java/process-$(PLATFORM).lo \
-	$(all_packages_source_files:.list=.lo) \
-	$(bc_objects) \
-	$(propertyo_files) \
+	$(libgcj_la_LIBADD_SUBOBJECTS) \
 	$(LIBFFI) $(ZLIBS) $(GCLIBS)
 libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
 	java/lang/Object.lo \
 	java/lang/Class.lo \
 	java/process-$(PLATFORM).lo \
-	$(all_packages_source_files:.list=.lo) \
+	$(ALL_PACKAGE_SOURCE_FILES_LO) \
 	$(LIBLTDL) $(libgcj_la_LIBADD)
 if ANONVERSCRIPT
 libgcj_la_DEPENDENCIES += $(srcdir)/libgcj.ver
@@ -305,6 +470,19 @@ libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS)
 ## compiled.
 EXTRA_libgcj_la_SOURCES = java/lang/Object.java
 
+if BUILD_SUBLIBS
+libgcj_noncore_la_SOURCES =
+libgcj_noncore_la_LDFLAGS = $(libgcj_la_LDFLAGS)
+libgcj_noncore_la_LIBADD = $(libgcj_noncore_la_LIBADD_SUBOBJECTS) \
+		$(LIBFFI) $(ZLIBS) $(GCLIBS) libgcj.la
+libgcj_noncore_la_DEPENDENCIES = libgcj-$(gcc_version).jar $(LIBLTDL) \
+		$(libgcj_noncore_la_LIBADD) libgcj.la
+if ANONVERSCRIPT
+libgcj_noncore_la_DEPENDENCIES += $(srcdir)/libgcj.ver
+endif
+libgcj_noncore_la_LINK = $(libgcj_la_LINK)
+endif
+
 # We compile libgcj_tools with -findirect-dispatch so that they can
 # depend on external classes: in particular, gjdoc uses antlr.  In
 # addition, -fno-bootstrap-classes ensures that the tools are loaded
@@ -316,16 +494,24 @@ libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findire
  -fsource-filename=$(here)/classpath/tools/all-classes.lst
 libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
  -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
- $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) -no-undefined -bindir $(bindir)
+libgcj_tools_la_LIBADD = libgcj.la
 libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+libgcj_tools_la_DEPENDENCIES += libgcj-noncore.la
+endif
 libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS)
 
 ## libjvm.so
 libjvm_la_SOURCES = jni-libjvm.cc
 libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+libjvm_la_DEPENDENCIES += libgcj-noncore.la
+endif
 ## See jv_convert_LDADD.
 libjvm_la_LIBADD = -L$(here)/.libs libgcj.la
-libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC)
+libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC) \
+ -no-undefined -bindir $(bindir)
 
 ## The .db file.  This rule is only used for native builds, so it is
 ## safe to invoke gcj-dbtool.
@@ -342,6 +528,9 @@ lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/g
 lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
 	libgcj.la libgcj.spec \
 	$(lib_gnu_awt_xlib_la_LIBADD)
+if BUILD_SUBLIBS
+lib_gnu_awt_xlib_la_DEPENDENCIES += libgcj-noncore.la
+endif
 ## We require libstdc++-v3 to be in the same build tree.
 lib_gnu_awt_xlib_la_CPPFLAGS = \
 	$(AM_CPPFLAGS) \
@@ -351,7 +540,7 @@ lib_gnu_awt_xlib_la_CPPFLAGS = \
 ## The mysterious backslash in the grep pattern is consumed by make.
 lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
 	@X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
-        -rpath $(toolexeclibdir) \
+        -rpath $(toolexeclibdir) -no-undefined -bindir $(bindir) \
         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
 lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS)
 
@@ -361,7 +550,7 @@ lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_aw
 ## This library is not linked against libgcj.
 libgcj_bc_la_SOURCES = libgcj_bc.c
 libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
-	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) -no-undefined -bindir $(bindir)
 libgcj_bc_la_DEPENDENCIES = libgcj.la
 libgcj_bc_la_LINK = $(LIBLINK) $(libgcj_bc_la_LDFLAGS)
 ## This is specific to Linux/{Free,Net,Open}BSD/Hurd and perhaps few others.
@@ -824,6 +1013,9 @@ jv_convert_LDADD = -L$(here)/.libs libgcj.la
 ## Depend on the spec file to make sure it is up to date before
 ## linking this program.
 jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+jv_convert_DEPENDENCIES += libgcj-noncore.la
+endif
 
 gcj_dbtool_SOURCES = \
 gnu/gcj/tools/gcj_dbtool/natMain.cc
@@ -845,6 +1037,9 @@ gcj_dbtool_LDADD = gnu/gcj/tools/gcj_dbtool.lo -L$
 ## Depend on the spec file to make sure it is up to date before
 ## linking this program.
 gcj_dbtool_DEPENDENCIES = gnu/gcj/tools/gcj_dbtool.lo libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+gcj_dbtool_DEPENDENCIES += libgcj-noncore.la
+endif
 
 gc_analyze_SOURCES =
 
@@ -859,6 +1054,9 @@ gc_analyze_LDADD = -L$(here)/.libs libgcj-tools.la
 ## Depend on the spec file to make sure it is up to date before
 ## linking this program.
 gc_analyze_DEPENDENCIES = libgcj-tools.la libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+gc_analyze_DEPENDENCIES += libgcj-noncore.la
+endif
 
 gij_SOURCES = 
 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
@@ -897,6 +1095,9 @@ endif !ENABLE_SHARED
 
 ecjx_LDADD = -L$(here)/.libs $(extra_ldflags)
 ecjx_DEPENDENCIES = libgcj.la libgcj.spec
+if BUILD_SUBLIBS
+ecjx_DEPENDENCIES += libgcj-noncore.la
+endif
 if USE_LIBGCJ_BC
 ecjx_DEPENDENCIES += libgcj_bc.la
 else

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]