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

112 lines
4.0 KiB
Diff
Raw Normal View History

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
Require osmogsm in configure.ac, because source code depends on it.
Find and use system talloc, do not rely on OSMO's bundled copy.
Rename libmtp to libosmo-mtp, as libmtp is already used by the
Multimedia Transfer Protocol library.
---
configure.ac | 3 ++-
libosmo-mtp.pc.in | 2 +-
libosmo-sccp.pc.in | 2 +-
src/Makefile.am | 14 +++++++++-----
tests/m2ua/Makefile.am | 2 +-
tests/sccp/Makefile.am | 4 ++--
6 files changed, 16 insertions(+), 11 deletions(-)
Index: libosmo-sccp/configure.ac
===================================================================
--- libosmo-sccp.orig/configure.ac
+++ libosmo-sccp/configure.ac
@@ -14,8 +14,9 @@ AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
LT_INIT
-AC_PROG_LIBTOOL
+PKG_CHECK_MODULES([LIBOSMOGSM], [libosmogsm])
+PKG_CHECK_MODULES([TALLOC], [talloc])
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0)
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.6)
Index: libosmo-sccp/libosmo-mtp.pc.in
===================================================================
--- libosmo-sccp.orig/libosmo-mtp.pc.in
+++ libosmo-sccp/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/libosmo-sccp.pc.in
===================================================================
--- libosmo-sccp.orig/libosmo-sccp.pc.in
+++ libosmo-sccp/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/src/Makefile.am
===================================================================
--- libosmo-sccp.orig/src/Makefile.am
+++ libosmo-sccp/src/Makefile.am
@@ -4,15 +4,19 @@ AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(
# 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_LDFLAGS = -release ${PACKAGE_VERSION}
+libosmo_mtp_la_LDFLAGS = -release ${PACKAGE_VERSION}
+libosmo_xua_la_LDFLAGS = -release ${PACKAGE_VERSION}
# New shared lib
Index: libosmo-sccp/tests/m2ua/Makefile.am
===================================================================
--- libosmo-sccp.orig/tests/m2ua/Makefile.am
+++ libosmo-sccp/tests/m2ua/Makefile.am
@@ -5,4 +5,4 @@ EXTRA_DIST = m2ua_test.ok
noinst_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/tests/sccp/Makefile.am
===================================================================
--- libosmo-sccp.orig/tests/sccp/Makefile.am
+++ libosmo-sccp/tests/sccp/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include ${TALLOC_CFLAGS}
AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS)
EXTRA_DIST = sccp_test.ok
@@ -6,5 +6,5 @@ EXTRA_DIST = sccp_test.ok
noinst_PROGRAMS = sccp_test
sccp_test_SOURCES = sccp_test.c $(top_srcdir)/src/sccp.c
-sccp_test_LDADD = $(LIBOSMOCORE_LIBS)
+sccp_test_LDADD = $(LIBOSMOCORE_LIBS) ${TALLOC_LIBS}