Package: xmltooling / 1.6.0-4+deb9u2

Finish-separating-flags-use-_LIBADD.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi@niif.hu>
Date: Wed, 6 Jul 2016 09:06:09 +0200
Subject: Finish separating flags, use _LIBADD

---
 configure.ac           | 12 ++++++++----
 xmltooling.pc.in       |  4 ++--
 xmltooling/Makefile.am | 14 ++++++++------
 3 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index 05ed466..63b4c3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,7 +71,11 @@ AC_TYPE_SIZE_T
 # Checks for library functions.
 AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r strcasecmp])
 AC_CHECK_HEADERS([dlfcn.h])
+AX_SAVE_FLAGS
+LIBS=""
 AC_SEARCH_LIBS([dlopen],[dl],,[AC_MSG_ERROR([cannot find dlopen() function])])
+AC_SUBST([dlopen_LIBS],[$LIBS])
+AX_RESTORE_FLAGS
 
 # checks for pthreads
 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
@@ -79,13 +83,14 @@ if test $enable_threads != "pthread"; then
     AC_MSG_ERROR([unable to find pthreads, currently this is required])
 else
     AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])
-	AM_CONDITIONAL(BUILD_PTHREAD,test "$enable_threads" = "pthread")
+    AX_SAVE_FLAGS
     LIBS="$PTHREAD_LIBS $LIBS"
     CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
-    CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
+    AC_CHECK_FUNCS([pthread_rwlock_init])
+    AX_RESTORE_FLAGS
 fi
 
-AC_CHECK_FUNCS([pthread_rwlock_init])
+AM_CONDITIONAL(BUILD_PTHREAD,test "$enable_threads" = "pthread")
 
 AC_LANG([C++])
 
@@ -102,7 +107,6 @@ BOOST_POINTER_CONTAINER
 BOOST_SMART_PTR
 BOOST_STRING_ALGO
 BOOST_TOKENIZER
-CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
 
 # are covariant methods allowed?
 AC_LINK_IFELSE(
diff --git a/xmltooling.pc.in b/xmltooling.pc.in
index a289acd..d4a4ea7 100644
--- a/xmltooling.pc.in
+++ b/xmltooling.pc.in
@@ -9,7 +9,7 @@ Name: @PACKAGE_NAME@
 Description: OpenSAML XMLTooling-C library
 Version: @PACKAGE_VERSION@
 Libs: -L${libdir} -lxmltooling
-Libs.private: @LIBS@
-Cflags: -I${includedir} @BOOST_CPPFLAGS@
+Libs.private: @dlopen_LIBS@ @PTHREAD_LIBS@
+Cflags: -I${includedir} @BOOST_CPPFLAGS@ @PTHREAD_CFLAGS@
 Requires: @AX_PACKAGE_REQUIRES@
 Requires.private: @AX_PACKAGE_REQUIRES_PRIVATE@
diff --git a/xmltooling/Makefile.am b/xmltooling/Makefile.am
index 321e451..5842d60 100644
--- a/xmltooling/Makefile.am
+++ b/xmltooling/Makefile.am
@@ -203,20 +203,22 @@ common_sources = \
 	validation/ValidatorSuite.cpp \
 	$(thread_sources)
 
+common_CPPFLAGS = $(xerces_CFLAGS) $(log4shib_CFLAGS) $(log4cpp_CFLAGS) $(PTHREAD_CFLAGS) $(BOOST_CPPFLAGS)
+common_LIBADD   = $(xerces_LIBS)   $(log4shib_LIBS)   $(log4cpp_LIBS)   $(PTHREAD_LIBS)   $(dlopen_LIBS)
+
 libxmltooling_lite_la_SOURCES = \
 	${common_sources}
-libxmltooling_lite_la_CPPFLAGS = -DXMLTOOLING_LITE
-libxmltooling_lite_la_LDFLAGS  = -version-info 7:0:0
-libxmltooling_lite_la_CPPFLAGS += $(xerces_CFLAGS) $(log4shib_CFLAGS) $(log4cpp_CFLAGS)
-libxmltooling_lite_la_LDFLAGS  += $(xerces_LIBS)   $(log4shib_LIBS)   $(log4cpp_LIBS)
+libxmltooling_lite_la_CPPFLAGS = -DXMLTOOLING_LITE $(common_CPPFLAGS)
+libxmltooling_lite_la_LDFLAGS = -version-info 7:0:0
+libxmltooling_lite_la_LIBADD = $(common_LIBADD)
 
 if BUILD_XMLSEC
 libxmltooling_la_SOURCES = \
 	${common_sources} \
 	${xmlsec_sources}
 libxmltooling_la_LDFLAGS = -version-info 7:0:0
-libxmltooling_la_CPPFLAGS = $(XMLSEC_CFLAGS) $(xerces_CFLAGS) $(log4shib_CFLAGS) $(log4cpp_CFLAGS)
-libxmltooling_la_LDFLAGS += $(XMLSEC_LIBS)   $(xerces_LIBS)   $(log4shib_LIBS)   $(log4cpp_LIBS)
+libxmltooling_la_CPPFLAGS = $(XMLSEC_CFLAGS) $(common_CPPFLAGS)
+libxmltooling_la_LIBADD   = $(XMLSEC_LIBS)   $(common_LIBADD)
 endif
 
 install-exec-hook: