Start using pkg-config / pkgconf.

This commit is contained in:
Dag-Erling Smørgrav 2017-03-07 01:33:16 +01:00
parent b87e7e57c9
commit 910b02c3d4
4 changed files with 27 additions and 36 deletions

View File

@ -39,6 +39,10 @@ AC_TYPE_UINTPTR_T
LT_PREREQ([2.2.6])
LT_INIT()
# pkg-config
PKG_PROG_PKG_CONFIG
PKG_INSTALLDIR
# other programs
AC_PROG_INSTALL
@ -76,40 +80,13 @@ AC_CHECK_FUNCS([wcslcat wcslcmp wcslcpy])
# Extra libraries
#
# cryb-core
save_LIBS="${LIBS}"
LIBS=""
AC_SEARCH_LIBS([cryb_core_version], [cryb-core], [
CRYB_CORE_LIBS="${LIBS}"
], [
AC_MSG_ERROR([cryb-core library not found])
])
LIBS="${save_LIBS}"
AC_SUBST(CRYB_CORE_LIBS)
# cryb-oath
save_LIBS="${LIBS}"
LIBS=""
AC_SEARCH_LIBS([cryb_oath_version], [cryb-oath], [
CRYB_OATH_LIBS="${LIBS}"
], [
AC_MSG_ERROR([cryb-oath library not found])
])
LIBS="${save_LIBS}"
AC_SUBST(CRYB_OATH_LIBS)
# cryb-test
save_LIBS="${LIBS}"
LIBS=""
AC_SEARCH_LIBS([cryb_test_version], [cryb-test], [
CRYB_TEST_LIBS="${LIBS}"
], [
CRYB_TEST_LIBS=""
AC_MSG_WARN([cryb-test library not found, unit tests disabled])
])
LIBS="${save_LIBS}"
AC_SUBST(CRYB_TEST_LIBS)
AM_CONDITIONAL([WITH_CRYB_TEST], [ test x"$CRYB_TEST_LIBS" != x"" ])
# Cryb.to components
PKG_HAVE_WITH_MODULES([CRYB_CORE], [cryb-core],
[Cryb.to core utilities])
PKG_HAVE_WITH_MODULES([CRYB_OATH], [cryb-oath],
[Cryb.to Open Authentication primitives])
PKG_HAVE_WITH_MODULES([CRYB_TEST], [cryb-test],
[Cryb.to test framework])
# libpam
save_LIBS="${LIBS}"
@ -248,6 +225,7 @@ AC_CONFIG_FILES([
include/cryb/Makefile
lib/Makefile
lib/otp/Makefile
lib/otp/cryb-otp.pc
pam/Makefile
pam/pam_otp/Makefile
libexec/Makefile

View File

@ -9,3 +9,5 @@ libcryb_otp_la_SOURCES = \
libcryb_otp_la_LIBADD = \
$(CRYB_CORE_LIBS) \
$(CRYB_OATH_LIBS)
pkgconfig_DATA = cryb-otp.pc

11
lib/otp/cryb-otp.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@
libdir=@libdir@
Name: cryb-otp
Description: Cryb.to one-time password library
Version: @PACKAGE_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lcryb-otp
Requires.private: cryb-core cryb-oath

View File

@ -2,7 +2,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include
EXTRA_DIST =
if WITH_CRYB_TEST
if HAVE_CRYB_TEST
libotp = $(top_builddir)/lib/otp/libcryb-otp.la
@ -25,4 +25,4 @@ endif OTP_LIB
check_PROGRAMS = $(TESTS)
endif WITH_CRYB_TEST
endif HAVE_CRYB_TEST