configure.in 2.63 KB
Newer Older
1
2
dnl $OpenLDAP$

3
dnl Copyright 2000-2008, OpenLDAP Foundation, All Rights Reserved.
4
dnl COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5

6
7
dnl Process this file with autoconf to produce a configure script.

8
9
10
11
AC_COPYRIGHT([[Copyright 2000-2008 The OpenLDAP Foundation. All rights reserved.
Restrictions apply, see COPYRIGHT and LICENSE files.]])
AC_REVISION([$OpenLDAP$])
AC_INIT(ldapcpplib, [] , [http://www.openldap.org/its/] )
Ralf Haferkamp's avatar
Ralf Haferkamp committed
12
13
AC_CONFIG_SRCDIR(src/LDAPConnection.h)
AM_INIT_AUTOMAKE(foreign)
14
15
16
AM_CONFIG_HEADER(src/config.h)

dnl Checks for programs.
17
18
AC_PROG_INSTALL
dnl AC_PROG_CC
19
AC_PROG_CXX
20
dnl AC_PROG_RANLIB
21
dnl AM_DISABLE_SHARED
22
AC_PROG_LIBTOOL
23
dnl AC_PROG_MAKE_SET
24
AC_ARG_ENABLE(debug,[  --enable-debug],[
25
	CXXFLAGS="-g -O0 -Wall"
26
    AC_DEFINE(WITH_DEBUG,[],[Define to 1 ot enable debug logging])
27
28
29
	],[
	CXXFLAGS="-O0"
    ]
30
31
32
)

AC_ARG_WITH(libldap,[  --with-libldap=DIR          Path to the libldap library [/usr/local/lib]],[
33
	LIBS="-L$with_libldap $LIBS "	
34
	],[
35
	LIBS="-L/usr/local/lib $LIBS "	
36
37
38
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 "	
41
	],[
42
	CPPFLAGS="-I/usr/local/include $CPPFLAGS "
43
44
45
46
	]
)
dnl Checks for libraries.
AC_CHECK_LIB(resolv,main)
47
AC_CHECK_LIB(lber,ber_strdup,[
48
49
dnl NOOP
        :
50
51
52
53
54
55
56
    ],[
        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,[
57
58
dnl NOOP
        :
59
60
61
62
63
64
65
66
    ],[
        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
    ])
67
68
dnl Checks for header files.
AC_HEADER_TIME
69
AC_CHECK_HEADERS(termios.h ldap.h)
70
AC_EGREP_HEADER(ldap_add_ext,ldap.h,[
71
72
dnl NOOP
        :
73
74
75
76
77
78
    ],[
        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
    ])
79
AC_CHECK_HEADER(lber.h)
80
AC_EGREP_HEADER(ber_strdup,lber.h,[
81
82
dnl NOOP
        :
83
84
85
86
87
88
    ],[
        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
    ])
89
90
91
92
93

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.

94
AC_OUTPUT(Makefile src/Makefile examples/Makefile)