[PATCH 1/2] build: put dependency libraries in the right place in Makefiles

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Jan Engelhardt jengelh at inai.de
Thu Oct 2 22:03:44 UTC 2014


Libs must be in _LDADD/_LIBADD and not in _LDFLAGS.
---
 src/Makefile.am                  | 4 ++--
 src/channel/abis/Makefile.am     | 3 ++-
 tests/osmo-pcap-test/Makefile.am | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 8b4b58e..ca40152 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,13 +4,13 @@ LIBVERSION=2:0:0
 
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
 AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
-AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS)
+AM_LDFLAGS = $(COVERAGE_LDFLAGS)
 
 SUBDIRS = channel
 
 lib_LTLIBRARIES = libosmonetif.la
 
-libosmonetif_la_LIBADD = channel/abis/libosmonetif-abis.la
+libosmonetif_la_LIBADD = channel/abis/libosmonetif-abis.la $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS)
 libosmonetif_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined
 
 libosmonetif_la_SOURCES = amr.c			\
diff --git a/src/channel/abis/Makefile.am b/src/channel/abis/Makefile.am
index e4d93a3..7b744f2 100644
--- a/src/channel/abis/Makefile.am
+++ b/src/channel/abis/Makefile.am
@@ -1,8 +1,9 @@
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
 AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
-AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS)
+AM_LDFLAGS = $(COVERAGE_LDFLAGS)
 
 noinst_LTLIBRARIES = libosmonetif-abis.la
 
 libosmonetif_abis_la_SOURCES = ipa_stream_server.c	\
 			       ipa_stream_client.c
+libosmonetif_abis_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS)
diff --git a/tests/osmo-pcap-test/Makefile.am b/tests/osmo-pcap-test/Makefile.am
index 0be6fc4..a256005 100644
--- a/tests/osmo-pcap-test/Makefile.am
+++ b/tests/osmo-pcap-test/Makefile.am
@@ -9,6 +9,6 @@ osmo_pcap_test_SOURCES = proto.c		\
 			 osmux_test.c		\
 			 pcap.c
 
-osmo_pcap_test_LDFLAGS = -lpcap			\
+osmo_pcap_test_LDADD =   -lpcap			\
 			 -losmocore		\
 			 -losmonetif
-- 
2.0.0





More information about the OpenBSC mailing list