# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(likewise-keytab, 1.0, support@likewisesoftware.com)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_HEADERS([include/config.h])
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)
# 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)
# 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)
# 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)
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([inttypes.h arpa/inet.h fcntl.h 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 nss.h nss_common.h nsswitch.h synch.h pthread.h wc16str.h wc16printf.h])
# 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
AC_CHECK_FUNCS([atexit bzero localtime_r memset select socket strchr strerror vsyslog rpl_realloc rpl_malloc clock_gettime clock_settime settimeofday gettimeofday timegm getgrouplist strtoll __strtoll strtoull __strtoull strtol strtoul])
AC_CHECK_DECLS([isblank], [], [], [#include ])
AC_CHECK_TYPES([wchar16_t], [], [], [AC_INCLUDES_DEFAULT
#ifdef HAVE_WC16STR_H
# include
#endif
])
AC_CHECK_LIB([pthread], [pthread_self], [PTHREAD_LIBS="-lpthread"])
AC_SUBST(PTHREAD_LIBS)
AC_CONFIG_FILES([Makefile
include/Makefile
ktkrb5/Makefile
utils/Makefile
test/Makefile
]
)
AC_OUTPUT