forked from madcamel/energymech
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·1556 lines (1419 loc) · 44.3 KB
/
configure
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
#!/bin/sh
#
# EnergyMech, IRC Bot software
# Copyright (c) 1997-2018 proton
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
umask 077
compile=no
install=no
silentopt=no
try_libmusl=no
# default optimization goal, speed = -O2, size = -Os
optitype=size
cc_arch_flag=
set_feature_defaults() {
ft_alias=$ft_default
ft_botnet=$ft_default
ft_bounce=$ft_default
ft_chanban=$ft_default
ft_ctcp=$ft_default
ft_dccfile=$ft_default
ft_debug=$ft_default
ft_dynamode=$ft_default
ft_dyncmd=$ft_default
ft_greet=$ft_default
ft_hostinfo=$ft_default
ft_ircd_ext=$ft_default
ft_md5=$ft_default
ft_netcfg=$ft_default
ft_newbie=$ft_default
ft_note=$ft_default
ft_notify=$ft_default
ft_perl=$ft_default
ft_python=$ft_default
ft_rawdns=$ft_default
ft_redirect=$ft_default
ft_seen=$ft_default
ft_session=$ft_default
ft_sha=$ft_default
ft_stats=$ft_default
ft_suppress=$ft_default
ft_tcl=$ft_default
ft_telnet=$ft_default
ft_toybox=$ft_default
ft_trivia=$ft_default
ft_uptime=$ft_default
ft_urlcapture=$ft_default
ft_web=$ft_default
ft_wingate=$ft_default
}
for opt
do
case "$opt" in
-*=*)
optarg=`echo $opt | sed 's/.*=//;'` ;;
*)
optarg= ;;
esac
yesno=
case "$opt" in
--with=* ) yesno=yes ;;
--enable=* ) yesno=yes ;;
--without=* ) yesno=no ;;
--disable=* ) yesno=no ;;
esac
if [ "$yesno" = yes -o "$yesno" = no ]; then
IFSBACKUP=$IFS
IFS='=,'
notfirst=
for nn in $opt
do
if [ "$notfirst" ]; then
case "$nn" in
alias ) ft_alias=$yesno ;;
botnet ) ft_botnet=$yesno ;;
bounce ) ft_bounce=$yesno ;;
chanban ) ft_chanban=$yesno ;;
ctcp ) ft_ctcp=$yesno ;;
dccfile ) ft_dccfile=$yesno ;;
debug ) ft_debug=$yesno ;;
dynamode ) ft_dynamode=$yesno ;;
dyncmd ) ft_dyncmd=$yesno ;;
greet ) ft_greet=$yesno ;;
hostinfo ) ft_hostinfo=$yesno ;;
idwrap ) ft_idwrap=$yesno ;;
ircd_ext ) ft_ircd_ext=$yesno ;;
libmusl ) try_libmusl=$yesno ;;
md5 ) ft_md5=$yesno ;;
netcfg ) ft_netcfg=$yesno ;;
newbie ) ft_newbie=$yesno ;;
note ) ft_note=$yesno ;;
notify ) ft_notify=$yesno ;;
perl ) ft_perl=$yesno ;;
python ) ft_python=$yesno ;;
rawdns ) ft_rawdns=$yesno ;;
redirect ) ft_redirect=$yesno ;;
seen ) ft_seen=$yesno ;;
session ) ft_session=$yesno ;;
sha ) ft_sha=$yesno ;;
stats ) ft_stats=$yesno ;;
suppress ) ft_suppress=$yesno ;;
tcl ) ft_tcl=$yesno ;;
telnet ) ft_telnet=$yesno ;;
toybox ) ft_toybox=$yesno ;;
trivia ) ft_trivia=$yesno ;;
uptime ) ft_uptime=$yesno ;;
urlcapture ) ft_urlcapture=$yesno ;;
web ) ft_web=$yesno ;;
wingate ) ft_wingate=$yesno ;;
esac
else
notfirst=yes
fi
done
IFS=$IFSBACKUP
fi
case "$opt" in
--enable-*=*)
feature=`echo $opt | sed 's/^\-\-enable\-//; s/=.*$//'` ;;
--enable-*)
feature=`echo $opt | sed 's/^\-\-enable\-//;'` ;;
--disable-*)
feature=`echo $opt | sed 's/^\-\-disable\-//;'` ;;
--with-*=*)
feature=`echo $opt | sed 's/^\-\-with\-//; s/=.*$//'` ;;
--with-*)
feature=`echo $opt | sed 's/^\-\-with\-//;'` ;;
--without-*)
feature=`echo $opt | sed 's/^\-\-without\-//;'` ;;
*)
feature=___none___ ;;
esac
case "$feature" in
alias | botnet | bounce | chanban | ctcp | dccfile | debug | dynamode | dyncmd | greet | hostinfo | idwrap | ircd_ext | libmusl | md5 \
| netcfg | newbie | note | notify | perl | profiling | python | rawdns | redirect | seen | session | sha | stats | suppress | tcl \
| telnet | toybox | trivia | uptime | urlcapture | web | wingate )
case _"$optarg"_ in
_yes_ | _no_ | __ )
;;
*)
if [ "$feature" = libmusl ]; then
try_libmusl="$optarg"
else
echo "unknown argument for $feature":" $optarg"
echo "Usage: configure [options]"
echo "use \"$0 --help\" for help"
exit 1
fi
esac
;;
___none___ )
;;
*)
echo "unknown feature: $feature"
echo "Usage: configure [options]"
echo "use \"$0 --help\" for help"
exit 1
esac
case "$opt" in
--with=* | --without=* | --enable=* | --disable=* ) ;;
--enable-* | --with-*)
case "$feature"_"$optarg" in
alias_yes | alias_ ) ft_alias=yes ;;
alias_no ) ft_alias=no ;;
botnet_yes | botnet_ ) ft_botnet=yes ;;
botnet_no ) ft_botnet=no ;;
bounce_yes | bounce_ ) ft_bounce=yes ;;
bounce_no ) ft_bounce=no ;;
chanban_yes | chanban_ ) ft_chanban=yes ;;
chanban_no ) ft_chanban=no ;;
ctcp_yes | ctcp_ ) ft_ctcp=yes ;;
ctcp_no ) ft_ctcp=no ;;
dccfile_yes | dccfile_ ) ft_dccfile=yes ;;
dccfile_no ) ft_dccfile=no ;;
debug_yes | debug_ ) ft_debug=yes ;;
debug_no ) ft_debug=no ;;
dynamode_yes | dynamode_ ) ft_dynamode=yes ;;
dynamode_no ) ft_dynamode=no ;;
dyncmd_yes | dyncmd_ ) ft_dyncmd=yes ;;
dyncmd_no ) ft_dyncmd=no ;;
greet_yes | greet_ ) ft_greet=yes ;;
greet_no ) ft_greet=no ;;
hostinfo_yes | hostinfo_ ) ft_hostinfo=yes ;;
hostinfo_no ) ft_hostinfo=no ;;
idwrap_yes | idwrap_ ) ft_idwrap=yes ;;
idwrap_no ) ft_idwrap=no ;;
ircd_ext_yes | ircd_ext_ ) ft_ircd_ext=yes ;;
ircd_ext_no ) ft_ircd_ext=no ;;
libmusl_yes | libmusl_ ) try_libmusl=/usr/local/musl/bin/musl-gcc ;;
libmusl_no ) try_libmusl=no ;;
md5_yes | md5_ ) ft_md5=yes ;;
md5_no ) ft_md5=no ;;
netcfg_yes | netcfg_ ) ft_netcfg=yes ;;
netcfg_no ) ft_netcfg=no ;;
newbie_yes | newbie_ ) ft_newbie=yes ;;
newbie_no ) ft_newbie=no ;;
note_yes | note_ ) ft_note=yes ;;
note_no ) ft_note=no ;;
notify_yes | notify_ ) ft_notify=yes ;;
notify_no ) ft_notify=no ;;
perl_yes | perl_ ) ft_perl=yes ;;
perl_no ) ft_perl=no ;;
python_yes | python_ ) ft_python=yes ;;
python_no ) ft_python=no ;;
rawdns_yes | rawdns_ ) ft_rawdns=yes ;;
rawdns_no ) ft_rawdns=no ;;
redirect_yes | redirect_ ) ft_redirect=yes ;;
redirect_no ) ft_redirect=no ;;
seen_yes | seen_ ) ft_seen=yes ;;
seen_no ) ft_seen=no ;;
session_yes | session_ ) ft_session=yes ;;
session_no ) ft_session=no ;;
sha_yes | sha_ ) ft_sha=yes ;;
sha_no ) ft_sha=no ;;
stats_yes | stats_ ) ft_stats=yes ;;
stats_no ) ft_stats=no ;;
suppress_yes | suppress_ ) ft_suppress=yes ;;
suppress_no ) ft_suppress=no ;;
tcl_yes | tcl_ ) ft_tcl=yes ;;
tcl_no ) ft_tcl=no ;;
telnet_yes | telnet_ ) ft_telnet=yes ;;
telnet_no ) ft_telnet=no ;;
toybox_yes | toybox_ ) ft_toybox=yes ;;
toybox_no ) ft_toybox=no ;;
trivia_yes | trivia_ ) ft_trivia=yes ;;
trivia_no ) ft_trivia=no ;;
uptime_yes | uptime_ ) ft_uptime=yes ;;
uptime_no ) ft_uptime=no ;;
urlcapture_yes | urlcapture_ ) ft_urlcapture=yes ;;
urlcapture_no ) ft_urlcapture=no ;;
web_yes | web_ ) ft_web=yes ;;
web_no ) ft_web=no ;;
wingate_yes | wingate_ ) ft_wingate=yes ;;
wingate_no ) ft_wingate=no ;;
profiling_yes | profiling_ ) ft_prof=yes ;;
profiling_no ) ft_prof=no ;;
esac
;;
--disable-* | --without-*)
case "$feature" in
alias ) ft_alias=no ;;
botnet ) ft_botnet=no ;;
bounce ) ft_bounce=no ;;
chanban ) ft_chanban=no ;;
ctcp ) ft_ctcp=no ;;
dccfile ) ft_dccfile=no ;;
debug ) ft_debug=no ;;
dynamode ) ft_dynamode=no ;;
dyncmd ) ft_dyncmd=no ;;
greet ) ft_greet=no ;;
hostinfo ) ft_hostinfo=no ;;
idwrap ) ft_idwrap=no ;;
ircd_ext ) ft_ircd_ext=no ;;
libmusl ) try_libmusl=no ;;
md5 ) ft_md5=no ;;
netcfg ) ft_netcfg=no ;;
newbie ) ft_newbie=no ;;
note ) ft_note=no ;;
notify ) ft_notify=no ;;
perl ) ft_perl=no ;;
profiling ) ft_prof=no ;;
python ) ft_python=no ;;
rawdns ) ft_rawdns=no ;;
redirect ) ft_redirect=no ;;
seen ) ft_seen=no ;;
session ) ft_session=no ;;
sha ) ft_sha=no ;;
stats ) ft_stats=no ;;
suppress ) ft_suppress=no ;;
tcl ) ft_tcl=no ;;
telnet ) ft_telnet=no ;;
toybox ) ft_toybox=no ;;
trivia ) ft_trivia=no ;;
uptime ) ft_uptime=no ;;
urlcapture ) ft_urlcapture=no ;;
web ) ft_web=no ;;
wingate ) ft_wingate=no ;;
esac
;;
--compile) compile=yes ;;
--install) install=yes ;;
--silence=options) silentopt=yes ;;
--md5=internal) ft_md5=internal ;;
--sha=internal) ft_sha=internal ;;
--use-cpuflags) cc_arch_opt=yes ;;
--no-cpuflags) cc_arch_opt=no ;;
--use-optimize) cc_optimize_opt=yes ;;
--no-optimize) cc_optimize_opt=no ;;
--optimize=speed) optitype=speed ;;
--optimize=size) optitype=size ;;
--use-gnudebug) cc_g_opt=yes ;;
--no-gnudebug) cc_g_opt=no ;;
--use-warnflag) cc_wall_opt=yes ;;
--no-warnflag) cc_wall_opt=no ;;
--use-pipeflag) cc_pipe_opt=yes ;;
--no-pipeflag) cc_pipe_opt=no ;;
--use-ofp) cc_ofp_opt=yes ;;
--no-ofp) cc_ofp_opt=no ;;
--default-yes) ft_default=yes set_feature_defaults ;;
--default-no) ft_default=no set_feature_defaults ;;
--help | -h)
cat <<__EOT__
Usage: configure [options]
Configuration:
--help print this message
Features and packages:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--with-FEATURE[=ARG] include FEATURE [ARG=yes]
--without-FEATURE do not include FEATURE (same as --with-FEATURE=no)
--default-yes Default answer for all feature selections is Yes
--default-no Default answer for all feature selections is No
--md5=internal Use internal routines for MD5 password hashes instead of system libraries
--sha=internal Use internal routines for SHA password hashes instead of system libraries
--use-ofp Try to use compiler flag -fomit-frame-pointer
--no-ofp Do not use compiler flag -fomit-frame-pointer
--with-alias ALIAS support
--with-botnet Botnet support
--with-bounce
--with-chanban
--with-ctcp
--with-dccfile
--with-debug Debug support
--with-dynamode
--with-dyncmd Dynamic command levels support
--with-greet
--with-hostinfo Support for code that reveals/displays/shares information about the host that the bot is running on
--with-ircd_ext
--with-libmusl[=/PATH/TO/musl-gcc]
Try to use libmusl instead of system default
--with-md5 Support for hashing passwords with the MD5 hashing algorithm
--with-netcfg Support for loading config blocks from the internet/other bots
--with-newbie Newbie support for extra sanity checks and error messages
--with-note
--with-notify
--with-perl Perl scripting support
--with-profiling Profiling (gcc+gprof)
--with-python Python scripting support
--with-rawdns Asynchronous DNS lookups
--with-redirect Support fo sending command output to other channels/nicks/files
--with-seen SEEN support
--with-session Session support
--with-sha Support for hashing passwords with the SHA (SHA-512)
--with-stats
--with-suppress Command duplication suppression
--with-tcl Tcl scripting support
--with-telnet Telnet support
--with-toybox An assortment of fun commands
--with-trivia A trivia game
--with-uptime Include code that sends uptime reports to the IRC bot uptime contest server (https://www.eggheads.org/irc/uptime_stats)
--with-urlcapture URL capture support
--with-web Support for EnergyMech serving documents via the HTTP protocol
--with-wingate Wingate support
__EOT__
exit 0
;;
CC=*)
CC=`echo $opt | sed 's/.*=//;'`
;;
*)
echo "unknown option: $opt"
echo "Usage: configure [options]"
echo "use \"$0 --help\" for help"
exit 1
esac
done
if (echo "testing\c"; echo 1,2,3) | grep c > /dev/null; then
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn > /dev/null; then
ac_n=
ac_c='
'
ac_t=' '
else
ac_n=-n
ac_c=
ac_t=
fi
else
ac_n=
ac_c='\c'
ac_t=
fi
echo $ac_n "checking system type ... "$ac_c
cf_ERR=yes
UNAME=`config/which uname`
test -x $UNAME && cf_ERR=
if test -z "$cf_ERR" && cf_ERR=yes && $UNAME -s 1> /dev/null 2> /dev/null; then
cf_SYS=`$UNAME -s`
cf_ERR=
fi
if test -z "$cf_ERR" && cf_ERR=yes && $UNAME -m 1> /dev/null 2> /dev/null; then
cf_MACH=`$UNAME -m`
cf_ERR=
fi
case _"$cf_ERR"_ in
_yes_ )
echo $ac_t unknown
echo "Unable to determine system type."
echo "Dont know how to compile the EnergyMech."
echo "exiting ..."
exit 1
;;
esac
if [ "$cf_SYS" = AIX ]; then
cf_MACH=
cf_SYSMACH="$cf_SYS"
else
cf_SYSMACH="$cf_SYS"'-'"$cf_MACH"
fi
echo $ac_t "$cf_SYSMACH"
#
#
#
echo $ac_n "checking for C compiler ... "$ac_c
if [ "$CC" ]; then
CCshort="$CC"
CC=`config/which $CC`
else
CCshort=gcc
CC=`config/which gcc`
fi
if [ ! -x "$CC" ]; then
CCshort=cc
CC=`config/which cc`
if [ ! -x "$CC" ]; then
echo $ac_t "not found"
echo "A working C compiler is needed to compile the EnergyMech"
echo "exiting ..."
exit 1
fi
fi
CClong="$CC"
CC="$CCshort"
echo $ac_t "$CC"
# set up things for test compiling
TESTO=./test$$.o
TESTP=./test$$
rm -f $TESTO $TESTP
has_musl=no
#
# if directed to use libmusl instead of (g)libc ...
#
if [ ! "$try_libmusl" = no ]; then
echo $ac_n "checking for libmusl ... "$ac_c
mgcc=`config/which musl-gcc`
if [ -x "$mgcc" ]; then
CC="$mgcc"
fi
if [ -x "$try_musl" ]; then
CC="$try_musl"
fi
if [ -x "$try_musl/musl-gcc" ]; then
CC="$try_musl/musl-gcc"
fi
if [ -x "$try_musl/bin/musl-gcc" ]; then
CC="$try_musl/bin/musl-gcc"
fi
if [ -x /opt/musl/bin/musl-gcc ]; then
CC=/opt/musl/bin/musl-gcc
fi
CCshort=$CC
echo $ac_t yes
fi
#
# does the C compile work?
#
TESTC=config/cc.c
echo $ac_n "checking whether $CC works or not ... "$ac_c
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
WORK=no
if [ -x "$TESTP" ]; then
res=_`$TESTP`_
WORK=yes
case $res in
_yes_ )
;;
_gnucc_ )
cf_GNUCC=yes
;;
_gnucc95_ )
cf_GNUCC=95
;;
_gnucc33_ )
cf_GNUCC=33
;;
esac
fi
rm -f $TESTP
if [ "$WORK" = yes ]; then
echo $ac_t yes
compiler=$CC
else
echo $ac_t no
echo ''
echo "A working C compiler is needed to compile the EnergyMech"
echo "exiting ..."
echo ''
exit 1
fi
#
# compiler flags
#
echo $ac_n "checking C compiler flags ... "$ac_c
#
# -g
#
if [ -z "$cc_g_opt" ]; then
cc_g_opt=no
if $CC -g -c -o $TESTO $TESTC 1> /dev/null 2> /dev/null && test -r $TESTO; then
cc_g_opt=yes
cc_g_flag=-g
echo $ac_n "-g "$ac_c
fi
fi
#
# GNU GCC
#
if [ -n "$cf_GNUCC" ]; then
#
# -Wall -Wshadow
#
if [ -r .use_warn -o -n "$cc_wall_opt" ]; then
if [ -z "$cc_wall_opt" -o -z "$cc_wshadow_opt" ]; then
if $CC -Wall -Wshadow -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then
cc_wall_flag="-Wall"
cc_wshadow_flag="-Wshadow"
echo $ac_n "-Wall -Wshadow "$ac_c
fi
fi
fi
if [ "$cc_wall_flag" = -Wall -a "$cf_GNUCC" = 33 ]; then
cc_fnostrictalias="-fno-strict-aliasing"
echo $ac_n "-fno-strict-aliasing "$ac_c
fi
#
# -mtune=i386/i486/i586/i686/core2
#
test -z "$cc_arch_opt" && cc_arch_opt=yes
if [ "$cc_arch_opt" = yes ]; then
case _"$cf_GNUCC"_"$cf_MACH"_ in
_95_i486_ | _33_i486_ )
if $CC -march=i486 -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then
cc_arch_flag="-march=i486"
fi
;;
_95_i[56789]86_ | _33_i[56789]86_ )
if $CC -march=i586 -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then
cc_arch_flag="-march=i586"
fi
;;
_33_x86_64_ )
if $CC -march=native -mtune=native -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then
cc_arch_flag="-march=native -mtune=native"
fi
esac
echo $ac_n "$cc_arch_flag "$ac_c
fi
#
# -fomit-frame-pointer
#
if [ -z "$cc_ofp_opt" -o "$cc_ofp_opt" = yes ]; then
if $CC -fomit-frame-pointer -c -o $TESTO $TESTC 1> /dev/null 2> /dev/null && test -r $TESTO; then
cc_ofp_flag=-fomit-frame-pointer
echo $ac_n "-fomit-frame-pointer "$ac_c
fi
fi
fi
if [ -z "$cc_pipe_opt" ]; then
if $CC -pipe -c -o $TESTO $TESTC 1> /dev/null 2> /dev/null && test -r $TESTO; then
cc_pipe_flag="-pipe"
echo $ac_n "-pipe "$ac_c
fi
fi
oflag="-O2"
if [ "$optitype" = size ]; then
oflag="-Os"
fi
if [ -z "$cc_optimize_opt" ]; then
if $CC $oflag -o $TESTO $TESTC 1> /dev/null 2> /dev/null; then
cc_optimize_flag="$oflag"
echo $ac_n "$oflag "$ac_c
fi
if [ -z "$cc_optimize_flag" ]; then
if $CC -O -o $TESTO $TESTC 1> /dev/null 2> /dev/null; then
cc_optimize_flag="-O"
echo $ac_n "-O "$ac_c
fi
fi
fi
echo $ac_t ""
if [ "$ft_prof" = yes ]; then
echo $ac_n "checking profiling support ... "$ac_c
if $CC -pg -o $TESTO $TESTC 1> /dev/null 2> /dev/null; then
cc_ofp_flag=
cc_pg_flag="-pg"
cc_pg_define="-D__profiling__"
libpgdl=
echo $ac_t yes
else
if $CC -pg -o $TESTO $TESTC -ldl 1> /dev/null 2> /dev/null; then
cc_ofp_flag=
cc_pg_flag="-pg"
cc_pg_define="-D__profiling__"
libpgdl="-ldl"
echo $ac_t "-ldl"
else
echo $ac_t no
fi
fi
fi
rm -f $TESTO $TESTP
#
# 32bit? 64bit?
#
TESTC=config/ptr_size.c
if [ -z "$ptr_size" ]; then
ptr_size=unknown
echo $ac_n "checking pointer size ... "$ac_c
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
if [ -x $TESTP ]; then
ptr_size=`$TESTP`
fi
echo $ac_t "$ptr_size"
fi
case _"$ptr_size"_ in
_8_ )
PTSIZE_DEFINE32='#undef PTSIZE_32BIT'
PTSIZE_DEFINE64='#define PTSIZE_64BIT'
;;
* )
PTSIZE_DEFINE32='#define PTSIZE_32BIT'
PTSIZE_DEFINE64='#undef PTSIZE_64BIT'
;;
esac
rm -f $TESTP
#
# big/little endian
#
TESTC=config/endian.c
if [ -z "$endian" ]; then
endian=unknown
echo $ac_n "checking endianness ... "$ac_c
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
if [ -x $TESTP ]; then
endian=`$TESTP`
if [ "$endian" = 1 ]; then
endian="little"
else
endian="big"
fi
fi
echo $ac_t "$endian endian"
fi
case "$endian" in
little )
LIT_END="#define LITTLE_ENDIAN"
BIG_END="#undef BIG_ENDIAN"
;;
* )
LIT_END="#undef LITTLE_ENDIAN"
BIG_END="#define BIG_ENDIAN"
;;
esac
rm -f $TESTP
#
# Some processors like Sparc, will cause a bus error (SIGBUS) if you try to access unaligned memory
#
has_unaligned=no
UNALIGNED_MEM='#undef UNALIGNED_MEM'
TESTC=config/unaligned.c
echo $ac_n "checking if cpu can access unaligned memory ... "$ac_c
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
if [ "`$TESTP`" = yes ]; then
has_unaligned=yes
UNALIGNED_MEM='#define UNALIGNED_MEM'
fi
echo $ac_t "$has_unaligned"
rm -f $TESTP
#
# is there a sendfile() system call?
#
has_sendfile=no
DEF_SENDFILE='#undef HAS_SENDFILE'
TESTC=config/sendfile.c
echo $ac_n "checking if system has sendfile() ... "$ac_c
$CC -c $TESTC -o $TESTO 1> /dev/null 2> /dev/null
if [ -r $TESTO ]; then
has_sendfile=yes
DEF_SENDFILE='#define HAS_SENDFILE'
fi
echo $ac_t "$has_sendfile"
rm -f $TESTO
#
# where is inet_addr() ?
#
has_inet_addr=no
TESTC=config/inet_addr.c
echo $ac_n "checking for inet_addr() ... "$ac_c
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
if [ -x $TESTP ]; then
has_inet_addr=yes
else
$CC -o $TESTP $TESTC -lnsl 1> /dev/null 2> /dev/null
if [ -x $TESTP ]; then
has_inet_addr=-lnsl
libnsl=-lnsl
fi
fi
echo $ac_t "$has_inet_addr"
rm -f $TESTP
#
# where is inet_aton() ?
#
has_inet_aton=no
TESTC=config/inet_aton.c
echo $ac_n "checking for inet_aton() ... "$ac_c
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
if [ -x $TESTP ]; then
has_inet_aton=yes
else
$CC -o $TESTP $TESTC -lresolv 1> /dev/null 2> /dev/null
if [ -x $TESTP ]; then
has_inet_aton=-lresolv
libresolv=-lresolv
fi
fi
echo $ac_t "$has_inet_aton"
rm -f $TESTP
#
# where is socket() ?
#
has_socket=no
TESTC=config/socket.c
echo $ac_n "checking for socket() ... "$ac_c
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
if [ -x $TESTP ]; then
has_socket=yes
else
$CC -o $TESTP $TESTC -lsocket 1> /dev/null 2> /dev/null
if [ -x $TESTP ]; then
has_socket=-lsocket
libsocket=-lsocket
fi
fi
echo $ac_t "$has_socket"
rm -f $TESTP
#
# check for SHA capabilities in libc/glibc/libcrypt
#
has_sha=no
has_md5=no
if [ ! "$ft_sha" = no ]; then
TESTC=config/pw.c
echo $ac_n "checking for SHA in crypt() ... "$ac_c
sha_internal=
crypt_func='-DCRYPT_FUNC=crypt'
CRYPT_FUNCTION='#define CRYPT_FUNC crypt'
if [ "$ft_sha" = internal ]; then
sha_internal=config/sha_internal.c
crypt_func='-DCRYPT_FUNC=sha_crypt'
CRYPT_FUNCTION='#define CRYPT_FUNC sha_crypt'
fi
$CC -o $TESTP $TESTC $sha_internal $crypt_func 1> /dev/null 2> /dev/null
if [ ! -x $TESTP ]; then
libcrypt=-lcrypt
has_sha=yes
$CC -o $TESTP $TESTC $crypt_func $libcrypt 1> /dev/null 2> /dev/null
fi
if [ ! -x $TESTP ]; then
libcrypt=/usr/lib/libcrypt.so
has_sha=yes
$CC -o $TESTP $TESTC $crypt_func $libcrypt 1> /dev/null 2> /dev/null
fi
if [ ! -x $TESTP ]; then
has_sha=no
libcrypt=
fi
if [ -x $TESTP ]; then
pwhash=`$TESTP`
case "$pwhash" in
MD5 ) has_md5=yes ;;
SHAMD5 )
has_md5=yes
has_sha=yes
;;
esac
fi
echo $ac_t "$has_sha"
[ "$has_sha" = yes -a "$sha_internal" ] && has_sha=internal
rm -f $TESTP
fi
#
# check for MD5 capabilities in libc/glibc/libcrypt
#
if [ "$has_md5" = yes ]; then
echo "checking for MD5 in crypt() ... (cached) yes"
elif [ "$ft_md5" = no ]; then
has_md5=notest
elif [ ! "$ft_md5" = no ]; then
TESTC=config/pw.c
echo $ac_n "checking for MD5 in crypt() ... "$ac_c
md5_internal=
crypt_func='-DCRYPT_FUNC=crypt'
CRYPT_FUNCTION='#define CRYPT_FUNC crypt'
if [ "$ft_md5" = internal ]; then
md5_internal=config/md5_internal.c
crypt_func='-DCRYPT_FUNC=md5_crypt'
CRYPT_FUNCTION='#define CRYPT_FUNC md5_crypt'
fi
$CC -o $TESTP $TESTC $md5_internal $crypt_func 1> /dev/null 2> /dev/null
if [ ! -x $TESTP ]; then
libcrypt=-lcrypt
has_md5=yes
$CC -o $TESTP $TESTC $crypt_func $libcrypt 1> /dev/null 2> /dev/null
fi
if [ ! -x $TESTP ]; then
libcrypt=/usr/lib/libcrypt.so
has_md5=yes
$CC -o $TESTP $TESTC $crypt_func $libcrypt 1> /dev/null 2> /dev/null
fi
if [ ! -x $TESTP ]; then
has_md5=no
libcrypt=
fi
if [ -x $TESTP ]; then
pwhash=`$TESTP`
case "$pwhash" in
MD5 ) has_md5=yes ;;
esac
fi
echo $ac_t "$has_md5"
[ "$has_md5" = yes -a "$md5_internal" ] && has_md5=internal
rm -f $TESTP
fi
#
# check for perl scripting support
#
has_perl=no
perlinclude=
libperl=
if [ "$ft_perl" = no ]; then
has_perl=notest
elif [ ! "$ft_perl" = no ]; then
echo $ac_n "checking for perl ... "$ac_c
pinc1=`perl -MConfig -e 'print $Config{archlib}'`
if [ -r $pinc1/CORE/perl.h -a -r $pinc1/CORE/EXTERN.h -a -r $pinc1/CORE/XSUB.h ]; then
perlinclude=$pinc1/CORE
TESTC=config/perl.c
if $CC -o $TESTP $TESTC -I$perlinclude -L$perlinclude -lperl 1> /dev/null 2> /dev/null; then
has_perl=yes
libperl=-lperl
I_PERL=-I$perlinclude
L_PERL=-L$perlinclude
fi
rm -f $TESTP
fi
echo $ac_t "$has_perl"
fi
#
# check for tcl
#
has_tcl=no
if [ "$ft_tcl" = no ]; then
has_tcl=notest
elif [ ! "$ft_tcl" = no ]; then
echo $ac_n "checking for tcl ... "$ac_c
TESTC=config/tcl.c
tclconfig=
if [ -f /usr/lib/tclConfig.sh ]; then
tclconfig=tclconfig
. /usr/lib/tclConfig.sh
fi
libtcl=
inctcl=
for tclver in $tclconfig empty 8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0
do
if [ -z "$libtcl" ]; then
case "$tclver" in
"tclconfig")
TCLLIB=$TCL_LIB_FLAG
TCLINCLUDE=$TCL_INCLUDE_SPEC
tclver=$TCL_VERSION
;;
"empty")
TCLLIB=-ltcl
TCLINCLUDE=
;;
*)
TCLLIB=-ltcl$tclver
TCLINCLUDE=
;;
esac
if $CC -o $TESTP $TESTC $TCLLIB $TCLINCLUDE 1> /dev/null 2> /dev/null; then
libtcl=$TCLLIB
inctcl=$TCLINCLUDE
has_tcl=$TCLLIB
test "$tclver" = "empty" && echo $ac_t "yes" || echo $ac_t "yes (version $tclver)"
fi
fi
done
if [ -z "$libtcl" ]; then
has_tcl=no
echo $ac_t "no"
fi
rm -f $TESTP
fi
#
# check for python
#
has_python=no
if [ "$ft_python" = no ]; then
has_python=notest