1 dnl Copyright 2000-2003, OpenLDAP Foundation, All Rights Reserved.
2 dnl COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5 dnl Process this file with autoconf to produce a configure script.
7 dnl disable config.cache
8 dnl define([AC_CACHE_LOAD], )
9 dnl define([AC_CACHE_SAVE], )
11 AC_INIT(examples/main.cpp)
12 AM_INIT_AUTOMAKE(main, 0.0.1)
13 AM_CONFIG_HEADER(src/config.h)
16 dnl Checks for programs.
24 AC_ARG_ENABLE(debug,[ --enable-debug],[
25 CXXFLAGS="-g -O0 -Wall"
26 AC_DEFINE(WITH_DEBUG,[],[Define to 1 ot enable debug logging])
32 AC_ARG_WITH(libldap,[ --with-libldap=DIR Path to the libldap library [/usr/local/lib]],[
33 LIBS="-L$with_libldap $LIBS "
35 LIBS="-L/usr/local/lib $LIBS "
39 AC_ARG_WITH(ldap-includes,[ --with-ldap-includes=DIR Path to the libldap include files [/usr/local/include]],[
40 CPPFLAGS="-I$with_ldap_includes $CPPFLAGS "
42 CPPFLAGS="-I/usr/local/include $CPPFLAGS "
45 dnl Checks for libraries.
46 AC_CHECK_LIB(resolv,main)
47 AC_CHECK_LIB(lber,ber_strdup,[
51 echo " didn't find ber_strdup in liblber !";
52 echo " Check for the right version (>= 2.0) of the OpenLDAP libraries";
53 echo " or try the --with-libldap option.";
56 AC_CHECK_LIB(ldap,ldap_add_ext,[
60 echo " didn't find ldap_add_ext in libldap !";
61 echo " Check for the right version (>= 2.0) of the OpenLDAP libraries";
62 echo " or try the --with-libldap option.";
67 dnl Checks for header files.
69 AC_CHECK_HEADER(ldap.h)
70 AC_EGREP_HEADER(ldap_add_ext,ldap.h,[
74 echo " didn't find ldap_add_ext in ldap.h!";
75 echo " Check for the right version (>= 2.0) of the OpenLDAP includes";
76 echo " or try --with-ldap-includes option.";
79 AC_CHECK_HEADER(lber.h)
80 AC_EGREP_HEADER(ber_strdup,lber.h,[
84 echo " didn't find ber_strdup in lber.h!";
85 echo " Check for the right version (>= 2.0) of the OpenLDAP includes";
86 echo " or try --with-ldap-includes option.";
90 dnl Checks for typedefs, structures, and compiler characteristics.
92 dnl Checks for library functions.
94 AC_OUTPUT(Makefile src/Makefile examples/Makefile)