3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc so you may fetch it yourself from your nearest
18 # archive site. Check with Archie if you don't know where that can be.)
21 # $Id: Head.U,v 3.0.1.8 1995/07/25 13:40:02 ram Exp $
23 # Generated on Sat Feb 1 00:26:40 EST 1997 [metaconfig 3.0 PL60]
28 SCO csh still thinks true is false. Write to SCO today and tell them that next
29 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
31 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
32 we'd have to do is go in and swap the && and || tokens, wherever they are.)
34 [End of diatribe. We now return you to your regularly scheduled programming...]
38 OOPS! You naughty creature! You didn't run Configure with sh!
39 I will attempt to remedy the situation by running sh for you...
42 true || cat /tmp/c1$$ /tmp/c2$$
43 true || exec sh $0 $argv:q
45 (exit $?0) || cat /tmp/c2$$
46 (exit $?0) || exec sh $0 $argv:q
47 rm -f /tmp/c1$$ /tmp/c2$$
49 : compute my invocation name
53 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
58 : Proper PATH separator
60 : On OS/2 this directory should exist if this is not floppy only system :-]
61 if test -d c:/. -a -n "$OS2_SHELL"; then
63 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
64 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
66 if test -d c:/. -a -n "$DJDIR"; then
71 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
72 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
73 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
74 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
75 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
76 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
77 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
78 paths="$paths /sbin /usr/sbin /usr/libexec"
84 *) test -d $p && PATH=$PATH$p_$p ;;
91 : This should not matter in scripts, but apparently it does, sometimes
99 echo "Say 'sh $me', not 'sh <$me'"
103 : Test and see if we are running under ksh, either blatantly or in disguise.
104 if (PATH=.; alias -x) >/dev/null 2>&1; then
105 : running under ksh. Is this a good thing?
106 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname ; then
107 if test X`/usr/bin/uname -v` = X4 ; then
108 : on AIX 4, /bin/sh is really ksh, and it causes us problems.
111 (Feeding myself to /usr/bin/bsh to avoid AIX 4's /bin/sh.)
114 exec /usr/bin/bsh $0 "$@"
117 if test ! -f /hp-ux ; then
118 : Warn them if they use ksh on other systems
120 (I see you are using the Korn shell. Some ksh's blow up on $me,
121 especially on older exotic systems. If yours does, try the Bourne
128 : Not running under ksh. Maybe we should be?
129 : On HP-UX, large Configure scripts may exercise a bug in /bin/sh
130 if test -f /hp-ux -a -f /bin/ksh; then
132 (Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
135 exec /bin/ksh $0 "$@"
139 : Configure runs within the UU subdirectory
140 test -d UU || mkdir UU
506 d_pthreads_created_joinable=''
657 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
660 : We must find out about Eunice early
662 if test -f /etc/unixtovms; then
663 eunicefix=/etc/unixtovms
665 if test -f /etc/unixtovms.exe; then
666 eunicefix=/etc/unixtovms.exe
669 : list of known cpp symbols, sorted alphabetically
670 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
671 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
672 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
673 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
674 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
675 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
676 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
677 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
678 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
679 al="$al VMS Xenix286"
680 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
681 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
682 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
683 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
684 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
685 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
686 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
687 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
688 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
689 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
690 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
691 al="$al __SVR4_2__ __UMAXV__"
692 al="$al ____386BSD____ __alpha __alpha__ __amiga"
693 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
694 al="$al __host_mips__"
695 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
696 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
697 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
698 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
699 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
700 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
701 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
702 al="$al __mc88100 __mc88100__ __mips __mips__"
703 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
704 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
705 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
706 al="$al _host_mips _mips _unix"
707 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
708 al="$al apollo ardent att386 att3b"
709 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
710 al="$al cadmus clipper concurrent convex cray ctix"
711 al="$al dmert encore gcos gcx gimpel gould"
712 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
713 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
714 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
715 al="$al i186 i286 i386 i486 i8086"
716 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
717 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
718 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
719 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
720 al="$al mc88000 mc88100 merlin mert mips mvs n16"
721 al="$al ncl_el ncl_mr"
722 al="$al news1500 news1700 news1800 news1900 news3700"
723 al="$al news700 news800 news900 ns16000 ns32000"
724 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
725 al="$al parisc pc532 pdp11 plexus posix pyr"
726 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
727 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
728 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
729 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
730 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
731 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
736 : default library list
738 : set useposix=false in your hint file to disable the POSIX extension.
740 : set useopcode=false in your hint file to disable the Opcode extension.
742 : Define several unixisms. These can be used in hint files.
744 : Extra object files, if any, needed on this platform.
746 : Possible local include directories to search.
747 : Set locincpth to "" in a hint file to defeat local include searches.
748 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
749 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
751 : no include file wanted by default
754 : change the next line if compiling for Xenix/286 on Xenix/386
755 xlibpth='/usr/lib/386 /lib/386'
757 : Possible local library directories to search.
758 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
759 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
761 : general looking path for locating libraries
762 glibpth="/shlib /usr/shlib /usr/lib/pa1.1 /usr/lib/large"
763 glibpth="$glibpth /lib /usr/lib $xlibpth"
764 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
765 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
767 : Private path used by Configure to find libraries. Its value
768 : is prepended to libpth. This variable takes care of special
769 : machines, like the mips. Usually, it should be empty.
772 : full support for void wanted by default
775 : List of libraries we want.
776 libswanted='sfio net socket inet nsl nm ndbm gdbm dbm db malloc dl'
777 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
778 libswanted="$libswanted ucb bsd BSD PW x"
779 : We probably want to search /usr/shlib before most other libraries.
780 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
781 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
782 glibpth="/usr/shlib $glibpth"
783 : Do not use vfork unless overridden by a hint file.
786 : Find the basic shell for Bourne shell scripts
789 : SYSTYPE is for some older MIPS systems.
790 : I do not know if it is still needed.
792 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
795 if test -f "$xxx"; then
798 : Build up a list and do a single loop so we can 'break' out.
799 pth=`echo $PATH | sed -e "s/$p_/ /g"`
800 for xxx in sh bash ksh pdksh ash; do
802 try="$try ${p}/${xxx}"
806 if test -f "$xxx"; then
808 echo "Your Bourne shell appears to be in $sh."
810 elif test -f "$xxx.exe"; then
812 echo "Hmm. Your Bourne shell appears to be in $sh."
822 $me: Fatal Error: I can't find a Bourne Shell anywhere.
823 Usually it's in /bin/sh. How did you even get this far?
824 Please contact me (Chip Salzenberg) at chip@perl.com and
825 we'll try to straigten this all out.
831 : see if sh knows # comments
832 if `$sh -c '#' >/dev/null 2>&1`; then
837 test -f $xcat || xcat=/usr/bin/cat
842 if test -s today; then
845 echo "#! $xcat" > try
849 if test -s today; then
852 echo "Okay, let's see if #! works on this system..."
853 echo "It's just a comment."
858 echo "Your $sh doesn't grok # comments--I will strip them later on."
861 echo "exec grep -v '^[ ]*#'" >spitshell
864 spitshell=`pwd`/spitshell
866 echo "I presume that if # doesn't work, #! won't work either!"
871 : figure out how to guarantee sh startup
873 '') startsh=${sharpbang}${sh} ;;
885 : echo "Yup, it does."
887 echo "Hmm. '$startsh' didn't work."
888 echo "You may have to fix up the shell scripts to make sure sh runs them."
892 : script used to extract .SH files with variable substitutions
896 cat >>extract <<'EOS'
898 echo "Doing variable substitutions on .SH files..."
899 if test -f MANIFEST; then
900 shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
901 : Pick up possible extension manifests.
902 for dir in ext/* ; do
903 if test -f $dir/MANIFEST; then
904 xxx=`awk '{print $1}' < $dir/MANIFEST |
905 sed -n "/\.SH$/ s@^@$dir/@p"`
906 shlist="$shlist $xxx"
911 echo "(Looking for .SH files under the current directory.)"
912 set x `find . -name "*.SH" -print`
916 0) set x *.SH; shift;;
918 if test ! -f $1; then
924 dir=`expr X$file : 'X\(.*\)/'`
925 file=`expr X$file : 'X.*/\(.*\)'`
926 (cd $dir && . ./$file)
933 if test -f config_h.SH; then
934 if test ! -f config.h; then
935 : oops, they left it out of MANIFEST, probably, so do it anyway.
941 : produce awk script to parse command line options
942 cat >options.awk <<'EOF'
944 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
946 len = length(optstr);
947 for (i = 1; i <= len; i++) {
948 c = substr(optstr, i, 1);
949 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
960 if (substr(str, 1, 1) != "-") {
961 printf("'%s'\n", str);
965 for (i = 2; i <= len; i++) {
966 c = substr(str, i, 1);
968 printf("-%s\n", substr(str, i));
974 printf("'%s'\n", substr(str, i + 1));
987 : process the command line options
988 set X `for arg in "$@"; do echo "X$arg"; done |
989 sed -e s/X// | awk -f options.awk`
994 : set up default values
1006 cat >optdef.sh <<EOS
1011 while test $# -gt 0; do
1013 -d) shift; fastread=yes;;
1014 -e) shift; alldone=cont;;
1018 if test -r "$1"; then
1021 echo "$me: cannot read config file $1." >&2
1026 -h) shift; error=true;;
1027 -r) shift; reuseval=true;;
1028 -s) shift; silent=true;;
1029 -E) shift; alldone=exit;;
1030 -K) shift; knowitall=true;;
1031 -O) shift; override=true;;
1032 -S) shift; extractsh=true;;
1037 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1038 echo "$me: ignoring -D $1" >&2
1041 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1042 *) echo "$1='define'" >> optdef.sh;;
1049 *=) echo "$1" >> optdef.sh;;
1051 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1052 echo "$me: ignoring -U $1" >&2
1054 *) echo "$1='undef'" >> optdef.sh;;
1058 -V) echo "$me generated by metaconfig 3.0 PL60." >&2
1061 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1069 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1070 [-U symbol] [-U symbol=]
1071 -d : use defaults for all answers.
1072 -e : go on without questioning past the production of config.sh.
1073 -f : specify an alternate default configuration file.
1074 -h : print this help message and exit (with an error status).
1075 -r : reuse C symbols value if possible (skips costly nm extraction).
1076 -s : silent mode, only echoes questions and essential information.
1077 -D : define symbol to have some value:
1078 -D symbol symbol gets the value 'define'
1079 -D symbol=value symbol gets the value 'value'
1080 -E : stop at the end of questions, after having produced config.sh.
1081 -K : do not use unless you know what you are doing.
1082 -O : let -D and -U override definitions from loaded configuration file.
1083 -S : perform variable substitutions on all .SH files (can mix with -f)
1084 -U : undefine symbol:
1085 -U symbol symbol gets the value 'undef'
1086 -U symbol= symbol gets completely empty
1087 -V : print version number and exit (with a zero status).
1095 true) exec 1>/dev/null;;
1098 : run the defines and the undefines, if any, but leave the file out there...
1102 case "$extractsh" in
1104 case "$config_sh" in
1105 '') config_sh='config.sh'; config='./config.sh';;
1106 /*) config="$config_sh";;
1107 *) config="./$config_sh";;
1110 echo "Fetching answers from $config_sh..."
1113 test "$override" && . ./optdef.sh
1124 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1125 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1126 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1127 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1128 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1131 : Eunice requires " " instead of "", can you believe it
1134 echo "Beginning of configuration questions for $package."
1136 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1138 : Some greps do not return status, grrr.
1139 echo "grimblepritz" >grimble
1140 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1142 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1148 : the following should work in any shell
1152 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1153 cat >contains <<'EOSS'
1154 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1159 : first determine how to suppress newline on echo command
1161 echo "Checking echo to see how to suppress newlines..."
1162 (echo "hi there\c" ; echo " ") >.echotmp
1163 if $contains c .echotmp >/dev/null 2>&1 ; then
1174 echo $n "The star should be here-->$c"
1178 : Now test for existence of everything in MANIFEST
1180 if test -f ../MANIFEST; then
1181 echo "First let's make sure your kit is complete. Checking..." >&4
1182 awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
1184 for filelist in x??; do
1185 (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
1187 if test -s missing; then
1191 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1193 You have the option of continuing the configuration process, despite the
1194 distinct possibility that your kit is damaged, by typing 'y'es. If you
1195 do, don't blame me if something goes wrong. I advise you to type 'n'o
1196 and contact the author (chip@perl.com).
1199 echo $n "Continue? [n] $c" >&4
1203 echo "Continuing..." >&4
1207 echo "ABORTING..." >&4
1212 echo "Looks good..." >&4
1215 echo "There is no MANIFEST file. I hope your kit is complete !"
1219 : compute the number of columns on the terminal for proper question formatting
1224 : set up the echo used in my read
1225 myecho="case \"\$xxxm\" in
1226 '') echo $n \"\$rp $c\" >&4;;
1228 '') echo $n \"[\$xxxm] $c\";;
1230 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1232 echo $n \"[\$xxxm] $c\" >&4
1234 echo $n \"\$rp [\$xxxm] $c\" >&4
1240 : now set up to do reads with possible shell escape and default assignment
1246 case "\$fastread" in
1247 yes) case "\$dflt" in
1250 case "\$silent-\$rp" in
1255 *) case "\$silent" in
1256 true) case "\$rp" in
1261 while expr "X\$ans" : "X!" >/dev/null; do
1265 aok=''; eval ans="\\"\$answ\\"" && aok=y
1270 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1275 echo "(OK, I'll run with -d after this question.)" >&4
1278 echo "*** Sorry, \$1 not supported yet." >&4
1290 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1300 echo "*** Substitution done -- please confirm."
1302 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1307 echo "*** Error -- try again."
1314 case "\$ans\$xxxm\$nostick" in
1326 : create .config dir to save info across Configure sessions
1327 test -d ../.config || mkdir ../.config
1328 cat >../.config/README <<EOF
1329 This directory created by Configure to save information that should
1330 persist across sessions.
1332 You may safely delete it if you wish.
1335 : general instructions
1338 user=`(logname) 2>/dev/null`
1340 user=`whoami 2>&1` ;;
1342 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1345 rp='Would you like to see the instructions?'
1356 This installation shell script will examine your system and ask you questions
1357 to determine how the perl5 package should be installed. If you get
1358 stuck on a question, you may use a ! shell escape to start a subshell or
1359 execute a command. Many of the questions will have default answers in square
1360 brackets; typing carriage return will give you the default.
1362 On some of the questions which ask for file or directory names you are allowed
1363 to use the ~name construct to specify the login directory belonging to "name",
1364 even if you don't have a shell which knows about that. Questions where this is
1365 allowed will be marked "(~name ok)".
1369 dflt='Type carriage return to continue'
1373 The prompter used in this script allows you to use shell variables and
1374 backticks in your answers. You may use $1, $2, etc... to refer to the words
1375 in the default answer, as if the default line was a set of arguments given to a
1376 script shell. This means you may also use $* to repeat the whole default line,
1377 so you do not have to re-type everything to add something to the default.
1379 Everytime there is a substitution, you will have to confirm. If there is an
1380 error (e.g. an unmatched backtick), the default answer will remain unchanged
1381 and you will be prompted again.
1383 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1384 the questions and use the computed defaults (or the previous answers if there
1385 was already a config.sh file). Type 'Configure -h' for a list of options.
1386 You may also start interactively and then answer '& -d' at any prompt to turn
1387 on the non-interactive behavior for the remainder of the execution.
1393 Much effort has been expended to ensure that this shell script will run on any
1394 Unix system. If despite that it blows up on yours, your best bet is to edit
1395 Configure and run it again. If you can't run Configure for some reason,
1396 you'll have to generate a config.sh file by hand. Whatever problems you
1397 have, let me (chip@perl.com) know how I blew it.
1399 This installation script affects things in two ways:
1401 1) it may do direct variable substitutions on some of the files included
1403 2) it builds a config.h file for inclusion in C programs. You may edit
1404 any of these files as the need arises after running this script.
1406 If you make a mistake on a question, there is no easy way to back up to it
1407 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1408 files. Configure will offer to let you do this before it runs the SH files.
1411 dflt='Type carriage return to continue'
1413 case "$firsttime" in
1414 true) echo $user >>../.config/instruct;;
1418 : find out where common programs are
1420 echo "Locating common programs..." >&4
1433 if test -d \$dir/\$thing; then
1439 for thisthing in \$dir/\$thing; do
1440 : just loop through to pick last item
1442 if test -f \$thisthing; then
1445 elif test -f \$dir/\$thing.exe; then
1446 : on Eunice apparently
1496 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1497 pth="$pth /lib /usr/lib"
1498 for file in $loclist; do
1499 xxx=`./loc $file $file $pth`
1504 echo $file is in $xxx.
1507 echo $file is in $xxx.
1510 echo "I don't know where '$file' is, and my life depends on it." >&4
1511 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1517 echo "Don't worry if any of the following aren't found..."
1519 for file in $trylist; do
1520 xxx=`./loc $file $file $pth`
1525 echo $file is in $xxx.
1528 echo $file is in $xxx.
1531 echo "I don't see $file out there, $say."
1538 echo "Substituting grep for egrep."
1544 echo "Substituting cp for ln."
1550 echo "Hopefully test is built into your sh."
1553 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1554 echo "Using the test built into your sh."
1562 echo "Hopefully echo is built into your sh."
1567 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1568 $echo $n "hi there$c" >foo1
1569 echo $n "hi there$c" >foo2
1570 if cmp foo1 foo2 >/dev/null 2>&1; then
1571 echo "They are compatible. In fact, they may be identical."
1578 They are not compatible! You are probably running ksh on a non-USG system.
1579 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1580 have echo built in and we may have to run some Bourne shell scripts. That
1581 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1584 $echo $n "The star should be here-->$c"
1591 : determine whether symbolic links are supported
1594 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1595 echo "Symbolic links are supported." >&4
1598 echo "Symbolic links are NOT supported." >&4
1603 : see whether [:lower:] and [:upper:] are supported character classes
1607 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1609 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1614 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1617 : set up the translation script tr, must be called with ./tr of course
1621 '[A-Z][a-z]') exec $tr '$up' '$low';;
1622 '[a-z][A-Z]') exec $tr '$low' '$up';;
1629 : Try to determine whether config.sh was made on this system
1630 case "$config_sh" in
1632 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1633 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1634 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1635 newmyuname="$myuname"
1637 case "$knowitall" in
1639 if test -f ../config.sh; then
1640 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1641 eval "`grep myuname= ../config.sh`"
1643 if test "X$myuname" = "X$newmyuname"; then
1651 : Get old answers from old config file if Configure was run on the
1652 : same system, otherwise use the hints.
1655 if test -f config.sh; then
1657 rp="I see a config.sh file. Shall I use it to set the defaults?"
1660 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1661 *) echo "Fetching default answers from your old config.sh file..." >&4
1669 : Older versions did not always set $sh. Catch re-use of such
1678 if test ! -f config.sh; then
1681 First time through, eh? I have some defaults handy for the following systems:
1684 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1686 : Half the following guesses are probably wrong... If you have better
1687 : tests or hints, please send them to chip@perl.com
1688 : The metaconfig authors would also appreciate a copy...
1689 $test -f /irix && osname=irix
1690 $test -f /xenix && osname=sco_xenix
1691 $test -f /dynix && osname=dynix
1692 $test -f /dnix && osname=dnix
1693 $test -f /lynx.os && osname=lynxos
1694 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1695 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
1696 $test -f /bin/mips && /bin/mips && osname=mips
1697 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1698 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1699 $test -d /usr/apollo/bin && osname=apollo
1700 $test -f /etc/saf/_sactab && osname=svr4
1701 $test -d /usr/include/minix && osname=minix
1702 if $test -d /MachTen; then
1704 if $test -x /sbin/version; then
1705 osvers=`/sbin/version | $awk '{print $2}' |
1706 $sed -e 's/[A-Za-z]$//'`
1707 elif $test -x /usr/etc/version; then
1708 osvers=`/usr/etc/version | $awk '{print $2}' |
1709 $sed -e 's/[A-Za-z]$//'`
1714 if $test -f $uname; then
1722 umips) osname=umips ;;
1725 [23]100) osname=mips ;;
1726 next*) osname=next ;;
1728 if $test -f /etc/kconfig; then
1730 if test "$lns" = "ln -s"; then
1732 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1734 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1743 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1745 'not found') osvers="$4"."$3" ;;
1746 '<3240'|'<>3240') osvers=3.2.0 ;;
1747 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1748 '=3250'|'>3250') osvers=3.2.5 ;;
1752 *dc.osx) osname=dcosx
1758 domainos) osname=apollo
1764 dynixptx*) osname=dynixptx
1767 freebsd) osname=freebsd
1769 genix) osname=genix ;;
1774 *.10.*) osvers=10 ;;
1790 netbsd*) osname=netbsd
1793 news-os) osvers="$3"
1795 4*) osname=newsos4 ;;
1799 bsd386) osname=bsd386
1802 powerux | power_ux | powermax_os | powermaxos | \
1803 powerunix | power_unix) osname=powerux
1806 next*) osname=next ;;
1807 solaris) osname=solaris
1809 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1816 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1820 titanos) osname=titanos
1829 ultrix) osname=ultrix
1832 osf1|mls+) case "$5" in
1835 osvers=`echo "$3" | sed 's/^[xvt]//'`
1837 hp*) osname=hp_osf1 ;;
1838 mips) osname=mips_osf1 ;;
1847 $2) case "$osname" in
1851 : svr4.x or possibly later
1861 if test -f /stand/boot ; then
1862 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
1863 if test -n "$INITPROG" -a -f "$INITPROG"; then
1864 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1865 if test -n "$isesix"; then
1873 *) if test -f /etc/systemid; then
1875 set `echo $3 | $sed 's/\./ /g'` $4
1876 if $test -f sco_$1_$2_$3.sh; then
1878 elif $test -f sco_$1_$2.sh; then
1880 elif $test -f sco_$1.sh; then
1885 '') : Still unknown. Probably a generic Sys V.
1894 *) case "$osname" in
1895 '') : Still unknown. Probably a generic BSD.
1903 if test -f /vmunix -a -f newsos4.sh; then
1904 (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
1905 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
1908 $rm -f ../UU/kernel.what
1909 elif test -d c:/.; then
1913 if test -n "$DJDIR"; then
1920 : Now look for a hint file osname_osvers, unless one has been
1921 : specified already.
1924 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
1925 : Also try without trailing minor version numbers.
1926 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1927 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1928 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1929 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
1932 *) case "$osvers" in
1935 *) if $test -f $file.sh ; then
1937 elif $test -f $xfile.sh ; then
1939 elif $test -f $xxfile.sh ; then
1941 elif $test -f $xxxfile.sh ; then
1943 elif $test -f $xxxxfile.sh ; then
1945 elif $test -f "${osname}.sh" ; then
1956 dflt=`echo $hintfile | $sed 's/\.sh$//'`
1962 You may give one or more space-separated answers, or "none" if appropriate.
1963 If your OS version has no hints, DO NOT give a wrong version -- say "none".
1966 rp="Which of these apply, if any?"
1969 for file in $tans; do
1970 if $test -f $file.sh; then
1972 $cat $file.sh >> ../UU/config.sh
1973 elif $test X$tans = X -o X$tans = Xnone ; then
1976 : Give one chance to correct a possible typo.
1977 echo "$file.sh does not exist"
1979 rp="hint to use instead?"
1981 for file in $ans; do
1982 if $test -f "$file.sh"; then
1984 $cat $file.sh >> ../UU/config.sh
1985 elif $test X$ans = X -o X$ans = Xnone ; then
1988 echo "$file.sh does not exist -- ignored."
1995 : Remember our hint file for later.
1996 if $test -f "$file.sh" ; then
2008 echo "Fetching default answers from $config_sh..." >&4
2012 cp $config_sh config.sh 2>/dev/null
2022 test "$override" && . ./optdef.sh
2023 myuname="$newmyuname"
2025 : Restore computed paths
2026 for file in $loclist $trylist; do
2027 eval $file="\$_$file"
2032 Configure uses the operating system name and version to set some defaults.
2033 The default value is probably right if the name rings a bell. Otherwise,
2034 since spelling matters for me, either accept the default or answer "none"
2041 ''|' '|none) dflt=none ;;
2042 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2045 *) dflt="$osname" ;;
2047 rp="Operating system name?"
2051 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2057 ''|' '|none) dflt=none ;;
2058 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2059 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2061 ''|' ') dflt=none ;;
2066 *) dflt="$osvers" ;;
2068 rp="Operating system version?"
2077 : who configured the system
2078 cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
2079 cf_by=`(logname) 2>/dev/null`
2080 case "$cf_by" in "")
2081 cf_by=`(whoami) 2>/dev/null`
2082 case "$cf_by" in "")
2087 : determine the architecture name
2089 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2090 tarch=`arch`"-$osname"
2091 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2092 if uname -m > tmparch 2>&1 ; then
2093 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2094 -e 's/$/'"-$osname/" tmparch`
2102 case "$myarchname" in
2105 echo "(Your architecture name used to be $myarchname.)"
2111 *) dflt="$archname";;
2113 rp='What is your architecture name'
2115 case "$usethreads" in
2116 $define) echo "Threads selected." >&4
2118 *-thread) echo "...and architecture name already ends in -thread." >&4
2121 *) archname="$ans-thread"
2122 echo "...setting architecture name to $archname." >&4
2126 *) archname="$ans" ;;
2133 $define|true) afs=true ;;
2134 $undef|false) afs=false ;;
2135 *) if test -d /afs; then
2143 echo "AFS may be running... I'll be extra cautious then..." >&4
2145 echo "AFS does not seem to be running..." >&4
2148 : decide how portable to be. Allow command line overrides.
2149 case "$d_portable" in
2151 *) d_portable="$define" ;;
2154 : set up shell script to do ~ expansion
2160 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2163 if $test -f /bin/csh; then
2164 /bin/csh -f -c "glob \$1"
2169 name=\`$expr x\$1 : '..\([^/]*\)'\`
2170 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2171 if $test ! -d "\$dir"; then
2173 echo "\$me: can't locate home directory for: \$name" >&2
2178 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2194 : now set up to get a file name
2198 cat <<'EOSC' >>getfile
2211 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2212 fn=`echo $fn | sed 's/(.*)//'`
2218 loc_file=`expr $fn : '.*:\(.*\)'`
2219 fn=`expr $fn : '\(.*\):.*'`
2227 */*) fullpath=true;;
2236 *e*) exp_file=true;;
2239 *p*) nopath_ok=true;;
2244 *d*) type='Directory';;
2245 *l*) type='Locate';;
2250 Locate) what='File';;
2255 case "$d_portable" in
2263 while test "$type"; do
2268 true) rp="$rp (~name ok)";;
2271 if test -f UU/getfile.ok && \
2272 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2291 value=`UU/filexp $ans`
2294 if test "$ans" != "$value"; then
2295 echo "(That expands to $value on this system.)"
2309 /*) value="$ansexp" ;;
2314 echo "I shall only accept a full path name, as in /bin/ls." >&4
2315 echo "Use a ! shell escape if you wish to check pathnames." >&4
2318 echo "Please give a full path name, starting with slash." >&4
2321 echo "Note that using ~name is ok provided it expands well." >&4
2334 if test -f "$ansexp"; then
2336 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2338 echo "($value is not a plain file, but that's ok.)"
2343 if test -d "$ansexp"; then
2348 if test -d "$ansexp"; then
2349 echo "(Looking for $loc_file in directory $value.)"
2350 value="$value/$loc_file"
2351 ansexp="$ansexp/$loc_file"
2353 if test -f "$ansexp"; then
2356 case "$nopath_ok" in
2357 true) case "$value" in
2359 *) echo "Assuming $value will be in people's path."
2375 if test "$fastread" = yes; then
2380 rp="$what $value doesn't exist. Use that name anyway?"
2401 : determine root of directory hierarchy where package will be installed.
2404 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2412 By default, $package will be installed in $dflt/bin, manual
2413 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2414 all installation directories. Typically set to /usr/local, but you
2415 may choose /usr if you wish to install $package among your system
2416 binaries. If you wish to have binaries under /bin but manual pages
2417 under /usr/local/man, that's ok: you will be prompted separately
2418 for each of the installation directories, the prefix being only used
2419 to set the defaults.
2423 rp='Installation prefix to use?'
2431 *) oldprefix="$prefix";;
2438 : set the prefixit variable, to compute a suitable default value
2439 prefixit='case "$3" in
2441 case "$oldprefix" in
2442 "") eval "$1=\"\$$2\"";;
2449 ""|" ") eval "$1=\"\$$2\"";;
2455 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2457 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2458 /*-$oldprefix/*|\~*-$oldprefix/*)
2459 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2460 *) eval "$1=\"\$$2\"";;
2464 : determine where private library files go
2465 : Usual default is /usr/local/lib/perl5. Also allow things like
2466 : /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
2468 *perl*) set dflt privlib lib ;;
2469 *) set dflt privlib lib/$package ;;
2474 There are some auxiliary files for $package that need to be put into a
2475 private library directory that is accessible by everyone.
2479 rp='Pathname where the private library files will reside?'
2481 if $test "X$privlibexp" != "X$ansexp"; then
2485 privlibexp="$ansexp"
2489 Since you are running AFS, I need to distinguish the directory in which
2490 private files reside from the directory in which they are installed (and from
2491 which they are presumably copied to the former directory by occult means).
2494 case "$installprivlib" in
2495 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2496 *) dflt="$installprivlib";;
2499 rp='Where will private files be installed?'
2501 installprivlib="$ans"
2503 installprivlib="$privlibexp"
2506 : set the base revision
2509 : get the patchlevel
2511 echo "Getting the current patchlevel..." >&4
2512 if $test -r ../patchlevel.h;then
2513 patchlevel=`awk '/PATCHLEVEL/ {print $3}' ../patchlevel.h`
2514 subversion=`awk '/SUBVERSION/ {print $3}' ../patchlevel.h`
2519 $echo $n "(You have $package" $c
2522 *) $echo $n " $baserev" $c ;;
2524 $echo $n " patchlevel $patchlevel" $c
2525 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
2528 : set the prefixup variable, to restore leading tilda escape
2529 prefixup='case "$prefixexp" in
2531 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2534 : determine where public architecture dependent libraries go
2540 '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
2544 *) if test 0 -eq "$subversion"; then
2545 version=`LC_ALL=C; export LC_ALL; \
2546 echo $baserev $patchlevel | \
2547 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2549 version=`LC_ALL=C; export LC_ALL; \
2550 echo $baserev $patchlevel $subversion | \
2551 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
2553 dflt="$privlib/$archname/$version"
2563 $spackage contains architecture-dependent library files. If you are
2564 sharing libraries in a heterogeneous environment, you might store
2565 these files in a separate location. Otherwise, you can just include
2566 them with the rest of the public library files.
2570 rp='Where do you want to put the public architecture-dependent libraries?'
2573 archlibexp="$ansexp"
2578 Since you are running AFS, I need to distinguish the directory in
2579 which architecture-dependent library files reside from the directory
2580 in which they are installed (and from which they are presumably copied
2581 to the former directory by occult means).
2584 case "$installarchlib" in
2585 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2586 *) dflt="$installarchlib";;
2589 rp='Where will architecture-dependent library files be installed?'
2591 installarchlib="$ans"
2593 installarchlib="$archlibexp"
2595 if $test X"$archlib" = X"$privlib"; then
2601 : set up the script used to warn in case of inconsistency
2608 echo "*** WHOA THERE!!! ***" >&4
2609 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2610 rp=" Keep the $hint value?"
2613 y) td=$was; tu=$was;;
2617 : function used to set $1 to $val
2618 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2620 $define$undef) . ./whoa; eval "$var=\$td";;
2621 $undef$define) . ./whoa; eval "$var=\$tu";;
2622 *) eval "$var=$val";;
2625 : bincompat3 is no more even possible starting with 5.005
2628 : make some quick guesses about what we are up against
2630 $echo $n "Hmm... $c"
2640 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2641 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2643 echo "Looks kind of like an OSF/1 system, but we'll see..."
2645 elif test `echo abc | tr a-z A-Z` = Abc ; then
2646 xxx=`./loc addbib blurfl $pth`
2647 if $test -f $xxx; then
2648 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2652 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2653 echo "Looks kind of like an extended USG system, but we'll see..."
2655 echo "Looks kind of like a USG system, but we'll see..."
2659 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2660 echo "Looks kind of like a BSD system, but we'll see..."
2664 echo "Looks kind of like a Version 7 system, but we'll see..."
2667 case "$eunicefix" in
2670 There is, however, a strange, musty smell in the air that reminds me of
2671 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2675 : it so happens the Eunice I know will not run shell scripts in Unix format
2679 echo "Congratulations. You aren't running Eunice."
2683 : Detect OS2. The p_ variable is set above in the Head.U unit.
2688 I have the feeling something is not exactly right, however...don't tell me...
2689 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2694 if test -f /xenix; then
2695 echo "Actually, this looks more like a XENIX system..."
2700 echo "It's not Xenix..."
2705 if test -f /venix; then
2706 echo "Actually, this looks more like a VENIX system..."
2713 echo "Nor is it Venix..."
2716 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2717 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2720 : see if setuid scripts can be secure
2723 Some kernels have a bug that prevents setuid #! scripts from being
2724 secure. Some sites have disabled setuid #! scripts because of this.
2726 First let's decide if your kernel supports secure setuid #! scripts.
2727 (If setuid #! scripts would be secure but have been disabled anyway,
2728 don't say that they are secure if asked.)
2733 if $test -d /dev/fd; then
2734 echo "#!$ls" >reflect
2735 chmod +x,u+s reflect
2736 ./reflect >flect 2>&1
2737 if $contains "/dev/fd" flect >/dev/null; then
2738 echo "Congratulations, your kernel has secure setuid scripts!" >&4
2742 If you are not sure if they are secure, I can check but I'll need a
2743 username and password different from the one you are using right now.
2744 If you don't have such a username or don't want me to test, simply
2748 rp='Other username to test security of setuid scripts with?'
2753 case "$d_suidsafe" in
2754 '') echo "I'll assume setuid scripts are *not* secure." >&4
2757 echo "Well, the $hint value is *not* secure." >&4
2759 *) echo "Well, the $hint value *is* secure." >&4
2764 $rm -f reflect flect
2765 echo "#!$ls" >reflect
2766 chmod +x,u+s reflect
2769 echo '"su" will (probably) prompt you for '"$ans's password."
2770 su $ans -c './reflect >flect'
2771 if $contains "/dev/fd" flect >/dev/null; then
2772 echo "Okay, it looks like setuid scripts are secure." >&4
2775 echo "I don't think setuid scripts are secure." >&4
2780 rp='Does your kernel have *secure* setuid scripts?'
2783 [yY]*) val="$define";;
2788 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
2789 echo "(That's for file descriptors, not floppy disks.)"
2795 $rm -f reflect flect
2797 : now see if they want to do setuid emulation
2800 case "$d_suidsafe" in
2803 echo "No need to emulate SUID scripts since they are secure here." >& 4
2807 Some systems have disabled setuid scripts, especially systems where
2808 setuid scripts cannot be secure. On systems where setuid scripts have
2809 been disabled, the setuid/setgid bits on scripts are currently
2810 useless. It is possible for $package to detect those bits and emulate
2811 setuid/setgid in a secure fashion. This emulation will only work if
2812 setuid scripts have been disabled in your kernel.
2816 "$define") dflt=y ;;
2819 rp="Do you want to do setuid/setgid emulation?"
2822 [yY]*) val="$define";;
2830 : determine where site specific libraries go.
2834 '') dflt="$privlib/site_perl" ;;
2835 *) dflt="$sitelib" ;;
2839 The installation process will also create a directory for
2840 site-specific extensions and modules. Some users find it convenient
2841 to place all local files in this directory rather than in the main
2842 distribution directory.
2846 rp='Pathname for the site-specific library files?'
2848 if $test "X$sitelibexp" != "X$ansexp"; then
2852 sitelibexp="$ansexp"
2856 Since you are running AFS, I need to distinguish the directory in
2857 which site-specific files reside from the directory in which they are
2858 installed (and from which they are presumably copied to the former
2859 directory by occult means).
2862 case "$installsitelib" in
2863 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
2864 *) dflt="$installsitelib";;
2867 rp='Where will site-specific files be installed?'
2869 installsitelib="$ans"
2871 installsitelib="$sitelibexp"
2874 : determine where site specific architecture-dependent libraries go.
2875 xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'`
2876 : xxx is usuually lib/site_perl/archname.
2877 set sitearch sitearch none
2880 '') dflt="$sitelib/$archname" ;;
2881 *) dflt="$sitearch" ;;
2885 The installation process will also create a directory for
2886 architecture-dependent site-specific extensions and modules.
2890 rp='Pathname for the site-specific architecture-dependent library files?'
2892 if $test "X$sitearchexp" != "X$ansexp"; then
2896 sitearchexp="$ansexp"
2900 Since you are running AFS, I need to distinguish the directory in
2901 which site-specific architecture-dependent library files reside from
2902 the directory in which they are installed (and from which they are
2903 presumably copied to the former directory by occult means).
2906 case "$installsitearch" in
2907 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
2908 *) dflt="$installsitearch";;
2911 rp='Where will site-specific architecture-dependent files be installed?'
2913 installsitearch="$ans"
2915 installsitearch="$sitearchexp"
2918 : determine where old public architecture dependent libraries might be
2919 case "$oldarchlib" in
2920 '') case "$privlib" in
2922 *) dflt="$privlib/$archname"
2926 *) dflt="$oldarchlib"
2929 if $test ! -d "$dflt/auto"; then
2934 In 5.001, Perl stored architecture-dependent library files in a directory
2935 with a name such as $privlib/$archname,
2936 and this directory contained files from the standard extensions and
2937 files from any additional extensions you might have added. Starting
2938 with version 5.002, all the architecture-dependent standard extensions
2939 will go into a version-specific directory such as
2941 while locally-added extensions will go into
2944 If you wish Perl to continue to search the old architecture-dependent
2945 library for your local extensions, give the path to that directory.
2946 If you do not wish to use your old architecture-dependent library
2947 files, answer 'none'.
2951 rp='Directory for your old 5.001 architecture-dependent libraries?'
2954 oldarchlibexp="$ansexp"
2955 case "$oldarchlib" in
2956 ''|' ') val="$undef" ;;
2962 : determine where public executables go
2967 rp='Pathname where the public executables will reside?'
2969 if $test "X$ansexp" != "X$binexp"; then
2977 Since you are running AFS, I need to distinguish the directory in which
2978 executables reside from the directory in which they are installed (and from
2979 which they are presumably copied to the former directory by occult means).
2982 case "$installbin" in
2983 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
2984 *) dflt="$installbin";;
2987 rp='Where will public executables be installed?'
2991 installbin="$binexp"
2994 : determine where manual pages are on this system
2998 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2999 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3000 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3001 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3002 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3003 sysman=`./loc . /usr/man/man1 $syspath`
3006 if $test -d "$sysman"; then
3007 echo "System manual is in $sysman." >&4
3009 echo "Could not find manual pages in source form." >&4
3012 : see what memory models we can support
3015 $cat >pdp11.c <<'EOP'
3024 (cc -o pdp11 pdp11.c) >/dev/null 2>&1
3025 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3026 dflt='unsplit split'
3028 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3031 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3036 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3039 if $test -d /lib/large || $test -d /usr/lib/large; then
3042 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3051 Some systems have different model sizes. On most systems they are called
3052 small, medium, large, and huge. On the PDP11 they are called unsplit and
3053 split. If your system doesn't support different memory models, say "none".
3054 If you wish to force everything to one memory model, say "none" here and
3055 put the appropriate flags later when it asks you for other cc and ld flags.
3056 Venix systems may wish to put "none" and let the compiler figure things out.
3057 (In the following question multiple model names should be space separated.)
3060 rp="Which memory models are supported?"
3075 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3076 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3083 rp="What flag indicates separate I and D space?"
3091 *large*|*small*|*medium*|*huge*)
3098 rp="What flag indicates large model?"
3108 *huge*) case "$huge" in
3112 rp="What flag indicates huge model?"
3122 *medium*) case "$medium" in
3126 rp="What flag indicates medium model?"
3133 *) medium="$large";;
3136 *small*) case "$small" in
3140 rp="What flag indicates small model?"
3151 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3155 : see if we need a special compiler
3163 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3164 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3177 On some systems the default C compiler will not resolve multiple global
3178 references that happen to have the same name. On some such systems the "Mcc"
3179 command may be used to force these to be resolved. On other systems a "cc -M"
3180 command is required. (Note that the -M flag on other systems indicates a
3181 memory model to use!) If you have the Gnu C compiler, you might wish to use
3185 rp="What command will force resolution on this system?"
3193 rp="Use which C compiler?"
3198 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3199 $cat >gccvers.c <<EOM
3204 printf("%s\n", __VERSION__);
3206 printf("%s\n", "1");
3212 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3213 gccversion=`./gccvers`
3214 case "$gccversion" in
3215 '') echo "You are not using GNU cc." ;;
3216 *) echo "You are using GNU cc $gccversion." ;;
3220 echo "*** WHOA THERE!!! ***" >&4
3221 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3222 case "$knowitall" in
3224 echo " You'd better start hunting for one and let me know about it." >&4
3230 case "$gccversion" in
3231 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3234 : What should the include directory be ?
3236 $echo $n "Hmm... $c"
3240 if $test -f /bin/mips && /bin/mips; then
3241 echo "Looks like a MIPS system..."
3242 $cat >usr.c <<'EOCP'
3243 #ifdef SYSTYPE_BSD43
3247 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3248 dflt='/bsd43/usr/include'
3252 mips_type='System V'
3254 $rm -f usr.c usr.out
3255 echo "and you're compiling with the $mips_type compiler and libraries."
3259 echo "Doesn't look like a MIPS system."
3270 case "$xxx_prompt" in
3272 rp='Where are the include files you want to use?'
3280 : Set private lib path
3283 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3288 '') dlist="$loclibpth $plibpth $glibpth";;
3289 *) dlist="$libpth";;
3292 : Now check and see which directories actually exist, avoiding duplicates
3296 if $test -d $xxx; then
3299 *) libpth="$libpth $xxx";;
3305 Some systems have incompatible or broken versions of libraries. Among
3306 the directories listed in the question below, please remove any you
3307 know not to be holding relevant libraries, and add any that are needed.
3308 Say "none" for none.
3319 rp="Directories to use for library searches?"
3326 : Define several unixisms. Hints files or command line options
3327 : can be used to override them.
3340 : Which makefile gets called first. This is used by make depend.
3341 case "$firstmakefile" in
3342 '') firstmakefile='makefile';;
3345 : compute shared library extension
3348 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3358 On some systems, shared libraries may be available. Answer 'none' if
3359 you want to suppress searching of shared libraries for the remaining
3360 of this configuration.
3363 rp='What is the file extension used for shared libraries?'
3367 : Looking for optional libraries
3369 echo "Checking for optional libraries..." >&4
3374 case "$libswanted" in
3375 '') libswanted='c_s';;
3377 for thislib in $libswanted; do
3379 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
3380 echo "Found -l$thislib (shared)."
3383 *) dflt="$dflt -l$thislib";;
3385 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3386 echo "Found -l$thislib (shared)."
3389 *) dflt="$dflt -l$thislib";;
3391 elif xxx=`./loc lib$thislib$lib_ext X $libpth`; $test -f "$xxx"; then
3392 echo "Found -l$thislib."
3395 *) dflt="$dflt -l$thislib";;
3397 elif xxx=`./loc $thislib$lib_ext X $libpth`; $test -f "$xxx"; then
3398 echo "Found -l$thislib."
3401 *) dflt="$dflt -l$thislib";;
3403 elif xxx=`./loc lib${thislib}_s$lib_ext X $libpth`; $test -f "$xxx"; then
3404 echo "Found -l${thislib}_s."
3407 *) dflt="$dflt -l${thislib}_s";;
3409 elif xxx=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$xxx"; then
3410 echo "Found -l$thislib."
3413 *) dflt="$dflt -l$thislib";;
3416 echo "No -l$thislib."
3427 ' '|'') dflt='none';;
3432 Some versions of Unix support shared libraries, which make executables smaller
3433 but make load time slightly longer.
3435 On some systems, mostly System V Release 3's, the shared library is included
3436 by putting the option "-lc_s" as the last thing on the cc command line when
3437 linking. Other systems use shared libraries by default. There may be other
3438 libraries needed to compile $package on your machine as well. If your system
3439 needs the "-lc_s" option, include it here. Include any other special libraries
3440 here as well. Say "none" for none.
3444 rp="Any additional libraries?"
3451 : see how we invoke the C preprocessor
3453 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3454 cat <<'EOT' >testcpp.c
3460 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3462 wrapper=`pwd`/cppstdin
3466 if $test "X$cppstdin" != "X" && \
3467 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3468 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3470 echo "You used to use $cppstdin $cppminus so we'll use that again."
3472 '') echo "But let's see if we can live without a wrapper..." ;;
3474 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3475 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3477 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3480 echo "(However, $cpprun $cpplast does not work, let's see...)"
3488 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3495 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3496 $cc -E <testcpp.c >testcpp.out 2>&1; \
3497 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3498 echo "Yup, it does."
3501 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3502 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3503 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3504 echo "Yup, it does."
3507 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3508 $cc -P <testcpp.c >testcpp.out 2>&1; \
3509 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3510 echo "Yipee, that works!"
3513 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3514 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3515 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3516 echo "At long last!"
3519 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3520 $cpp <testcpp.c >testcpp.out 2>&1; \
3521 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3525 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3526 $cpp - <testcpp.c >testcpp.out 2>&1; \
3527 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3528 echo "Hooray, it works! I was beginning to wonder."
3531 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3532 $wrapper <testcpp.c >testcpp.out 2>&1; \
3533 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3539 rp="No dice. I can't find a C preprocessor. Name one:"
3543 $x_cpp <testcpp.c >testcpp.out 2>&1
3544 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3545 echo "OK, that will do." >&4
3547 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3562 echo "Perhaps can we force $cc -E using a wrapper..."
3563 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3564 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3570 echo "Nope, we'll have to live without it..."
3585 *) $rm -f $wrapper;;
3587 $rm -f testcpp.c testcpp.out
3589 : determine optimize, if desired, or use for debug flag also
3591 ' '|$undef) dflt='none';;
3593 *) dflt="$optimize";;
3597 Some C compilers have problems with their optimizers. By default, $package
3598 compiles with the -O flag to use the optimizer. Alternately, you might want
3599 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3600 systems). Either flag can be specified here. To use neither flag, specify
3604 rp="What optimizer/debugger flag should be used?"
3608 'none') optimize=" ";;
3612 : We will not override a previous value, but we might want to
3613 : augment a hint file
3616 case "$gccversion" in
3617 1*) dflt='-fpcc-struct-return' ;;
3620 *-g*) dflt="$dflt -DDEBUGGING";;
3622 case "$gccversion" in
3623 2*) if test -d /etc/conf/kconfig.d &&
3624 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3633 case "$mips_type" in
3634 *BSD*|'') inclwanted="$locincpth $usrinc";;
3635 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3637 for thisincl in $inclwanted; do
3638 if $test -d $thisincl; then
3639 if $test x$thisincl != x$usrinc; then
3642 *) dflt="$dflt -I$thisincl";;
3648 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3650 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3658 *) dflt="$dflt -D$2";;
3663 set signal.h __LANGUAGE_C__; eval $inctest
3665 set signal.h LANGUAGE_C; eval $inctest
3669 none|recommended) dflt="$ccflags $dflt" ;;
3670 *) dflt="$ccflags";;
3678 Your C compiler may want other flags. For this question you should include
3679 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3680 but you should NOT include libraries or ld flags like -lwhatever. If you
3681 want $package to honor its debug switch, you should include -DDEBUGGING here.
3682 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
3683 -DHIDEMYMALLOC or -DCRIPPLED_CC.
3685 To use no flags, specify the word "none".
3691 rp="Any additional cc flags?"
3698 : the following weeds options from ccflags that are of no interest to cpp
3700 case "$gccversion" in
3701 1*) cppflags="$cppflags -D__GNUC__"
3703 case "$mips_type" in
3705 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3711 echo "Let me guess what the preprocessor flags are..." >&4
3725 *) ftry="$previous $flag";;
3727 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3728 >cpp1.out 2>/dev/null && \
3729 $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
3730 >cpp2.out 2>/dev/null && \
3731 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3732 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3734 cppflags="$cppflags $ftry"
3744 *-*) echo "They appear to be: $cppflags";;
3746 $rm -f cpp.c cpp?.out
3750 : flags used in final linking phase
3753 '') if ./venix; then
3759 *-posix*) dflt="$dflt -posix" ;;
3762 *) dflt="$ldflags";;
3765 : Try to guess additional flags to pick up local libraries.
3766 for thislibdir in $libpth; do
3767 case " $loclibpth " in
3770 *"-L$thislibdir "*) ;;
3771 *) dflt="$dflt -L$thislibdir" ;;
3783 Your C linker may need flags. For this question you should
3784 include -L/whatever and any other flags used by the C linker, but you
3785 should NOT include libraries like -lwhatever.
3787 Make sure you include the appropriate -L/path flags if your C linker
3788 does not normally search all of the directories you specified above,
3791 To use no flags, specify the word "none".
3795 rp="Any additional ld flags (NOT including libraries)?"
3801 rmlist="$rmlist pdp11"
3805 echo "Checking your choice of C compiler, libs, and flags for coherency..." >&4
3806 set X $cc $optimize $ccflags $ldflags -o try try.c $libs
3809 I've tried to compile and run a simple program with:
3814 and I got the following output:
3817 $cat > try.c <<'EOF'
3822 if sh -c "$cc $optimize $ccflags -o try try.c $ldflags $libs" >>try.msg 2>&1; then
3823 if sh -c './try' >>try.msg 2>&1; then
3826 echo "The program compiled OK, but exited with status $?." >>try.msg
3827 rp="You have a problem. Shall I abort Configure (and explain the problem)"
3831 echo "I can't compile the test program." >>try.msg
3832 rp="You have a BIG problem. Shall I abort Configure (and explain the problem)"
3838 case "$knowitall" in
3840 echo "(The supplied flags might be incorrect with this C compiler.)"
3848 *) echo "Ok. Stopping Configure." >&4
3853 n) echo "OK, that should do.";;
3855 $rm -f try try.* core
3858 echo "Checking for GNU C Library..." >&4
3859 cat >gnulibc.c <<EOM
3863 return __libc_main();
3866 if $cc $ccflags $ldflags -o gnulibc gnulibc.c $libs >/dev/null 2>&1 && \
3867 ./gnulibc | $contains '^GNU C Library' >/dev/null 2>&1; then
3869 echo "You are using the GNU C Library"
3872 echo "You are not using the GNU C Library"
3878 : see if nm is to be used to determine whether a symbol is defined or not
3881 case "$d_gnulibc" in
3886 dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null`
3887 if $test $dflt -gt 20; then
3904 I can use 'nm' to extract the symbols from your C libraries. This is a time
3905 consuming task which may generate huge output on the disk (up to 3 megabytes)
3906 but that should make the symbols extraction faster. The alternative is to skip
3907 the 'nm' extraction part and to compile a small test program instead to
3908 determine whether each symbol is present. If you have a fast C compiler and/or
3909 if your 'nm' output cannot be parsed, this may be the best solution.
3910 You shouldn't let me use 'nm' if you have the GNU C Library.
3913 rp='Shall I use nm to extract C symbols from the libraries?'
3925 : nm options which may be necessary
3927 '') if $test -f /mach_boot; then
3929 elif $test -d /usr/ccs/lib; then
3930 nm_opt='-p' # Solaris (and SunOS?)
3931 elif $test -f /dgux; then
3933 elif $test -f /lib64/rld; then
3934 nm_opt='-p' # 64-bit Irix
3940 : nm options which may be necessary for shared libraries but illegal
3941 : for archive libraries. Thank you, Linux.
3942 case "$nm_so_opt" in
3943 '') case "$myuname" in
3945 if nm --help | $grep 'dynamic' > /dev/null 2>&1; then
3946 nm_so_opt='--dynamic'
3955 : get list of predefined functions in a handy place
3960 *-lc_s*) libc=`./loc libc_s$lib_ext $libc $libpth`
3967 *) for thislib in $libs; do
3970 : Handle C library specially below.
3973 thislib=`echo $thislib | $sed -e 's/^-l//'`
3974 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
3976 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
3978 elif try=`./loc lib$thislib$lib_ext X $libpth`; $test -f "$try"; then
3980 elif try=`./loc $thislib$lib_ext X $libpth`; $test -f "$try"; then
3982 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
3984 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
3986 elif try=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$try"; then
3991 libnames="$libnames $try"
3993 *) libnames="$libnames $thislib" ;;
4002 for xxx in $libpth; do
4003 $test -r $1 || set $xxx/libc.$so
4004 : The messy sed command sorts on library version numbers.
4006 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4007 tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
4009 s/[0-9][0-9]*/0000&/g
4010 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4013 sort | $sed -e 's/^.* //'`
4016 $test -r $1 || set /usr/ccs/lib/libc.$so
4017 $test -r $1 || set /lib/libsys_s$lib_ext
4023 if $test -r "$1"; then
4024 echo "Your (shared) C library seems to be in $1."
4026 elif $test -r /lib/libc && $test -r /lib/clib; then
4027 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4029 libc='/lib/clib /lib/libc'
4030 if $test -r /lib/syslib; then
4031 echo "(Your math library is in /lib/syslib.)"
4032 libc="$libc /lib/syslib"
4034 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4035 echo "Your C library seems to be in $libc, as you said before."
4036 elif $test -r $incpath/usr/lib/libc$lib_ext; then
4037 libc=$incpath/usr/lib/libc$lib_ext;
4038 echo "Your C library seems to be in $libc. That's fine."
4039 elif $test -r /lib/libc$lib_ext; then
4040 libc=/lib/libc$lib_ext;
4041 echo "Your C library seems to be in $libc. You're normal."
4043 if tans=`./loc libc$lib_ext blurfl/dyick $libpth`; $test -r "$tans"; then
4045 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4046 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4047 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4049 elif tans=`./loc Slibc$lib_ext blurfl/dyick $xlibpth`; $test -r "$tans"; then
4051 elif tans=`./loc Mlibc$lib_ext blurfl/dyick $xlibpth`; $test -r "$tans"; then
4054 tans=`./loc Llibc$lib_ext blurfl/dyick $xlibpth`
4056 if $test -r "$tans"; then
4057 echo "Your C library seems to be in $tans, of all places."
4063 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4067 If the guess above is wrong (which it might be if you're using a strange
4068 compiler, or your machine supports multiple models), you can override it here.
4073 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
4075 I can't seem to find your C library. I've looked in the following places:
4078 $sed 's/^/ /' libpath
4081 None of these seems to contain your C library. I need to get its name...
4086 rp='Where is your C library?'
4091 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
4092 set X `cat libnames`
4095 case $# in 1) xxx=file; esac
4096 echo "Extracting names from the following $xxx for later perusal:" >&4
4098 $sed 's/^/ /' libnames >&4
4100 $echo $n "This may take a while...$c" >&4
4102 : Linux may need the special Dynamic option to nm for shared libraries.
4103 : In general, this is stored in the nm_so_opt variable.
4104 : Unfortunately, that option may be fatal on non-shared libraries.
4105 for nm_libs_ext in $*; do
4106 case $nm_libs_ext in
4107 *$so*) nm $nm_so_opt $nm_opt $nm_libs_ext 2>/dev/null ;;
4108 *) nm $nm_opt $nm_libs_ext 2>/dev/null ;;
4113 $grep fprintf libc.tmp > libc.ptf
4114 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4115 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4117 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4119 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4121 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4123 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4125 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4127 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4129 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4131 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4133 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4135 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4137 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4139 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4141 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4142 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4144 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4146 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4148 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4150 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4152 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4154 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4156 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4158 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4160 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4162 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4164 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4166 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4168 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4171 nm -p $* 2>/dev/null >libc.tmp
4172 $grep fprintf libc.tmp > libc.ptf
4173 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4174 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4180 echo "nm didn't seem to work right. Trying ar instead..." >&4
4182 if ar t $libc > libc.tmp; then
4183 for thisname in $libnames; do
4184 ar t $thisname >>libc.tmp
4186 $sed -e 's/\.o$//' < libc.tmp > libc.list
4189 echo "ar didn't seem to work right." >&4
4190 echo "Maybe this is a Cray...trying bld instead..." >&4
4191 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list
4193 for thisname in $libnames; do
4195 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
4196 ar t $thisname >>libc.tmp
4200 echo "That didn't work either. Giving up." >&4
4207 if $test -f /lib/syscalls.exp; then
4209 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4210 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4214 $rm -f libnames libpath
4216 : determine filename position in cpp output
4218 echo "Computing filename position in cpp output for #include directives..." >&4
4219 echo '#include <stdio.h>' > foo.c
4222 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4223 $grep '^[ ]*#.*stdio\.h' | \
4224 while read cline; do
4227 while $test \$# -gt 0; do
4228 if $test -r \`echo \$1 | $tr -d '"'\`; then
4233 pos=\`expr \$pos + 1\`
4245 *) pos="${fieldn}th";;
4247 echo "Your cpp writes the filename in the $pos field of the line."
4249 : locate header file
4254 if test -f $usrinc/\$wanted; then
4255 echo "$usrinc/\$wanted"
4258 awkprg='{ print \$$fieldn }'
4259 echo "#include <\$wanted>" > foo\$\$.c
4260 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4261 $grep "^[ ]*#.*\$wanted" | \
4262 while read cline; do
4263 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4265 */\$wanted) echo "\$name"; exit 0;;
4276 : define an alternate in-header-list? function
4277 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4278 cont=true; xxf="echo \"<\$1> found.\" >&4";
4279 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4280 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4282 case $# in 4) instead=instead;; *) instead="at last";; esac;
4283 while $test "$cont"; do
4285 var=$2; eval "was=\$$2";
4286 if $test "$xxx" && $test -r "$xxx";
4288 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4291 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4292 set $yyy; shift; shift; yyy=$@;
4293 case $# in 0) cont="";;
4294 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4295 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4296 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4297 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4301 do set $yyy; var=$2; eval "was=\$$2";
4302 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4303 set $yyy; shift; shift; yyy=$@;
4306 : see if dld is available
4310 : is a C symbol defined?
4313 -v) tf=libc.tmp; tc=""; tdc="";;
4314 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4315 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4318 case "$reuseval-$4" in
4320 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4326 if $contains $tlook $tf >/dev/null 2>&1;
4331 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4332 if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4340 $define) tval=true;;
4346 : define an is-in-libc? function
4347 inlibc='echo " "; td=$define; tu=$undef;
4348 sym=$1; var=$2; eval "was=\$$2";
4350 case "$reuseval$was" in
4360 echo "$sym() found." >&4;
4361 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4363 echo "$sym() NOT found." >&4;
4364 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4368 $define) echo "$sym() found." >&4;;
4369 *) echo "$sym() NOT found." >&4;;
4373 : see if dlopen exists
4380 : determine which dynamic loading, if any, to compile in
4382 dldir="ext/DynaLoader"
4395 $define) dflt='y' ;;
4398 $define) dflt='y' ;;
4400 : Does a dl_xxx.xs file exist for this operating system
4401 $test -f ../$dldir/dl_${osname}.xs && dflt='y'
4404 rp="Do you wish to use dynamic loading?"
4411 if $test -f ../$dldir/dl_${osname}.xs ; then
4412 dflt="$dldir/dl_${osname}.xs"
4413 elif $test "$d_dlopen" = "$define" ; then
4414 dflt="$dldir/dl_dlopen.xs"
4415 elif $test "$i_dld" = "$define" ; then
4416 dflt="$dldir/dl_dld.xs"
4421 *) dflt="$dldir/$dlsrc"
4424 echo "The following dynamic loading files are available:"
4425 : Can not go over to $dldir because getfile has path hard-coded in.
4426 cd ..; ls -C $dldir/dl*.xs; cd UU
4427 rp="Source file to use for dynamic loading"
4432 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4436 Some systems may require passing special flags to $cc -c to
4437 compile modules that will be used to create a shared library.
4438 To use no flags, say "none".
4441 case "$cccdlflags" in
4442 '') case "$gccversion" in
4443 '') case "$osname" in
4445 next) dflt='none' ;;
4446 svr4*|esix*) dflt='-Kpic' ;;
4447 irix*) dflt='-KPIC' ;;
4448 solaris) case "$ccflags" in
4449 *-DDEBUGGING*) dflt='-KPIC' ;;
4452 sunos) dflt='-pic' ;;
4455 *) case "$osname/$ccflags" in
4456 solaris/*-DDEBUGGING*) dflt='-fPIC' ;;
4460 *) dflt="$cccdlflags" ;;
4462 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4465 none) cccdlflags=' ' ;;
4466 *) cccdlflags="$ans" ;;
4471 Some systems use ld to create libraries that can be dynamically loaded,
4472 while other systems (such as those using ELF) use $cc.
4476 '') $cat >try.c <<'EOM'
4477 /* Test for whether ELF binaries are produced */
4482 int i = open("a.out",O_RDONLY);
4485 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
4486 exit(0); /* succeed (yes, it's ELF) */
4491 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
4493 You appear to have ELF support. I'll use $cc to build dynamic libraries.
4497 echo "I'll use ld to build dynamic libraries."
4506 rp="What command should be used to create dynamic libraries?"
4512 Some systems may require passing special flags to $ld to create a
4513 library that can be dynamically loaded. If your ld flags include
4514 -L/other/path options to locate libraries outside your loader's normal
4515 search path, you may need to specify those -L options here as well. To
4516 use no flags, say "none".
4519 case "$lddlflags" in
4520 '') case "$osname" in
4522 linux|irix*) dflt='-shared' ;;
4523 next) dflt='none' ;;
4524 solaris) dflt='-G' ;;
4525 sunos) dflt='-assert nodefinitions' ;;
4526 svr4*|esix*) dflt="-G $ldflags" ;;
4530 *) dflt="$lddlflags" ;;
4533 : Try to guess additional flags to pick up local libraries.
4534 for thisflag in $ldflags; do
4539 *) dflt="$dflt $thisflag" ;;
4549 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
4552 none) lddlflags=' ' ;;
4553 *) lddlflags="$ans" ;;
4558 Some systems may require passing special flags to $cc to indicate that
4559 the resulting executable will use dynamic linking. To use no flags,
4563 case "$ccdlflags" in
4564 '') case "$osname" in
4565 hpux) dflt='-Wl,-E' ;;
4566 linux) dflt='-rdynamic' ;;
4567 next) dflt='none' ;;
4568 sunos) dflt='none' ;;
4571 *) dflt="$ccdlflags" ;;
4573 rp="Any special flags to pass to $cc to use dynamic loading?"
4576 none) ccdlflags=' ' ;;
4577 *) ccdlflags="$ans" ;;
4591 # No dynamic loading being used, so don't bother even to prompt.
4594 *) case "$useshrplib" in
4595 '') case "$osname" in
4596 svr4*|dgux|dynixptx|esix|powerux)
4598 also='Building a shared libperl is required for dynamic loading to work on your system.'
4603 also='Building a shared libperl is needed for MAB support.'
4611 also='Building a shared libperl will definitely not work on SunOS 4.'
4625 The perl executable is normally obtained by linking perlmain.c with
4626 libperl${lib_ext}, any static extensions (usually just DynaLoader), and
4627 any other libraries needed on this system (such as -lm, etc.). Since
4628 your system supports dynamic loading, it is probably possible to build
4629 a shared libperl.$so. If you will have more than one executable linked
4630 to libperl.$so, this will significantly reduce the size of each
4631 executable, but it may have a noticeable affect on performance. The
4632 default is probably sensible for your system.
4636 rp="Build a shared libperl.$so (y/n)"
4641 # Why does next4 have to be so different?
4642 case "${osname}${osvers}" in
4643 next4*) xxx='DYLD_LIBRARY_PATH' ;;
4644 *) xxx='LD_LIBRARY_PATH' ;;
4648 To build perl, you must add the current working directory to your
4649 $xxx environtment variable before running make. You can do
4651 $xxx=\`pwd\`; export $xxx
4652 for Bourne-style shells, or
4654 for Csh-style shells. You *MUST* do this before running make.
4658 *) useshrplib='false' ;;
4663 case "$useshrplib" in
4667 # Figure out a good name for libperl.so. Since it gets stored in
4668 # a version-specific architecture-dependent library, the version
4669 # number isn't really that important, except for making cc/ld happy.
4671 # A name such as libperl.so.3.1
4672 majmin="libperl.$so.$patchlevel.$subversion"
4673 # A name such as libperl.so.301
4674 majonly=`echo $patchlevel $subversion |
4675 $awk '{printf "%d%02d", $1, $2}'`
4676 majonly=libperl.$so.$majonly
4677 # I'd prefer to keep the os-specific stuff here to a minimum, and
4678 # rely on figuring it out from the naming of libc.
4679 case "${osname}${osvers}" in
4682 # XXX How handle the --version stuff for MAB?
4684 linux*) # ld won't link with a bare -lperl otherwise.
4687 *) # Try to guess based on whether libc has major.minor.
4689 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
4690 *libc.$so.[0-9]*) dflt=$majonly ;;
4691 *) dflt=libperl.$so ;;