From 746391a1719659161f026684193b3fb04593f563 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Thu, 7 Jan 2010 15:11:07 -0500 Subject: Split off libdhash into a shared library Right now, the pkg-config checks for the system version of libdhash are forcibly disabled, requiring the SSSD to build it from its own tree. In the future, when we split the libraries off from the SSSD, it will be easy to switch this check to the external library. --- server/Makefile.am | 15 ++++++++++----- server/configure.ac | 1 + server/external/libdhash.m4 | 12 ++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 server/external/libdhash.m4 (limited to 'server') diff --git a/server/Makefile.am b/server/Makefile.am index 989b39e6..100189d4 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -145,11 +145,16 @@ INI_CFG_LIBS = \ -L$(builddir)/../common/ini/.libs/ \ -lini_config -DHASH_CFLAGS = \ - -I$(srcdir)/../common/dhash -DHASH_LIBS = \ - -L$(builddir)/../common/dhash/ \ - -ldhash +if HAVE_SYSTEM_DHASH + DHASH_CFLAGS = $(SYSTEM_DHASH_CFLAGS) + DHASH_LIBS = $(SYSTEM_DHASH_LIBS) +else + DHASH_CFLAGS = \ + -I$(srcdir)/../common/dhash + DHASH_LIBS = \ + -L$(builddir)/../common/dhash/ \ + -ldhash +endif AM_CPPFLAGS = -Wall \ -Iinclude \ diff --git a/server/configure.ac b/server/configure.ac index 72b15cd0..4f560239 100644 --- a/server/configure.ac +++ b/server/configure.ac @@ -62,6 +62,7 @@ m4_include([external/libtalloc.m4]) m4_include([external/libtdb.m4]) m4_include([external/libtevent.m4]) m4_include([external/libldb.m4]) +m4_include([external/libdhash.m4]) m4_include([external/pam.m4]) m4_include([external/ldap.m4]) m4_include([external/libpcre.m4]) diff --git a/server/external/libdhash.m4 b/server/external/libdhash.m4 new file mode 100644 index 00000000..e3afdac3 --- /dev/null +++ b/server/external/libdhash.m4 @@ -0,0 +1,12 @@ +AC_SUBST(SYSTEM_DHASH_OBJ) +AC_SUBST(SYSTEM_DHASH_CFLAGS) +AC_SUBST(SYSTEM_DHASH_LIBS) + +PKG_CHECK_MODULES(SYSTEM_DHASH, dhash >= 0.4.0, + have_system_dhash=true, + have_system_dhash=false + ) +# This is future-compatible. Right now, we'll force the use of our +# in-tree copy. When dhash is split off as its own source package, we'll +# fix this test +AM_CONDITIONAL(HAVE_SYSTEM_DHASH, test x$have_system_dhash = xtrue_FORCE_IN_TREE) -- cgit