dnl Process this file with autoconf to produce a configure script. AC_INIT(publication_ldap, 2.0.0-0, info@newpki.org) AC_CANONICAL_TARGET AC_DISABLE_STATIC AC_PROG_LIBTOOL libdir=/etc/newpki/modules AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/publication_ldap.h]) AM_CONFIG_HEADER([src/config.h]) dnl Checks for programs. AC_PROG_CXX(c++ g++ cpp gcc) AC_PROG_CC(gcc) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME # Checks for library functions. AC_CHECK_FUNCS([strstr]) AC_LANG_PUSH(C) dnl Checking openssl includes AC_ARG_WITH(openssl-include, AC_HELP_STRING([--with-openssl-include=path], [Where openssl includes are installed (optional)]), CPPFLAGS="-I$with_openssl_include $CPPFLAGS", []) dnl Checking openssl lib AC_ARG_WITH(openssl-lib, AC_HELP_STRING([--with-openssl-lib=path], [Where openssl lib are installed (optional)]), LDFLAGS=["-L$with_openssl_lib $LDFLAGS"], []) dnl Checking ldap includes AC_ARG_WITH(ldap-include, AC_HELP_STRING([--with-ldap-include=path], [Where ldap includes are installed (optional)]), CPPFLAGS="-I$with_ldap_include $CPPFLAGS", []) dnl Checking ldap lib AC_ARG_WITH(ldap-lib, AC_HELP_STRING([--with-ldap-lib=path], [Where mysql lib are installed (optional)]), LDFLAGS=["-L$with_ldap_lib $LDFLAGS"], []) dnl Checking newpki includes AC_ARG_WITH(newpki-lib, AC_HELP_STRING([--with-newpki-lib=path], [Where NewPKI's lib is installed (optional)]), LDFLAGS=["-L$with_newpki_lib -Wl,-rpath -Wl,$with_newpki_lib $LDFLAGS"], []) AC_ARG_WITH(newpki-include, AC_HELP_STRING([--with-newpki-include=path], [Where NewPKI's includes are installed (optional)]), CPPFLAGS="-I$with_newpki_include $CPPFLAGS", []) dnl Disabling gettext AC_ARG_ENABLE(gettext, AC_HELP_STRING([--disable-gettext], [Disable gettext support]), [], []) if test x"$enable_gettext" = x"no"; then CPPFLAGS="-DNO_GETTEXT $CPPFLAGS" fi; dnl Checking openssl version AC_MSG_CHECKING(openssl version) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[#include ]], [[return ((OPENSSL_VERSION_NUMBER < 0x0090702fL)?1:0);]])], [AC_MSG_RESULT([OK])], [AC_MSG_ERROR([openssl must be at least 0.9.7b])]) if test "$with_newpki_lib"; then CPPFLAGS="-I$with_newpki_lib/src/ $CPPFLAGS" fi; AC_LANG_PUSH(C++) AC_CHECK_HEADERS("NewPKI.h", [], [AC_MSG_ERROR([could not find the NewPKI.h include])]) AC_LANG_POP AC_CHECK_HEADERS("openssl/opensslv.h", [], [AC_MSG_ERROR([could not find the openssl/opensslv.h include])]) AC_CHECK_LIB(crypto, OCSP_RESPONSE_new, [], [AC_MSG_ERROR([libcrypto not found])]) AC_CHECK_HEADERS("openssl/ssl.h", [], [AC_MSG_ERROR([could not find the openssl/ssl.h include])]) AC_CHECK_LIB(ssl, SSL_connect, [], [AC_MSG_ERROR([libssl not found])]) AC_CHECK_HEADERS("pthread.h", [], [AC_MSG_ERROR([could not find pthread.h include])]) AC_CHECK_LIB(pthread, pthread_mutex_init, [], [AC_MSG_ERROR([pthread_mutex_init not found])]) AC_CHECK_HEADERS("ldap.h", [], [AC_MSG_ERROR([could not find the ldap.h include])]) AC_CHECK_LIB(ldap, ldap_init, [], [AC_MSG_ERROR([libldap not found])], -llber) AC_CHECK_FUNC(gethostent, [], AC_CHECK_LIB(nsl, gethostent, [], [AC_MSG_ERROR([gethostent not found])])) AC_CHECK_FUNC(setsockopt, [], AC_CHECK_LIB(socket, setsockopt, [], [AC_MSG_ERROR([setsockopt not found])])) AC_LANG_POP LIBS="-lnewpki $LIBS" AC_OUTPUT([Makefile])