1
0
forked from pool/libosmo-sccp
libosmo-sccp/0001-build-fixes.patch

159 lines
5.8 KiB
Diff

From f34a36b94185f377639c7c997dcdd2453fc23574 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Mon, 21 Jul 2014 10:13:00 +0200
Subject: [PATCH] build: fixes
Find and use system talloc, do not rely on OSMO's bundled copy.
Avoid adding .o files into _LDADD, this is nonportable.
Rename libmtp to libosmo-mtp, as libmtp is already used by the
Multimedia Transfer Protocol library.
---
configure.ac | 1 +
libosmo-mtp.pc.in | 2 +-
libosmo-sccp.pc.in | 2 +-
src/Makefile.am | 20 +++++++++++++++-----
tests/m2ua/Makefile.am | 2 +-
tests/sccp/Makefile.am | 7 ++++---
tests/ss7/Makefile.am | 2 +-
tests/xua/Makefile.am | 7 ++++---
8 files changed, 28 insertions(+), 15 deletions(-)
Index: libosmo-sccp-1.9.0/configure.ac
===================================================================
--- libosmo-sccp-1.9.0.orig/configure.ac
+++ libosmo-sccp-1.9.0/configure.ac
@@ -51,6 +51,7 @@ AC_SEARCH_LIBS([sctp_recvmsg], [sctp], [
], [
AC_MSG_ERROR([sctp_recvmsg not found in searched libs])])
LIBS=$old_LIBS
+PKG_CHECK_MODULES([TALLOC], [talloc])
AC_ARG_ENABLE(sanitize,
[AS_HELP_STRING(
Index: libosmo-sccp-1.9.0/libosmo-mtp.pc.in
===================================================================
--- libosmo-sccp-1.9.0.orig/libosmo-mtp.pc.in
+++ libosmo-sccp-1.9.0/libosmo-mtp.pc.in
@@ -6,5 +6,5 @@ includedir=@includedir@
Name: Osmo MTP Lib
Description: Osmo MTP Lib
Version: @VERSION@
-Libs: -L${libdir} -lmtp
+Libs: -L${libdir} -losmo-mtp
Cflags: -I${includedir}/
Index: libosmo-sccp-1.9.0/libosmo-sccp.pc.in
===================================================================
--- libosmo-sccp-1.9.0.orig/libosmo-sccp.pc.in
+++ libosmo-sccp-1.9.0/libosmo-sccp.pc.in
@@ -6,5 +6,5 @@ includedir=@includedir@
Name: OpenBSC SCCP Lib
Description: OpenBSC SCCP Lib
Version: @VERSION@
-Libs: -L${libdir} -lsccp
+Libs: -L${libdir} -losmo-sccp
Cflags: -I${includedir}/
Index: libosmo-sccp-1.9.0/src/Makefile.am
===================================================================
--- libosmo-sccp-1.9.0.orig/src/Makefile.am
+++ libosmo-sccp-1.9.0/src/Makefile.am
@@ -13,15 +13,21 @@ noinst_HEADERS = \
# Legacy static libs
sccpdir = $(libdir)
-sccp_LIBRARIES = libsccp.a libmtp.a libxua.a
+sccp_LTLIBRARIES = libosmo-sccp.la libosmo-mtp.la libosmo-xua.la
-libsccp_a_SOURCES = sccp.c
-libmtp_a_SOURCES = mtp_pcap.c
-libxua_a_SOURCES = xua_msg.c
+libosmo_sccp_la_SOURCES = sccp.c
+libosmo_mtp_la_SOURCES = mtp_pcap.c
+libosmo_xua_la_SOURCES = xua_msg.c
# ensure that the file for the static lib is built with different C
# flags, working around automake complaining that xua_msg.o is built
# both with libtool (below) and without (here)
-libxua_a_CPPFLAGS = $(AM_CPPFLAGS) -DDUMMY -UDUMMY
+libosmo_xua_la_CPPFLAGS = ${AM_CPPFLAGS} -DDUMMY -UDUMMY
+
+libosmo_sccp_la_LIBADD = $(TALLOC_LIBS) $(LIBOSMOCORE_LIBS)
+libosmo_sccp_la_LDFLAGS = -release ${PACKAGE_VERSION}
+libosmo_mtp_la_LDFLAGS = -release ${PACKAGE_VERSION}
+libosmo_xua_la_LIBADD = $(TALLOC_LIBS) $(LIBOSMOCORE_LIBS)
+libosmo_xua_la_LDFLAGS = -release ${PACKAGE_VERSION}
# New shared lib
@@ -72,3 +78,7 @@ libosmo_sigtran_la_LIBADD = \
$(LIBOSMOCORE_LIBS) \
$(LIBSCTP_LIBS) \
$(NULL)
+
+noinst_LTLIBRARIES = libosmo-sigtran-internal.la
+libosmo_sigtran_internal_la_SOURCES = $(libosmo_sigtran_la_SOURCES)
+libosmo_sigtran_internal_la_LIBADD = $(libosmo_sigtran_la_LIBADD)
Index: libosmo-sccp-1.9.0/tests/m2ua/Makefile.am
===================================================================
--- libosmo-sccp-1.9.0.orig/tests/m2ua/Makefile.am
+++ libosmo-sccp-1.9.0/tests/m2ua/Makefile.am
@@ -6,4 +6,4 @@ EXTRA_DIST = m2ua_test.ok
check_PROGRAMS = m2ua_test
m2ua_test_SOURCES = m2ua_test.c
-m2ua_test_LDADD = $(top_builddir)/src/libxua.a $(LIBOSMOCORE_LIBS)
+m2ua_test_LDADD = $(top_builddir)/src/libosmo-xua.la $(LIBOSMOCORE_LIBS) ${TALLOC_LIBS}
Index: libosmo-sccp-1.9.0/tests/sccp/Makefile.am
===================================================================
--- libosmo-sccp-1.9.0.orig/tests/sccp/Makefile.am
+++ libosmo-sccp-1.9.0/tests/sccp/Makefile.am
@@ -1,14 +1,15 @@
AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
-AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS)
+AM_CFLAGS=-Wall -ggdb3
+AM_CPPFLAGS += $(LIBOSMOCORE_CFLAGS) ${TALLOC_CFLAGS}
AM_LDFLAGS = -no-install
EXTRA_DIST = sccp_test.ok
check_PROGRAMS = sccp_test
-sccp_test_SOURCES = sccp_test.c
+sccp_test_SOURCES = sccp_test.c ${top_srcdir}/src/sccp.c
sccp_test_LDADD = \
$(LIBOSMOCORE_LIBS) \
- $(top_builddir)/src/sccp.o \
+ ${TALLOC_LIBS} \
$(NULL)
Index: libosmo-sccp-1.9.0/tests/ss7/Makefile.am
===================================================================
--- libosmo-sccp-1.9.0.orig/tests/ss7/Makefile.am
+++ libosmo-sccp-1.9.0/tests/ss7/Makefile.am
@@ -1,7 +1,7 @@
AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS)
-AM_LDFLAGS = -static -no-install
+AM_LDFLAGS = -no-install
LDADD = $(top_builddir)/src/libosmo-sigtran.la \
$(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMONETIF_LIBS) $(LIBSCTP_LIBS)
Index: libosmo-sccp-1.9.0/tests/xua/Makefile.am
===================================================================
--- libosmo-sccp-1.9.0.orig/tests/xua/Makefile.am
+++ libosmo-sccp-1.9.0/tests/xua/Makefile.am
@@ -1,8 +1,9 @@
AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
-AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS)
+AM_CFLAGS=-Wall
+AM_CPPFLAGS += $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMONETIF_CFLAGS) $(LIBSCTP_CFLAGS)
-AM_LDFLAGS = -static -no-install
-LDADD = $(top_builddir)/src/libosmo-sigtran.la \
+AM_LDFLAGS = -no-install
+LDADD = $(top_builddir)/src/libosmo-xua.la $(top_builddir)/src/libosmo-sigtran-internal.la \
$(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMONETIF_LIBS) $(LIBSCTP_LIBS)
EXTRA_DIST = xua_test.ok xua_test.err