configure.ac revision 70e59ed31c5a9c9ed02d9065ddf92be87c887efb
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_PREREQ(2.59)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_INIT([sssd],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher VERSION_NUMBER,
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [sssd-devel@lists.fedorahosted.org])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherm4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [AC_USE_SYSTEM_EXTENSIONS],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [AC_GNU_SOURCE])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherCFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_CONFIG_SRCDIR([BUILD.txt])
ee359fe1384507fed6c2274e7bfe81d288de4542Stephen GallagherAC_CONFIG_AUX_DIR([build])
ee359fe1384507fed6c2274e7bfe81d288de4542Stephen GallagherAM_INIT_AUTOMAKE([-Wall foreign subdir-objects tar-pax])
33396dc46ea52c18f47db1b5d590880806521005Sumit BoseAM_PROG_CC_C_O
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_DISABLE_STATIC
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_PROG_INSTALL
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_PROG_LIBTOOL
84ae5edab16ad6be5e3be956cb6fa031c1428eb5Stephen GallagherAC_CONFIG_MACRO_DIR([m4])
84ae5edab16ad6be5e3be956cb6fa031c1428eb5Stephen GallagherAM_GNU_GETTEXT([external])
84ae5edab16ad6be5e3be956cb6fa031c1428eb5Stephen GallagherAM_GNU_GETTEXT_VERSION([0.14])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_SUBST([PRERELEASE_VERSION],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher PRERELEASE_VERSION_NUMBER)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_DEFINE([PRERELEASE_VERSION], "PRERELEASE_VERSION_NUMBER",
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [Prerelease version number of package])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAM_CONDITIONAL([GIT_CHECKOUT], [git log -1 &>/dev/null])
cc98edd9479d4622634a1275c98058916c14059aStephen Gallagherm4_pattern_allow([AM_SILENT_RULES])
ee359fe1384507fed6c2274e7bfe81d288de4542Stephen GallagherAM_SILENT_RULES
1183d29d87c5c7439cf2364b7d7324d4a13b6e35Stephen GallagherAM_CONDITIONAL([HAVE_GCC], [test "$ac_cv_prog_gcc" = yes])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_CONFIG_HEADER(config.h)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_CHECK_TYPES([errno_t], [], [], [[#include <errno.h>]])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherBUILD_WITH_SHARED_BUILD_DIR
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_COMPILE_IFELSE(
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [AC_LANG_PROGRAM([[#include <pthread.h>]],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [[pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;]])],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [AC_DEFINE([HAVE_PTHREAD], [1], [Pthread mutexes available.])],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [AC_MSG_WARN([Pthread library not found! Clients will not be thread safe...])])
c89589fa349f38214c9cb8d9389c0fd557e5dca2Simo Sorce#Check for PAM headers
c89589fa349f38214c9cb8d9389c0fd557e5dca2Simo SorceAC_CHECK_HEADERS([security/pam_appl.h security/pam_misc.h security/pam_modules.h],
c89589fa349f38214c9cb8d9389c0fd557e5dca2Simo Sorce [AC_CHECK_LIB(pam, pam_get_item, [ PAM_LIBS="-lpam" ], [AC_MSG_ERROR([PAM must support pam_get_item])])],
c89589fa349f38214c9cb8d9389c0fd557e5dca2Simo Sorce [AC_MSG_ERROR([PAM development libraries not installed])]
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher#Set the NSS library install path
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_ARG_ENABLE([nsslibdir], [AS_HELP_STRING([--enable-nsslibdir],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [Where to install nss libraries ($libdir)])],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [nsslibdir=$enableval],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [nsslibdir=$libdir])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_SUBST(nsslibdir)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher#Set the PAM module install path
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_ARG_ENABLE([pammoddir], [AS_HELP_STRING([--enable-pammoddir],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [Where to install pam modules ($libdir/security)])],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [pammoddir=$enableval],
d921c1eba437662437847279f251a0a5d8f70127MaximAC_SUBST(pammoddir)
d921c1eba437662437847279f251a0a5d8f70127Maxim#Include here cause WITH_INIT_DIR requires $osname set in platform.m4
d921c1eba437662437847279f251a0a5d8f70127MaximWITH_DISTRO_VERSION
327127bb7fcc07f882209f029e14026de1b23c94MaximWITH_DB_PATH
327127bb7fcc07f882209f029e14026de1b23c94MaximWITH_PLUGIN_PATH
327127bb7fcc07f882209f029e14026de1b23c94MaximWITH_PID_PATH
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherWITH_PUBCONF_PATH
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherWITH_XML_CATALOG
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherWITH_KRB5_PLUGIN_PATH
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherWITH_KRB5_RCACHE_DIR
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherWITH_PYTHON_BINDINGS
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherWITH_NOLOGIN_SHELL
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherm4_include([src/external/libcollection.m4])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherm4_include([src/external/libini_config.m4])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherWITH_UNICODE_LIB
2a5790216f57e9bdfb2930d52860bb5300366536Jakub Hrozekif test x$unicode_lib = xlibunistring; then
e6e26182d58c05d896f72f2925426658a6dc70b5Jakub Hrozek AC_DEFINE_UNQUOTED(HAVE_LIBUNISTRING, 1, [Using libunistring for unicode])
e6e26182d58c05d896f72f2925426658a6dc70b5Jakub Hrozek UNICODE_LIBS=-lunistring
2a5790216f57e9bdfb2930d52860bb5300366536Jakub Hrozek AC_SUBST(UNICODE_LIBS)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AC_DEFINE_UNQUOTED(HAVE_GLIB2, 1, [Using libunistring for unicode])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher UNICODE_LIBS=$GLIB2_LIBS
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AC_SUBST(UNICODE_LIBS)
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherWITH_INITSCRIPT
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherif test x$initscript = xsystemd; then
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher WITH_SYSTEMD_UNIT_DIR
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherPKG_CHECK_MODULES([DBUS],[dbus-1])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherdnl if test -n "`$PKG_CONFIG --modversion dbus-1 | grep '^0\.'`" ; then
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherif ! $PKG_CONFIG --atleast-version 1.0.0 dbus-1; then
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AC_MSG_RESULT([setting -DDBUS_API_SUBJECT_TO_CHANGE])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherif test x$has_dbus != xno; then
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher SAFE_LIBS="$LIBS"
6f51c802311fd81a409a26763ed45b28a3234d0dJakub Hrozek LIBS="$DBUS_LIBS"
6f51c802311fd81a409a26763ed45b28a3234d0dJakub Hrozek AC_CHECK_FUNC([dbus_watch_get_unix_fd],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AC_DEFINE([HAVE_DBUS_WATCH_GET_UNIX_FD], [1],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [Define if dbus_watch_get_unix_fd exists]))
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher LIBS="$SAFE_LIBS"
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherif test x$HAVE_MANPAGES != x; then
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher CHECK_XML_TOOLS
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher CHECK_STYLESHEET([$SGML_CATALOG_FILES],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher [Docbook XSL templates])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AC_CHECK_PROG([PO4A],[po4a],[po4a],[no])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAM_CONDITIONAL([HAVE_MANPAGES], [test "x$HAVE_MANPAGES" != "x"])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAM_CONDITIONAL([HAVE_PO4A], [test "x$PO4A" != "xno"])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherif test x$HAVE_PYTHON_BINDINGS != x; then
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AM_PATH_PYTHON([2.4])
5352c9b3609bca63814f9f6f03dbbbadf6c6333aStephen Gallagher AM_CHECK_PYTHON_HEADERS([],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AC_MSG_ERROR([Could not find python headers]))
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AM_PYTHON_CONFIG
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AM_CHECK_PYTHON_COMPAT
2a5790216f57e9bdfb2930d52860bb5300366536Jakub Hrozekif test x$HAVE_SELINUX != x; then
2a5790216f57e9bdfb2930d52860bb5300366536Jakub Hrozek AM_CHECK_SELINUX
172c07013d1ea99447a780fd36f49d5c3a76981bJakub Hrozekif test x$HAVE_SEMANAGE != x -a x$HAVE_SELINUX != x; then
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AM_CHECK_SEMANAGE
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherif test x$BUILD_LIBNL != x; then
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AM_CHECK_LIBNL
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagherif test x$HAVE_SYSTEMD_UNIT != x; then
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher AM_CHECK_SYSTEMD
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAM_CONDITIONAL([HAVE_NSS], [test x"$NSS_CFLAGS" != x])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_CHECK_HEADERS([sys/inotify.h])
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_CHECK_HEADERS([sasl/sasl.h],,AC_MSG_ERROR([Could not find SASL headers]))
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen GallagherAC_CACHE_CHECK([whether compiler supports __attribute__((destructor))],
551aa6c36797ed720487f5974dcadabf19e6ff9fStephen Gallagher sss_client_cv_attribute_destructor,
96c73559adfbdac96720008fc022cb1d540b53c3Jakub Hrozek [AC_COMPILE_IFELSE(
6f51c802311fd81a409a26763ed45b28a3234d0dJakub Hrozek [AC_LANG_SOURCE([__attribute__((destructor)) static void cleanup(void) { }])],
84ae5edab16ad6be5e3be956cb6fa031c1428eb5Stephen Gallagher sss_client_cv_attribute_destructor=yes)
AC_MSG_WARN([Without the 'CHECK' libraries, you will be unable to run all tests in the 'make check' suite])
AC_CHECK_HEADERS([check.h],,AC_MSG_ERROR([Could not find CHECK headers]))