1dnl $OpenLDAP$
2
3dnl Copyright 2000-2021 The OpenLDAP Foundation. All Rights Reserved.
4dnl COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5
6dnl Process this file with autoconf to produce a configure script.
7
8AC_COPYRIGHT([[Copyright 2000-2021 The OpenLDAP Foundation. All rights reserved.
9Restrictions apply, see COPYRIGHT and LICENSE files.]])
10AC_REVISION([Id: 9e53b7243116521c824456d5fb2d4d3c358c0d76 ])
11AC_INIT(ldapcpplib, [] , [http://www.openldap.org/its/] )
12AC_CONFIG_SRCDIR(src/LDAPConnection.h)
13AM_INIT_AUTOMAKE(foreign)
14AM_CONFIG_HEADER(src/config.h)
15
16eval `$ac_aux_dir/version.sh`
17if test -z "$OL_CPP_API_RELEASE"; then
18        AC_MSG_ERROR([could not determine version])
19fi
20
21VERSION=$OL_CPP_API_RELEASE
22OPENLDAP_CPP_API_VERSION=$OL_CPP_API_VERSION
23AC_SUBST(VERSION)
24AC_SUBST(OPENLDAP_CPP_API_VERSION)
25dnl Checks for programs.
26AC_PROG_INSTALL
27dnl AC_PROG_CC
28AC_PROG_CXX
29dnl AC_PROG_RANLIB
30dnl AM_DISABLE_SHARED
31AC_PROG_LIBTOOL
32dnl AC_PROG_MAKE_SET
33AC_ARG_ENABLE(debug,[  --enable-debug],[
34	CXXFLAGS="-g -O0 -Wall"
35    AC_DEFINE(WITH_DEBUG,[],[Define to 1 ot enable debug logging])
36	],
37)
38
39AC_ARG_WITH(libldap,[  --with-libldap=DIR          Path to the libldap library [/usr/local/lib]],[
40	LIBS="-L$with_libldap $LIBS "
41	],[
42	LIBS="-L/usr/local/lib $LIBS "
43	]
44)
45
46AC_ARG_WITH(ldap-includes,[  --with-ldap-includes=DIR    Path to the libldap include files [/usr/local/include]],[
47	CPPFLAGS="-I$with_ldap_includes $CPPFLAGS "
48	],[
49	CPPFLAGS="-I/usr/local/include $CPPFLAGS "
50	]
51)
52dnl Checks for libraries.
53AC_CHECK_LIB(resolv,main)
54AC_CHECK_LIB(lber,ber_strdup,[
55dnl NOOP
56        :
57    ],[
58        echo "        didn't find ber_strdup in liblber !";
59        echo "        Check for the right version (>= 2.0) of the OpenLDAP libraries";
60        echo "        or try the --with-libldap option.";
61        exit
62    ])
63AC_CHECK_LIB(ldap,ldap_add_ext,[
64dnl NOOP
65        :
66    ],[
67        echo "        didn't find ldap_add_ext in libldap !";
68        echo "        Check for the right version (>= 2.0) of the OpenLDAP libraries";
69        echo "        or try the --with-libldap option.";
70        exit
71    ],[
72    -llber
73    ])
74dnl Checks for header files.
75AC_HEADER_TIME
76AC_CHECK_HEADERS(termios.h ldap.h)
77AC_EGREP_HEADER(ldap_add_ext,ldap.h,[
78dnl NOOP
79        :
80    ],[
81        echo "        didn't find ldap_add_ext in ldap.h!";
82        echo "        Check for the right version (>= 2.0) of the OpenLDAP includes";
83        echo "        or try --with-ldap-includes option.";
84        exit
85    ])
86AC_CHECK_HEADER(lber.h)
87AC_EGREP_HEADER(ber_strdup,lber.h,[
88dnl NOOP
89        :
90    ],[
91        echo "        didn't find ber_strdup in lber.h!";
92        echo "        Check for the right version (>= 2.0) of the OpenLDAP includes";
93        echo "        or try --with-ldap-includes option.";
94        exit
95    ])
96
97dnl Checks for typedefs, structures, and compiler characteristics.
98
99dnl Checks for library functions.
100
101AC_OUTPUT(Makefile src/Makefile examples/Makefile)
102