174
dnl CURL_CHECK_HEADER_WINLDAP
175
dnl -------------------------------------------------
176
dnl Check for compilable and valid winldap.h header
178
AC_DEFUN([CURL_CHECK_HEADER_WINLDAP], [
179
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
180
AC_CACHE_CHECK([for winldap.h], [ac_cv_header_winldap_h], [
184
#ifdef HAVE_WINDOWS_H
185
#ifndef WIN32_LEAN_AND_MEAN
186
#define WIN32_LEAN_AND_MEAN
193
HAVE_WINLDAP_H shall not be defined.
195
LDAP *ldp = ldap_init("dummy", LDAP_PORT);
196
ULONG res = ldap_unbind(ldp);
200
ac_cv_header_winldap_h="yes"
202
ac_cv_header_winldap_h="no"
205
case "$ac_cv_header_winldap_h" in
207
AC_DEFINE_UNQUOTED(HAVE_WINLDAP_H, 1,
208
[Define to 1 if you have the winldap.h header file.])
214
dnl CURL_CHECK_HEADER_WINBER
215
dnl -------------------------------------------------
216
dnl Check for compilable and valid winber.h header
218
AC_DEFUN([CURL_CHECK_HEADER_WINBER], [
219
AC_REQUIRE([CURL_CHECK_HEADER_WINLDAP])dnl
220
AC_CACHE_CHECK([for winber.h], [ac_cv_header_winber_h], [
224
#ifdef HAVE_WINDOWS_H
225
#ifndef WIN32_LEAN_AND_MEAN
226
#define WIN32_LEAN_AND_MEAN
234
HAVE_WINBER_H shall not be defined.
237
BerElement *bep = ber_init(bvp);
242
ac_cv_header_winber_h="yes"
244
ac_cv_header_winber_h="no"
247
case "$ac_cv_header_winber_h" in
249
AC_DEFINE_UNQUOTED(HAVE_WINBER_H, 1,
250
[Define to 1 if you have the winber.h header file.])
256
dnl CURL_CHECK_HEADER_LBER
257
dnl -------------------------------------------------
258
dnl Check for compilable and valid lber.h header,
259
dnl and check if it is needed even with ldap.h
261
AC_DEFUN([CURL_CHECK_HEADER_LBER], [
262
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
263
AC_CACHE_CHECK([for lber.h], [ac_cv_header_lber_h], [
267
#ifdef HAVE_WINDOWS_H
268
#ifndef WIN32_LEAN_AND_MEAN
269
#define WIN32_LEAN_AND_MEAN
273
#ifdef HAVE_SYS_TYPES_H
274
#include <sys/types.h>
278
#define NULL (void *)0
282
BerValue *bvp = NULL;
283
BerElement *bep = ber_init(bvp);
287
ac_cv_header_lber_h="yes"
289
ac_cv_header_lber_h="no"
292
if test "$ac_cv_header_lber_h" = "yes"; then
293
AC_DEFINE_UNQUOTED(HAVE_LBER_H, 1,
294
[Define to 1 if you have the lber.h header file.])
299
#ifdef HAVE_WINDOWS_H
300
#ifndef WIN32_LEAN_AND_MEAN
301
#define WIN32_LEAN_AND_MEAN
305
#ifdef HAVE_SYS_TYPES_H
306
#include <sys/types.h>
310
#define NULL (void *)0
312
#ifndef LDAP_DEPRECATED
313
#define LDAP_DEPRECATED 1
317
BerValue *bvp = NULL;
318
BerElement *bep = ber_init(bvp);
322
curl_cv_need_header_lber_h="no"
324
curl_cv_need_header_lber_h="yes"
327
case "$curl_cv_need_header_lber_h" in
329
AC_DEFINE_UNQUOTED(NEED_LBER_H, 1,
330
[Define to 1 if you need the lber.h header file even with ldap.h])
337
dnl CURL_CHECK_HEADER_LDAP
338
dnl -------------------------------------------------
339
dnl Check for compilable and valid ldap.h header
341
AC_DEFUN([CURL_CHECK_HEADER_LDAP], [
342
AC_REQUIRE([CURL_CHECK_HEADER_LBER])dnl
343
AC_CACHE_CHECK([for ldap.h], [ac_cv_header_ldap_h], [
347
#ifdef HAVE_WINDOWS_H
348
#ifndef WIN32_LEAN_AND_MEAN
349
#define WIN32_LEAN_AND_MEAN
353
#ifdef HAVE_SYS_TYPES_H
354
#include <sys/types.h>
357
#ifndef LDAP_DEPRECATED
358
#define LDAP_DEPRECATED 1
365
LDAP *ldp = ldap_init("dummy", LDAP_PORT);
366
int res = ldap_unbind(ldp);
369
ac_cv_header_ldap_h="yes"
371
ac_cv_header_ldap_h="no"
374
case "$ac_cv_header_ldap_h" in
376
AC_DEFINE_UNQUOTED(HAVE_LDAP_H, 1,
377
[Define to 1 if you have the ldap.h header file.])
383
dnl CURL_CHECK_HEADER_LDAP_SSL
384
dnl -------------------------------------------------
385
dnl Check for compilable and valid ldap_ssl.h header
387
AC_DEFUN([CURL_CHECK_HEADER_LDAP_SSL], [
388
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
389
AC_CACHE_CHECK([for ldap_ssl.h], [ac_cv_header_ldap_ssl_h], [
393
#ifdef HAVE_WINDOWS_H
394
#ifndef WIN32_LEAN_AND_MEAN
395
#define WIN32_LEAN_AND_MEAN
399
#ifdef HAVE_SYS_TYPES_H
400
#include <sys/types.h>
403
#ifndef LDAP_DEPRECATED
404
#define LDAP_DEPRECATED 1
412
#include <ldap_ssl.h>
414
LDAP *ldp = ldapssl_init("dummy", LDAPS_PORT, 1);
417
ac_cv_header_ldap_ssl_h="yes"
419
ac_cv_header_ldap_ssl_h="no"
422
case "$ac_cv_header_ldap_ssl_h" in
424
AC_DEFINE_UNQUOTED(HAVE_LDAP_SSL_H, 1,
425
[Define to 1 if you have the ldap_ssl.h header file.])
431
dnl CURL_CHECK_HEADER_LDAPSSL
432
dnl -------------------------------------------------
433
dnl Check for compilable and valid ldapssl.h header
435
AC_DEFUN([CURL_CHECK_HEADER_LDAPSSL], [
436
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
437
AC_CACHE_CHECK([for ldapssl.h], [ac_cv_header_ldapssl_h], [
441
#ifdef HAVE_WINDOWS_H
442
#ifndef WIN32_LEAN_AND_MEAN
443
#define WIN32_LEAN_AND_MEAN
447
#ifdef HAVE_SYS_TYPES_H
448
#include <sys/types.h>
452
#define NULL (void *)0
454
#ifndef LDAP_DEPRECATED
455
#define LDAP_DEPRECATED 1
465
char *cert_label = NULL;
466
LDAP *ldp = ldap_ssl_init("dummy", LDAPS_PORT, cert_label);
469
ac_cv_header_ldapssl_h="yes"
471
ac_cv_header_ldapssl_h="no"
474
case "$ac_cv_header_ldapssl_h" in
476
AC_DEFINE_UNQUOTED(HAVE_LDAPSSL_H, 1,
477
[Define to 1 if you have the ldapssl.h header file.])
483
dnl CURL_CHECK_LIBS_WINLDAP
484
dnl -------------------------------------------------
485
dnl Check for libraries needed for WINLDAP support,
486
dnl and prepended to LIBS any needed libraries.
487
dnl This macro can take an optional parameter with a
488
dnl white space separated list of libraries to check
489
dnl before the WINLDAP default ones.
491
AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [
492
AC_REQUIRE([CURL_CHECK_HEADER_WINBER])dnl
494
AC_MSG_CHECKING([for WINLDAP libraries])
508
if test -z "$u_libs"; then
511
u_libs="$u_libs $l_lib"
516
curl_cv_save_LIBS="$LIBS"
517
curl_cv_ldap_LIBS="unknown"
519
for x_nlibs in '' "$u_libs" \
521
if test -z "$x_nlibs"; then
522
LIBS="$curl_cv_save_LIBS"
524
LIBS="$x_nlibs $curl_cv_save_LIBS"
529
#ifdef HAVE_WINDOWS_H
530
#ifndef WIN32_LEAN_AND_MEAN
531
#define WIN32_LEAN_AND_MEAN
534
#ifdef HAVE_WINLDAP_H
543
BerElement *bep = ber_init(bvp);
544
LDAP *ldp = ldap_init("dummy", LDAP_PORT);
545
ULONG res = ldap_unbind(ldp);
549
curl_cv_ldap_LIBS="$x_nlibs"
554
LIBS="$curl_cv_save_LIBS"
556
case X-"$curl_cv_ldap_LIBS" in
558
AC_MSG_RESULT([cannot find WINLDAP libraries])
561
AC_MSG_RESULT([no additional lib required])
564
if test -z "$curl_cv_save_LIBS"; then
565
LIBS="$curl_cv_ldap_LIBS"
567
LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS"
569
AC_MSG_RESULT([$curl_cv_ldap_LIBS])
576
dnl CURL_CHECK_LIBS_LDAP
577
dnl -------------------------------------------------
578
dnl Check for libraries needed for LDAP support,
579
dnl and prepended to LIBS any needed libraries.
580
dnl This macro can take an optional parameter with a
581
dnl white space separated list of libraries to check
582
dnl before the default ones.
584
AC_DEFUN([CURL_CHECK_LIBS_LDAP], [
585
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
587
AC_MSG_CHECKING([for LDAP libraries])
601
if test -z "$u_libs"; then
604
u_libs="$u_libs $l_lib"
609
curl_cv_save_LIBS="$LIBS"
610
curl_cv_ldap_LIBS="unknown"
612
for x_nlibs in '' "$u_libs" \
616
'-lldapssl -lldapx -lldapsdk' \
617
'-lldapsdk -lldapx -lldapssl' ; do
618
if test -z "$x_nlibs"; then
619
LIBS="$curl_cv_save_LIBS"
621
LIBS="$x_nlibs $curl_cv_save_LIBS"
626
#ifdef HAVE_WINDOWS_H
627
#ifndef WIN32_LEAN_AND_MEAN
628
#define WIN32_LEAN_AND_MEAN
632
#ifdef HAVE_SYS_TYPES_H
633
#include <sys/types.h>
637
#define NULL (void *)0
639
#ifndef LDAP_DEPRECATED
640
#define LDAP_DEPRECATED 1
649
BerValue *bvp = NULL;
650
BerElement *bep = ber_init(bvp);
651
LDAP *ldp = ldap_init("dummy", LDAP_PORT);
652
int res = ldap_unbind(ldp);
656
curl_cv_ldap_LIBS="$x_nlibs"
661
LIBS="$curl_cv_save_LIBS"
663
case X-"$curl_cv_ldap_LIBS" in
665
AC_MSG_RESULT([cannot find LDAP libraries])
668
AC_MSG_RESULT([no additional lib required])
671
if test -z "$curl_cv_save_LIBS"; then
672
LIBS="$curl_cv_ldap_LIBS"
674
LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS"
676
AC_MSG_RESULT([$curl_cv_ldap_LIBS])
174
683
dnl CURL_CHECK_HEADER_MALLOC
175
684
dnl -------------------------------------------------
176
685
dnl Check for compilable and valid malloc.h header,
1831
2343
]) dnl end of AC_DEFUN()
1834
dnl Determine the name of the library to pass to dlopen() based on the name
1835
dnl that would normally be given to AC_CHECK_LIB. The preprocessor symbol
1836
dnl given is set to the quoted library file name.
1837
dnl The standard dynamic library file name is first generated, based on the
1838
dnl current system type, then a search is performed for that file on the
1839
dnl standard dynamic library path. If it is a symbolic link, the destination
1840
dnl of the link is used as the file name, after stripping off any minor
1841
dnl version numbers. If a library file can't be found, a guess is made.
1842
dnl This macro assumes AC_PROG_LIBTOOL has been called and requires perl
1843
dnl to be available in the PATH, or $PERL to be set to its location.
1845
dnl CURL_DLLIB_NAME(VARIABLE, library_name)
1846
dnl e.g. CURL_DLLIB_NAME(LDAP_NAME, ldap) on a Linux system might result
1847
dnl in LDAP_NAME holding the string "libldap.so.2".
1849
AC_DEFUN([CURL_DLLIB_NAME],
1851
AC_MSG_CHECKING([name of dynamic library $2])
1852
dnl The shared library extension variable name changes from version to
1853
dnl version of libtool. Try a few names then just set one statically.
1854
test -z "$shared_ext" && eval shared_ext=\"$shrext_cmds\"
1855
test -z "$shared_ext" && shared_ext="$std_shrext"
1856
test -z "$shared_ext" && shared_ext="$shrext"
1857
test -z "$shared_ext" && shared_ext=".so"
1859
dnl Create the library link name of the correct form for this platform
1860
LIBNAME_LINK_SPEC=`echo "$library_names_spec" | $SED 's/^.* //'`
1861
DLGUESSLIB=`name=$2 eval echo "$libname_spec"`
1862
DLGUESSFILE=`libname="$DLGUESSLIB" release="" major="" versuffix="" eval echo "$LIBNAME_LINK_SPEC"`
1863
dnl Last resort in case libtool knows nothing about shared libs on this platform
1864
test -z "$DLGUESSFILE" && DLGUESSFILE="$DLGUESSLIB$shared_ext"
1866
dnl Synthesize a likely dynamic library name in case we can't find an actual one
1867
SO_NAME_SPEC="$soname_spec"
1868
dnl soname_spec undefined when identical to the 1st entry in library_names_spec
1869
test -z "$SO_NAME_SPEC" && SO_NAME_SPEC=`echo "$library_names_spec" | $SED 's/ .*$//'`
1870
DLGUESSSOFILE=`libname="$DLGUESSLIB" release="" major="" versuffix="" eval echo "$SO_NAME_SPEC"`
1871
dnl Last resort in case libtool knows nothing about shared libs on this platform
1872
test -z "$DLGUESSSOFILE" && DLGUESSSOFILE="$DLGUESSFILE"
1874
if test "$cross_compiling" = yes; then
1875
dnl Can't look at filesystem when cross-compiling
1876
AC_DEFINE_UNQUOTED($1, "$DLGUESSSOFILE", [$2 dynamic library file])
1877
AC_MSG_RESULT([$DLGUESSSOFILE (guess while cross-compiling)])
1881
if test "$sys_lib_dlsearch_path_spec" ; then
1882
dnl Search for the link library name and see what it points to.
1883
for direc in $sys_lib_dlsearch_path_spec ; do
1884
DLTRYFILE="$direc/$DLGUESSFILE"
1885
dnl Find where the symbolic link for this name points
1886
changequote(<<, >>)dnl
1888
DLFOUNDFILE=`${PERL:-perl} -e 'use File::Basename; (basename(readlink($ARGV[0])) =~ /^(.*[^\d]\.\d+)[\d\.]*$/ && print ${1}) || exit 1;' "$DLTRYFILE" 2>&5`
1890
changequote([, ])dnl
1891
if test "$?" -eq "0"; then
1892
dnl Found the file link
1898
if test -z "$DLFOUNDFILE" ; then
1899
dnl Couldn't find a link library, so guess at a name.
1900
DLFOUNDFILE="$DLGUESSSOFILE"
1903
AC_DEFINE_UNQUOTED($1, "$DLFOUNDFILE", [$2 dynamic library file])
1904
AC_MSG_RESULT($DLFOUNDFILE)
1908
2345
# This is only a temporary fix. This macro is here to replace the broken one
1909
2346
# delivered by the automake project (including the 1.9.6 release). As soon as
1910
2347
# they ship a working version we SHOULD remove this work-around.