-
Notifications
You must be signed in to change notification settings - Fork 26
/
configure
executable file
·1247 lines (1161 loc) · 36.2 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
# This is a UNIX shell script that generates a custom "Makefile" file and
# a "config.h" file.
#
# usage: configure [[flags] system]
#
# flags: --with-x[=no] enable/disable support for X-windows interface
# --without-x disable support for X-windows interface
# --with-xft[=no] enable/disable support for Xft under "x11" intf.
# --without-xft disable support for Xft under "x11" interface
# --with-gcc[=no] enable/disable use of GCC
# --without-gcc disable use of GCC
# --x-includes=DIR add DIR to path for X-windows include files
# --x-libraries=DIR add DIR to path for X-windows libraries
# --libs=STRING define the non-X11 part of the LIBS= line
# --bindir=DIR where to install the executables
# --datadir=DIR where to install the supporting data files
# --docdir=DIR where to install the :help files & other docs
# --prefix=DIR like --bindir=DIR/bin --datadir=DIR/lib/elvis
# --ioctl=VARIETY type of tty ioctl to use: termios, termio, sgtty
# --verbose explain each decision
#
# system: *one* of the following...
# linux UNIX clone for IBM clones
# sunos Sun's Ancient SunOS variant of BSD
# solaris Sun's OLDER Solaris systems
# solaris2 Sun's NEWER Solaris 2 systems
# aix IBM's variant of POSIX
# osf-1 DEC's variant of POSIX
# ultrix DEC's variant of BSD
# hp-ux HP's variant of POSIX
# qnx4 QNX's POSIXish real-time operating system
# qnx6 QNX's neutrino, variant of POSIXish real-time OS
# irix SGI's variant of POSIX
# xenix ancient SCO Xenix-386 systems
# sco SCO UNIX or Open Desktop systems
# bsd typical BSD implementations
# freebsd FreeBSD is a specific BSD implementation
# openbsd OpenBSD is a specific BSD implementation
# netbsd NetBSD is a specific BSD implementation
# posix generic POSIX implementations
# cygwin GNU utilities under Windows95/98/NT
# (anything else) generic UNIX, including SysV
# If no system is specified, this script will attempt to obtain the system
# type by running the "uname" command. If it can't recognize the system name
# returned by "uname", then it uses generic UNIX settings. The script also
# inspects the files on your system to refine those settings, so it'll still
# work okay, usually.
# Set some defaults
XINCPATH="/usr/X11R6/include /usr/X11/include /usr/include /usr/include/X11 /usr/local/X11/include /usr/openwin/include"
XLIBPATH="/lib /usr/lib /usr/X11/lib /usr/local/X11/lib /usr/openwin/lib /usr/X11R6/lib /usr/ucblib /usr/ccs/lib /usr/local/lib "`echo "$LD_LIBRARY_PATH" | tr ':' ' '`
GNUPATH=`echo "$PATH" | tr ':' ' '`
PREFIX=/usr
BINDIR='$(PREFIX)/bin'
DATADIR='$(PREFIX)/share/elvis/'
DOCDIR='$(PREFIX)/share/elvis/doc/'
SYS=""
DEFAULT_CC="cc -O"
IOCTL=""
WHY=""
# Initialize some variables. These aren't merely defaults; don't change them!
args=""
XLIBS=""
NLIBS=""
# Ultrix has a broken /bin/sh; it doesn't support shell functions. Try to be
# clever about running bash instead of /bin/sh there.
if [ "$SYS" = ultrix ]
then
case "$0" in
*configure)
(echo set - "$@"; cat configure) | bash
exit 0
;;
esac
fi
# This function echoes its arguments, but only if the --verbose flag is given
why()
{
if [ "$WHY" ]
then
echo "$@"
fi
}
# This function is used to look for a file in a path. $1 is the name of the
# file, and the remaining args are the path. It write the absolute file file
# to stdout if successful
searchpath()
{
file=$1
shift
for i
do
if [ -f $i/$file ]
then
echo $i/$file
return
fi
done
}
# This function outputs a usage message, and then exits
usage()
{
echo "usage: configure [[flags] system]"
echo "flags: --with-x[=no] enable/disable support for X-windows interface"
echo " --without-x disable support for X-windows interface"
echo " --with-xft[=no] enable/disable support for Xft under 'x11' intf."
echo " --without-xft disable support for Xft under 'x11' interface"
echo " --with-gcc[=no] enable/disable use of GCC"
echo " --without-gcc disable use of GCC"
echo " --x-includes=DIR add DIR to path for X-windows include files"
echo " --x-libraries=DIR add DIR to path for X-windows libraries"
echo " --bindir=DIR where to install the executables"
echo " --datadir=DIR where to install the supporting data files"
echo " --prefix=DIR like --bindir=DIR/bin --datadir=DIR/share/elvis"
echo " --libs=STRING non-X11 part of the LIBS= string in Makefile"
echo " --ioctl=VARIETY type of tty ioctl to use: termios, termio, or sgtty"
echo " --verbose explain any decisions made during configuration"
echo "system: linux, sunos, solaris, solaris2, freebsd, openbsd, netbsd, bsd,"
echo " posix, aix, osf-1, hp-ux, ultrix, qnx, irix, cygwin, xenix,"
echo " sco (meaning SCO Unix or OpenDesktop)"
echo "The default prefix is --prefix=$PREFIX"
if [ "$*" ]
then
echo "$*"
fi
exit
}
# Check the arguments
for i
do
case "$i" in
--with-x=no|--without-x)
GUI_X11=undef
args="$args --with-x=no"
;;
--with-x*)
GUI_X11=define
args="$args --with-x"
;;
--with-xft=no|--without-xft)
FEATURE_XFT=undef
args="$args --with-xft=no"
;;
--with-xft*)
FEATURE_XFT=define
args="$args --with-xft"
;;
--with-gcc=no|--without-gcc)
gnu=n
forcegcc=n
args="$args --with-gcc=no"
;;
--with-gcc*)
gnu=y
forcegcc=y
args="$args --with-gcc"
;;
--x-includes=*)
XINCPATH=`echo "$i"|sed 's/^--x-includes=//'`" $XINCPATH"
args="$args $i"
;;
--x-libraries=*)
XLIBPATH=`echo "$i"|sed 's/^--x-libraries=//'`" $XLIBPATH"
args="$args $i"$
X_LIBRARIES_OPTION=undef
;;
--bindir=*)
BINDIR=`echo "$i"|sed 's/^--bindir=//'`
args="$args $i"
;;
--datadir=*)
DATADIR=`echo "$i"|sed 's/^--datadir=//'`
args="$args $i"
;;
--docdir=*)
DOCDIR=`echo "$i"|sed 's/^--docdir=//'`
args="$args $i"
;;
--prefix=*)
PREFIX=`echo "$i"|sed 's/^--prefix=//'`
args="$args $i"
;;
--libs=*)
LIBS=`echo "$i"|sed 's/^--libs=//'`
# added to args later
;;
--ioctl=termios|--ioctl=termio|--ioctl=sgtty)
IOCTL=`echo "$i"|sed 's/^--ioctl=//'`
args="$args $i"
;;
--ioctl=*)
usage "bad --ioctl value; must be termios, termio, or sgtty"
;;
--verbose)
WHY=y
;;
--help|-\?)
usage
;;
--version)
sed -n 's/.*VERSION.*"\(.*\)\"/configure (elvis) \1/p' version.h
sed -n 's/.*COPY1.*"\(.*\)\"/\1/p' version.h
exit 0
;;
--*)
# Ignore other --symbol flags
;;
-*)
usage invalid option $i
;;
*)
SYS="$i"
;;
esac
done
# If no system specified, then guess by examining output of uname
if [ "$SYS" = "" ]
then
why "No system type was specified, so I'm running uname(1) to guess it..."
SYS=`uname | tr '[A-Z]' '[a-z]'`
why " Apparently this is '$SYS'"
case "$SYS" in
sunos)
# Solaris 2 masquerades as SunOS. Check for that, by examining
# the release number.
why " I know '$SYS'"
why " Solaris claims to be SunOS, but it requires a different configuration."
why " I'm checking the release number to distinguish between them..."
case `uname -r` in
[5-9]*) SYS=solaris2 ;;
esac
why " This is really '$SYS'"
;;
qnx*)
case `uname -r` in
6*) why " QNX Neutrino -- QNX's multiplatform POSIX Realtime platform"
SYS=qnx6 ;;
*) why " QNX 4.?? -- QNX's X86 almost POSIX Realtime OS"
SYS=qnx4 ;;
esac
;;
linux|solaris|solaris2|aix|osf-1|ultrix|hp-ux|irix*|xenix|sco|bsd|freebsd|openbsd|netbsd|posix|cygwin*)
why " I know '$SYS' -- This should be easy!"
;;
*)
# SCO likes to change the OS name to match the system name.
# Inspect the files to guess whether that's the case here.
if [ -f /etc/hwconfig ]
then
if [ -f /unix ]
then
sys2=sco
else
sys2=xenix
fi
why " I don't know '$SYS' but I know '$sys2' and this looks like '$sys2' to me"
SYS=$sys2
else
why " I don't know '$SYS' so I'll treat this like generic Unix"
fi
esac
fi
# Try to locate some files
why "Looking for some compiler files..."
inet=`searchpath netinet/in.h $XINCPATH`
case "$inet" in
"") why " Internet headers not found - maybe need '--x-includes=...' argument?" ;;
*) why " Internet headers found" ;;
esac
case "$GUI_X11" in
undef)
why " Skipping X11 tests since you specified --with-x=no"
;;
*)
if [ "$SYS" = "darwin" ]
then
case "$X_LIBRARIES_OPTION" in
undef)
;;
*)
if [ -d /opt/X11/include -a -d /opt/X11/lib ]
then
echo "darwin: no --x-libraries= option set, assuming XQuartz installation in /opt/X11..."
XINCPATH=/opt/X11/include
XLIBPATH=/opt/X11/lib
else
echo "darwin should build OK as a generic Unix but you must use the --x-libraries= option"
exit 0
fi
esac
fi
xinc=`searchpath X11/Xresource.h $XINCPATH`
case "$xinc" in
"") why " X11 headers not found - maybe need '--x-includes=...' argument?" ;;
*) why " X11 headers found" ;;
esac
for suffix in a so dylib; do
xlib=`searchpath libX11.$suffix $XLIBPATH`
test -n "$xlib" && break;
done
if [ "$xlib" = "" ]
then
xlib=`searchpath libX11.so $XLIBPATH`
fi
case "$xlib" in
"") why " X11 libraries not found - maybe need '--x-libraries=...' argument?" ;;
*) why " X11 libraries found" ;;
esac
;;
esac
case "$CC" in
"") CC="$DEFAULT_CC"
case "$gnu" in
y|"")
gnu=`searchpath gcc $GNUPATH`
case "$gnu" in
"") why " GCC not found" ;;
*) why " GCC found" ;;
esac
;;
*)
why " GCC not searched for because of --gcc=$gcc argument"
;;
esac
;;
esac
case "$gnu" in
y|n) gnu="" ;;
esac
# If X-windows is unspecified, and the X files are present, then assume with-x
if [ "$GUI_X11" = "" -a "$xinc" ]
then
why "Assuming --with-x because X11 headers were found"
GUI_X11=define
args="$args --with-x"
elif [ "$GUI_X11" = "" ]
then
why "Assuming --with-x=no because X11 headers were not found"
GUI_X11=undef
args="$args --with-x=no"
fi
# If X-windows is used, then check for the -lXpm library, need for FEATURE_IMAGE
if [ "$GUI_X11" = "define" -a "$FEATURE_IMAGE" = "" ]
then
if [ "`searchpath libXpm.a $XLIBPATH`" = "" ] \
&& [ "`searchpath libXpm.so $XLIBPATH`" = "" ] \
&& [ "`searchpath libXpm.dylib $XLIBPATH`" = "" ]
then
why " Disabling the use of background images since -lXpm wasn't found"
FEATURE_IMAGE=undef
elif [ "`searchpath X11/xpm.h $XINCPATH`" = "" ]
then
why " Disabling the use of background images since <X11/xpm.h> wasn't found"
FEATURE_IMAGE=undef
else
why " Enabling the use of background images since -lXpm and <X11/xpm.h> were found"
FEATURE_IMAGE=define
fi
fi
# If X-windows is *NOT* used, then force off FEATURE_IMAGE
if [ "$GUI_X11" \!= "define" ]
then
FEATURE_IMAGE=undef
fi
case "$FEATURE_XFT" in
undef)
why " Skipping Xft tests since you specified --with-xft=no"
;;
*)
if [ "$GUI_X11" = "define" ]
then
xft_h=`searchpath X11/Xft/Xft.h $XINCPATH`
for suffix in a so dylib; do
libxft=`searchpath libXft.$suffix $XLIBPATH`
test -n "$libxft" && break
done
[ -n "$libxft" ] || libxft=`searchpath libXft.so $XLIBPATH`
if [ "$xft_h" = "" -o "$libxft" = "" ]
then
why " Xft not found"
FEATURE_XFT=undef
else
why " Xft found -- elvis will use it"
FEATURE_XFT=define
fi
else
why " Skipping Xft tests since X11 isn't configured"
fi
;;
esac
# if network protocols are unspecified, and the network header files are
# present, then assume they should be used.
if [ "$PROTOCOL_HTTP" = "" -a "$inet" ]
then
why "Assuming HTTP should be supported because Internet headers were found"
PROTOCOL_HTTP=define
elif [ "$PROTOCOL_HTTP" = "" ]
then
why "Assuming HTTP should not be supported because Internet headers were not found"
PROTOCOL_HTTP=undef
fi
if [ "$PROTOCOL_FTP" = "" -a "$inet" ]
then
why "Assuming FTP should be supported because Internet headers were found"
PROTOCOL_FTP=define
elif [ "$PROTOCOL_FTP" = "" ]
then
why "Assuming FTP should not be supported because Internet headers were not found"
PROTOCOL_FTP=undef
fi
################################################################################
# Check for some known system quirks
if [ -f /usr/include/sys/ptem.h ]
then
why "This system has a <sys/ptem.h> file so I assume elvis needs it"
NEED_WINSIZE=define
else
why "This system has no <sys/ptem.h> file so I assume elvis doesn't need it"
fi
if [ -f /usr/include/termcap.h ]
then
why "This system has a <termcap.h> file so I assume elvis needs it"
NEED_SPEED_T=define
else
why "This system has no <termcap.h> file so I assume elvis doesn't need it"
fi
if [ -f /usr/include/sys/wait.h ]
then
why "This system has a <sys/wait.h> file so I assume elvis needs it"
NEED_WAIT_H=define
else
why "This system has no <sys/wait.h> file so I assume elvis doesn't need it"
fi
if [ -f /usr/include/sys/select.h ]
then
why "This system has a <sys/select.h> file so I assume elvis needs it"
NEED_SELECT_H=define
else
why "This system has no <sys/select.h> file so I assume elvis doesn't need it"
fi
if [ -f /usr/include/sys/ioctl.h ]
then
why "This system has a <sys/ioctl.h> file so I assume elvis needs it"
NEED_IOCTL_H=define
else
why "This system has no <sys/ioctl.h> file so I assume elvis doesn't need it"
fi
if [ -f /usr/include/netinet/in.h ]
then
why "This system has a <netinet/in.h> file so I assume elvis needs it"
NEED_IN_H=define
else
why "This system has no <netinet/in.h> file so I assume elvis doesn't need it"
fi
if [ -f /usr/include/sys/socket.h ]
then
why "This system has a <sys/socket.h> file so I assume elvis needs it"
NEED_SOCKET_H=define
else
why "This system has no <sys/socket.h> file so I assume elvis doesn't need it"
fi
if [ X"$xinc" != X ]
then
if [ -f `dirname $xinc`/Xos.h ]
then
why "This system has a <X11/Xos.h> file so I assume elvis needs it"
NEED_XOS_H=define
else
why "This system has no <X11/Xos.h> file so I assume elvis doesn't need it"
fi
fi
why "Does this system support setpgid()?"
if fgrep setpgid /usr/include/unistd.h >/dev/null 2>/dev/null
then
why " Assuming yes, because it is declared in <unistd.h>"
NEED_SETPGID=undef
else
why " Assuming no, because it isn't declared in <unistd.h>"
NEED_SETPGID=define
fi
why "Does this system support freopen()?"
if fgrep freopen /usr/include/stdio.h >/dev/null 2>/dev/null
then
why " Assuming yes, because it is declared in <stdio.h>"
NEED_FREOPEN=undef
else
why " Assuming no, because it isn't declared in <stdio.h>"
NEED_FREOPEN=define
fi
if [ -s "$xinc" ]
then
why "Does this system support XrmCombineFileDatabase()?"
if fgrep XrmCombineFileDatabase $xinc </dev/null >/dev/null
then
why " Assuming yes, because it is declared in <X11/Xresource.h>"
NEED_XRMCOMBINEFILEDATABASE=undef
else
why " Assuming no, because it isn't declared in <X11/Xresource.h>"
NEED_XRMCOMBINEFILEDATABASE=define
fi
fi
if [ "$PROTOCOL_HTTP" = define -o "$PROTOCOL_FTP" = define ]
then
why "Does this system support inet_aton()?"
if [ "$SYS" = sunos -o "$SYS" = solaris -o "$SYS" = solaris2 ]
then
why " Assuming no, because this is a Sun system."
NEED_INET_ATON=define
elif fgrep inet_aton /usr/include/arpa/inet.h </dev/null >/dev/null
then
why " Assuming yes, because it is declared in <arpa/inet.h>"
NEED_INET_ATON=undef
else
why " Assuming no, because it isn't declared in <arpa/inet.h>"
NEED_INET_ATON=define
fi
fi
if [ "$NEED_INET_ATON" = undef ]
then
why "Does this system require -lresolv to use inet_aton()?"
if [ "`searchpath libresolv.a $XLIBPATH`" = "" ] \
&& [ "`searchpath libresolv.so $XLIBPATH`" = "" ] \
&& [ "`searchpath libresolv.dylib $XLIBPATH`" = "" ]
then
why " Assuming no, because I couldn't find libresolv"
else
why " Assuming yes, because I found libresolv"
NLIBS="$NLIBS -lresolv"
fi
fi
why "Does this system support memmove()?"
FN=memmove$$.c
cat >$FN <<EOF
#include <string.h>
int main(void) { char buf2[10], buf1[10]; memmove(buf2, buf1, 10); return 0; }
EOF
gcc -c $FN >/dev/null 2>&1
RC=$?
rm -f $FN
if [ $RC -eq 0 ]
then
why " Assuming yes, because it is declared in <string.h> or <strings.h>"
NEED_MEMMOVE=undef
else
why " Assuming no, because it isn't declared in <string.h> or <strings.h>"
NEED_MEMMOVE=define
fi
case "$IOCTL" in
termios) USE= ;;
termio) USE=" -DUSE_TERMIO" ;;
sgtty) USE=" -DUSE_SGTTY" ;;
*)
why "Choosing a type of ioctl() calls, since no --ioctl=... argument was given"
if [ -f /usr/include/termios.h ]
then
USE=
args="$args --ioctl=termios"
why " Assuming --ioctl=termios because <termios.h> exists"
else
if [ -f /usr/include/termio.h ]
then
USE=" -DUSE_TERMIO"
args="$args --ioctl=termio"
why " Assuming --ioctl=termio because <termio.h> exists"
else
USE=" -DUSE_SGTTY"
args="$args --ioctl=sgtty"
why " Assuming --ioctl=sgtty because neither <termio.h> nor <termios.h> exists"
fi
fi
;;
esac
case "$SYS" in
*aix*)
why "AIX always uses curses because the termcap database has no entry for xterm"
TLIBS="-lcurses"
;;
*linux* | *kfreebsd*)
if [ ! -f /usr/lib/libtermcap.a -a ! -f /lib/libtermcap.a ]
then
if [ -f /usr/lib/libncurses.a -o -f /usr/lib/ncurses.a ]
then
why "For Linux, we're using ncurses because there is no termcap library"
TLIBS="-lncurses"
else
why "For Linux, we're using curses because there is no termcap library"
TLIBS="-lcurses"
fi
else
why "For Linux, we're using termcap because I prefer it over curses/terminfo"
fi
if [ "$NEED_SELECT_H" = "define" ]
then
why "For Linux, elvis never needs <sys/select.h> so I'm ignoring it on your system"
NEED_SELECT_H=undef
fi
;;
*qnx4*)
CC="cc -D_POSIX_SOURCE"
gnu=""
TLIBS="-ltermcap -lsocket"
;;
*qnx6*)
CC="qcc"
gnu=""
TLIBS="-ltermcap -lsocket"
;;
*osf*)
why "OSF is configured to use the bogus 'tinytcap.c' file instead of a real termcap"
why " or terminfo library. I don't know why. It also tries to use -ltermcap"
why " which doesn't make much sense here either. You may want to change this."
NEED_TGETENT=define
#TLIBS="-lucb -lcurses"
TLIBS="-ltermcap"
;;
*ultrix*)
why "Ultrix needs -ldnet to support X11. Also, it uses both -lcurses and -ltermcap"
why " though I can't imagine why it would need both; elvis doesn't use any fancy"
why " curses functions. You may want to change this."
CC="cc -std"
NEED_STRDUP=define
TLIBS="-lcurses -ltermcap"
if [ "$GUI_X11" = "define" ]
then
XLIBS=" -ldnet"
fi
;;
*hp-ux*)
why "HP-UX must use its own compiler even if GCC is available, apparently because"
why " GCC doesn't support shared libraries. Also, it uses both -lcurses and"
why " -ltermcap, though I can't imagine why it would need both."
if [ X$forcegcc = Xy ]
then
why "... but since you used an explicit -with-gcc flag, I'll do that"
else
CC="cc -Ae +O2"
gnu=""
fi
NEED_OSPEED=define
TLIBS="-lcurses -ltermcap"
;;
*solaris2*)
why "For Solaris2, the standard system C compiler chokes on some standard system"
why " header files because of an unchecked 'const' keyword, so we add '-Dconst='"
why " to ensure that 'const' is ignored. Also, if X11 is to be supported then"
why " we also need -lsocket -lnsl. A -R flag may also be added so the X11"
why " shared libraries can be found at run time."
CC="cc -O -Dconst="
TLIBS="-lcurses"
NLIBS="$NLIBS -lsocket -lnsl"
if [ "$GUI_X11" = "define" ]
then
xlibdir=`dirname "$xlib"`
XLIBS=" -R$xlibdir$XLIBS"
fi
if [ -f /usr/ccs/lib/libtermcap.a ]
then
why "For Solaris2, -ltermcap is usually not necessary but since you have one and"
why " it is harmless, I'll add it."
TLIBS="$TLIBS -ltermcap"
fi
;;
*solaris*)
why "For Solaris 1, no really wacky tricks are needed. A -Dconst= flag is added"
why " to the compiler command to allow it to work around a 'const' keyword in a"
why " standard system header."
CC="cc -O -Dconst="
TLIBS="-L/usr/ucblib -lucb -lcurses -ltermcap"
;;
*sunos*)
why "For ancient SunOS, no really wacky tricks are needed. A -Dconst= flag is added"
why " to the compiler command to allow it to work around a 'const' keyword in a"
why " standard system header."
CC="cc -O -Dconst="
TLIBS="-ltermcap"
;;
*sco*)
TLIBS="-lx -ltermcap"
tmp=`searchpath icc $GNUPATH`
if [ "$tmp" ]
then
why "For SCO, I like the icc compiler (unless gcc is available)."
CC="icc"
# but it may be overridden by gcc
fi
if [ "$GUI_X11" = "define" ]
then
why "For SCO, X11 requires -lsocket"
XLIBS=" -lsocket"
why "SCO has an <X11/Xos.h>, but it clashes with <times.h> so we leave it out"
NEED_XOS_H="undef"
elif [ X"$inet" != X ]
then
why "For SCO, any network access needs -lsocket"
TLIBS="$TLIBS -lsocket"
fi
;;
*xenix*)
TLIBS="-lx -ltermcap"
if [ "$GUI_X11" = "define" ]
then
why "For SCO Xenix, X11 requires -lsocket"
XLIBS=" -lsocket"
fi
;;
*freebsd*)
why "For FreeBSD, we ignore the <sys/select.h> file"
NEED_SELECT_H="undef"
if [ "$GUI_X11" = "define" ]
then
why " To support X11, it also requires -lipc"
XLIBS=" -lipc"
fi
;;
*openbsd*)
why "For OpenBSD, we ignore the <sys/select.h> file"
NEED_SELECT_H="undef"
TLIBS="-lcurses"
if [ "$GUI_X11" = "define" ]
then
why " To support X11, it also requires -lipc"
XLIBS=" -lipc"
fi
;;
*netbsd*)
why "For NetBSD, we need to specify the -R flag for X11."
why " The use of LD_LIBRARY_PATH is not encouraged unless it is really necessary."
if [ "$GUI_X11" = "define" ]
then
xlibdir=`dirname "$xlib"`
XLIBS=" -R$xlibdir$XLIBS"
fi
;;
*bsd*)
why "For BSD we like to use shlicc2 because it supports shared libraries"
tmp=`searchpath shlicc2 $GNUPATH`
if [ "$tmp" ]
then
CC="shlicc2"
gnu=""
why " Using shlicc2, even in preference to GCC"
else
why " Apparently shlicc2 doesn't exist on this system"
fi
if [ "$GUI_X11" = "define" ]
then
why "Some BSD versions require -lipc with X11, but some don't allow it. Checking..."
tmp=`searchpath libipc.a $XLIBPATH`
if [ "$tmp" ]
then
why " This BSD has a -lipc library, so I'll use it"
XLIBS=" -lipc"
else
why " Couldn't find -lipc library. Hopefully that means it isn't needed"
fi
why "FreeBSD requires -I/usr/X11R6/include. Should be harmless for other BSDs"
CC="$CC -I/usr/X11R6/include"
fi
;;
*irix*)
# If "cc" in installed, use it in preference to "gcc"
why "For IRIX, the standard CC is preferable to GCC"
tmp=`searchpath cc $GNUPATH`
if [ "$tmp" ]
then
CC="cc"
gnu=""
fi
;;
*cygwin*)
why "Cygwin has no inet_aton() function even though one is declared in the headers"
NEED_INET_ATON=define
;;
esac
if [ -f /usr/bin/lp ]
then
why "Assuming lpout=\"!lp -s\" because /usr/bin/lp exists"
LPOUT="!lp -s"
else
why "Assuming lpout=\"!lpr\" because /usr/bin/lp doesn't exist"
fi
# Add non-X11 libraries to args via the --libs=... flag
if [ "$TLIBS" ]
then
args="$args --libs='$TLIBS'"
fi
# If "gcc" is available, and CC didn't come from environment variables, then
# use "gcc" instead of plain old "cc"
if [ "$gnu" ]
then
why "Assuming GCC should be used because it exists and the $SYS-specific"
why " tweaks didn't indicate that the standard CC is better."
CC="gcc -O2"
fi
################################################################################
# Save these arguments in a "config.stat" script
echo exec configure $args $SYS >config.stat
# Tell the user what we discovered
echo "Options: $args"
echo "System: $SYS"
echo "Compiler: $CC"
echo "Bin dir: "`echo "$BINDIR" |sed s,'$(PREFIX)',"$PREFIX",`
echo "Data dir: "`echo "$DATADIR"|sed s,'$(PREFIX)',"$PREFIX",`
echo "Doc dir: "`echo "$DOCDIR" |sed s,'$(PREFIX)',"$PREFIX",`
echo "Man dir: "`sh instman.sh -d -p"${PREFIX}"`
[ "$WHY" ] || echo "To see details, run \"configure --verbose\""
################################################################################
#Set some options that'll be used in the here-files below
CC="$CC$USE"
if [ "$GUI_X11" = "define" ]
then
case "$FEATURE_XFT" in
define)
xft="-lXft "
if [ "$SYS" = "darwin" -a -d /opt/X11/include/freetype2 ]
then
CC="$CC -I/opt/X11/include/freetype2"
elif [ -d /usr/include/freetype2 ]
then
CC="$CC -I/usr/include/freetype2"
fi
;;
*)
xft=""
;;
esac
case "$FEATURE_IMAGE" in
define) xpm="-lXpm " ;;
*) xpm="" ;;
esac
case "$xlib" in
/lib/libX11.*|/usr/lib/libX11.*|"")
XLIBS="$xft$xpm-lX11$XLIBS"
;;
*)
XLIBS="-L`dirname $xlib` $xft$xpm-lX11$XLIBS"
;;
esac
case "$xinc" in
/usr/include/X11/Xresource.h)
;;
*)
x11subdir=`dirname $xinc`
################################################################################
# darwin will mostly build ok as a "generic" system with the exception
# that -L<X11_lib_dir> must be specified with the --x-libraries= option
################################################################################
if [ "$SYS" = "darwin" ]
then
x=-1
xdir=""
for dir in $XLIBPATH
do
if test $x -lt 0
then
xdir="$dir"
x=`expr $x + 1`
fi
done
CC="$CC -L$xdir -I"`dirname $x11subdir`
else
CC="$CC -I"`dirname $x11subdir`
fi
;;
esac
fi
if [ "$LIBS" = "" ]
then
LIBS="${TLIBS:--ltermcap} $NLIBS"
fi
case "$LIBS" in
*ncurses*) NEED_BC=undef;;
*) NEED_BC=define;;
esac
################################################################################
# Generate the "config.h" file
ELVISPATH=`echo "~/.elvis:/etc/elvis:$DATADIR:$DOCDIR" | sed s,'$(DATADIR)',"$DATADIR",g\;s,'$(PREFIX)',"$PREFIX",g`
cat >config.h <<eof-config
/* config.h */
/* Originally, this file was automatically generated by the "configure"
* shell script.
*
* This file contains C macro definitions which indicate which features
* are to be supported, and which library functions are to be emulated.
* In general, #define enables the feature or emulating function, and
* #undef disables the feature or causes the library function to be used.
*/
/* The following determine which user interfaces are to be supported */
#${GUI_X11:-undef} GUI_X11 /* simple X-windows interface */
#undef GUI_CURSES /* curses interface */
#define GUI_TERMCAP /* termcap interface */
#define GUI_OPEN /* open-mode only, does nothing fancy */
/* These allow you to selectively disable the display modes, network protocols,
* and other optional features. If you disable the markup display modes then
* the :help command is disabled because it depends on the "html" markup display
* mode. #define to enable the mode, #undef to exclude it.
*/
#define DISPLAY_HEX /* hex interactive hex dump */
#define DISPLAY_HTML /* html formatted text */
#define DISPLAY_MAN /* man formatted text */
#define DISPLAY_TEX /* tex formatted text */
#define DISPLAY_SYNTAX /* syntax generic syntax coloring */
#${PROTOCOL_HTTP} PROTOCOL_HTTP /* define to enable HTTP; undef to disable */
#${PROTOCOL_FTP} PROTOCOL_FTP /* define to enable FTP; undef to disable */
#define FEATURE_ALIAS /* the :alias command */
#define FEATURE_ARRAY /* arrays in :calc expressions */
#define FEATURE_AUTOCMD /* the :autocmd command */
#define FEATURE_BACKTICK /* the \`program\` notation in file names */
#define FEATURE_BROWSE /* the :browse and :sbrowse commands */
#define FEATURE_CACHEDESC /* store syntax/markup descriptions in RAM */
#define FEATURE_CALC /* built-in calculator -- see command below */
#define FEATURE_COMPLETE /* filename completion */
#define FEATURE_EQUALTILDE /* :let option =~ excmdline */
#define FEATURE_FOLD /* the :fold and :unfold commands */
#define FEATURE_G /* most of the visual 'g' commands */
#define FEATURE_HLOBJECT /* the hlobject and hllayers options */
#define FEATURE_HLSEARCH /* the hlsearch option */
#${FEATURE_IMAGE:-undef} FEATURE_IMAGE /* background images in x11 */
#define FEATURE_INCSEARCH /* the incsearch option */
#define FEATURE_LISTCHARS /* the "listchars" option */
#define FEATURE_LITRE /* accelerate searches for literal strings */
#define FEATURE_LPR /* the :lpr command */
#define FEATURE_MAKE /* the :make and :cc commands */
#define FEATURE_MAPDB /* the map debugger */
#define FEATURE_MISC /* lots of little things -- see comment below */
#define FEATURE_MKEXRC /* the :mkexrc command */
#define FEATURE_NORMAL /* vim-style :normal command */
#define FEATURE_PROTO /* using aliases to add new protocols */
#undef FEATURE_RAM /* store edit buffer in RAM if "-f ram" */
#define FEATURE_RCSID /* include RCS Id strings for all source files */
#define FEATURE_REGION /* the :region and :unregion commands */
#define FEATURE_SHOWTAG /* the showtag option */
#define FEATURE_SMARTARGS /* the smartargs option */
#define FEATURE_SPELL /* spell-checker */
#define FEATURE_SPLIT /* :split and friends */
#define FEATURE_STDIN /* ability to read from stdin for "-" filename */
#define FEATURE_TAGS /* :tag command -- undef'ing will break ref & ctags */
#define FEATURE_TEXTOBJ /* text objects */
#define FEATURE_V /* the v/V/^V marking commands */
#${FEATURE_XFT:-undef} FEATURE_XFT /* support antialiased fonts in "x11" */
#define FEATURE_PERSIST /* the persistfile option */