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_PREREQ([2.2.6])
LT_INIT() LT_INIT()
# pkg-config
PKG_PROG_PKG_CONFIG
PKG_INSTALLDIR
# other programs # other programs
AC_PROG_INSTALL AC_PROG_INSTALL
@ -76,40 +80,13 @@ AC_CHECK_FUNCS([wcslcat wcslcmp wcslcpy])
# Extra libraries # Extra libraries
# #
# cryb-core # Cryb.to components
save_LIBS="${LIBS}" PKG_HAVE_WITH_MODULES([CRYB_CORE], [cryb-core],
LIBS="" [Cryb.to core utilities])
AC_SEARCH_LIBS([cryb_core_version], [cryb-core], [ PKG_HAVE_WITH_MODULES([CRYB_OATH], [cryb-oath],
CRYB_CORE_LIBS="${LIBS}" [Cryb.to Open Authentication primitives])
], [ PKG_HAVE_WITH_MODULES([CRYB_TEST], [cryb-test],
AC_MSG_ERROR([cryb-core library not found]) [Cryb.to test framework])
])
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"" ])
# libpam # libpam
save_LIBS="${LIBS}" save_LIBS="${LIBS}"
@ -248,6 +225,7 @@ AC_CONFIG_FILES([
include/cryb/Makefile include/cryb/Makefile
lib/Makefile lib/Makefile
lib/otp/Makefile lib/otp/Makefile
lib/otp/cryb-otp.pc
pam/Makefile pam/Makefile
pam/pam_otp/Makefile pam/pam_otp/Makefile
libexec/Makefile libexec/Makefile

View file

@ -9,3 +9,5 @@ libcryb_otp_la_SOURCES = \
libcryb_otp_la_LIBADD = \ libcryb_otp_la_LIBADD = \
$(CRYB_CORE_LIBS) \ $(CRYB_CORE_LIBS) \
$(CRYB_OATH_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 = EXTRA_DIST =
if WITH_CRYB_TEST if HAVE_CRYB_TEST
libotp = $(top_builddir)/lib/otp/libcryb-otp.la libotp = $(top_builddir)/lib/otp/libcryb-otp.la
@ -25,4 +25,4 @@ endif OTP_LIB
check_PROGRAMS = $(TESTS) check_PROGRAMS = $(TESTS)
endif WITH_CRYB_TEST endif HAVE_CRYB_TEST