-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.in
916 lines (809 loc) · 25.7 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
dnl
dnl ettercap -- configure script
dnl
dnl Copyright (C) ALoR & NaGA
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dnl
dnl $Id: configure.in,v 1.134 2004/11/05 10:00:57 alor Exp $
dnl
AC_INIT
AC_CONFIG_SRCDIR([include/ec.h])
dnl Force autoconf 2.57
AC_PREREQ(2.57)
dnl Force automake 1.7 or better
dnl AM_INIT_AUTOMAKE(1.7.0)
dnl Do not recompile configure Makefile et similia
AM_MAINTAINER_MODE
VERSION=`grep EC_VERSION\ ./include/ec_version.h | cut -f2 -d"\""`
SB=`./shtool echo -n -e %B`
EB=`./shtool echo -n -e %b`
AC_SUBST(SB)
AC_SUBST(EB)
AC_SUBST(VERSION)
EC_MESSAGE(Configuring ettercap $VERSION)
AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE(ettercap, $VERSION)
AC_CONFIG_HEADERS([include/config.h])
dnl AC_CONFIG_HEADERS(include/config.h)
dnl ================
dnl Check the OS
dnl ================
AC_CANONICAL_HOST
AH_TEMPLATE(OS_LINUX, [compiling under linux])
AH_TEMPLATE(OS_BSD, [compiling under bsd])
dnl the subtype for BSD only used if there are significant differences
AH_TEMPLATE(OS_BSD_FREE, [compiling under free bsd])
AH_TEMPLATE(OS_BSD_OPEN, [compiling under open bsd])
AH_TEMPLATE(OS_BSD_NET, [compiling under net bsd])
AH_TEMPLATE(OS_DARWIN, [compiling under macosx])
AH_TEMPLATE(OS_SOLARIS, [compiling under solaris])
AH_TEMPLATE(OS_WINDOWS, [compiling under windows])
dnl the subtype does matter
AH_TEMPLATE(OS_CYGWIN, [compiling under cygwin])
AH_TEMPLATE(OS_MINGW, [compiling under mingw])
dnl initialize the conditionals
AM_CONDITIONAL(LINUX, false)
AM_CONDITIONAL(BSD, false)
AM_CONDITIONAL(DARWIN, false)
AM_CONDITIONAL(SOLARIS, false)
AM_CONDITIONAL(CYGWIN, false)
AM_CONDITIONAL(MINGW, false)
AM_CONDITIONAL(SFU, false)
case "$host_os" in
*linux*)
AC_DEFINE(OS_LINUX)
AM_CONDITIONAL(LINUX, true)
OS="LINUX"
;;
*freebsd*)
AC_DEFINE(OS_BSD)
AC_DEFINE(OS_BSD_FREE)
AM_CONDITIONAL(BSD, true)
OS="FREEBSD"
;;
*openbsd*)
AC_DEFINE(OS_BSD)
AC_DEFINE(OS_BSD_OPEN)
AM_CONDITIONAL(BSD, true)
OS="OPENBSD"
;;
*netbsd*)
AC_DEFINE(OS_BSD)
AC_DEFINE(OS_BSD_NET)
AM_CONDITIONAL(BSD, true)
OS="NETBSD"
;;
*darwin*)
AC_DEFINE(OS_DARWIN)
AM_CONDITIONAL(DARWIN, true)
OS="DARWIN"
;;
*solaris*)
AC_DEFINE(OS_SOLARIS)
AM_CONDITIONAL(SOLARIS, true)
OS="SOLARIS"
;;
*cygwin*)
EC_WINDOWS_KERNEL()
EC_CYGWIN_KERNEL()
AC_DEFINE(OS_CYGWIN)
AM_CONDITIONAL(CYGWIN, true)
OS="WINDOWS"
OS_SUB="CYGWIN $ac_ec_windows_version"
PL_LDFLAGS="-no-undefined"
;;
*mingw*)
EC_WINDOWS_KERNEL()
EC_MINGW_KERNEL()
AC_DEFINE(OS_WINDOWS)
AC_DEFINE(OS_MINGW)
AM_CONDITIONAL(MINGW, true)
OS="WINDWOS"
OS_SUB="MINGW"
EC_MINGW_SPECIAL_MAKEFILE()
exit
;;
*)
echo
echo "NOT A SUPPORTED SYSTEM / OR SYSTEM NOT RECOGNIZED"
echo
;;
esac
AC_SUBST(PL_LDFLAGS)
dnl =====================================
dnl Save the path passed to configure
dnl =====================================
AC_PREFIX_DEFAULT(/usr/local)
if test "$prefix" = "NONE"; then
prefix="/usr/local"
fi
if test "$exec_prefix" = "NONE"; then
exec_prefix=$prefix
fi
AH_TEMPLATE(INSTALL_PREFIX, [the prefix passed by configure])
AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "`eval echo $prefix`")
AH_TEMPLATE(INSTALL_EXECPREFIX, [the exec_prefix passed by configure])
AC_DEFINE_UNQUOTED(INSTALL_EXECPREFIX, "`eval echo $exec_prefix`")
AH_TEMPLATE(INSTALL_SYSCONFDIR, [where can I find my sysconf file ?])
AC_DEFINE_UNQUOTED(INSTALL_SYSCONFDIR, "`eval echo $sysconfdir`")
AH_TEMPLATE(INSTALL_DATADIR, [where can I find my data file ?])
AC_DEFINE_UNQUOTED(INSTALL_DATADIR, "`eval echo $datadir`")
AH_TEMPLATE(INSTALL_LIBDIR, [where can I find my plugins ?])
AC_DEFINE_UNQUOTED(INSTALL_LIBDIR, "`eval echo $libdir`")
AH_TEMPLATE(INSTALL_BINDIR, [where can I find the ettercap executable ?])
AC_DEFINE_UNQUOTED(INSTALL_BINDIR, "`eval echo $bindir`")
dnl ========================
dnl Check the C compiler
dnl ========================
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_GCC_TRADITIONAL
EC_GCC_MACRO
AH_TEMPLATE(GCC_VERSION, [gcc version])
gcc_ver=`$CC -dumpversion`
AC_DEFINE_UNQUOTED(GCC_VERSION, "$gcc_ver")
dnl ========================
dnl Bison/Flex related...
dnl ========================
AC_PROG_YACC
AC_PROG_LEX
dnl ========================
dnl Libtool related...
dnl ========================
AC_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
AC_SEARCH_LIBS(dlopen,c dl,,)
AC_LIB_LTDL
ac_ec_lt_dlopen=yes
AC_SEARCH_LIBS(lt_dlopen,c dl ltdl,,ac_ec_lt_dlopen=no)
AC_CHECK_HEADERS(dlfcn.h)
AC_CHECK_HEADERS(ltdl.h)
dnl ======================
dnl Machine Endianness
dnl ======================
AC_C_BIGENDIAN
dnl =====================
dnl Check for headers
dnl =====================
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_DIRENT
dnl These are required !!
AC_CHECK_HEADERS(unistd.h stdlib.h signal.h stdarg.h sys/ioctl.h sys/types.h dirent.h errno.h,,
AC_MSG_WARN(****************************************************);
AC_MSG_WARN(* REQUIRED !! I cant believe you don't have this !!*);
AC_MSG_WARN(****************************************************);
exit 1)
AC_CHECK_HEADERS(fcntl.h ctype.h libgen.h)
AC_CHECK_HEADERS(sys/types.h stdint.h)
AC_CHECK_HEADERS(sys/time.h sys/utsname.h)
AC_CHECK_HEADERS(termios.h)
AC_CHECK_HEADERS(sys/poll.h poll.h sys/select.h)
AC_CHECK_HEADERS(sys/cdefs.h)
dnl nameser NS_GET32 and so on...
EC_NS_GET()
dnl ==================================================================
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ==================================================================
AC_STRUCT_TM
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_C_CONST
dnl =====================
dnl Check for libs
dnl =====================
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
EC_PTHREAD_CHECK()
AC_CHECK_FUNCS(getifaddrs)
AC_CHECK_FUNCS(gettimeofday)
AC_CHECK_FUNCS(vsnprintf)
AC_CHECK_FUNCS(select poll strdup strerror strstr strsignal strtok_r)
AC_CHECK_FUNCS(uname)
AC_CHECK_FUNCS(daemon)
EC_MESSAGE(Checking for required libraries)
AC_SEARCH_LIBS(gethostbyname, c nsl socket,, AC_MSG_ERROR(not found.))
AC_SEARCH_LIBS(socket, c socket,, AC_MSG_ERROR(not found.))
AC_SEARCH_LIBS(poll, c poll)
AC_SEARCH_LIBS(gzopen,c z,,AC_MSG_ERROR(not found.))
dnl
dnl Do we have dn_expand ?
dnl
EC_RESOLVE_CHECK()
dnl ===============================
dnl Check for non standard libs
dnl ===============================
EC_MESSAGE(Checking for missing functions)
AC_CONFIG_LIBOBJ_DIR(src/missing)
AM_CONDITIONAL(MISSING_STRLCPY, false)
AM_CONDITIONAL(MISSING_STRLCAT, false)
AM_CONDITIONAL(MISSING_STRSEP, false)
AM_CONDITIONAL(MISSING_MEMMEM, false)
AM_CONDITIONAL(MISSING_MEMCMP, false)
AM_CONDITIONAL(MISSING_BASENAME, false)
AM_CONDITIONAL(MISSING_GETOPT_LONG, false)
AM_CONDITIONAL(MISSING_STRCASESTR, false)
AM_CONDITIONAL(MISSING_INET_ATON, false)
AM_CONDITIONAL(MISSING_SCANDIR, false)
dnl AC_REPLACE_FUNCS(strlcpy)
AC_CHECK_FUNCS([strlcpy], , [AC_LIBOBJ(missing/strlcpy) AM_CONDITIONAL(MISSING_STRLCPY, true)])
AC_CHECK_FUNCS([strlcat], , [AC_LIBOBJ(missing/strlcat) AM_CONDITIONAL(MISSING_STRLCAT, true)])
AC_CHECK_FUNCS([strsep], , [AC_LIBOBJ(missing/strsep) AM_CONDITIONAL(MISSING_STRSEP, true)])
AC_CHECK_FUNCS([memmem], , [AC_LIBOBJ(missing/memmem) AM_CONDITIONAL(MISSING_MEMMEM, true)])
AC_CHECK_FUNCS([memcmp], , [AC_LIBOBJ(missing/memcmp) AM_CONDITIONAL(MISSING_MEMCMP, true)])
AC_CHECK_FUNCS([basename], , [AC_LIBOBJ(missing/basename) AM_CONDITIONAL(MISSING_BASENAME, true)])
AC_CHECK_FUNCS([getopt_long], , [AC_LIBOBJ(missing/getopt) AM_CONDITIONAL(MISSING_GETOPT_LONG, true)])
AC_CHECK_FUNCS([strcasestr], , [AC_LIBOBJ(missing/strcasestr) AM_CONDITIONAL(MISSING_STRCASESTR, true)])
AC_CHECK_FUNCS([scandir], , [AC_LIBOBJ(missing/scandir) AM_CONDITIONAL(MISSING_SCANDIR, true)])
AC_CHECK_FUNCS([inet_aton], , [AC_LIBOBJ(missing/inet_aton) AM_CONDITIONAL(MISSING_INET_ATON, true)])
AC_CHECK_LIB(resolv, inet_aton,
AM_CONDITIONAL(INET_ATON_WANTS_RESOLV, true),
AM_CONDITIONAL(INET_ATON_WANTS_RESOLV, false))
dnl =======================================
dnl Check user defined --enable-FEATURE
dnl =======================================
EC_MESSAGE(Checking user defined options)
dnl -----------
dnl -- DEBUG --
dnl -----------
AH_TEMPLATE(DEBUG, [debug support])
ac_ec_debug=no
AC_MSG_CHECKING([if --enable-debug option was specified])
AC_ARG_ENABLE(debug, AC_HELP_STRING(--enable-debug,create a file for debugging messages),
[ case "$enableval" in
yes)
AC_DEFINE(DEBUG, 1)
DEBUG_FLAGS="-g -ggdb -Wmissing-prototypes -Wno-uninitialized -Werror -Wformat-security -Wsign-compare -Wall"
AC_MSG_RESULT(yes)
ac_ec_debug=yes
;;
no) AC_MSG_RESULT(no)
DEBUG_FLAGS="-O2 -funroll-loops -fomit-frame-pointer -Wall"
ac_ec_debug=no
;;
esac ],
AC_MSG_RESULT(no)
DEBUG_FLAGS="-O2 -funroll-loops -fomit-frame-pointer -Wall"
ac_ec_debug=no
)
dnl -------------
dnl -- PLUGINS --
dnl -------------
AM_CONDITIONAL(PLUGINS, false)
AH_TEMPLATE(HAVE_PLUGINS, [plugins support])
check_plugins=0
ac_ec_plugin=no
AC_MSG_CHECKING([if --enable-plugins option was specified])
if test $ac_ec_lt_dlopen = yes; then
AC_ARG_ENABLE(plugins, AC_HELP_STRING(--enable-plugins,enable the use of plugins in ettercap),
[ case "$enableval" in
yes)
AC_MSG_RESULT(yes)
AM_CONDITIONAL(PLUGINS, true)
AC_DEFINE(HAVE_PLUGINS, 1)
ac_ec_plugin=yes
;;
no) AC_MSG_RESULT(no)
ac_ec_plugin=no
;;
esac ],
AC_MSG_RESULT(yes by default)
AM_CONDITIONAL(PLUGINS, true)
AC_DEFINE(HAVE_PLUGINS, 1)
ac_ec_plugin=yes
)
else
AC_MSG_RESULT(not supported)
fi
dnl ==================
dnl Check for libs
dnl ==================
dnl ---------
dnl libpcap
dnl ---------
ac_ec_libpcap=default
AC_MSG_CHECKING(for libpcap)
AC_ARG_WITH(libpcap, AC_HELP_STRING(--with-libpcap=DIR,use libpcap in DIR),
[ case "$withval" in
no)
AC_MSG_RESULT(no)
AC_MSG_ERROR(["*** ettercap cannot operate without libpcap. ***"])
;;
*)
if test -f $withval/pcap.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
PCAPINC="-I$withval"
if test "$OS" = "WINDOWS"; then
PCAPLIB="-L$withval -lwpcap -lpacket"
else
PCAPLIB="-L$withval -lpcap"
fi
ac_ec_libpcap=$withval
AC_MSG_RESULT($withval)
elif test -f $withval/include/pcap.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
PCAPINC="-I$withval/include"
if test "$OS" = "WINDOWS"; then
PCAPLIB="-L$withval/lib -lwpcap -lpacket"
else
PCAPLIB="-L$withval/lib -lpcap"
fi
ac_ec_libpcap=$withval
AC_MSG_RESULT($withval)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([pcap.h not found in $withval])
fi
;;
esac ],
[ if test -f /usr/include/pcap/pcap.h; then
PCAPINC="-I/usr/include/pcap"
if test "$OS" = "WINDOWS"; then
PCAPLIB="-lwpcap -lpacket"
else
PCAPLIB="-lpcap"
fi
elif test -f /usr/include/pcap.h; then
if test "$OS" = "WINDOWS"; then
PCAPLIB="-lwpcap -lpacket"
else
PCAPLIB="-lpcap"
fi
elif test -f /usr/local/include/pcap.h; then
PCAPINC="-I/usr/local/include"
if test "$OS" = "WINDOWS"; then
PCAPLIB="-lwpcap -lpacket"
else
PCAPLIB="-lpcap"
fi
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([libpcap not found])
fi
AC_MSG_RESULT(yes) ]
)
if test "$OS" = "WINDOWS"; then
EC_CHECK_FUNC(wpcap, pcap_datalink_val_to_description, $PCAPLIB, $LIBS,, AC_MSG_ERROR([Incorrect libpcap version. libpcap >= 0.8.1 required]))
EC_CHECK_FUNC(packet, PacketInitPacket, $PCAPLIB, $LIBS,, AC_MSG_ERROR([Incorrect libpcap version. libpcap >= 0.8.1 required]))
AC_CHECK_LIB(ws2_32, ntohs,, AC_MSG_ERROR([Incorrect ws2_32 version.]))
AC_CHECK_LIB(iphlpapi, main)
else
EC_CHECK_FUNC(pcap, pcap_datalink_val_to_description, $PCAPLIB, $LIBS,, AC_MSG_ERROR([Incorrect libpcap version. libpcap >= 0.8.1 required]))
fi
dnl ---------
dnl libnet
dnl ---------
ac_ec_libnet=default
AC_MSG_CHECKING(for libnet)
AC_ARG_WITH(libnet, AC_HELP_STRING(--with-libnet=DIR,use libnet in DIR),
[ case "$withval" in
no)
AC_MSG_RESULT(no)
AC_MSG_ERROR(["*** ettercap cannot operate without libnet. ***"])
;;
*)
if test -f $withval/lnet.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
LNETINC="-I$withval"
LNETLIB="-L$withval -lnet"
ac_ec_libnet=$withval
AC_MSG_RESULT($withval)
elif test -f $withval/include/libnet.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
LNETINC="-I$withval/include"
LNETLIB="-L$withval/lib -L$withval/src -lnet"
ac_ec_libnet=$withval
AC_MSG_RESULT($withval)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([libnet.h not found in $withval])
fi
;;
esac ],
[ if test -f /usr/include/libnet.h; then
AC_MSG_RESULT(yes)
LNETINC=""
LNETLIB="-lnet"
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([libnet >= 1.1.2.1 not found])
fi
]
)
EC_CHECK_FUNC(net, libnet_adv_free_packet, $LNETLIB, $LIBS,, AC_MSG_ERROR([Incorrect libnet version. libnet >= 1.1.2.1 required]))
dnl ------------------
dnl Checks for openssl
dnl ------------------
AH_TEMPLATE(HAVE_OPENSSL, [openssl executable path])
AM_CONDITIONAL(OPENSSL, false)
ac_ec_libssl="NO"
AC_MSG_CHECKING(for openssl)
AC_ARG_WITH(openssl, AC_HELP_STRING(--with-openssl=DIR,use openssl in DIR),
[ case "$withval" in
yes|no)
AC_MSG_RESULT(no)
;;
*)
if test -f $withval/include/openssl/ssl.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
SSLINC="-I$withval/include"
SSLLIB="-L$withval/lib -lssl -lcrypto"
AC_DEFINE(HAVE_OPENSSL, 1)
AM_CONDITIONAL(OPENSSL, true)
ac_ec_libssl=$withval
AC_MSG_RESULT($withval)
elif test -f $withval/ssl/include/openssl/ssl.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
SSLINC="-I$withval/ssl/include"
SSLLIB="-L$withval/ssl/lib -lssl -lcrypto"
AC_DEFINE(HAVE_OPENSSL, 1)
AM_CONDITIONAL(OPENSSL, true)
ac_ec_libssl=$withval
AC_MSG_RESULT($withval)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([ssl.h not found in $withval])
fi
;;
esac ],
[ if test -f /usr/include/openssl/ssl.h; then
SSLLIB="-lssl -lcrypto"
AC_DEFINE(HAVE_OPENSSL, 1)
AM_CONDITIONAL(OPENSSL, true)
AC_MSG_RESULT(yes)
ac_ec_libssl=default
else
AC_MSG_RESULT(no)
fi]
)
dnl ---------
dnl libpcre
dnl ---------
AH_TEMPLATE(HAVE_PCRE, [perl compatible regex])
ac_ec_pcre=no
AC_MSG_CHECKING(for libpcre)
AC_ARG_WITH(libpcre, AC_HELP_STRING(--with-libpcre=DIR,use libpcre in DIR),
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
*)
if test -f $withval/pcre.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
PCREINC="-I$withval/"
PCRELIB="-L$withval/ -lpcre"
AM_CONDITIONAL(HAVE_PCRE, true)
AC_DEFINE(HAVE_PCRE, 1)
ac_ec_pcre=yes
AC_MSG_RESULT($withval)
elif test -f $withval/include/pcre.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
PCREINC="-I$withval/include"
PCRELIB="-L$withval/lib -lpcre"
AM_CONDITIONAL(HAVE_PCRE, true)
AC_DEFINE(HAVE_PCRE, 1)
ac_ec_pcre=yes
AC_MSG_RESULT($withval)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([pcre.h not found in $withval])
fi
;;
esac ],
[ if test -f /usr/include/pcre.h; then
AM_CONDITIONAL(HAVE_PCRE, true)
AC_DEFINE(HAVE_PCRE, 1)
ac_ec_pcre=yes
PCREINC=""
PCRELIB="-lpcre"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AM_CONDITIONAL(HAVE_PCRE, false)
fi
]
)
dnl ------------------
dnl iconv / libiconv
dnl ------------------
AH_TEMPLATE(HAVE_UTF8, [support for UTF-8])
ac_ec_utf8=no
AC_MSG_CHECKING(for iconv)
AC_ARG_WITH(iconv, AC_HELP_STRING(--with-iconv=DIR,use iconv in DIR),
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
*)
if test -f $withval/iconv.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
ICONVINC="-I$withval/"
ICONVLIB="-L$withval/ -liconv"
AC_MSG_RESULT($withval)
elif test -f $withval/include/iconv.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
ICONVINC="-I$withval/include"
ICONVLIB="-L$withval/lib -liconv"
AC_MSG_RESULT($withval)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([iconv.h not found in $withval])
fi
;;
esac ],
[ if test -f /usr/include/iconv.h; then
AC_MSG_RESULT(yes)
ICONVINC=""
ICONVLIB=""
AC_SEARCH_LIBS(iconv, c, , ICONVLIB="-liconv")
else
AC_MSG_RESULT(no)
fi
]
)
EC_CHECK_FUNC(c, iconv, $ICONVLIB,, [AC_DEFINE(HAVE_UTF8,1) ac_ec_utf8=yes])
EC_CHECK_FUNC(iconv, iconv, $ICONVLIB,, [AC_DEFINE(HAVE_UTF8,1) ac_ec_utf8=yes ICONVLIB="-liconv"])
EC_CHECK_FUNC(iconv, libiconv, $ICONVLIB,, [AC_DEFINE(HAVE_UTF8,1) ac_ec_utf8=yes ICONVLIB="-liconv"])
dnl ---------
dnl ncurses
dnl ---------
AH_TEMPLATE(HAVE_NCURSES, [ncurses support])
AM_CONDITIONAL(NCURSES, false)
ac_ec_libncurses="NO"
AC_MSG_CHECKING(for libncurses)
AC_ARG_WITH(libncurses, AC_HELP_STRING(--with-libncurses=DIR,use libncurses in DIR),
[ case "$withval" in
yes|no)
AC_MSG_RESULT(no)
;;
*)
if test -f $withval/ncurses.h \
-a -f $withval/panel.h \
-a -f $withval/form.h \
-a -f $withval/menu.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
NCURSINC="-I$withval"
NCURSLIB="-L$withval -lpanel -lmenu -lform -lncurses"
AC_DEFINE(HAVE_NCURSES, 1)
AM_CONDITIONAL(NCURSES, true)
ac_ec_libncurses=$withval
AC_MSG_RESULT($withval)
elif test -f $withval/include/ncurses.h \
-a -f $withval/include/panel.h \
-a -f $withval/include/menu.h \
-a -f $withval/include/form.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
NCURSINC="-I$withval/include"
NCURSLIB="-L$withval/lib -lpanel -lmenu -lform -lncurses"
AC_DEFINE(HAVE_NCURSES, 1)
AM_CONDITIONAL(NCURSES, true)
ac_ec_libncurses=$withval
AC_MSG_RESULT($withval)
elif test -f $withval/include/ncurses/ncurses.h \
-a -f $withval/include/ncurses/panel.h \
-a -f $withval/include/ncurses/menu.h \
-a -f $withval/include/ncurses/form.h; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
NCURSINC="-I$withval/include/ncurses"
NCURSLIB="-L$withval/lib -lpanel -lmenu -lform -lncurses"
AC_DEFINE(HAVE_NCURSES, 1)
AM_CONDITIONAL(NCURSES, true)
ac_ec_libncurses=$withval
AC_MSG_RESULT($withval)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([ncurses.h menu.h panel.h form.h not found in $withval])
fi
;;
esac ],
[ if test -f /usr/include/ncurses/ncurses.h; then
if test ! -f /usr/include/ncurses/form.h \
-a -f /usr/include/ncurses/menu.h \
-a -f /usr/include/ncurses/panel.h; then
AC_MSG_RESULT(no)
else
NCURSINC="-I/usr/include/ncurses"
NCURSLIB="-lpanel -lmenu -lform -lncurses"
AC_DEFINE(HAVE_NCURSES, 1)
AM_CONDITIONAL(NCURSES, true)
ac_ec_libncurses=default
AC_MSG_RESULT(yes)
fi
elif test -f /usr/include/ncurses.h; then
if test ! -f /usr/include/form.h \
-a -f /usr/include/menu.h \
-a -f /usr/include/panel.h; then
AC_MSG_RESULT(no)
else
NCURSLIB="-lpanel -lmenu -lform -lncurses"
AC_DEFINE(HAVE_NCURSES, 1)
AM_CONDITIONAL(NCURSES, true)
ac_ec_libncurses=default
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
fi]
)
dnl ---------
dnl GTK
dnl ---------
AH_TEMPLATE(HAVE_GTK, [gtk+ support])
AM_CONDITIONAL(GTK, false)
ac_ec_gtk="NO"
AC_MSG_CHECKING(if --enable-gtk option was specified)
AC_ARG_ENABLE(gtk, AC_HELP_STRING(--enable-gtk,enable the gtk interface),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "$PKG_CONFIG" = "no" ; then
AC_MSG_RESULT(pkg-config not found)
else
AC_MSG_CHECKING(for gtk+)
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.0 pango >= 1.0 atk >= 1.0,
[ AC_DEFINE(HAVE_GTK, 1)
AM_CONDITIONAL(GTK, true)
AC_MSG_RESULT(yes)
GTK_LIBS="$GTK_LIBS -lgthread-2.0"
ac_ec_gtk=yes ],
[ AC_MSG_RESULT(no) ]
)
fi
;;
esac ],
[
AC_MSG_RESULT(yes)
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "$PKG_CONFIG" = "no" ; then
AC_MSG_RESULT(pkg-config not found)
else
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.0 pango >= 1.0 atk >= 1.0,
[ AC_DEFINE(HAVE_GTK, 1)
AM_CONDITIONAL(GTK, true)
GTK_LIBS="$GTK_LIBS -lgthread-2.0"
ac_ec_gtk=yes ]
)
fi
])
dnl -----------------------
dnl set up the final vars
dnl -----------------------
EC_CFLAGS="$DEBUG_FLAGS $PCAPINC $LNETINC $SSLINC $PCREINC $ICONVINC"
EC_LIBS="$LIBS $PCAPLIB $LNETLIB $SSLLIB $PCRELIB $NCURSLIB $GTK_LIBS $ICONVLIB"
AC_SUBST(EC_CFLAGS)
AC_SUBST(EC_LIBS)
AC_SUBST(PCAPINC)
AC_SUBST(LNETINC)
AC_SUBST(SSLINC)
AC_SUBST(PCREINC)
AC_SUBST(NCURSINC)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(PCAPLIB)
AC_SUBST(LNETLIB)
AC_SUBST(SSLLIB)
AC_SUBST(PCRELIB)
AC_SUBST(NCURSLIB)
AC_SUBST(GTK_LIBS)
AC_SUBST(ICONVLIB)
dnl for the plugins
PL_CFLAGS="$DEBUG_FLAGS $PCREINC"
AC_SUBST(PL_CFLAGS)
dnl ===============
dnl FINISHED !!
dnl ===============
EC_MESSAGE(Writing output files)
AC_CONFIG_FILES( Makefile
Makefile.mingw
man/Makefile
man/ettercap.8
man/ettercap_curses.8
man/ettercap_plugins.8
man/etterlog.8
man/etterfilter.8
man/etter.conf.5
share/Makefile
src/Makefile
src/os/Makefile
src/interfaces/Makefile
src/interfaces/daemon/Makefile
src/interfaces/text/Makefile
src/interfaces/curses/Makefile
src/interfaces/curses/widgets/Makefile
src/interfaces/gtk/Makefile
include/Makefile
utils/Makefile
utils/etterlog/Makefile
utils/etterfilter/Makefile
plug-ins/Makefile
plug-ins/arp_cop/Makefile
plug-ins/autoadd/Makefile
plug-ins/chk_poison/Makefile
plug-ins/dos_attack/Makefile
plug-ins/dns_spoof/Makefile
plug-ins/dummy/Makefile
plug-ins/find_conn/Makefile
plug-ins/find_ettercap/Makefile
plug-ins/find_ip/Makefile
plug-ins/finger/Makefile
plug-ins/finger_submit/Makefile
plug-ins/gre_relay/Makefile
plug-ins/gw_discover/Makefile
plug-ins/isolate/Makefile
plug-ins/link_type/Makefile
plug-ins/pptp_chapms1/Makefile
plug-ins/pptp_clear/Makefile
plug-ins/pptp_pap/Makefile
plug-ins/pptp_reneg/Makefile
plug-ins/rand_flood/Makefile
plug-ins/remote_browser/Makefile
plug-ins/reply_arp/Makefile
plug-ins/repoison_arp/Makefile
plug-ins/scan_poisoner/Makefile
plug-ins/search_promisc/Makefile
plug-ins/smb_clear/Makefile
plug-ins/smb_down/Makefile
plug-ins/stp_mangler/Makefile)
AC_OUTPUT
dnl ===============
dnl THE SUMMARY
dnl ===============
EC_MESSAGE(ettercap has been configured as follow)
echo "=================================================="
echo
EC_CHECK_OPTION(" Install directory: ",${prefix})
echo
echo
EC_CHECK_OPTION("Libraries :", "")
echo
EC_CHECK_OPTION(" LIBPCAP ................ ",${ac_ec_libpcap})
EC_CHECK_OPTION(" LIBNET ................. ",${ac_ec_libnet})
EC_CHECK_OPTION(" LIBSSL ................. ",${ac_ec_libssl})
EC_CHECK_OPTION(" NCURSES ................ ",${ac_ec_libncurses})
EC_CHECK_OPTION(" GTK+ ................... ",${ac_ec_gtk})
echo
EC_CHECK_OPTION("Functionalities :", "")
echo
EC_CHECK_OPTION(" Debug mode ............. ",${ac_ec_debug})
EC_CHECK_OPTION(" Plugin support ......... ",${ac_ec_plugin})
EC_CHECK_OPTION(" Passive DNS ............ ",${ac_ec_dns})
EC_CHECK_OPTION(" Perl regex in filters .. ",${ac_ec_pcre})
EC_CHECK_OPTION(" Iconv UTF-8 support .... ",${ac_ec_utf8})
echo
echo "=================================================="
echo
dnl ================
dnl vim:ts=3:expandtab