]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/configure.in
fix realloc bug
[openldap] / contrib / ldapc++ / configure.in
index b67057a475c436d0928bad27ee85e30ee3d669c1..a246d69c55886089ceaf85c1c26c86dfcac3ec1f 100644 (file)
@@ -4,6 +4,9 @@ dnl COPYING RESTRICTIONS APPLY, see COPYRIGHT file
   
 dnl Process this file with autoconf to produce a configure script.
 
+dnl disable config.cache
+dnl define([AC_CACHE_LOAD], )
+dnl define([AC_CACHE_SAVE], )
 
 AC_INIT(src/main.cpp)
 AM_INIT_AUTOMAKE(main, 0.0.1)
@@ -11,36 +14,78 @@ AM_CONFIG_HEADER(src/config.h)
 
 
 dnl Checks for programs.
+AC_PROG_INSTALL
+dnl AC_PROG_CC
 AC_PROG_CXX
-AC_PROG_RANLIB
+dnl AC_PROG_RANLIB
+dnl AM_DISABLE_SHARED
+AM_PROG_LIBTOOL
 dnl AC_PROG_MAKE_SET
-AC_ARG_ENABLE(debug,--disable-debug,[
-       ],[
+AC_ARG_ENABLE(debug,--enable-debug,[
        CXXFLAGS="-g -O0 -Wall"
-       ]
+    AC_DEFINE(WITH_DEBUG)
+       ],[
+       CXXFLAGS="-O0"
+    ]
 )
 
 AC_ARG_WITH(libldap,[  --with-libldap=DIR          Path to the libldap library [/usr/local/lib]],[
-       LIBS="$LIBS -L$with_libldap"    
+       LIBS="-L$with_libldap $LIBS "   
        ],[
-       LIBS="$LIBS -L/usr/local/lib"   
+       LIBS="-L/usr/local/lib $LIBS "  
        ]
 )
 
 AC_ARG_WITH(ldap-includes,[  --with-ldap-includes=DIR    Path to the libldap include files [/usr/local/include]],[
-       CPPFLAGS="$CPPFLAGS -I$with_ldap_includes"      
+       CPPFLAGS="-I$with_ldap_includes $CPPFLAGS "     
        ],[
-       CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+       CPPFLAGS="-I/usr/local/include $CPPFLAGS "
        ]
 )
 dnl Checks for libraries.
 AC_CHECK_LIB(resolv,main)
-AC_CHECK_LIB(lber,main)
-AC_CHECK_LIB(ldap,main)
+AC_CHECK_LIB(lber,ber_strdup,[
+dnl NOOP
+        :
+    ],[
+        echo "        didn't find ber_strdup in liblber !";
+        echo "        Check for the right version (>= 2.0) of the OpenLDAP libraries";
+        echo "        or try the --with-libldap option.";
+        exit
+    ])
+AC_CHECK_LIB(ldap,ldap_add_ext,[
+dnl NOOP
+        :
+    ],[
+        echo "        didn't find ldap_add_ext in libldap !";
+        echo "        Check for the right version (>= 2.0) of the OpenLDAP libraries";
+        echo "        or try the --with-libldap option.";
+        exit
+    ],[
+    -llber
+    ])
 dnl Checks for header files.
 AC_HEADER_TIME
 AC_CHECK_HEADER(ldap.h)
+AC_EGREP_HEADER(ldap_add_ext,ldap.h,[
+dnl NOOP
+        :
+    ],[
+        echo "        didn't find ldap_add_ext in ldap.h!";
+        echo "        Check for the right version (>= 2.0) of the OpenLDAP includes";
+        echo "        or try --with-ldap-includes option.";
+        exit
+    ])
 AC_CHECK_HEADER(lber.h)
+AC_EGREP_HEADER(ber_strdup,lber.h,[
+dnl NOOP
+        :
+    ],[
+        echo "        didn't find ber_strdup in lber.h!";
+        echo "        Check for the right version (>= 2.0) of the OpenLDAP includes";
+        echo "        or try --with-ldap-includes option.";
+        exit
+    ])
 
 dnl Checks for typedefs, structures, and compiler characteristics.