Hi,
While I was playing around with openbsc project I noticed that the
libosmo-sccp libraries are built as a static libraries only and I decided that
it will be useful to build them as shared objects too.
I also enabled colored output of the test suite and ignore all tag files that
are generated by the Makefiles.
Cheers
Vasil Velichckov (3):
Build shared objects with libtool
Enable colored test results by default
Ignore the tag files that are generated by Makefile
.gitignore | 9 +++++++++
configure.ac | 2 +-
src/Makefile.am | 18 +++++++++++++-----
tests/m2ua/Makefile.am | 2 +-
tests/sccp/Makefile.am | 4 ++--
tests/testsuite.at | 1 +
6 files changed, 27 insertions(+), 9 deletions(-)
--
1.7.10.4
Show replies by date
Convert static libraries to shared objects.
Link the test programs to the shared objects
---
.gitignore | 5 +++++
configure.ac | 2 +-
src/Makefile.am | 18 +++++++++++++-----
tests/m2ua/Makefile.am | 2 +-
tests/sccp/Makefile.am | 4 ++--
5 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/.gitignore b/.gitignore
index 65fb1ef..1bb2d00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,9 @@
*.o
*.a
+*.la
+*.lo
.deps
+.libs
Makefile
Makefile.in
bscconfig.h
@@ -23,6 +26,8 @@ depcomp
install-sh
missing
stamp-h1
+libtool
+ltmain.sh
# git-version-gen magic
.tarball-version
diff --git a/configure.ac b/configure.ac
index 98a6b1f..9dea792 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,7 +13,7 @@ dnl checks for programs
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
-AC_PROG_RANLIB
+LT_INIT
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0)
diff --git a/src/Makefile.am b/src/Makefile.am
index 584c3bd..0c29085 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,9 +1,17 @@
+# This is _NOT_ the library release version, it's an API version.
+# Please read Chapter 6 "Library interface versions" of the libtool
documentation before making any modification
+LIBVERSION=1:0:0
+
AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS)
-sccpdir = $(libdir)
-sccp_LIBRARIES = libsccp.a libmtp.a libm2ua.a
+lib_LTLIBRARIES = libsccp.la libmtp.la libm2ua.la
+
+libsccp_la_SOURCES = sccp.c
+libsccp_la_LDFLAGS = -version-info $(LIBVERSION) $(LIBOSMOCORE_LDFLAGS) -no-undefined
+
+libmtp_la_SOURCES = mtp_pcap.c
+libmtp_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined
-libsccp_a_SOURCES = sccp.c
-libmtp_a_SOURCES = mtp_pcap.c
-libm2ua_a_SOURCES = m2ua_msg.c
+libm2ua_la_SOURCES = m2ua_msg.c
+libm2ua_la_LDFLAGS = -version-info $(LIBVERSION) $(LIBOSMOCORE_LDFLAGS) -no-undefined
diff --git a/tests/m2ua/Makefile.am b/tests/m2ua/Makefile.am
index 7299e9b..128fc68 100644
--- a/tests/m2ua/Makefile.am
+++ b/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/libm2ua.a $(LIBOSMOCORE_LIBS)
+m2ua_test_LDADD = $(top_builddir)/src/libm2ua.la $(LIBOSMOCORE_LIBS)
diff --git a/tests/sccp/Makefile.am b/tests/sccp/Makefile.am
index 8cce20c..7c4cb20 100644
--- a/tests/sccp/Makefile.am
+++ b/tests/sccp/Makefile.am
@@ -5,6 +5,6 @@ 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_SOURCES = sccp_test.c
+sccp_test_LDADD = $(top_builddir)/src/libsccp.la $(LIBOSMOCORE_LIBS)
--
1.7.10.4
---
tests/testsuite.at | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 8907ffa..d040907 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -1,5 +1,6 @@
AT_INIT
AT_BANNER([Regression tests.])
+AT_COLOR_TESTS
AT_SETUP([m2ua])
AT_KEYWORDS([m2ua])
--
1.7.10.4
Tag files are generated by Makefile tags and ctags targets
make tags
make ctags
---
.gitignore | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.gitignore b/.gitignore
index 1bb2d00..8196f74 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,3 +65,7 @@ tests/testsuite.log
*.pc
config.*
+
+# Tag files
+tags
+TAGS
--
1.7.10.4