# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(lsass, 5.0.0, support@likewisesoftware.com) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_CONFIG_HEADERS([include/config.h]) AC_CONFIG_MACRO_DIR([m4]) AM_CPPFLAGS="" AM_CFLAGS="" AM_LDFLAGS="" COMPONENT_VERSION="5.0.0.0" # Platform-specific stuff MOD_EXT=".so" # This note was originally in lsass/server/auth-providers/ad-provider/addef.h # before the definition for the skeleton dirs on Darwin -- ssalley@likewise.com # #ISSUE-2008/10/03-dalmeida -- The only difference between this and the # createhomedir utility is that the latter uses locale info and sets # "AppleLocale" in ~/Library/Preferences/.GlobalPreferences.plist # The latter is done by adding at the end of the section: # # AppleLocale # en_US # # To determine the right thing to do wrt locale, verify createhomedir # behavior wrt locale. # # Note that we must do the non-localized first then the localized to # make sure that the localized files overwrite non-localized ones. # This actually comes into play, at least on Mac OS X 10.5. # Note that this does not handle ACLs (ls -le), which are normally # present, at least on Mac OS X 10.5. But the default ACLs do # not appear to be useful. default_skeldirs="/etc/skel" default_homedir_prefix="/home" CF_FRAMEWORK_LDFLAGS="" SC_FRAMEWORK_LDFLAGS="" DS_FRAMEWORK_LDFLAGS="" AC_DEFINE(__LW_MOTD_FILE__, "/etc/motd", [File which contains the message of the day]) AC_DEFINE(__LW_MOTD_MAX_SIZE__, 4096, [The maximum number of bytes which will be displayed from the MOTD]) AC_USE_SYSTEM_EXTENSIONS PLATFORM_AIX="false" case "$host_os:$host_cpu" in linux*:i?86) echo "Detected Linux - i?86" nss_libdir="/lib" pam_libdir="/lib/security" NSS_SUBDIR="linux" ENABLE_NSS_ENUM_DEFAULT="no" AC_DEFINE([__LWI_LINUX__], [], [Define if OS is Linux]) ;; linux*:x86_64) echo "Detected Linux - x86_64" nss_libdir="/lib64" pam_libdir="/lib64/security" NSS_SUBDIR="linux" ENABLE_NSS_ENUM_DEFAULT="no" AC_DEFINE([__LWI_LINUX__], [], [Define if OS is Linux]) ;; linux*:s390*) echo "Detected Linux - s390*" nss_libdir="/lib64" pam_libdir="/lib64/security" NSS_SUBDIR="linux" ENABLE_NSS_ENUM_DEFAULT="no" AC_DEFINE([__LWI_LINUX__], [], [Define if OS is Linux]) ;; solaris*:i?86|solaris*:sparc*) echo "Detected Solaris SunOS" nss_libdir="/usr/lib" pam_libdir="/usr/lib/security" NSS_SUBDIR="solaris" ENABLE_NSS_ENUM_DEFAULT="no" default_homedir_prefix="/export/home" AC_DEFINE([__LWI_SOLARIS__], [], [Define if OS is Solaris]) AC_DEFINE([_XOPEN_SOURCE], [500], [Define to desired XOPEN compliance level]) ;; darwin8.*:*) echo "Detected Mac OS X - Tiger" nss_libdir="/usr/lib" pam_libdir="/usr/lib/pam" NSS_SUBDIR="mac" ENABLE_NSS_ENUM_DEFAULT="yes" default_skeldirs="System/Library/User Template/Non_localized, /System/Library/User Template/English.lproj" default_homedir_prefix="/Users" CF_FRAMEWORK_LDFLAGS="-framework CoreFoundation" SC_FRAMEWORK_LDFLAGS="-framework SystemConfiguration" DS_FRAMEWORK_LDFLAGS="-framework DirectoryService" AC_DEFINE([__LWI_DARWIN__], [], [Define if OS is Darwin]) ;; darwin9.*:*) echo "Detected Mac OS X - Leopard" nss_libdir="/usr/lib" pam_libdir="/usr/lib/pam" NSS_SUBDIR="mac" ENABLE_NSS_ENUM_DEFAULT="yes" default_skeldirs="System/Library/User Template/Non_localized, /System/Library/User Template/English.lproj" default_homedir_prefix="/Users" CF_FRAMEWORK_LDFLAGS="-framework CoreFoundation" SC_FRAMEWORK_LDFLAGS="-framework SystemConfiguration" DS_FRAMEWORK_LDFLAGS="-framework DirectoryService" AC_DEFINE([__LWI_DARWIN__], [], [Define if OS is Darwin]) ;; darwin10.*:*) echo "Detected Mac OS X - Snow Leopard" nss_libdir="/usr/lib" pam_libdir="/usr/lib/pam" NSS_SUBDIR="mac" ENABLE_NSS_ENUM_DEFAULT="yes" default_skeldirs="System/Library/User Template/Non_localized, /System/Library/User Template/English.lproj" default_homedir_prefix="/Users" CF_FRAMEWORK_LDFLAGS="-framework CoreFoundation" SC_FRAMEWORK_LDFLAGS="-framework SystemConfiguration" DS_FRAMEWORK_LDFLAGS="-framework DirectoryService" AC_DEFINE([__LWI_DARWIN__], [], [Define if OS is Darwin - x64 Snow Leopard]) AC_DEFINE([__LWI_DARWIN_X64__], [], [Define if OS is Darwin - x64 Snow Leopard]) ;; freebsd*:*) echo "Detected Free BSD OS" nss_libdir="/usr/local/lib" pam_libdir="/usr/local/lib" NSS_SUBDIR="freebsd" ENABLE_NSS_ENUM_DEFAULT="no" AC_DEFINE([__LWI_FREEBSD__], [], [Define if OS is FreeBSD]) ;; netbsd*:*) echo "Detected NetBSD OS" nss_libdir="/usr/lib" pam_libdir="/usr/lib/security" NSS_SUBDIR="freebsd" ENABLE_NSS_ENUM_DEFAULT="no" AC_DEFINE([__LWI_NETBSD__], [], [Define if OS is NetBSD]) ;; hpux*:hppa*) echo "Detected HPUX - hppa*" nss_libdir="/usr/lib" pam_libdir="/usr/lib/security" NSS_SUBDIR="hpux" ENABLE_NSS_ENUM_DEFAULT="no" NSS_SHR_EXT="" MOD_EXT=".sl" AC_SUBST(NSS_SHR_EXT) AC_DEFINE([__LWI_HP_UX__], [], [Define if OS is HP-UX]) AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [Define on HP-UX]) ;; hpux*:ia64*) echo "Detected HPUX - ia64*" nss_libdir="/usr/lib" pam_libdir="/usr/lib/security" NSS_SUBDIR="hpux" ENABLE_NSS_ENUM_DEFAULT="no" NSS_SHR_EXT=".so" AC_SUBST(NSS_SHR_EXT) AC_DEFINE([__LWI_HP_UX__], [], [Define if OS is HP-UX]) AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [Define on HP-UX]) ;; aix*:*) echo "Detected IBM AIX OS" nss_libdir="/usr/lib" pam_libdir="/usr/lib/security" NSS_SUBDIR="aix" ENABLE_NSS_ENUM_DEFAULT="no" NSS_SHR_EXT="" AC_SUBST(NSS_SHR_EXT) AC_DEFINE([__LWI_AIX__], [], [Define if OS is AIX]) AC_DEFINE([_LINUX_SOURCE_COMPAT], [], [Enable Linux source compatibility on AIX]) PLATFORM_AIX="true" ;; esac AM_CONDITIONAL(PLATFORM_AIX, [$PLATFORM_AIX]) AC_SUBST(NSS_SUBDIR) AC_SUBST(MOD_EXT) AC_SUBST(default_skeldirs) AC_SUBST(default_homedir_prefix) AC_SUBST(CF_FRAMEWORK_LDFLAGS) AC_SUBST(SC_FRAMEWORK_LDFLAGS) AC_SUBST(DS_FRAMEWORK_LDFLAGS) if test "$ENABLE_NSS_ENUM_DEFAULT" = "yes" then ENABLE_NSS_ENUM_DEFAULT_DWORD="00000001" else ENABLE_NSS_ENUM_DEFAULT_DWORD="00000000" fi AC_SUBST(ENABLE_NSS_ENUM_DEFAULT) AC_SUBST(ENABLE_NSS_ENUM_DEFAULT_DWORD) AC_DEFINE_UNQUOTED([MOD_EXT], ["$MOD_EXT"], [Extension of shared modules]) AC_DEFINE_UNQUOTED([ENABLE_NSS_ENUM_DEFAULT], ["$ENABLE_NSS_ENUM_DEFAULT"], [Default value for nss enumeration option]) # Package version AC_ARG_WITH([version], [AC_HELP_STRING([--with-version=], [Component version ...])], [ COMPONENT_VERSION="$withval" ]) AC_DEFINE_UNQUOTED(COMPONENT_VERSION, "$COMPONENT_VERSION", [Component Version]) # lwreg AC_ARG_WITH([lwreg], [AC_HELP_STRING([--with-lwreg=], [use lwreg located in prefix ])], [ LWREG_INCLUDES="-I$withval/include" LWREG_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([lwreg-includes], [AC_HELP_STRING([--with-lwreg-includes=], [use lwreg includes located in ])], [ LWREG_INCLUDES="-I$withval" ]) AC_ARG_WITH([lwreg-libs], [AC_HELP_STRING([--with-lwreg-libs=], [use lwreg libs located in ])], [ LWREG_LDFLAGS="-L$withval" ]) LWREG_LIBS=-lregclient # NSS and PAM AC_ARG_WITH([nss-libdir], [AC_HELP_STRING([--with-nss-libdir=], [install nss modules into ])], [ nss_libdir="$withval" ]) AC_ARG_WITH([pam-libdir], [AC_HELP_STRING([--with-pam-libdir=], [install pam modules into ])], [ pam_libdir="$withval" ]) # krb5 AC_ARG_WITH([krb5], [AC_HELP_STRING([--with-krb5=], [use krb5 located in prefix ])], [ KRB5_INCLUDES="-I$withval/include" KRB5_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([krb5-includes], [AC_HELP_STRING([--with-krb5-includes=], [use krb5 includes located in ])], [ KRB5_INCLUDES="-I$withval" ]) AC_ARG_WITH([krb5-libs], [AC_HELP_STRING([--with-krb5-libs=], [use krb5 libs located in ])], [ KRB5_LDFLAGS="-L$withval" ]) KRB5_LIBS="-lgssapi_krb5 -lkrb5 -lk5crypto" AC_SUBST(KRB5_INCLUDES) AC_SUBST(KRB5_LDFLAGS) AC_SUBST(KRB5_LIBS) # openldap AC_ARG_WITH([openldap], [AC_HELP_STRING([--with-openldap=], [use openldap located in prefix ])], [ OPENLDAP_INCLUDES="-I$withval/include" OPENLDAP_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([openldap-includes], [AC_HELP_STRING([--with-openldap-includes=], [use openldap includes located in ])], [ OPENLDAP_INCLUDES="-I$withval" ]) AC_ARG_WITH([openldap-libs], [AC_HELP_STRING([--with-openldap-libs=], [use openldap libs located in ])], [ OPENLDAP_LDFLAGS="-L$withval" ]) OPENLDAP_LIBS="-lldap_r -llber" AC_SUBST(OPENLDAP_INCLUDES) AC_SUBST(OPENLDAP_LDFLAGS) AC_SUBST(OPENLDAP_LIBS) # netapi AC_ARG_WITH([netapi], [AC_HELP_STRING([--with-netapi=], [use netapi located in prefix ])], [ NETAPI_INCLUDES="-I$withval/include" NETAPI_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([netapi-includes], [AC_HELP_STRING([--with-netapi-includes=], [use netapi includes located in ])], [ NETAPI_INCLUDES="-I$withval" ]) AC_ARG_WITH([netapi-libs], [AC_HELP_STRING([--with-netapi-libs=], [use netapi libs located in ])], [ NETAPI_LDFLAGS="-L$withval" ]) NETAPI_LIBS="-lnetapi" AC_SUBST(NETAPI_INCLUDES) AC_SUBST(NETAPI_LDFLAGS) AC_SUBST(NETAPI_LIBS) # libunistr AC_ARG_WITH([libunistr], [AC_HELP_STRING([--with-libunistr=], [use libunistr located in prefix ])], [ LIBUNISTR_INCLUDES="-I$withval/include" LIBUNISTR_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([libunistr-includes], [AC_HELP_STRING([--with-libunistr-includes=], [use libunistr includes located in ])], [ LIBUNISTR_INCLUDES="-I$withval" ]) AC_ARG_WITH([libunistr-libs], [AC_HELP_STRING([--with-libunistr-libs=], [use libunistr libs located in ])], [ LIBUNISTR_LDFLAGS="-L$withval" ]) LIBUNISTR_LIBS="-lunistr" AC_SUBST(LIBUNISTR_INCLUDES) AC_SUBST(LIBUNISTR_LDFLAGS) AC_SUBST(LIBUNISTR_LIBS) # lwmapsecurity AC_ARG_WITH([lwmapsecurity], [AC_HELP_STRING([--with-lwmapsecurity=], [use lwmapsecurity located in prefix ])], [ LWMAPSECURITY_INCLUDES="-I$withval/include" LWMAPSECURITY_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([lwmapsecurity-includes], [AC_HELP_STRING([--with-lwmapsecurity-includes=], [use lwmapsecurity includes located in ])], [ LWMAPSECURITY_INCLUDES="-I$withval" ]) AC_ARG_WITH([lwmapsecurity-libs], [AC_HELP_STRING([--with-lwmapsecurity-libs=], [use lwmapsecurity libs located in ])], [ LWMAPSECURITY_LDFLAGS="-L$withval" ]) LWMAPSECURITY_LIBS="-llwmapsecurity" AC_SUBST(LWMAPSECURITY_INCLUDES) AC_SUBST(LWMAPSECURITY_LDFLAGS) AC_SUBST(LWMAPSECURITY_LIBS) # lwmsg AC_ARG_WITH([lwmsg], [AC_HELP_STRING([--with-lwmsg=], [use lwmsg located in prefix ])], [ LWMSG_INCLUDES="-I$withval/include" LWMSG_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([lwmsg-includes], [AC_HELP_STRING([--with-lwmsg-includes=], [use lwmsg includes located in ])], [ LWMSG_INCLUDES="-I$withval" ]) AC_ARG_WITH([lwmsg-libs], [AC_HELP_STRING([--with-lwmsg-libs=], [use lwmsg libs located in ])], [ LWMSG_LDFLAGS="-L$withval" ]) # lwbase AC_ARG_WITH([lwbase], [AC_HELP_STRING([--with-lwbase=], [use lwbase located in prefix ])], [ LWBASE_INCLUDES="-I$withval/include" LWBASE_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([lwbase-includes], [AC_HELP_STRING([--with-lwbase-includes=], [use lwbase includes located in ])], [ LWBASE_INCLUDES="-I$withval" ]) AC_ARG_WITH([lwbase-libs], [AC_HELP_STRING([--with-lwbase-libs=], [use lwbase libs located in ])], [ LWBASE_LDFLAGS="-L$withval" ]) # crypto AC_ARG_WITH([crypto], [AC_HELP_STRING([--with-crypto=], [use crypto located in prefix ])], [ CRYPTO_INCLUDES="-I$withval/include" CRYPTO_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([crypto-includes], [AC_HELP_STRING([--with-crypto-includes=], [use crypto includes located in ])], [ CRYPTO_INCLUDES="-I$withval" ]) AC_ARG_WITH([crypto-libs], [AC_HELP_STRING([--with-crypto-libs=], [use crypto libs located in ])], [ CRYPTO_LDFLAGS="-L$withval" ]) CRYPTO_LIBS="-lcrypto" AC_SUBST(CRYPTO_INCLUDES) AC_SUBST(CRYPTO_LDFLAGS) AC_SUBST(CRYPTO_LIBS) # sqlite AC_ARG_WITH([sqlite], [AC_HELP_STRING([--with-sqlite=], [use sqlite located in prefix ])], [ SQLITE_INCLUDES="-I$withval/include" SQLITE_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([sqlite-includes], [AC_HELP_STRING([--with-sqlite-includes=], [use sqlite includes located in ])], [ SQLITE_INCLUDES="-I$withval" ]) AC_ARG_WITH([sqlite-libs], [AC_HELP_STRING([--with-sqlite-libs=], [use sqlite libs located in ])], [ SQLITE_LDFLAGS="-L$withval" ]) SQLITE_LIBS="-lsqlite3" AC_SUBST(SQLITE_INCLUDES) AC_SUBST(SQLITE_LDFLAGS) AC_SUBST(SQLITE_LIBS) # netlogon AC_ARG_WITH([netlogon], [AC_HELP_STRING([--with-netlogon=], [use netlogon located in prefix ])], [ NETLOGON_INCLUDES="-I$withval/include" NETLOGON_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([netlogon-includes], [AC_HELP_STRING([--with-netlogon-includes=], [use netlogon includes located in ])], [ NETLOGON_INCLUDES="-I$withval" ]) AC_ARG_WITH([netlogon-libs], [AC_HELP_STRING([--with-netlogon-libs=], [use netlogon libs located in ])], [ NETLOGON_LDFLAGS="-L$withval" ]) NETLOGON_LIBS="-llwnetclientapi" AC_SUBST(NETLOGON_INCLUDES) AC_SUBST(NETLOGON_LDFLAGS) AC_SUBST(NETLOGON_LIBS) # lwio AC_ARG_WITH([lwio], [AC_HELP_STRING([--with-lwio=], [use lwio located in prefix ])], [ LWIO_INCLUDES="-I$withval/include" LWIO_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([lwio-includes], [AC_HELP_STRING([--with-lwio-includes=], [use lwio includes located in ])], [ LWIO_INCLUDES="-I$withval" ]) AC_ARG_WITH([lwio-libs], [AC_HELP_STRING([--with-lwio-libs=], [use lwio libs located in ])], [ LWIO_LDFLAGS="-L$withval" ]) LWIO_LIBS="-llwioclient" AC_SUBST(LWIO_INCLUDES) AC_SUBST(LWIO_LDFLAGS) AC_SUBST(LWIO_LIBS) # lwadvapi AC_ARG_WITH([lwadvapi], [AC_HELP_STRING([--with-lwadvapi=], [use lwadvapi located in prefix ])], [ LWADVAPI_INCLUDES="-I$withval/include" LWADVAPI_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([lwadvapi-includes], [AC_HELP_STRING([--with-lwadvapi-includes=], [use lwadvapi includes located in ])], [ LWADVAPI_INCLUDES="-I$withval" ]) AC_ARG_WITH([lwadvapi-libs], [AC_HELP_STRING([--with-lwadvapi-libs=], [use lwadvapi libs located in ])], [ LWADVAPI_LDFLAGS="-L$withval" ]) LWADVAPI_LIBS="-llwadvapi" LWADVAPI_NOTHR_LIBS="-llwadvapi_nothr" AC_SUBST(LWADVAPI_INCLUDES) AC_SUBST(LWADVAPI_LDFLAGS) AC_SUBST(LWADVAPI_LIBS) AC_SUBST(LWADVAPI_NOTHR_LIBS) # pstore AC_ARG_WITH([pstore], [AC_HELP_STRING([--with-pstore=], [use pstore located in prefix ])], [ PSTORE_INCLUDES="-I$withval/include" PSTORE_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([pstore-includes], [AC_HELP_STRING([--with-pstore-includes=], [use pstore includes located in ])], [ PSTORE_INCLUDES="-I$withval" ]) AC_ARG_WITH([pstore-libs], [AC_HELP_STRING([--with-pstore-libs=], [use pstore libs located in ])], [ PSTORE_LDFLAGS="-L$withval" ]) PSTORE_LIBS="-llwpsapi" AC_SUBST(PSTORE_INCLUDES) AC_SUBST(PSTORE_LDFLAGS) AC_SUBST(PSTORE_LIBS) # eventlog AC_ARG_WITH([eventlog], [AC_HELP_STRING([--with-eventlog=], [use eventlog located in prefix ])], [ EVENTLOG_INCLUDES="-I$withval/include" EVENTLOG_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([eventlog-includes], [AC_HELP_STRING([--with-eventlog-includes=], [use eventlog includes located in ])], [ EVENTLOG_INCLUDES="-I$withval" ]) AC_ARG_WITH([eventlog-libs], [AC_HELP_STRING([--with-eventlog-libs=], [use eventlog libs located in ])], [ EVENTLOG_LDFLAGS="-L$withval" ]) EVENTLOG_LIBS="-leventlog" AC_SUBST(EVENTLOG_INCLUDES) AC_SUBST(EVENTLOG_LDFLAGS) AC_SUBST(EVENTLOG_LIBS) # dcerpc AC_ARG_WITH([dcerpc], [AC_HELP_STRING([--with-dcerpc=], [use dcerpc located in prefix ])], [ DCERPC_INCLUDES="-I$withval/include" DCERPC_LDFLAGS="-L$withval/lib" DCERPC_PATH="$withval/bin" ]) AC_ARG_WITH([dcerpc-includes], [AC_HELP_STRING([--with-dcerpc-includes=], [use dcerpc includes located in ])], [ DCERPC_INCLUDES="-I$withval" ]) AC_ARG_WITH([dcerpc-libs], [AC_HELP_STRING([--with-dcerpc-libs=], [use dcerpc libs located in ])], [ DCERPC_LDFLAGS="-L$withval" ]) DCERPC_LIBS="-ldcerpc" AC_SUBST(DCERPC_INCLUDES) AC_SUBST(DCERPC_LDFLAGS) AC_SUBST(DCERPC_LIBS) # minimal AC_ARG_ENABLE([minimal], [AC_HELP_STRING([--enable-minimal], [build minimal lsass])]) AM_CONDITIONAL(ENABLE_MINIMAL, test x"$enable_minimal" = x"yes") if test x"$enable_minimal" = x"yes" then AC_DEFINE([ENABLE_MINIMAL], [], [Define if should build minimal lsass]) fi # compat ENABLE_COMPAT=false AC_ARG_ENABLE([compat], [AC_HELP_STRING([--enable-compat], [enable compat-only build (default: disabled)])], [ if test x"$enableval" = x"yes" then ENABLE_COMPAT=true else ENABLE_COMPAT=false fi ]) AM_CONDITIONAL(ENABLE_COMPAT, [$ENABLE_COMPAT]) # gss ntlm test provider AC_ARG_ENABLE([testgssprovider], [AC_HELP_STRING([--enable-testgssprovider], [enable GSSNTLM test provider (default: disabled)])], [ if test x"$enableval" = x"yes" then ENABLE_TESTGSSPROVIDER=true AC_DEFINE(ENABLE_TESTGSSPROVIDER, 1, [Define if the test gss provider must be included in runtime]) else ENABLE_TESTGSSPROVIDER=false fi ]) AM_CONDITIONAL(ENABLE_TESTGSSPROVIDER, [$ENABLE_TESTGSSPROVIDER]) AC_ARG_WITH([providers], [AC_HELP_STRING([--with-providers], [list of providers to build (ad local)])], [], [with_providers="ad local"]) _IFS="${IFS}" IFS=" ," for provider in $with_providers do eval "enable_${provider}=yes" done IFS="${_IFS}" AM_CONDITIONAL(ENABLE_AD, test x"$enable_ad" = x"yes") if test x"$enable_ad" = x"yes" then AC_DEFINE([ENABLE_AD], [], [Define if AD provider should be built]) fi AM_CONDITIONAL(ENABLE_LOCAL, test x"$enable_local" = x"yes") if test x"$enable_local" = x"yes" then AC_DEFINE([ENABLE_LOCAL], [], [Define if local provider should be built]) fi # Boolean settings AC_ARG_ENABLE([static-providers], [AC_HELP_STRING([--enable-static-providers], [build providers directly into lsassd])]) AM_CONDITIONAL(ENABLE_STATIC_PROVIDERS, test x"$enable_static_providers" = x"yes") if test x"$enable_static_providers" = x"yes" then AC_DEFINE([ENABLE_STATIC_PROVIDERS], [], [Define if providers should be built directly into lsassd]) fi AC_ARG_ENABLE([rpcserver], [AC_HELP_STRING([--enable-rpcserver], [build rpc server modules])], [], [enable_rpcserver="yes"]) AM_CONDITIONAL(ENABLE_RPCSERVER, test x"$enable_rpcserver" = x"yes") if test x"$enable_rpcserver" = x"yes" then AC_DEFINE([ENABLE_RPCSERVER], [], [Define if rpc server modules should be built]) fi AC_ARG_ENABLE([static-rpcservers], [AC_HELP_STRING([--enable-static-rpcservers], [build rpc servers directly into lsassd])]) AM_CONDITIONAL(ENABLE_STATIC_RPCSERVERS, test x"$enable_static_rpcservers" = x"yes") if test x"$enable_static_rpcservers" = x"yes" then AC_DEFINE([ENABLE_STATIC_RPCSERVERS], [], [Define if rpc servers should be built directly into lsassd]) fi AC_ARG_ENABLE([pidfile], [AC_HELP_STRING([--disable-pidfile], [disable pid file creation (default: enabled)])], [], [enable_pidfile="yes"]) if test x"$enable_pidfile" = x"yes" then AC_DEFINE([ENABLE_PIDFILE], [], [Define if pid file should be created]) fi AC_ARG_ENABLE([small-daemon], [AC_HELP_STRING([--enable-small-daemon], [build small lsassd])]) AM_CONDITIONAL(ENABLE_SMALL_DAEMON, test x"$enable_small_daemon" = x"yes") if test x"$enable_small_daemon" = x"yes" then AC_DEFINE([ENABLE_SMALL_DAEMON], [], [Define if lsassd should be small]) fi # debugging AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug], [enable debugging (default: disabled)])], [ if test x"$enableval" = x"yes" then AM_CFLAGS="$AM_CFLAGS -g -O0" AM_CPPFLAGS="$AM_CPPFLAGS -DDEBUG" fi ]) AC_ARG_ENABLE([profiling], [AC_HELP_STRING([--enable-profiling], [enable profiling (default: disabled)])], [ if test x"$enableval" = x"yes" then AM_CFLAGS="$AM_CFLAGS -fprofile-arcs -ftest-coverage" LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage" fi ]) CPPFLAGS="$CPPFLAGS -D_REENTRANT" AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/include" AM_CFLAGS="$AM_CFLAGS -Wall -Werror -fno-strict-aliasing" AC_SUBST(AM_CPPFLAGS) AC_SUBST(AM_CFLAGS) lsassconfdir="$sysconfdir" AC_SUBST(lsassconfdir) AS_AC_EXPAND(CONFIGDIR, $lsassconfdir) AC_DEFINE_UNQUOTED(CONFIGDIR, "$CONFIGDIR", [Config directory]) lsassregdir="$sysconfdir" AC_SUBST(lsassregdir) if test x"$localstatedir" = x"/var"; then lsasscachedir="$localstatedir/lib/likewise" else lsasscachedir="$localstatedir" fi AC_SUBST(lsasscachedir) AS_AC_EXPAND(CACHEDIR, $lsasscachedir) AC_DEFINE_UNQUOTED(CACHEDIR, "$CACHEDIR", [Cache directory]) AS_AC_EXPAND(providerdir, $libdir) AS_AC_EXPAND(rpcserverdir, $libdir) AS_AC_EXPAND(SBINDIR, ["${sbindir}"]) testbindir='$(exec_prefix)/test' AC_SUBST(testbindir) testlibdir='$(exec_prefix)/test' AC_SUBST(testlibdir) AS_AC_EXPAND(PREFIXDIR, $prefix) AC_DEFINE_UNQUOTED(PREFIXDIR, "$PREFIXDIR", [Prefix directory]) AS_AC_EXPAND(LIBDIR, $libdir) AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [Library directory]) AS_AC_EXPAND(pamlibdir, $pam_libdir) AC_DEFINE_UNQUOTED(PAM_LIBDIR, "$pamlibdir", [PAM library directory]) AS_AC_EXPAND(nsslibdir, $nss_libdir) AC_DEFINE_UNQUOTED(NSS_LIBDIR, "$nsslibdir", [NSS library directory]) AC_C_BIGENDIAN AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL AC_PROG_MKDIR_P LW_USE_DOXYGEN([1.5.3]) AC_SUBST([DOXYGEN],[$DOXYGEN]) AM_CONDITIONAL([HAVE_DOXYGEN], [$HAVE_DOXYGEN]) AM_CONDITIONAL([HAVE_DOXYGEN_PDF], [$HAVE_DOXYGEN_PDF]) AC_CHECK_LIB([nsl], [gethostname], [NSL_LIBS="-lnsl"]) AC_CHECK_LIB([dl], [dlopen], [DL_LIBS="-ldl"]) AC_CHECK_LIB([resolv], [res_query], [RESOLV_LIBS="-lresolv"]) AC_CHECK_LIB([resolv], [__res_query], [RESOLV_LIBS="-lresolv"]) AC_CHECK_LIB([pthread], [pthread_self], [PTHREAD_LIBS="-lpthread"]) AC_CHECK_LIB([rt], [clock_settime], [RT_LIBS="-lrt"]) AC_CHECK_LIB([uuid], [uuid_copy], [UUID_LIBS="-luuid"]) AC_CHECK_LIB([socket], [bind], [SOCKET_LIBS="-lsocket"]) AC_CHECK_LIB([kvm], [kvm_open], [KVM_LIBS="-lkvm"]) AC_CHECK_LIB([proc], [openproc], [PROC_LIBS="-lproc"]) AC_CHECK_LIB([unistr], [mbstowc16s], [LIBUNISTR_LIBS="-lunistr"], [], [$LIBUNISTR_LDFLAGS]) AC_CHECK_LIB([crypto], [DES_set_key], [CRYPTO_LIBS="-lcrypto"], [], [$CRYPTO_LDFLAGS]) AC_CHECK_LIB([pam], [pam_start], [PAM_LIBS="-lpam"]) AC_SUBST(NSL_LIBS) AC_SUBST(DL_LIBS) AC_SUBST(RESOLV_LIBS) AC_SUBST(PTHREAD_LIBS) AC_SUBST(RT_LIBS) AC_SUBST(UUID_LIBS) AC_SUBST(SOCKET_LIBS) AC_SUBST(PAM_LIBS) AC_SUBST(KVM_LIBS) AC_SUBST(PROC_LIBS) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([inttypes.h arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h]) AC_CHECK_HEADERS([stdint.h stdlib.h stdbool.h string.h strings.h sys/socket.h]) AC_CHECK_HEADERS([syslog.h unistd.h sys/types.h iconv.h sys/stat.h sys/pstat.h]) AC_CHECK_HEADERS([proc/readproc.h procfs.h sys/procfs.h kvm.h sys/utsname.h]) AC_CHECK_HEADERS([time.h sys/time.h sys/varargs.h sys/systeminfo.h]) AC_CHECK_HEADERS([nss.h nss_common.h nsswitch.h]) AC_CHECK_HEADERS([synch.h pthread.h wc16str.h wc16printf.h sys/param.h]) AC_CHECK_HEADERS([sys/sysctl.h sys/user.h pwd.h stdio.h grp.h sys/wait.h libgen.h]) AC_CHECK_HEADERS([security/pam_appl.h], , [AC_CHECK_HEADERS([pam/pam_appl.h], , [AC_MSG_ERROR([No PAM header files found])])]) AC_CHECK_HEADERS([execinfo.h sys/regset.h]) AC_PATH_PROG([IDL], [dceidl], [no], [$PATH:$DCERPC_PATH]) if test x"$IDL" = x"no" -a x"$ENABLE_COMPAT" = x"false"; then AC_MSG_ERROR([DCERPC IDL compiler not found]) fi # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_HEADER_TIME AC_STRUCT_TM # Check for basic types AC_CHECK_TYPES([int8, int16, int32, int64], [], [], [#include #if __ia64 #include #endif]) AC_CHECK_TYPES([uint8, uint16, uint32, uint64]) AC_CHECK_TYPE(suseconds_t, [USEC_T="suseconds_t"], [USEC_T="long int"], [#include ]) AC_DEFINE_UNQUOTED([USEC_T], [$USEC_T], [Type of tv_usec field of struct timeval]) AC_CHECK_SIZEOF([long long int]) AC_CHECK_SIZEOF([long int]) # Checks for library functions. AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_TYPE_SIGNAL AC_FUNC_STRFTIME AC_FUNC_VPRINTF AC_FUNC_STRERROR_R old_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $RT_LIBS" AC_CHECK_FUNCS([atexit localtime_r memset select socket]) AC_CHECK_FUNCS([strtoll __strtoll strtoull __strtoull strtol strtoul]) AC_CHECK_FUNCS([strchr strerror strerror_r]) AC_CHECK_FUNCS([vsyslog rpl_realloc rpl_malloc]) AC_CHECK_FUNCS([clock_gettime clock_settime settimeofday gettimeofday timegm]) AC_CHECK_FUNCS([getgrouplist sysinfo backtrace]) LDFLAGS="$old_LDFLAGS" AC_CHECK_DECLS([isblank], [], [], [#include ]) AC_CHECK_TYPES([wchar16_t], [], [], [AC_INCLUDES_DEFAULT #ifdef HAVE_WC16STR_H # include #endif ]) AC_CHECK_MEMBERS([ucontext_t.uc_mcontext, ucontext_t.uc_mcontext->__ss, ucontext_t.uc_mcontext->__ss.__rip, ucontext_t.uc_mcontext->__ss.__eip], [], [], [AC_INCLUDES_DEFAULT #ifdef HAVE_EXECINFO_H # include #endif ]) AC_CHECK_HEADER([reg/reg.h],,[AC_MSG_ERROR([Could not find lwreg headers])], [[#include ]]) AC_SUBST(LWREG_INCLUDES) AC_SUBST(LWREG_LDFLAGS) AC_SUBST(LWREG_LIBS) AC_CHECK_HEADER([lwmsg/lwmsg.h],,[AC_MSG_ERROR([Could not find lwmsg headers])]) AC_CHECK_LIB([lwmsg_nothr], [lwmsg_data_marshal], [LWMSG_NOTHR_LIBS="-llwmsg_nothr"], [AC_MSG_ERROR([Could not find liblwmsg_nothr])], [$LWMSG_LDFLAGS]) AC_CHECK_LIB([lwmsg], [lwmsg_peer_new], [LWMSG_LIBS="-llwmsg"], [AC_MSG_ERROR([Could not find liblwmsg])], [$LWMSG_LDFLAGS]) AC_SUBST(LWMSG_INCLUDES) AC_SUBST(LWMSG_LDFLAGS) AC_SUBST(LWMSG_NOTHR_LIBS) AC_SUBST(LWMSG_LIBS) AC_CHECK_HEADER([lw/base.h],,[AC_MSG_ERROR([Could not find lwbase headers])]) AC_CHECK_LIB([lwbase_nothr], [LwRtlMemoryAllocate], [LWBASE_NOTHR_LIBS="-llwbase_nothr"], [AC_MSG_ERROR([Could not find liblwbase_nothr])], [$LWBASE_LDFLAGS]) AC_CHECK_LIB([lwbase], [LwInterlockedIncrement], [LWBASE_LIBS="-llwbase"], [AC_MSG_ERROR([Could not find liblwbase])], [$LWBASE_LDFLAGS]) AC_SUBST(LWBASE_INCLUDES) AC_SUBST(LWBASE_LDFLAGS) AC_SUBST(LWBASE_NOTHR_LIBS) AC_SUBST(LWBASE_LIBS) AC_CHECK_TYPES([socklen_t], [], [], [AC_INCLUDES_DEFAULT #include #include ]) AC_CHECK_TYPES([struct pam_repository], [], [], [AC_INCLUDES_DEFAULT #include ]) AC_CHECK_DECLS([PAM_BAD_ITEM], [], [], [AC_INCLUDES_DEFAULT #include ]) AC_CHECK_DECLS([kvm_open, kvm_getprocs], [], [], [ #if HAVE_FCNTL_H #include #endif #if HAVE_KVM_H #include #endif #if HAVE_SYS_PARAM_H #include #endif #if HAVE_SYS_SYSCTL_H #include #endif #if HAVE_SYS_USER_H #include #endif]) AC_CHECK_DECLS([isblank, pstat_getproc, KERN_PROC_PATHNAME], [], [], [ #include #if HAVE_SYS_PARAM_H #include #endif #if HAVE_SYS_SYSCTL_H #include #endif #if HAVE_SYS_PSTAT_H #include #endif]) AC_CHECK_TYPES([struct psinfo], , , [ #if HAVE_PROCFS_H #include #elif HAVE_SYS_PROCFS_H #include #endif ]) if test "$ac_cv_have_decl_pstat_getproc" = yes; then AM_CPPFLAGS="$AM_CPPFLAGS -D_PSTAT64" fi saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" AC_MSG_CHECKING([if pthread_mutex_lock is available outside of libpthread]) AC_TRY_LINK_FUNC([pthread_mutex_lock], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_NONLIBPTHREAD_MUTEX_LOCK], [], [Define if pthread_mutex_lock is available outside of libpthread])],[ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([if getsockname takes socklen_t*]) AC_TRY_COMPILE([ #include #include ], [ int fd = -1; struct sockaddr addr; socklen_t addrlen; (void) getsockname(fd, &addr, &addrlen); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([GETSOCKNAME_TAKES_SOCKLEN_T], [], [Define if getsockname takes socklen_t as its third argument])],[ AC_MSG_RESULT([no]) ]) case "$host_os:$host_cpu" in freebsd*:*|netbsd*:*) AC_MSG_CHECKING([if pam_get_data takes const void** as last argument]) AC_TRY_COMPILE([ #include #include ], [ const pam_handle_t * pamh = NULL; const char * module_data_name = NULL; const void * data = NULL; pam_get_data(pamh, module_data_name, &data); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([PAM_GET_DATA_TAKES_CONST_DATA_ARG], [], [Define if pam_get_data takes const void** as its third argument])], [AC_MSG_RESULT([no])]) ;; *) ;; esac AC_MSG_CHECKING([if struct msghdr has msg_control]) AC_TRY_COMPILE([ #include #include ], [ struct msghdr hdr; hdr.msg_control = 0; ], [ AC_MSG_RESULT([yes]) AC_DEFINE([MSGHDR_HAS_MSG_CONTROL], [], [Define if struct msghdr has the msg_control field]) ], [ AC_MSG_RESULT([no]) ]) CFLAGS="$saved_CFLAGS" AC_CONFIG_FILES([Makefile common/Makefile common/utils/Makefile common/ipc/Makefile common/ipc/api/Makefile common/ipc/ad/Makefile common/ipc/ntlm/Makefile client/Makefile client/api/Makefile client/ad/Makefile client/ntlm/Makefile logging_r/Makefile lsaunistr/Makefile join/Makefile interop/Makefile interop/gssntlm/Makefile interop/nsswitch/Makefile interop/nsswitch/common/Makefile interop/nsswitch/linux/Makefile interop/nsswitch/freebsd/Makefile interop/nsswitch/aix/Makefile interop/nsswitch/hpux/Makefile interop/nsswitch/solaris/Makefile interop/nsswitch/mac/Makefile interop/lwmapsecurity/Makefile server/Makefile server/api/Makefile server/ntlm/Makefile server/auth-providers/Makefile server/auth-providers/ad-provider/addef.h server/auth-providers/ad-provider/Makefile server/auth-providers/local-provider/lpdefs.h server/auth-providers/local-provider/Makefile server/lsassd/Makefile server/rpc/Makefile server/rpc/lsa/Makefile server/rpc/samr/Makefile server/rpc/dssetup/Makefile server/store/Makefile server/store/samdb/Makefile server/store/dsapi/Makefile server/store/dsapi/dirdefs.h interop/access/Makefile interop/auth/Makefile interop/auth/common/Makefile interop/auth/pam/Makefile interop/wbclient/Makefile interop/lwicompat/Makefile tools/Makefile tools/lw-lsa/Makefile etc/Makefile etc/lsassd.reg include/lsaregdef.h include/Makefile tests/Makefile tests/test_headers/Makefile tests/lsaclient/Makefile tests/test_getgrgid/Makefile tests/test_getpwuid/Makefile tests/test_LsaGetNamesBySidList/Makefile tests/test_getgrnam/Makefile tests/test_LsaAllocSecurityIdentifierFromBinary/Makefile tests/test_LsaGetSecurityIdentifierHashedRid/Makefile tests/test_LsaAllocSecurityIdentifierFromString/Makefile tests/test_getpwent/Makefile tests/test_getpwnam/Makefile tests/test_bitvector/Makefile tests/test_memcache/Makefile tests/test_perf/Makefile tests/test_perf/lsassonly/Makefile tests/test_authenticate/Makefile tests/test_validate/Makefile tests/test_changepasswd/Makefile tests/test_session/Makefile tests/test_checkuserinlist/Makefile tests/test_openldap/Makefile tests/ntlmapps/Makefile tests/ntlmapps/ntlmclient/Makefile tests/ntlmapps/ntlmserver/Makefile scripts/Makefile docs/Makefile docs/Doxyfile]) AC_OUTPUT