-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
1058 lines (813 loc) · 29.5 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
# -*- mode: m4; -*-
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# nepenthes meta-Makefile
# Maximillian Dornseif 2005
# $Id: configure.ac 1549 2008-02-14 11:45:25Z common $
AC_PREREQ(2.59)
AC_INIT([nepenthes], [0.2.2], [[email protected]])
AM_INIT_AUTOMAKE([nepenthes], [0.2.2])
AC_REVISION([$Id: configure.ac 1549 2008-02-14 11:45:25Z common $])
AC_PREFIX_DEFAULT(/opt/nepenthes)
AC_CONFIG_SRCDIR([nepenthes-core/include/Buffer.hpp])
AM_CONFIG_HEADER([config.h])
# AM_MAINTAINER_MODE
AM_CONDITIONAL(NDEBUG, test "$disable_debug" = yes)
AM_CONDITIONAL(PROFILE, test "$enable_profile" = yes)
AC_CANONICAL_HOST
AC_C_CONST
AC_C_BIGENDIAN
dnl Check for some target-specific stuff
case "$host" in
*-*-freebsd*)
# FreeBSD forgot to install magic.h in a sane location. Bug or Feature?
CPPFLAGS="$CPPFLAGS -I/usr/local/include -I/usr/src/contrib/file/"
LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
;;
*-*-linux*)
CPPFLAGS="$CPPFLAGS -D _GNU_SOURCE -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
;;
*-*-darwin*)
CPPFLAGS="$CPPFLAGS -I/opt/local/include"
LDFLAGS="$LDFLAGS -L/opt/local/lib"
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -no-cpp-precomp"
fi
;;
esac
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_PROG_YACC
AC_PROG_LEX
# Checks for header files.
#AC_HEADER_DIRENT
#AC_HEADER_STDC
#AC_HEADER_SYS_WAIT
#AC_HEADER_TIME
#AC_HEADER_STDBOOL
AC_CHECK_HEADERS([getopt.h arpa/inet.h fcntl.h memory.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h unistd.h])
dnl We ought not to have to worry about getopt.h, getopt{,1}.c,
dnl since they can always be unconditionally compiled and linked. See
dnl http://mail.gnu.org/archive/html/autoconf/2000-12/msg00049.html
dnl and surrounding thread for discussion. However that doesn't
dnl appear to work in fact, and the function in getopt_long.c has
dnl different magic to avoid getting horribly tangled up.
AC_CHECK_FUNCS(getopt)
AC_CHECK_DECLS([getopt,getsubopt,getopt_long,setenv,putenv])
AC_REPLACE_FUNCS(getopt_long getsubopt)
dnl getopt_long.c uses (and provides a replacement for)
dnl this glibc utility function
AC_CHECK_FUNCS(__strchrnul)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_UID_T
AC_STRUCT_TM
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(off_t)
AC_MSG_CHECKING([for SIGPOLL])
AC_EGREP_CPP(we_have_sigpoll,
[#include <signal.h>
#ifdef SIGPOLL
we_have_sigpoll
#endif
], AC_DEFINE([HAVE_SIGPOLL], [1], [Define to 1 if you have the sigpoll signal.]) haveSIGPOLL=yes, haveSIGPOLL=no)
AC_MSG_RESULT([$haveSIGPOLL])
AC_MSG_CHECKING([for SIGCLD])
AC_EGREP_CPP(we_have_sigcld,
[#include <signal.h>
#ifdef SIGCLD
we_have_sigcld
#endif
], AC_DEFINE([HAVE_SIGCLD], [1], [Define to 1 if you have the sigcld signal.]) haveSIGCLD=yes, haveSIGCLD=no)
AC_MSG_RESULT([$haveSIGCLD])
AC_MSG_CHECKING([for SIGPWR])
AC_EGREP_CPP(we_have_sigpwr,
[#include <signal.h>
#ifdef SIGPWR
we_have_sigpwr
#endif
], AC_DEFINE([HAVE_SIGPWR], [1], [Define to 1 if you have the sigpwr signal.]) haveSIGPWR=yes, haveSIGPWR=no)
AC_MSG_RESULT([$haveSIGPWR])
AC_MSG_CHECKING([for SIGSTKFLT])
AC_EGREP_CPP(we_have_sigstkflt,
[#include <signal.h>
#ifdef SIGSTKFLT
we_have_sigstkflt
#endif
], AC_DEFINE([HAVE_SIGSTKFLT], [1], [Define to 1 if you have the sigstkflt signal.]) haveSIGSTKFLT=yes, haveSIGSTKFLT=no)
AC_MSG_RESULT([$haveSIGSTKFLT])
AC_MSG_CHECKING([for SIGUNUSED])
AC_EGREP_CPP(we_have_sigunused,
[#include <signal.h>
#ifdef SIGUNUSED
we_have_sigunused
#endif
], AC_DEFINE([HAVE_SIGUNUSED], [1], [Define to 1 if you have the sigunused signal.]) haveSIGUNUSED=yes, haveSIGUNUSED=no)
AC_MSG_RESULT([$haveSIGUNUSED])
AC_MSG_CHECKING([for SIGINFO])
AC_EGREP_CPP(we_have_siginfo,
[#include <signal.h>
#ifdef SIGINFO
we_have_siginfo
#endif
], AC_DEFINE([HAVE_SIGINFO], [1], [Define to 1 if you have the siginfo signal.]) haveSIGINFO=yes, haveSIGINFO=no)
AC_MSG_RESULT([$haveSIGINFO])
AC_MSG_CHECKING([for SO_NOSIGPIPE])
AC_EGREP_CPP(we_have_sonosigpipe,
[#include <sys/socket.h>
#ifdef SO_NOSIGPIPE
we_have_sonosigpipe
#endif
], AC_DEFINE([HAVE_SO_NOSIGPIPE], [1], [Define to 1 if you have the SO_NOSIGPIPE socketoption.]) haveSO_NOSIGPIPE=yes, haveSO_NOSIGPIPE=no)
AC_MSG_RESULT([$haveSO_NOSIGPIPE])
AC_MSG_CHECKING(for MSG_NOSIGNAL)
AC_EGREP_CPP(we_have_MSG_NOSIGNAL,
[#include <linux/socket.h>
#ifdef MSG_NOSIGNAL
we_have_MSG_NOSIGNAL
#endif
], AC_DEFINE([HAVE_MSG_NOSIGNAL], [1], [Define to 1 if you have the MSG_NOSIGNAL socket flag.]) haveMSG_NOSIGNAL=yes, haveMSG_NOSIGNAL=no)
AC_MSG_RESULT([$haveMSG_NOSIGNAL])
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([strndup alarm bzero gethostbyname gethostname gettimeofday inet_ntoa localtime_r memmove memset munmap select socket strcasecmp strdup strerror strncasecmp strstr strtoul setresgid setresuid])
# libadns
AC_SUBST([LIB_ADNS])
# libpcre
AC_SUBST([LIB_PCRE])
# libcurl
AC_SUBST([LIB_CURL])
# libcapabilities
AC_SUBST([LIB_CAP])
# libmagic
AC_SUBST([LIB_MAGIC])
# libpq
AC_SUBST([LIB_POSTGRES])
# libprelude
AC_SUBST([LIB_PRELUDE])
AC_SUBST([LDFLAG_PRELUDE])
AC_SUBST([CPPFLAG_PRELUDE])
# libipq
AC_SUBST([LIB_IPQ])
# libpcap
AC_SUBST([LIB_PCAP])
# libnet
AC_SUBST([LIB_LIBNET])
# liby
AC_SUBST([LIB_LIBY])
# libdl
AC_SUBST([LIB_DL])
# libssh
AC_SUBST([LIB_SSH])
# libemu
AC_SUBST([LIB_EMU])
dnl **************************************************
dnl * libdl linking flag *
dnl **************************************************
enable_dl=no;
AC_CHECK_FUNC([dlopen],enable_dl="yes", enable_dl="no")
if test x$enable_dl = "xno" ; then
AC_CHECK_LIB([dl],[dlopen],enable_dl="yes", enable_dl="no")
if test x$enable_dl = "xyes" ; then
LIB_DL="-ldl"
fi
fi
if test x$enable_dl = "xno" ; then
AC_CHECK_LIB([ldld],[dlopen],enable_dl="yes", enable_dl="no")
if test x$enable_dl = "xyes" ; then
LIB_DL="-ldl"
fi
fi
dnl **************************************************
dnl * libipq support *
dnl **************************************************
enable_ipq="yes"
AC_ARG_ENABLE(ipq, [ --enable-ipq enable support for libipq],
[enable_ipq="$enableval"],[enable_ipq="yes"])
AC_ARG_WITH(ipq-include,
[ --with-ipq-include=DIR libipq include dir],
[ipq_inc="$withval"],[ipq_inc=no])
AC_ARG_WITH(ipq-lib,
[ --with-ipq-lib=DIR libipq library dir],
[ipq_lib="$withval"],[ipq_lib=no])
if test x$enable_ipq = "xyes" ; then
if test x$ipq_inc != "xno"; then
CPPFLAGS="${CPPFLAGS} -I${ipq_inc}"
fi
AC_CHECK_HEADER(libipq.h,[enable_ipq=yes],[enable_ipq=no])
if test x$enable_ipq = "xyes" ; then
if test x$ipq_lib != "xno"; then
LDFLAGS="${LDFLAGS} -L${ipq_lib}"
fi
AC_CHECK_LIB([ipq],[ipq_set_mode],enable_ipq="yes", enable_ipq="no")
if test x$enable_ipq = "xyes" ; then
LIB_IPQ="-lipq"
AC_DEFINE([HAVE_IPQ], [1], [Define to 1 if you have ip queue on linux])
fi
fi
fi
dnl **************************************************
dnl * pcap support *
dnl **************************************************
AC_ARG_ENABLE(pcap, [ --enable-pcap enable support for packet capture library],
[enable_pcap="$enableval"],[enable_pcap="yes"])
AC_ARG_WITH(pcap_include,
[ --with-pcap-include=DIR pcap include directory],
[pcap_inc="$withval"],[pcap_inc=no])
AC_ARG_WITH(pcap_lib,
[ --with-pcap-lib=DIR pcap library directory],
[pcap_lib="$withval"],[pcap_lib=no])
if test x$enable_pcap = xyes; then
if test "$pcap_inc" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${pcap_inc}"
fi
AC_CHECK_HEADER(pcap.h,[enable_pcap=yes],[enable_pcap=no])
if test x$enable_pcap != "xno"; then
if test "$pcap_lib" != "no"; then
LDFLAGS="${LDFLAGS} -L${pcap_lib}"
fi
AC_CHECK_LIB([pcap],[pcap_open_live],enable_pcap="yes", enable_pcap="no")
if test x$enable_pcap = "xyes" ; then
LIB_PCAP="-lpcap"
AC_DEFINE([HAVE_PCAP], [1], [Define to 1 if you have packet capture library])
fi
fi
fi
dnl **************************************************
dnl * ipfw support *
dnl **************************************************
AC_ARG_ENABLE(ipfw,
[ --enable-ipfw enable support for ipfw Divert on FreeBSD],
enable_ipfw="$enableval", enable_ipfw=no)
if test x$enable_ipfw = "xyes"; then
AC_DEFINE([HAVE_IPFW], [1], [Define to 1 if you want ipfw divert on FreeBSD])
fi
dnl **************************************************
dnl * debug logging *
dnl **************************************************
AC_ARG_ENABLE(debug-logging, [ --enable-debug-logging spam the console and logfile with all debug information [default=no]],
enable_debug_logging="$enableval", enable_debug_logging="no")
if test x$enable_debug_logging = "xyes"; then
AC_DEFINE([HAVE_DEBUG_LOGGING], [1], [Define to 1 if you need debug logging])
fi
# Checks for generic libraries.
dnl **************************************************
dnl * libcurl Support *
dnl **************************************************
AC_ARG_WITH(curl-include,
[ --with-curl-include=PATH specify path to curl include files],
[curl_inc=$withval],
[curl_inc=no])
AC_ARG_WITH(curl-lib,
[ --with-curl-lib=PATH specify path to curl client library],
[curl_lib=$withval],
[curl_lib=no])
if test xyes = "xyes"; then
AC_PATH_PROG(LIBCURL_CONFIG, curl-config, no)
if test "$LIBCURL_CONFIG" = "no" ; then
AC_MSG_ERROR([libcurl curl-config was not found in PATH])
fi
if test "x$curl_inc" != xno; then
CPPFLAGS="-I$curl_inc $CPPFLAGS"
fi
if test "x$curl_lib" != "xno"; then
LDFLAGS="-L$curl_lib $LDFLAGS"
fi
orig_cppflags=$CPPFLAGS
orig_libs=$LIBS
CPPFLAGS="$CPPFLAGS `curl-config --cflags`"
LIBS="$LIBS `curl-config --libs`"
AC_CHECK_LIB([curl], [curl_version],
[AC_DEFINE(HAVE_LIBCURL, 1,
[Define if you want to use libcurl])
LIB_CURL="`curl-config --libs` -lcurl"],
[AC_MSG_ERROR([libcurl is missing - install it please])
])
CPPFLAGS=$orig_cppflags
LIBS=$orig_libs
fi
dnl **************************************************
dnl * libpcre Support *
dnl **************************************************
AC_ARG_WITH(pcre-include,
[ --with-pcre-include=PATH specify path to pcre include files],
[pcre_inc=$withval],
[pcre_inc=no])
AC_ARG_WITH(pcre-lib,
[ --with-pcre-lib=PATH specify path to pcre client library],
[pcre_lib=$withval],
[pcre_lib=no])
if test xyes = "xyes"; then
orig_cppflags=$CPPFLAGS
if test "x$pcre_inc" != xno; then
CPPFLAGS="-I$pcre_inc $CPPFLAGS"
fi
orig_ldflags=$LDFLAGS
if test "x$pcre_lib" != "xno"; then
LDFLAGS="-L$pcre_lib $LDFLAGS"
fi
AC_CHECK_LIB([pcre], [pcre_compile],
[AC_DEFINE(HAVE_LIBPCRE, 1,
[Define if you want to use libpcre])
LIB_PCRE="-lpcre"],
[AC_MSG_ERROR([libpcre is missing - install it please])
])
fi
dnl **************************************************
dnl * libmagic Support *
dnl **************************************************
AC_ARG_WITH(magic-include,
[ --with-magic-include=PATH specify path to magic include files],
[magic_inc=$withval],
[magic_inc=no])
AC_ARG_WITH(magic-lib,
[ --with-magic-lib=PATH specify path to magic client library],
[magic_lib=$withval],
[magic_lib=no])
if test xyes = "xyes"; then
orig_cppflags=$CPPFLAGS
if test "x$magic_inc" != xno; then
CPPFLAGS="-I$magic_inc $CPPFLAGS"
fi
orig_ldflags=$LDFLAGS
if test "x$magic_lib" != "xno"; then
LDFLAGS="-L$magic_lib $LDFLAGS"
fi
orig_libs=$LIBS
LIBS="-lz $LIBS"
AC_CHECK_LIB([magic], [magic_open],
[AC_DEFINE(HAVE_LIBMAGIC, 1,
[Define if you want to use libmagic])
LIB_MAGIC="-lmagic -lz"],
[AC_MSG_ERROR([libmagic is missing - install it please])
])
LIBS=$orig_libs
AC_CHECK_HEADERS(magic.h)
fi
dnl **************************************************
dnl * libssh Support *
dnl **************************************************
AC_MSG_CHECKING(for libssh)
AC_ARG_ENABLE(libssh, [ --enable-ssh Enable Support for ssh[default=auto]],
enable_ssh="$enableval", enable_ssh="yes")
AC_ARG_WITH(ssh-lib,
[ --with-ssh-lib=PATH specify path to ssh client library],
[ssh_lib=$withval],
[ssh_lib=no])
AC_ARG_WITH(ssh-include,
[ --with-ssh-include=PATH specify path to ssh include files],
[ssh_inc=$withval],
[ssh_inc=no])
if test x$enable_ssh = xyes; then
dnl **************************************************
dnl * ssh headers *
dnl **************************************************
orig_cppflags=$CPPFLAGS
if test "x$ssh_inc" != xno; then
CPPFLAGS="-I$ssh_inc $CPPFLAGS"
fi
AC_CHECK_HEADER(libssh.h, [found=yes], [found=no])
if test "x$found" != "xno"; then
dnl **************************************************
dnl * ssh lib *
dnl **************************************************
orig_ldflags=$LDFLAGS
if test "x$ssh_lib" != "xno"; then
LDFLAGS="-L$ssh_lib $LDFLAGS"
fi
AC_CHECK_LIB([ssh], [ssh_bind_new],[found=yes], [found=no])
if test "x$found" != "xyes"; then
LDFLAGS=$orig_ldflags
fi
else
CPPFLAGS=$orig_cppflags
fi
if test "x$found" != "xyes"; then
enable_ssh=no
else
AC_DEFINE(HAVE_LIBSSH,1,[Define wether we have libssh])
LIB_SSH="-lssh"
fi
fi
dnl **************************************************
dnl * mysql Support *
dnl **************************************************
AC_ARG_WITH(mysql-lib,
[ --with-mysql-lib=PATH specify path to MySQL client library],
[mysql_lib=$withval],
[mysql_lib=no])
AC_ARG_WITH(mysql-include,
[ --with-mysql-include=PATH specify path to MySQL include files],
[mysql_inc=$withval],
[mysql_inc=no])
AC_ARG_ENABLE(mysql, [ --enable-mysql Enable Support [default=auto]],
enable_mysql="$enableval", enable_mysql="no")
if test x$enable_mysql = xyes; then
AC_MSG_CHECKING(for mysql client library)
dnl **************************************************
dnl * mysql headers *
dnl **************************************************
orig_cppflags=$CPPFLAGS
if test "x$mysql_inc" != xno; then
CPPFLAGS="-I$mysql_inc $CPPFLAGS"
fi
AC_CHECK_HEADER(mysql.h, [found=yes], [found=no])
if test "x$found" != "xno"; then
dnl **************************************************
dnl * mysql lib *
dnl **************************************************
orig_ldflags=$LDFLAGS
if test "x$mysql_lib" != "xno"; then
LDFLAGS="-L$mysql_lib $LDFLAGS"
fi
AC_CHECK_LIB(mysqlclient, mysql_real_connect, [found=yes], [found=no])
if test "x$found" != "xyes"; then
LDFLAGS=$orig_ldflags
fi
else
CPPFLAGS=$orig_cppflags
fi
if test "x$found" != "xyes"; then
enable_mysql=no
else
AC_DEFINE(HAVE_MYSQL, 1 , [Define if we have mysql client library])
LIB_MYSQL="-lmysqlclient"
fi
AC_MSG_RESULT($enable_mysql)
fi
dnl **************************************************
dnl * postgre Support *
dnl **************************************************
AC_ARG_WITH(postgre-lib,
[ --with-postgre-lib=PATH specify path to PostGRE client library],
[postgre_lib=$withval],
[postgre_lib=no])
AC_ARG_WITH(postgre-include,
[ --with-postgre-include=PATH specify path to PostGRE include files],
[postgre_inc=$withval],
[postgre_inc=no])
AC_ARG_ENABLE(postgre, [ --enable-postgre Enable Support [default=auto]],
enable_postgre="$enableval", enable_postgre="no")
if test x$enable_postgre = xyes; then
AC_MSG_CHECKING(for postgre client library)
dnl **************************************************
dnl * postgre headers *
dnl **************************************************
orig_cppflags=$CPPFLAGS
if test "x$postgre_inc" != xno; then
CPPFLAGS="-I$postgre_inc $CPPFLAGS"
fi
AC_CHECK_HEADER(libpq-fe.h, [found=yes], [found=no])
if test "x$found" != "xno"; then
dnl **************************************************
dnl * postgre lib *
dnl **************************************************
orig_ldflags=$LDFLAGS
if test "x$postgre_lib" != "xno"; then
LDFLAGS="-L$postgre_lib $LDFLAGS"
fi
AC_CHECK_LIB(pq, PQsetdbLogin, [found=yes], [found=no])
if test "x$found" != "xyes"; then
LDFLAGS=$orig_ldflags
fi
else
CPPFLAGS=$orig_cppflags
fi
if test "x$found" != "xyes"; then
enable_postgre=no
else
AC_DEFINE(HAVE_POSTGRES, 1 , [Define if we have postgre client library])
LIB_POSTGRES="-lpq"
have_pqserverversion=no
AC_CHECK_LIB(pq,PQserverVersion,[have_pqserverversion=yes],[have_pqserverversion=no])
if test "x$have_pqserverversion" != "xno"; then
AC_DEFINE(HAVE_PQSERVERVERSION, 1 , [Define if libpq supports PQserverVersion])
fi
fi
fi
dnl **************************************************
dnl * libemu support *
dnl **************************************************
AC_ARG_WITH(emu-lib,
[ --with-emu-lib=PATH specify path to libemu library],
[emu_lib=$withval],
[emu_lib=no])
AC_ARG_WITH(emu-include,
[ --with-emu-include=PATH specify path to libemu include files],
[emu_inc=$withval],
[emu_inc=no])
AC_ARG_ENABLE(emu, [ --enable-emu Enable Support [default=auto]],
enable_emu="$enableval", enable_emu="no")
if test x$enable_emu = xyes; then
AC_MSG_CHECKING(for libemu - x86 emulation library)
dnl **************************************************
dnl * emu headers *
dnl **************************************************
orig_cppflags=$CPPFLAGS
if test "x$emu_inc" != xno; then
CPPFLAGS="-I$emu_inc $CPPFLAGS"
fi
AC_CHECK_HEADER(emu/emu.h, [found=yes], [found=no])
if test "x$found" != "xno"; then
dnl **************************************************
dnl * emu lib *
dnl **************************************************
orig_ldflags=$LDFLAGS
if test "x$emu_lib" != "xno"; then
LDFLAGS="-L$emu_lib $LDFLAGS"
fi
AC_CHECK_LIB(emu, emu_new, [found=yes], [found=no])
if test "x$found" != "xyes"; then
LDFLAGS=$orig_ldflags
fi
else
CPPFLAGS=$orig_cppflags
fi
if test "x$found" != "xyes"; then
enable_emu=no
else
AC_DEFINE(HAVE_EMU, 1 , [Define if we have emu client library])
LIB_EMU="-lemu"
fi
fi
dnl **************************************************
dnl * large filesystem Support *
dnl **************************************************
AC_MSG_CHECKING(for Large File System support)
AC_ARG_ENABLE(lfs,
AC_HELP_STRING([--enable-lfs],[Turn on Large File System (default)]),
[case "$host" in
*-*-linux*)
case "${enableval}" in
yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-lfs) ;;
esac
;;
esac],[
CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES"
enable_lfs=yes]
,enable_lfs=no,)
AC_MSG_RESULT($enableval)
dnl **************************************************
dnl * dnsresolve Support *
dnl **************************************************
AC_ARG_ENABLE(dnsresolve_adns, [ --enable-dnsresolve-adns Enable adns [default=yes]],
enable_dnsresolve_adns="$enableval", enable_dnsresolve_adns="yes")
dnl **************************************************
dnl * libadns Support *
dnl **************************************************
AC_ARG_WITH(adns-include,
[ --with-adns-include=PATH specify path to adns include files],
[adns_inc=$withval],
[adns_inc=no])
AC_ARG_WITH(adns-lib,
[ --with-adns-lib=PATH specify path to adns client library],
[adns_lib=$withval],
[adns_lib=no])
if test x$enable_dnsresolve_adns = xyes; then
orig_cppflags=$CPPFLAGS
if test "x$adns_inc" != xno; then
CPPFLAGS="-I$adns_inc $CPPFLAGS"
fi
orig_ldflags=$LDFLAGS
if test "x$adns_lib" != "xno"; then
LDFLAGS="-L$adns_lib $LDFLAGS"
fi
AC_CHECK_LIB([adns], [adns_init],
[AC_DEFINE(HAVE_LIBADNS, 1,
[Define if you want to use adns])
LIB_ADNS="-ladns"],
enable_dnsresolve_adns=no
)
fi
if test x$enable_dnsresolve_adns = xno; then
AC_MSG_ERROR([at least one dnsresolver has to work])
fi
#dnl **************************************************
#dnl * ipv6 Support *
#dnl **************************************************
#
#AC_ARG_ENABLE(ipv6,
# [ --enable-ipv6 enable IPv6 support [default=auto].],
# [ if test "$enableval" = "no"; then
# enable_ipv6="no"
# fi ],
# [ enable_ipv6="yes" ] )
#
#
#
#if test x$enabled_ipv6 = xno ; then
# AC_MSG_RESULT([no -- disabled by user])
#else
# enable_ipv6="no"
# AC_CHECK_FUNC(inet_pton,[enable_ipv6=yes])
# AC_CHECK_LIB(resolv,inet_pton,[enable_ipv6=yes])
# AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
# AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
# [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); enable_ipv6="no"])
# if ${have_ipv6}; then
# AC_DEFINE(HAVE_IPV6, 1, Define if the system have IPv6 structures.)
# fi
#fi
dnl **************************************************
dnl * libprelude Support *
dnl **************************************************
AC_MSG_CHECKING(whether to use prelude for logging)
AC_ARG_ENABLE(prelude,
[ --enable-prelude enable prelude support [default=no].],
[ if test "$enableval" = "yes"; then
enable_prelude="yes"
fi ],
[ enable_prelude="no" ] )
if test x$enable_prelude = xno ; then
AC_MSG_RESULT([no -- disabled by user])
else
AC_PATH_PROG(LIBPRELUDE_CONFIG, libprelude-config, no)
if test "$LIBPRELUDE_CONFIG" = "no" ; then
AC_MSG_ERROR([libpreludes libprelude-config was not found in PATH])
enable_prelude=no
else
AC_DEFINE(HAVE_LIBPRELUDE, 1,[Define if you want to use libprelude])
PRELUDE_LDFLAGS=`$LIBPRELUDE_CONFIG --ldflags`
PRELUDE_LIBS=`$LIBPRELUDE_CONFIG --libs`
PRELUDE_CPPFLAGS=`$LIBPRELUDE_CONFIG --pthread-cflags`
LIB_PRELUDE="$PRELUDE_LIBS"
LDFLAG_PRELUDE="$PRELUDE_LDFLAGS"
CPPFLAGS="$CPPFLAGS $PRELUDE_CPPFLAGS"
fi
fi
dnl **************************************************
dnl * capabilities Support *
dnl **************************************************
AC_MSG_CHECKING(whether to use libcap to improve security)
AC_ARG_ENABLE(capabilities, [ --enable-capabilities Enable capabilities [default=auto]],
[enable_capabilities="$enableval"],
[enable_capabilities="yes"])
if test x$enable_capabilities = xno ; then
AC_MSG_RESULT([no -- disabled by user])
else
AC_ARG_WITH(cap-include,
[ --with-cap-include=PATH use libcap],
[cap_inc=$withval],
[cap_inc=no])
AC_ARG_WITH(cap-lib,
[ --with-cap-lib=PATH use libcap],
[cap_lib=$withval],
[cap_lib=no])
orig_cppflags=$CPPFLAGS
if test "x$cap_inc" != xno; then
CPPFLAGS="-I$cap_inc $CPPFLAGS"
fi
orig_ldflags=$LDFLAGS
if test "x$cap_lib" != "xno"; then
LDFLAGS="-L$cap_lib $LDFLAGS"
fi
AC_CHECK_LIB(cap, cap_init,
[
AC_DEFINE(HAVE_LIBCAP, 1,[Define if libcap is available to restrict process capabilities])
LIB_CAP="-lcap"
enable_capabilities="yes"
],
[
AC_MSG_WARN([libcap check failed])
enable_capabilities="no (check failed)"
])
fi
dnl **************************************************
dnl * liby existence *
dnl **************************************************
AC_CHECK_LIB(y, yyerror,
[
LIB_LIBY="-ly"
enable_liby="yes"
],
[
enable_liby="no"
])
AC_DEFUN([AC_DEFINE_DIR], [
prefix_NONE=
exec_prefix_NONE=
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
dnl refers to ${prefix}. Thus we have to use `eval' twice.
eval ac_define_dir="\"[$]$2\""
eval ac_define_dir="\"$ac_define_dir\""
AC_SUBST($1, "$ac_define_dir")
AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
test "$prefix_NONE" && prefix=NONE
test "$exec_prefix_NONE" && exec_prefix=NONE
])
AC_DEFINE_DIR(PREFIX, prefix, [default working directory])
AC_DEFINE_DIR(LOCALESTATEDIR, localstatedir, [where to put logs etc])
AC_DEFINE_DIR(LIBDIR, libdir, [where to look for plugins])
AC_DEFINE_DIR(SYSCONFDIR, [sysconfdir], [System configuration dir])
AC_CONFIG_FILES([Makefile
nepenthes-core/Makefile
nepenthes-core/include/Makefile
nepenthes-core/src/Makefile
modules/Makefile
modules/dnsresolve-adns/Makefile
modules/download-creceive/Makefile
modules/download-csend/Makefile
modules/download-curl/Makefile
modules/download-ftp/Makefile
modules/download-http/Makefile
modules/download-link/Makefile
modules/download-rcp/Makefile
modules/download-tftp/Makefile
modules/log-download/Makefile
modules/log-irc/Makefile
modules/log-prelude/Makefile
modules/log-surfnet/Makefile
modules/module-bridge/Makefile
modules/module-honeytrap/Makefile
modules/module-portwatch/Makefile
modules/module-peiros/Makefile
modules/shellcode-generic/Makefile
modules/shellcode-signatures/Makefile
modules/shellemu-winnt/Makefile
modules/sqlhandler-postgres/Makefile
modules/submit-file/Makefile
modules/submit-gotek/Makefile
modules/submit-norman/Makefile
modules/submit-postgres/Makefile
modules/submit-http/Makefile
modules/submit-mwserv/Makefile
modules/vuln-asn1/Makefile
modules/vuln-bagle/Makefile
modules/vuln-dameware/Makefile
modules/vuln-dcom/Makefile
modules/vuln-ftpd/Makefile
modules/vuln-iis/Makefile
modules/vuln-kuang2/Makefile
modules/vuln-lsass/Makefile
modules/vuln-msdtc/Makefile
modules/vuln-msmq/Makefile
modules/vuln-mssql/Makefile
modules/vuln-mydoom/Makefile
modules/vuln-netbiosname/Makefile
modules/vuln-netdde/Makefile