forked from schacon/perl
/
Configure
executable file
·6241 lines (5894 loc) · 128 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
#
# 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 so you may fetch it yourself from your nearest
# archive site. Check with Archie if you don't know where that can be.)
#
# $Id: Head.U,v 3.0.1.3 1993/12/15 08:15:07 ram Exp $
#
# Generated on Wed May 4 14:59:36 EDT 1994 [metaconfig 3.0 PL22]
cat >/tmp/c1$$ <<EOF
ARGGGHHHH!!!!!
SCO csh still thinks true is false. Write to SCO today and tell them that next
year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
(Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
we'd have to do is go in and swap the && and || tokens, wherever they are.)
[End of diatribe. We now return you to your regularly scheduled programming...]
EOF
cat >/tmp/c2$$ <<EOF
OOPS! You naughty creature! You didn't run Configure with sh!
I will attempt to remedy the situation by running sh for you...
EOF
true || cat /tmp/c1$$ /tmp/c2$$
true || exec sh $0 $argv:q
(exit $?0) || cat /tmp/c2$$
(exit $?0) || exec sh $0 $argv:q
rm -f /tmp/c1$$ /tmp/c2$$
: Sanity checks
PATH=".:$PATH:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin"
PATH=$PATH:'/usr/5bin:/etc:/usr/gnu/bin:/usr/new:/usr/new/bin:/usr/nbin'
PATH=$PATH:'/sys5.3/bin:/sys5.3/usr/bin:/bsd4.3/bin:/bsd4.3/usr/ucb'
PATH=$PATH:'/bsd4.3/usr/bin:/usr/bsd:/bsd43/bin:/usr/ccs/bin'
PATH=$PATH:'/etc:/usr/lib:/usr/ucblib:/lib:/usr/ccs/lib'
PATH=$PATH:'/sbin:/usr/sbin:/usr/libexec'
export PATH
if test ! -t 0; then
echo "Say 'sh Configure', not 'sh <Configure'"
exit 1
fi
: On HP-UX, large Configure scripts may exercise a bug in /bin/sh
if test -f /hp-ux -a -f /bin/ksh; then
if (PATH=.; alias -x) >/dev/null 2>&1; then
: already under /bin/ksh
else
cat <<'EOM'
(Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
EOM
exec /bin/ksh $0 "$@"
fi
else
: Warn them if they use ksh on other systems
(PATH=.; alias -x) >/dev/null 2>&1 && \
cat <<'EOM'
(I see you are using the Korn shell. Some ksh's blow up on Configure,
especially on exotic machines. If yours does, try the Bourne shell instead.)
EOM
fi
: Configure runs within the UU subdirectory
test -d UU || mkdir UU
cd UU && rm -f *
extensions=''
d_eunice=''
d_xenix=''
eunicefix=''
Mcc=''
awk=''
bash=''
bison=''
byacc=''
cat=''
chgrp=''
chmod=''
chown=''
compress=''
cp=''
cpio=''
cpp=''
csh=''
date=''
echo=''
egrep=''
emacs=''
expr=''
find=''
flex=''
gcc=''
grep=''
inews=''
ksh=''
less=''
line=''
lint=''
ln=''
lp=''
lpr=''
ls=''
mail=''
mailx=''
make=''
mkdir=''
more=''
mv=''
nroff=''
perl=''
pg=''
pmake=''
pr=''
rm=''
rmail=''
sed=''
sendmail=''
sh=''
shar=''
sleep=''
smail=''
sort=''
submit=''
tail=''
tar=''
tbl=''
test=''
touch=''
tr=''
troff=''
uname=''
uniq=''
uuname=''
vi=''
zcat=''
hint=''
myuname=''
osname=''
osvers=''
Author=''
Date=''
Header=''
Id=''
Locker=''
Log=''
RCSfile=''
Revision=''
Source=''
State=''
afs=''
memalignbytes=''
bin=''
binexp=''
installbin=''
byteorder=''
cc=''
gccversion=''
ccflags=''
cppflags=''
ldflags=''
lkflags=''
optimize=''
cf_by=''
cf_time=''
contains=''
cpplast=''
cppminus=''
cpprun=''
cppstdin=''
d_access=''
d_bcmp=''
d_bcopy=''
d_bzero=''
d_casti32=''
castflags=''
d_castneg=''
d_charsprf=''
d_chsize=''
d_const=''
cryptlib=''
d_crypt=''
d_csh=''
d_dosuid=''
d_dup2=''
d_fchmod=''
d_fchown=''
d_fcntl=''
d_flexfnam=''
d_flock=''
d_getgrps=''
d_gethent=''
aphostname=''
d_gethname=''
d_phostname=''
d_uname=''
d_getpgrp2=''
d_getpgrp=''
d_getprior=''
d_htonl=''
d_isascii=''
d_killpg=''
d_link=''
d_lstat=''
d_memcmp=''
d_memcpy=''
d_memmove=''
d_memset=''
d_mkdir=''
d_msg=''
d_msgctl=''
d_msgget=''
d_msgrcv=''
d_msgsnd=''
d_open3=''
d_portable=''
d_readdir=''
d_rewinddir=''
d_seekdir=''
d_telldir=''
d_rename=''
d_rmdir=''
d_safebcpy=''
d_safemcpy=''
d_select=''
d_sem=''
d_semctl=''
d_semget=''
d_semop=''
d_setegid=''
d_seteuid=''
d_setlocale=''
d_setpgid=''
d_setpgrp2=''
d_bsdpgrp=''
d_setpgrp=''
d_setprior=''
d_setregid=''
d_setresgid=''
d_setresuid=''
d_setreuid=''
d_setrgid=''
d_setruid=''
d_setsid=''
d_shm=''
d_shmat=''
d_voidshmat=''
d_shmctl=''
d_shmdt=''
d_shmget=''
d_oldsock=''
d_socket=''
d_sockpair=''
sockethdr=''
socketlib=''
d_statblks=''
d_stdstdio=''
d_index=''
d_strchr=''
d_strctcpy=''
d_strerrm=''
d_strerror=''
d_sysernlst=''
d_syserrlst=''
d_symlink=''
d_syscall=''
d_system=''
d_time=''
timetype=''
clocktype=''
d_times=''
d_truncate=''
d_usendir=''
i_ndir=''
ndirc=''
ndirlib=''
ndiro=''
d_vfork=''
d_voidsig=''
signal_t=''
d_volatile=''
d_charvspr=''
d_vprintf=''
d_wait4=''
d_waitpid=''
cccdlflags=''
ccdlflags=''
dldir=''
dlobj=''
dlsrc=''
lddlflags=''
shlibsuffix=''
usedl=''
gidtype=''
groupstype=''
h_fcntl=''
h_sysfile=''
i_dbm=''
d_dirnamlen=''
i_dirent=''
i_dlfcn=''
i_fcntl=''
i_gdbm=''
i_grp=''
i_memory=''
i_ndbm=''
i_neterrno=''
i_niin=''
i_sysin=''
d_pwage=''
d_pwchange=''
d_pwclass=''
d_pwcomment=''
d_pwexpire=''
d_pwquota=''
i_pwd=''
i_sdbm=''
i_stdarg=''
i_stddef=''
i_string=''
strings=''
i_sysdir=''
i_sysfile=''
d_voidtty=''
i_bsdioctl=''
i_sysioctl=''
i_syssockio=''
i_sysndir=''
i_sysselct=''
i_sgtty=''
i_termio=''
i_termios=''
i_systime=''
i_systimek=''
i_time=''
timeincl=''
i_unistd=''
i_utime=''
i_varargs=''
i_varhdr=''
i_vfork=''
intsize=''
lib=''
libexp=''
libc=''
libpth=''
plibpth=''
xlibpth=''
libs=''
lns=''
lseektype=''
d_mymalloc=''
mallocobj=''
mallocsrc=''
malloctype=''
usemymalloc=''
installmansrc=''
manext=''
mansrc=''
mansrcexp=''
huge=''
large=''
medium=''
models=''
small=''
split=''
mydomain=''
myhostname=''
phostname=''
c=''
n=''
groupcat=''
hostcat=''
passcat=''
orderlib=''
ranlib=''
package=''
spackage=''
installprivlib=''
privlib=''
privlibexp=''
prototype=''
ptrsize=''
randbits=''
installscript=''
scriptdir=''
scriptdirexp=''
sig_name=''
sharpbang=''
shsharp=''
spitshell=''
startsh=''
stdchar=''
sysman=''
uidtype=''
nm_opt=''
runnm=''
usenm=''
incpath=''
mips=''
mips_type=''
usrinc=''
defvoidused=''
voidflags=''
yacc=''
yaccflags=''
CONFIG=''
: script used to extract .SH files with variable substitutions
cat >extract <<'EOS'
CONFIG=true
echo "Doing variable substitutions on .SH files..."
if test -f MANIFEST; then
set x `awk '{print $1}' <MANIFEST | grep '\.SH'`
else
echo "(Looking for .SH files under the current directory.)"
set x `find . -name "*.SH" -print`
fi
shift
case $# in
0) set x *.SH; shift;;
esac
if test ! -f $1; then
shift
fi
for file in $*; do
case "$file" in
*/*)
dir=`expr X$file : 'X\(.*\)/'`
file=`expr X$file : 'X.*/\(.*\)'`
(cd $dir && . ./$file)
;;
*)
. ./$file
;;
esac
done
if test -f config_h.SH; then
if test ! -f config.h; then
: oops, they left it out of MANIFEST, probably, so do it anyway.
. ./config_h.SH
fi
fi
EOS
: produce awk script to parse command line options
cat >options.awk <<'EOF'
BEGIN {
optstr = "deEf:hrsSV"; # 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 $arg; done | awk -f options.awk`
eval "set $*"
shift
rm -f options.awk
: set up default values
fastread=''
reuseval=false
config_sh=''
alldone=''
error=''
silent=''
extractsh=''
: 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 "Configure: cannot read config file $1." >&2
error=true
fi
cd UU
shift;;
-h) shift; error=true;;
-r) shift; reuseval=true;;
-s) shift; silent=true;;
-E) shift; alldone=exit;;
-S) shift; extractsh=true;;
-V) echo "Configure generated by metaconfig 3.0 PL22." >&2
exit 0;;
--) break;;
-*) echo "Configure: unknown option $1" >&2; shift; error=true;;
*) break;;
esac
done
case "$error" in
true)
cat >&2 <<EOM
Usage: Configure [-dehrESV] [-f config.sh]
-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.
-E : stop at the end of questions, after having produced config.sh.
-S : perform variable substitutions on all .SH files (can mix with -f)
-V : print version number and exit (with a zero status).
EOM
exit 1
;;
esac
exec 4>&1
case "$silent" in
true) exec 1>/dev/null;;
esac
case "$extractsh" in
true)
case "$config_sh" in
'') config_sh='config.sh'; config='./config.sh';;
/*) config="$config_sh";;
*) config="./$config_sh";;
esac
echo " "
echo "Fetching answers from $config_sh..."
cd ..
. $config
echo " "
. ./UU/extract
rm -rf UU
echo "Done."
exit 0
;;
esac
: set package name
package=perl5
: Eunice requires " " instead of "", can you believe it
echo " "
: Here we go...
echo "Beginning of configuration questions for $package."
define='define'
undef='undef'
smallmach='pdp11 i8086 z8000 i80286 iAPX286'
rmlist=''
trap 'echo " "; rm -rf $rmlist; exit 1' 1 2 3 15
: We must find out about Eunice early
eunicefix=':'
if test -f /etc/unixtovms; then
eunicefix=/etc/unixtovms
fi
if test -f /etc/unixtovms.exe; then
eunicefix=/etc/unixtovms.exe
fi
: list of known cpp symbols
attrlist="__alpha __bsdi__ BSD_NET2 DGUX M_I186 M_I286 M_I386"
attrlist="$attrlist M_I8086 M_XENIX UTS __DGUX__"
attrlist="$attrlist _AIX __STDC__ __m88k__ ansi bsd4_2 gcos gimpel"
attrlist="$attrlist hp9000s300 hp9000s400 hp9000s500 hp9000s700"
attrlist="$attrlist hp9000s800 hpux"
attrlist="$attrlist i186 i386 i486 i8086 iAPX286 ibm interdata"
attrlist="$attrlist m88k mc300 mc500 mc68000 mc68k mc700 mert"
attrlist="$attrlist mips NeXT ns16000 ns32000 nsc32000 os"
attrlist="$attrlist __osf__ pdp11 posix"
attrlist="$attrlist pyr sinix sony sparc sun tower tower32 tower32_600"
attrlist="$attrlist tower32_800 tss u3b2 u3b20 u3b200 u3b5 ultrix unix"
attrlist="$attrlist __unix__ vax venix xenix z8000"
i_whoami=''
: List of extensions we want:
extensions=''
gccversion=''
: no include file wanted by default
inclwanted=''
: File to use for dynamic loading
usedl=''
gidtype=''
groupstype=''
: change the next line if compiling for Xenix/286 on Xenix/386
xlibpth='/usr/lib/386 /lib/386'
: general looking path for locating libraries
libpth="/usr/lib/large /lib /usr/lib $xlibpth /lib/large"
libpth="$libpth /usr/lib/small /lib/small"
libpth="$libpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
: Private path used by Configure to find libraries. Its value
: is prepend to libpth. This variable takes care of special
: machines, like the mips. Usually, it should be empty.
plibpth=''
libswanted=" net socket inet nsl nm sdbm gdbm ndbm dbm malloc dl dld sun m c_s posix cposix ndir dir ucb bsd BSD PW x "
: full support for void wanted by default
defvoidused=15
: 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
: Now test for existence of everything in MANIFEST
echo " "
if test -f ../MANIFEST; then
echo "First let's make sure your kit is complete. Checking..." >&4
awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
rm -f missing
for filelist in x??; do
(cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/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 (lwall@netlabs.com).
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..." >&4
fi
else
echo "There is no MANIFEST file. I hope your kit is complete !"
fi
rm -f missing x??
: 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
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
"\$ans")
case "\$ans" in
"!")
sh 1>&4
echo " "
$myecho
;;
!*)
set x \`expr "X\$ans" : "X!\(.*\)\$"\`
shift
sh 1>&4 -c "\$*"
echo " "
$myecho
;;
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
: 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.
You may safely delete it if you wish.
EOF
: general instructions
needman=true
firsttime=true
user=`( (logname) 2>/dev/null || whoami) 2>&1`
if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
firsttime=false
echo " "
rp='Would you like to see the instructions?'
dflt=n
. ./myread
case "$ans" in
[yY]*) ;;
*) needman=false;;
esac
fi
if $needman; then
cat <<EOH
This installation shell script will examine your system and ask you questions
to determine how the perl package should be installed. If you get
stuck on a question, you may use a ! shell escape to start a subshell or
execute a command. Many of the questions will have default answers in square
brackets; typing carriage return will give you the default.
On some of the questions which ask for file or directory names you are allowed
to use the ~name construct to specify the login directory belonging to "name",
even if you don't have a shell which knows about that. Questions where this is
allowed will be marked "(~name ok)".
EOH
rp=''
dflt='Type carriage return to continue'
. ./myread
cat <<'EOH'
The prompter used in this script allows you to use shell variables and
backticks in your answers. You may use $1, $2, etc... to refer to the words
in the default answer, as if the default line was a set of arguments given to a
script shell. This means you may also use $* to repeat the whole default line,
so you do not have to re-type everything to add something to the default.
Everytime there is a substitution, you will have to confirm. If there is an
error (e.g. an unmatched backtick), the default answer will remain unchanged
and you will be prompted again.
If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
the questions and use the computed defaults (or the previous answers if there
was already a config.sh file). Type 'Configure -h' for a list of options.
EOH
. ./myread
cat <<EOH
Much effort has been expended to ensure that this shell script will run on any
Unix system. If despite that it blows up on yours, your best bet is to edit
Configure and run it again. Also, let me (lwall@netlabs.com)
know how I blew it. If you can't run Configure for some reason, you'll have to
generate a config.sh file by hand.
This installation script affects things in two ways:
1) it may do direct variable substitutions on some of the files included
in this kit.
2) it builds a config.h file for inclusion in C programs. You may edit
any of these files as the need arises after running this script.
If you make a mistake on a question, there is no easy way to back up to it
currently. The easiest thing to do is to edit config.sh and rerun all the SH
files. Configure will offer to let you do this before it runs the SH files.
EOH
dflt='Type carriage return to continue'
. ./myread
case "$firsttime" in
true) echo $user >>../.config/instruct;;
esac
fi
: see if sh knows # comments
echo " "
echo "Checking your sh to see if it knows about # comments..." >&4
if sh -c '#' >/dev/null 2>&1 ; then
echo "Your sh handles # comments correctly."
shsharp=true
spitshell=cat
echo " "
echo "Okay, let's see if #! works on this system..."
echo "#!/bin/cat" >try
$eunicefix try
chmod +x try
./try > today
if test -s today; then
echo "It does."
sharpbang='#!'
else
echo "#! /bin/cat" > try
$eunicefix try
chmod +x try
./try > today
if test -s today; then
echo "It does."
sharpbang='#! '
else
echo "It's just a comment."
sharpbang=': use '
fi
fi
else
echo "Your sh doesn't grok # comments--I will strip them later on."
shsharp=false
echo "exec grep -v '^[ ]*#'" >spitshell
chmod +x spitshell
$eunicefix spitshell
spitshell=`pwd`/spitshell
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
echo " "
echo "Checking out how to guarantee sh startup..." >&4
case "$SYSTYPE" in
*bsd*|sys5*) startsh=$sharpbang"/$SYSTYPE/bin/sh";;
*) startsh=$sharpbang'/bin/sh';;
esac
echo "Let's see if '$startsh' works..."
cat >try <<EOSS
$startsh
set abc
test "$?abc" != 1
EOSS
chmod +x try
$eunicefix try
if ./try; then
echo "Yup, it does."
else
echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
fi
rm -f try
: find out where common programs are
echo " "
echo "Locating common programs..." >&4
cat <<EOSC >loc
$startsh
case \$# in
0) exit 1;;
esac
thing=\$1
shift
dflt=\$1
shift
for dir in \$*; do
case "\$thing" in