From 80fe1806941d555433f3a1c97ab116dd281041e0 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 17 Feb 2011 22:24:16 +0100 Subject: Add a proper pkg-config file. --- .gitignore | 2 ++ configure.ac | 25 ++++++++++++++----------- module/Makefile.am | 10 +++++----- module/p11-kit.pc.in | 17 +++++++++++++++++ 4 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 module/p11-kit.pc.in diff --git a/.gitignore b/.gitignore index a4de919..3972c50 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,8 @@ missing stamp-h1 temp.txt +/module/p11-kit.pc + /tests/coverage /tests/coverage.info /tests/hash-test diff --git a/configure.ac b/configure.ac index 079a2c0..dcb6a23 100644 --- a/configure.ac +++ b/configure.ac @@ -29,20 +29,22 @@ dnl Checks for typedefs, structures, and compiler characteristics. AC_CHECK_MEMBERS([struct dirent.d_type],,,[#include ]) # -------------------------------------------------------------------- -# PAM Module Directory +# PKCS#11 Directories -AC_ARG_WITH([pkcs11-dir], - [AC_HELP_STRING([--with-pkcs11-dir=DIR], - [directory which holds pkcs11 modules])], - [], [with_pkcs11_dir='${libdir}/pkcs11']) -PKCS11_MODULE_PATH="$with_pkcs11_dir" -AC_SUBST(PKCS11_MODULE_PATH) +p11_system_conf="$sysconfdir/pkcs11/pkcs11.conf" +p11_system_modules="$sysconfdir/pkcs11/modules" +p11_user_conf="~/.pkcs11/pkcs11.conf" +p11_user_modules="~/.pkcs11/modules" -AM_CONDITIONAL(WITH_PAM, test "$have_pam" = "yes") +AC_DEFINE_UNQUOTED(P11_SYSTEM_CONF, "$p11_system_conf", [System configuration file]) +AC_DEFINE_UNQUOTED(P11_SYSTEM_MODULES, "$p11_system_modules", [System modules dir]) +AC_DEFINE_UNQUOTED(P11_USER_CONF, "$p11_user_conf", [User configuration file]) +AC_DEFINE_UNQUOTED(P11_USER_MODULES, "$p11_user_modules", [User modules dir]) -if test "$have_pam" = "yes"; then - pam_status="yes ($with_pam_dir)" -fi +AC_SUBST(p11_system_conf) +AC_SUBST(p11_system_modules) +AC_SUBST(p11_user_conf) +AC_SUBST(p11_user_modules) # -------------------------------------------------------------------- # Warnings to show if using GCC @@ -130,6 +132,7 @@ fi AC_CONFIG_FILES([Makefile module/Makefile + module/p11-kit.pc tests/Makefile ]) AC_OUTPUT diff --git a/module/Makefile.am b/module/Makefile.am index 6103485..23589d2 100644 --- a/module/Makefile.am +++ b/module/Makefile.am @@ -1,8 +1,4 @@ -INCLUDES = \ - -DPKCS11_CONFIG_FILE=\"$(sysconfdir)/pkcs11.conf\" \ - -DPKCS11_CONFIG_LIBS=\"$(sysconfdir)/pkcs11/libs\" - MODULE_SRCS = \ conf.c conf.h \ hash.c hash.h \ @@ -26,5 +22,9 @@ libp11_kit_testable_la_LDFLAGS = \ libp11_kit_testable_la_SOURCES = $(MODULE_SRCS) +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = p11-kit.pc + EXTRA_DIST = \ - pkcs11.h \ No newline at end of file + pkcs11.h \ + p11-kit.pc.in \ No newline at end of file diff --git a/module/p11-kit.pc.in b/module/p11-kit.pc.in new file mode 100644 index 0000000..d80167e --- /dev/null +++ b/module/p11-kit.pc.in @@ -0,0 +1,17 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +datarootdir=@datarootdir@ +datadir=@datadir@ +sysconfdir=@sysconfdir@ +p11_system_conf=@p11_system_conf@ +p11_system_modules=@p11_system_modules@ +p11_user_conf=@p11_user_conf@ +p11_user_modules=@p11_user_modules@ + +Name: p11-kit +Description: Library and proxy module for properly loading and sharing PKCS#11 modules. +Version: @VERSION@ +Libs: -L${libdir} -lp11-kit +Cflags: -I${includedir}/p11-kit -- cgit v1.2.3