From: Mark Wooding Date: Mon, 17 Mar 2008 18:48:12 +0000 (+0000) Subject: Infrastructure: Switch over to pkg-config. X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/commitdiff_plain/4263ac2bc343215f89247e0bc7314ce986dc743d Infrastructure: Switch over to pkg-config. --- diff --git a/Makefile.m4 b/Makefile.m4 index 812d210..e85d17c 100644 --- a/Makefile.m4 +++ b/Makefile.m4 @@ -107,7 +107,7 @@ primetab.c: genprimes$(EXEEXT) wheel.h: wheel.c wheel.c: genwheel$(EXEEXT) ./genwheel -h wheel.h -c wheel.c \ - -s CATACOMB_WHEEL_H -n 5 + -s CATACOMB_WHEEL_H -n 5 \ -t "unsigned char" -i wheel archinclude_HEADERS = mptypes.h mplimits.h @@ -163,7 +163,8 @@ BUILT_SOURCES = \ lib_LTLIBRARIES = libcatacomb.la -libcatacomb_la_LDFLAGS = -version-info 3:0:1 +libcatacomb_la_LIBADD = $(CATACOMB_LIBS) +libcatacomb_la_LDFLAGS = -version-info 3:1:1 ## Middle number is the patchlevel. Final number is the minor version. The ## difference between the first and last numbers is major version. @@ -277,7 +278,8 @@ bin_PROGRAMS = \ dsig key pixie cookie rspit factorial hashsum mkphrase \ catcrypt catsign noinst_LIBRARIES = libcatcrypt.a -bin_SCRIPTS = catacomb-config xpixie +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = catacomb.pc noinst_PROGRAMS = \ genprimes genwheel mptypes genlimits serpent-check bittest mpdump \ perftest \ @@ -303,7 +305,7 @@ rspit_SOURCES = rspit.c factorial_SOURCES = factorial.c perftest_SOURCES = perftest.c pixie_SOURCES = pixie.c pixie-common.c lmem.c arena.c passphrase.c -pixie_LDADD = +pixie_LDADD = $(PIXIE_LIBS) pixie_CFLAGS = $(AM_CFLAGS) mkphrase_SOURCES = mkphrase.c bittest_SOURCES = bittest.c diff --git a/catacomb.pc.in b/catacomb.pc.in new file mode 100644 index 0000000..c0337f3 --- /dev/null +++ b/catacomb.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Catacomb +Description: Cryptographic library +Version: @VERSION@ + +Requires: mLib >= 2.0.4 +Libs: -L${libdir} -lcatacomb +Libs.private: @CATACOMB_LIBS@ +Cflags: -I${includedir} -I${libdir}/catacomb/include diff --git a/configure.in b/configure.in index f8457bf..30c2816 100644 --- a/configure.in +++ b/configure.in @@ -29,14 +29,14 @@ dnl MA 02111-1307, USA. dnl --- Boring boilerplate --- AC_INIT(blkc.h) -mdw_INIT_LIB(catacomb, Catacomb, 2.1.0) +AM_INIT_AUTOMAKE(catacomb, 2.1.1) AM_CONFIG_HEADER(config.h) dnl --- Make sure I can compile and build libraries --- AC_PROG_CC AM_PROG_LIBTOOL -mdw_GCC_FLAGS +AX_CFLAGS_WARN_ALL AC_PROG_YACC @@ -47,16 +47,18 @@ AC_HEADER_STDC dnl --- Check for various important system types --- -AC_TYPE_PID_T -AC_TYPE_SIZE_T +AC_CHECK_TYPE(pid_t, int) +AC_CHECK_TYPE(size_t, unsigned) AC_TYPE_UID_T AC_CHECK_TYPE(time_t, long) -mdw_TYPE_SSIZE_T +AC_CHECK_TYPE(ssize_t, int) dnl --- The maths library, for Maurer's test --- -mdw_CHECK_MANYLIBS(log, m,,, [#include ], [2]) -mdw_CHECK_MANYLIBS(sqrt, m,,, [#include ], [2]) +OLIBS=$LIBS +AC_SEARCH_LIBS(log, m) +AC_SEARCH_LIBS(sqrt, m) +AC_SUBST([CATACOMB_LIBS], [$LIBS]) LIBS=$OLIBS dnl --- Functions used for noise-gathering --- @@ -81,7 +83,9 @@ fi dnl --- Support for the passphrase pixie --- -mdw_CHECK_MANYLIBS(socket, socket) +OLIBS=$LIBS +AC_SEARCH_LIBS(socket, socket) +AC_SUBST([PIXIE_LIBS], [$LIBS]) LIBS=$OLIBS AC_CHECK_FUNCS(mlock) dnl --- Debugging things --- @@ -102,8 +106,10 @@ AC_ARG_ENABLE([mpw], dnl --- Done --- -mdw_MLIB(2.0.0) -AC_OUTPUT(Makefile tests/Makefile catacomb-config:lib-config.in qcc, +PKG_CHECK_MODULES(mLib, mLib >= 2.0.4) +CFLAGS="$CFLAGS $mLib_CFLAGS" +LIBS="$LIBS $mLib_LIBS" +AC_OUTPUT(Makefile tests/Makefile catacomb.pc qcc, chmod 755 qcc) dnl ----- That's all, folks ------------------------------------------------- diff --git a/debian/changelog b/debian/changelog index ce65b69..679f0ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +catacomb (2.1.1) experimental; urgency=low + + * Do configuration through pkgconfig. + + -- Mark Wooding Mon, 17 Mar 2008 18:36:30 +0000 + catacomb (2.1.0) experimental; urgency=low * Added support for elliptic curves, on both prime and binary fields diff --git a/debian/rules b/debian/rules index ec53299..00d76e4 100755 --- a/debian/rules +++ b/debian/rules @@ -21,6 +21,7 @@ install: build mv debian/catacomb2/usr/include debian/catacomb-dev/usr mkdir -p debian/catacomb-dev/usr/lib mv debian/catacomb2/usr/lib/catacomb debian/catacomb-dev/usr/lib + mv debian/catacomb2/usr/lib/pkgconfig debian/catacomb-dev/usr/lib mv debian/catacomb2/usr/lib/*.a debian/catacomb-dev/usr/lib mv debian/catacomb2/usr/lib/*.so debian/catacomb-dev/usr/lib mv debian/catacomb2/usr/lib/*.la debian/catacomb-dev/usr/lib