-
Notifications
You must be signed in to change notification settings - Fork 95
/
configure.ac
947 lines (856 loc) · 30.8 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([dirsrv],[1.0],[http://bugzilla.redhat.com/])
# AC_CONFIG_HEADER must be called right after AC_INIT.
AC_CONFIG_HEADERS([config.h])
# include the version information
. $srcdir/VERSION.sh
AC_MSG_NOTICE(This is configure for $PACKAGE_TARNAME $PACKAGE_VERSION)
AM_INIT_AUTOMAKE([1.9 foreign subdir-objects dist-bzip2 no-dist-gzip no-define tar-pax])
AC_SUBST([RPM_VERSION])
AC_SUBST([RPM_RELEASE])
AC_SUBST([VERSION_PREREL])
AC_SUBST([CONSOLE_VERSION])
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIRS([m4])
# Checks for programs.
: ${CXXFLAGS=""}
AC_PROG_CXX
: ${CFLAGS=""}
AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_AS
PKG_PROG_PKG_CONFIG
# disable static libs by default - we only use a couple
AC_DISABLE_STATIC
LT_INIT
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h syslog.h unistd.h mntent.h sys/sysinfo.h sys/endian.h endian.h])
# These are *required* headers without option.
AC_CHECK_HEADERS([inttypes.h], [], AC_MSG_ERROR([unable to locate required header inttypes.h]))
AC_CHECK_HEADERS([crack.h], [], AC_MSG_ERROR([unable to locate required header crack.h]))
AC_CHECK_HEADERS([lmdb.h], [], AC_MSG_ERROR([unable to locate required header lmdb.h]))
AC_CHECK_HEADERS([json-c/json.h], [], AC_MSG_ERROR([unable to locate required header json-c/json.h]))
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STAT
AC_C_CONST
AC_HEADER_STDBOOL
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([#include <sys/types.h>
#include <signal.h>
],
[return *(signal (0, 0)) (0) == 1;])],
[ac_cv_type_signal=int],
[ac_cv_type_signal=void])])
AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
(`int' or `void').])
AC_FUNC_STAT
AC_FUNC_STRERROR_R
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([endpwent ftruncate getcwd getaddrinfo inet_pton inet_ntop localtime_r memmove memset mkdir munmap putenv rmdir setrlimit socket strcasecmp strchr strcspn strdup strerror strncasecmp strpbrk strrchr strstr strtol tzset])
# These functions are *required* without option.
AC_CHECK_FUNCS([clock_gettime], [], AC_MSG_ERROR([unable to locate required symbol clock_gettime]))
# This will detect if we need to add the LIBADD_DL value for us.
LT_LIB_DLLOAD
# Optional rust component support.
AC_MSG_CHECKING(for --enable-rust-offline)
AC_ARG_ENABLE(rust_offline, AS_HELP_STRING([--enable-rust-offline], [Enable rust building offline. you MUST have run vendor! (default: no)]),
[], [ enable_rust_offline=no ])
AC_MSG_RESULT($enable_rust_offline)
AM_CONDITIONAL([RUST_ENABLE_OFFLINE],[test "$enable_rust_offline" = yes])
AS_IF([test "$enable_rust_offline" = yes],
[rust_vendor_sources="replace-with = \"vendored-sources\""],
[rust_vendor_sources=""])
AC_SUBST([rust_vendor_sources])
if test "$enable_rust_offline" = yes; then
AC_CHECK_PROG(CARGO, [cargo], [yes], [no])
AC_CHECK_PROG(RUSTC, [rustc], [yes], [no])
AS_IF([test "$CARGO" != "yes" -o "$RUSTC" != "yes"], [
AC_MSG_FAILURE("Rust based plugins cannot be built cargo=$CARGO rustc=$RUSTC")
])
fi
# Optional cockpit support (enabled by default)
AC_MSG_CHECKING(for --enable-cockpit)
AC_ARG_ENABLE(cockpit, AS_HELP_STRING([--enable-cockpit], [Enable cockpit plugin (default: yes)]),
[], [ enable_cockpit=yes ])
AC_MSG_RESULT($enable_cockpit)
AC_SUBST([enable_cockpit])
AC_SUBST(ENABLE_COCKPIT)
AM_CONDITIONAL([ENABLE_COCKPIT],[test "$enable_cockpit" = yes])
AC_DEFINE_UNQUOTED([DS_PACKAGE_TARNAME], "$PACKAGE_TARNAME", [package tarball name])
AC_DEFINE_UNQUOTED([DS_PACKAGE_BUGREPORT], "$PACKAGE_BUGREPORT", [package bug report url])
# define these for automake distdir
PACKAGE=$PACKAGE_TARNAME
AC_DEFINE_UNQUOTED([PACKAGE], "$PACKAGE", [package tar name])
AC_MSG_CHECKING(for --enable-debug)
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debug features (default: no)]),
[], [ enable_debug=no ])
AC_MSG_RESULT($enable_debug)
if test "$enable_debug" = yes ; then
debug_defs="-DDEBUG -DMCC_DEBUG"
debug_cflags="-g3 -ggdb -gdwarf-5 -O0"
debug_cxxflags="-g3 -ggdb -gdwarf-5 -O0"
debug_rust_defs="-C debuginfo=2 -Z macro-backtrace"
cargo_defs=""
rust_target_dir="debug"
AC_DEFINE_UNQUOTED([DS_PACKAGE_VERSION], "$VERSION_MAJOR.$VERSION_MINOR.$VERSION_MAINT DEVELOPER BUILD", [package version])
AC_DEFINE_UNQUOTED([DS_PACKAGE_STRING], "$PACKAGE_TARNAME DEVELOPER BUILD", [package string])
# define these for automake distdir
VERSION="DEBUG"
AC_DEFINE_UNQUOTED([VERSION], "$VERSION", [package version])
else
debug_defs=""
# set the default safe CFLAGS that would be set by AC_PROG_CC otherwise
debug_cflags="-g -O2"
debug_cxxflags="-g -O2"
debug_rust_defs="-C debuginfo=2"
cargo_defs="--release"
rust_target_dir="release"
AC_DEFINE_UNQUOTED([DS_PACKAGE_VERSION], "$PACKAGE_VERSION", [package version])
AC_DEFINE_UNQUOTED([DS_PACKAGE_STRING], "$PACKAGE_TARNAME $PACKAGE_VERSION", [package string])
# define these for automake distdir
VERSION=$PACKAGE_VERSION
AC_DEFINE_UNQUOTED([VERSION], "$VERSION", [package version])
fi
AC_SUBST([debug_defs])
AC_SUBST([debug_cflags])
AC_SUBST([debug_cxxflags])
AC_SUBST([debug_rust_defs])
AC_SUBST([cargo_defs])
AC_SUBST([rust_target_dir])
AM_CONDITIONAL([DEBUG],[test "$enable_debug" = yes])
AC_MSG_CHECKING(for --enable-asan)
AC_ARG_ENABLE(asan, AS_HELP_STRING([--enable-asan], [Enable gcc/clang address sanitizer options (default: no)]),
[], [ enable_asan=no ])
AC_MSG_RESULT($enable_asan)
if test "$enable_asan" = yes ; then
asan_cflags="-fsanitize=address -fno-omit-frame-pointer"
asan_rust_defs="-Z sanitizer=address"
else
asan_cflags=""
asan_rust_defs=""
fi
AC_SUBST([asan_cflags])
AC_SUBST([asan_rust_defs])
AM_CONDITIONAL(enable_asan,[test "$enable_asan" = yes])
AC_MSG_CHECKING(for --enable-msan)
AC_ARG_ENABLE(msan, AS_HELP_STRING([--enable-msan], [Enable gcc/clang memory sanitizer options (default: no)]),
[], [ enable_msan=no ])
AC_MSG_RESULT($enable_msan)
if test "$enable_msan" = yes ; then
msan_cflags="-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer"
msan_rust_defs="-Z sanitizer=memory"
else
msan_cflags=""
msan_rust_defs=""
fi
AC_SUBST([msan_cflags])
AC_SUBST([msan_rust_defs])
AM_CONDITIONAL(enable_msan,test "$enable_msan" = "yes")
AC_MSG_CHECKING(for --enable-tsan)
AC_ARG_ENABLE(tsan, AS_HELP_STRING([--enable-tsan], [Enable gcc/clang thread sanitizer options (default: no)]),
[], [ enable_tsan=no ])
AC_MSG_RESULT($enable_tsan)
if test "$enable_tsan" = yes ; then
tsan_cflags="-fsanitize=thread -fno-omit-frame-pointer"
tsan_rust_defs="-Z sanitizer=thread"
else
tsan_cflags=""
tsan_rust_defs=""
fi
AC_SUBST([tsan_cflags])
AC_SUBST([tsan_rust_defs])
AM_CONDITIONAL(enable_tsan,test "$enable_tsan" = "yes")
AC_MSG_CHECKING(for --enable-ubsan)
AC_ARG_ENABLE(ubsan, AS_HELP_STRING([--enable-tsan], [Enable gcc/clang undefined behaviour sanitizer options (default: no)]),
[], [ enable_ubsan=no ])
AC_MSG_RESULT($enable_ubsan)
if test "$enable_ubsan" = yes ; then
ubsan_cflags="-fsanitize=undefined -fno-omit-frame-pointer"
ubsan_rust_defs=""
else
ubsan_cflags=""
ubsan_rust_defs=""
fi
AC_SUBST([ubsan_cflags])
AC_SUBST([ubsan_rust_defs])
AM_CONDITIONAL(enable_ubsan,test "$enable_ubsan" = "yes")
AM_CONDITIONAL(with_sanitizer,test "$enable_asan" = "yes" -o "$enable_msan" = "yes" -o "$enable_tsan" = "yes" -o "$enable_ubsan" = "yes")
AC_MSG_CHECKING(for --enable-clang)
AC_ARG_ENABLE(clang, AS_HELP_STRING([--enable-clang], [Enable clang (default: no)]),
[], [ enable_clang=no ])
AC_MSG_RESULT($enable_clang)
AM_CONDITIONAL(CLANG_ENABLE,test "$enable_clang" = "yes")
AC_MSG_CHECKING(for --enable-cfi)
AC_ARG_ENABLE(cfi, AS_HELP_STRING([--enable-cfi], [Enable control flow integrity - requires --enable-clang (default: no)]),
[], [ enable_cfi=no ])
AC_MSG_RESULT($enable_cfi)
AM_CONDITIONAL(CFI_ENABLE,test "$enable_cfi" = "yes" -a "$enable_clang" = "yes")
AM_CONDITIONAL([RPM_HARDEND_CC], [test -f /usr/lib/rpm/redhat/redhat-hardened-cc1])
AC_MSG_CHECKING(for --enable-gcc-security)
AC_ARG_ENABLE(gcc-security, AS_HELP_STRING([--enable-gcc-security], [Enable gcc secure compilation options (default: no)]),
[], [ enable_gcc_security=no ])
AC_MSG_RESULT($enable_gcc_security)
if test "$enable_gcc_security" = yes ; then
gccsec_cflags="-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -Werror=format-security"
else
# Without this, -fPIC doesn't work on generic fedora builds, --disable-gcc-sec.
gccsec_cflags=""
fi
AM_COND_IF([RPM_HARDEND_CC],
[ gccsec_cflags="$gccsec_flags -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" ],
[])
AC_SUBST([gccsec_cflags])
# Pull in profiling.
AC_MSG_CHECKING(for --enable-profiling)
AC_ARG_ENABLE(profiling, AS_HELP_STRING([--enable-profiling], [Enable gcov profiling features (default: no)]),
[], [ enable_profiling=no ])
AC_MSG_RESULT($enable_profiling)
if test "$enable_profiling" = yes ; then
profiling_defs="-fprofile-arcs -ftest-coverage -g3 -ggdb -gdwarf-5 -O0"
profiling_links="-lgcov --coverage"
else
profiling_defs=""
profiling_links=""
fi
AC_SUBST([profiling_defs])
AC_SUBST([profiling_links])
AC_MSG_CHECKING(for --enable-systemtap)
AC_ARG_ENABLE(systemtap, AS_HELP_STRING([--enable-systemtap], [Enable systemtap probe features (default: no)]),
[], [ enable_systemtap=no ])
AC_MSG_RESULT($enable_systemtap)
if test "$enable_systemtap" = yes ; then
systemtap_defs="-DSYSTEMTAP"
else
systemtap_defs=""
fi
AC_SUBST([systemtap_defs])
# these enables are for optional or experimental features
AC_MSG_CHECKING(for --enable-pam-passthru)
AC_ARG_ENABLE(pam-passthru,
AS_HELP_STRING([--enable-pam-passthru],
[enable the PAM passthrough auth plugin (default: yes)]),
[], [ enable_pam_passthru=yes ])
AC_MSG_RESULT($enable_pam_passthru)
if test "$enable_pam_passthru" = yes ; then
# check for pam header file used by plugins/pass_passthru/pam_ptimpl.c
AC_CHECK_HEADER([security/pam_appl.h], [], [AC_MSG_ERROR([Missing header file security/pam_appl.h])])
AC_DEFINE([ENABLE_PAM_PASSTHRU], [1], [enable the pam passthru auth plugin])
fi
AM_CONDITIONAL(enable_pam_passthru,test "$enable_pam_passthru" = "yes")
if test -z "$enable_dna" ; then
enable_dna=yes # if not set on cmdline, set default
fi
AC_MSG_CHECKING(for --enable-dna)
AC_ARG_ENABLE(dna,
AS_HELP_STRING([--enable-dna],
[enable the Distributed Numeric Assignment (DNA) plugin (default: yes)]))
if test "$enable_dna" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE([ENABLE_DNA], [1], [enable the dna plugin])
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(enable_dna,test "$enable_dna" = "yes")
if test -z "$enable_ldapi" ; then
enable_ldapi=yes # if not set on cmdline, set default
fi
AC_MSG_CHECKING(for --enable-ldapi)
AC_ARG_ENABLE(ldapi,
AS_HELP_STRING([--enable-ldapi],
[enable LDAP over unix domain socket (LDAPI) support (default: yes)]))
if test "$enable_ldapi" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE([ENABLE_LDAPI], [1], [enable ldapi support in the server])
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(enable_ldapi,test "$enable_ldapi" = "yes")
if test -z "$enable_autobind" ; then
enable_autobind=yes # if not set on cmdline, set default
fi
AC_MSG_CHECKING(for --enable-autobind)
AC_ARG_ENABLE(autobind,
AS_HELP_STRING([--enable-autobind],
[enable auto bind over unix domain socket (LDAPI) support (default: no)]))
if test "$enable_ldapi" = yes -a "$enable_autobind" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE([ENABLE_AUTOBIND], [1], [enable ldapi auto bind support in the server])
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(enable_autobind,test "$enable_autobind" = "yes")
if test -z "$enable_auto_dn_suffix" ; then
enable_auto_dn_suffix=no # if not set on cmdline, set default
fi
AC_MSG_CHECKING(for --enable-auto-dn-suffix)
AC_ARG_ENABLE(auto-dn-suffix,
AS_HELP_STRING([--enable-auto-dn-suffix],
[enable auto bind with auto dn suffix over unix domain socket (LDAPI) support (default: no)]))
if test "$enable_ldapi" = yes -a "$enable_autobind" = yes -a "$enable_auto_dn_suffix" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE([ENABLE_AUTO_DN_SUFFIX], [1], [enable ldapi auto bind with auto dn suffix support in the server])
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(enable_auto_dn_suffix,test "$enable_auto_dn_suffix" = "yes")
if test -z "$enable_bitwise" ; then
enable_bitwise=yes # if not set on cmdline, set default
fi
AC_MSG_CHECKING(for --enable-bitwise)
AC_ARG_ENABLE(bitwise,
AS_HELP_STRING([--enable-bitwise],
[enable the bitwise matching rule plugin (default: yes)]))
if test "$enable_bitwise" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE([ENABLE_BITWISE], [1], [enable the bitwise plugin])
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(enable_bitwise,test "$enable_bitwise" = "yes")
# Can never be enabled.
AM_CONDITIONAL(enable_presence,test "$enable_presence" = "yes")
if test -z "$enable_acctpolicy" ; then
enable_acctpolicy=yes # if not set on cmdline, set default
fi
AC_MSG_CHECKING(for --enable-acctpolicy)
AC_ARG_ENABLE(acctpolicy,
AS_HELP_STRING([--enable-acctpolicy],
[enable the account policy plugin (default: yes)]))
if test "$enable_acctpolicy" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE([ENABLE_ACCTPOLICY], [1], [enable the account policy plugin])
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(enable_acctpolicy,test "$enable_acctpolicy" = "yes")
if test -z "$enable_posix_winsync" ; then
enable_posix_winsync=yes # if not set on cmdline, set default
fi
AC_MSG_CHECKING(for --enable-posix-winsync)
AC_ARG_ENABLE(posix_winsync,
AS_HELP_STRING([--enable-posix-winsync],
[enable support for POSIX user/group attributes in winsync (default: yes)]))
if test "$enable_posix_winsync" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE([ENABLE_POSIX_WINSYNC], [1], [enable support for POSIX user/group attributes in winsync])
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(enable_posix_winsync,test "$enable_posix_winsync" = "yes")
# the default prefix - override with --prefix or --with-fhs
AC_PREFIX_DEFAULT([/opt/$PACKAGE_NAME])
# If we have no prefix specified, we need to fix the prefix variable.
# If we don't what happens is $prefixdir ends up as NONE, and then
# later configure changes $prefix to $ac_default_prefix underneath us.
if test "$prefix" = "NONE"; then
prefix=$ac_default_prefix
fi
m4_include(m4/fhs.m4)
# /run directory path
AC_ARG_WITH([localrundir],
AS_HELP_STRING([--with-localrundir=DIR],
[Runtime data directory]),
[localrundir=$with_localrundir],
[localrundir="/run"])
AC_SUBST([localrundir])
cockpitdir=/389-console
# installation paths - by default, we store everything
# under the prefix. The with-fhs option will use /usr,
# /etc, and /var. The with-fhs-opt option will use the
# prefix, but it's sysconfdir and localstatedir will be
# /etc/opt, and /var/opt.
if test "$with_fhs_opt" = "yes"; then
# Override sysconfdir and localstatedir if FHS optional
# package was requested.
prefixdir=$prefix
sysconfdir='/etc/opt'
localstatedir='/var/opt'
localrundir='/var/opt/run'
# relative to datadir
sampledatadir=/data
# relative to datadir
systemschemadir=/schema
# relative to datadir
scripttemplatedir=/script-templates
# relative to datadir
updatedir=/updates
# relative to libdir
serverdir=
# relative to includedir
serverincdir=
# relative to libdir
serverplugindir=/plugins
# relative to datadir
infdir=/inf
# relative to datadir
mibdir=/mibs
# location of property/resource files, relative to datadir
propertydir=/properties
# relative to libdir
perldir=/perl
# relative to libdir
pythondir=/python
else
if test "$with_fhs" = "yes"; then
ac_default_prefix=/usr
prefix=$ac_default_prefix
exec_prefix=$prefix
dnl as opposed to the default /usr/etc
sysconfdir='/etc'
dnl as opposed to the default /usr/var
localstatedir='/var'
localrundir='/run'
fi
prefixdir=$prefix
# relative to datadir
sampledatadir=/$PACKAGE_NAME/data
# relative to datadir
systemschemadir=/$PACKAGE_NAME/schema
# relative to datadir
scripttemplatedir=/$PACKAGE_NAME/script-templates
# relative to datadir
updatedir=/$PACKAGE_NAME/updates
# relative to libdir
serverdir=$PACKAGE_NAME
# relative to includedir
serverincdir=$PACKAGE_NAME
# relative to libdir
serverplugindir=/$PACKAGE_NAME/plugins
# relative to datadir
infdir=/$PACKAGE_NAME/inf
# relative to datadir
mibdir=/$PACKAGE_NAME/mibs
# location of property/resource files, relative to datadir
propertydir=/$PACKAGE_NAME/properties
# relative to libdir
perldir=/$PACKAGE_NAME/perl
# relative to libdir
pythondir=/$PACKAGE_NAME/python
fi
# if mandir is the default value, override it
# otherwise, the user must have set it - just use it
if test X"$mandir" = X'${prefix}/man' ; then
mandir='$(datadir)/man'
fi
# Shared paths for all layouts
# relative to sysconfdir
configdir=/$PACKAGE_NAME/config
# relative to sysconfdir
schemadir=/$PACKAGE_NAME/schema
# default user, group
defaultuser=dirsrv
defaultgroup=dirsrv
AC_MSG_CHECKING(for --with-perldir)
AC_ARG_WITH([perldir],
AS_HELP_STRING([--with-perldir=PATH],
[Directory for perl])
)
if test -n "$with_perldir"; then
if test "$with_perldir" = yes ; then
AC_MSG_ERROR([You must specify --with-perldir=/full/path/to/perl])
elif test "$with_perldir" = no ; then
with_perldir=
else
AC_MSG_RESULT([$with_perldir])
fi
else
with_perldir=
fi
AC_MSG_CHECKING(for --with-pythonexec)
AC_ARG_WITH([pythonexec],
AS_HELP_STRING([--with-pythonexec=PATH],
[Path to executable for python])
)
if test -n "$with_pythonexec"; then
if test "$with_pythonexec" = yes ; then
AC_MSG_ERROR([You must specify --with-pythonexec=/full/path/to/python])
elif test "$with_pythonexec" = no ; then
with_pythonexec=/usr/bin/python3
else
AC_MSG_RESULT([$with_pythonexec])
fi
else
with_pythonexec=/usr/bin/python3
fi
dblib=".libs/libdb-5.3-389ds.so"
AC_MSG_CHECKING(for --with-bundle-libdb)
AC_ARG_WITH([bundle-libdb],
AS_HELP_STRING([--with-bundle-libdb=PATH],
[Directory containing $dblib and db.h (if not using system libdb package)])
)
if test -n "$with_bundle_libdb"; then
if test "$with_bundle_libdb" = no ; then
with_bundle_libdb=no
elif ! test -f "$with_bundle_libdb/db.h" ; then
AC_MSG_ERROR([Directory specified with --with-bundle-libdb=fullpath should contains db.h])
elif ! test -f "$with_bundle_libdb/$dblib" ; then
AC_MSG_ERROR([Directory specified with --with-bundle-libdb=fullpath should contains $dblib])
else
AC_MSG_RESULT([$with_bundle_libdb])
fi
else
with_bundle_libdb=no
fi
AM_CONDITIONAL([BUNDLE_LIBDB],[test "$with_bundle_libdb" != no])
AC_SUBST(prefixdir)
AC_SUBST(configdir)
AC_SUBST(sampledatadir)
AC_SUBST(systemschemadir)
AC_SUBST(propertydir)
AC_SUBST(schemadir)
AC_SUBST(serverdir)
AC_SUBST(serverincdir)
AC_SUBST(serverplugindir)
AC_SUBST(scripttemplatedir)
AC_SUBST(perldir)
AC_SUBST(pythondir)
AC_SUBST(infdir)
AC_SUBST(mibdir)
AC_SUBST(mandir)
AC_SUBST(updatedir)
AC_SUBST(defaultuser)
AC_SUBST(defaultgroup)
AC_SUBST(cockpitdir)
# check for --with-instconfigdir
AC_MSG_CHECKING(for --with-instconfigdir)
AC_ARG_WITH(instconfigdir,
AS_HELP_STRING([--with-instconfigdir=/path],
[Base directory for instance specific writable configuration directories (default $sysconfdir/$PACKAGE_NAME)]),
[
if test $withval = yes ; then
AC_MSG_ERROR(Please specify a full path with --with-instconfigdir)
fi
instconfigdir="$withval"
AC_MSG_RESULT($withval)
],
[
dnl this value is expanded out in Makefile.am
instconfigdir='$(sysconfdir)/$(PACKAGE_NAME)'
AC_MSG_RESULT(no)
])
AC_SUBST(instconfigdir)
# WINNT should be true if building on Windows system not using
# cygnus, mingw, or the like and using cmd.exe as the shell
AM_CONDITIONAL([WINNT], false)
# Deal with platform dependent defines
# initdir is the location for the SysV init scripts - very heavily platform
# dependent and not specified in fhs or lsb
# and not used if systemd is used
initdir='$(sysconfdir)/rc.d'
AC_MSG_CHECKING(for --with-initddir)
AC_ARG_WITH(initddir,
AS_HELP_STRING([--with-initddir=/path],
[Absolute path (not relative like some of the other options) that should contain the SysV init scripts (default '$(sysconfdir)/rc.d')]),
[
AC_MSG_RESULT($withval)
],
[
AC_MSG_RESULT(no)
])
AM_CONDITIONAL([INITDDIR], [test -n "$with_initddir" -a "$with_initddir" != "no"])
# This will let us change over the python version easier in the future.
if test -n "$with_pythonexec"; then
pythonexec="$with_pythonexec"
else
pythonexec='/usr/bin/python3'
fi
# Default to no atomic queue operations.
with_atomic_queue="no"
# we use stty in perl scripts to disable password echo
# this doesn't work unless the full absolute path of the
# stty command is used e.g. system("stty -echo") does not
# work but system("/bin/stty -echo") does work
# since the path of stty may not be the same on all
# platforms, we set the default here to /bin/stty and
# allow that value to be overridden in the platform
# specific section below
sttyexec=/bin/stty
case $host in
*-*-linux*)
AC_DEFINE([LINUX], [1], [Linux])
AC_DEFINE([_GNU_SOURCE], [1], [GNU Source])
platform="linux"
initdir='$(sysconfdir)/rc.d/init.d'
# do arch specific linux stuff here
case $host in
i*86-*-linux*)
AC_DEFINE([CPU_x86], [], [cpu type x86])
;;
x86_64-*-linux*)
AC_DEFINE([CPU_x86_64], [1], [cpu type x86_64])
;;
aarch64-*-linux*)
AC_DEFINE([CPU_arm], [], [cpu type arm])
;;
arm-*-linux*)
AC_DEFINE([CPU_arm], [], [cpu type arm])
;;
ppc64le-*-linux*)
;;
ppc64-*-linux*)
;;
ppc-*-linux*)
;;
s390-*-linux*)
;;
s390x-*-linux*)
;;
esac
# some programs use the native thread library directly
THREADLIB=-lpthread
AC_SUBST([THREADLIB], [$THREADLIB])
LIBCRYPT=-lcrypt
AC_SUBST([LIBCRYPT], [$LIBCRYPT])
AC_DEFINE([USE_POSIX_RWLOCKS], [1], [POSIX rwlocks])
;;
*-*-freebsd*)
AC_DEFINE([FREEBSD], [1], [FreeBSD])
platform="freebsd"
initdir='$(sysconfdir)/rc.d'
THREADLIB=-lthr
AC_SUBST([THREADLIB], [$THREADLIB])
AC_DEFINE([USE_POSIX_RWLOCKS], [1], [POSIX rwlocks])
LIBDL=
;;
ia64-hp-hpux*)
AC_DEFINE([hpux], [1], [HP-UX])
AC_DEFINE([HPUX], [1], [HP-UX])
AC_DEFINE([HPUX11], [1], [HP-UX 11])
AC_DEFINE([HPUX11_23], [1], [HP-UX 11.23])
AC_DEFINE([CPU_ia64], [], [cpu type ia64])
AC_DEFINE([OS_hpux], [1], [OS HP-UX])
AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
AC_DEFINE([_INCLUDE_STDC__SOURCE_199901], [1], [to pick up all of the printf format macros in inttypes.h])
# assume 64 bit
platform="hpux"
initconfigdir="/$PACKAGE_NAME/config"
# HPUX doesn't use /etc for this
initdir=/init.d
;;
hppa*-hp-hpux*)
AC_DEFINE([hpux], [1], [HP-UX])
AC_DEFINE([HPUX], [1], [HP-UX])
AC_DEFINE([HPUX11], [1], [HP-UX 11])
AC_DEFINE([HPUX11_11], [1], [HP-UX 11.11])
AC_DEFINE([CPU_hppa], [], [cpu type pa-risc])
AC_DEFINE([OS_hpux], [1], [OS HP-UX])
AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
AC_DEFINE([_INCLUDE_STDC__SOURCE_199901], [1], [to pick up all of the printf format macros in inttypes.h])
# assume 64 bit
initconfigdir="/$PACKAGE_NAME/config"
platform="hpux"
# HPUX doesn't use /etc for this
initdir=/init.d
;;
*-*-solaris*)
AC_DEFINE([SVR4], [1], [SVR4])
AC_DEFINE([__svr4], [1], [SVR4])
AC_DEFINE([__svr4__], [1], [SVR4])
AC_DEFINE([_SVID_GETTOD], [1], [SVID_GETTOD])
AC_DEFINE([SOLARIS], [1], [SOLARIS])
AC_DEFINE([OS_solaris], [1], [OS SOLARIS])
AC_DEFINE([sunos5], [1], [SunOS5])
AC_DEFINE([OSVERSION], [509], [OS version])
AC_DEFINE([_REENTRANT], [1], [_REENTRANT])
AC_DEFINE([NO_DOMAINNAME], [1], [no getdomainname])
dnl socket nsl and dl are required to link several programs and libdb
LIBSOCKET=-lsocket
AC_SUBST([LIBSOCKET], [$LIBSOCKET])
LIBNSL=-lnsl
AC_SUBST([LIBNSL], [$LIBNSL])
LIBDL=-ldl
AC_SUBST([LIBDL], [$LIBDL])
dnl Cstd and Crun are required to link any C++ related code
LIBCSTD=-lCstd
AC_SUBST([LIBCSTD], [$LIBCSTD])
LIBCRUN=-lCrun
AC_SUBST([LIBCRUN], [$LIBCRUN])
platform="solaris"
initdir='$(sysconfdir)/init.d'
case $host in
i?86-*-solaris2.1[[0-9]]*)
dnl I dont know why i386 need this explicit
AC_DEFINE([HAVE_GETPEERUCRED], [1], [have getpeerucred])
;;
sparc-*-solaris*)
dnl includes some assembler stuff in counter.o
AC_DEFINE([CPU_sparc], [], [cpu type sparc])
TARGET='SPARC'
;;
esac
;;
*)
platform=""
;;
esac
### TO CHECK FOR SSE4.2!!!
# gcc -march=native -dM -E - < /dev/null | grep SSE
# We can just use the define in GCC instead!
AC_MSG_CHECKING([for GCC provided 64-bit atomic operations])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <inttypes.h>
]],
[[
uint64_t t_counter = 0;
uint64_t t_oldval = 0;
uint64_t t_newval = 1;
__atomic_compare_exchange_8(&t_counter, &t_oldval, t_newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
__atomic_add_fetch_8(&t_counter, t_newval, __ATOMIC_SEQ_CST);
__atomic_sub_fetch_8(&t_counter, t_newval, __ATOMIC_SEQ_CST);
__atomic_load(&t_counter, &t_oldval, __ATOMIC_SEQ_CST);
return 0;
]])],
[
AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [have 64-bit atomic operation functions provided by gcc])
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no])
]
)
# cmd line overrides default setting above
if test -n "$with_initddir" ; then
initdir="$with_initddir"
fi
# sysv init scripts not used when systemd is used
AC_SUBST(initdir)
AC_SUBST(pythonexec)
AC_SUBST(sttyexec)
# set default initconfigdir if not already set
# value will be set so as to be relative to $(sysconfdir)
if test -z "$initconfigdir" ; then
if test -d /etc/sysconfig ; then
initconfigdir=/sysconfig
elif test -d /etc/default ; then
initconfigdir=/default
else
initconfigdir="/$PACKAGE_NAME/config"
fi
fi
AC_SUBST(initconfigdir)
# Conditionals for makefile.am
AM_CONDITIONAL([HPUX],[test "$platform" = "hpux"])
AM_CONDITIONAL([SOLARIS],[test "$platform" = "solaris"])
AM_CONDITIONAL([FREEBSD],[test "$platform" = "freebsd"])
AM_CONDITIONAL([SPARC],[test "x$TARGET" = xSPARC])
# Check for library dependencies
if $PKG_CONFIG --exists nspr; then
PKG_CHECK_MODULES([NSPR], [nspr])
else
PKG_CHECK_MODULES([NSPR], [dirsec-nspr])
fi
if $PKG_CONFIG --exists nss; then
PKG_CHECK_MODULES([NSS], [nss])
nss_libdir=`$PKG_CONFIG --libs-only-L nss | sed -e s/-L// | sed -e s/\ .*$//`
else
PKG_CHECK_MODULES([NSS], [dirsec-nss])
nss_libdir=`$PKG_CONFIG --libs-only-L dirsec-nss | sed -e s/-L// | sed -e s/\ .*$//`
fi
AC_SUBST(nss_libdir)
PKG_CHECK_MODULES([OPENSSL], [openssl])
m4_include(m4/openldap.m4)
if test $with_bundle_libdb = no; then
m4_include(m4/db.m4)
else
m4_include(m4/bundle_libdb.m4)
fi
PKG_CHECK_MODULES([SASL], [libsasl2])
PKG_CHECK_MODULES([ICU], [icu-i18n >= 60.2 icu-uc >= 60.2])
m4_include(m4/netsnmp.m4)
PKG_CHECK_MODULES([KERBEROS], [krb5])
krb5_vendor=`$PKG_CONFIG --variable=vendor krb5`
if test "$krb5_vendor" = "MIT"; then
AC_DEFINE(HAVE_KRB5, 1, [Define if you have Kerberos V])
save_LIBS="$LIBS"
LIBS="$KERBEROS_LIBS"
AC_CHECK_FUNCS([krb5_cc_new_unique])
LIBS="$save_LIBS"
fi
PKG_CHECK_MODULES(
[PCRE],
[libpcre2-8],
[
AC_DEFINE(
[PCRE2_CODE_UNIT_WIDTH],
8,
[Define libpcre2 unit size]
)
]
)
m4_include(m4/selinux.m4)
m4_include(m4/systemd.m4)
AC_MSG_CHECKING(whether to enable cmocka unit tests)
AC_ARG_ENABLE(cmocka, AS_HELP_STRING([--enable-cmocka], [Enable cmocka unit tests (default: no)]))
if test "x$enable_cmocka" = "xyes"; then
AC_MSG_RESULT(yes)
PKG_CHECK_MODULES([CMOCKA], [cmocka])
AC_DEFINE([ENABLE_CMOCKA], [1], [Enable cmocka unit tests])
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL([ENABLE_CMOCKA], [test "x$enable_cmocka" = "xyes"])
m4_include(m4/doxygen.m4)
PACKAGE_BASE_VERSION=`echo $PACKAGE_VERSION | awk -F\. '{print $1"."$2}'`
AC_SUBST(PACKAGE_BASE_VERSION)
AM_CONDITIONAL(OPENLDAP,test "$with_openldap" = "yes")
# check for --with-libldap-r
AC_MSG_CHECKING(for --with-libldap-r)
AC_ARG_WITH(libldap-r, AS_HELP_STRING([--with-libldap-r],[Use lldap_r shared library (default: if OpenLDAP version is less than 2.5, then lldap_r will be used, else - lldap)]),
[
if test "$withval" = "no"; then
AC_MSG_RESULT(no)
else
with_libldap_r=yes
AC_MSG_RESULT(yes)
AC_SUBST(with_libldap_r)
fi
],
OPENLDAP_VERSION=`ldapsearch -VV 2>&1 | sed -n '/ldapsearch/ s/.*ldapsearch \([[[0-9]]]\+\.[[[0-9]]]\+\.[[[0-9]]]\+\) .*/\1/p'`
AX_COMPARE_VERSION([$OPENLDAP_VERSION], [lt], [2.5], [ with_libldap_r=yes ], [ with_libldap_r=no ])
AC_MSG_RESULT($with_libldap_r))
AM_CONDITIONAL([WITH_LIBLDAP_R],[test "$with_libldap_r" = yes])
# write out paths for binary components
AC_SUBST(ldaplib)
AC_SUBST(ldaplib_defs)
AC_SUBST(ldaptool_bindir)
AC_SUBST(ldaptool_opts)
AC_SUBST(plainldif_opts)
AC_SUBST(brand)
AC_SUBST(capbrand)
AC_SUBST(vendor)
# AC_DEFINE([USE_OLD_UNHASHED], [], [Use old unhashed code])
# Internally we use a macro function slapi_log_err() to call slapi_log_error()
# which gives us the option to do performance testing without the presence of
# logging. To remove the presence of error logging undefine LDAP_ERROR_LOGGING.
AC_DEFINE([LDAP_ERROR_LOGGING], [1], [LDAP error logging flag])
# Build our pkgconfig files
# This currently conflicts with %.in: rule in Makefile.am, which should be removed eventually.
# AC_CONFIG_FILES([ldap/admin/src/defaults.inf])
AC_CONFIG_FILES([src/pkgconfig/dirsrv.pc src/pkgconfig/libsds.pc src/pkgconfig/svrcore.pc])
AC_CONFIG_FILES([Makefile rpm/389-ds-base.spec ])
AC_CONFIG_FILES([.cargo/config.toml])
AC_OUTPUT