-
Notifications
You must be signed in to change notification settings - Fork 0
/
Configure
executable file
·4760 lines (4323 loc) · 97.7 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/bash
#-----------------------------------------------------------------------
# If these # comments don't work, trim them. Don't worry about any other
# shell scripts, Configure will trim # comments from them for you.
#
# (If you are trying to port this package to a machine without sh,
# I would suggest you have a look at the prototypical config_h.sh file
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#
# Yes, you may rip this off to use in other distribution packages. This
# script belongs to the public domain and cannot be copyrighted.
#
# (Note: this Configure script was generated automatically. Rather than
# working with this copy of Configure, you may wish to get metaconfig.
# The dist-3.0 package (which contains metaconfig) was posted in
# comp.sources.misc and is available on CPAN under authors/id/RAM so
# you may fetch it yourself from your nearest archive site.)
#-----------------------------------------------------------------------
#-----------------------------------------------------------------------
# $Id: Configure,v 1.1 2004-05-03 05:17:48 behdad Exp $
# Generated on Thu Feb 19 19:32:00 CST 2004 [metaconfig 3.0 PL70]
#-----------------------------------------------------------------------
true || exec sh $0 $argv:q
(exit $?0) || exec sh $0 $argv:q
: compute my invocation name
me=$0
case "$0" in
*/*)
me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
test "$me" || me=$0
;;
esac
: Proper PATH separator
p_=:
: On OS/2 this directory should exist if this is not floppy only system :-]
if test -d c:/.; then
p_=\;
PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
fi
: Proper PATH setting
paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
paths="$paths /sbin /usr/sbin /usr/libexec"
for p in $paths
do
case "$p_$PATH$p_" in *$p_$p$p_*) ;;
*) test -d $p && PATH=$PATH$p_$p ;;
esac
done
PATH=.$p_$PATH
export PATH
: shall we be using ksh?
inksh=''
needksh=''
avoidksh=''
newsh=/bin/ksh
changesh=''
if (PATH=.; alias -x) >/dev/null 2>&1; then
inksh=true
fi
if test -f /hp-ux -a -f /bin/ksh; then
needksh='to avoid sh bug in "here document" expansion'
fi
if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
if test X`/usr/bin/uname -v` = X4; then
avoidksh="to avoid AIX 4's /bin/sh"
newsh=/usr/bin/bsh
fi
fi
case "$inksh/$needksh" in
[a-z]*)
unset ENV
changesh=true
reason="$needksh"
;;
esac
case "$inksh/$avoidksh" in
true/[a-z]*)
changesh=true
reason="$avoidksh"
;;
esac
case "$inksh/$needksh-$avoidksh-" in
true/--)
cat <<EOM
(I see you are using the Korn shell. Some ksh's blow up on $me,
mainly on older exotic systems. If yours does, try the Bourne shell instead.)
EOM
;;
esac
case "$changesh" in
true)
echo "(Feeding myself to $newsh $reason.)"
case "$0" in Configure|*/Configure) exec $newsh $0 "$@";;
*) exec $newsh Configure "$@";;
esac
;;
esac
: Configure runs within the UU subdirectory
test -d UU || mkdir UU
unset CDPATH
cd UU && rm -f ./*
d_bsd=''
d_xenix=''
Mcc=''
ar=''
awk=''
bash=''
bison=''
byacc=''
cat=''
chgrp=''
chmod=''
chown=''
comm=''
compress=''
cp=''
cpio=''
cpp=''
csh=''
date=''
echo=''
egrep=''
emacs=''
expr=''
find=''
flex=''
gcc=''
grep=''
gzip=''
inews=''
ksh=''
less=''
line=''
lint=''
ln=''
lp=''
lpr=''
ls=''
mail=''
mailx=''
make=''
mkdir=''
more=''
mv=''
nroff=''
perl=''
pg=''
pmake=''
pr=''
rm=''
rmail=''
sed=''
sendmail=''
shar=''
sleep=''
smail=''
sort=''
submit=''
tail=''
tar=''
tbl=''
test=''
touch=''
tr=''
troff=''
uname=''
uniq=''
uuname=''
vi=''
zcat=''
zip=''
hint=''
myuname=''
osname=''
osvers=''
Author=''
Date=''
Header=''
Id=''
Locker=''
Log=''
RCSfile=''
Revision=''
Source=''
State=''
archobjs=''
firstmakefile=''
bin=''
binexp=''
installbin=''
cc=''
gccversion=''
ccflags=''
cppflags=''
ldflags=''
lkflags=''
locincpth=''
optimize=''
cf_by=''
cf_time=''
contains=''
cppfilecom=''
cppstdinflags=''
d_cppcanstdin=''
d_cppignhdrs=''
cpplast=''
cppminus=''
cpprun=''
cppstdin=''
d_access=''
d_attribut=''
d_const=''
d_flexfnam=''
d_gnulibc=''
d_link=''
d_open3=''
d_portable=''
d_index=''
d_strchr=''
d_strftime=''
d_strstr=''
d_symlink=''
d_time=''
timetype=''
d_voidsig=''
signal_t=''
d_volatile=''
h_fcntl=''
h_sysfile=''
i_fcntl=''
i_stddef=''
i_stdlib=''
i_string=''
strings=''
i_sysfile=''
i_systypes=''
i_systime=''
i_systimek=''
i_time=''
timeincl=''
i_unistd=''
i_stdarg=''
i_varargs=''
i_varhdr=''
lex=''
lexflags=''
libc=''
glibpth=''
libpth=''
loclibpth=''
plibpth=''
xlibpth=''
libs=''
libyacc=''
lns=''
installmansrc=''
manext=''
mansrc=''
mansrcexp=''
mkdep=''
c=''
n=''
package=''
spackage=''
prefix=''
prefixexp=''
installprivlib=''
privlib=''
privlibexp=''
prototype=''
sh=''
so=''
sharpbang=''
shsharp=''
spitshell=''
src=''
startsh=''
sysman=''
nm_opt=''
nm_so_opt=''
runnm=''
usenm=''
incpath=''
mips_type=''
usrinc=''
vaproto=''
defvoidused=''
voidflags=''
warnflags=''
yacc=''
yaccflags=''
CONFIG=''
define='define'
undef='undef'
smallmach='pdp11 i8086 z8000 i80286 iAPX286'
rmlist=''
: No trailing extension on UNIX executables
_exe=''
: Extra object files, if any, needed on this platform.
archobjs=''
gccversion=''
: Possible local include directories to search.
: Set locincpth to "" in a hint file to defeat local include searches.
locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
:
: no include file wanted by default
inclwanted=''
i_sysselct=''
: change the next line if compiling for Xenix/286 on Xenix/386
xlibpth='/usr/lib/386 /lib/386'
: Possible local library directories to search.
loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
: general looking path for locating libraries
glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
glibpth="$glibpth /lib /usr/lib $xlibpth"
glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
: Private path used by Configure to find libraries. Its value
: is prepended to libpth. This variable takes care of special
: machines, Usually, it should be empty.
plibpth=''
: default library list
libswanted=''
large=''
: full support for void wanted by default
defvoidused=15
: Find the basic shell for Bourne shell scripts
case "$sh" in
'')
case "$SYSTYPE" in *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
*) xxx='/bin/sh';;
esac
if test -f "$xxx"; then
sh="$xxx"
else
: Build up a list and do a single loop so we can 'break' out.
pth=`echo $PATH | sed -e "s/$p_/ /g"`
for xxx in sh bash ksh pdksh ash; do
for p in $pth; do
try="$try ${p}/${xxx}"
done
done
for xxx in $try; do
if test -f "$xxx"; then
sh="$xxx";
break
elif test -f "$xxx.exe"; then
sh="$xxx";
break
fi
done
fi
;;
esac
case "$sh" in
'') cat <<EOM >&2
$me: Fatal Error: I can't find a Bourne Shell anywhere.
Usually it's in /bin/sh. How did you even get this far?
Please contact me (Manoj Srivastava) at [email protected] and
we'll try to straighten this all out.
EOM
exit 1
;;
esac
: see if sh knows # comments
if `$sh -c '#' >/dev/null 2>&1`; then
shsharp=true
spitshell=cat
xcat=/bin/cat
test -f $xcat || xcat=/usr/bin/cat
echo "#!$xcat" >try
chmod +x try
./try > today
if test -s today; then
sharpbang='#!'
else
echo "#! $xcat" > try
chmod +x try
./try > today
if test -s today; then
sharpbang='#! '
else
sharpbang=': use '
fi
fi
else
echo " "
echo "Your $sh doesn't grok # comments--I will strip them later on."
shsharp=false
cd ..
echo "exec grep -v '^[ ]*#'" >spitshell
chmod +x spitshell
spitshell=`pwd`/spitshell
cd UU
echo "I presume that if # doesn't work, #! won't work either!"
sharpbang=': use '
fi
rm -f try today
: figure out how to guarantee sh startup
case "$startsh" in
'') startsh=${sharpbang}${sh} ;;
*)
esac
cat >try <<EOSS
$startsh
set abc
test "$?abc" != 1
EOSS
chmod +x try
if ./try; then
: echo "Yup, it does."
else
echo "Hmm... '$startsh' does not guarantee sh startup..."
echo "You may have to fix up the shell scripts to make sure $sh runs them."
fi
rm -f try
: produce awk script to parse command line options
cat >options.awk <<'EOF'
BEGIN {
optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
len = length(optstr);
for (i = 1; i <= len; i++) {
c = substr(optstr, i, 1);
if (i < len) a = substr(optstr, i + 1, 1); else a = "";
if (a == ":") {
arg[c] = 1;
i++;
}
opt[c] = 1;
}
}
{
expect = 0;
str = $0;
if (substr(str, 1, 1) != "-") {
printf("'%s'\n", str);
next;
}
len = length($0);
for (i = 2; i <= len; i++) {
c = substr(str, i, 1);
if (!opt[c]) {
printf("-%s\n", substr(str, i));
next;
}
printf("-%s\n", c);
if (arg[c]) {
if (i < len)
printf("'%s'\n", substr(str, i + 1));
else
expect = 1;
next;
}
}
}
END {
if (expect)
print "?";
}
EOF
: process the command line options
set X `for arg in "$@"; do echo "X$arg"; done |
sed -e s/X// | awk -f options.awk`
eval "set $*"
shift
rm -f options.awk
: set up default values
fastread=''
reuseval=false
config_sh=''
alldone=''
error=''
silent=''
extractsh=''
override=''
knowitall=''
rm -f optdef.sh
cat >optdef.sh <<EOS
$startsh
EOS
: option parsing
while test $# -gt 0; do
case "$1" in
-d) shift; fastread=yes;;
-e) shift; alldone=cont;;
-f)
shift
cd ..
if test -r "$1"; then
config_sh="$1"
else
echo "$me: cannot read config file $1." >&2
error=true
fi
cd UU
shift;;
-h) shift; error=true;;
-r) shift; reuseval=true;;
-s) shift; silent=true; realsilent=true;;
-E) shift; alldone=exit;;
-K) shift; knowitall=true;;
-O) shift; override=true;;
-S) shift; silent=true; extractsh=true;;
-D)
shift
case "$1" in
*=)
echo "$me: use '-U symbol=', not '-D symbol='." >&2
echo "$me: ignoring -D $1" >&2
;;
*=*) echo "$1" | sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
*) echo "$1='define'" >> optdef.sh;;
esac
shift
;;
-U)
shift
case "$1" in
*=) echo "$1" >> optdef.sh;;
*=*)
echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
echo "$me: ignoring -U $1" >&2
;;
*)
echo "$1='undef'" >> optdef.sh;;
esac
shift
;;
-V) echo "$me generated by metaconfig 3.0 PL70." >&2
exit 0;;
--) break;;
-*) echo "$me: unknown option $1" >&2; shift; error=true;;
*) break;;
esac
done
case "$error" in
true)
cat >&2 <<EOM
Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
[-U symbol] [-U symbol=]
-d : use defaults for all answers.
-e : go on without questioning past the production of config.sh.
-f : specify an alternate default configuration file.
-h : print this help message and exit (with an error status).
-r : reuse C symbols value if possible (skips costly nm extraction).
-s : silent mode, only echoes questions and essential information.
-D : define symbol to have some value:
-D symbol symbol gets the value 'define'
-D symbol=value symbol gets the value 'value'
-E : stop at the end of questions, after having produced config.sh.
-K : do not use unless you know what you are doing.
-O : let -D and -U override definitions from loaded configuration file.
-S : perform variable substitutions on all .sh files (can mix with -f)
-U : undefine symbol:
-U symbol symbol gets the value 'undef'
-U symbol= symbol gets completely empty
-V : print version number and exit (with a zero status).
EOM
exit 1
;;
esac
: Sanity checks
case "$fastread$alldone" in
yescont|yesexit) ;;
*)
if test ! -t 0; then
echo "Say 'sh Configure', not 'sh <Configure'"
exit 1
fi
;;
esac
exec 4>&1
case "$silent" in
true) exec 1>/dev/null;;
esac
: run the defines and the undefines, if any, but leave the file out there...
touch optdef.sh
. ./optdef.sh
: set package name
package=c2man
first=`echo $package | sed -e 's/^\(.\).*/\1/'`
last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
*) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
esac
: Some greps do not return status, grrr.
echo "grimblepritz" >grimble
if grep blurfldyick grimble >/dev/null 2>&1 ; then
contains=contains
elif grep grimblepritz grimble >/dev/null 2>&1 ; then
contains=grep
else
contains=contains
fi
rm -f grimble
: the following should work in any shell
case "$contains" in
contains*)
echo " "
echo "AGH! Grep doesn't return a status. Attempting remedial action."
cat >contains <<'EOSS'
grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
EOSS
chmod +x contains
esac
: first determine how to suppress newline on echo command
echo " "
echo "Checking echo to see how to suppress newlines..."
(echo "hi there\c" ; echo " ") >.echotmp
if $contains c .echotmp >/dev/null 2>&1 ; then
echo "...using -n."
n='-n'
c=''
else
cat <<'EOM'
...using \c
EOM
n=''
c='\c'
fi
echo $n "The star should be here-->$c"
echo '*'
rm -f .echotmp
: compute the number of columns on the terminal for proper question formatting
case "$COLUMNS" in
'') COLUMNS='80';;
esac
: set up the echo used in my read
myecho="case \"\$xxxm\" in '') echo $n \"\$rp $c\" >&4;;
*) case \"\$rp\" in
'') echo $n \"[\$xxxm] $c\";;
*)
if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
echo \"\$rp\" >&4
echo $n \"[\$xxxm] $c\" >&4
else
echo $n \"\$rp [\$xxxm] $c\" >&4
fi
;;
esac;;
esac"
: now set up to do reads with possible shell escape and default assignment
cat <<EOSC >myread
$startsh
xxxm=\$dflt
$myecho
ans='!'
case "\$fastread" in
yes) case "\$dflt" in
'') ;;
*) ans='';
case "\$silent-\$rp" in
true-) ;;
*) echo " " >&4;;
esac;;
esac;;
*) case "\$silent" in
true) case "\$rp" in
'') ans='';;
esac;;
esac;;
esac
while expr "X\$ans" : "X!" >/dev/null; do
read answ
set x \$xxxm
shift
aok=''; eval "ans=\\"\$answ\\"" && aok=y
case "\$answ" in
"!")
sh 1>&4
echo " "
$myecho
;;
!*)
set x \`expr "X\$ans" : "X!\(.*\)\$"\`
shift
sh 1>&4 -c "\$*"
echo " "
$myecho
;;
"\$ans")
case "\$ans" in
\\&*)
set x \`expr "X\$ans" : "X&\(.*\)\$"\`
shift
case "\$1" in
-d)
fastread=yes
echo "(OK, I'll run with -d after this question.)" >&4
;;
-*)
echo "*** Sorry, \$1 not supported yet." >&4
;;
esac
$myecho
ans=!
;;
esac;;
*)
case "\$aok" in
y)
echo "*** Substitution done -- please confirm."
xxxm="\$ans"
ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
xxxm="\$ans"
ans=!
;;
*)
echo "*** Error -- try again."
ans=!
;;
esac
$myecho
;;
esac
case "\$ans\$xxxm\$nostick" in
'')
ans=!
$myecho
;;
esac
done
case "\$ans" in
'') ans="\$xxxm";;
esac
EOSC
: Find the path to the source tree
case "$src" in
'') src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
esac
case "$src" in
'')
src=.
rsrc=..
;;
/*) rsrc="$src/..";;
*) rsrc="../$src";;
esac
if test -f $rsrc/Configure && \
$contains "^package=$package" $rsrc/Configure >/dev/null 2>&1
then
: found it, so we are ok.
else
rsrc=''
for src in . .. ../.. ../../.. ../../../..; do
if test -f ../$src/Configure && \
$contains "^package=$package" ../$src/Configure >/dev/null 2>&1
then
rsrc=../$src
break
fi
done
fi
case "$rsrc" in
'')
echo " "
dflt=
rp="Directory where sources for $package are located?"
. ./myread
src="$ans"
rsrc="$src"
if test -f $rsrc/Configure && \
$contains "^package=$package" $rsrc/Configure >/dev/null 2>&1
then
echo "Ok, I've found them under $src"
else
echo "Sorry, I can't seem to be able to locate $package sources." >&4
exit 1
fi
;;
../.) ;;
*)
echo " "
echo "Sources for $package found in $src" >&4
;;
esac
: script used to extract .sh files with variable substitutions
cat >extract <<'EOS'
CONFIG=true
echo "Doing variable substitutions on .sh files..."
if test -f $src/MANIFEST; then
set x `awk '{print $1}' <$src/MANIFEST | grep '\.sh'`
else
echo "(Looking for .sh files under the source directory.)"
set x `(cd $src; find . -name "*.sh" -print)`
fi
shift
case $# in
0) set x `(cd $src; echo *.sh)`; shift;;
esac
if test ! -f $src/$1; then
shift
fi
mkdir_p='
name=$1;
create="";
while test $name; do
if test ! -d "$name"; then
create="$name $create";
name=`echo $name | sed -e "s|^[^/]*$||"`;
name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
else
name="";
fi;
done;
for file in $create; do
mkdir $file;
done
'
for file in $*; do
case "$src" in
".")
case "$file" in
*/*)
dir=`expr X$file : 'X\(.*\)/'`
file=`expr X$file : 'X.*/\(.*\)'`
(cd $dir && . ./$file)
;;
*)
. ./$file
;;
esac
;;
*)
case "$file" in
*/*)
dir=`expr X$file : 'X\(.*\)/'`
file=`expr X$file : 'X.*/\(.*\)'`
(set x $dir; shift; eval $mkdir_p)
sh <$src/$dir/$file
;;
*)
sh <$src/$file
;;
esac
;;
esac
done
if test -f $src/config_h.sh; then
if test ! -f config.h; then
: oops, they left it out of MANIFEST, probably, so do it anyway.
. $src/config_h.sh
fi
fi
EOS
: extract files and exit if asked to do so
case "$extractsh" in
true)
case "$realsilent" in
true) ;;
*) exec 1>&4;;
esac
case "$config_sh" in
'') config_sh='config.sh'; config="$rsrc/config.sh";;
/*) config="$config_sh";;
*) config="$rsrc/$config_sh";;
esac
echo " "
echo "Fetching answers from $config_sh..."
. $config
test "$override" && . ./optdef.sh
echo " "
cd ..
. UU/extract
rm -rf UU
echo "Done."
exit 0
;;
esac
: Eunice requires " " instead of "", can you believe it
echo " "
: Here we go...
echo "Beginning of configuration questions for $package."
trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
: Now test for existence of everything in MANIFEST
echo " "
if test -f $rsrc/MANIFEST; then
echo "First let's make sure your kit is complete. Checking..." >&4
awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -l 50
rm -f missing
tmppwd=`pwd`
for filelist in x??; do
(cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
done
if test -s missing; then
cat missing >&4
cat >&4 <<'EOM'
THIS PACKAGE SEEMS TO BE INCOMPLETE.
You have the option of continuing the configuration process, despite the
distinct possibility that your kit is damaged, by typing 'y'es. If you
do, don't blame me if something goes wrong. I advise you to type 'n'o
and contact the author ([email protected]).
EOM
echo $n "Continue? [n] $c" >&4
read ans
case "$ans" in
y*)
echo "Continuing..." >&4
rm -f missing
;;
*)
echo "ABORTING..." >&4
kill $$
;;
esac
else
echo "Looks good..."
fi
else
echo "There is no MANIFEST file. I hope your kit is complete !"
fi
rm -f missing x??
: create .config dir to save info across Configure sessions
test -d ../.config || mkdir ../.config
cat >../.config/README <<EOF
This directory created by Configure to save information that should
persist across sessions for $package.
You may safely delete it if you wish.
EOF
: general instructions
needman=true
firsttime=true
user=`(logname) 2>/dev/null`
case "$user" in