[PATCH 2/4] [libosmo-sccp] src: remove our own copy of talloc

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/.

pablo at gnumonks.org pablo at gnumonks.org
Tue Jun 14 17:14:50 UTC 2011


From: Pablo Neira Ayuso <pablo at gnumonks.org>

With this patch, we check for the libtalloc version installed
in the system.

This patch also replaces all references to:

#include <osmocom/core/talloc.h>

by:

#include <talloc.h>

I did this with this command:
find ./ -type f -exec sed -i "s/osmocom\/core\/talloc.h/talloc.h/g" {} \;

Make sure you skip .git directory in this replacement, otherwise you'll
get a corrupted git repository.
---
 configure.ac    |    1 +
 src/Makefile.am |    4 ++++
 src/m2ua_msg.c  |    2 +-
 src/sccp.c      |    2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index b16b1f3..b2ae81a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,6 +15,7 @@ AC_PROG_INSTALL
 AC_PROG_RANLIB
 
 PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0)
+PKG_CHECK_MODULES([LIBTALLOC], [talloc >= 2.0.1])
 
 # The following test is taken from WebKit's webkit.m4
 saved_CFLAGS="$CFLAGS"
diff --git a/src/Makefile.am b/src/Makefile.am
index c7451ad..59d511d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,6 +4,10 @@ AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS)
 sccpdir = $(libdir)
 sccp_LIBRARIES = libsccp.a libmtp.a libm2ua.a
 
+libsccp_la_LIBADD = ${LIBTALLOC_LIBS}
+libmtp_la_LIBADD = ${LIBTALLOC_LIBS}
+libm2ua_la_LIBADD = ${LIBTALLOC_LIBS}
+
 libsccp_a_SOURCES = sccp.c
 libmtp_a_SOURCES = mtp_pcap.c 
 libm2ua_a_SOURCES = m2ua_msg.c
diff --git a/src/m2ua_msg.c b/src/m2ua_msg.c
index c04586f..6156a71 100644
--- a/src/m2ua_msg.c
+++ b/src/m2ua_msg.c
@@ -20,7 +20,7 @@
 
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/logging.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
 
 #include <arpa/inet.h>
 
diff --git a/src/sccp.c b/src/sccp.c
index e061d37..9af36fb 100644
--- a/src/sccp.c
+++ b/src/sccp.c
@@ -25,7 +25,7 @@
 #include <string.h>
 
 #include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
 #include <osmocom/core/logging.h>
 #include <osmocom/gsm/tlv.h>
 
-- 
1.7.2.5





More information about the OpenBSC mailing list