From e73ec5a0bd0c052d3ce8b621381fc5f58014aa2b Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 9 Aug 2004 20:55:23 +0000 Subject: Conditional Compilation of the various handlers --- configure.in | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 320fa2d..5b0a37e 100644 --- a/configure.in +++ b/configure.in @@ -36,8 +36,8 @@ dnl Nate Nielsen dnl dnl Process this file with autoconf to produce a configure script. -AC_INIT(httpauth, 0.4.1, nielsen@memberwebs.com) -AM_INIT_AUTOMAKE(httpauth, 0.4.1) +AC_INIT(httpauth, 0.4.2, nielsen@memberwebs.com) +AM_INIT_AUTOMAKE(httpauth, 0.4.2) LDFLAGS="$LDFLAGS -L/usr/local/lib" CFLAGS="$CFLAGS -I/usr/local/include -g -O0" @@ -57,13 +57,14 @@ AC_ARG_ENABLE(debug, [Compile binaries in debug mode])) if test "$enable_debug" = "yes"; then - CFLAGS="$CFLAGS -g -O0" - AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode]) - echo "enabling debug compile mode" + CFLAGS="$CFLAGS -g -O0" + AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode]) + echo "enabling debug compile mode" fi -# TODO: Make SMB support an option -# TODO: Make LDAP support an option +# Check for the various options +AC_ARG_WITH(ldap, [ --with-ldap with LDAP support]) +AC_ARG_ENABLE(ntlm, [ --enable-ntlm enable NTLM support]) # TODO: Figure out why we need this wierd hack ACX_PTHREAD( , [echo "ERROR: Pthread support not found."; exit 1] ) @@ -76,9 +77,6 @@ AC_CHECK_LIB([crypt_r], [crypt], , [ [ echo "ERROR: Crypt library required."; exit 1] ) ]) -AC_CHECK_LIB([ldap], [ldap_init], , - [ echo "ERROR: Open LDAP 2.x library required."; exit 1] ) - # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([unistd.h stdio.h stddef.h fcntl.h stdlib.h assert.h errno.h stdarg.h err.h string.h], , @@ -92,11 +90,36 @@ AC_CHECK_DECL(PTHREAD_MUTEX_ERRORCHECK_NP, [AC_DEFINE(HAVE_ERR_MUTEX, 1, "Error [AC_CHECK_DECL(PTHREAD_MUTEX_ERRORCHECK, [AC_DEFINE(HAVE_ERR_MUTEX, 2)], [echo "ERROR: Missing error checking mutex functionality in pthread.h"], [ #include ])], [ #include ]) - + # Required Functions AC_CHECK_FUNCS([memset strerror malloc realloc getopt strchr tolower getaddrinfo], , [echo "ERROR: Required function missing"; exit 1]) AC_CHECK_FUNCS([strlwr]) + +# LDAP support +AM_CONDITIONAL(WITH_LDAP, test -n "$with_ldap") +if test -n "$with_ldap"; then + + echo "enabling LDAP support" + + if test "$with_ldap" != "yes"; then + LDFLAGS="$LDFLAGS -L$with_ldap/lib" + CFLAGS="$CFLAGS -L$with_ldap/include" + fi + + AC_CHECK_LIB([ldap], [ldap_init], , + [ echo "ERROR: Open LDAP 2.x library required."; exit 1] ) + + AC_CHECK_HEADERS(ldap.h) + AC_DEFINE_UNQUOTED(WITH_LDAP, 1, [With LDAP Support] ) +fi + +# NTLM Support +AM_CONDITIONAL(WITH_NTLM, test -n "$enable_ntlm") +if test -n "$enable_ntlm"; then + echo "enabling NTLM support" + AC_DEFINE_UNQUOTED(WITH_NTLM, 1, [With NTLM Support] ) +fi AC_CONFIG_FILES([Makefile daemon/Makefile doc/Makefile]) AC_OUTPUT -- cgit v1.2.3