summaryrefslogtreecommitdiff
path: root/libjava/Makefile.am
diff options
context:
space:
mode:
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-05 17:22:52 +0000
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-05 17:22:52 +0000
commitf8725d56513b248109bccad632fd7d2954b1bced (patch)
tree33fb639d327468fa17d35f0500155d56bc25a8a4 /libjava/Makefile.am
parent71cbce26c5ccce4738f8b1f3d403b5162e43a2d4 (diff)
downloadgcc-f8725d56513b248109bccad632fd7d2954b1bced.tar.gz
* configure.ac (ANONVERSCRIPT): Handle sun style.
Define ANONVERSCRIPT_GNU, ANONVERSCRIPT_SUN automake conditionals. * configure: Regenerate. * Makefile.am [ANONVERSCRIPT]: Protect GNU section with ANONVERSCRIPT_GNU. Introduce per-library $(lib)_la_version_arg, $(lib)_la_version_dep variables. [ANONVERSCRIPT_GNU] (version_arg): Default ld arg for version map. (version_dep): Likewise for dependency. Use them to set the per-library variables. [!ANONVERSCRIPT]: Provide them vor the unversioned case. [ANONVERSCRIPT_SUN]: Handle Sun symbol versioning. (libgcj_la_DEPENDENCIES): Unconditionally use $(libgcj_la_version_dep). (libgcj_la_LINK): Add $(libgcj_la_version_arg). (libgcj_noncore_la_DEPENDENCIES): Unconditionally use $(libgcj_la_version_dep). (libgcj_tools_la_LIBADD): Move -lm ... (libgcj_tools_la_LDFLAGS): ... here. (libgcj_tools_la_DEPENDENCIES): Add $(libgcj_tools_la_version_dep). (libgcj_tools_la_LINK): Add $(libgcj_tools_la_version_arg). (lib_gnu_awt_xlib_la_DEPENDENCIES): Add $(lib_gnu_awt_xlib_la_version_dep). (lib_gnu_awt_xlib_la_LINK): Add $(lib_gnu_awt_xlib_la_version_arg). (libgcj_bc_la_DEPENDENCIES): Add $(libgcj_bc_la_version_dep). (libgcj_bc_la_LINK): $(libgcj_bc_la_version_arg). [ANONVERSCRIPT && ANONVERSCRIPT_SUN] (%.ver-sun): New pattern rule. * Makefile.in: Regenerate. * libgcj.ver: Reformat. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161843 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/Makefile.am')
-rw-r--r--libjava/Makefile.am91
1 files changed, 74 insertions, 17 deletions
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 190c686e65e..7bcb5564213 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -291,7 +291,45 @@ extra_ldflags_libjava = @extra_ldflags_libjava@
extra_ldflags = @extra_ldflags@
if ANONVERSCRIPT
-extra_ldflags_libjava += -Wl,--version-script=$(srcdir)/libgcj.ver
+if ANONVERSCRIPT_GNU
+version_arg = -Wl,--version-script=$(srcdir)/libgcj.ver
+libgcj_la_version_arg = $(version_arg)
+libgcj_tools_la_version_arg = $(version_arg)
+lib_gnu_awt_xlib_la_version_arg = $(version_arg)
+libgcj_bc_la_version_arg = $(version_arg)
+
+version_dep = $(srcdir)/libgcj.ver
+libgcj_la_version_dep = $(version_dep)
+libgcj_tools_la_version_dep = $(version_dep)
+lib_gnu_awt_xlib_la_version_dep = $(version_dep)
+libgcj_bc_la_version_dep = $(version_dep)
+endif
+if ANONVERSCRIPT_SUN
+libgcj_la_version_arg = -Wl,-M,libgcj.ver-sun
+libgcj_tools_la_version_arg = -Wl,-M,libgcj_tools.ver-sun
+lib_gnu_awt_xlib_la_version_arg = -Wl,-M,lib_gnu_awt_xlib.ver-sun
+libgcj_bc_la_version_arg = -Wl,-M,libgcj_bc.ver-sun
+
+libgcj_la_version_dep = libgcj.ver-sun
+libgcj_tools_la_version_dep = libgcj_tools.ver-sun
+lib_gnu_awt_xlib_la_version_dep = lib_gnu_awt_xlib.ver-sun
+libgcj_bc_la_version_dep = libgcj_bc.ver-sun
+
+# The pattern rule necessary to build the *.ver-sun mapfiles is at the end
+# of the file, see below.
+endif
+else
+version_arg =
+libgcj_la_version_arg = $(version_arg)
+libgcj_tools_la_version_arg = $(version_arg)
+lib_gnu_awt_xlib_la_version_arg = $(version_arg)
+libgcj_bc_la_version_arg = $(version_arg)
+
+version_dep =
+libgcj_la_version_dep = $(version_dep)
+libgcj_tools_la_version_dep = $(version_dep)
+lib_gnu_awt_xlib_la_version_dep = $(version_dep)
+libgcj_bc_la_version_dep = $(version_dep)
endif
LTLDFLAGS = $(shell $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
@@ -463,11 +501,9 @@ libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
java/process-$(PLATFORM).lo \
$(ALL_PACKAGE_SOURCE_FILES_LO) \
$(LIBLTDL) $(libgcj_la_LIBADD) \
- $(LIBJAVA_CORE_EXTRA)
-if ANONVERSCRIPT
-libgcj_la_DEPENDENCIES += $(srcdir)/libgcj.ver
-endif
-libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS)
+ $(LIBJAVA_CORE_EXTRA) \
+ $(libgcj_la_version_dep)
+libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS) $(libgcj_la_version_arg)
## A hack to make sure the various gcj-related macros, like
## LTGCJCOMPILE, are defined by automake. This is never actually
@@ -490,10 +526,7 @@ libgcj_noncore_la_SOURCES =
libgcj_noncore_la_LDFLAGS = $(libgcj_la_LDFLAGS)
libgcj_noncore_la_LIBADD = $(libgcj_noncore_la_LIBADD_SUBOBJECTS) 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_LIBADD) libgcj.la $(libgcj_la_version_dep)
libgcj_noncore_la_LINK = $(libgcj_la_LINK)
endif # BUILD_SUBLIBS
@@ -509,13 +542,15 @@ libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch \
-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) $(LIBJAVA_LDFLAGS_NOUNDEF)
-libgcj_tools_la_LIBADD = libgcj.la -lm
-libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF) -lm
+libgcj_tools_la_LIBADD = libgcj.la
+libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec \
+ $(libgcj_tools_la_version_dep)
if BUILD_SUBLIBS
libgcj_tools_la_DEPENDENCIES += libgcj-noncore.la
endif
-libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS)
+libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS) \
+ $(libgcj_tools_la_version_arg)
## libjvm.so
libjvm_la_SOURCES = jni-libjvm.cc
@@ -543,6 +578,7 @@ lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
libgcj.la libgcj.spec \
+ $(lib_gnu_awt_xlib_la_version_dep) \
$(lib_gnu_awt_xlib_la_LIBADD)
if BUILD_SUBLIBS
lib_gnu_awt_xlib_la_DEPENDENCIES += libgcj-noncore.la
@@ -558,7 +594,8 @@ lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
@X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
-rpath $(toolexeclibdir) $(LIBJAVA_LDFLAGS_NOUNDEF) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
-lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS)
+lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS) \
+ $(lib_gnu_awt_xlib_la_version_arg)
## Support for libgcj_bc: dummy shared library.
##
@@ -567,8 +604,9 @@ lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS)
libgcj_bc_la_SOURCES = libgcj_bc.c
libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF)
-libgcj_bc_la_DEPENDENCIES = libgcj.la
-libgcj_bc_la_LINK = $(LIBLINK) $(libgcj_bc_la_LDFLAGS)
+libgcj_bc_la_DEPENDENCIES = libgcj.la $(libgcj_bc_la_version_dep)
+libgcj_bc_la_LINK = $(LIBLINK) $(libgcj_bc_la_LDFLAGS) \
+ $(libgcj_bc_la_version_arg)
## This is specific to Linux/{Free,Net,Open}BSD/Hurd and perhaps few others.
## USE_LIBGCJ_BC shouldn't be set on other targets.
libgcj_bc_dummy_LINK = $(CC) -L$(here)/.libs $(CFLAGS) $(LDFLAGS) -shared \
@@ -1574,3 +1612,22 @@ distclean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
maintainer-clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
+
+if ANONVERSCRIPT
+if ANONVERSCRIPT_SUN
+# This must be at the end of the Makefile, otherwise .SECONDEXPANSION
+# causes expansion of filenames with $ in their names, which breaks the build.
+# .SECONDEXPANSION is necessary to allow the use of automatic variables ($@
+# in this case) in the requisites of pattern rules.
+.SECONDEXPANSION:
+
+%.ver-sun : $(srcdir)/libgcj.ver \
+ $(top_srcdir)/../contrib/make_sunver.pl \
+ $$($$(basename $$@)_la_OBJECTS) $$($$(basename $$@)_la_LIBADD)
+ perl $(top_srcdir)/../contrib/make_sunver.pl \
+ $(srcdir)/libgcj.ver \
+ `echo $($(basename $@)_la_OBJECTS) $($(basename $@)_la_LIBADD) | \
+ sed 's,\([^/ ]*\)\.l\([ao]\),.libs/\1.\2,g'` \
+ > $@ || (rm -f $@ ; exit 1)
+endif
+endif