File 0001-build-fixes.patch of Package libosmo-sigtran
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.
Fix this link error too:
[ 12s] libtool: link: gcc -Wall -I/usr/include/libosmo-netif/
-I/usr/include/libosmocore/ -I/usr/include/libmnl -I/usr/include/libosmocore/
-I/usr/include/libmnl -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
-fstack-clash-protection -Werror=return-type -g -fcommon -std=gnu11 -Wall -o
xua_test xua_test.o sccp_test_data.o ../../src/.libs/libosmo-sigtran.so
-losmogsm -losmoisdn -losmovty -losmocore -ltalloc -lmnl -losmonetif -lsctp
-pthread -Wl,-rpath
-Wl,/home/abuild/rpmbuild/BUILD/libosmo-sigtran-2.1.0-build/libosmo-sigtran-2.1.0/src/.libs
-Wl,-rpath -Wl,/usr/lib64
[ 12s] /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: xua_test.o: warning: relocation against `xua_dialect_sua' in read-only section `.text.startup'
[ 12s] /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: xua_test.o: in function `test_helpers':
[ 12s] /home/abuild/rpmbuild/BUILD/libosmo-sigtran-2.1.0-build/libosmo-sigtran-2.1.0/tests/xua/xua_test.c:339:(.text.startup+0x271): undefined reference to `xua_part_add_gt'
---
configure.ac | 1 +
src/Makefile.am | 10 ++++++----
tests/m2ua/Makefile.am | 2 +-
tests/ss7/Makefile.am | 2 +-
tests/xua/Makefile.am | 2 +-
5 files changed, 10 insertions(+), 7 deletions(-)
Index: libosmo-sigtran-2.2.1/configure.ac
===================================================================
--- libosmo-sigtran-2.2.1.orig/configure.ac
+++ libosmo-sigtran-2.2.1/configure.ac
@@ -66,6 +66,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-sigtran-2.2.1/src/Makefile.am
===================================================================
--- libosmo-sigtran-2.2.1.orig/src/Makefile.am
+++ libosmo-sigtran-2.2.1/src/Makefile.am
@@ -35,13 +35,11 @@ noinst_HEADERS = \
xua_types.h \
$(NULL)
-noinst_LIBRARIES = libxua.a
-
-libxua_a_SOURCES = xua_msg.c
+libxua_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
+libxua_la_CPPFLAGS = $(AM_CPPFLAGS) -DDUMMY -UDUMMY
lib_LTLIBRARIES = libosmo-sigtran.la
@@ -122,3 +120,7 @@ libosmo_sigtran_la_LIBADD += \
$(LIBOSMOASN1TCAP_LIBS) \
$(NULL)
endif
+
+noinst_LTLIBRARIES = libxua.la libosmo-sigtran-internal.la
+libosmo_sigtran_internal_la_SOURCES = ${libosmo_sigtran_la_SOURCES}
+libosmo_sigtran_internal_la_LIBADD = ${libosmo_sigtran_la_LIBADD}
Index: libosmo-sigtran-2.2.1/tests/m2ua/Makefile.am
===================================================================
--- libosmo-sigtran-2.2.1.orig/tests/m2ua/Makefile.am
+++ libosmo-sigtran-2.2.1/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/libxua.la $(LIBOSMOCORE_LIBS) ${TALLOC_LIBS}
Index: libosmo-sigtran-2.2.1/tests/ss7/Makefile.am
===================================================================
--- libosmo-sigtran-2.2.1.orig/tests/ss7/Makefile.am
+++ libosmo-sigtran-2.2.1/tests/ss7/Makefile.am
@@ -2,7 +2,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_sr
AM_CFLAGS=-Wall $(LIBOSMONETIF_CFLAGS) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS)
AM_LDFLAGS = -no-install
-LDADD = $(top_builddir)/src/.libs/libosmo-sigtran.a \
+LDADD = $(top_builddir)/src/libosmo-sigtran.la \
$(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMONETIF_LIBS) $(LIBSCTP_LIBS)
if BUILD_WITH_TCAP_LOADSHARING
Index: libosmo-sigtran-2.2.1/tests/xua/Makefile.am
===================================================================
--- libosmo-sigtran-2.2.1.orig/tests/xua/Makefile.am
+++ libosmo-sigtran-2.2.1/tests/xua/Makefile.am
@@ -2,7 +2,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_sr
AM_CFLAGS=-Wall $(LIBOSMONETIF_CFLAGS) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS)
AM_LDFLAGS = -no-install
-LDADD = $(top_builddir)/src/.libs/libosmo-sigtran.a \
+LDADD = $(top_builddir)/src/libosmo-sigtran.la \
$(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMONETIF_LIBS) $(LIBSCTP_LIBS)
if BUILD_WITH_TCAP_LOADSHARING
LDADD += $(LIBOSMOASN1TCAP_LIBS)