Skip to content
Snippets Groups Projects
configure.in 2.51 KiB
Newer Older
  • Learn to ignore specific revisions
  • dnl Copyright 2000-2003, OpenLDAP Foundation, All Rights Reserved.
    
    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(ldapcpplib, 0.0.4)
    AC_CONFIG_SRCDIR(src/LDAPConnection.h)
    AM_INIT_AUTOMAKE(foreign)
    
    AM_CONFIG_HEADER(src/config.h)
    
    
    dnl Checks for programs.
    
    AC_PROG_INSTALL
    dnl AC_PROG_CC
    
    dnl AM_DISABLE_SHARED
    
    AC_ARG_ENABLE(debug,[  --enable-debug],[
    
        AC_DEFINE(WITH_DEBUG,[],[Define to 1 ot enable debug logging])
    
    )
    
    AC_ARG_WITH(libldap,[  --with-libldap=DIR          Path to the libldap library [/usr/local/lib]],[
    
    	LIBS="-L$with_libldap $LIBS "	
    
    	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="-I$with_ldap_includes $CPPFLAGS "	
    
    	CPPFLAGS="-I/usr/local/include $CPPFLAGS "
    
    	]
    )
    dnl Checks for libraries.
    AC_CHECK_LIB(resolv,main)
    
    AC_CHECK_LIB(lber,ber_strdup,[
    
        ],[
            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,[
    
        ],[
            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,[
    
        ],[
            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_EGREP_HEADER(ber_strdup,lber.h,[
    
        ],[
            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.
    
    dnl Checks for library functions.
    
    
    AC_OUTPUT(Makefile src/Makefile examples/Makefile)