Index: HISTORY =================================================================== --- HISTORY (revision 10390) +++ HISTORY (revision 10391) @@ -5,6 +5,13 @@ bug fixes (and other actions) for each version of LAM since version 1.0. +7.1.5 +----- + +- Clean up shared library dependencies to support use of + --as-needed linker option on GNU systems. Thanks to + Justin Bronder for bringing this to our attention. + 7.1.4 ----- Index: share/mpi/f77/Makefile.am =================================================================== --- share/mpi/f77/Makefile.am (revision 10390) +++ share/mpi/f77/Makefile.am (revision 10391) @@ -27,15 +27,13 @@ # with an additional -llamf77mpi at the beginning of the -l arguments # (splitting the RPI is not nearly as clean -- trust me!). -# Hence, this library will get installed and not be a "noinst". - # Note that this is *not* true for the profiling interface; since the # RPI does not have to be linked in to the profiling library, there's # no extra subdirectories, so it doesn't run into the same character # limit with ar. Ugh. if WANT_FORTRAN -fortran_lib = liblamf77mpi.la +fortran_lib = liblamf77mpi_internal.la else fortran_lib = endif @@ -62,8 +60,8 @@ endif -lib_LTLIBRARIES = $(fortran_lib) -liblamf77mpi_la_SOURCES = \ +noinst_LTLIBRARIES = $(fortran_lib) +liblamf77mpi_internal_la_SOURCES = \ $(mpi_stub_sources) \ abort_f.c \ accept_f.c \ Index: share/liblam/Makefile.am =================================================================== --- share/liblam/Makefile.am (revision 10390) +++ share/liblam/Makefile.am (revision 10391) @@ -35,5 +35,6 @@ $(top_builddir)/share/ssi/libssi_lam.la \ $(top_builddir)/share/threads/liblamthreads.la \ $(top_builddir)/share/trillium/liblamtrillium.la \ - $(top_builddir)/share/tstdio/liblamtstdio.la -liblam_la_LDFLAGS = $(EXTRA_LDFLAGS) + $(top_builddir)/share/tstdio/liblamtstdio.la \ + $(LIBLAM_EXTRA_LIBS) +liblam_la_LDFLAGS = $(EXTRA_LDFLAGS) $(LIBLAM_EXTRA_LDFLAGS) Index: share/libmpi/Makefile.am =================================================================== --- share/libmpi/Makefile.am (revision 10390) +++ share/libmpi/Makefile.am (revision 10391) @@ -28,11 +28,17 @@ pmpi_lib = endif +if WANT_FORTRAN +fortran_lib = liblamf77mpi.la +else +fortran_lib = +endif + # Note that mpi/liblamextra.la gets built into both liblam.la and # in both libraries, and avoids a dependency from liblam -> libmpi # (dependencies the other way are ok). -lib_LTLIBRARIES = libmpi.la +lib_LTLIBRARIES = libmpi.la $(fortran_lib) # SSI and MPI libraries get munged together. @@ -42,5 +48,13 @@ $(top_builddir)/share/mpi/libmpiextra.la \ $(top_builddir)/share/ssi/libssi_mpi.la \ $(top_builddir)/share/memory/libmemory.la \ - $(impi_lib) $(pmpi_lib) -libmpi_la_LDFLAGS = $(EXTRA_LDFLAGS) + $(impi_lib) $(pmpi_lib) \ + $(LIBMPI_EXTRA_LIBS) \ + $(top_builddir)/share/liblam/liblam.la +libmpi_la_LDFLAGS = $(EXTRA_LDFLAGS) $(LIBMPI_EXTRA_LDFLAGS) + +liblamf77mpi_la_SOURCES = +liblamf77mpi_la_LIBADD = \ + $(top_builddir)/share/mpi/f77/liblamf77mpi_internal.la \ + $(top_builddir)/share/libmpi/libmpi.la +liblamf77mpi_la_LDFLAGS = $(EXTRA_LDFLAGS) $(LIBMPI_EXTRA_LDFLAGS)