Package: xmltooling / 1.6.0-4+deb9u2

Propagate-requirements-into-our-pkg-config-file.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi@niif.hu>
Date: Tue, 5 Jul 2016 12:05:32 +0200
Subject: Propagate requirements into our pkg-config file

---
 Makefile.am                    |   6 -
 configure.ac                   |  12 +-
 m4/ax_create_pkgconfig_info.m4 | 349 -----------------------------------------
 m4/ax_pkg_check_modules.m4     |  69 ++++++++
 xmltooling.pc.in               |  13 ++
 5 files changed, 87 insertions(+), 362 deletions(-)
 delete mode 100644 m4/ax_create_pkgconfig_info.m4
 create mode 100644 m4/ax_pkg_check_modules.m4
 create mode 100644 xmltooling.pc.in

diff --git a/Makefile.am b/Makefile.am
index 5edea2e..89972c7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,12 +5,6 @@ include doxygen.am
 
 MOSTLYCLEANFILES = $(DX_CLEANFILES)
 
-DISTCLEANFILES = \
-	@PACKAGE_NAME@.pc \
-	@PACKAGE_NAME@.pc.in \
-	@PACKAGE_NAME@-uninstalled.pc \
-	@PACKAGE_NAME@-uninstalled.sh
-
 SUBDIRS = doc schemas @PACKAGE_NAME@ xmltoolingtest
 
 if DX_COND_doc
diff --git a/configure.ac b/configure.ac
index 78ce864..19017c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,7 @@ else
 fi
 
 AC_CONFIG_HEADERS([config.h xmltooling/config_pub.h])
-AC_CONFIG_FILES([xmltooling.spec])
+AC_CONFIG_FILES([xmltooling.pc xmltooling.spec])
 AC_CONFIG_FILES([Makefile xmltooling/Makefile xmltoolingtest/Makefile schemas/Makefile doc/Makefile])
 
 AC_PROG_CC([gcc gcc3 cc])
@@ -117,13 +117,13 @@ AC_COMPILE_IFELSE(
     [AC_LANG_PROGRAM([[#include <cstddef>]],[[const char* ptr = nullptr;]])],
     [AC_DEFINE([HAVE_NULLPTR],[1],[Define to 1 if C++ compiler supports nullptr keyword.])])
 
-PKG_CHECK_MODULES([log4shib], [log4shib],
+AX_PKG_CHECK_MODULES([log4shib],,[log4shib],
     [AC_DEFINE([XMLTOOLING_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
-    [PKG_CHECK_MODULES([log4cpp], [log4cpp],
+    [AX_PKG_CHECK_MODULES([log4cpp],,[log4cpp],
         [AC_DEFINE([XMLTOOLING_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])])])
 
 # Xerces-C v2.6.0 has bugs that inhibit use with signed XML
-PKG_CHECK_MODULES([xerces],[xerces-c != 2.6.0])
+AX_PKG_CHECK_MODULES([xerces],,[xerces-c != 2.6.0])
 AX_SAVE_FLAGS
 CPPFLAGS="$xerces_CFLAGS $CPPFLAGS"
 LIBS="$xerces_LIBS $LIBS"
@@ -173,7 +173,7 @@ AC_ARG_WITH(xmlsec,
     [with_xmlsec=check])
 
 AS_IF([test "x$with_xmlsec" != xno],
-    [PKG_CHECK_MODULES([XMLSEC],[xml-security-c >= 1.4 openssl libcurl],
+    [AX_PKG_CHECK_MODULES([XMLSEC],,[xml-security-c >= 1.4 openssl libcurl],
         [AX_SAVE_FLAGS
          CPPFLAGS="$XMLSEC_CFLAGS $CPPFLAGS"
          LIBS="$XMLSEC_LIBS $LIBS"
@@ -269,8 +269,6 @@ AC_SUBST(CXXTEST)
 AC_SUBST(CXXTESTFLAGS)
 AM_CONDITIONAL(BUILD_UNITTEST,test -f ${CXXTEST})
 
-AX_CREATE_PKGCONFIG_INFO(,,[$XMLSEC_LIBS -lxmltooling],[OpenSAML XMLTooling-C library])
-
 dnl Disabled on Debian since build log analysis wants verbose logs.
 dnl LIBTOOL="$LIBTOOL --silent"
 
diff --git a/m4/ax_create_pkgconfig_info.m4 b/m4/ax_create_pkgconfig_info.m4
deleted file mode 100644
index 60ac548..0000000
--- a/m4/ax_create_pkgconfig_info.m4
+++ /dev/null
@@ -1,349 +0,0 @@
-# ===========================================================================
-#    http://www.nongnu.org/autoconf-archive/ax_create_pkgconfig_info.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_CREATE_PKGCONFIG_INFO [(outputfile, [requires [,libs [,summary [,cflags [, ldflags]]]]])]
-#
-# DESCRIPTION
-#
-#   Defaults:
-#
-#     $1 = $PACKAGE_NAME.pc
-#     $2 = (empty)
-#     $3 = $PACKAGE_LIBS $LIBS (as set at that point in configure.ac)
-#     $4 = $PACKAGE_SUMMARY (or $1 Library)
-#     $5 = $CPPFLAGS $PACKAGE_CFLAGS (as set at the point in configure.ac)
-#     $6 = $LDFLAGS $PACKAGE_LDFLAGS (as set at the point in configure.ac)
-#
-#     PACKAGE_NAME defaults to $PACKAGE if not set.
-#     PACKAGE_LIBS defaults to -l$PACKAGE_NAME if not set.
-#
-#   The resulting file is called $PACKAGE.pc.in / $PACKAGE.pc
-#
-#   You will find this macro most useful in conjunction with
-#   ax_spec_defaults that can read good initializers from the .spec file. In
-#   consequencd, most of the generatable installable stuff can be made from
-#   information being updated in a single place for the whole project.
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-#   Copyright (c) 2008 Sven Verdoolaege <skimo@kotnet.org>
-#
-#   This program is free software; you can redistribute it and/or modify it
-#   under the terms of the GNU General Public License as published by the
-#   Free Software Foundation; either version 2 of the License, or (at your
-#   option) any later version.
-#
-#   This program is distributed in the hope that it will be useful, but
-#   WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-#   Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License along
-#   with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-#   As a special exception, the respective Autoconf Macro's copyright owner
-#   gives unlimited permission to copy, distribute and modify the configure
-#   scripts that are the output of Autoconf when processing the Macro. You
-#   need not follow the terms of the GNU General Public License when using
-#   or distributing such scripts, even though portions of the text of the
-#   Macro appear in them. The GNU General Public License (GPL) does govern
-#   all other use of the material that constitutes the Autoconf Macro.
-#
-#   This special exception to the GPL applies to versions of the Autoconf
-#   Macro released by the Autoconf Archive. When you make and distribute a
-#   modified version of the Autoconf Macro, you may extend this special
-#   exception to the GPL to apply to your modified version as well.
-
-AC_DEFUN([AX_CREATE_PKGCONFIG_INFO],[dnl
-AS_VAR_PUSHDEF([PKGCONFIG_suffix],[ax_create_pkgconfig_suffix])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_libdir],[ax_create_pkgconfig_libdir])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_libfile],[ax_create_pkgconfig_libfile])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_libname],[ax_create_pkgconfig_libname])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_version],[ax_create_pkgconfig_version])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_description],[ax_create_pkgconfig_description])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_requires],[ax_create_pkgconfig_requires])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_pkglibs],[ax_create_pkgconfig_pkglibs])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_libs],[ax_create_pkgconfig_libs])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_ldflags],[ax_create_pkgconfig_ldflags])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_cppflags],[ax_create_pkgconfig_cppflags])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_generate],[ax_create_pkgconfig_generate])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_src_libdir],[ax_create_pkgconfig_src_libdir])dnl
-AS_VAR_PUSHDEF([PKGCONFIG_src_headers],[ax_create_pkgconfig_src_headers])dnl
-
-# we need the expanded forms...
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-AC_MSG_CHECKING(our pkgconfig libname)
-test ".$PKGCONFIG_libname" != "." || \
-PKGCONFIG_libname="ifelse($1,,${PACKAGE_NAME},`basename $1 .pc`)"
-test ".$PKGCONFIG_libname" != "." || \
-PKGCONFIG_libname="$PACKAGE"
-PKGCONFIG_libname=`eval echo "$PKGCONFIG_libname"`
-PKGCONFIG_libname=`eval echo "$PKGCONFIG_libname"`
-AC_MSG_RESULT($PKGCONFIG_libname)
-
-AC_MSG_CHECKING(our pkgconfig version)
-test ".$PKGCONFIG_version" != "." || \
-PKGCONFIG_version="${PACKAGE_VERSION}"
-test ".$PKGCONFIG_version" != "." || \
-PKGCONFIG_version="$VERSION"
-PKGCONFIG_version=`eval echo "$PKGCONFIG_version"`
-PKGCONFIG_version=`eval echo "$PKGCONFIG_version"`
-AC_MSG_RESULT($PKGCONFIG_version)
-
-AC_MSG_CHECKING(our pkgconfig_libdir)
-test ".$pkgconfig_libdir" = "." && \
-pkgconfig_libdir='${libdir}/pkgconfig'
-PKGCONFIG_libdir=`eval echo "$pkgconfig_libdir"`
-PKGCONFIG_libdir=`eval echo "$PKGCONFIG_libdir"`
-PKGCONFIG_libdir=`eval echo "$PKGCONFIG_libdir"`
-AC_MSG_RESULT($pkgconfig_libdir)
-test "$pkgconfig_libdir" != "$PKGCONFIG_libdir" && (
-AC_MSG_RESULT(expanded our pkgconfig_libdir... $PKGCONFIG_libdir))
-AC_SUBST([pkgconfig_libdir])
-
-AC_MSG_CHECKING(our pkgconfig_libfile)
-test ".$pkgconfig_libfile" != "." || \
-pkgconfig_libfile="ifelse($1,,$PKGCONFIG_libname.pc,`basename $1`)"
-PKGCONFIG_libfile=`eval echo "$pkgconfig_libfile"`
-PKGCONFIG_libfile=`eval echo "$PKGCONFIG_libfile"`
-AC_MSG_RESULT($pkgconfig_libfile)
-test "$pkgconfig_libfile" != "$PKGCONFIG_libfile" && (
-AC_MSG_RESULT(expanded our pkgconfig_libfile... $PKGCONFIG_libfile))
-AC_SUBST([pkgconfig_libfile])
-
-AC_MSG_CHECKING(our package / suffix)
-PKGCONFIG_suffix="$program_suffix"
-test ".$PKGCONFIG_suffix" != .NONE || PKGCONFIG_suffix=""
-AC_MSG_RESULT(${PACKAGE_NAME} / ${PKGCONFIG_suffix})
-
-AC_MSG_CHECKING(our pkgconfig description)
-PKGCONFIG_description="ifelse($4,,$PACKAGE_SUMMARY,$4)"
-test ".$PKGCONFIG_description" != "." || \
-PKGCONFIG_description="$PKGCONFIG_libname Library"
-PKGCONFIG_description=`eval echo "$PKGCONFIG_description"`
-PKGCONFIG_description=`eval echo "$PKGCONFIG_description"`
-AC_MSG_RESULT($PKGCONFIG_description)
-
-AC_MSG_CHECKING(our pkgconfig requires)
-PKGCONFIG_requires="ifelse($2,,$PACKAGE_REQUIRES,$2)"
-PKGCONFIG_requires=`eval echo "$PKGCONFIG_requires"`
-PKGCONFIG_requires=`eval echo "$PKGCONFIG_requires"`
-AC_MSG_RESULT($PKGCONFIG_requires)
-
-AC_MSG_CHECKING(our pkgconfig ext libs)
-PKGCONFIG_pkglibs="$PACKAGE_LIBS"
-test ".$PKGCONFIG_pkglibs" != "." || PKGCONFIG_pkglibs="-l$PKGCONFIG_libname"
-PKGCONFIG_libs="ifelse($3,,$PKGCONFIG_pkglibs $LIBS,$3)"
-PKGCONFIG_libs=`eval echo "$PKGCONFIG_libs"`
-PKGCONFIG_libs=`eval echo "$PKGCONFIG_libs"`
-AC_MSG_RESULT($PKGCONFIG_libs)
-
-AC_MSG_CHECKING(our pkgconfig cppflags)
-PKGCONFIG_cppflags="ifelse($5,,$CPPFLAGS $PACKAGE_CFLAGS,$5)"
-PKGCONFIG_cppflags=`eval echo "$PKGCONFIG_cppflags"`
-PKGCONFIG_cppflags=`eval echo "$PKGCONFIG_cppflags"`
-AC_MSG_RESULT($PKGCONFIG_cppflags)
-
-AC_MSG_CHECKING(our pkgconfig ldflags)
-PKGCONFIG_ldflags="ifelse($6,,$LDFLAGS $PACKAGE_LDFLAGS,$5)"
-PKGCONFIG_ldflags=`eval echo "$PKGCONFIG_ldflags"`
-PKGCONFIG_ldflags=`eval echo "$PKGCONFIG_ldflags"`
-AC_MSG_RESULT($PKGCONFIG_ldflags)
-
-test ".$PKGCONFIG_generate" != "." || \
-PKGCONFIG_generate="ifelse($1,,$PKGCONFIG_libname.pc,$1)"
-PKGCONFIG_generate=`eval echo "$PKGCONFIG_generate"`
-PKGCONFIG_generate=`eval echo "$PKGCONFIG_generate"`
-test "$pkgconfig_libfile" != "$PKGCONFIG_generate" && (
-AC_MSG_RESULT(generate the pkgconfig later... $PKGCONFIG_generate))
-
-if test ".$PKGCONFIG_src_libdir" = "." ; then
-PKGCONFIG_src_libdir=`pwd`
-PKGCONFIG_src_libdir=`AS_DIRNAME("$PKGCONFIG_src_libdir/$PKGCONFIG_generate")`
-test ! -d $PKGCONFIG_src_libdir/src || \
-PKGCONFIG_src_libdir="$PKGCONFIG_src_libdir/src"
-case ".$objdir" in
-*libs) PKGCONFIG_src_libdir="$PKGCONFIG_src_libdir/$objdir" ;; esac
-AC_MSG_RESULT(noninstalled pkgconfig -L $PKGCONFIG_src_libdir)
-fi
-
-if test ".$PKGCONFIG_src_headers" = "." ; then
-PKGCONFIG_src_headers=`pwd`
-v="$ac_top_srcdir" ;
-test ".$v" != "." || v="$ax_spec_dir"
-test ".$v" != "." || v="$srcdir"
-case "$v" in /*) PKGCONFIG_src_headers="" ;; esac
-PKGCONFIG_src_headers=`AS_DIRNAME("$PKGCONFIG_src_headers/$v/x")`
-test ! -d $PKGCONFIG_src_headers/incl[]ude || \
-PKGCONFIG_src_headers="$PKGCONFIG_src_headers/incl[]ude"
-AC_MSG_RESULT(noninstalled pkgconfig -I $PKGCONFIG_src_headers)
-fi
-
-
-dnl AC_CONFIG_COMMANDS crap disallows to use $PKGCONFIG_libfile here...
-AC_CONFIG_COMMANDS([$ax_create_pkgconfig_generate],[
-pkgconfig_generate="$ax_create_pkgconfig_generate"
-if test ! -f "$pkgconfig_generate.in"
-then generate="true"
-elif grep ' generated by configure ' $pkgconfig_generate.in >/dev/null
-then generate="true"
-else generate="false";
-fi
-if $generate ; then
-AC_MSG_NOTICE(creating $pkgconfig_generate.in)
-cat > $pkgconfig_generate.in <<AXEOF
-# generated by configure / remove this line to disable regeneration
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-libdir=@libdir@
-datarootdir=@datarootdir@
-datadir=@datadir@
-sysconfdir=@sysconfdir@
-includedir=@includedir@
-package=@PACKAGE@
-suffix=@suffix@
-
-Name: @PACKAGE_NAME@
-Description: @PACKAGE_DESCRIPTION@
-Version: @PACKAGE_VERSION@
-Requires: @PACKAGE_REQUIRES@
-Libs: -L\${libdir} @LDFLAGS@ @LIBS@
-Cflags: -I\${includedir} @CPPFLAGS@
-AXEOF
-fi # DONE generate $pkgconfig_generate.in
-AC_MSG_NOTICE(creating $pkgconfig_generate)
-cat >conftest.sed <<AXEOF
-s|@prefix@|${pkgconfig_prefix}|
-s|@exec_prefix@|${pkgconfig_execprefix}|
-s|@bindir@|${pkgconfig_bindir}|
-s|@libdir@|${pkgconfig_libdir}|
-s|@datarootdir@|${pkgconfig_datarootdir}|
-s|@datadir@|${pkgconfig_datadir}|
-s|@sysconfdir@|${pkgconfig_sysconfdir}|
-s|@includedir@|${pkgconfig_includedir}|
-s|@suffix@|${pkgconfig_suffix}|
-s|@PACKAGE@|${pkgconfig_package}|
-s|@PACKAGE_NAME@|${pkgconfig_libname}|
-s|@PACKAGE_DESCRIPTION@|${pkgconfig_description}|
-s|@PACKAGE_VERSION@|${pkgconfig_version}|
-s|@PACKAGE_REQUIRES@|${pkgconfig_requires}|
-s|@LIBS@|${pkgconfig_libs}|
-s|@LDFLAGS@|${pkgconfig_ldflags}|
-s|@CPPFLAGS@|${pkgconfig_cppflags}|
-AXEOF
-sed -f conftest.sed  $pkgconfig_generate.in > $pkgconfig_generate
-if test ! -s $pkgconfig_generate ; then
-    AC_MSG_ERROR([$pkgconfig_generate is empty])
-fi ; rm conftest.sed # DONE generate $pkgconfig_generate
-pkgconfig_uninstalled=`echo $pkgconfig_generate |sed 's/.pc$/-uninstalled.pc/'`
-AC_MSG_NOTICE(creating $pkgconfig_uninstalled)
-cat >conftest.sed <<AXEOF
-s|@prefix@|${pkgconfig_prefix}|
-s|@exec_prefix@|${pkgconfig_execprefix}|
-s|@bindir@|${pkgconfig_bindir}|
-s|@libdir@|${pkgconfig_src_libdir}|
-s|@datarootdir@|${pkgconfig_datarootdir}|
-s|@datadir@|${pkgconfig_datadir}|
-s|@sysconfdir@|${pkgconfig_sysconfdir}|
-s|@includedir@|${pkgconfig_src_headers}|
-s|@suffix@|${pkgconfig_suffix}|
-s|@PACKAGE@|${pkgconfig_package}|
-s|@PACKAGE_NAME@|${pkgconfig_libname}|
-s|@PACKAGE_DESCRIPTION@|${pkgconfig_description}|
-s|@PACKAGE_VERSION@|${pkgconfig_version}|
-s|@PACKAGE_REQUIRES@|${pkgconfig_requires}|
-s|@LIBS@|${pkgconfig_libs}|
-s|@LDFLAGS@|${pkgconfig_ldflags}|
-s|@CPPFLAGS@|${pkgconfig_cppflags}|
-AXEOF
-sed -f conftest.sed $pkgconfig_generate.in > $pkgconfig_uninstalled
-if test ! -s $pkgconfig_uninstalled ; then
-    AC_MSG_ERROR([$pkgconfig_uninstalled is empty])
-fi ; rm conftest.sed # DONE generate $pkgconfig_uninstalled
-           pkgconfig_requires_add=`echo ${pkgconfig_requires}`
-if test ".$pkgconfig_requires_add" != "." ; then
-           pkgconfig_requires_add="pkg-config $pkgconfig_requires_add"
-    else   pkgconfig_requires_add=":" ; fi
-pkgconfig_uninstalled=`echo $pkgconfig_generate |sed 's/.pc$/-uninstalled.sh/'`
-AC_MSG_NOTICE(creating $pkgconfig_uninstalled)
-cat >conftest.sed <<AXEOF
-s|@prefix@|\"${pkgconfig_prefix}\"|
-s|@exec_prefix@|\"${pkgconfig_execprefix}\"|
-s|@bindir@|\"${pkgconfig_bindir}\"|
-s|@libdir@|\"${pkgconfig_src_libdir}\"|
-s|@datarootdir@|\"${pkgconfig_datarootdir}\"|
-s|@datadir@|\"${pkgconfig_datadir}\"|
-s|@sysconfdir@|\"${pkgconfig_sysconfdir}\"|
-s|@includedir@|\"${pkgconfig_src_headers}\"|
-s|@suffix@|\"${pkgconfig_suffix}\"|
-s|@PACKAGE@|\"${pkgconfig_package}\"|
-s|@PACKAGE_NAME@|\"${pkgconfig_libname}\"|
-s|@PACKAGE_DESCRIPTION@|\"${pkgconfig_description}\"|
-s|@PACKAGE_VERSION@|\"${pkgconfig_version}\"|
-s|@PACKAGE_REQUIRES@|\"${pkgconfig_requires}\"|
-s|@LIBS@|\"${pkgconfig_libs}\"|
-s|@LDFLAGS@|\"${pkgconfig_ldflags}\"|
-s|@CPPFLAGS@|\"${pkgconfig_cppflags}\"|
-s>Name:>for option\\; do case \"\$option\" in --list-all|--name) echo >
-s>Description: *>\\;\\; --help) pkg-config --help \\; echo Buildscript Of >
-s>Version: *>\\;\\; --modversion|--version) echo >
-s>Requires:>\\;\\; --requires) echo $pkgconfig_requires_add>
-s>Libs: *>\\;\\; --libs) echo >
-s>Cflags: *>\\;\\; --cflags) echo >
-/--libs)/a\\
-       $pkgconfig_requires_add
-/--cflags)/a\\
-       $pkgconfig_requires_add\\
-;; --variable=*) eval echo '\$'\`echo \$option | sed -e 's/.*=//'\`\\
-;; --uninstalled) exit 0 \\
-;; *) ;; esac done
-AXEOF
-sed -f conftest.sed  $pkgconfig_generate.in > $pkgconfig_uninstalled
-if test ! -s $pkgconfig_uninstalled ; then
-    AC_MSG_ERROR([$pkgconfig_uninstalled is empty])
-fi ; rm conftest.sed # DONE generate $pkgconfig_uninstalled
-],[
-dnl AC_CONFIG_COMMANDS crap, the AS_PUSHVAR defines are invalid here...
-ax_create_pkgconfig_generate="$ax_create_pkgconfig_generate"
-pkgconfig_prefix='$prefix'
-pkgconfig_execprefix='$exec_prefix'
-pkgconfig_bindir='$bindir'
-pkgconfig_libdir='$libdir'
-pkgconfig_includedir='$includedir'
-pkgconfig_datarootdir='$datarootdir'
-pkgconfig_datadir='$datadir'
-pkgconfig_sysconfdir='$sysconfdir'
-pkgconfig_suffix='$ax_create_pkgconfig_suffix'
-pkgconfig_package='$PACKAGE_NAME'
-pkgconfig_libname='$ax_create_pkgconfig_libname'
-pkgconfig_description='$ax_create_pkgconfig_description'
-pkgconfig_version='$ax_create_pkgconfig_version'
-pkgconfig_requires='$ax_create_pkgconfig_requires'
-pkgconfig_libs='$ax_create_pkgconfig_libs'
-pkgconfig_ldflags='$ax_create_pkgconfig_ldflags'
-pkgconfig_cppflags='$ax_create_pkgconfig_cppflags'
-pkgconfig_src_libdir='$ax_create_pkgconfig_src_libdir'
-pkgconfig_src_headers='$ax_create_pkgconfig_src_headers'
-])dnl
-AS_VAR_POPDEF([PKGCONFIG_suffix])dnl
-AS_VAR_POPDEF([PKGCONFIG_libdir])dnl
-AS_VAR_POPDEF([PKGCONFIG_libfile])dnl
-AS_VAR_POPDEF([PKGCONFIG_libname])dnl
-AS_VAR_POPDEF([PKGCONFIG_version])dnl
-AS_VAR_POPDEF([PKGCONFIG_description])dnl
-AS_VAR_POPDEF([PKGCONFIG_requires])dnl
-AS_VAR_POPDEF([PKGCONFIG_pkglibs])dnl
-AS_VAR_POPDEF([PKGCONFIG_libs])dnl
-AS_VAR_POPDEF([PKGCONFIG_ldflags])dnl
-AS_VAR_POPDEF([PKGCONFIG_cppflags])dnl
-AS_VAR_POPDEF([PKGCONFIG_generate])dnl
-AS_VAR_POPDEF([PKGCONFIG_src_libdir])dnl
-AS_VAR_POPDEF([PKGCONFIG_src_headers])dnl
-])
diff --git a/m4/ax_pkg_check_modules.m4 b/m4/ax_pkg_check_modules.m4
new file mode 100644
index 0000000..f3af0f6
--- /dev/null
+++ b/m4/ax_pkg_check_modules.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+#   http://www.gnu.org/software/autoconf-archive/ax_pkg_check_modules.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_PKG_CHECK_MODULES(PREFIX, PUBLIC-MODULES, PRIVATE-MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [PUBLIC-VARIABLE], [PRIVATE-VARIABLE])
+#
+# DESCRIPTION
+#
+#   A wrapper around PKG_CHECK_MODULES which splits the list of modules into
+#   public and private dependencies, and produces two variables listing the
+#   dependencies across all invocations of AX_PKG_CHECK_MODULES. These two
+#   variables are exposed via AC_SUBST, and should be used in a pkg-config
+#   file as the substituted values for Requires and Requires.private.
+#
+#   The PREFIX, PUBLIC-MODULES and PRIVATE-MODULES arguments should be
+#   specified as for PKG_CHECK_MODULES, with the concatenation of
+#   PUBLIC-MODULES and PRIVATE-MODULES equaling the LIST-OF-MODULES from
+#   PKG_CHECK_MODULES.  The ACTION-IF-FOUND and ACTION-IF-NOT-FOUND
+#   arguments are optional, and should also be specified as for
+#   PKG_CHECK_MODULES.  ACTION-IF-FOUND is evaluated if the full
+#   LIST-OF-MODULES is found; ACTION-IF-NOT-FOUND similarly.
+#
+#   PUBLIC-VARIABLE defaults to AX_PACKAGE_REQUIRES, and PRIVATE-VARIABLE
+#   defaults to AX_PACKAGE_REQUIRES_PRIVATE.  Both variables are AC_SUBST-ed
+#   by this macro.
+#
+#   For example:
+#
+#     AX_PKG_CHECK_MODULES([GLIB],[glib-2.0 gio-2.0],[gthread-2.0])
+#     AX_PKG_CHECK_MODULES([DBUS],[],[dbus-glib-1 >= 0.98 dbus-1])
+#
+#   results in the substitutions:
+#
+#     AX_PACKAGE_REQUIRES="glib-2.0 gio-2.0"
+#     AX_PACKAGE_REQUIRES_PRIVATE="gthread-2.0 dbus-glib-1 >= 0.98 dbus-1"
+#
+#   and can be used with a template pkg-config file (.pc.in) using:
+#
+#     Requires: @AX_PACKAGE_REQUIRES@
+#     Requires.private: @AX_PACKAGE_REQUIRES_PRIVATE@
+#
+# LICENSE
+#
+#   Copyright (c) 2014 Philip Withnall <philip@tecnocode.co.uk>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.  This file is offered as-is, without any
+#   warranty.
+
+#serial 2
+
+AC_DEFUN([AX_PKG_CHECK_MODULES],[
+    m4_define([ax_package_requires],
+              [m4_default_quoted([$6],[AX_PACKAGE_REQUIRES])])
+    m4_define([ax_package_requires_private],
+              [m4_default_quoted([$7],[AX_PACKAGE_REQUIRES_PRIVATE])])
+
+    ax_package_requires="$[]ax_package_requires $2"
+    ax_package_requires_private="$[]ax_package_requires_private $3"
+
+    PKG_CHECK_MODULES([$1],[$2 $3],[$4],[$5])
+
+    # Substitute output.
+    AC_SUBST(ax_package_requires)
+    AC_SUBST(ax_package_requires_private)
+])dnl AX_PKG_CHECK_MODULES
diff --git a/xmltooling.pc.in b/xmltooling.pc.in
new file mode 100644
index 0000000..e5dd983
--- /dev/null
+++ b/xmltooling.pc.in
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE_NAME@
+Description: OpenSAML XMLTooling-C library
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lxmltooling
+Libs.private: @LIBS@
+Cflags: -I${includedir} @BOOST_CPPFLAGS@
+Requires: @AX_PACKAGE_REQUIRES@
+Requires.private: @AX_PACKAGE_REQUIRES_PRIVATE@