forked from samba-team/samba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
6762 lines (5962 loc) · 216 KB
/
configure.in
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 Process this file with autoconf to produce a configure script.
dnl We must use autotools 2.54 or above
AC_PREREQ(2.54)
AC_INIT([Samba],[3],[[email protected]])
AC_CONFIG_SRCDIR([include/includes.h])
AC_CONFIG_HEADER(include/autoconf/config.h)
AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h])
case "$PATH" in
*/usr/ucb*)
AC_MSG_WARN([\$PATH contains /usr/ucb - build errors may follow])
;;
esac
builddir=`pwd`
AC_SUBST(builddir)
m4_include(m4/samba_version.m4)
m4_include(m4/check_path.m4)
m4_include(pkg.m4)
AC_LIBREPLACE_CC_CHECKS
AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR
m4_include(../lib/tevent/libtevent.m4)
m4_include(../lib/ccan/libccan.m4)
LIBTEVENT_OBJ0=""
for obj in ${TEVENT_OBJ}; do
LIBTEVENT_OBJ0="${LIBTEVENT_OBJ0} ${teventdir}/${obj}"
done
AC_SUBST(LIBTEVENT_OBJ0)
LIBS="${LIBS} ${TEVENT_LIBS}"
SAMBA_CPPFLAGS="-Iinclude/autoconf -Iinclude -I${srcdir-.}/include -I. -I${srcdir-.}"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/replace"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TEVENT_CFLAGS}"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${CCAN_CFLAGS}"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/librpc"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/.."
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/tdb_compat"
SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/popt"
## cleanup the $(srcdir) in the Makefile if we are outside of the tree
if test "x${srcdir-.}" != "x."; then
SAMBA_CPPFLAGS=`echo ${SAMBA_CPPFLAGS} | sed -e "s;${srcdir};\$\(srcdir\);g"`
fi
dnl Unique-to-Samba variables we'll be playing with.
AC_SUBST(SAMBA_CPPFLAGS)
AC_SUBST(SHELL)
AC_SUBST(LDSHFLAGS)
AC_SUBST(SONAMEFLAG)
AC_SUBST(SHLD)
AC_SUBST(MODULE_EXPORTS)
AC_SUBST(DSO_EXPORTS)
AC_SUBST(HOST_OS)
AC_SUBST(PICFLAG)
AC_SUBST(PIE_CFLAGS)
AC_SUBST(PIE_LDFLAGS)
AC_SUBST(RELRO_LDFLAGS)
AC_SUBST(SHLIBEXT)
AC_SUBST(INSTALLLIBCMD_SH)
AC_SUBST(INSTALLLIBCMD_A)
AC_SUBST(UNINSTALLLIBCMD_SH)
AC_SUBST(UNINSTALLLIBCMD_A)
AC_SUBST(INSTALL_LIBWBCLIENT)
AC_SUBST(UNINSTALL_LIBWBCLIENT)
AC_SUBST(LIBWBCLIENT_SHARED_TARGET)
AC_SUBST(LIBWBCLIENT_SHARED_TARGET_SOVER)
AC_SUBST(LIBWBCLIENT_SHARED_TARGET_FULLVER)
AC_SUBST(LIBWBCLIENT_SHARED)
AC_SUBST(LIBWBCLIENT_STATIC_TARGET)
AC_SUBST(LIBWBCLIENT_STATIC)
AC_SUBST(LIBWBCLIENT_SOVER)
AC_SUBST(LIBWBCLIENT_FULLVER)
AC_SUBST(LIBWBCLIENT)
AC_SUBST(LIBWBCLIENT_LIBS)
AC_SUBST(LIBSAMBAUTIL_SHARED)
AC_SUBST(PRINT_LIBS)
AC_SUBST(AUTH_LIBS)
AC_SUBST(ACL_LIBS)
AC_SUBST(PASSDB_LIBS)
AC_SUBST(IDMAP_LIBS)
AC_SUBST(KRB5_LIBS)
AC_SUBST(UUID_LIBS)
AC_SUBST(LDAP_LIBS)
AC_SUBST(GPEXT_LIBS)
AC_SUBST(PAM_MODULES)
AC_SUBST(INSTALL_PAM_MODULES)
AC_SUBST(UNINSTALL_PAM_MODULES)
AC_SUBST(NSS_MODULES)
AC_SUBST(EXTRA_BIN_PROGS)
AC_SUBST(CIFSMOUNT_PROGS)
AC_SUBST(INSTALL_CIFSMOUNT)
AC_SUBST(UNINSTALL_CIFSMOUNT)
AC_SUBST(CIFSUMOUNT_PROGS)
AC_SUBST(INSTALL_CIFSUMOUNT)
AC_SUBST(UNINSTALL_CIFSUMOUNT)
AC_SUBST(CIFSUPCALL_PROGS)
AC_SUBST(INSTALL_CIFSUPCALL)
AC_SUBST(UNINSTALL_CIFSUPCALL)
AC_SUBST(EXTRA_SBIN_PROGS)
AC_SUBST(EXTRA_ALL_TARGETS)
AC_SUBST(CONFIG_LIBS)
AC_SUBST(NSCD_LIBS)
# compile with optimization and without debugging by default, but
# allow people to set their own preference.
# do this here since AC_CACHE_CHECK apparently sets the CFLAGS to "-g -O2"
# if it has no value. This prevent *very* large debug binaries from occurring
# by default.
if test "x$debug" = "xyes" ; then
CFLAGS="${CFLAGS} -g"
fi
if test "x$CFLAGS" = x; then
CFLAGS="-O"
fi
m4_include(../lib/socket_wrapper/config.m4)
m4_include(../lib/nss_wrapper/config.m4)
m4_include(../lib/uid_wrapper/config.m4)
m4_include(m4/swat.m4)
DEVELOPER_CFLAGS="-DDEBUG_PASSWORD -DDEVELOPER"
# Probe the gcc version for extra CFLAGS. We always stash these in
# DEVELOPER_CFLAGS, so that you can turn them on and off with a simple
# Makefile edit, avoiding the need to re-run configure.
if test x"$ac_cv_prog_gcc" = x"yes" ; then
DEVELOPER_CFLAGS="${DEVELOPER_CFLAGS} -g -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings"
# Add -Wdeclaration-after-statement if compiler supports it
AC_CACHE_CHECK(
[that the C compiler understands -Wdeclaration-after-statement],
samba_cv_HAVE_Wdeclaration_after_statement, [
AC_TRY_RUN_STRICT([
int main(void)
{
return 0;
}],[$CFLAGS -Wdeclaration-after-statement],[$CPPFLAGS],[$LDFLAGS],
samba_cv_HAVE_Wdeclaration_after_statement=yes,
samba_cv_HAVE_Wdeclaration_after_statement=no,
samba_cv_HAVE_Wdeclaration_after_statement=cross)
])
if test x"$samba_cv_HAVE_Wdeclaration_after_statement" = x"yes"; then
DEVELOPER_CFLAGS="${DEVELOPER_CFLAGS} -Wdeclaration-after-statement"
fi
#-Werror-implicit-function-declaration
AC_CACHE_CHECK(
[that the C compiler understands -Werror-implicit-function-declaration],
samba_cv_HAVE_Werror_implicit_function_declaration, [
AC_TRY_RUN_STRICT([
int main(void)
{
return 0;
}],[$CFLAGS -Werror-implicit-function-declaration],[$CPPFLAGS],[$LDFLAGS],
samba_cv_HAVE_Werror_implicit_function_declaration=yes,
samba_cv_HAVE_Werror_implicit_function_declaration=no,
samba_cv_HAVE_Werror_implicit_function_declaration=cross)
])
if test x"$samba_cv_HAVE_Werror_implicit_function_declaration" = x"yes"; then
DEVELOPER_CFLAGS="${DEVELOPER_CFLAGS} -Werror-implicit-function-declaration"
fi
# krb5developer is like developer, except we don't get
# -Wstrict-prototypes.
if test x"$krb5_developer" != x"$yes" ; then
DEVELOPER_CFLAGS="$DEVELOPER_CFLAGS -Wstrict-prototypes"
fi
if test x"$picky_developer" = x"yes"; then
DEVELOPER_CFLAGS="$DEVELOPER_CFLAGS -Werror"
fi
fi
#################################################
# check for a shared memory profiling support
AC_MSG_CHECKING(whether to use profiling)
AC_ARG_WITH(profiling-data,
[AS_HELP_STRING([--with-profiling-data], [Include gathering source code profile information (default=no)])],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_PROFILE,1,[Whether to use profiling])
samba_cv_WITH_PROFILE=yes
;;
*)
AC_MSG_RESULT(no)
samba_cv_WITH_PROFILE=no
;;
esac ],
AC_MSG_RESULT(no)
)
dnl Checks for programs.
AC_ARG_ENABLE(smbtorture4,
[AS_HELP_STRING([--enable-smbtorture4], [Enable building smbtorture4 (default=auto)])])
if test x$enable_smbtorture4 != xno; then
smbtorture4_possible=yes
else
smbtorture4_possible=no
fi
AC_PROG_INSTALL
AC_PROG_AWK
# Check for GNU make
m4_include(../m4/check_make.m4)
AC_SAMBA_GNU_MAKE([true], [true])
# Check for perl
m4_include(../m4/check_perl.m4)
AC_SAMBA_PERL([true], [smbtorture4_possible=no])
# Check for python
m4_include(../m4/check_python.m4)
AC_SAMBA_PYTHON_DEVEL([true], [smbtorture4_possible=no])
AC_CHECK_TOOL(AR, ar)
dnl Check if we (actually our C compiler!) use GNU ld
AC_PROG_LD_GNU
dnl Certain versions of GNU ld the default is not to have the
dnl --allow-shlib-undefined flag defined. This causes a stackload of
dnl warnings when building modules.
if test "$ac_cv_prog_gnu_ld" = "yes"; then
ac_cv_gnu_ld_version=`$CC -Wl,-v /dev/null 2>&1 < /dev/null | grep "GNU ld"`
AC_MSG_CHECKING(GNU ld release date)
changequote(,)dnl
ac_cv_gnu_ld_date=`echo $ac_cv_gnu_ld_version | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
changequote([,])dnl
AC_MSG_RESULT(${ac_cv_gnu_ld_date})
if test -n "$ac_cv_gnu_ld_date"; then
if test "$ac_cv_gnu_ld_date" -lt 20030217; then
ac_cv_gnu_ld_no_default_allow_shlib_undefined=yes
fi
if test "$ac_cv_gnu_ld_date" -gt 20030101; then
ac_cv_gnu_ld_version_script=yes
fi
else
AC_MSG_CHECKING(GNU ld release version)
changequote(,)dnl
ac_cv_gnu_ld_vernr=`echo $ac_cv_gnu_ld_version | awk '{print $NF}' | sed -n 's,\([1-9][0-9]*\.[0-9][0-9]*\).*$,\1,p'`
ac_cv_gnu_ld_vernr_major=`echo $ac_cv_gnu_ld_vernr | cut -d '.' -f 1`
ac_cv_gnu_ld_vernr_minor=`echo $ac_cv_gnu_ld_vernr | cut -d '.' -f 2`
changequote([,])dnl
AC_MSG_RESULT(${ac_cv_gnu_ld_vernr})
AC_MSG_CHECKING(GNU ld release version major)
AC_MSG_RESULT(${ac_cv_gnu_ld_vernr_major})
AC_MSG_CHECKING(GNU ld release version minor)
AC_MSG_RESULT(${ac_cv_gnu_ld_vernr_minor})
if test "$ac_cv_gnu_ld_vernr_major" -lt 2 || test "$ac_cv_gnu_ld_vernr_minor" -lt 14; then
ac_cv_gnu_ld_no_default_allow_shlib_undefined=yes
fi
if test "$ac_cv_gnu_ld_vernr_major" -gt 2 || test "$ac_cv_gnu_ld_vernr_major" = 2 && test "$ac_cv_gnu_ld_vernr_minor" -ge 12; then
ac_cv_gnu_ld_version_script=yes
fi
fi
fi
dnl Check if C compiler understands -c and -o at the same time
AC_PROG_CC_C_O
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
BROKEN_CC=
else
BROKEN_CC=#
fi
AC_SUBST(BROKEN_CC)
dnl Check if the C compiler understands -Werror (GNU)
AC_CACHE_CHECK([that the C compiler understands -Werror],samba_cv_HAVE_Werror, [
AC_TRY_RUN_STRICT([
int main(void)
{
return 0;
}],[$CFLAGS -Werror],[$CPPFLAGS],[$LDFLAGS],
samba_cv_HAVE_Werror=yes,samba_cv_HAVE_Werror=no,samba_cv_HAVE_Werror=cross)])
if test x"$samba_cv_HAVE_Werror" = x"yes"; then
Werror_FLAGS="-Werror"
else
dnl Check if the C compiler understands -w2
AC_CACHE_CHECK([that the C compiler understands -w2],samba_cv_HAVE_w2, [
AC_TRY_RUN_STRICT([
int main(void)
{
return 0;
}],[$CFLAGS -w2],[$CPPFLAGS],[$LDFLAGS],
samba_cv_HAVE_w2=yes,samba_cv_HAVE_w2=no,samba_cv_HAVE_w2=cross)])
if test x"$samba_cv_HAVE_w2" = x"yes"; then
Werror_FLAGS="-w2"
else
dnl Check if the C compiler understands -errwarn (Sun)
AC_CACHE_CHECK([that the C compiler understands -errwarn],samba_cv_HAVE_errwarn, [
AC_TRY_RUN_STRICT([
int main(void)
{
return 0;
}],[$CFLAGS -errwarn=%all],[$CPPFLAGS],[$LDFLAGS],
samba_cv_HAVE_errwarn=yes,samba_cv_HAVE_errwarn=no,samba_cv_HAVE_errwarn=cross)])
if test x"$samba_cv_HAVE_errwarn" = x"yes"; then
Werror_FLAGS="-errwarn=%all"
else
dnl Check if the C compiler understands -qhalt (IBM)
AC_CACHE_CHECK([that the C compiler understands -qhalt],samba_cv_HAVE_qhalt, [
AC_TRY_RUN_STRICT([
int main(void)
{
return 0;
}],[$CFLAGS -qhalt=w],[$CPPFLAGS],[$LDFLAGS],
samba_cv_HAVE_qhalt=yes,samba_cv_HAVE_qhalt=no,samba_cv_HAVE_qhalt=cross)])
if test x"$samba_cv_HAVE_qhalt" = x"yes"; then
Werror_FLAGS="-qhalt=w"
fi
fi
fi
fi
############################################
# check if the compiler can handle negative enum values
# and don't truncate the values to INT_MAX
# a runtime test is needed here
AC_SUBST(PIDL_ARGS)
AC_CACHE_CHECK([that the C compiler understands negative enum values],samba_cv_CC_NEGATIVE_ENUM_VALUES, [
AC_TRY_RUN(
[
#include <stdio.h>
enum negative_values { NEGATIVE_VALUE = 0xFFFFFFFF };
int main(void) {
enum negative_values v1 = NEGATIVE_VALUE;
unsigned v2 = NEGATIVE_VALUE;
if (v1 != 0xFFFFFFFF) {
printf("%u != 0xFFFFFFFF\n", v1);
return 1;
}
if (v2 != 0xFFFFFFFF) {
printf("%u != 0xFFFFFFFF\n", v2);
return 1;
}
return 0;
}
],
samba_cv_CC_NEGATIVE_ENUM_VALUES=yes,samba_cv_CC_NEGATIVE_ENUM_VALUES=no)])
if test x"$samba_cv_CC_NEGATIVE_ENUM_VALUES" != x"yes"; then
AC_MSG_WARN([using --uint-enums for pidl])
PIDL_ARGS="$PIDL_ARGS --uint-enums"
fi
dnl Figure out the flags to support named structure initializers
LIBREPLACE_C99_STRUCT_INIT([],[AC_MSG_ERROR([c99 structure initializer are not supported])])
UNAME_S=`(uname -s) 2>/dev/null` || UNAME_S="unknown"
AC_MSG_CHECKING(uname -s)
AC_MSG_RESULT(${UNAME_S})
UNAME_R=`(uname -r) 2>/dev/null` || UNAME_R="unknown"
AC_MSG_CHECKING(uname -r)
AC_MSG_RESULT(${UNAME_R})
UNAME_M=`(uname -m) 2>/dev/null` || UNAME_M="unknown"
AC_MSG_CHECKING(uname -m)
AC_MSG_RESULT(${UNAME_M})
UNAME_P=`(uname -p) 2>/dev/null` || UNAME_P="unknown"
AC_MSG_CHECKING(uname -p)
AC_MSG_RESULT(${UNAME_P})
UNAME_I=`(uname -i) 2>/dev/null` || UNAME_I="unknown"
AC_MSG_CHECKING(uname -i)
AC_MSG_RESULT(${UNAME_I})
dnl Add #include for broken IRIX header files
case "$host_os" in
*irix6*)
#TODO add to libreplace
if test x"$ac_cv_prog_gcc" != x"yes" ; then
dnl Fix sensible defaults for MIPSPro compilers. The
dnl error numbers are valid for the 7.3 compilers,
dnl hopefully also valid for the 7.4 series.
dnl
dnl Bugzilla 3801. Force an error on warning 1035
dnl so we don't incorrectly detect stdint.h. This
dnl warning is emitted for #error directives.
CFLAGS="$CFLAGS -diag_error 1035"
dnl 1209: Controlling expression is constant
dnl 1174: Function foo declared but never referenced
dnl 3201: Parameter foo was never referenced
CFLAGS="$CFLAGS -woff 1209,1174,3201"
fi
;;
esac
DYNEXP=
AC_SUBST(DYNEXP)
LDSHFLAGS_Z_DEFS=
AC_SUBST(LDSHFLAGS_Z_DEFS)
LDSHFLAGS_Z_NODEFS=
AC_SUBST(LDSHFLAGS_Z_NODEFS)
dnl Add modules that have to be built by default here
dnl These have to be built static:
default_static_modules=""
default_static_modules="$default_static_modules pdb_smbpasswd"
default_static_modules="$default_static_modules pdb_tdbsam"
default_static_modules="$default_static_modules pdb_wbc_sam"
default_static_modules="$default_static_modules rpc_lsarpc"
default_static_modules="$default_static_modules rpc_samr"
default_static_modules="$default_static_modules rpc_winreg"
default_static_modules="$default_static_modules rpc_initshutdown"
default_static_modules="$default_static_modules rpc_dssetup"
default_static_modules="$default_static_modules rpc_wkssvc"
default_static_modules="$default_static_modules rpc_svcctl"
default_static_modules="$default_static_modules rpc_ntsvcs"
default_static_modules="$default_static_modules rpc_netlogon"
default_static_modules="$default_static_modules rpc_netdfs"
default_static_modules="$default_static_modules rpc_srvsvc"
default_static_modules="$default_static_modules rpc_spoolss"
default_static_modules="$default_static_modules rpc_eventlog"
default_static_modules="$default_static_modules auth_sam"
default_static_modules="$default_static_modules auth_unix"
default_static_modules="$default_static_modules auth_winbind"
default_static_modules="$default_static_modules auth_wbc"
default_static_modules="$default_static_modules auth_server"
default_static_modules="$default_static_modules auth_domain"
default_static_modules="$default_static_modules auth_builtin"
default_static_modules="$default_static_modules vfs_default"
default_static_modules="$default_static_modules nss_info_template"
dnl These are preferably build shared, and static if dlopen() is not available
default_shared_modules=""
default_shared_modules="$default_shared_modules vfs_recycle"
default_shared_modules="$default_shared_modules vfs_audit"
default_shared_modules="$default_shared_modules vfs_extd_audit"
default_shared_modules="$default_shared_modules vfs_full_audit"
default_shared_modules="$default_shared_modules vfs_netatalk"
default_shared_modules="$default_shared_modules vfs_fake_perms"
default_shared_modules="$default_shared_modules vfs_default_quota"
default_shared_modules="$default_shared_modules vfs_readonly"
default_shared_modules="$default_shared_modules vfs_cap"
default_shared_modules="$default_shared_modules vfs_expand_msdfs"
default_shared_modules="$default_shared_modules vfs_shadow_copy"
default_shared_modules="$default_shared_modules vfs_shadow_copy2"
default_shared_modules="$default_shared_modules auth_script"
default_shared_modules="$default_shared_modules vfs_readahead"
default_shared_modules="$default_shared_modules vfs_xattr_tdb"
default_shared_modules="$default_shared_modules vfs_streams_xattr"
default_shared_modules="$default_shared_modules vfs_streams_depot"
default_shared_modules="$default_shared_modules vfs_acl_xattr"
default_shared_modules="$default_shared_modules vfs_acl_tdb"
default_shared_modules="$default_shared_modules vfs_smb_traffic_analyzer"
default_shared_modules="$default_shared_modules vfs_preopen"
default_shared_modules="$default_shared_modules vfs_catia"
default_shared_modules="$default_shared_modules vfs_scannedonly"
default_shared_modules="$default_shared_modules vfs_crossrename"
default_shared_modules="$default_shared_modules vfs_linux_xfs_sgid"
default_shared_modules="$default_shared_modules vfs_time_audit"
default_shared_modules="$default_shared_modules idmap_autorid"
if test "x$developer" = xyes; then
default_static_modules="$default_static_modules rpc_rpcecho pdb_ads"
default_static_modules="$default_static_modules auth_netlogond"
default_shared_modules="$default_shared_modules perfcount_test"
fi
#
# Config CPPFLAG settings for strange OS's that must be set
# before other tests. Do NOT invoke AC_CHECK_HEADERS within this
# case statement; its first reference must be unconditional.
#
case "$host_os" in
*hpux*)
#
# Defines needed for HPUX support.
# HPUX has bigcrypt but (sometimes?) doesn't use it for
# password hashing - hence the USE_BOTH_CRYPT_CALLS define.
#
case `uname -r` in
*9*|*10*|*11)
AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls])
;;
esac
;;
#
# CRAY Unicos has broken const handling
*unicos*)
AC_MSG_RESULT([disabling const])
CPPFLAGS="$CPPFLAGS -Dconst="
;;
#
# AIX4.x doesn't even admit to having large
# files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
#
*aix4*)
AC_MSG_RESULT([enabling large file support])
CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
AC_DEFINE(_LARGE_FILES, 1, [Whether to enable large file support])
;;
#
# Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
# to the existance of large files..
#
# Solaris uses SYSV printing. Make sure to set that here. --jerry
#
*solaris*)
AC_DEFINE(SYSV, 1, [Whether to enable System V compatibility])
LDFLAGS="$LDFLAGS -lthread"
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
;;
#
# IRIX uses SYSV printing. Make sure to set that here
#
*irix*)
AC_DEFINE(SYSV, 1, [Whether to enable System V compatibility])
;;
*freebsd*|*dragonfly*)
AC_DEFINE(FREEBSD, 1, [Whether the host os is FreeBSD])
;;
#
# VOS may need to have POSIX support and System V compatibility enabled.
#
*vos*)
case "$CPPFLAGS" in
*-D_POSIX_C_SOURCE*)
;;
*)
CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Whether to enable POSIX support])
;;
esac
case "$CPPFLAGS" in
*-D_SYSV*|*-D_SVID_SOURCE*)
;;
*)
CPPFLAGS="$CPPFLAGS -D_SYSV"
AC_DEFINE(_SYSV, 1, [Whether to enable System V compatibility])
esac
;;
# GNU systems
#
*linux* | *hurd* | gnu* | k*bsd*-gnu | kopensolaris*-gnu)
CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
;;
#
# MacOS X is the *only* system that uses compose character in utf8. This
# is so horribly broken....
#
*darwin*)
AC_DEFINE(BROKEN_UNICODE_COMPOSE_CHARACTERS, 1, [Does this system use unicode compose characters])
# Add a system specific charset module.
default_shared_modules="$default_shared_modules"
;;
*qnx*)
;;
esac
SAVE_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${SAMBA_CONFIGURE_CPPFLAGS}"
AC_LIBREPLACE_BROKEN_CHECKS
AC_CHECK_FUNCS([syslog],[],[AC_MSG_ERROR([Required function not found])])
AC_LIBREPLACE_NETWORK_CHECKS
CPPFLAGS="${SAVE_CPPFLAGS}"
LIBREPLACE_DIR=`echo ${libreplacedir} | sed -e "s;${srcdir};;" -e "s;^/;;"`
LIBREPLACE_OBJS="${LIBREPLACEOBJ}"
AC_SUBST(LIBREPLACE_OBJS)
LIBREPLACE_LIBS="${LIBREPLACE_NETWORK_LIBS}"
AC_SUBST(LIBREPLACE_LIBS)
# add -ldl to the global LIBS
LIBS="${LIBS} ${LIBDL} ${LIBREPLACE_NETWORK_LIBS}"
AUTH_LIBS="${AUTH_LIBS} ${CRYPT_LIBS}"
AC_CHECK_HEADERS(aio.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h)
AC_CHECK_HEADERS(unistd.h grp.h sys/id.h memory.h alloca.h)
AC_CHECK_HEADERS(limits.h float.h libintl.h)
AC_CHECK_HEADERS(rpc/rpc.h rpcsvc/nis.h rpcsvc/ypclnt.h)
AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/prctl.h sys/sysctl.h)
AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h)
AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h)
AC_CHECK_HEADERS(sys/sysmacros.h)
AC_CHECK_HEADERS(sys/syslog.h syslog.h)
AC_CHECK_HEADERS(langinfo.h locale.h)
AC_CHECK_HEADERS(xfs/libxfs.h)
AC_CHECK_HEADERS(netgroup.h)
AC_CHECK_HEADERS(linux/falloc.h)
AC_CHECK_HEADERS(sys/uuid.h)
AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h)
AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[
#if HAVE_RPC_RPC_H
#include <rpc/rpc.h>
#endif
]])
CRYPTO_MD5_OBJ=
if test "x$ac_cv_header_CommonCrypto_CommonDigest_h" != "xyes"
then
CRYPTO_MD5_OBJ="../lib/crypto/md5.o"
fi
AC_SUBST(CRYPTO_MD5_OBJ)
## These fail to compile on IRIX so just check for their presence
AC_CHECK_HEADERS(sys/mode.h,,,)
# Look for Darwin headers
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-Iinclude $CPPFLAGS"
AC_CHECK_HEADERS([CoreFoundation/CFStringEncodingConverter.h], [], [AC_CHECK_HEADERS([CFStringEncodingConverter.h])])
CPPFLAGS="$old_CPPFLAGS"
# To link lib/util/charset/charset_macosxfs.c, we need to tell the linker
# about CoreFoundation, at least on os X 10.6 and 10.7
case "$host_os" in
*darwin11*|*darwin10*)
LDFLAGS="$LDFLAGS -framework CoreFoundation"
;;
esac
# In valgrind 1.0.x, it's just valgrind.h. In 1.9.x+ there's a
# subdirectory of headers.
AC_CHECK_HEADERS(valgrind.h valgrind/valgrind.h valgrind/memcheck.h)
if test x"$enable_developer" = x"yes" ; then
if test x"$ac_cv_header_valgrind_h" = xyes -o \
x"$ac_cv_header_valgrind_valgrind_h" = xyes ; then
AC_DEFINE(VALGRIND,1,[Whether we have valgrind headers])
fi
fi
#
# HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
# This causes configure to fail to detect it. Check for shadow separately on HPUX.
#
case "$host_os" in
*hpux*)
AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
if test x"$ac_cv_header_shadow_h" = x"yes"; then
AC_DEFINE(HAVE_SHADOW_H,1,[Whether we have shadow.h])
fi
;;
esac
AC_CHECK_HEADERS(shadow.h)
AC_CHECK_HEADERS(nss.h nss_common.h nsswitch.h ns_api.h sys/security.h)
AC_CHECK_HEADERS(syscall.h sys/syscall.h)
AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h)
AC_CHECK_HEADERS(sys/ea.h sys/proplist.h)
AC_CHECK_HEADERS(sys/cdefs.h glob.h)
# For experimental utmp support (lastlog on some BSD-like systems)
AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
AC_CHECK_SIZEOF(int,cross)
AC_CHECK_SIZEOF(long,cross)
AC_CHECK_SIZEOF(long long,cross)
AC_CHECK_SIZEOF(short,cross)
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
AC_C_CHAR_UNSIGNED
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_STRUCT_ST_RDEV
AC_DIRENT_D_OFF
AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_TYPE(wchar_t, unsigned short)
############################################
# for cups support we need libcups, and a handful of header files
AC_ARG_ENABLE(cups,
[AS_HELP_STRING([--enable-cups], [Turn on CUPS support (default=auto)])])
if test x$enable_cups != xno; then
AC_PATH_PROG(CUPS_CONFIG, cups-config)
if test "x$CUPS_CONFIG" != x; then
ac_save_LDFLAGS=$LDFLAGS
ac_save_PRINT_LIBS=$PRINT_LIBS
AC_CHECK_HEADERS(cups/cups.h cups/language.h)
if test x"$ac_cv_header_cups_cups_h" = xyes -a \
x"$ac_cv_header_cups_language_h" = xyes; then
# try linking with -lcups alone first. That should work unless libcups is
# underlinked. With cups-config --libs we pull in unwanted and unneeded
# dendencies including thread libraries - use cups-config only if really
# required.
AC_CHECK_LIB_EXT(cups, ac_save_PRINT_LIBS , httpConnect,
[PRINT_LIBS="$ac_save_PRINT_LIBS -lcups"],
[AC_MSG_WARN([your cups library doesn't link with -lcups alone, it might be underlinked.]) ;
PRINT_LIBS="$ac_save_PRINT_LIBS `$CUPS_CONFIG --libs`"])
AC_DEFINE(HAVE_CUPS,1,[Whether we have CUPS])
samba_cv_HAVE_CUPS=yes
AC_CHECK_LIB_EXT(cups, PRINT_LIBS, httpConnectEncrypt)
else
AC_MSG_WARN([cups-config around but cups-devel not installed])
CFLAGS=$ac_save_CFLAGS
LDFLAGS=$ac_save_LDFLAGS
PRINT_LIBS=$ac_save_PRINT_LIBS
fi
elif test x"$enable_cups" = x"yes"; then
AC_MSG_ERROR(Cups support required but cups-config not located. Make sure cups-devel related files are installed.)
fi
fi
AC_ARG_ENABLE(iprint,
[AS_HELP_STRING([--enable-iprint], [Turn on iPrint support (default=yes if cups is yes)])])
if test x$enable_iprint != xno; then
if test x"$samba_cv_HAVE_CUPS" = xyes; then
AC_DEFINE(HAVE_IPRINT,1,[Whether we have iPrint])
elif test x"$enable_iprint" = x"yes"; then
AC_MSG_ERROR(iPrint support required but cups not enabled. Make sure cups-devel related files are installed and that cups is enabled.)
fi
fi
############################################
# check if the compiler will optimize out function calls
AC_CACHE_CHECK([if the compiler will optimize out function calls],samba_cv_optimize_out_funcation_calls, [
AC_TRY_LINK([
#include <stdio.h>],
[
if (0) {
this_function_does_not_exist();
} else {
return 1;
}
],
samba_cv_optimize_out_funcation_calls=yes,samba_cv_optimize_out_funcation_calls=no)])
if test x"$samba_cv_optimize_out_funcation_calls" = x"yes"; then
AC_DEFINE(HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS,1,[Whether the compiler will optimize out function calls])
fi
#############################################
# check for fd passing struct via msg_control
AC_CACHE_CHECK([for fd passing via msg_control],samba_cv_msghdr_msg_control, [
AC_TRY_COMPILE([
#include <sys/types.h>
#include <stdlib.h>
#include <stddef.h>
#include <sys/socket.h>
#include <sys/un.h>],
[
struct msghdr msg;
union {
struct cmsghdr cm;
char control[CMSG_SPACE(sizeof(int))];
} control_un;
msg.msg_control = control_un.control;
msg.msg_controllen = sizeof(control_un.control);
],
samba_cv_msghdr_msg_control=yes,samba_cv_msghdr_msg_control=no)])
if test x"$samba_cv_msghdr_msg_control" = x"yes"; then
AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL,1,
[If we can use msg_control for passing file descriptors])
fi
#############################################
# check for fd passing struct via msg_acctrights
AC_CACHE_CHECK([for fd passing via msg_acctrights],
samba_cv_msghdr_msg_acctrights, [
AC_TRY_COMPILE([
#include <sys/types.h>
#include <stdlib.h>
#include <stddef.h>
#include <sys/socket.h>
#include <sys/un.h>],
[
struct msghdr msg;
int fd;
msg.msg_acctrights = (caddr_t) &fd;
msg.msg_acctrightslen = sizeof(fd);
],
samba_cv_msghdr_msg_acctrights=yes,samba_cv_msghdr_msg_acctrights=no)])
if test x"$samba_cv_msghdr_msg_acctrights" = x"yes"; then
AC_DEFINE(HAVE_MSGHDR_MSG_ACCTRIGHTS,1,
[If we can use msg_acctrights for passing file descriptors])
fi
AC_CHECK_FUNCS(dirfd)
if test x"$ac_cv_func_dirfd" = x"yes"; then
default_shared_modules="$default_shared_modules vfs_syncops vfs_dirsort"
fi
AC_CACHE_CHECK([for struct sigevent type],samba_cv_struct_sigevent, [
AC_TRY_COMPILE([
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
#include <signal.h>],[struct sigevent s;],
samba_cv_struct_sigevent=yes,samba_cv_struct_sigevent=no)])
if test x"$samba_cv_struct_sigevent" = x"yes"; then
AC_DEFINE(HAVE_STRUCT_SIGEVENT,1,[Whether we have the struct sigevent])
AC_CHECK_MEMBERS([struct sigevent.sigev_value.sival_ptr,struct sigevent.sigev_value.sigval_ptr], , ,
[#include <signal.h>])
fi
# and glibc has setresuid under linux but the function does
# nothing until kernel 2.1.44! very dumb.
AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
AC_TRY_RUN([#include <errno.h>
main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
if test x"$samba_cv_have_setresuid" = x"yes"; then
AC_DEFINE(HAVE_SETRESUID,1,[Whether the system has setresuid])
fi
# Do the same check for setresguid...
#
AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
AC_TRY_RUN([#include <unistd.h>
#include <errno.h>
main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
if test x"$samba_cv_have_setresgid" = x"yes"; then
AC_DEFINE(HAVE_SETRESGID,1,[Whether the system has setresgid])
fi
AC_FUNC_MEMCMP
###############################################
# Readline included by default unless explicitly asked not to
test "${with_readline+set}" != "set" && with_readline=yes
# test for where we get readline() from
AC_MSG_CHECKING(whether to use readline)
AC_ARG_WITH(readline,
[AS_HELP_STRING([--with-readline[=DIR]], [Look for readline include/libs in DIR (default=auto)])],
[ case "$with_readline" in
yes)
AC_MSG_RESULT(yes)
AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
AC_CHECK_HEADERS(readline/history.h)
AC_CHECK_HEADERS(readline.h readline/readline.h,[
for termlib in ncurses curses termcap terminfo termlib tinfo; do
AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
done
AC_CHECK_LIB(readline, rl_callback_handler_install,
[TERMLIBS="-lreadline $TERMLIBS"
AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
break], [TERMLIBS=], $TERMLIBS)])
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
# Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
# alternate readline path
_ldflags=${LDFLAGS}
_cppflags=${CPPFLAGS}
# Add additional search path
LDFLAGS="-L$with_readline/lib $LDFLAGS"
CPPFLAGS="-I$with_readline/include $CPPFLAGS"
AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
AC_CHECK_HEADERS(readline/history.h)
AC_CHECK_HEADERS(readline.h readline/readline.h,[
for termlib in ncurses curses termcap terminfo termlib; do
AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
done
AC_CHECK_LIB(readline, rl_callback_handler_install,
[TERMLDFLAGS="-L$with_readline/lib"
TERMCPPFLAGS="-I$with_readline/include"
CPPFLAGS="-I$with_readline/include $CPPFLAGS"
TERMLIBS="-lreadline $TERMLIBS"
AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
LDFLAGS=$_ldflags
;;
esac],
AC_MSG_RESULT(no)
)
AC_SUBST(TERMLIBS)
AC_SUBST(TERMLDFLAGS)
# The readline API changed slightly from readline3 to readline4, so
# code will generate warnings on one of them unless we have a few
# special cases.
AC_CHECK_LIB(readline, rl_completion_matches,
[AC_DEFINE(HAVE_NEW_LIBREADLINE, 1,
[Do we have rl_completion_matches?])],
[],
[$TERMLIBS])
# not all readline libs have rl_event_hook or history_list
AC_CHECK_DECLS(rl_event_hook, [], [], [#include <readline/readline.h>])
AC_CHECK_LIB(readline, history_list,
[AC_DEFINE(HAVE_HISTORY_LIST, 1, [Do we have history_list?])],
[],
[$TERMLIBS])
###############################################
# test for where we get yp_get_default_domain() from
AC_SEARCH_LIBS(yp_get_default_domain, [nsl])
AC_CHECK_FUNCS(yp_get_default_domain)
# Check if we have execl, if not we need to compile smbrun.
AC_CHECK_FUNCS(execl)
if test x"$ac_cv_func_execl" = x"no"; then
EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun"
fi
AC_CHECK_FUNCS(getcwd fchown chmod fchmod mknod mknod64)
AC_CHECK_FUNCS(strtol)
AC_CHECK_FUNCS(strchr chflags)
AC_CHECK_FUNCS(getrlimit fsync setpgid)
AC_CHECK_FUNCS(fdatasync,,[AC_CHECK_LIB_EXT(rt, LIBS, fdatasync)])
AC_CHECK_FUNCS(setsid glob strpbrk crypt16 getauthuid)
AC_CHECK_FUNCS(sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
AC_CHECK_FUNCS(initgroups select rdchk getgrnam getgrent pathconf)
AC_CHECK_FUNCS(getgrset)
AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf)
AC_CHECK_FUNCS(atexit grantpt posix_fallocate)
AC_CHECK_FUNCS(fallocate)
AC_CHECK_FUNCS(fseeko setluid getpwanam)
AC_CHECK_FUNCS(fdopendir)
AC_CHECK_FUNCS(getpwent_r)
AC_CHECK_FUNCS(setenv strcasecmp fcvt fcvtl)
AC_CHECK_FUNCS(syslog vsyslog timegm)
AC_CHECK_FUNCS(setlocale)
AC_CHECK_FUNCS(nanosleep,,[AC_CHECK_LIB_EXT(rt, LIBS, nanosleep)])
AC_CHECK_FUNCS(lutimes futimes utimensat futimens)
AC_CHECK_FUNCS(mlock munlock mlockall munlockall)
AC_CHECK_FUNCS(memalign posix_memalign hstrerror)
AC_CHECK_HEADERS(sys/mman.h)
# setbuffer, shmget, shm_open are needed for smbtorture
AC_CHECK_FUNCS(shmget shm_open)
AC_CHECK_FUNCS(gettext dgettext)
AC_CHECK_FUNCS(bindtextdomain textdomain bind_textdomain_codeset)
AC_CHECK_FUNCS(strupr)
# Find a method of generating a stack trace
AC_CHECK_HEADERS(execinfo.h libexc.h libunwind.h)
# libexecinfo provides backtrace_symbols on FreeBSD
AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
AC_CHECK_FUNCS(backtrace_symbols)
AC_CHECK_LIB(exc, trace_back_stack)
# check for sysctlbyname and sysctl for BSD systems
AC_CHECK_FUNCS(sysctlbyname)
AC_CHECK_FUNCS(sysctl)
#################################################
# Check to see if core dump directory is defined in linux
# with /proc/sys/kernel/core_pattern
AC_CHECK_FILE([/proc/sys/kernel/core_pattern],
AC_DEFINE(HAVE_SYS_KERNEL_PROC_CORE_PATTERN, 1,
[Whether Linux kernel uses core_pattern for core files]),
[])
#############################