# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(eventlog, 1.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="" # Platform-specific stuff MOD_EXT=".so" case "$host_os:$host_cpu" in linux*:i?86|linux*:x86_64|linux*:s390*) AC_DEFINE([__LWI_LINUX__], [], [Define if OS is Linux]) ;; solaris*:i?86|solaris*:sparc*) AC_DEFINE([__LWI_SOLARIS__], [], [Define if OS is Solaris]) AC_DEFINE([__EXTENSIONS__], [], [Solaris requires this macro to be defined to enable several function declarations like: settimeofday(3) in sys/time.h vsyslog(3) in syslog.h]) AC_DEFINE([_XOPEN_SOURCE], [500], [Define to desired XOPEN compliance level]) ;; darwin*:*) AC_DEFINE([__LWI_DARWIN__], [], [Define if OS is Darwin]) ;; freebsd*:*) AC_DEFINE([__LWI_FREEBSD__], [], [Define if OS is FreeBSD]) ;; hpux*:hppa*) MOD_EXT=".sl" AC_DEFINE([__LWI_HP_UX__], [], [Define if OS is HP-UX]) AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [Define on HP-UX]) ;; hpux*:ia64*) AC_DEFINE([__LWI_HP_UX__], [], [Define if OS is HP-UX]) AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [Define on HP-UX]) ;; aix*:*) AC_DEFINE([__LWI_AIX__], [], [Define if OS is AIX]) AC_DEFINE([_LINUX_SOURCE_COMPAT], [], [Enable Linux source compatibility on AIX]) ;; esac AC_SUBST(MOD_EXT) AC_DEFINE_UNQUOTED([MOD_EXT], ["$MOD_EXT"], [Extension of shared modules]) # 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) # 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) # 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) # 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" ]) 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) # lwrpcrt AC_ARG_WITH([lwrpcrt], [AC_HELP_STRING([--with-lwrpcrt=], [use lwrpcrt located in prefix ])], [ LWRPCRT_INCLUDES="-I$withval/include" LWRPCRT_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([lwrpcrt-includes], [AC_HELP_STRING([--with-lwrpcrt-includes=], [use lwrpcrt includes located in ])], [ LWRPCRT_INCLUDES="-I$withval" ]) AC_ARG_WITH([lwrpcrt-libs], [AC_HELP_STRING([--with-lwrpcrt-libs=], [use lwrpcrt libs located in ])], [ LWRPCRT_LDFLAGS="-L$withval" ]) LWRPCRT_LIBS="-llwrpcrt" AC_SUBST(LWRPCRT_INCLUDES) AC_SUBST(LWRPCRT_LDFLAGS) AC_SUBST(LWRPCRT_LIBS) # gssapi AC_ARG_WITH([gssapi], [AC_HELP_STRING([--with-gssapi=], [use gssapi located in prefix ])], [ GSSAPI_INCLUDES="-I$withval/include" GSSAPI_LDFLAGS="-L$withval/lib" ]) AC_ARG_WITH([gssapi-includes], [AC_HELP_STRING([--with-gssapi-includes=], [use gssapi includes located in ])], [ GSSAPI_INCLUDES="-I$withval" ]) AC_ARG_WITH([gssapi-libs], [AC_HELP_STRING([--with-gssapi-libs=], [use gssapi libs located in ])], [ GSSAPI_LDFLAGS="-L$withval" ]) GSSAPI_LIBS="-lgssapi_krb5" AC_SUBST(GSSAPI_INCLUDES) AC_SUBST(GSSAPI_LDFLAGS) AC_SUBST(GSSAPI_LIBS) # 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 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) # 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]) # 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 ]) CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_GNU_SOURCE" 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) for i in $CPPFLAGS ${DCERPC_INCLUDES} ${UNISTR_INCLUDES} ${LSASS_INCLUDES}; do j=`echo $i | grep '^-I'` if test x != x"$j" then IDLFLAGS="$IDLFLAGS $j" fi done AC_SUBST(IDLFLAGS) eventlogconfdir="$sysconfdir" AC_SUBST(eventlogconfdir) eventlogregdir="$sysconfdir" AC_SUBST(eventlogregdir) AS_AC_EXPAND(CONFIGDIR, $eventlogconfdir) AC_DEFINE_UNQUOTED(CONFIGDIR, "$CONFIGDIR", [Config directory]) if test x"$localstatedir" = x"/var"; then eventlogcachedir="$localstatedir/lib/likewise" else eventlogcachedir="$localstatedir" fi AC_SUBST(eventlogcachedir) AS_AC_EXPAND(CACHEDIR, $eventlogcachedir) AC_DEFINE_UNQUOTED(CACHEDIR, "$CACHEDIR", [Cache directory]) 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(SBINDIR, ["${sbindir}"]) AC_C_BIGENDIAN AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL 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([unistr], [mbstowc16s], [LIBUNISTR_LIBS="-lunistr"], [], [$LIBUNISTR_LDFLAGS]) AC_CHECK_LIB([dcerpc], [rpc__init], [DCERPC_LIBS="-ldcerpc"],[],[$DCERPC_LDFLAGS]) 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) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([inttypes.h arpa/inet.h fcntl.h limits.h sys/syslimits.h sys/limits.h netdb.h netinet/in.h stdint.h stdlib.h stdbool.h string.h strings.h sys/socket.h syslog.h unistd.h sys/types.h fcntl.h iconv.h sys/stat.h time.h sys/time.h sys/varargs.h synch.h pthread.h wc16str.h wc16printf.h]) AC_PATH_PROG([IDL], [dceidl], [no], [$PATH:$DCERPC_PATH]) if test x"$IDL" = x"no"; 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_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 strchr strerror strerror_r vsyslog rpl_realloc rpl_malloc clock_gettime clock_settime settimeofday gettimeofday timegm strtoll __strtoll strtoull __strtoull strtol strtoul]) LDFLAGS="$old_LDFLAGS" AC_CHECK_DECLS([isblank], [], [], [#include ]) AC_CHECK_TYPES([wchar16_t], [], [], [AC_INCLUDES_DEFAULT #ifdef HAVE_WC16STR_H # include #endif ]) AC_CONFIG_FILES([Makefile etc/eventlogd.reg etc/Makefile include/Makefile utils/Makefile client/Makefile server/Makefile tools/Makefile tools/addevent/Makefile tools/cli/Makefile ]) AC_OUTPUT