This repository has been archived by the owner on Sep 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
configure.ac
3239 lines (2813 loc) · 99 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl Copyright 1998-2018 ReOpenLDAP AUTHORS: please see AUTHORS file.
dnl All rights reserved.
dnl
dnl This file is part of ReOpenLDAP.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted only as authorized by the OpenLDAP
dnl Public License.
dnl
dnl A copy of this license is available in the file LICENSE in the
dnl top-level directory of the distribution or, alternatively, at
dnl <http://www.OpenLDAP.org/license.html>.
dnl
dnl ----------------------------------------------------------------
dnl Disable config.cache!
dnl define([AC_CACHE_LOAD], )dnl
dnl define([AC_CACHE_SAVE], )dnl
dnl ----------------------------------------------------------------
dnl Disable libtool support for languages we don't use
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])dnl
dnl ================================================================
dnl Configure.in for ReOpenLDAP
AC_COPYRIGHT([[Copyright 1992-2018 ReOpenLDAP AUTHORS: please see AUTHORS file.
All rights reserved.
This file is part of ReOpenLDAP.
Redistribution and use in source and binary forms, with or without
modification, are permitted only as authorized by the OpenLDAP
Public License.
A copy of this license is available in the file LICENSE in the
top-level directory of the distribution or, alternatively, at
<http://www.OpenLDAP.org/license.html>.]])
AC_PREREQ([2.69])dnl Required Autoconf version
AC_REVISION([$Id: 8c9139400f1cfd3f68bc9b65828515fe85e91ee1 $])
AC_INIT(
[m4_esyscmd_s(build/BRANDING --package)],
[m4_esyscmd_s(build/BRANDING --version-full)],
[m4_esyscmd_s(build/BRANDING --bugs)],
[m4_esyscmd_s(build/BRANDING --tarname)],
[m4_esyscmd_s(build/BRANDING --url)])
AC_CONFIG_MACRO_DIR([build/m4])
dnl ----------------------------------------------------------------
dnl OpenLDAP Autoconf Macros
builtin(include, build/openldap.m4)
dnl ================================================================
AC_CONFIG_AUX_DIR(build)
REOPENLDAP_REPO=""
if test -d $ac_aux_dir/../.git; then
REOPENLDAP_REPO="(from Git clone) "
fi
echo "Configuring ${PACKAGE_TITLE} ${REOPENLDAP_REPO}..."
dnl Determine host platform
dnl we try not to use this for much
AC_CANONICAL_TARGET([])
AM_INIT_AUTOMAKE([subdir-objects --warnings=all,no-override,no-portability,error dist-xz tar-pax no-dist-gzip])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([disable])
AM_PROG_AR
LT_CONFIG_LTDL_DIR([build/libltdl])
LT_INIT([dlopen])
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(PACKAGE_URL)
AC_SUBST(PACKAGE_BUGREPORT)
VERSION_NUMBER=m4_esyscmd_s([build/BRANDING --number])
AC_SUBST(VERSION_NUMBER)
VERSION_MAJOR=m4_esyscmd_s([build/BRANDING --major])
AC_SUBST(VERSION_MAJOR)
VERSION_MINOR=m4_esyscmd_s([build/BRANDING --minor])
AC_SUBST(VERSION_MINOR)
VERSION_PATCH=m4_esyscmd_s([build/BRANDING --patch])
AC_SUBST(VERSION_PATCH)
RELEASE_DATE=m4_esyscmd_s([build/BRANDING --date])
AC_SUBST(RELEASE_DATE)
RELEASE_STAMP=m4_esyscmd_s([build/BRANDING --stamp])
AC_SUBST(RELEASE_STAMP)
API_LIB_RELEASE=m4_esyscmd_s([build/BRANDING --api])
AC_SUBST(API_LIB_RELEASE)
API_LIB_VERSION=m4_esyscmd_s([build/BRANDING --so])
AC_SUBST(API_LIB_VERSION)
AC_DEFINE_UNQUOTED(REOPENLDAP_PACKAGE,"$PACKAGE",[Name of the Package])
AC_DEFINE_UNQUOTED(REOPENLDAP_VERSION,"$VERSION", [Package version as a string])
AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION,$VERSION_NUMBER, [Package version as number])
AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_MAJOR,$VERSION_MAJOR,[Major version])
AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_MINOR,$VERSION_MINOR,[Minor version])
AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_PATCH,$VERSION_PATCH,[Patch level])
AC_DEFINE_UNQUOTED(RELEASE_DATE,"$RELEASE_DATE",[Date of release])
AC_DEFINE_UNQUOTED(RELEASE_STAMP,"$RELEASE_STAMP",[Digest stamp])
AC_DEFINE_UNQUOTED(API_LIB_RELEASE,"$API_LIB_RELEASE",[API version])
AC_DEFINE_UNQUOTED(API_LIB_VERSION,"$API_LIB_VERSION",[so-lib version])
MKBANNER_CMD="\$(top_srcdir)/build/mkbanner --version '$VERSION'"
MKBANNER="\$(MKBANNER_VERBOSE_\$(V))"
MKBANNER_VERBOSE_="\$(MKBANNER_VERBOSE_\$(AM_DEFAULT_VERBOSITY))"
MKBANNER_VERBOSE_0="@echo ' GEN \$@' && ${MKBANNER_CMD}"
MKBANNER_VERBOSE_1="${MKBANNER_CMD}"
AC_SUBST(MKBANNER)
AC_SUBST(MKBANNER_VERBOSE_)
AC_SUBST(MKBANNER_VERBOSE_0)
AC_SUBST(MKBANNER_VERBOSE_1)
FIXUP_DIST="\$(SED) \
-e 's|@PACKAGE[@]|\$(PACKAGE)|Ig' \
-e 's|@VERSION[@]|\$(VERSION)|Ig' \
-e 's|@PACKAGE_URL[@]|\$(PACKAGE_URL)|Ig' \
-e 's|@PACKAGE_BUGREPORT[@]|\$(PACKAGE_BUGREPORT)|Ig' \
-e 's|@VERSION_NUMBER[@]|\$(VERSION_NUMBER)|Ig' \
-e 's|@VERSION_MAJOR[@]|\$(VERSION_MAJOR)|Ig' \
-e 's|@VERSION_MINOR[@]|\$(VERSION_MINOR)|Ig' \
-e 's|@VERSION_PATCH[@]|\$(VERSION_PATCH)|Ig' \
-e 's|@RELEASE_DATE[@]|\$(RELEASE_DATE)|Ig' \
-e 's|@RELEASE_STAMP[@]|\$(RELEASE_STAMP)|Ig' \
-e 's|@API_LIB_RELEASE[@]|\$(API_LIB_RELEASE)|Ig' \
-e 's|@API_LIB_VERSION[@]|\$(API_LIB_VERSION)|Ig'"
AC_SUBST(FIXUP_DIST)
FIXUP_DIRS="\$(SED) \
-e 's|@sysconfdir[@]|\$(sysconfdir)|Ig' \
-e 's|@datadir[@]|\$(datadir)|Ig' \
-e 's|@bindir[@]|\$(bindir)|Ig' \
-e 's|@sbindir[@]|\$(sbindir)|Ig' \
-e 's|@libexecdir[@]|\$(libexecdir)|Ig' \
-e 's|@moduledir[@]|\$(pkglibdir)|Ig' \
-e 's|@localstatedir[@]|\$(localstatedir)|Ig' \
-e 's|@runstatedir[@]|\$(runstatedir)|Ig' \
-e 's|@localedir[@]|\$(localedir)|Ig' \
-e 's|[^:/]//|/|g'"
AC_SUBST(FIXUP_DIRS)
AC_LANG([C])
AC_ARG_VAR(EXTRA_CFLAGS, [Extra build-time CFLAGS, e.g. -Wall -Werror.
Alternatively, ones can be specified or overridden by invocation 'make EXTRA_CFLAGS="a b c"'])
AC_PREFIX_DEFAULT("/opt/reopenldap")
dnl ----------------------------------------------------------------
AC_PROG_CC([gcc clang icc cc])
if test "${ac_cv_prog_cc_stdc}" = no ; then
AC_MSG_ERROR([ReOpenLDAP requires compiler to support STDC constructs.])
fi
AC_PROG_CC_C99
if test "$ac_cv_prog_cc_c99" = no; then
AC_MSG_ERROR([ReOpenLDAP requires compiler to support C99 constructs.])
fi
AC_PROG_CXX([g++ clang++ icpc c++])
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AM_PROG_CC_C_O
AC_PROG_SED
AC_PROG_GREP
AC_PROG_MKDIR_P
AC_PROG_EGREP
AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
PKG_PROG_PKG_CONFIG
if test -z "$PKG_CONFIG"; then
AC_MSG_FAILURE([pkg-config tool is required for ReOpenLDAP, please install it])
fi
LT_PREREQ([2.4.2])
LT_INIT([dlopen])
LT_OUTPUT
AC_DEFINE(_GNU_SOURCE, 1, [Enable GNU extensions.])
AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
dnl ----------------------------------------------------------------
AH_TOP([
/* begin of reldap_autoconf.h.pre */
/* Copyright 1992-2018 ReOpenLDAP AUTHORS: please see AUTHORS file.
* All rights reserved.
*
* This file is part of ReOpenLDAP.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in the file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef RELDAP_AUTOCONF_H
#define RELDAP_AUTOCONF_H
/* LY: Please do not ask us for Windows support, just never!
* But you can make a fork for Windows, or become maintainer for FreeBSD... */
#ifndef __gnu_linux__
# error "ReOpenLDAP supports only GNU Linux"
#endif
/* define this if needed to get reentrant functions */
#ifndef REENTRANT
# undef REENTRANT
#endif
#ifndef _REENTRANT
# undef _REENTRANT
#endif
/* define this if needed to get threadsafe functions */
#ifndef THREADSAFE
# undef THREADSAFE
#endif
#ifndef _THREADSAFE
# undef _THREADSAFE
#endif
#ifndef THREAD_SAFE
# undef THREAD_SAFE
#endif
#ifndef _THREAD_SAFE
# undef _THREAD_SAFE
#endif
#ifndef _SGI_MP_SOURCE
# undef _SGI_MP_SOURCE
#endif
/* end of reldap_autoconf.h.pre */
])
AH_BOTTOM([
/* begin of reldap_autoconf.h.post */
#ifdef HAVE_FEATURES_H
# include <features.h>
#endif
#ifdef HAVE_STDDEF_H
# include <stddef.h>
#endif
#ifdef HAVE_ANSIDECL_H
# include <ansidecl.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_ENDIAN_H
# include <endian.h>
#endif
/* LY: TLS which is enabled due configure */
#define RELDAP_TLS_NONE 0 /* None, --with-tls=no */
#define RELDAP_TLS_MOZNSS 1 /* Mozilla NSS, --with-tls=moznss */
#define RELDAP_TLS_GNUTLS 2 /* GnuTLS, --with-tls=gnutls */
#define RELDAP_TLS_OPENSSL 3 /* OpenSSL, --with-tls=openssl */
#ifndef REOPENLDAP_BUILDID_SUFFIX
# define REOPENLDAP_BUILDID_SUFFIX ""
#endif
#endif /* RELDAP_AUTOCONF_H */
/* end of reldap_autoconf.h.post */])
AC_CONFIG_HEADERS([reldap_autoconf.h])
AC_CONFIG_HEADERS([include/ldap_features.h])
AC_CONFIG_HEADERS([include/lber_types.h])
dnl ================================================================
dnl Start Args
AC_MSG_CHECKING(configure arguments)
dnl ----------------------------------------------------------------
dnl --with-subdir
ldap_subdir="/reopenldap"
AC_ARG_WITH(subdir,
[ --with-subdir=DIR change default subdirectory used for installs],
[case "$withval" in
no) ldap_subdir=""
;;
yes)
;;
/*|\\*)
ldap_subdir="$withval"
;;
*)
ldap_subdir="/$withval"
;;
esac
])dnl
AC_SUBST(ldap_subdir)dnl
REOPENLDAP_BUILDID_SUFFIX=
AC_ARG_WITH(buildid,
[ --with-buildid=SUFFIX specifies optional build-id suffix for version],
[case "$withval" in
no)
REOPENLDAP_BUILDID_SUFFIX=""
;;
*)
REOPENLDAP_BUILDID_SUFFIX="$withval"
;;
esac
])dnl
AC_DEFINE_UNQUOTED(REOPENLDAP_BUILDID_SUFFIX, "${REOPENLDAP_BUILDID_SUFFIX}", [BuildId suffix for Version])
AC_SUBST(REOPENLDAP_BUILDID_SUFFIX)
dnl ----------------------------------------------------------------
dnl General "enable" options
OL_ARG_ENABLE(debug,[ --enable-debug enable debug logging], yes, [no yes extra])dnl
OL_ARG_ENABLE(ci,[ --enable-ci enable Continuous Integration stuff], no, [no yes])dnl
OL_ARG_ENABLE(syslog,[ --enable-syslog enable syslog support], auto)dnl
OL_ARG_ENABLE(contrib,[ --enable-contrib enable extra plugins and overlays], no, [no yes broken])dnl
OL_ARG_ENABLE(experimental,[ --enable-experimental enable experimental and developing features], no, [no yes])dnl
OL_ARG_ENABLE(check,[ --enable-check enable internal checking and assertions], no, [no yes always default])dnl
OL_ARG_ENABLE(hipagut,[ --enable-hipagut enable internal memory allocation debugger], no, [no yes always extra])dnl
OL_ARG_ENABLE(proctitle,[ --enable-proctitle enable proctitle support], yes)dnl
dnl OL_ARG_ENABLE(referrals,[ --enable-referrals enable LDAPv2+ Referrals (experimental)], no)dnl
ol_enable_referrals=${ol_enable_referrals-no}
OL_ARG_ENABLE(ipv6,[ --enable-ipv6 enable IPv6 support], auto)dnl
OL_ARG_ENABLE(local,[ --enable-local enable AF_LOCAL (AF_UNIX) socket support], auto)dnl
OL_ARG_ENABLE(deprecated,[ --enable-deprecated enable deprecated interfaces of libreldap], no, [no yes])dnl
if test -a $ac_aux_dir/../tests/scripts/valgrind.supp; then
AX_VALGRIND_DFLT([memcheck], [on])
VALGRIND_SUPPRESSIONS_FILES=tests/scripts/valgrind.supp
AX_VALGRIND_CHECK
if test $enable_valgrind = yes; then
# PKG_CHECK_MODULES(VALGRIND, valgrind, valgrind_found=yes, valgrind_found=no)
# AC_SUBST(VALGRIND_LIBS)
# AC_SUBST(VALGRIND_CFLAGS)
AC_DEFINE(HAVE_VALGRIND,1,[define if you have Valgrind])
AC_CHECK_HEADER([valgrind/memcheck.h])
if test "$ac_cv_header_valgrind_memcheck_h" = yes; then
AC_DEFINE(USE_VALGRIND,1,[define to enable interaction with Valgrind])
else
AC_MSG_WARN([valgrind/memcheck.h required for Valgrind complete support.])
fi
fi
else
AX_VALGRIND_DFLT([memcheck], [off])
AX_VALGRIND_CHECK
fi
AC_SUBST(VALGRIND_SUPPRESSIONS_FILES)
case $ol_enable_experimental in
yes)
AC_DEFINE(LDAP_EXPERIMENTAL,1,[define as 0 to disable experimental/developing features])
;;
no)
AC_DEFINE(LDAP_EXPERIMENTAL,0,[define as 1 to enable experimental/developing features])
;;
*)
AC_MSG_FAILURE([invalid --enable-experimental value '$ol_enable_experimental'])
;;
esac
case $ol_enable_check in
yes)
AC_DEFINE_UNQUOTED(LDAP_CHECK,1 /* available */,[define as 2 to enable runtime checking by default])
;;
default)
AC_DEFINE_UNQUOTED(LDAP_CHECK,2 /* enabled */,[define as 3 to always runtime checking])
;;
always)
AC_DEFINE_UNQUOTED(LDAP_CHECK,3 /* always */,[define as 0 to disable runtime checking])
;;
no)
AC_DEFINE_UNQUOTED(LDAP_CHECK,0 /* disabled */,[define as 1 to enable runtime checking])
;;
*)
AC_MSG_FAILURE([invalid --enable-check value '$ol_enable_check'])
;;
esac
case $ol_enable_hipagut in
yes)
AC_DEFINE_UNQUOTED(LDAP_MEMORY_DEBUG,1 /* available */,[define as 2 to enable runtime checking by default])
;;
always)
AC_DEFINE_UNQUOTED(LDAP_MEMORY_DEBUG,2 /* always */,[define as 3 to always runtime checking with stats])
;;
extra)
AC_DEFINE_UNQUOTED(LDAP_MEMORY_DEBUG,3 /* extra */,[define as 0 to disable runtime checking])
;;
no)
AC_DEFINE_UNQUOTED(LDAP_MEMORY_DEBUG,0 /* disabled */,[define as 1 to enable runtime checking])
;;
*)
AC_MSG_FAILURE([invalid --enable-hipagut value '$ol_enable_hipagut'])
;;
esac
AM_CONDITIONAL([SLAPD_DEBUG], [test "$ol_enable_debug" != no])
AM_CONDITIONAL([SLAPD_DEBUG_EXTRA], [test "$ol_enable_debug" = extra])
AM_CONDITIONAL([SLAPD_SYSLOG], [test "$ol_enable_syslog" != no])
AM_CONDITIONAL([LDAP_DEPRECATED], [test "$ol_enable_deprecated" != no])
AM_CONDITIONAL([LDAP_EXPERIMENTAL], [test "$ol_enable_experimental" != no])
dnl ----------------------------------------------------------------
dnl General "with" options
OL_ARG_WITH(cyrus_sasl,[ --with-cyrus-sasl with Cyrus SASL support],
auto, [auto yes no] )
OL_ARG_WITH(gssapi,[ --with-gssapi with GSSAPI support],
auto, [auto yes no] )
OL_ARG_WITH(fetch,[ --with-fetch with fetch(3) URL support],
auto, [auto yes no] )
OL_ARG_WITH(tls,[ --with-tls with TLS/SSL support auto|openssl|gnutls|moznss],
auto, [auto openssl gnutls moznss yes no] )
OL_ARG_WITH(yielding_select,
[ --with-yielding-select with implicitly yielding select],
auto, [auto yes no manual] )
OL_ARG_WITH(mp,
[ --with-mp with multiple precision statistics auto|longlong|long|bignum|gmp],
auto, [auto longlong long bignum gmp yes no])
OL_ARG_WITH(odbc,
[ --with-odbc with specific ODBC support iodbc|unixodbc|auto],
auto, [auto iodbc unixodbc] )
dnl ----------------------------------------------------------------
dnl Server options
dnl ----------------------------------------------------------------
dnl ----------------------------------------------------------------
dnl SLAPD OPTIONS
slapd_features="slapi modules wrappers rlookups dynacl aci rewrite"
AC_ARG_ENABLE(xxslapdoptions,[
SLAPD (Standalone LDAP Daemon) Options:])
OL_ARG_ENABLE(slapd,[ --enable-slapd enable building slapd], yes)dnl
OL_ARG_ENABLE(dynacl,[ --enable-dynacl enable run-time loadable ACL support (experimental)], no)dnl
OL_ARG_ENABLE(aci,[ --enable-aci enable per-object ACIs (experimental)], no, [no yes mod])dnl
OL_ARG_ENABLE(cleartext,[ --enable-cleartext enable cleartext passwords], yes)dnl
OL_ARG_ENABLE(crypt,[ --enable-crypt enable crypt(3) passwords], no)dnl
OL_ARG_ENABLE(lmpasswd,[ --enable-lmpasswd enable LAN Manager passwords], no)dnl
OL_ARG_ENABLE(spasswd,[ --enable-spasswd enable (Cyrus) SASL password verification], no)dnl
OL_ARG_ENABLE(modules,[ --enable-modules enable dynamic module support], yes)dnl
OL_ARG_ENABLE(rewrite,[ --enable-rewrite enable DN rewriting in back-ldap and rwm overlay], auto)dnl
OL_ARG_ENABLE(rlookups,[ --enable-rlookups enable reverse lookups of client hostnames], no)dnl
OL_ARG_ENABLE(slapi,[ --enable-slapi enable SLAPI support (experimental)], no)dnl
OL_ARG_ENABLE(slp,[ --enable-slp enable SLPv2 support], no)dnl
OL_ARG_ENABLE(wrappers,[ --enable-wrappers enable tcp wrapper support], no)dnl
dnl ----------------------------------------------------------------
dnl SLAPD Backend Options
slapd_backends="mdb bdb dnssrv hdb ldap meta monitor ndb null passwd perl \
relay shell sock sql"
AC_ARG_ENABLE(xxslapbackends,[
SLAPD Backend Options:])
OL_ARG_ENABLE(backends,[ --enable-backends enable all stable/non-experimental backends],
--, [no yes mod])dnl
OL_ARG_ENABLE(mdb,[ --enable-mdb enable MDBX database backend],
yes, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(hdb,[ --enable-hdb enable Hierarchical Berkeley DB backend (obsolete)],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(bdb,[ --enable-bdb enable Berkeley DB backend (obsolete)],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(dnssrv,[ --enable-dnssrv enable dnssrv backend (experimental)],
no, [no yes mod], ol_enable_experimental)dnl
OL_ARG_ENABLE(ldap,[ --enable-ldap enable ldap backend],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(meta,[ --enable-meta enable metadirectory backend],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(monitor,[ --enable-monitor enable monitor backend],
yes, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(ndb,[ --enable-ndb enable MySQL NDB Cluster backend (experimental)],
no, [no yes mod], ol_enable_experimental)dnl
OL_ARG_ENABLE(null,[ --enable-null enable null backend],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(passwd,[ --enable-passwd enable passwd backend],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(perl,[ --enable-perl enable perl backend],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(relay,[ --enable-relay enable relay backend (experimental)],
yes, [no yes mod], ol_enable_experimental)dnl
OL_ARG_ENABLE(shell,[ --enable-shell enable shell backend],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(sock,[ --enable-sock enable sock backend],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(sql,[ --enable-sql enable SQL backend (experimental and buggy)],
no, [no yes mod], ol_enable_experimental)dnl
dnl ----------------------------------------------------------------
dnl SLAPD Overlay Options
slapd_overlays="accesslog auditlog autoca collect constraint dds deref \
dyngroup dynlist memberof ppolicy pcache refint \
retcode rwm seqmod sssvlv syncprov translucent unique \
valsort"
AC_ARG_ENABLE(xxslapoverlays,[
SLAPD Overlay Options:])
OL_ARG_ENABLE(overlays,[ --enable-overlays enable all available overlays],
--, [no yes mod])dnl
OL_ARG_ENABLE(accesslog,[ --enable-accesslog In-Directory Access Logging overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(auditlog,[ --enable-auditlog Audit Logging overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(autoca,[ --enable-autoca Automatic Certificate Authority overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(collect,[ --enable-collect Collect overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(constraint,[ --enable-constraint Attribute Constraint overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(dds,[ --enable-dds Dynamic Directory Services overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(deref,[ --enable-deref Dereference overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(dyngroup,[ --enable-dyngroup Dynamic Group overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(dynlist,[ --enable-dynlist Dynamic List overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(memberof,[ --enable-memberof Reverse Group Membership overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(ppolicy,[ --enable-ppolicy Password Policy overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(pcache,[ --enable-pcache Proxy Cache overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(refint,[ --enable-refint Referential Integrity overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(retcode,[ --enable-retcode Return Code testing overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(rwm,[ --enable-rwm Rewrite/Remap overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(seqmod,[ --enable-seqmod Sequential Modify overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(sssvlv,[ --enable-sssvlv ServerSideSort/VLV overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(syncprov,[ --enable-syncprov Syncrepl Provider overlay],
yes, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(translucent,[ --enable-translucent Translucent Proxy overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(unique,[ --enable-unique Attribute Uniqueness overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(valsort,[ --enable-valsort Value Sorting overlay],
no, [no yes mod], ol_enable_overlays)
dnl ----------------------------------------------------------------
AC_ARG_ENABLE(xxliboptions,[
Library Generation & Linking Options])
LTDL_INIT([recursive])
AC_ENABLE_STATIC
AC_ENABLE_SHARED
dnl ----------------------------------------------------------------
# Kerberos and Heimdal
PKG_CHECK_MODULES(KRB5, krb5 krb5-gssapi, krb5_found=yes, krb5_found=no)
AC_SUBST(KRB5_LIBS)
AC_SUBST(KRB5_CFLAGS)
AM_CONDITIONAL([KRB5_AVAIL], [test $krb5_found = yes])
PKG_CHECK_MODULES(HEIMDAL, heimdal-krb5 heimdal-kadm-server, heimdal_found=yes, heimdal_found=no)
AC_SUBST(HEIMDAL_LIBS)
AC_SUBST(HEIMDAL_CFLAGS)
AM_CONDITIONAL([HEIMDAL_AVAIL], [test $heimdal_found = yes])
if test $heimdal_found == yes; then
AC_MSG_CHECKING([for hdb_generate_key_set_password() signature])
saved_cflags="$CFLAGS"
CFLAGS="$CFLAGS $HEIMDAL_CFLAGS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <heimdal/hdb.h>]],
[[krb5_context context; krb5_principal principal; Key *key; size_t size;]
[krb5_error_code rc = hdb_generate_key_set_password(context, principal, "", &key, &size);]
[return (int) rc;]])
],[
AC_MSG_RESULT([modern])
AC_DEFINE(HAVE_MODERN_HDB_GENERATE_KEY_SET_PASSWORD, 1, [Does hdb_generate_key_set_password() signature is modern])
],[
AC_MSG_RESULT([legacy])
])
CFLAGS="$saved_cflags"
fi
dnl ----------------------------------------------------------------
# libsodium (argon2 hash)
PKG_CHECK_MODULES(LIBSODIUM, [libsodium >= 1.0.9], libsodium_found=yes, libsodium_found=no)
AC_SUBST(LIBSODIUM_LIBS)
AC_SUBST(LIBSODIUM_CFLAGS)
AM_CONDITIONAL([LIBSODIUM_AVAIL], [test $libsodium_found = yes])
dnl ----------------------------------------------------------------
# validate options
for o in $slapd_features $slapd_backends $slapd_overlays; do
eval "ol_value=\$ol_enable_$o"
if test $ol_enable_slapd = no -a $ol_value != no; then
AC_MSG_ERROR([slapd disabled, therefore --enable-$o=$ol_value unavailable ])
elif test $ol_enable_modules = no -a $ol_value = mod; then
AC_MSG_ERROR([dynamic modules disabled, therefore --enable-$o=$ol_value unavailable ])
fi
done
if test $ol_enable_contrib != no; then
if test $ol_enable_slapd = no ; then
AC_MSG_ERROR([slapd disabled, therefore --enable-contrib unavailable ])
else
if test $ol_enable_modules = no; then
AC_MSG_ERROR([dynamic modules disabled, therefore contrib-overlays unavailable ])
fi
if test $ol_enable_slapi = no; then
AC_MSG_WARN([SLAPI disabled, therefore slapi contrib-pluginus unavailable ])
fi
if test $ol_enable_dynacl = no; then
AC_MSG_WARN([dynamic ACL disabled, therefore acl contrib-pluginus unavailable ])
fi
fi
if test $ol_enable_contrib = broken -a $ol_enable_experimental != yes; then
AC_MSG_WARN([experimental features disabled, therefore broken-contrib-modules unavailable ])
fi
if test $heimdal_found != yes; then
AC_MSG_WARN([$HEIMDAL_PKG_ERRORS, therefore depended contrib-modules unavailable ])
fi
if test $libsodium_found != yes; then
AC_MSG_WARN([$LIBSODIUM_PKG_ERRORS, therefore depended contrib-modules unavailable ])
fi
CRACKLIB_LIBS=
CRACKLIB_CFLAGS=
CRACKLIB_DICTPATH=
AC_CHECK_HEADERS(crack.h)
if test $ac_cv_header_crack_h = yes; then
AC_CHECK_LIB(crack, FascistCheck, [have_cracklib=yes], [have_cracklib=false])
if test $have_cracklib = yes; then
CRACKLIB_LIBS=-lcrack
AC_DEFINE(HAVE_CRACKLIB, 1, [define if you have cracklib])
else
AC_MSG_WARN([libcrack-devel is needed for 'check_password' contrib-module ])
fi
fi
if test -s "/usr/share/cracklib/pw_dict"; then
CRACKLIB_DICTPATH="/usr/share/cracklib/pw_dict"
else
CRACKLIB_DICTPATH="/var/cache/cracklib/cracklib_dict"
fi
AC_SUBST(CRACKLIB_LIBS)
AC_SUBST(CRACKLIB_CFLAGS)
AC_SUBST(CRACKLIB_DICTPATH)
if test $krb5_found != yes; then
AC_MSG_WARN([krb5-devel is needed for 'gssacl' contrib-module ])
fi
fi
if test $ol_enable_slapd != no ; then
be=
for o in $slapd_backends; do
eval "ol_value=\$ol_enable_$o"
if test $ol_enable_slapd != no; then
be=$o
break
fi
done
if test -z "$be"; then
AC_MSG_WARN([no backend specified, slapd will be used ldif])
fi
fi
if test $ol_enable_meta/$ol_enable_ldap = yes/no ; then
AC_MSG_ERROR([--enable-meta requires --enable-ldap])
fi
if test $ol_enable_spasswd = yes ; then
if test $ol_with_cyrus_sasl = no ; then
AC_MSG_ERROR([options require --with-cyrus-sasl])
fi
ol_with_cyrus_sasl=yes
fi
dnl ----------------------------------------------------------------
dnl Initialize vars
LTHREAD_LIBS=
LUTIL_LIBS=
SLAPD_LIBS=
SLAPD_BACKENDS_LIST="ldif $slapd_backends"
SLAPD_STATIC_BACKENDS=ldif
SLAPD_DYNAMIC_BACKENDS=
SLAPD_OVERLAYS_LIST=$slapd_overlays
SLAPD_STATIC_OVERLAYS=
SLAPD_DYNAMIC_OVERLAYS=
BDB_LIBS=
BDB_INCLUDES=
NDB_LIBS=
NDB_INCLUDES=
NDB_LDFLAGS=
NDB_RDIR=
PERL_LIBS=
PERL_CPPFLAGS=
PERL_LDFLAGS=
PERL_RDIR=
SQL_LIBS=
SQL_INCLUDES=
TLS_LIBS=
TLS_CFLAGS=
TLS_FALLBACK_LIBS=
TLS_FALLBACK_CFLAGS=
GSSAPI_LIBS=
SASL_LIBS=
SLAPI_LIBS=
AUTH_LIBS=
#ICU_LIBS=
SLAPD_SLP_LIBS=
SLAPD_GMP_LIBS=
SLAPD_TCPWRAP_LIBS=
dnl ================================================================
dnl Checks for programs
dnl ----------------------------------------------------------------
dnl Perl
ol_link_perl=no
if test $ol_enable_perl != no ; then
AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl)
if test -z "$PERLBIN"; then
AC_MSG_ERROR([could not locate perl])
fi
PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
PERL_LIBS="`$PERLBIN -MExtUtils::Embed -e ldopts | sed -e 's/^-L /-L/g' -e 's/^-l /-l/g' | tr -s '[[:space:]]' '\n' | grep -e '^-l' | grep -v '^-lc$' | tr '\n' ' '`"
PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts | sed -e 's/^-L /-L/g' -e 's/^-l /-l/g' | tr -s '[[:space:]]' '\n' | grep -v -e '^-l' | tr '\n' ' '`"
if test -z "$PERL_CPPFLAGS" -o -z "$PERL_LIBS"; then
AC_MSG_ERROR([could not fetch perl libs or options])
fi
PERL_RDIR="`echo $PERL_LDFLAGS | tr '[[:space:]]' '\n' | grep -- '-Wl,-rpath,' | sed 's/-Wl,-rpath,/-R/'`"
save_LIBS=$LIBS
save_CPPFLAGS=$CPPFLAGS
save_LDFLAGS=$LDFLAGS
CPPFLAGS="$CPPFLAGS $PERL_CPPFLAGS"
LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
AC_SEARCH_LIBS(perl_construct, [`echo $PERL_LIBS | sed 's/^-l//;s/ -l/ /g'`], [ol_link_perl=yes])
LDFLAGS=$save_LDFLAGS
CPPFLAGS=$save_CPPFLAGS
LIBS=$save_LIBS
if test $ol_link_perl = no -a $ol_enable_perl = yes ; then
AC_MSG_ERROR([libperl not found (libperl-dev installed?)])
fi
dnl should check perl version
fi
dnl ----------------------------------------------------------------
dnl Checks for file extensions
AC_EXEEXT
AC_OBJEXT
AC_DEFINE_UNQUOTED(EXEEXT, "${EXEEXT}", [defined to be the EXE extension])
dnl ----------------------------------------------------------------
dnl Check for module support
if test $ol_enable_modules != no -o $ol_enable_slapi != no; then
# The lt_dladvise_init symbol was added with libtool-2.2
if test yes != "$with_included_ltdl"; then
save_CPPFLAGS=$CPPFLAGS
save_LDFLAGS=$LDFLAGS
CPPFLAGS="$CPPFLAGS $LTDLINCL"
LDFLAGS="$LDFLAGS $LIBLTDL"
AC_CHECK_LIB([ltdl], [lt_dladvise_init],
[],
[AC_MSG_ERROR([installed libltdl is too old])])
LDFLAGS=$save_LDFLAGS
CPPFLAGS=$save_CPPFLAGS
fi
else
for be in $slapd_backends; do
eval "ol_tmp=\$ol_enable_$be"
if test $ol_tmp = mod ; then
AC_MSG_WARN([building static $be backend])
eval "ol_enable_$be=yes"
fi
done
for ov in $slapd_overlays; do
eval "ol_tmp=\$ol_enable_$ov"
if test $ol_tmp = mod ; then
AC_MSG_WARN([building static $ov overlay])
eval "ol_enable_$ov=yes"
fi
done
fi
dnl ----------------------------------------------------------------
dnl Checks for header files.
OL_HEADER_STDC
if test $ol_cv_header_stdc != yes; then
AC_MSG_WARN([could not locate Standard C compliant headers])
fi
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_HEADER_TIOCGWINSZ
AC_CHECK_HEADERS( \
ansidecl.h \
arpa/inet.h \
arpa/nameser.h \
assert.h \
bits/types.h \
conio.h \
crypt.h \
direct.h \
errno.h \
endian.h \
features.h \
fcntl.h \
filio.h \
getopt.h \
grp.h \
inttypes.h \
io.h \
libutil.h \
limits.h \
locale.h \
malloc.h \
memory.h \
psap.h \
pwd.h \
process.h \
sgtty.h \
shadow.h \
stddef.h \
string.h \
strings.h \
stdint.h \
sysexits.h \
sys/file.h \
sys/filio.h \
sys/fstyp.h \
sys/errno.h \
sys/ioctl.h \
sys/param.h \
sys/privgrp.h \
sys/resource.h \
sys/select.h \
sys/socket.h \
sys/stat.h \
sys/syslog.h \
sys/time.h \
sys/types.h \
sys/uio.h \
sys/vmount.h \
syslog.h \
termios.h \
unistd.h \
utime.h \
dirent.h \
ndir.h \
sys/ndir.h \
sys/dir.h \
)
AC_CHECK_HEADERS( resolv.h, [], [],
[$ac_includes_default
#include <netinet/in.h>
])
AC_CHECK_HEADERS( netinet/tcp.h, [], [],
[$ac_includes_default
#include <netinet/in.h>
])
AC_CHECK_HEADERS( sys/ucred.h, [], [],
[$ac_includes_default
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
])
dnl Check whether ucred is defined without _GNU_SOURCE
AC_MSG_CHECKING(for struct ucred)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/ucred.h>
#include <sys/socket.h>
]], [[
struct ucred sucred; sucred.pid=0;
]])],[has_ucred=yes],[has_ucred=no])
AC_MSG_RESULT($has_ucred)
if test ${has_ucred} = no ; then CFLAGS="$CFLAGS -D_GNU_SOURCE"; fi
dnl ----------------------------------------------------------------
dnl Checks for libraries
AC_CHECK_FUNCS( sigaction sigset )
dnl Find socket()
dnl Likely combinations:
dnl -lsocket [ -lnsl_s | -lnsl ]
dnl -linet
AC_CHECK_FUNC(socket, :, [
dnl hopefully we won't include too many libraries
AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(net, socket)
AC_CHECK_LIB(nsl_s, main)
AC_CHECK_LIB(nsl, main)
AC_CHECK_LIB(inet, socket)
AC_CHECK_LIB(gen, main)
])
dnl require select
AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
if test "${ac_cv_header_winsock_h}" != yes; then
dnl Select arg types
dnl (if this detection becomes permanent, it and the select() detection
dnl should be done before the yielding select test)
AC_FUNC_SELECT_ARGTYPES
fi
dnl check to see if system call automatically restart
dnl AC_SYS_RESTARTABLE_SYSCALLS
dnl ----------------------------------------------------------------
AC_CHECK_FUNCS( poll )
if test $ac_cv_func_poll = yes; then
AC_CHECK_HEADERS( poll.h sys/poll.h )
fi
dnl ----------------------------------------------------------------
AC_CHECK_HEADERS( sys/epoll.h )
if test "${ac_cv_header_sys_epoll_h}" = yes; then
AC_MSG_CHECKING(for epoll system call)
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv)
{
int epfd = epoll_create(256);
exit (epfd == -1 ? 1 : 0);
}]])],[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_EPOLL,1, [define if your system supports epoll])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
fi
dnl ----------------------------------------------------------------
AC_CHECK_HEADERS( sys/devpoll.h )
dnl "/dev/poll" needs <sys/poll.h> as well...
if test "${ac_cv_header_sys_devpoll_h}" = yes \
-a "${ac_cv_header_poll_h}" = yes ; \
then
AC_MSG_CHECKING(for /dev/poll)
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv)
{
int devpollfd = open("/dev/poll", /* O_RDWR */ 2);
exit (devpollfd == -1 ? 1 : 0);
}]])],[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DEVPOLL,1, [define if your system supports /dev/poll])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
fi
dnl ----------------------------------------------------------------
OL_STRERROR
dnl ----------------------------------------------------------------
# checks for backtrace feature
AC_CHECK_HEADERS(unistd.h signal.h fcntl.h execinfo.h ucontext.h sys/prctl.h sys/syscall.h sys/resource.h sys/wait.h linux/limits.h,,DONT_HAVE_ENOUGH4BACKTRACE=yes)
if test "$DONT_HAVE_ENOUGH4BACKTRACE" != yes; then
AC_DEFINE(HAVE_ENOUGH4BACKTRACE,1,[define if target platform have enough for backtrace feature])
AC_CHECK_HEADERS(bfd.h libelf.h gelf.h)
AC_CHECK_LIB(elf, elf_begin, have_libelf=yes)
AC_CHECK_LIB(bfd, bfd_openr, have_libbfd=yes)
if test "$ac_cv_header_libelf_h" = yes -a "$ac_cv_header_gelf_h" = yes -a "$have_libelf" = yes; then
AC_DEFINE(HAVE_LIBELF,1,[define 1 if you have libelf])
SLAPD_LIBS="$SLAPD_LIBS -lelf"
if test "$ac_cv_header_bfd_h" = yes -a "$have_libbfd" = yes; then
AC_DEFINE(HAVE_LIBBFD,1,[define 1 if you have libbfd])
SLAPD_LIBS="$SLAPD_LIBS -lbfd"
fi