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 and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Fri Sep 11 21:59:48 EET DST 1998 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by jhi@iki.fi)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 case "$inksh/$needksh" in
118 case "$inksh/$avoidksh" in
124 case "$inksh/$needksh-$avoidksh-" in
127 (I see you are using the Korn shell. Some ksh's blow up on $me,
128 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
134 echo "(Feeding myself to $newsh $reason.)"
136 Configure|*/Configure) exec $newsh $0 "$@";;
137 *) exec $newsh Configure "$@";;
142 : if needed set CDPATH to a harmless value that is not chatty
143 : avoid bash 2.02 problems with empty CDPATH.
147 *bash*) CDPATH='.' ;;
152 : Configure runs within the UU subdirectory
153 test -d UU || mkdir UU
413 d_pthreads_created_joinable=''
758 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
761 : We must find out about Eunice early
763 if test -f /etc/unixtovms; then
764 eunicefix=/etc/unixtovms
766 if test -f /etc/unixtovms.exe; then
767 eunicefix=/etc/unixtovms.exe
771 : change the next line if compiling for Xenix/286 on Xenix/386
772 xlibpth='/usr/lib/386 /lib/386'
774 : Possible local library directories to search.
775 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
776 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
778 : general looking path for locating libraries
779 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
780 glibpth="$glibpth /lib /usr/lib $xlibpth"
781 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
782 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
784 : Private path used by Configure to find libraries. Its value
785 : is prepended to libpth. This variable takes care of special
786 : machines, like the mips. Usually, it should be empty.
789 : default library list
791 : Possible local include directories to search.
792 : Set locincpth to "" in a hint file to defeat local include searches.
793 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
794 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
796 : no include file wanted by default
799 : list of known cpp symbols, sorted alphabetically
800 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
801 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
802 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
803 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
804 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
805 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
806 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
807 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
808 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
809 al="$al VMS Xenix286"
810 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
811 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
812 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
813 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
814 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
815 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
816 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
817 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
818 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
819 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
820 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
821 al="$al __SVR4_2__ __UMAXV__"
822 al="$al ____386BSD____ __alpha __alpha__ __amiga"
823 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
824 al="$al __host_mips__"
825 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
826 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
827 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
828 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
829 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
830 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
831 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
832 al="$al __mc88100 __mc88100__ __mips __mips__"
833 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
834 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
835 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
836 al="$al _host_mips _mips _unix"
837 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
838 al="$al apollo ardent att386 att3b"
839 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
840 al="$al cadmus clipper concurrent convex cray ctix"
841 al="$al dmert encore gcos gcx gimpel gould"
842 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
843 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
844 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
845 al="$al i186 i286 i386 i486 i8086"
846 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
847 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
848 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
849 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
850 al="$al mc88000 mc88100 merlin mert mips mvs n16"
851 al="$al ncl_el ncl_mr"
852 al="$al news1500 news1700 news1800 news1900 news3700"
853 al="$al news700 news800 news900 ns16000 ns32000"
854 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
855 al="$al parisc pc532 pdp11 plexus posix pyr"
856 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
857 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
858 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
859 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
860 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
861 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
864 : Trailing extension. Override this in a hint file, if needed.
866 : Extra object files, if any, needed on this platform.
869 : full support for void wanted by default
872 : set useposix=false in your hint file to disable the POSIX extension.
874 : set useopcode=false in your hint file to disable the Opcode extension.
876 : set usethreads on the Configure command line to enable threads.
877 : List of libraries we want.
878 : If anyone needs -lnet, put it in a hint file.
879 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
880 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
881 libswanted="$libswanted ucb bsd BSD PW x"
882 : We probably want to search /usr/shlib before most other libraries.
883 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
884 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
885 glibpth="/usr/shlib $glibpth"
886 : Do not use vfork unless overridden by a hint file.
889 : Find the basic shell for Bourne shell scripts
893 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
896 if test -f "$xxx"; then
899 : Build up a list and do a single loop so we can 'break' out.
900 pth=`echo $PATH | sed -e "s/$p_/ /g"`
901 for xxx in sh bash ksh pdksh ash; do
903 try="$try ${p}/${xxx}"
907 if test -f "$xxx"; then
910 elif test -f "$xxx.exe"; then
921 $me: Fatal Error: I can't find a Bourne Shell anywhere.
923 Usually it's in /bin/sh. How did you even get this far?
924 Please contact me (Jarkko Hietaniemi) at jhi@iki.fi and
925 we'll try to straighten this all out.
931 : see if sh knows # comments
932 if `$sh -c '#' >/dev/null 2>&1`; then
936 test -f $xcat || xcat=/usr/bin/cat
941 if test -s today; then
944 echo "#! $xcat" > try
948 if test -s today; then
956 echo "Your $sh doesn't grok # comments--I will strip them later on."
959 echo "exec grep -v '^[ ]*#'" >spitshell
962 spitshell=`pwd`/spitshell
964 echo "I presume that if # doesn't work, #! won't work either!"
969 : figure out how to guarantee sh startup
971 '') startsh=${sharpbang}${sh} ;;
983 : echo "Yup, it does."
985 echo "Hmm... '$startsh' does not guarantee sh startup..."
986 echo "You may have to fix up the shell scripts to make sure $sh runs them."
991 : Save command line options in file UU/cmdline.opt for later use in
992 : generating config.sh.
993 cat > cmdline.opt <<EOSH
994 # Configure command line arguments.
1001 cat >>cmdline.opt <<EOSH
1002 config_arg$argn='$arg'
1004 argn=`expr $argn + 1`
1007 : produce awk script to parse command line options
1008 cat >options.awk <<'EOF'
1010 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
1012 len = length(optstr);
1013 for (i = 1; i <= len; i++) {
1014 c = substr(optstr, i, 1);
1015 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1026 if (substr(str, 1, 1) != "-") {
1027 printf("'%s'\n", str);
1031 for (i = 2; i <= len; i++) {
1032 c = substr(str, i, 1);
1034 printf("-%s\n", substr(str, i));
1040 printf("'%s'\n", substr(str, i + 1));
1053 : process the command line options
1054 set X `for arg in "$@"; do echo "X$arg"; done |
1055 sed -e s/X// | awk -f options.awk`
1060 : set up default values
1071 cat >optdef.sh <<EOS
1077 while test $# -gt 0; do
1079 -d) shift; fastread=yes;;
1080 -e) shift; alldone=cont;;
1084 if test -r "$1"; then
1087 echo "$me: cannot read config file $1." >&2
1092 -h) shift; error=true;;
1093 -r) shift; reuseval=true;;
1094 -s) shift; silent=true; realsilent=true;;
1095 -E) shift; alldone=exit;;
1096 -K) shift; knowitall=true;;
1097 -O) shift; override=true;;
1098 -S) shift; silent=true; extractsh=true;;
1103 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1104 echo "$me: ignoring -D $1" >&2
1107 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1108 *) echo "$1='define'" >> optdef.sh;;
1115 *=) echo "$1" >> optdef.sh;;
1117 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1118 echo "$me: ignoring -U $1" >&2
1120 *) echo "$1='undef'" >> optdef.sh;;
1124 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1127 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1135 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1136 [-U symbol] [-U symbol=]
1137 -d : use defaults for all answers.
1138 -e : go on without questioning past the production of config.sh.
1139 -f : specify an alternate default configuration file.
1140 -h : print this help message and exit (with an error status).
1141 -r : reuse C symbols value if possible (skips costly nm extraction).
1142 -s : silent mode, only echoes questions and essential information.
1143 -D : define symbol to have some value:
1144 -D symbol symbol gets the value 'define'
1145 -D symbol=value symbol gets the value 'value'
1146 -E : stop at the end of questions, after having produced config.sh.
1147 -K : do not use unless you know what you are doing.
1148 -O : let -D and -U override definitions from loaded configuration file.
1149 -S : perform variable substitutions on all .SH files (can mix with -f)
1150 -U : undefine symbol:
1151 -U symbol symbol gets the value 'undef'
1152 -U symbol= symbol gets completely empty
1153 -V : print version number and exit (with a zero status).
1160 case "$fastread$alldone" in
1163 if test ! -t 0; then
1164 echo "Say 'sh Configure', not 'sh <Configure'"
1172 true) exec 1>/dev/null;;
1175 : run the defines and the undefines, if any, but leave the file out there...
1181 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1182 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1183 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1184 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1185 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1188 : Some greps do not return status, grrr.
1189 echo "grimblepritz" >grimble
1190 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1192 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1198 : the following should work in any shell
1202 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1203 cat >contains <<'EOSS'
1204 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1209 : Find the path to the source tree
1212 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1223 if test -f $rsrc/Configure && \
1224 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1226 : found it, so we are ok.
1229 for src in . .. ../.. ../../.. ../../../..; do
1230 if test -f ../$src/Configure && \
1231 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1242 Sorry, I can't seem to locate the source dir for $package. Please start
1243 Configure with an explicit path -- i.e. /some/path/Configure.
1251 echo "Sources for $package found in \"$src\"." >&4
1255 : script used to extract .SH files with variable substitutions
1256 cat >extract <<'EOS'
1258 echo "Doing variable substitutions on .SH files..."
1259 if test -f $src/MANIFEST; then
1260 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'`
1262 echo "(Looking for .SH files under the source directory.)"
1263 set x `(cd $src; find . -name "*.SH" -print)`
1267 0) set x `(cd $src; echo *.SH)`; shift;;
1269 if test ! -f $src/$1; then
1275 while test $name; do
1276 if test ! -d "$name"; then
1277 create="$name $create";
1278 name=`echo $name | sed -e "s|^[^/]*$||"`;
1279 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1284 for file in $create; do
1293 dir=`expr X$file : 'X\(.*\)/'`
1294 file=`expr X$file : 'X.*/\(.*\)'`
1295 (cd $dir && . ./$file)
1305 dir=`expr X$file : 'X\(.*\)/'`
1306 file=`expr X$file : 'X.*/\(.*\)'`
1307 (set x $dir; shift; eval $mkdir_p)
1317 if test -f $src/config_h.SH; then
1318 if test ! -f config.h; then
1319 : oops, they left it out of MANIFEST, probably, so do it anyway.
1325 : extract files and exit if asked to do so
1326 case "$extractsh" in
1328 case "$realsilent" in
1332 case "$config_sh" in
1333 '') config_sh='config.sh';;
1336 echo "Fetching answers from $config_sh..."
1339 test "$override" && . ./optdef.sh
1348 : Eunice requires " " instead of "", can you believe it
1351 echo "Beginning of configuration questions for $package."
1353 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1355 : first determine how to suppress newline on echo command
1357 echo "Checking echo to see how to suppress newlines..."
1358 (echo "hi there\c" ; echo " ") >.echotmp
1359 if $contains c .echotmp >/dev/null 2>&1 ; then
1370 echo $n "The star should be here-->$c"
1374 : Now test for existence of everything in MANIFEST
1376 if test -f $rsrc/MANIFEST; then
1377 echo "First let's make sure your kit is complete. Checking..." >&4
1378 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1381 for filelist in x??; do
1382 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1384 if test -s missing; then
1388 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1390 You have the option of continuing the configuration process, despite the
1391 distinct possibility that your kit is damaged, by typing 'y'es. If you
1392 do, don't blame me if something goes wrong. I advise you to type 'n'o
1393 and contact the author (jhi@iki.fi).
1396 echo $n "Continue? [n] $c" >&4
1400 echo "Continuing..." >&4
1404 echo "ABORTING..." >&4
1409 echo "Looks good..."
1412 echo "There is no MANIFEST file. I hope your kit is complete !"
1417 : Find the appropriate value for a newline for tr
1418 if test -n "$DJGPP"; then
1421 if test X"$trnl" = X; then
1422 case "`echo foo|tr '\n' x 2>/dev/null`" in
1426 if test X"$trnl" = X; then
1427 case "`echo foo|tr '\012' x 2>/dev/null`" in
1428 foox) trnl='\012' ;;
1431 if test X"$trnl" = X; then
1434 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1440 : compute the number of columns on the terminal for proper question formatting
1445 : set up the echo used in my read
1446 myecho="case \"\$xxxm\" in
1447 '') echo $n \"\$rp $c\" >&4;;
1449 '') echo $n \"[\$xxxm] $c\";;
1451 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1453 echo $n \"[\$xxxm] $c\" >&4
1455 echo $n \"\$rp [\$xxxm] $c\" >&4
1461 : now set up to do reads with possible shell escape and default assignment
1467 case "\$fastread" in
1468 yes) case "\$dflt" in
1471 case "\$silent-\$rp" in
1476 *) case "\$silent" in
1477 true) case "\$rp" in
1482 while expr "X\$ans" : "X!" >/dev/null; do
1486 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1494 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1503 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1508 echo "(OK, I'll run with -d after this question.)" >&4
1511 echo "*** Sorry, \$1 not supported yet." >&4
1521 echo "*** Substitution done -- please confirm."
1523 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1528 echo "*** Error -- try again."
1535 case "\$ans\$xxxm\$nostick" in
1547 : create .config dir to save info across Configure sessions
1548 test -d ../.config || mkdir ../.config
1549 cat >../.config/README <<EOF
1550 This directory created by Configure to save information that should
1551 persist across sessions for $package.
1553 You may safely delete it if you wish.
1556 : general instructions
1559 user=`(logname) 2>/dev/null`
1561 '') user=`whoami 2>&1`;;
1563 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1566 rp='Would you like to see the instructions?'
1577 This installation shell script will examine your system and ask you questions
1578 to determine how the perl5 package should be installed. If you get
1579 stuck on a question, you may use a ! shell escape to start a subshell or
1580 execute a command. Many of the questions will have default answers in square
1581 brackets; typing carriage return will give you the default.
1583 On some of the questions which ask for file or directory names you are allowed
1584 to use the ~name construct to specify the login directory belonging to "name",
1585 even if you don't have a shell which knows about that. Questions where this is
1586 allowed will be marked "(~name ok)".
1590 dflt='Type carriage return to continue'
1594 The prompter used in this script allows you to use shell variables and
1595 backticks in your answers. You may use $1, $2, etc... to refer to the words
1596 in the default answer, as if the default line was a set of arguments given to a
1597 script shell. This means you may also use $* to repeat the whole default line,
1598 so you do not have to re-type everything to add something to the default.
1600 Everytime there is a substitution, you will have to confirm. If there is an
1601 error (e.g. an unmatched backtick), the default answer will remain unchanged
1602 and you will be prompted again.
1604 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1605 the questions and use the computed defaults (or the previous answers if there
1606 was already a config.sh file). Type 'Configure -h' for a list of options.
1607 You may also start interactively and then answer '& -d' at any prompt to turn
1608 on the non-interactive behaviour for the remainder of the execution.
1614 Much effort has been expended to ensure that this shell script will run on any
1615 Unix system. If despite that it blows up on yours, your best bet is to edit
1616 Configure and run it again. If you can't run Configure for some reason,
1617 you'll have to generate a config.sh file by hand. Whatever problems you
1618 have, let me (jhi@iki.fi) know how I blew it.
1620 This installation script affects things in two ways:
1622 1) it may do direct variable substitutions on some of the files included
1624 2) it builds a config.h file for inclusion in C programs. You may edit
1625 any of these files as the need arises after running this script.
1627 If you make a mistake on a question, there is no easy way to back up to it
1628 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1629 files. Configure will offer to let you do this before it runs the SH files.
1632 dflt='Type carriage return to continue'
1634 case "$firsttime" in
1635 true) echo $user >>../.config/instruct;;
1639 : find out where common programs are
1641 echo "Locating common programs..." >&4
1654 if test -d \$dir/\$thing; then
1660 for thisthing in \$dir/\$thing; do
1661 : just loop through to pick last item
1663 if test -f \$thisthing; then
1666 elif test -f \$dir/\$thing.exe; then
1667 if test -n "$DJGPP"; then
1668 echo \$dir/\$thing.exe
1670 : on Eunice apparently
1725 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1726 pth="$pth /lib /usr/lib"
1727 for file in $loclist; do
1731 if test -f "$xxx"; then
1734 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1735 xxx=`./loc $file $file $pth`
1738 '') xxx=`./loc $file $file $pth`;;
1739 *) xxx=`./loc $xxx $xxx $pth`;;
1745 echo $file is in $xxx.
1748 echo $file is in $xxx.
1751 echo "I don't know where '$file' is, and my life depends on it." >&4
1752 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1758 echo "Don't worry if any of the following aren't found..."
1760 for file in $trylist; do
1764 if test -f "$xxx"; then
1767 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1768 xxx=`./loc $file $file $pth`
1771 '') xxx=`./loc $file $file $pth`;;
1772 *) xxx=`./loc $xxx $xxx $pth`;;
1778 echo $file is in $xxx.
1781 echo $file is in $xxx.
1784 echo "I don't see $file out there, $say."
1791 echo "Substituting grep for egrep."
1797 echo "Substituting cp for ln."
1803 echo "Hopefully test is built into your sh."
1806 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1807 echo "Using the test built into your sh."
1815 echo "Hopefully echo is built into your sh."
1820 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1821 $echo $n "hi there$c" >foo1
1822 echo $n "hi there$c" >foo2
1823 if cmp foo1 foo2 >/dev/null 2>&1; then
1824 echo "They are compatible. In fact, they may be identical."
1831 They are not compatible! You are probably running ksh on a non-USG system.
1832 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1833 have echo built in and we may have to run some Bourne shell scripts. That
1834 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1837 $echo $n "The star should be here-->$c"
1844 : determine whether symbolic links are supported
1847 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1848 echo "Symbolic links are supported." >&4
1851 echo "Symbolic links are NOT supported." >&4
1856 : see whether [:lower:] and [:upper:] are supported character classes
1858 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1860 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1864 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1865 # (0xc9 and 0xd1), therefore that is a nice testing point.
1866 if test "X$up" = X -o "X$low" = X; then
1867 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1873 if test "X$up" = X -o "X$low" = X; then
1874 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1880 if test "X$up" = X -o "X$low" = X; then
1881 case "`echo IJ | od -x 2>/dev/null`" in
1883 echo "Hey, this might be EBCDIC." >&4
1884 if test "X$up" = X -o "X$low" = X; then
1885 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1886 ij) up='[A-IJ-RS-Z]'
1891 if test "X$up" = X -o "X$low" = X; then
1892 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1902 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
1904 echo "Using $up and $low to convert case." >&4
1907 echo "I don't know how to translate letters from upper to lower case." >&4
1908 echo "Your tr is not acting any way I know of." >&4
1912 : set up the translation script tr, must be called with ./tr of course
1916 '[A-Z][a-z]') exec $tr '$up' '$low';;
1917 '[a-z][A-Z]') exec $tr '$low' '$up';;
1924 : Try to determine whether config.sh was made on this system
1925 case "$config_sh" in
1927 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1928 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
1929 # because the A-Z/a-z are not consecutive.
1930 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1931 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1932 newmyuname="$myuname"
1934 case "$knowitall" in
1936 if test -f ../config.sh; then
1937 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1938 eval "`grep myuname= ../config.sh`"
1940 if test "X$myuname" = "X$newmyuname"; then
1948 : Get old answers from old config file if Configure was run on the
1949 : same system, otherwise use the hints.
1952 if test -f config.sh; then
1954 rp="I see a config.sh file. Shall I use it to set the defaults?"
1957 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1958 *) echo "Fetching default answers from your old config.sh file..." >&4
1966 : Older versions did not always set $sh. Catch re-use of such
1975 if test ! -f config.sh; then
1978 First time through, eh? I have some defaults handy for some systems
1979 that need some extra help getting the Configure answers right:
1982 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
1984 : Half the following guesses are probably wrong... If you have better
1985 : tests or hints, please send them to jhi@iki.fi
1986 : The metaconfig authors would also appreciate a copy...
1987 $test -f /irix && osname=irix
1988 $test -f /xenix && osname=sco_xenix
1989 $test -f /dynix && osname=dynix
1990 $test -f /dnix && osname=dnix
1991 $test -f /lynx.os && osname=lynxos
1992 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1993 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
1994 $test -f /bin/mips && /bin/mips && osname=mips
1995 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1996 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1997 $test -d /usr/apollo/bin && osname=apollo
1998 $test -f /etc/saf/_sactab && osname=svr4
1999 $test -d /usr/include/minix && osname=minix
2000 if $test -d /MachTen -o -d /MachTen_Folder; then
2002 if $test -x /sbin/version; then
2003 osvers=`/sbin/version | $awk '{print $2}' |
2004 $sed -e 's/[A-Za-z]$//'`
2005 elif $test -x /usr/etc/version; then
2006 osvers=`/usr/etc/version | $awk '{print $2}' |
2007 $sed -e 's/[A-Za-z]$//'`
2012 $test -f /sys/posix.dll &&
2013 $test -f /usr/bin/what &&
2014 set X `/usr/bin/what /sys/posix.dll` &&
2015 $test "$3" = UWIN &&
2018 if $test -f $uname; then
2026 umips) osname=umips ;;
2029 [23]100) osname=mips ;;
2030 next*) osname=next ;;
2032 if $test -f /etc/kconfig; then
2034 if test "$lns" = "ln -s"; then
2036 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2038 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2044 if test -n "$DJGPP"; then
2053 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2055 'not found') osvers="$4"."$3" ;;
2056 '<3240'|'<>3240') osvers=3.2.0 ;;
2057 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2058 '=3250'|'>3250') osvers=3.2.5 ;;
2062 *dc.osx) osname=dcosx
2068 domainos) osname=apollo
2074 dynixptx*) osname=dynixptx
2077 freebsd) osname=freebsd
2079 genix) osname=genix ;;
2081 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2097 netbsd*) osname=netbsd
2100 news-os) osvers="$3"
2102 4*) osname=newsos4 ;;
2106 bsd386) osname=bsd386
2109 powerux | power_ux | powermax_os | powermaxos | \
2110 powerunix | power_unix) osname=powerux
2113 next*) osname=next ;;
2114 solaris) osname=solaris
2116 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2123 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2127 titanos) osname=titanos
2136 ultrix) osname=ultrix
2139 osf1|mls+) case "$5" in
2142 osvers=`echo "$3" | sed 's/^[xvt]//'`
2144 hp*) osname=hp_osf1 ;;
2145 mips) osname=mips_osf1 ;;
2154 $2) case "$osname" in
2158 : svr4.x or possibly later
2168 if test -f /stand/boot ; then
2169 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2170 if test -n "$INITPROG" -a -f "$INITPROG"; then
2171 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2172 if test -n "$isesix"; then
2180 *) if test -f /etc/systemid; then
2182 set `echo $3 | $sed 's/\./ /g'` $4
2183 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2185 elif $test -f $src/hints/sco_$1_$2.sh; then
2187 elif $test -f $src/hints/sco_$1.sh; then
2192 '') : Still unknown. Probably a generic Sys V.
2201 *) case "$osname" in
2202 '') : Still unknown. Probably a generic BSD.
2210 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2211 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2212 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2215 $rm -f UU/kernel.what
2216 elif test -d c:/.; then
2223 : Now look for a hint file osname_osvers, unless one has been
2224 : specified already.
2227 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2228 : Also try without trailing minor version numbers.
2229 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2230 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2231 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2232 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2235 *) case "$osvers" in
2238 *) if $test -f $src/hints/$file.sh ; then
2240 elif $test -f $src/hints/$xfile.sh ; then
2242 elif $test -f $src/hints/$xxfile.sh ; then
2244 elif $test -f $src/hints/$xxxfile.sh ; then
2246 elif $test -f $src/hints/$xxxxfile.sh ; then
2248 elif $test -f "$src/hints/${osname}.sh" ; then
2257 if $test -f Policy.sh ; then
2260 none) dflt="Policy" ;;
2261 *) dflt="Policy $dflt" ;;
2266 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2270 if $test -f Policy.sh ; then
2273 There's also a Policy hint file available, which should make the
2274 site-specific (policy) questions easier to answer.
2281 You may give one or more space-separated answers, or "none" if appropriate.
2282 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2283 is a good thing. DO NOT give a wrong version.
2287 rp="Which of these apply, if any?"
2290 for file in $tans; do
2291 if $test X$file = XPolicy -a -f Policy.sh; then
2293 $cat Policy.sh >> UU/config.sh
2294 elif $test -f $src/hints/$file.sh; then
2295 . $src/hints/$file.sh
2296 $cat $src/hints/$file.sh >> UU/config.sh
2297 elif $test X$tans = X -o X$tans = Xnone ; then
2300 : Give one chance to correct a possible typo.
2301 echo "$file.sh does not exist"
2303 rp="hint to use instead?"
2305 for file in $ans; do
2306 if $test -f "$src/hints/$file.sh"; then
2307 . $src/hints/$file.sh
2308 $cat $src/hints/$file.sh >> UU/config.sh
2309 elif $test X$ans = X -o X$ans = Xnone ; then
2312 echo "$file.sh does not exist -- ignored."
2319 : Remember our hint file for later.
2320 if $test -f "$src/hints/$file.sh" ; then
2330 echo "Fetching default answers from $config_sh..." >&4
2334 cp $config_sh config.sh 2>/dev/null
2344 test "$override" && . ./optdef.sh
2345 myuname="$newmyuname"
2347 : Restore computed paths
2348 for file in $loclist $trylist; do
2349 eval $file="\$_$file"
2354 Configure uses the operating system name and version to set some defaults.
2355 The default value is probably right if the name rings a bell. Otherwise,
2356 since spelling matters for me, either accept the default or answer "none"
2363 ''|' '|none) dflt=none ;;
2364 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2367 *) dflt="$osname" ;;
2369 rp="Operating system name?"
2373 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2379 ''|' '|none) dflt=none ;;
2380 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2381 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2383 ''|' ') dflt=none ;;
2388 *) dflt="$osvers" ;;
2390 rp="Operating system version?"
2397 : who configured the system
2398 cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
2399 cf_by=`(logname) 2>/dev/null`
2402 cf_by=`(whoami) 2>/dev/null`
2404 "") cf_by=unknown ;;
2408 : set up the script used to warn in case of inconsistency
2415 echo "*** WHOA THERE!!! ***" >&4
2416 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2417 rp=" Keep the $hint value?"
2420 y) td=$was; tu=$was;;
2424 : function used to set $1 to $val
2425 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2427 $define$undef) . ./whoa; eval "$var=\$td";;
2428 $undef$define) . ./whoa; eval "$var=\$tu";;
2429 *) eval "$var=$val";;
2434 Perl can be built to take advantage of threads, on some systems.
2435 To do so, Configure must be run with -Dusethreads.
2436 (See README.threads for details.)
2438 case "$usethreads" in
2439 $define|true|[yY]*) dflt='y';;
2442 rp='Build a threading Perl?'
2445 y|Y) val="$define" ;;
2450 : Look for a hint-file generated 'call-back-unit'. Now that the
2451 : user has specified if a threading perl is to be built, we may need
2452 : to set or change some other defaults.
2453 if $test -f usethreads.cbu; then
2456 case "$d_oldpthreads" in
2457 '') : Configure tests would be welcome here. For now, assume undef.
2459 *) val="$d_oldpthreads" ;;
2464 : determine the architecture name
2466 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2467 tarch=`arch`"-$osname"
2468 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2469 if uname -m > tmparch 2>&1 ; then
2470 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2471 -e 's/$/'"-$osname/" tmparch`
2479 case "$myarchname" in
2482 echo "(Your architecture name used to be $myarchname.)"
2488 *) dflt="$archname";;
2490 rp='What is your architecture name'
2492 case "$usethreads" in
2493 $define) echo "Threads selected." >&4
2495 *-thread) echo "...and architecture name already ends in -thread." >&4
2498 *) archname="$ans-thread"
2499 echo "...setting architecture name to $archname." >&4
2503 *) archname="$ans" ;;
2509 $define|true) afs=true ;;
2510 $undef|false) afs=false ;;
2511 *) if test -d /afs; then
2519 echo "AFS may be running... I'll be extra cautious then..." >&4
2521 echo "AFS does not seem to be running..." >&4
2524 : decide how portable to be. Allow command line overrides.
2525 case "$d_portable" in
2527 *) d_portable="$define" ;;
2530 : set up shell script to do ~ expansion
2536 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2539 if $test -f /bin/csh; then
2540 /bin/csh -f -c "glob \$1"
2545 name=\`$expr x\$1 : '..\([^/]*\)'\`
2546 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2547 if $test ! -d "\$dir"; then
2549 echo "\$me: can't locate home directory for: \$name" >&2
2554 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2570 : now set up to get a file name
2574 cat <<'EOSC' >>getfile
2587 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2588 fn=`echo $fn | sed 's/(.*)//'`
2594 loc_file=`expr $fn : '.*:\(.*\)'`
2595 fn=`expr $fn : '\(.*\):.*'`
2603 */*) fullpath=true;;
2612 *e*) exp_file=true;;
2615 *p*) nopath_ok=true;;
2620 *d*) type='Directory';;
2621 *l*) type='Locate';;
2626 Locate) what='File';;
2631 case "$d_portable" in
2639 while test "$type"; do
2644 true) rp="$rp (~name ok)";;
2647 if test -f UU/getfile.ok && \
2648 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2667 value=`UU/filexp $ans`
2670 if test "$ans" != "$value"; then
2671 echo "(That expands to $value on this system.)"
2685 /*) value="$ansexp" ;;
2690 echo "I shall only accept a full path name, as in /bin/ls." >&4
2691 echo "Use a ! shell escape if you wish to check pathnames." >&4
2694 echo "Please give a full path name, starting with slash." >&4
2697 echo "Note that using ~name is ok provided it expands well." >&4
2710 if test -f "$ansexp"; then
2712 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2714 echo "($value is not a plain file, but that's ok.)"
2719 if test -d "$ansexp"; then
2724 if test -d "$ansexp"; then
2725 echo "(Looking for $loc_file in directory $value.)"
2726 value="$value/$loc_file"
2727 ansexp="$ansexp/$loc_file"
2729 if test -f "$ansexp"; then
2732 case "$nopath_ok" in
2733 true) case "$value" in
2735 *) echo "Assuming $value will be in people's path."
2751 if test "$fastread" = yes; then
2756 rp="$what $value doesn't exist. Use that name anyway?"
2777 : determine root of directory hierarchy where package will be installed.
2780 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2788 By default, $package will be installed in $dflt/bin, manual
2789 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2790 all installation directories. Typically set to /usr/local, but you
2791 may choose /usr if you wish to install $package among your system
2792 binaries. If you wish to have binaries under /bin but manual pages
2793 under /usr/local/man, that's ok: you will be prompted separately
2794 for each of the installation directories, the prefix being only used
2795 to set the defaults.
2799 rp='Installation prefix to use?'
2807 *) oldprefix="$prefix";;
2814 : set the prefixit variable, to compute a suitable default value
2815 prefixit='case "$3" in
2817 case "$oldprefix" in
2818 "") eval "$1=\"\$$2\"";;
2825 ""|" ") eval "$1=\"\$$2\"";;
2831 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2833 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2834 /*-$oldprefix/*|\~*-$oldprefix/*)
2835 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2836 *) eval "$1=\"\$$2\"";;
2840 : set the base revision
2843 : get the patchlevel
2845 echo "Getting the current patchlevel..." >&4
2846 if $test -r $rsrc/patchlevel.h;then
2847 patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
2848 subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
2853 $echo $n "(You have $package" $c
2856 *) $echo $n " $baserev" $c ;;
2858 $echo $n " patchlevel $patchlevel" $c
2859 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
2862 if test 0 -eq "$subversion"; then
2863 version=`LC_ALL=C; export LC_ALL; \
2864 echo $baserev $patchlevel | \
2865 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2867 version=`LC_ALL=C; export LC_ALL; \
2868 echo $baserev $patchlevel $subversion | \
2869 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
2871 : Figure out perl API version. Perhaps this should be in patchlevel.h
2872 if test "$subversion" -lt 50; then
2873 apiversion=`LC_ALL=C; export LC_ALL; \
2874 echo $baserev $patchlevel | \
2875 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2877 apiversion="$version"
2880 : determine where private library files go
2881 : Usual default is /usr/local/lib/perl5/$version.
2882 : Also allow things like /opt/perl/lib/$version, since
2883 : /opt/perl/lib/perl5... would be redundant.
2885 *perl*) set dflt privlib lib/$version ;;
2886 *) set dflt privlib lib/$package/$version ;;
2891 There are some auxiliary files for $package that need to be put into a
2892 private library directory that is accessible by everyone.
2896 rp='Pathname where the private library files will reside?'
2898 if $test "X$privlibexp" != "X$ansexp"; then
2902 privlibexp="$ansexp"
2906 Since you are running AFS, I need to distinguish the directory in which
2907 private files reside from the directory in which they are installed (and from
2908 which they are presumably copied to the former directory by occult means).
2911 case "$installprivlib" in
2912 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2913 *) dflt="$installprivlib";;
2916 rp='Where will private files be installed?'
2918 installprivlib="$ans"
2920 installprivlib="$privlibexp"
2923 : set the prefixup variable, to restore leading tilda escape
2924 prefixup='case "$prefixexp" in
2926 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2929 : determine where public architecture dependent libraries go
2932 : privlib default is /usr/local/lib/$package/$version
2933 : archlib default is /usr/local/lib/$package/$version/$archname
2934 : privlib may have an optional trailing /share.
2935 tdflt=`echo $privlib | $sed 's,/share$,,'`
2936 tdflt=$tdflt/$archname
2945 $spackage contains architecture-dependent library files. If you are
2946 sharing libraries in a heterogeneous environment, you might store
2947 these files in a separate location. Otherwise, you can just include
2948 them with the rest of the public library files.
2952 rp='Where do you want to put the public architecture-dependent libraries?'
2955 archlibexp="$ansexp"
2960 Since you are running AFS, I need to distinguish the directory in
2961 which architecture-dependent library files reside from the directory
2962 in which they are installed (and from which they are presumably copied
2963 to the former directory by occult means).
2966 case "$installarchlib" in
2967 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2968 *) dflt="$installarchlib";;
2971 rp='Where will architecture-dependent library files be installed?'
2973 installarchlib="$ans"
2975 installarchlib="$archlibexp"
2977 if $test X"$archlib" = X"$privlib"; then
2983 : make some quick guesses about what we are up against
2985 $echo $n "Hmm... $c"
2995 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2996 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2998 echo "Looks kind of like an OSF/1 system, but we'll see..."
3000 elif test `echo abc | tr a-z A-Z` = Abc ; then
3001 xxx=`./loc addbib blurfl $pth`
3002 if $test -f $xxx; then
3003 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3007 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3008 echo "Looks kind of like an extended USG system, but we'll see..."
3010 echo "Looks kind of like a USG system, but we'll see..."
3014 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3015 echo "Looks kind of like a BSD system, but we'll see..."
3019 echo "Looks kind of like a Version 7 system, but we'll see..."
3022 case "$eunicefix" in
3025 There is, however, a strange, musty smell in the air that reminds me of
3026 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3030 : it so happens the Eunice I know will not run shell scripts in Unix format
3034 echo "Congratulations. You aren't running Eunice."
3038 : Detect OS2. The p_ variable is set above in the Head.U unit.
3043 I have the feeling something is not exactly right, however...don't tell me...
3044 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3049 if test -f /xenix; then
3050 echo "Actually, this looks more like a XENIX system..."
3055 echo "It's not Xenix..."
3060 if test -f /venix; then
3061 echo "Actually, this looks more like a VENIX system..."
3068 echo "Nor is it Venix..."
3071 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3072 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3075 : see if setuid scripts can be secure
3078 Some kernels have a bug that prevents setuid #! scripts from being
3079 secure. Some sites have disabled setuid #! scripts because of this.
3081 First let's decide if your kernel supports secure setuid #! scripts.
3082 (If setuid #! scripts would be secure but have been disabled anyway,
3083 don't say that they are secure if asked.)
3088 if $test -d /dev/fd; then
3089 echo "#!$ls" >reflect
3090 chmod +x,u+s reflect
3091 ./reflect >flect 2>&1
3092 if $contains "/dev/fd" flect >/dev/null; then
3093 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3097 If you are not sure if they are secure, I can check but I'll need a
3098 username and password different from the one you are using right now.
3099 If you don't have such a username or don't want me to test, simply
3103 rp='Other username to test security of setuid scripts with?'
3108 case "$d_suidsafe" in
3109 '') echo "I'll assume setuid scripts are *not* secure." >&4
3112 echo "Well, the $hint value is *not* secure." >&4
3114 *) echo "Well, the $hint value *is* secure." >&4
3119 $rm -f reflect flect
3120 echo "#!$ls" >reflect
3121 chmod +x,u+s reflect
3124 echo '"su" will (probably) prompt you for '"$ans's password."
3125 su $ans -c './reflect >flect'
3126 if $contains "/dev/fd" flect >/dev/null; then
3127 echo "Okay, it looks like setuid scripts are secure." >&4
3130 echo "I don't think setuid scripts are secure." >&4
3135 rp='Does your kernel have *secure* setuid scripts?'
3138 [yY]*) val="$define";;
3143 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3144 echo "(That's for file descriptors, not floppy disks.)"
3150 $rm -f reflect flect
3152 : now see if they want to do setuid emulation
3155 case "$d_suidsafe" in
3158 echo "No need to emulate SUID scripts since they are secure here." >& 4
3162 Some systems have disabled setuid scripts, especially systems where
3163 setuid scripts cannot be secure. On systems where setuid scripts have
3164 been disabled, the setuid/setgid bits on scripts are currently
3165 useless. It is possible for $package to detect those bits and emulate
3166 setuid/setgid in a secure fashion. This emulation will only work if
3167 setuid scripts have been disabled in your kernel.
3171 "$define") dflt=y ;;
3174 rp="Do you want to do setuid/setgid emulation?"
3177 [yY]*) val="$define";;
3185 : determine where manual pages are on this system
3189 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3190 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3191 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3192 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3193 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3194 sysman=`./loc . /usr/man/man1 $syspath`
3197 if $test -d "$sysman"; then
3198 echo "System manual is in $sysman." >&4
3200 echo "Could not find manual pages in source form." >&4
3203 : see what memory models we can support
3206 $cat >pdp11.c <<'EOP'
3215 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3216 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3217 dflt='unsplit split'
3219 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3222 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3227 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3230 if $test -d /lib/large || $test -d /usr/lib/large; then
3233 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3242 Some systems have different model sizes. On most systems they are called
3243 small, medium, large, and huge. On the PDP11 they are called unsplit and
3244 split. If your system doesn't support different memory models, say "none".
3245 If you wish to force everything to one memory model, say "none" here and
3246 put the appropriate flags later when it asks you for other cc and ld flags.
3247 Venix systems may wish to put "none" and let the compiler figure things out.
3248 (In the following question multiple model names should be space separated.)
3250 The default for most systems is "none".
3253 rp="Which memory models are supported?"
3268 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3269 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3276 rp="What flag indicates separate I and D space?"
3284 *large*|*small*|*medium*|*huge*)
3291 rp="What flag indicates large model?"
3301 *huge*) case "$huge" in
3305 rp="What flag indicates huge model?"
3315 *medium*) case "$medium" in
3319 rp="What flag indicates medium model?"
3326 *) medium="$large";;
3329 *small*) case "$small" in
3333 rp="What flag indicates small model?"
3344 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3347 $rm -f pdp11.* pdp11
3349 : see if we need a special compiler
3357 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3358 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3372 On some older systems the default C compiler will not resolve multiple global
3373 references that happen to have the same name. On some such systems the "Mcc"
3374 command may be used to force these to be resolved. On other systems a "cc -M"
3375 command is required. (Note that the -M flag on other systems indicates a
3376 memory model to use!) If you have the Gnu C compiler, you might wish to use
3382 rp="Use which C compiler?"
3390 rp="Use which C compiler?"
3394 : Look for a hint-file generated 'call-back-unit'. Now that the
3395 : user has specified the compiler, we may need to set or change some
3397 if $test -f cc.cbu; then
3401 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3402 $cat >gccvers.c <<EOM
3407 printf("%s\n", __VERSION__);
3409 printf("%s\n", "1");
3415 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3416 gccversion=`./gccvers`
3417 case "$gccversion" in
3418 '') echo "You are not using GNU cc." ;;
3419 *) echo "You are using GNU cc $gccversion." ;;
3423 echo "*** WHOA THERE!!! ***" >&4
3424 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3425 case "$knowitall" in
3427 echo " You'd better start hunting for one and let me know about it." >&4
3433 case "$gccversion" in
3434 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3437 : What should the include directory be ?
3439 $echo $n "Hmm... $c"
3443 if $test -f /bin/mips && /bin/mips; then
3444 echo "Looks like a MIPS system..."
3445 $cat >usr.c <<'EOCP'
3446 #ifdef SYSTYPE_BSD43
3450 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3451 dflt='/bsd43/usr/include'
3455 mips_type='System V'
3457 $rm -f usr.c usr.out
3458 echo "and you're compiling with the $mips_type compiler and libraries."
3462 echo "Doesn't look like a MIPS system."
3472 case "$xxx_prompt" in
3475 rp='Where are the include files you want to use?'
3483 : see how we invoke the C preprocessor
3485 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3486 cat <<'EOT' >testcpp.c
3492 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3494 wrapper=`pwd`/cppstdin
3498 if $test "X$cppstdin" != "X" && \
3499 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3500 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3502 echo "You used to use $cppstdin $cppminus so we'll use that again."
3504 '') echo "But let's see if we can live without a wrapper..." ;;
3506 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3507 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3509 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3512 echo "(However, $cpprun $cpplast does not work, let's see...)"
3520 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3527 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3528 $cc -E <testcpp.c >testcpp.out 2>&1; \
3529 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3530 echo "Yup, it does."
3533 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3534 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3535 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3536 echo "Yup, it does."
3539 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3540 $cc -P <testcpp.c >testcpp.out 2>&1; \
3541 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3542 echo "Yipee, that works!"
3545 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3546 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3547 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3548 echo "At long last!"
3551 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3552 $cpp <testcpp.c >testcpp.out 2>&1; \
3553 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3557 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3558 $cpp - <testcpp.c >testcpp.out 2>&1; \
3559 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3560 echo "Hooray, it works! I was beginning to wonder."
3563 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3564 $wrapper <testcpp.c >testcpp.out 2>&1; \
3565 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3571 rp="No dice. I can't find a C preprocessor. Name one:"
3575 $x_cpp <testcpp.c >testcpp.out 2>&1
3576 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3577 echo "OK, that will do." >&4
3579 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3594 echo "Perhaps can we force $cc -E using a wrapper..."
3595 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3596 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3602 echo "Nope, we'll have to live without it..."
3617 *) $rm -f $wrapper;;
3619 $rm -f testcpp.c testcpp.out
3621 : Set private lib path
3624 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3629 '') dlist="$loclibpth $plibpth $glibpth";;
3630 *) dlist="$libpth";;
3633 : Now check and see which directories actually exist, avoiding duplicates
3637 if $test -d $xxx; then
3640 *) libpth="$libpth $xxx";;
3646 Some systems have incompatible or broken versions of libraries. Among
3647 the directories listed in the question below, please remove any you
3648 know not to be holding relevant libraries, and add any that are needed.
3649 Say "none" for none.
3660 rp="Directories to use for library searches?"
3667 : compute shared library extension
3670 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3680 On some systems, shared libraries may be available. Answer 'none' if
3681 you want to suppress searching of shared libraries for the remaining
3682 of this configuration.
3685 rp='What is the file extension used for shared libraries?'
3689 : Define several unixisms.
3690 : Hints files or command line option can be used to override them.
3691 : The convoluted testing is in case hints files set either the old
3694 '') case "$exe_ext" in
3696 *) _exe="$exe_ext" ;;
3701 '') case "$lib_ext" in
3708 '') case "$obj_ext" in
3715 '') case "$path_sep" in
3726 : Which makefile gets called first. This is used by make depend.
3727 case "$firstmakefile" in
3728 '') firstmakefile='makefile';;
3731 : Looking for optional libraries
3733 echo "Checking for optional libraries..." >&4
3738 case "$libswanted" in
3739 '') libswanted='c_s';;
3741 for thislib in $libswanted; do
3743 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
3744 echo "Found -l$thislib (shared)."
3747 *) dflt="$dflt -l$thislib";;
3749 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3750 echo "Found -l$thislib (shared)."
3753 *) dflt="$dflt -l$thislib";;
3755 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3756 echo "Found -l$thislib."
3759 *) dflt="$dflt -l$thislib";;
3761 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3762 echo "Found -l$thislib."
3765 *) dflt="$dflt -l$thislib";;
3767 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3768 echo "Found -l${thislib}_s."
3771 *) dflt="$dflt -l${thislib}_s";;
3773 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3774 echo "Found -l$thislib."
3777 *) dflt="$dflt -l$thislib";;
3780 echo "No -l$thislib."
3791 ' '|'') dflt='none';;
3796 Some versions of Unix support shared libraries, which make executables smaller
3797 but make load time slightly longer.
3799 On some systems, mostly System V Release 3's, the shared library is included
3800 by putting the option "-lc_s" as the last thing on the cc command line when
3801 linking. Other systems use shared libraries by default. There may be other
3802 libraries needed to compile $package on your machine as well. If your system
3803 needs the "-lc_s" option, include it here. Include any other special libraries
3804 here as well. Say "none" for none.
3808 rp="Any additional libraries?"
3815 : determine optimize, if desired, or use for debug flag also
3817 ' '|$undef) dflt='none';;
3819 *) dflt="$optimize";;
3823 Some C compilers have problems with their optimizers. By default, $package
3824 compiles with the -O flag to use the optimizer. Alternately, you might want
3825 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3826 systems). Either flag can be specified here. To use neither flag, specify
3830 rp="What optimizer/debugger flag should be used?"
3834 'none') optimize=" ";;
3838 : We will not override a previous value, but we might want to
3839 : augment a hint file
3842 case "$gccversion" in
3843 1*) dflt='-fpcc-struct-return' ;;
3846 *-g*) dflt="$dflt -DDEBUGGING";;
3848 case "$gccversion" in
3849 2*) if test -d /etc/conf/kconfig.d &&
3850 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3859 case "$mips_type" in
3860 *BSD*|'') inclwanted="$locincpth $usrinc";;
3861 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3863 for thisincl in $inclwanted; do
3864 if $test -d $thisincl; then
3865 if $test x$thisincl != x$usrinc; then
3868 *) dflt="$dflt -I$thisincl";;
3874 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3876 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3884 *) dflt="$dflt -D$2";;
3889 set signal.h __LANGUAGE_C__; eval $inctest
3891 set signal.h LANGUAGE_C; eval $inctest
3895 none|recommended) dflt="$ccflags $dflt" ;;
3896 *) dflt="$ccflags";;
3904 Your C compiler may want other flags. For this question you should include
3905 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3906 but you should NOT include libraries or ld flags like -lwhatever. If you
3907 want $package to honor its debug switch, you should include -DDEBUGGING here.
3908 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3910 To use no flags, specify the word "none".
3916 rp="Any additional cc flags?"
3923 : the following weeds options from ccflags that are of no interest to cpp
3925 case "$gccversion" in
3926 1*) cppflags="$cppflags -D__GNUC__"
3928 case "$mips_type" in
3930 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3936 echo "Let me guess what the preprocessor flags are..." >&4
3950 *) ftry="$previous $flag";;
3952 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3953 >cpp1.out 2>/dev/null && \
3954 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3955 >cpp2.out 2>/dev/null && \
3956 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3957 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3959 cppflags="$cppflags $ftry"
3969 *-*) echo "They appear to be: $cppflags";;
3971 $rm -f cpp.c cpp?.out
3975 : flags used in final linking phase
3977 '') if ./venix; then
3983 *-posix*) dflt="$dflt -posix" ;;
3986 *) dflt="$ldflags";;
3989 : Try to guess additional flags to pick up local libraries.
3990 for thislibdir in $libpth; do
3991 case " $loclibpth " in
3994 *"-L$thislibdir "*) ;;
3995 *) dflt="$dflt -L$thislibdir" ;;
4007 Your C linker may need flags. For this question you should
4008 include -L/whatever and any other flags used by the C linker, but you
4009 should NOT include libraries like -lwhatever.
4011 Make sure you include the appropriate -L/path flags if your C linker
4012 does not normally search all of the directories you specified above,
4015 To use no flags, specify the word "none".
4019 rp="Any additional ld flags (NOT including libraries)?"
4025 rmlist="$rmlist pdp11"
4029 echo "Checking your choice of C compiler and flags for coherency..." >&4
4030 $cat > try.c <<'EOF'
4032 main() { printf("Ok\n"); exit(0); }
4034 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4036 $cat >try.msg <<'EOM'
4037 I've tried to compile and run the following simple program:
4042 $cat >> try.msg <<EOM
4049 and I got the following output:
4053 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4054 if sh -c './try' >>try.msg 2>&1; then
4058 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4061 cat >> try.msg <<'EOQS'
4062 If $libs contains -lsfio, and sfio is mis-configured, then it
4063 sometimes (apparently) runs and exits with a 0 status, but with no
4064 output! It may have to do with sfio's use of _exit vs. exit.
4067 rp="You have a big problem. Shall I abort Configure"
4074 echo "The program compiled OK, but exited with status $?." >>try.msg
4075 rp="You have a problem. Shall I abort Configure"
4079 echo "I can't compile the test program." >>try.msg
4080 rp="You have a BIG problem. Shall I abort Configure"
4086 case "$knowitall" in
4088 echo "(The supplied flags or libraries might be incorrect.)"
4096 *) echo "Ok. Stopping Configure." >&4
4101 n) echo "OK, that should do.";;
4103 $rm -f try try.* core
4105 : determine filename position in cpp output
4107 echo "Computing filename position in cpp output for #include directives..." >&4
4108 echo '#include <stdio.h>' > foo.c
4111 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4112 $grep '^[ ]*#.*stdio\.h' | \
4113 while read cline; do
4116 while $test \$# -gt 0; do
4117 if $test -r \`echo \$1 | $tr -d '"'\`; then
4122 pos=\`expr \$pos + 1\`
4134 *) pos="${fieldn}th";;
4136 echo "Your cpp writes the filename in the $pos field of the line."
4138 : locate header file
4143 if test -f $usrinc/\$wanted; then
4144 echo "$usrinc/\$wanted"
4147 awkprg='{ print \$$fieldn }'
4148 echo "#include <\$wanted>" > foo\$\$.c
4149 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4150 $grep "^[ ]*#.*\$wanted" | \
4151 while read cline; do
4152 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4154 */\$wanted) echo "\$name"; exit 0;;
4165 : define an alternate in-header-list? function
4166 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4167 cont=true; xxf="echo \"<\$1> found.\" >&4";
4168 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4169 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4171 case $# in 4) instead=instead;; *) instead="at last";; esac;
4172 while $test "$cont"; do
4174 var=$2; eval "was=\$$2";
4175 if $test "$xxx" && $test -r "$xxx";
4177 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4180 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4181 set $yyy; shift; shift; yyy=$@;
4182 case $# in 0) cont="";;
4183 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4184 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4185 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4186 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4190 do set $yyy; var=$2; eval "was=\$$2";
4191 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4192 set $yyy; shift; shift; yyy=$@;
4195 : see if this is a malloc.h system
4196 set malloc.h i_malloc
4199 : see if stdlib is available
4200 set stdlib.h i_stdlib
4203 : determine which malloc to compile in
4205 case "$usemymalloc" in
4206 ''|[yY]*|true|$define) dflt='y' ;;
4209 rp="Do you wish to attempt to use the malloc that comes with $package?"
4215 mallocsrc='malloc.c'
4216 mallocobj="malloc$_o"
4217 d_mymalloc="$define"
4220 : Remove malloc from list of libraries to use
4221 echo "Removing unneeded -lmalloc from library list" >&4
4222 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4225 echo "libs = $libs" >&4
4237 : compute the return types of malloc and free
4239 $cat >malloc.c <<END
4243 #include <sys/types.h>
4257 case "$malloctype" in
4259 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4266 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4270 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4277 echo "Your system uses $freetype free(), it would seem." >&4
4279 : Cruising for prototypes
4281 echo "Checking out function prototypes..." >&4
4282 $cat >prototype.c <<'EOCP'
4283 main(int argc, char *argv[]) {
4286 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4287 echo "Your C compiler appears to support function prototypes."
4290 echo "Your C compiler doesn't seem to understand function prototypes."
4297 case "$prototype" in
4299 *) ansi2knr='ansi2knr'
4304 This version of $package can only be compiled by a compiler that
4305 understands function prototypes. Unfortunately, your C compiler
4307 doesn't seem to understand them. Sorry about that.
4309 If GNU cc is available for your system, perhaps you could try that instead.
4311 Eventually, we hope to support building Perl with pre-ANSI compilers.
4312 If you would like to help in that effort, please contact <perlbug@perl.org>.
4314 Aborting Configure now.
4320 : determine where public executables go
4325 rp='Pathname where the public executables will reside?'
4327 if $test "X$ansexp" != "X$binexp"; then
4335 Since you are running AFS, I need to distinguish the directory in which
4336 executables reside from the directory in which they are installed (and from
4337 which they are presumably copied to the former directory by occult means).
4340 case "$installbin" in
4341 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4342 *) dflt="$installbin";;
4345 rp='Where will public executables be installed?'
4349 installbin="$binexp"
4352 : define a shorthand compile call
4356 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4357 : define a shorthand compile call for compilations that should be ok.
4361 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4364 echo "Checking for GNU C Library..." >&4
4365 cat >gnulibc.c <<EOM
4378 if eval $compile_ok && ./gnulibc; then
4380 echo "You are using the GNU C Library"
4383 echo "You are not using the GNU C Library"
4389 : see if nm is to be used to determine whether a symbol is defined or not
4393 case "$d_gnulibc" in
4396 echo "nm probably won't work on the GNU C Library." >&4
4402 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4404 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4405 echo "'nm' won't be sufficient on this sytem." >&4
4411 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4412 if $test $dflt -gt 20; then
4422 true|$define) dflt=y;;
4429 I can use $nm to extract the symbols from your C libraries. This
4430 is a time consuming task which may generate huge output on the disk (up
4431 to 3 megabytes) but that should make the symbols extraction faster. The
4432 alternative is to skip the 'nm' extraction part and to compile a small
4433 test program instead to determine whether each symbol is present. If
4434 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4435 this may be the best solution.
4437 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4440 rp="Shall I use $nm to extract C symbols from the libraries?"
4443 [Nn]*) usenm=false;;
4452 : nm options which may be necessary
4454 '') if $test -f /mach_boot; then
4456 elif $test -d /usr/ccs/lib; then
4457 nm_opt='-p' # Solaris (and SunOS?)
4458 elif $test -f /dgux; then
4460 elif $test -f /lib64/rld; then
4461 nm_opt='-p' # 64-bit Irix
4467 : nm options which may be necessary for shared libraries but illegal
4468 : for archive libraries. Thank you, Linux.
4469 case "$nm_so_opt" in
4470 '') case "$myuname" in
4472 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4473 nm_so_opt='--dynamic'
4482 : get list of predefined functions in a handy place
4487 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4494 *) for thislib in $libs; do
4497 : Handle C library specially below.
4500 thislib=`echo $thislib | $sed -e 's/^-l//'`
4501 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4503 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4505 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4507 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4509 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4511 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4513 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4518 libnames="$libnames $try"
4520 *) libnames="$libnames $thislib" ;;
4529 for xxx in $libpth; do
4530 $test -r $1 || set $xxx/libc.$so
4531 : The messy sed command sorts on library version numbers.
4533 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4534 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4536 s/[0-9][0-9]*/0000&/g
4537 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4540 sort | $sed -e 's/^.* //'`
4543 $test -r $1 || set /usr/ccs/lib/libc.$so
4544 $test -r $1 || set /lib/libsys_s$_a
4550 if $test -r "$1"; then
4551 echo "Your (shared) C library seems to be in $1."
4553 elif $test -r /lib/libc && $test -r /lib/clib; then
4554 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4556 libc='/lib/clib /lib/libc'
4557 if $test -r /lib/syslib; then
4558 echo "(Your math library is in /lib/syslib.)"
4559 libc="$libc /lib/syslib"
4561 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4562 echo "Your C library seems to be in $libc, as you said before."
4563 elif $test -r $incpath/usr/lib/libc$_a; then
4564 libc=$incpath/usr/lib/libc$_a;
4565 echo "Your C library seems to be in $libc. That's fine."
4566 elif $test -r /lib/libc$_a; then
4568 echo "Your C library seems to be in $libc. You're normal."
4570 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4572 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4573 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4574 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4576 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4578 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4581 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4583 if $test -r "$tans"; then
4584 echo "Your C library seems to be in $tans, of all places."
4590 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4594 If the guess above is wrong (which it might be if you're using a strange
4595 compiler, or your machine supports multiple models), you can override it here.
4600 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4602 I can't seem to find your C library. I've looked in the following places:
4605 $sed 's/^/ /' libpath
4608 None of these seems to contain your C library. I need to get its name...
4613 rp='Where is your C library?'
4618 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4619 set X `cat libnames`
4622 case $# in 1) xxx=file; esac
4623 echo "Extracting names from the following $xxx for later perusal:" >&4
4625 $sed 's/^/ /' libnames >&4
4627 $echo $n "This may take a while...$c" >&4
4631 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4632 *) $nm $nm_opt $file 2>/dev/null;;
4637 $grep fprintf libc.tmp > libc.ptf
4638 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4639 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4641 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4643 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4645 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4649 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4653 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4657 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4661 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4665 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4666 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4670 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4672 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4674 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4678 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4682 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4686 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4690 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4695 $nm -p $* 2>/dev/null >libc.tmp
4696 $grep fprintf libc.tmp > libc.ptf
4697 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4698 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4704 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4706 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4707 for thisname in $libnames $libc; do
4708 $ar t $thisname >>libc.tmp
4710 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4712 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4713 # Repeat libc to extract forwarders to DLL entries too
4714 for thisname in $libnames $libc; do
4715 $ar tv $thisname >>libc.tmp
4716 # Revision 50 of EMX has bug in $ar.
4717 # it will not extract forwarders to DLL entries
4718 # Use emximp which will extract exactly them.
4719 emximp -o tmp.imp $thisname \
4721 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4722 < tmp.imp >>libc.tmp
4725 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4728 echo "$ar didn't seem to work right." >&4
4729 echo "Maybe this is a Cray...trying bld instead..." >&4
4730 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4732 for thisname in $libnames; do
4734 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4735 $ar t $thisname >>libc.tmp
4739 echo "That didn't work either. Giving up." >&4
4746 if $test -f /lib/syscalls.exp; then
4748 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4749 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4753 $rm -f libnames libpath
4755 : see if dld is available
4759 : is a C symbol defined?
4762 -v) tf=libc.tmp; tc=""; tdc="";;
4763 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4764 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4767 case "$reuseval-$4" in
4769 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4775 if $contains $tlook $tf >/dev/null 2>&1;
4780 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4781 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4789 $define) tval=true;;
4795 : define an is-in-libc? function
4796 inlibc='echo " "; td=$define; tu=$undef;
4797 sym=$1; var=$2; eval "was=\$$2";
4799 case "$reuseval$was" in
4809 echo "$sym() found." >&4;
4810 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4812 echo "$sym() NOT found." >&4;
4813 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4817 $define) echo "$sym() found." >&4;;
4818 *) echo "$sym() NOT found." >&4;;
4822 : see if dlopen exists
4829 : determine which dynamic loading, if any, to compile in
4831 dldir="ext/DynaLoader"
4844 $define) dflt='y' ;;
4847 $define) dflt='y' ;;
4849 : Does a dl_xxx.xs file exist for this operating system
4850 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
4853 rp="Do you wish to use dynamic loading?"
4860 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
4861 dflt="$dldir/dl_${osname}.xs"
4862 elif $test "$d_dlopen" = "$define" ; then
4863 dflt="$dldir/dl_dlopen.xs"
4864 elif $test "$i_dld" = "$define" ; then
4865 dflt="$dldir/dl_dld.xs"
4870 *) dflt="$dldir/$dlsrc"
4873 echo "The following dynamic loading files are available:"
4874 : Can not go over to $dldir because getfile has path hard-coded in.
4875 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
4876 rp="Source file to use for dynamic loading"
4878 # XXX This getfile call will fail the existence check if you try
4879 # building away from $src (this is not supported yet).
4883 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4887 Some systems may require passing special flags to $cc -c to
4888 compile modules that will be used to create a shared library.
4889 To use no flags, say "none".
4892 case "$cccdlflags" in
4893 '') case "$gccversion" in
4894 '') case "$osname" in
4896 next) dflt='none' ;;
4897 irix*) dflt='-KPIC' ;;
4898 svr4*|esix*|solaris) dflt='-KPIC' ;;
4899 sunos) dflt='-pic' ;;
4903 *) case "$osname" in
4904 svr4*|esix*|solaris) dflt='-fPIC' ;;
4909 *) dflt="$cccdlflags" ;;
4911 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4914 none) cccdlflags=' ' ;;
4915 *) cccdlflags="$ans" ;;
4920 Some systems use ld to create libraries that can be dynamically loaded,
4921 while other systems (such as those using ELF) use $cc.
4925 '') $cat >try.c <<'EOM'
4926 /* Test for whether ELF binaries are produced */
4931 int i = open("a.out",O_RDONLY);
4934 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
4935 exit(0); /* succeed (yes, it's ELF) */
4940 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
4942 You appear to have ELF support. I'll use $cc to build dynamic libraries.
4946 echo "I'll use ld to build dynamic libraries."
4955 rp="What command should be used to create dynamic libraries?"
4961 Some systems may require passing special flags to $ld to create a
4962 library that can be dynamically loaded. If your ld flags include
4963 -L/other/path options to locate libraries outside your loader's normal
4964 search path, you may need to specify those -L options here as well. To
4965 use no flags, say "none".
4968 case "$lddlflags" in
4969 '') case "$osname" in
4971 linux|irix*) dflt='-shared' ;;
4972 next) dflt='none' ;;
4973 solaris) dflt='-G' ;;
4974 sunos) dflt='-assert nodefinitions' ;;
4975 svr4*|esix*) dflt="-G $ldflags" ;;
4979 *) dflt="$lddlflags" ;;
4982 : Try to guess additional flags to pick up local libraries.
4983 for thisflag in $ldflags; do
4988 *) dflt="$dflt $thisflag" ;;
4995 ''|' ') dflt='none' ;;
4998 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5001 none) lddlflags=' ' ;;
5002 *) lddlflags="$ans" ;;
5007 Some systems may require passing special flags to $cc to indicate that
5008 the resulting executable will use dynamic linking. To use no flags,
5012 case "$ccdlflags" in
5013 '') case "$osname" in
5014 hpux) dflt='-Wl,-E' ;;
5015 linux) dflt='-rdynamic' ;;
5016 next) dflt='none' ;;
5017 sunos) dflt='none' ;;
5021 *) dflt="$ccdlflags" ;;
5023 rp="Any special flags to pass to $cc to use dynamic loading?"
5026 none) ccdlflags=' ' ;;
5027 *) ccdlflags="$ans" ;;
5041 # No dynamic loading being used, so don't bother even to prompt.
5044 *) case "$useshrplib" in
5045 '') case "$osname" in
5046 svr4*|dgux|dynixptx|esix|powerux)
5048 also='Building a shared libperl is required for dynamic loading to work on your system.'
5053 also='Building a shared libperl is needed for MAB support.'
5071 The perl executable is normally obtained by linking perlmain.c with
5072 libperl${_a}, any static extensions (usually just DynaLoader), and
5073 any other libraries needed on this system (such as -lm, etc.). Since
5074 your system supports dynamic loading, it is probably possible to build
5075 a shared libperl.$so. If you will have more than one executable linked
5076 to libperl.$so, this will significantly reduce the size of each
5077 executable, but it may have a noticeable affect on performance. The
5078 default is probably sensible for your system.
5082 rp="Build a shared libperl.$so (y/n)"
5087 # Why does next4 have to be so different?
5088 case "${osname}${osvers}" in
5089 next4*) xxx='DYLD_LIBRARY_PATH' ;;
5090 os2*) xxx='' ;; # Nothing special needed.
5091 *) xxx='LD_LIBRARY_PATH' ;;
5093 if test X"$xxx" != "X"; then
5094 $cat <<EOM | $tee -a ../config.msg >&4
5096 To build perl, you must add the current working directory to your
5097 $xxx environment variable before running make. You can do
5099 $xxx=\`pwd\`; export $xxx
5100 for Bourne-style shells, or
5102 for Csh-style shells. You *MUST* do this before running make.
5107 *) useshrplib='false' ;;
5112 case "$useshrplib" in
5116 # Figure out a good name for libperl.so. Since it gets stored in
5117 # a version-specific architecture-dependent library, the version
5118 # number isn't really that important, except for making cc/ld happy.
5120 # A name such as libperl.so.3.1
5121 majmin="libperl.$so.$patchlevel.$subversion"
5122 # A name such as libperl.so.301
5123 majonly=`echo $patchlevel $subversion |
5124 $awk '{printf "%d%02d", $1, $2}'`
5125 majonly=libperl.$so.$majonly
5126 # I'd prefer to keep the os-specific stuff here to a minimum, and
5127 # rely on figuring it out from the naming of libc.
5128 case "${osname}${osvers}" in
5131 # XXX How handle the --version stuff for MAB?
5133 linux*) # ld won't link with a bare -lperl otherwise.
5136 *) # Try to guess based on whether libc has major.minor.
5138 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5139 *libc.$so.[0-9]*) dflt=$majonly ;;
5140 *) dflt=libperl.$so ;;
5150 I need to select a good name for the shared libperl. If your system uses
5151 library names with major and minor numbers, then you might want something
5152 like $majmin. Alternatively, if your system uses a single version
5153 number for shared libraries, then you might want to use $majonly.
5154 Or, your system might be quite happy with a simple libperl.$so.
5156 Since the shared libperl will get installed into a version-specific
5157 architecture-dependent directory, the version number of the shared perl
5158 library probably isn't important, so the default should be o.k.
5161 rp='What name do you want to give to the shared libperl?'
5164 echo "Ok, I'll use $libperl"
5167 libperl="libperl${_a}"
5171 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5175 WARNING: Use of the shrpdir variable for the installation location of
5176 the shared $libperl is not supported. It was never documented and
5177 will not work in this version. Let me (jhi@iki.fi)
5178 know of any problems this may cause.
5184 But your current setting of $shrpdir is
5185 the default anyway, so it's harmless.
5190 Further, your current attempted setting of $shrpdir
5191 conflicts with the value of $archlibexp/CORE
5192 that installperl will use.
5199 # How will the perl executable find the installed shared $libperl?
5200 # Add $xxx to ccdlflags.
5201 # If we can't figure out a command-line option, use $shrpenv to
5202 # set env LD_RUN_PATH. The main perl makefile uses this.
5203 shrpdir=$archlibexp/CORE
5206 if "$useshrplib"; then
5209 # We'll set it in Makefile.SH...
5215 xxx="-Wl,-R$shrpdir"
5217 linux|irix*|dec_osf)
5218 xxx="-Wl,-rpath,$shrpdir"
5221 # next doesn't like the default...
5224 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5230 # Only add $xxx if it isn't already in ccdlflags.
5231 case " $ccdlflags " in
5233 *) ccdlflags="$ccdlflags $xxx"
5236 Adding $xxx to the flags
5237 passed to $ld so that the perl executable will find the
5238 installed shared $libperl.
5246 # Respect a hint or command-line value.
5248 '') shrpenv="$tmp_shrpenv" ;;
5251 : determine where manual pages go
5252 set man1dir man1dir none
5256 $spackage has manual pages available in source form.
5260 echo "However, you don't have nroff, so they're probably useless to you."
5262 '') man1dir="none";;
5265 echo "If you don't want the manual sources installed, answer 'none'."
5270 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5271 lookpath="$lookpath $prefixexp/man/p_man/man1"
5272 lookpath="$lookpath $prefixexp/man/u_man/man1"
5273 lookpath="$lookpath $prefixexp/man/man.1"
5275 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5276 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5286 rp="Where do the main $spackage manual pages (source) go?"
5288 if $test "X$man1direxp" != "X$ansexp"; then
5292 man1direxp="$ansexp"
5300 Since you are running AFS, I need to distinguish the directory in which
5301 manual pages reside from the directory in which they are installed (and from
5302 which they are presumably copied to the former directory by occult means).
5305 case "$installman1dir" in
5306 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5307 *) dflt="$installman1dir";;
5310 rp='Where will man pages be installed?'
5312 installman1dir="$ans"
5314 installman1dir="$man1direxp"
5317 : What suffix to use on installed man pages
5324 rp="What suffix should be used for the main $spackage man pages?"
5326 '') case "$man1dir" in
5340 *) dflt="$man1ext";;
5347 : see if we can have long filenames
5349 rmlist="$rmlist /tmp/cf$$"
5350 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5351 first=123456789abcdef
5352 second=/tmp/cf$$/$first
5353 $rm -f $first $second
5354 if (echo hi >$first) 2>/dev/null; then
5355 if $test -f 123456789abcde; then
5356 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5359 if (echo hi >$second) 2>/dev/null; then
5360 if $test -f /tmp/cf$$/123456789abcde; then
5362 That's peculiar... You can have filenames longer than 14 characters, but only
5363 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5364 I shall consider your system cannot support long filenames at all.
5368 echo 'You can have filenames longer than 14 characters.' >&4
5373 How confusing! Some of your filesystems are sane enough to allow filenames
5374 longer than 14 characters but some others like /tmp can't even think about them.
5375 So, for now on, I shall assume your kernel does not allow them at all.
5382 You can't have filenames longer than 14 chars. You can't even think about them!
5388 $rm -rf /tmp/cf$$ 123456789abcde*
5390 : determine where library module manual pages go
5391 set man3dir man3dir none
5395 $spackage has manual pages for many of the library modules.
5401 However, you don't have nroff, so they're probably useless to you.
5404 '') man3dir="none";;
5408 case "$d_flexfnam" in
5411 However, your system can't handle the long file names like File::Basename.3.
5414 '') man3dir="none";;
5418 echo "If you don't want the manual sources installed, answer 'none'."
5419 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5421 '') case "$prefix" in
5422 *$prog*) dflt=`echo $man1dir |
5423 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5424 *) dflt="$privlib/man/man3" ;;
5428 *) dflt="$man3dir" ;;
5433 rp="Where do the $package library man pages (source) go?"
5435 if test "X$man3direxp" != "X$ansexp"; then
5440 man3direxp="$ansexp"
5448 Since you are running AFS, I need to distinguish the directory in which
5449 manual pages reside from the directory in which they are installed (and from
5450 which they are presumably copied to the former directory by occult means).
5453 case "$installman3dir" in
5454 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5455 *) dflt="$installman3dir";;
5458 rp='Where will man pages be installed?'
5460 installman3dir="$ans"
5462 installman3dir="$man3direxp"
5465 : What suffix to use on installed man pages
5472 rp="What suffix should be used for the $package library man pages?"
5474 '') case "$man3dir" in
5488 *) dflt="$man3ext";;
5495 : see if we have to deal with yellow pages, now NIS.
5496 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5497 if $test -f /usr/etc/nibindd; then
5499 echo "I'm fairly confident you're on a NeXT."
5501 rp='Do you get the hosts file via NetInfo?'
5510 y*) hostcat='nidump hosts .';;
5511 *) case "$hostcat" in
5512 nidump*) hostcat='';;
5522 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5530 rp='Are you getting the hosts file via yellow pages?'
5533 y*) hostcat='ypcat hosts';;
5534 *) hostcat='cat /etc/hosts';;
5540 '') hostcat='cat /etc/hosts';;
5543 '') groupcat='cat /etc/group';;
5546 '') passcat='cat /etc/passwd';;
5549 : now get the host name
5551 echo "Figuring out host name..." >&4
5552 case "$myhostname" in
5554 echo 'Maybe "hostname" will work...'
5555 if tans=`sh -c hostname 2>&1` ; then
5563 if $test "$cont"; then
5565 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5566 if tans=`cat /etc/systemid 2>&1` ; then
5568 phostname='cat /etc/systemid'
5569 echo "Whadyaknow. Xenix always was a bit strange..."
5572 elif $test -r /etc/systemid; then
5573 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5576 if $test "$cont"; then
5577 echo 'No, maybe "uuname -l" will work...'
5578 if tans=`sh -c 'uuname -l' 2>&1` ; then
5580 phostname='uuname -l'
5582 echo 'Strange. Maybe "uname -n" will work...'
5583 if tans=`sh -c 'uname -n' 2>&1` ; then
5585 phostname='uname -n'
5587 echo 'Oh well, maybe I can mine it out of whoami.h...'
5588 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5589 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5590 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5592 case "$myhostname" in
5593 '') echo "Does this machine have an identity crisis or something?"
5596 echo "Well, you said $myhostname before..."
5597 phostname='echo $myhostname';;
5603 : you do not want to know about this
5608 if $test "$myhostname" ; then
5610 rp='Your host name appears to be "'$myhostname'".'" Right?"
5618 : bad guess or no guess
5619 while $test "X$myhostname" = X ; do
5621 rp="Please type the (one word) name of your host:"
5626 : translate upper to lower if necessary
5627 case "$myhostname" in
5629 echo "(Normalizing case in your host name)"
5630 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5634 case "$myhostname" in
5636 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5637 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5638 echo "(Trimming domain name from host name--host name is now $myhostname)"
5640 *) case "$mydomain" in
5643 test "X$hostcat" = "Xypcat hosts" &&
5644 ypmatch "$myhostname" hosts 2>/dev/null |\
5645 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5648 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5649 /[ ]$myhostname[ . ]/p" > hosts
5652 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5653 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5654 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5655 hosts | $sort | $uniq | \
5656 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5657 case `$echo X$dflt` in
5658 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5661 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5666 tans=`./loc resolv.conf X /etc /usr/etc`
5667 if $test -f "$tans"; then
5668 echo "(Attempting domain name extraction from $tans)"
5669 dflt=.`$sed -n -e 's/ / /g' \
5670 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5671 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5673 .) dflt=.`$sed -n -e 's/ / /g' \
5674 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5675 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5682 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5683 dflt=.`sh -c domainname 2>/dev/null`
5686 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5691 .) echo "(Lost all hope -- silly guess then)"
5697 *) dflt="$mydomain";;
5701 rp="What is your domain name?"
5711 : translate upper to lower if necessary
5714 echo "(Normalizing case in your domain name)"
5715 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5719 : a little sanity check here
5720 case "$phostname" in
5723 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5724 $myhostname$mydomain|$myhostname) ;;
5726 case "$phostname" in
5728 echo "(That doesn't agree with your whoami.h file, by the way.)"
5731 echo "(That doesn't agree with your $phostname command, by the way.)"
5741 I need to get your e-mail address in Internet format if possible, i.e.
5742 something like user@host.domain. Please answer accurately since I have
5743 no easy means to double check it. The default value provided below
5744 is most probably close to the reality but may not be valid from outside
5745 your organization...
5749 while test "$cont"; do
5751 '') dflt="$cf_by@$myhostname$mydomain";;
5752 *) dflt="$cf_email";;
5754 rp='What is your e-mail address?'
5760 rp='Address does not look like an Internet one. Use it anyway?'
5776 If you or somebody else will be maintaining perl at your site, please
5777 fill in the correct e-mail address here so that they may be contacted
5778 if necessary. Currently, the "perlbug" program included with perl
5779 will send mail to this address in addition to perlbug@perl.com. You may
5780 enter "none" for no administrator.
5783 case "$perladmin" in
5784 '') dflt="$cf_email";;
5785 *) dflt="$perladmin";;
5787 rp='Perl administrator e-mail address'
5791 : figure out how to guarantee perl startup
5792 case "$startperl" in
5794 case "$sharpbang" in
5798 I can use the #! construct to start perl on your system. This will
5799 make startup of perl scripts faster, but may cause problems if you
5800 want to share those scripts and perl is not in a standard place
5801 ($binexp/perl) on all your platforms. The alternative is to force
5802 a shell by starting the script with a single ':' character.
5806 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
5809 none) startperl=": # use perl";;
5810 *) startperl="#!$ans"
5811 if $test 30 -lt `echo "$ans" | wc -c`; then
5814 WARNING: Some systems limit the #! command to 32 characters.
5815 If you experience difficulty running Perl scripts with #!, try
5816 installing Perl in a directory with a shorter pathname.
5822 *) startperl=": # use perl"
5827 echo "I'll use $startperl to start perl scripts."
5829 : figure best path for perl in scripts
5832 perlpath="$binexp/perl"
5833 case "$startperl" in
5838 I will use the "eval 'exec'" idiom to start Perl on your system.
5839 I can use the full path of your Perl binary for this purpose, but
5840 doing so may cause problems if you want to share those scripts and
5841 Perl is not always in a standard place ($binexp/perl).
5845 rp="What path shall I use in \"eval 'exec'\"?"
5852 case "$startperl" in
5854 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
5857 : determine where public executable scripts go
5858 set scriptdir scriptdir
5860 case "$scriptdir" in
5863 : guess some guesses
5864 $test -d /usr/share/scripts && dflt=/usr/share/scripts
5865 $test -d /usr/share/bin && dflt=/usr/share/bin
5866 $test -d /usr/local/script && dflt=/usr/local/script
5867 $test -d $prefixexp/script && dflt=$prefixexp/script
5871 *) dflt="$scriptdir"
5876 Some installations have a separate directory just for executable scripts so
5877 that they can mount it across multiple architectures but keep the scripts in
5878 one spot. You might, for example, have a subdirectory of /usr/share for this.
5879 Or you might just lump your scripts in with all your other executables.
5883 rp='Where do you keep publicly executable scripts?'
5885 if $test "X$ansexp" != "X$scriptdirexp"; then
5889 scriptdirexp="$ansexp"
5893 Since you are running AFS, I need to distinguish the directory in which
5894 scripts reside from the directory in which they are installed (and from
5895 which they are presumably copied to the former directory by occult means).
5898 case "$installscript" in
5899 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
5900 *) dflt="$installscript";;
5903 rp='Where will public scripts be installed?'
5905 installscript="$ans"
5907 installscript="$scriptdirexp"
5910 : determine where site specific libraries go.
5911 : Usual default is /usr/local/lib/perl5/site_perl/$apiversion
5912 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5914 *perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
5915 *) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
5920 The installation process will also create a directory for
5921 site-specific extensions and modules. Some users find it convenient
5922 to place all local files in this directory rather than in the main
5923 distribution directory.
5927 rp='Pathname for the site-specific library files?'
5929 if $test "X$sitelibexp" != "X$ansexp"; then
5933 sitelibexp="$ansexp"
5937 Since you are running AFS, I need to distinguish the directory in
5938 which site-specific files reside from the directory in which they are
5939 installed (and from which they are presumably copied to the former
5940 directory by occult means).
5943 case "$installsitelib" in
5944 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
5945 *) dflt="$installsitelib";;
5948 rp='Where will site-specific files be installed?'
5950 installsitelib="$ans"
5952 installsitelib="$sitelibexp"
5955 : determine where site specific architecture-dependent libraries go.
5956 : sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
5957 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
5958 : sitelib may have an optional trailing /share.
5959 tdflt=`echo $sitelib | $sed 's,/share$,,'`
5960 tdflt="$tdflt/$archname"
5961 set sitearch sitearch none
5964 '') dflt="$tdflt" ;;
5965 *) dflt="$sitearch" ;;
5969 The installation process will also create a directory for
5970 architecture-dependent site-specific extensions and modules.
5974 rp='Pathname for the site-specific architecture-dependent library files?'
5976 if $test "X$sitearchexp" != "X$ansexp"; then
5980 sitearchexp="$ansexp"
5984 Since you are running AFS, I need to distinguish the directory in
5985 which site-specific architecture-dependent library files reside from
5986 the directory in which they are installed (and from which they are
5987 presumably copied to the former directory by occult means).
5990 case "$installsitearch" in
5991 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
5992 *) dflt="$installsitearch";;
5995 rp='Where will site-specific architecture-dependent files be installed?'
5997 installsitearch="$ans"
5999 installsitearch="$sitearchexp"
6004 Perl can be built to take advantage of 64-bit interfaces, on some systems.
6005 To do so, Configure must be run with -Dusethreads.
6007 If this doesn't make any sense to you, just accept the default 'n'.
6009 case "$use64bits" in
6010 $define|true|[yY]*) dflt='y';;
6013 rp='Try to use 64-bit APIs, if available?'
6028 Previous version of $package used the standard IO mechanisms as defined
6029 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6030 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6031 the default. This abstraction layer can use AT&T's sfio (if you already
6032 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6033 problems with some extension modules. Using PerlIO with stdio is safe,
6034 but it is slower than plain stdio and therefore is not the default.
6036 If this doesn't make any sense to you, just accept the default 'n'.
6038 case "$useperlio" in
6039 $define|true|[yY]*) dflt='y';;
6042 rp='Use the experimental PerlIO abstraction layer?'
6049 echo "Ok, doing things the stdio way"
6056 : Check how to convert floats to strings.
6057 if test "X$d_Gconvert" = X; then
6059 echo "Checking for an efficient way to convert floats to strings."
6062 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6063 char *myname = "gconvert";
6066 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6067 char *myname = "gcvt";
6070 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6071 char *myname = "sprintf";
6077 checkit(expect, got)
6081 if (strcmp(expect, got)) {
6082 printf("%s oddity: Expected %s, got %s\n",
6083 myname, expect, got);
6094 /* This must be 1st test on (which?) platform */
6095 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6096 Gconvert(0.1, 8, 0, buf);
6097 checkit("0.1", buf);
6099 Gconvert(1.0, 8, 0, buf);
6102 Gconvert(0.0, 8, 0, buf);
6105 Gconvert(-1.0, 8, 0, buf);
6108 /* Some Linux gcvt's give 1.e+5 here. */
6109 Gconvert(100000.0, 8, 0, buf);
6110 checkit("100000", buf);
6112 /* Some Linux gcvt's give -1.e+5 here. */
6113 Gconvert(-100000.0, 8, 0, buf);
6114 checkit("-100000", buf);
6119 case "$d_Gconvert" in
6120 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6121 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6122 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6123 *) xxx_list='gconvert gcvt sprintf' ;;
6126 for xxx_convert in $xxx_list; do
6127 echo "Trying $xxx_convert"
6129 set try -DTRY_$xxx_convert
6130 if eval $compile; then
6131 echo "$xxx_convert" found. >&4
6133 echo "I'll use $xxx_convert to convert floats into a string." >&4
6136 echo "...But $xxx_convert didn't work as I expected."
6139 echo "$xxx_convert NOT found." >&4
6143 case "$xxx_convert" in
6144 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6145 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6146 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6150 : Initialize h_fcntl
6153 : Initialize h_sysfile
6156 : access call always available on UNIX
6160 : locate the flags for 'access()'
6164 $cat >access.c <<'EOCP'
6165 #include <sys/types.h>
6170 #include <sys/file.h>
6179 : check sys/file.h first, no particular reason here
6180 if $test `./findhdr sys/file.h` && \
6181 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
6183 echo "<sys/file.h> defines the *_OK access constants." >&4
6184 elif $test `./findhdr fcntl.h` && \
6185 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
6187 echo "<fcntl.h> defines the *_OK access constants." >&4
6188 elif $test `./findhdr unistd.h` && \
6189 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
6190 echo "<unistd.h> defines the *_OK access constants." >&4
6192 echo "I can't find the four *_OK access constants--I'll use mine." >&4
6198 : see if accessx exists
6199 set accessx d_accessx
6202 : see if alarm exists
6206 : Look for GNU-cc style attribute checking
6208 echo "Checking whether your compiler can handle __attribute__ ..." >&4
6209 $cat >attrib.c <<'EOCP'
6211 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
6213 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
6214 if $contains 'warning' attrib.out >/dev/null 2>&1; then
6215 echo "Your C compiler doesn't fully support __attribute__."
6218 echo "Your C compiler supports __attribute__."
6222 echo "Your C compiler doesn't seem to understand __attribute__ at all."
6229 : see if bcmp exists
6233 : see if bcopy exists
6237 : see if this is a unistd.h system
6238 set unistd.h i_unistd
6241 : see if getpgrp exists
6242 set getpgrp d_getpgrp
6245 case "$d_getpgrp" in
6248 echo "Checking to see which flavor of getpgrp is in use..."
6251 #include <sys/types.h>
6253 # include <unistd.h>
6257 if (getuid() == 0) {
6258 printf("(I see you are running Configure as super-user...)\n");
6262 if (getpgrp(1) == 0)
6271 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6272 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6274 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6275 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6278 echo "I can't seem to compile and run the test program."
6280 xxx="a USG one, i.e. you use getpgrp()."
6282 # SVR4 systems can appear rather BSD-ish.
6285 xxx="a BSD one, i.e. you use getpgrp(pid)."
6289 xxx="probably a USG one, i.e. you use getpgrp()."
6294 echo "Assuming your getpgrp is $xxx" >&4
6303 : see if setpgrp exists
6304 set setpgrp d_setpgrp
6307 case "$d_setpgrp" in
6310 echo "Checking to see which flavor of setpgrp is in use..."
6313 #include <sys/types.h>
6315 # include <unistd.h>
6319 if (getuid() == 0) {
6320 printf("(I see you are running Configure as super-user...)\n");
6324 if (-1 == setpgrp(1, 1))
6327 if (setpgrp() != -1)
6333 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6334 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6336 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6337 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6340 echo "(I can't seem to compile and run the test program.)"
6342 xxx="a USG one, i.e. you use setpgrp()."
6344 # SVR4 systems can appear rather BSD-ish.
6347 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6351 xxx="probably a USG one, i.e. you use setpgrp()."
6356 echo "Assuming your setpgrp is $xxx" >&4
6364 : see if bzero exists
6368 : check for lengths of integral types
6372 echo "Checking to see how big your integers are..." >&4
6373 $cat >intsize.c <<'EOCP'
6377 printf("intsize=%d;\n", sizeof(int));
6378 printf("longsize=%d;\n", sizeof(long));
6379 printf("shortsize=%d;\n", sizeof(short));
6384 if eval $compile_ok && ./intsize > /dev/null; then
6386 echo "Your integers are $intsize bytes long."
6387 echo "Your long integers are $longsize bytes long."
6388 echo "Your short integers are $shortsize bytes long."
6392 Help! I can't compile and run the intsize test program: please enlighten me!
6393 (This is probably a misconfiguration in your system or libraries, and
6394 you really ought to fix it. Still, I'll try anyway.)
6398 rp="What is the size of an integer (in bytes)?"
6402 rp="What is the size of a long integer (in bytes)?"
6406 rp="What is the size of a short integer (in bytes)?"
6412 $rm -f intsize intsize.*
6414 : see if signal is declared as pointer to function returning int or void
6416 xxx=`./findhdr signal.h`
6417 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6418 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6419 echo "You have int (*signal())() instead of void." >&4
6421 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6422 echo "You have void (*signal())()." >&4
6424 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6425 echo "You have int (*signal())() instead of void." >&4
6427 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6428 echo "You have void (*signal())()." >&4
6431 case "$d_voidsig" in
6433 echo "I can't determine whether signal handler returns void or int..." >&4
6435 rp="What type does your signal handler return?"
6442 echo "As you already told me, signal handler returns void." >&4
6445 *) echo "As you already told me, signal handler returns int." >&4
6452 case "$d_voidsig" in
6453 "$define") signal_t="void";;
6458 : check for ability to cast large floats to 32-bit ints.
6460 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6461 if $test "$intsize" -ge 4; then
6468 #include <sys/types.h>
6470 $signal_t blech(s) int s; { exit(3); }
6477 signal(SIGFPE, blech);
6479 /* Don't let compiler optimize the test away. Store the number
6480 in a writable string for gcc to pass to sscanf under HP/UX.
6482 sprintf(str, "2147483647");
6483 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6487 /* x86 processors will probably give 0x8000 0000, which is a
6488 sign change. We don't want that. We want to mimic SPARC
6489 behavior here, which is to preserve the sign and give
6492 if (i32 != ($xxx) f)
6498 if eval $compile_ok; then
6502 echo "(I can't seem to compile the test program--assuming it can't)"
6510 echo "Nope, it can't."
6517 : check for ability to cast negative floats to unsigned
6519 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6522 #include <sys/types.h>
6524 $signal_t blech(s) int s; { exit(7); }
6525 $signal_t blech_in_list(s) int s; { exit(4); }
6526 unsigned long dummy_long(p) unsigned long p; { return p; }
6527 unsigned int dummy_int(p) unsigned int p; { return p; }
6528 unsigned short dummy_short(p) unsigned short p; { return p; }
6532 unsigned long along;
6534 unsigned short ashort;
6538 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6539 a direct f = -123. assignment. gcc-2.8.0 reportedly
6540 optimized the whole file away
6542 /* Store the number in a writable string for gcc to pass to
6545 sprintf(str, "-123");
6546 sscanf(str, "%lf", &f); /* f = -123.; */
6548 signal(SIGFPE, blech);
6549 along = (unsigned long)f;
6550 aint = (unsigned int)f;
6551 ashort = (unsigned short)f;
6552 if (along != (unsigned long)-123)
6554 if (aint != (unsigned int)-123)
6556 if (ashort != (unsigned short)-123)
6558 sprintf(str, "1073741824.");
6559 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6562 along = (unsigned long)f;
6563 if (along != 0x80000000)
6567 along = (unsigned long)f;
6568 if (along != 0x7fffffff)
6572 along = (unsigned long)f;
6573 if (along != 0x80000001)
6577 signal(SIGFPE, blech_in_list);
6578 sprintf(str, "123.");
6579 sscanf(str, "%lf", &f); /* f = 123.; */
6580 along = dummy_long((unsigned long)f);
6581 aint = dummy_int((unsigned int)f);
6582 ashort = dummy_short((unsigned short)f);
6583 if (along != (unsigned long)123)
6585 if (aint != (unsigned int)123)
6587 if (ashort != (unsigned short)123)
6594 if eval $compile_ok; then
6598 echo "(I can't seem to compile the test program--assuming it can't)"
6601 case "$castflags" in
6606 echo "Nope, it can't."
6613 : see if vprintf exists
6615 if set vprintf val -f d_vprintf; eval $csym; $val; then
6616 echo 'vprintf() found.' >&4
6618 $cat >vprintf.c <<'EOF'
6619 #include <varargs.h>
6621 main() { xxx("foo"); }
6630 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6634 if eval $compile && ./vprintf; then
6635 echo "Your vsprintf() returns (int)." >&4
6638 echo "Your vsprintf() returns (char*)." >&4
6642 echo 'vprintf() NOT found.' >&4
6652 : see if chown exists
6656 : see if chroot exists
6660 : see if chsize exists
6664 : check for const keyword
6666 echo 'Checking to see if your C compiler knows about "const"...' >&4
6667 $cat >const.c <<'EOCP'
6668 typedef struct spug { int drokk; } spug;
6675 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
6677 echo "Yup, it does."
6680 echo "Nope, it doesn't."
6685 : see if crypt exists
6687 if set crypt val -f d_crypt; eval $csym; $val; then
6688 echo 'crypt() found.' >&4
6692 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
6693 if $test -z "$cryptlib"; then
6694 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
6698 if $test -z "$cryptlib"; then
6699 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
6703 if $test -z "$cryptlib"; then
6704 cryptlib=`./loc libcrypt$_a "" $libpth`
6708 if $test -z "$cryptlib"; then
6709 echo 'crypt() NOT found.' >&4
6718 : see if cuserid exists
6719 set cuserid d_cuserid
6722 : see if this is a limits.h system
6723 set limits.h i_limits
6726 : see if this is a float.h system
6730 : See if number of significant digits in a double precision number is known
6732 $cat >dbl_dig.c <<EOM
6742 printf("Contains DBL_DIG");
6745 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
6746 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
6747 echo "DBL_DIG found." >&4
6750 echo "DBL_DIG NOT found." >&4
6758 if $test X"$use64bits" = X"$define"; then
6759 : see if dbminit64 exists
6760 set dbminit64 d_dbminit64
6763 : see if dbmclose64 exists
6764 set dbmclose64 d_dbmclose64
6767 : see if fetch64 exists
6768 set fetch64 d_fetch64
6771 : see if store64 exists
6772 set store64 d_store64
6775 : see if delete64 exists
6776 set delete64 d_delete64
6779 : see if firstkey64 exists
6780 set firstkey64 d_firstkey64
6783 : see if nextkey64 exists
6784 set nextkey64 d_nextkey64
6788 for xxx in d_dbminit64 d_dbmclose64 d_fetch64 d_store64 d_delete64 d_firstkey64 d_nextkey64
6795 : see if difftime exists
6796 set difftime d_difftime
6799 : see if sys/stat.h is available
6800 set sys/stat.h i_sysstat
6803 : see if this is a dirent system
6805 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
6807 echo "<dirent.h> found." >&4
6810 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
6811 echo "<sys/dir.h> found." >&4
6814 xinc=`./findhdr sys/ndir.h`
6816 echo "<dirent.h> NOT found." >&4
6821 : Look for type of directory structure.
6823 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6825 case "$direntrytype" in
6828 $define) guess1='struct dirent' ;;
6829 *) guess1='struct direct' ;;
6832 *) guess1="$direntrytype"
6837 'struct dirent') guess2='struct direct' ;;
6838 *) guess2='struct dirent' ;;
6841 if $contains "$guess1" try.c >/dev/null 2>&1; then
6842 direntrytype="$guess1"
6843 echo "Your directory entries are $direntrytype." >&4
6844 elif $contains "$guess2" try.c >/dev/null 2>&1; then
6845 direntrytype="$guess2"
6846 echo "Your directory entries seem to be $direntrytype." >&4
6848 echo "I don't recognize your system's directory entries." >&4
6849 rp="What type is used for directory entries on this system?"
6857 : see if the directory entry stores field length
6859 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6860 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
6861 echo "Good, your directory entry keeps length information in d_namlen." >&4
6864 echo "Your directory entry does not know about the d_namlen field." >&4
6871 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
6872 while $test $# -ge 2; do
6874 $define) echo "#include <$2>";;
6878 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
6880 if eval $cc $optimize $ccflags -c try.c; then
6881 echo "Your struct $struct has field $field."; >&4
6884 echo "Your struct $struct does not have field $field."; >&4
6892 if $test X"$use64bits" = X"$define"; then
6893 : see if fstat64 exists
6894 set fstat64 d_fstat64
6897 : see if ftruncate64 exists
6898 set ftruncate64 d_ftruncate64
6901 : see if lockf64 exists
6902 set lockf64 d_lockf64
6905 : see if lseek64 exists
6906 set lseek64 d_lseek64
6909 : see if lstat64 exists
6910 set lstat64 d_lstat64
6913 : see if open64 exists
6917 : see if opendir64 exists
6918 set opendir64 d_opendir64
6921 : see if readdir64 exists
6922 set readdir64 d_readdir64
6925 : see if seekdir64 exists
6926 set seekdir64 d_seekdir64
6929 : see if stat64 exists
6933 : see if telldir64 exists
6934 set telldir64 d_telldir64
6937 : see if truncate64 exists
6938 set truncate64 d_truncate64
6943 echo $n "Checking to see if your system supports off64_t...$c" >&4
6945 #include <sys/types.h>
6946 off64_t foo() { off64_t x; x = 7; return x; }'
6948 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6950 echo " Yup, it does." >&4
6953 echo " Nope, it doesn't." >&4
6961 echo $n "Checking to see if your system supports ino64_t...$c" >&4
6963 case "$i_sysstat" in
6966 #include <sys/types.h>
6967 #include <sys/stat.h>
6968 ino64_t foo() { ino64_t x; x = 7; return x; }'
6970 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6976 if $test "X$val" = X"$define"; then
6977 echo " Yup, it does." >&4
6979 echo " Nope, it doesn't." >&4
6984 : check for struct flock64
6987 set d_flock64s flock64 l_len define fcntl.h
6991 : check for struct dirent64
6993 set d_dirent64s dirent64 d_off $i_dirent dirent.h
6997 for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64t d_ino64t d_flock64s d_dirent64s
7004 : see if dlerror exists
7007 set dlerror d_dlerror
7011 : see if dlfcn is available
7019 On a few systems, the dynamically loaded modules that perl generates and uses
7020 will need a different extension than shared libs. The default will probably
7028 rp='What is the extension of dynamically loaded modules'
7037 : Check if dlsym need a leading underscore
7043 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7044 $cat >dyna.c <<'EOM'
7053 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7055 #include <sys/types.h>
7069 int mode = RTLD_LAZY ;
7071 handle = dlopen("./dyna.$dlext", mode) ;
7072 if (handle == NULL) {
7077 symbol = dlsym(handle, "fred") ;
7078 if (symbol == NULL) {
7079 /* try putting a leading underscore */
7080 symbol = dlsym(handle, "_fred") ;
7081 if (symbol == NULL) {
7094 : Call the object file tmp-dyna.o in case dlext=o.
7095 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7096 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7097 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7098 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7101 1) echo "Test program failed using dlopen." >&4
7102 echo "Perhaps you should not use dynamic loading." >&4;;
7103 2) echo "Test program failed using dlsym." >&4
7104 echo "Perhaps you should not use dynamic loading." >&4;;
7105 3) echo "dlsym needs a leading underscore" >&4
7107 4) echo "dlsym doesn't need a leading underscore." >&4;;
7110 echo "I can't compile and run the test program." >&4
7115 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7120 : see if dup2 exists
7124 : see if eaccess exists
7125 set eaccess d_eaccess
7128 : see if endgrent exists
7129 set endgrent d_endgrent
7132 : see if endhostent exists
7133 set endhostent d_endhent
7136 : see if endnetent exists
7137 set endnetent d_endnent
7140 : see if endprotoent exists
7141 set endprotoent d_endpent
7144 : see if endpwent exists
7145 set endpwent d_endpwent
7148 : see if endservent exists
7149 set endservent d_endsent
7152 : Locate the flags for 'open()'
7154 $cat >open3.c <<'EOCP'
7155 #include <sys/types.h>
7160 #include <sys/file.h>
7171 : check sys/file.h first to get FREAD on Sun
7172 if $test `./findhdr sys/file.h` && \
7173 set open3 -DI_SYS_FILE && eval $compile; then
7175 echo "<sys/file.h> defines the O_* constants..." >&4
7177 echo "and you have the 3 argument form of open()." >&4
7180 echo "but not the 3 argument form of open(). Oh, well." >&4
7183 elif $test `./findhdr fcntl.h` && \
7184 set open3 -DI_FCNTL && eval $compile; then
7186 echo "<fcntl.h> defines the O_* constants..." >&4
7188 echo "and you have the 3 argument form of open()." >&4
7191 echo "but not the 3 argument form of open(). Oh, well." >&4
7196 echo "I can't find the O_* constant definitions! You got problems." >&4
7202 : check for non-blocking I/O stuff
7203 case "$h_sysfile" in
7204 true) echo "#include <sys/file.h>" > head.c;;
7207 true) echo "#include <fcntl.h>" > head.c;;
7208 *) echo "#include <sys/fcntl.h>" > head.c;;
7213 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7214 case "$o_nonblock" in
7217 $cat >>try.c <<'EOCP'
7220 printf("O_NONBLOCK\n");
7224 printf("O_NDELAY\n");
7228 printf("FNDELAY\n");
7235 if eval $compile_ok; then
7237 case "$o_nonblock" in
7238 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
7239 *) echo "Seems like we can use $o_nonblock.";;
7242 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
7245 *) echo "Using $hint value $o_nonblock.";;
7247 $rm -f try try.* .out core
7250 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7256 #include <sys/types.h>
7258 #define MY_O_NONBLOCK $o_nonblock
7259 #ifndef errno /* XXX need better Configure test */
7262 $signal_t blech(x) int x; { exit(3); }
7264 $cat >> try.c <<'EOCP'
7272 pipe(pd); /* Down: child -> parent */
7273 pipe(pu); /* Up: parent -> child */
7276 close(pd[1]); /* Parent reads from pd[0] */
7277 close(pu[0]); /* Parent writes (blocking) to pu[1] */
7278 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
7280 signal(SIGALRM, blech);
7282 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
7284 sprintf(string, "%d\n", ret);
7285 write(2, string, strlen(string));
7288 if (errno == EAGAIN) {
7294 if (errno == EWOULDBLOCK)
7295 printf("EWOULDBLOCK\n");
7298 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
7299 sleep(2); /* Give it time to close our pipe */
7301 ret = read(pd[0], buf, 1); /* Should read EOF */
7303 sprintf(string, "%d\n", ret);
7304 write(3, string, strlen(string));
7308 close(pd[0]); /* We write to pd[1] */
7309 close(pu[1]); /* We read from pu[0] */
7310 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
7311 close(pd[1]); /* Pipe pd is now fully closed! */
7312 exit(0); /* Bye bye, thank you for playing! */
7316 if eval $compile_ok; then
7317 echo "$startsh" >mtry
7318 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
7320 ./mtry >/dev/null 2>&1
7322 0) eagain=`$cat try.out`;;
7323 1) echo "Could not perform non-blocking setting!";;
7324 2) echo "I did a successful read() for something that was not there!";;
7325 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
7326 *) echo "Something terribly wrong happened during testing.";;
7328 rd_nodata=`$cat try.ret`
7329 echo "A read() system call with no data present returns $rd_nodata."
7330 case "$rd_nodata" in
7333 echo "(That's peculiar, fixing that to be -1.)"
7339 echo "Forcing errno EAGAIN on read() with no data available."
7343 echo "Your read() sets errno to $eagain when no data is available."
7346 status=`$cat try.err`
7348 0) echo "And it correctly returns 0 to signal EOF.";;
7349 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
7350 *) echo "However, your read() returns '$status' on EOF??";;
7353 if test "$status" = "$rd_nodata"; then
7354 echo "WARNING: you can't distinguish between EOF and no data!"
7358 echo "I can't compile the test program--assuming errno EAGAIN will do."
7365 echo "Using $hint value $eagain."
7366 echo "Your read() returns $rd_nodata when no data is present."
7367 case "$d_eofnblk" in
7368 "$define") echo "And you can see EOF because read() returns 0.";;
7369 "$undef") echo "But you can't see EOF status from read() returned value.";;
7371 echo "(Assuming you can't see EOF status from read anyway.)"
7377 $rm -f try try.* .out core head.c mtry
7379 : see if fchmod exists
7383 : see if fchown exists
7387 : see if this is an fcntl system
7391 : see if fgetpos exists
7392 set fgetpos d_fgetpos
7396 if $test X"$use64bits" = X"$define"; then
7397 : see if fgetpos64 exists
7398 set fgetpos64 d_fgetpos64
7401 : see if fopen64 exists
7402 set freopen64 d_fopen64
7405 : see if freopen64 exists
7406 set freopen64 d_freopen64
7409 : see if fseek64 exists
7410 set fseek64 d_fseek64
7413 : see if fseeko64 exists
7414 set fseeko64 d_fseeko64
7417 : see if fsetpos64 exists
7418 set fsetpos64 d_fsetpos64
7421 : see if ftell64 exists
7422 set ftell64 d_ftell64
7425 : see if ftello64 exists
7426 set ftello64 d_ftello64
7429 : see if tmpfile64 exists
7430 set tmpfile64 d_tmpfile64
7434 for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
7441 : see if flock exists
7445 : see if fork exists
7449 : see if pathconf exists
7450 set pathconf d_pathconf
7453 : see if fpathconf exists
7454 set fpathconf d_fpathconf
7457 : see if fseeko exists
7461 : see if fsetpos exists
7462 set fsetpos d_fsetpos
7465 : see if ftello exists
7469 : see if getgrent exists
7470 set getgrent d_getgrent
7473 : see if gethostbyaddr exists
7474 set gethostbyaddr d_gethbyaddr
7477 : see if gethostbyname exists
7478 set gethostbyname d_gethbyname
7481 : see if gethostent exists
7482 set gethostent d_gethent
7485 hasproto='varname=$1; func=$2; shift; shift;
7486 while $test $# -ge 2; do
7488 $define) echo "#include <$2>";;
7492 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7493 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7494 echo "$func() prototype found.";
7497 echo "$func() prototype NOT found.";
7502 $rm -f try.c tryout.c'
7504 : see if this is a netdb.h system
7508 : see if prototypes for various gethostxxx netdb.h functions are available
7510 set d_gethostprotos gethostent $i_netdb netdb.h
7513 : see if getlogin exists
7514 set getlogin d_getlogin
7517 : see if getnetbyaddr exists
7518 set getnetbyaddr d_getnbyaddr
7521 : see if getnetbyname exists
7522 set getnetbyname d_getnbyname
7525 : see if getnetent exists
7526 set getnetent d_getnent
7529 : see if prototypes for various getnetxxx netdb.h functions are available
7531 set d_getnetprotos getnetent $i_netdb netdb.h
7535 : see if getprotobyname exists
7536 set getprotobyname d_getpbyname
7539 : see if getprotobynumber exists
7540 set getprotobynumber d_getpbynumber
7543 : see if getprotoent exists
7544 set getprotoent d_getpent
7547 : see if getpgid exists
7548 set getpgid d_getpgid
7551 : see if getpgrp2 exists
7552 set getpgrp2 d_getpgrp2
7555 : see if getppid exists
7556 set getppid d_getppid
7559 : see if getpriority exists
7560 set getpriority d_getprior
7563 : see if prototypes for various getprotoxxx netdb.h functions are available
7565 set d_getprotoprotos getprotoent $i_netdb netdb.h
7568 : see if getpwent exists
7569 set getpwent d_getpwent
7573 : see if getservbyname exists
7574 set getservbyname d_getsbyname
7577 : see if getservbyport exists
7578 set getservbyport d_getsbyport
7581 : see if getservent exists
7582 set getservent d_getsent
7585 : see if prototypes for various getservxxx netdb.h functions are available
7587 set d_getservprotos getservent $i_netdb netdb.h
7590 : see if gettimeofday or ftime exists
7591 set gettimeofday d_gettimeod
7593 case "$d_gettimeod" in
7599 val="$undef"; set d_ftime; eval $setvar
7602 case "$d_gettimeod$d_ftime" in
7605 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
7609 : see if this is an grp system
7615 xxx=`./findhdr grp.h`
7616 $cppstdin $cppflags $cppminus < $xxx >$$.h
7618 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
7630 set d_grpasswd; eval $setvar
7634 : see if this is a netinet/in.h or sys/in.h system
7635 set netinet/in.h i_niin sys/in.h i_sysin
7638 : see if arpa/inet.h has to be included
7639 set arpa/inet.h i_arpainet
7642 : see if htonl --and friends-- exists
7647 : Maybe they are macros.
7652 #include <sys/types.h>
7653 #$i_niin I_NETINET_IN
7655 #$i_arpainet I_ARPA_INET
7657 #include <netinet/in.h>
7663 #include <arpa/inet.h>
7666 printf("Defined as a macro.");
7669 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
7670 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
7672 echo "But it seems to be defined as a macro." >&4
7680 : see which of string.h or strings.h is needed
7682 strings=`./findhdr string.h`
7683 if $test "$strings" && $test -r "$strings"; then
7684 echo "Using <string.h> instead of <strings.h>." >&4
7688 strings=`./findhdr strings.h`
7689 if $test "$strings" && $test -r "$strings"; then
7690 echo "Using <strings.h> instead of <string.h>." >&4
7692 echo "No string header found -- You'll surely have problems." >&4
7698 "$undef") strings=`./findhdr strings.h`;;
7699 *) strings=`./findhdr string.h`;;
7704 if set index val -f; eval $csym; $val; then
7705 if set strchr val -f d_strchr; eval $csym; $val; then
7706 if $contains strchr "$strings" >/dev/null 2>&1 ; then
7709 echo "strchr() found." >&4
7713 echo "index() found." >&4
7718 echo "index() found." >&4
7721 if set strchr val -f d_strchr; eval $csym; $val; then
7724 echo "strchr() found." >&4
7726 echo "No index() or strchr() found!" >&4
7731 set d_strchr; eval $setvar
7733 set d_index; eval $setvar
7735 : check whether inet_aton exists
7736 set inet_aton d_inetaton
7739 : see if inttypes.h is available
7740 set inttypes.h i_inttypes
7744 echo $n "Checking to see if your system supports int64_t...$c" >&4
7746 #include <sys/types.h>
7747 #$i_inttypes I_INTTYPES
7749 #include <inttypes.h>
7751 int64_t foo() { int64_t x; x = 7; return x; }'
7753 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7755 echo " Yup, it does." >&4
7758 echo " Nope, it doesn't." >&4
7767 $cat >isascii.c <<'EOCP'
7779 if eval $compile; then
7780 echo "isascii() found." >&4
7783 echo "isascii() NOT found." >&4
7790 : see if killpg exists
7794 : see if lchown exists
7796 $cat > try.c <<'EOCP'
7797 /* System header to define __stub macros and hopefully few prototypes,
7798 which can conflict with char lchown(); below. */
7800 /* Override any gcc2 internal prototype to avoid an error. */
7801 /* We use char because int might match the return type of a gcc2
7802 builtin and then its argument prototype would still apply. */
7805 /* The GNU C library defines this for functions which it implements
7806 to always fail with ENOSYS. Some functions are actually named
7807 something starting with __ and the normal name is an alias. */
7808 #if defined (__stub_lchown) || defined (__stub___lchown)
7816 if eval $compile; then
7817 $echo "lchown() found." >&4
7820 $echo "lchown() NOT found." >&4
7826 : see if link exists
7830 : see if localeconv exists
7831 set localeconv d_locconv
7834 : see if lockf exists
7838 : check for long doubles
7840 echo $n "Checking to see if your system supports long doubles...$c" >&4
7841 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7842 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7844 echo " Yup, it does." >&4
7847 echo " Nope, it doesn't." >&4
7853 : check for length of long double
7854 case "${d_longdbl}${longdblsize}" in
7857 $echo $n "Checking to see how big your long doubles are...$c" >&4
7858 $cat >try.c <<'EOCP'
7862 printf("%d\n", sizeof(long double));
7866 if eval $compile; then
7868 $echo " $longdblsize bytes." >&4
7872 echo "(I can't seem to compile the test program. Guessing...)" >&4
7873 rp="What is the size of a long double (in bytes)?"
7881 : check for long long
7883 echo $n "Checking to see if your system supports long long...$c" >&4
7884 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
7885 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7887 echo " Yup, it does." >&4
7890 echo " Nope, it doesn't." >&4
7896 : check for length of long long
7897 case "${d_longlong}${longlongsize}" in
7900 $echo $n "Checking to see how big your long longs are...$c" >&4
7901 $cat >try.c <<'EOCP'
7905 printf("%d\n", sizeof(long long));
7909 if eval $compile_ok; then
7910 longlongsize=`./try`
7911 $echo " $longlongsize bytes." >&4
7915 echo "(I can't seem to compile the test program. Guessing...)"
7916 rp="What is the size of a long long (in bytes)?"
7924 : see if lstat exists
7928 : see if mblen exists
7932 : see if mbstowcs exists
7933 set mbstowcs d_mbstowcs
7936 : see if mbtowc exists
7940 : see if memcmp exists
7944 : see if memcpy exists
7948 : see if memmove exists
7949 set memmove d_memmove
7952 : see if memset exists
7956 : see if mkdir exists
7960 : see if mkfifo exists
7964 : see if mktime exists
7968 : see if msgctl exists
7972 : see if msgget exists
7976 : see if msgsnd exists
7980 : see if msgrcv exists
7984 : see how much of the 'msg*(2)' library is present.
7987 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
7988 *"$undef"*) h_msg=false;;
7992 case "`ipcs 2>&1`" in
7993 "SVID messages"*"not configured"*)
7994 echo "Your $osname does not have the msg*(2) configured." >&4
8009 : we could also check for sys/ipc.h ...
8010 if $h_msg && $test `./findhdr sys/msg.h`; then
8011 echo "You have the full msg*(2) library." >&4
8014 echo "You don't have the full msg*(2) library." >&4
8020 : see if nice exists
8024 : see if pause exists
8028 : see if pipe exists
8032 : see if poll exists
8037 : see whether the various POSIXish _yields exist within given cccmd
8039 #include <pthread.h>
8045 : see if pthread_yield exists within given cccmd,
8046 : if we do not usethreads this may well end up undef.
8047 set try -DYIELD=pthread_yield
8048 if eval $compile; then
8050 echo 'pthread_yield() found.' >&4
8053 echo 'pthread_yield() NOT found.' >&4
8058 : see if sched_yield exists within given cccmd,
8059 : if we do not usethreads this may well end up undef.
8060 set try -DYIELD=sched_yield
8061 if eval $compile; then
8063 echo 'sched_yield() found.' >&4
8066 echo 'sched_yield() NOT found.' >&4
8072 : test whether pthreads are created in joinable -- aka undetached -- state
8073 if test "X$usethreads" = "X$define"; then
8074 echo $n "Checking whether pthreads are created joinable. $c" >&4
8075 $cat >try.c <<'EOCP'
8076 #include <pthread.h>
8079 pthread_attr_t attr;
8082 pthread_attr_init(&attr) == 0 &&
8083 pthread_attr_getdetachstate(&attr, &detachstate) == 0 &&
8084 detachstate == PTHREAD_CREATE_DETACHED ?
8085 "detached" : "joinable");
8090 if eval $compile; then
8093 detached) echo "Nope, they aren't." >&4 ;;
8094 *) echo "Yup, they are." >&4 ;;
8098 echo "(I can't execute the test program--assuming they are.)" >&4
8103 detached) val="$undef" ;;
8106 set d_pthreads_created_joinable
8109 d_pthreads_created_joinable="$undef"
8112 : see if this is a pwd.h system
8118 xxx=`./findhdr pwd.h`
8119 $cppstdin $cppflags $cppminus < $xxx >$$.h
8121 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
8129 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
8137 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
8145 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
8153 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
8161 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
8169 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
8177 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
8189 set d_pwquota; eval $setvar
8190 set d_pwage; eval $setvar
8191 set d_pwchange; eval $setvar
8192 set d_pwclass; eval $setvar
8193 set d_pwexpire; eval $setvar
8194 set d_pwcomment; eval $setvar
8195 set d_pwgecos; eval $setvar
8196 set d_pwpasswd; eval $setvar
8200 : see if readdir and friends exist
8201 set readdir d_readdir
8203 set seekdir d_seekdir
8205 set telldir d_telldir
8207 set rewinddir d_rewinddir
8210 : see if readlink exists
8211 set readlink d_readlink
8214 : see if rename exists
8218 : see if rmdir exists
8222 : see if memory.h is available.
8227 : See if it conflicts with string.h
8233 $cppstdin $cppflags $cppminus < $strings > mem.h
8234 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
8236 echo "We won't be including <memory.h>."
8246 : can bcopy handle overlapping blocks?
8251 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
8258 $cat >>try.c <<'EOCP'
8261 # include <memory.h>
8264 # include <stdlib.h>
8267 # include <string.h>
8269 # include <strings.h>
8272 # include <unistd.h> /* Needed for NetBSD */
8276 char buf[128], abc[128];
8282 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
8284 for (align = 7; align >= 0; align--) {
8285 for (len = 36; len; len--) {
8288 for (off = 1; off <= len; off++) {
8289 bcopy(b, b+off, len);
8290 bcopy(b+off, b, len);
8291 if (bcmp(b, abc, len))
8300 if eval $compile_ok; then
8301 if ./try 2>/dev/null; then
8305 echo "It can't, sorry."
8306 case "$d_memmove" in
8307 "$define") echo "But that's Ok since you have memmove()." ;;
8311 echo "(I can't compile the test program, so we'll assume not...)"
8312 case "$d_memmove" in
8313 "$define") echo "But that's Ok since you have memmove()." ;;
8318 $rm -f try.* try core
8322 : can memcpy handle overlapping blocks?
8327 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
8334 $cat >>try.c <<'EOCP'
8337 # include <memory.h>
8340 # include <stdlib.h>
8343 # include <string.h>
8345 # include <strings.h>
8348 # include <unistd.h> /* Needed for NetBSD */
8352 char buf[128], abc[128];
8358 /* Copy "abcde..." string to char abc[] so that gcc doesn't
8359 try to store the string in read-only memory. */
8360 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
8362 for (align = 7; align >= 0; align--) {
8363 for (len = 36; len; len--) {
8365 memcpy(b, abc, len);
8366 for (off = 1; off <= len; off++) {
8367 memcpy(b+off, b, len);
8368 memcpy(b, b+off, len);
8369 if (memcmp(b, abc, len))
8378 if eval $compile_ok; then
8379 if ./try 2>/dev/null; then
8383 echo "It can't, sorry."
8384 case "$d_memmove" in
8385 "$define") echo "But that's Ok since you have memmove()." ;;
8389 echo "(I can't compile the test program, so we'll assume not...)"
8390 case "$d_memmove" in
8391 "$define") echo "But that's Ok since you have memmove()." ;;
8396 $rm -f try.* try core
8400 : can memcmp be trusted to compare relative magnitude?
8405 echo "Checking if your memcmp() can compare relative magnitude..." >&4
8412 $cat >>try.c <<'EOCP'
8415 # include <memory.h>
8418 # include <stdlib.h>
8421 # include <string.h>
8423 # include <strings.h>
8426 # include <unistd.h> /* Needed for NetBSD */
8432 if ((a < b) && memcmp(&a, &b, 1) < 0)
8438 if eval $compile_ok; then
8439 if ./try 2>/dev/null; then
8443 echo "No, it can't (it uses signed chars)."
8446 echo "(I can't compile the test program, so we'll assume not...)"
8450 $rm -f try.* try core
8454 : see if select exists
8458 : see if semctl exists
8462 : see if semget exists
8466 : see if semop exists
8470 : see how much of the 'sem*(2)' library is present.
8473 case "$d_semctl$d_semget$d_semop" in
8474 *"$undef"*) h_sem=false;;
8478 case "`ipcs 2>&1`" in
8479 "SVID messages"*"not configured"*)
8480 echo "Your $osname does not have the sem*(2) configured." >&4
8493 : we could also check for sys/ipc.h ...
8494 if $h_sem && $test `./findhdr sys/sem.h`; then
8495 echo "You have the full sem*(2) library." >&4
8498 echo "You don't have the full sem*(2) library." >&4
8504 : see whether sys/sem.h defines union semun
8506 $cat > try.c <<'END'
8507 #include <sys/types.h>
8508 #include <sys/ipc.h>
8509 #include <sys/sem.h>
8510 int main () { union semun semun; semun.buf = 0; }
8513 if eval $compile; then
8514 echo "You have union semun in <sys/sem.h>." >&4
8517 echo "You do not have union semun in <sys/sem.h>." >&4
8524 : see how to do semctl IPC_STAT
8527 : see whether semctl IPC_STAT can use union semun
8530 #include <sys/types.h>
8531 #include <sys/ipc.h>
8532 #include <sys/sem.h>
8533 #include <sys/stat.h>
8539 #$d_union_semun HAS_UNION_SEMUN
8542 #ifndef HAS_UNION_SEMUN
8545 struct semid_ds *buf;
8546 unsigned short *array;
8552 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8553 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8555 struct semid_ds argbuf;
8558 st = semctl(sem, 0, IPC_STAT, arg);
8562 # endif /* IPC_STAT */
8563 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8565 if (semctl(sem, 0, IPC_RMID, arg) != 0)
8566 # endif /* IPC_RMID */
8567 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8569 #endif /* IPC_PRIVATE && ... */
8570 printf("semget failed: errno = %d\n", errno);
8576 if eval $compile; then
8579 semun) val="$define" ;;
8585 case "$d_semctl_semun" in
8587 echo "You can use union semun for semctl IPC_STAT." >&4
8590 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
8595 : see whether semctl IPC_STAT can use struct semid_ds pointer
8596 $cat > try.c <<'END'
8597 #include <sys/types.h>
8598 #include <sys/ipc.h>
8599 #include <sys/sem.h>
8600 #include <sys/stat.h>
8607 struct semid_ds arg;
8610 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8611 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8614 st = semctl(sem, 0, IPC_STAT, &arg);
8616 printf("semid_ds\n");
8618 # endif /* IPC_STAT */
8619 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8621 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
8622 # endif /* IPC_RMID */
8623 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8625 #endif /* IPC_PRIVATE && ... */
8626 printf("semget failed: errno = %d\n", errno);
8633 if eval $compile; then
8636 semid_ds) val="$define" ;;
8640 set d_semctl_semid_ds
8642 case "$d_semctl_semid_ds" in
8644 echo "You can $also use struct semid_ds * for semctl IPC_STAT." >&4
8646 *) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4
8652 # We do not have the full sem*(2) library, so assume we can not
8658 set d_semctl_semid_ds
8663 : see if setegid exists
8664 set setegid d_setegid
8667 : see if seteuid exists
8668 set seteuid d_seteuid
8671 : see if setgrent exists
8672 set setgrent d_setgrent
8675 : see if sethostent exists
8676 set sethostent d_sethent
8679 : see if setlinebuf exists
8680 set setlinebuf d_setlinebuf
8683 : see if setlocale exists
8684 set setlocale d_setlocale
8687 : see if setnetent exists
8688 set setnetent d_setnent
8691 : see if setprotoent exists
8692 set setprotoent d_setpent
8695 : see if setpgid exists
8696 set setpgid d_setpgid
8699 : see if setpgrp2 exists
8700 set setpgrp2 d_setpgrp2
8703 : see if setpriority exists
8704 set setpriority d_setprior
8707 : see if setpwent exists
8708 set setpwent d_setpwent
8711 : see if setregid exists
8712 set setregid d_setregid
8714 set setresgid d_setresgid
8717 : see if setreuid exists
8718 set setreuid d_setreuid
8720 set setresuid d_setresuid
8723 : see if setrgid exists
8724 set setrgid d_setrgid
8727 : see if setruid exists
8728 set setruid d_setruid
8731 : see if setservent exists
8732 set setservent d_setsent
8735 : see if setsid exists
8739 : see if setvbuf exists
8740 set setvbuf d_setvbuf
8743 : see if sfio.h is available
8748 : see if sfio library is available
8759 : Ok, but do we want to use it.
8763 true|$define|[yY]*) dflt='y';;
8766 echo "$package can use the sfio library, but it is experimental."
8767 rp="You seem to have sfio available, do you want to try using it?"
8771 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
8773 : Remove sfio from list of libraries to use
8774 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
8777 echo "libs = $libs" >&4
8781 *) case "$usesfio" in
8783 echo "Sorry, cannot find sfio on this machine" >&4
8784 echo "Ignoring your setting of usesfio=$usesfio" >&4
8792 $define) usesfio='true';;
8793 *) usesfio='false';;
8796 : see if shmctl exists
8800 : see if shmget exists
8804 : see if shmat exists
8807 : see what shmat returns
8810 $cat >shmat.c <<'END'
8811 #include <sys/shm.h>
8814 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
8819 echo "and it returns ($shmattype)." >&4
8820 : see if a prototype for shmat is available
8821 xxx=`./findhdr sys/shm.h`
8822 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
8823 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
8834 set d_shmatprototype
8837 : see if shmdt exists
8841 : see how much of the 'shm*(2)' library is present.
8844 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
8845 *"$undef"*) h_shm=false;;
8849 case "`ipcs 2>&1`" in
8850 "SVID shared memory"*"not configured"*)
8851 echo "Your $osname does not have the shm*(2) configured." >&4
8866 : we could also check for sys/ipc.h ...
8867 if $h_shm && $test `./findhdr sys/shm.h`; then
8868 echo "You have the full shm*(2) library." >&4
8871 echo "You don't have the full shm*(2) library." >&4
8878 : see if we have sigaction
8879 if set sigaction val -f d_sigaction; eval $csym; $val; then
8880 echo 'sigaction() found.' >&4
8881 $cat > try.c <<'EOP'
8883 #include <sys/types.h>
8887 struct sigaction act, oact;
8891 if eval $compile_ok; then
8894 echo "But you don't seem to have a useable struct sigaction." >&4
8898 echo 'sigaction NOT found.' >&4
8901 set d_sigaction; eval $setvar
8902 $rm -f try try$_o try.c
8904 : see if sigsetjmp exists
8906 case "$d_sigsetjmp" in
8914 if (sigsetjmp(env,1))
8922 if eval $compile; then
8923 if ./try >/dev/null 2>&1; then
8924 echo "POSIX sigsetjmp found." >&4
8928 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
8934 echo "sigsetjmp not found." >&4
8938 *) val="$d_sigsetjmp"
8939 case "$d_sigsetjmp" in
8940 $define) echo "POSIX sigsetjmp found." >&4;;
8941 $undef) echo "sigsetjmp not found." >&4;;
8951 : see whether socket exists
8953 $echo $n "Hmm... $c" >&4
8954 if set socket val -f d_socket; eval $csym; $val; then
8955 echo "Looks like you have Berkeley networking support." >&4
8957 if set setsockopt val -f; eval $csym; $val; then
8960 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
8964 if $contains socklib libc.list >/dev/null 2>&1; then
8965 echo "Looks like you have Berkeley networking support." >&4
8967 : we will have to assume that it supports the 4.2 BSD interface
8970 echo "You don't have Berkeley networking in libc$_a..." >&4
8971 if test -f /usr/lib/libnet$_a; then
8972 ( ($nm $nm_opt /usr/lib/libnet$_a | eval $nm_extract) || \
8973 $ar t /usr/lib/libnet$_a) 2>/dev/null >> libc.list
8974 if $contains socket libc.list >/dev/null 2>&1; then
8975 echo "...but the Wollongong group seems to have hacked it in." >&4
8977 sockethdr="-I/usr/netinclude"
8979 if $contains setsockopt libc.list >/dev/null 2>&1; then
8982 echo "...using the old 4.1c interface, rather than 4.2" >&4
8986 echo "or even in libnet$_a, which is peculiar." >&4
8991 echo "or anywhere else I see." >&4
8998 : see if socketpair exists
8999 set socketpair d_sockpair
9002 : see if stat knows about block sizes
9004 set d_statblks stat st_blocks $i_sysstat sys/stat.h
9007 : see if _ptr and _cnt from stdio act std
9009 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
9010 echo "(Looks like you have stdio.h from Linux.)"
9011 case "$stdio_ptr" in
9012 '') stdio_ptr='((fp)->_IO_read_ptr)'
9015 *) ptr_lval=$d_stdio_ptr_lval;;
9017 case "$stdio_cnt" in
9018 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
9021 *) cnt_lval=$d_stdio_cnt_lval;;
9023 case "$stdio_base" in
9024 '') stdio_base='((fp)->_IO_read_base)';;
9026 case "$stdio_bufsiz" in
9027 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
9030 case "$stdio_ptr" in
9031 '') stdio_ptr='((fp)->_ptr)'
9034 *) ptr_lval=$d_stdio_ptr_lval;;
9036 case "$stdio_cnt" in
9037 '') stdio_cnt='((fp)->_cnt)'
9040 *) cnt_lval=$d_stdio_cnt_lval;;
9042 case "$stdio_base" in
9043 '') stdio_base='((fp)->_base)';;
9045 case "$stdio_bufsiz" in
9046 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
9049 : test whether _ptr and _cnt really work
9050 echo "Checking how std your stdio is..." >&4
9053 #define FILE_ptr(fp) $stdio_ptr
9054 #define FILE_cnt(fp) $stdio_cnt
9056 FILE *fp = fopen("try.c", "r");
9059 18 <= FILE_cnt(fp) &&
9060 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
9068 if eval $compile; then
9070 echo "Your stdio acts pretty std."
9073 echo "Your stdio isn't very std."
9076 echo "Your stdio doesn't appear very std."
9082 : Can _ptr be used as an lvalue?
9083 case "$d_stdstdio$ptr_lval" in
9084 $define$define) val=$define ;;
9087 set d_stdio_ptr_lval
9090 : Can _cnt be used as an lvalue?
9091 case "$d_stdstdio$cnt_lval" in
9092 $define$define) val=$define ;;
9095 set d_stdio_cnt_lval
9098 : see if _base is also standard
9100 case "$d_stdstdio" in
9104 #define FILE_base(fp) $stdio_base
9105 #define FILE_bufsiz(fp) $stdio_bufsiz
9107 FILE *fp = fopen("try.c", "r");
9110 19 <= FILE_bufsiz(fp) &&
9111 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
9118 if eval $compile; then
9120 echo "And its _base field acts std."
9123 echo "But its _base field isn't std."
9126 echo "However, it seems to be lacking the _base field."
9134 : see if strcoll exists
9135 set strcoll d_strcoll
9138 : check for structure copying
9140 echo "Checking to see if your C compiler can copy structs..." >&4
9141 $cat >try.c <<'EOCP'
9151 if $cc -c try.c >/dev/null 2>&1 ; then
9156 echo "Nope, it can't."
9162 : see if strerror and/or sys_errlist[] exist
9164 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
9165 if set strerror val -f d_strerror; eval $csym; $val; then
9166 echo 'strerror() found.' >&4
9167 d_strerror="$define"
9168 d_strerrm='strerror(e)'
9169 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9170 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
9171 d_syserrlst="$define"
9173 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
9174 d_syserrlst="$undef"
9176 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
9177 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
9178 echo 'strerror() found in string header.' >&4
9179 d_strerror="$define"
9180 d_strerrm='strerror(e)'
9181 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9182 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
9183 d_syserrlst="$define"
9185 echo "(You don't appear to have any sys_errlist[], how can this be?)"
9186 d_syserrlst="$undef"
9188 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9189 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
9191 d_syserrlst="$define"
9192 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
9194 echo 'strerror() and sys_errlist[] NOT found.' >&4
9196 d_syserrlst="$undef"
9197 d_strerrm='"unknown"'
9201 : see if strtod exists
9205 : see if strtol exists
9209 : see if strtoul exists
9210 set strtoul d_strtoul
9213 : see if strxfrm exists
9214 set strxfrm d_strxfrm
9217 : see if symlink exists
9218 set symlink d_symlink
9221 : see if syscall exists
9222 set syscall d_syscall
9225 : see if sysconf exists
9226 set sysconf d_sysconf
9229 : see if system exists
9233 : see if tcgetpgrp exists
9234 set tcgetpgrp d_tcgetpgrp
9237 : see if tcsetpgrp exists
9238 set tcsetpgrp d_tcsetpgrp
9241 : define an is-a-typedef? function
9242 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9244 "") inclist="sys/types.h";;
9246 eval "varval=\$$var";
9250 for inc in $inclist; do
9251 echo "#include <$inc>" >>temp.c;
9253 echo "#ifdef $type" >> temp.c;
9254 echo "printf(\"We have $type\");" >> temp.c;
9255 echo "#endif" >> temp.c;
9256 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9257 if $contains $type temp.E >/dev/null 2>&1; then
9263 *) eval "$var=\$varval";;
9266 : define an is-a-typedef? function that prompts if the type is not available.
9267 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9269 "") inclist="sys/types.h";;
9271 eval "varval=\$$var";
9275 for inc in $inclist; do
9276 echo "#include <$inc>" >>temp.c;
9278 echo "#ifdef $type" >> temp.c;
9279 echo "printf(\"We have $type\");" >> temp.c;
9280 echo "#endif" >> temp.c;
9281 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9283 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9284 if $contains $type temp.E >/dev/null 2>&1; then
9285 echo "$type found." >&4;
9288 echo "$type NOT found." >&4;
9294 *) eval "$var=\$varval";;
9297 : see if this is a sys/times.h system
9298 set sys/times.h i_systimes
9301 : see if times exists
9303 if set times val -f d_times; eval $csym; $val; then
9304 echo 'times() found.' >&4
9307 case "$i_systimes" in
9308 "$define") inc='sys/times.h';;
9310 rp="What is the type returned by times() on this system?"
9311 set clock_t clocktype long stdio.h sys/types.h $inc
9314 echo 'times() NOT found, hope that will do.' >&4
9319 : see if truncate exists
9320 set truncate d_truncate
9323 : see if tzname[] exists
9325 if set tzname val -a d_tzname; eval $csym; $val; then
9327 echo 'tzname[] found.' >&4
9330 echo 'tzname[] NOT found.' >&4
9335 : see if umask exists
9339 : see how we will look up host name
9342 : dummy stub to allow use of elif
9343 elif set uname val -f d_uname; eval $csym; $val; then
9346 uname() was found, but you're running xenix, and older versions of xenix
9347 have a broken uname(). If you don't really know whether your xenix is old
9348 enough to have a broken system call, use the default answer.
9355 rp='Is your uname() broken?'
9358 n*) d_uname="$define"; call=uname;;
9361 echo 'uname() found.' >&4
9366 case "$d_gethname" in
9367 '') d_gethname="$undef";;
9370 '') d_uname="$undef";;
9372 case "$d_phostname" in
9373 '') d_phostname="$undef";;
9376 : backward compatibility for d_hvfork
9377 if test X$d_hvfork != X; then
9381 : see if there is a vfork
9386 : Ok, but do we want to use it. vfork is reportedly unreliable in
9387 : perl on Solaris 2.x, and probably elsewhere.
9395 rp="Some systems have problems with vfork(). Do you want to use it?"
9400 echo "Ok, we won't use vfork()."
9409 $define) usevfork='true';;
9410 *) usevfork='false';;
9413 : see if this is an sysdir system
9414 set sys/dir.h i_sysdir
9417 : see if this is an sysndir system
9418 set sys/ndir.h i_sysndir
9421 : see if sys/types.h has to be included
9422 set sys/types.h i_systypes
9425 : see if closedir exists
9426 set closedir d_closedir
9429 case "$d_closedir" in
9432 echo "Checking whether closedir() returns a status..." >&4
9433 cat > closedir.c <<EOM
9434 #$i_dirent I_DIRENT /**/
9435 #$i_sysdir I_SYS_DIR /**/
9436 #$i_sysndir I_SYS_NDIR /**/
9437 #$i_systypes I_SYS_TYPES /**/
9439 #if defined(I_SYS_TYPES)
9440 #include <sys/types.h>
9442 #if defined(I_DIRENT)
9444 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
9445 #include <sys/dir.h>
9449 #include <sys/ndir.h>
9453 #include <ndir.h> /* may be wrong in the future */
9455 #include <sys/dir.h>
9460 int main() { return closedir(opendir(".")); }
9463 if eval $compile_ok; then
9464 if ./closedir > /dev/null 2>&1 ; then
9465 echo "Yes, it does."
9468 echo "No, it doesn't."
9472 echo "(I can't seem to compile the test program--assuming it doesn't)"
9483 : check for volatile keyword
9485 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
9486 $cat >try.c <<'EOCP'
9489 typedef struct _goo_struct goo_struct;
9490 goo_struct * volatile goo = ((goo_struct *)0);
9491 struct _goo_struct {
9496 typedef unsigned short foo_t;
9499 volatile foo_t blech;
9503 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
9505 echo "Yup, it does."
9508 echo "Nope, it doesn't."
9514 : see if there is a wait4
9518 : see if waitpid exists
9519 set waitpid d_waitpid
9522 : see if wcstombs exists
9523 set wcstombs d_wcstombs
9526 : see if wctomb exists
9530 : preserve RCS keywords in files with variable substitution, grrr
9535 Revision='$Revision'
9537 : check for alignment requirements
9539 case "$alignbytes" in
9540 '') echo "Checking alignment constraints..." >&4
9541 $cat >try.c <<'EOCP'
9548 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
9552 if eval $compile_ok; then
9556 echo "(I can't seem to compile the test program...)"
9559 *) dflt="$alignbytes"
9562 rp="Doubles must be aligned on a how-many-byte boundary?"
9567 : check for ordering of bytes in a long
9568 case "$byteorder" in
9572 In the following, larger digits indicate more significance. A big-endian
9573 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
9574 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
9575 machines may have weird orders like 3412. A Cray will report 87654321. If
9576 the test program works the default is probably right.
9577 I'm now running the test program...
9579 $cat >try.c <<'EOCP'
9586 char c[sizeof(long)];
9589 if (sizeof(long) > 4)
9590 u.l = (0x08070605L << 32) | 0x04030201L;
9593 for (i = 0; i < sizeof(long); i++)
9594 printf("%c", u.c[i]+'0');
9601 if eval $compile && ./try > /dev/null; then
9604 [1-4][1-4][1-4][1-4]|12345678|87654321)
9605 echo "(The test program ran ok.)"
9606 echo "byteorder=$dflt"
9609 ????|????????) echo "(The test program ran ok.)" ;;
9610 *) echo "(The test program didn't run right for some reason.)" ;;
9615 (I can't seem to compile the test program. Guessing big-endian...)
9618 case "$xxx_prompt" in
9620 rp="What is the order of bytes in a long?"
9631 : how do we catenate cpp tokens here?
9633 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
9634 $cat >cpp_stuff.c <<'EOCP'
9635 #define RCAT(a,b)a/**/b
9636 #define ACAT(a,b)a ## b
9640 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
9641 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
9642 echo "Oh! Smells like ANSI's been here." >&4
9643 echo "We can catify or stringify, separately or together!"
9645 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
9646 echo "Ah, yes! The good old days!" >&4
9647 echo "However, in the good old days we don't know how to stringify and"
9648 echo "catify at the same time."
9652 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
9653 to have to edit the values of CAT[2-5] in config.h...
9655 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
9659 : see if this is a db.h system
9667 echo "Checking Berkeley DB version ..." >&4
9673 #include <sys/types.h>
9678 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
9679 int Major, Minor, Patch ;
9680 unsigned long Version ;
9681 (void)db_version(&Major, &Minor, &Patch) ;
9682 printf("You have Berkeley DB Version 2 or greater\n");
9684 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
9685 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
9686 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
9687 Major, Minor, Patch) ;
9689 /* check that db.h & libdb are compatible */
9690 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
9691 printf("db.h and libdb are incompatible\n") ;
9695 printf("db.h and libdb are compatible\n") ;
9697 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
9698 + DB_VERSION_PATCH ;
9700 /* needs to be >= 2.3.4 */
9701 if (Version < 2003004) {
9702 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
9703 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
9709 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
9710 printf("You have Berkeley DB Version 1\n");
9711 exit(0); /* DB version < 2: the coast is clear. */
9713 exit(1); /* <db.h> not Berkeley DB? */
9719 if eval $compile && ./try; then
9720 echo 'Looks OK.' >&4
9722 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
9726 : Remove db from list of libraries to use
9727 echo "Removing unusable -ldb from library list" >&4
9728 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
9731 echo "libs = $libs" >&4
9741 : Check the return type needed for hash
9743 echo "Checking return type needed for hash for Berkeley DB ..." >&4
9749 #include <sys/types.h>
9752 #ifndef DB_VERSION_MAJOR
9753 u_int32_t hash_cb (ptr, size)
9761 info.hash = hash_cb;
9765 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9766 if $contains warning try.out >>/dev/null 2>&1 ; then
9769 db_hashtype='u_int32_t'
9772 : XXX Maybe we should just give up here.
9773 db_hashtype=u_int32_t
9775 echo "Help: I can't seem to compile the db test program." >&4
9776 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
9779 echo "Your version of Berkeley DB uses $db_hashtype for hash."
9781 *) db_hashtype=u_int32_t
9786 : Check the return type needed for prefix
9788 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
9794 #include <sys/types.h>
9797 #ifndef DB_VERSION_MAJOR
9798 size_t prefix_cb (key1, key2)
9806 info.prefix = prefix_cb;
9810 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9811 if $contains warning try.out >>/dev/null 2>&1 ; then
9814 db_prefixtype='size_t'
9817 db_prefixtype='size_t'
9818 : XXX Maybe we should just give up here.
9820 echo "Help: I can't seem to compile the db test program." >&4
9821 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
9824 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
9826 *) db_prefixtype='size_t'
9830 : check for void type
9832 echo "Checking to see how well your C compiler groks the void type..." >&4
9833 case "$voidflags" in
9835 $cat >try.c <<'EOCP'
9841 extern void moo(); /* function returning void */
9842 void (*goo)(); /* ptr to func returning void */
9844 void *hue; /* generic ptr */
9859 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
9860 voidflags=$defvoidused
9861 echo "Good. It appears to support void to the level $package wants.">&4
9862 if $contains warning .out >/dev/null 2>&1; then
9863 echo "However, you might get some warnings that look like this:"
9867 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
9868 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
9869 echo "It supports 1..."
9870 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
9871 echo "It also supports 2..."
9872 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
9874 echo "And it supports 4 but not 8 definitely."
9876 echo "It doesn't support 4..."
9877 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
9879 echo "But it supports 8."
9882 echo "Neither does it support 8."
9886 echo "It does not support 2..."
9887 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
9889 echo "But it supports 4 and 8."
9891 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
9893 echo "And it supports 4 but has not heard about 8."
9895 echo "However it supports 8 but not 4."
9900 echo "There is no support at all for void."
9905 case "$voidflags" in
9908 Support flag bits are:
9909 1: basic void declarations.
9910 2: arrays of pointers to functions returning void.
9911 4: operations between pointers to and addresses of void functions.
9912 8: generic void pointers.
9915 rp="Your void support flags add up to what?"
9922 : check for length of double
9924 case "$doublesize" in
9926 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
9927 $cat >try.c <<'EOCP'
9931 printf("%d\n", sizeof(double));
9935 if eval $compile_ok; then
9937 $echo " $doublesize bytes." >&4
9940 echo "(I can't seem to compile the test program. Guessing...)"
9941 rp="What is the size of a double precision number (in bytes)?"
9950 echo "Determining whether or not we are on an EBCDIC system..." >&4
9951 $cat >tebcdic.c <<'EOM'
9954 if ('M'==0xd4) return 0;
9961 if eval $compile_ok; then
9963 echo "You have EBCDIC." >&4
9966 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
9969 echo "$me: I'm unable to compile the test program." >&4
9970 echo "I'll assume ASCII or some ISO Latin." >&4
9972 $rm -f tebcdic.c tebcdic
9976 : see what type file positions are declared as in the library
9977 rp="What is the type for file position used by fsetpos()?"
9978 set fpos_t fpostype long stdio.h sys/types.h
9981 : get csh whereabouts
9983 'csh') val="$undef" ;;
9988 : Respect a hint or command line value for full_csh.
9990 '') full_csh=$csh ;;
9993 : Store the full pathname to the sed program for use in the C program
9996 : see what type gids are declared as in the kernel
9998 echo "Looking for the type for group ids returned by getgid()."
9999 set gid_t gidtype xxx stdio.h sys/types.h
10003 xxx=`./findhdr sys/user.h`
10004 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
10006 unsigned) dflt="$1 $2" ;;
10010 *) dflt="$gidtype";;
10013 gid_t) echo "gid_t found." ;;
10014 *) rp="What is the type for group ids returned by getgid()?"
10020 : see if getgroups exists
10021 set getgroups d_getgrps
10024 : see if setgroups exists
10025 set setgroups d_setgrps
10029 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
10031 case "$d_getgrps$d_setgrps" in
10033 case "$groupstype" in
10034 '') dflt="$gidtype" ;;
10035 *) dflt="$groupstype" ;;
10038 What type of pointer is the second argument to getgroups() and setgroups()?
10039 Usually this is the same as group ids, $gidtype, but not always.
10042 rp='What type pointer is the second argument to getgroups() and setgroups()?'
10046 *) groupstype="$gidtype";;
10049 : see what type lseek is declared as in the kernel
10050 rp="What is the type used for lseek's offset on this system?"
10051 set off_t lseektype long stdio.h sys/types.h
10055 $echo $n "Checking to see how big your file offsets are...$c" >&4
10057 #include <sys/types.h>
10061 printf("%d\n", sizeof($lseektype));
10065 if eval $compile_ok; then
10067 $echo " $lseeksize bytes." >&4
10071 echo "(I can't seem to compile the test program. Guessing...)"
10072 rp="What is the size of your file offsets (in bytes)?"
10079 echo "Checking if your $make program sets \$(MAKE)..." >&4
10080 case "$make_set_make" in
10082 $sed 's/^X //' > testmake.mak << 'EOF'
10084 X @echo 'maketemp="$(MAKE)"'
10086 case "`$make -f testmake.mak 2>/dev/null`" in
10087 *maketemp=*) make_set_make='#' ;;
10088 *) make_set_make="MAKE=$make" ;;
10090 $rm -f testmake.mak
10093 case "$make_set_make" in
10094 '#') echo "Yup, it does.";;
10095 *) echo "Nope, it doesn't.";;
10098 : see what type is used for mode_t
10099 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
10100 set mode_t modetype int stdio.h sys/types.h
10103 : define a fucntion to check prototypes
10104 $cat > protochk <<EOSH
10107 optimize="$optimize"
10109 prototype="$prototype"
10114 $cat >> protochk <<'EOSH'
10119 while test $# -ge 2; do
10121 $define) echo "#include <$2>" >> try.c ;;
10122 literal) echo "$2" >> try.c ;;
10126 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10127 cat >> try.c <<'EOCP'
10128 #ifdef CAN_PROTOTYPE
10129 #define _(args) args
10134 echo "$foo" >> try.c
10135 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10136 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10142 $eunicefix protochk
10144 : see what type is used for size_t
10145 rp="What is the type used for the length parameter for string functions?"
10146 set size_t sizetype 'unsigned int' stdio.h sys/types.h
10149 : check for type of arguments to gethostbyaddr.
10150 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
10151 case "$d_gethbyaddr" in
10155 Checking to see what type of arguments are accepted by gethostbyaddr().
10157 hdrs="$define sys/types.h
10158 $d_socket sys/socket.h
10159 $i_niin netinet/in.h
10161 $i_unistd unistd.h"
10162 : The first arg can 'char *' or 'void *'
10163 : The second arg is some of integral type
10164 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
10165 for yyy in size_t long int; do
10166 case "$netdb_host_type" in
10167 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
10168 if ./protochk "$try" $hdrs; then
10169 echo "Your system accepts $xxx for the first arg."
10170 echo "...and $yyy for the second arg."
10171 netdb_host_type="$xxx"
10172 netdb_hlen_type="$yyy"
10178 : In case none of those worked, prompt the user.
10179 case "$netdb_host_type" in
10180 '') rp='What is the type for the 1st argument to gethostbyaddr?'
10183 netdb_host_type=$ans
10184 rp='What is the type for the 2nd argument to gethostbyaddr?'
10187 netdb_hlen_type=$ans
10191 *) : no gethostbyaddr, so pick harmless defaults
10192 netdb_host_type='char *'
10193 netdb_hlen_type="$sizetype"
10196 # Remove the "const" if needed. -- but then we'll have a
10198 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
10201 : check for type of argument to gethostbyname.
10202 if test "X$netdb_name_type" = X ; then
10203 case "$d_gethbyname" in
10207 Checking to see what type of argument is accepted by gethostbyname().
10209 hdrs="$define sys/types.h
10210 $d_socket sys/socket.h
10211 $i_niin netinet/in.h
10213 $i_unistd unistd.h"
10214 for xxx in "const char *" "char *"; do
10215 case "$netdb_name_type" in
10216 '') try="extern struct hostent *gethostbyname($xxx);"
10217 if ./protochk "$try" $hdrs; then
10218 echo "Your system accepts $xxx."
10219 netdb_name_type="$xxx"
10224 : In case none of those worked, prompt the user.
10225 case "$netdb_name_type" in
10226 '') rp='What is the type for the 1st argument to gethostbyname?'
10229 netdb_name_type=$ans
10233 *) : no gethostbyname, so pick harmless default
10234 netdb_name_type='char *'
10239 : check for type of 1st argument to getnetbyaddr.
10240 if test "X$netdb_net_type" = X ; then
10241 case "$d_getnbyaddr" in
10245 Checking to see what type of 1st argument is accepted by getnetbyaddr().
10247 hdrs="$define sys/types.h
10248 $d_socket sys/socket.h
10249 $i_niin netinet/in.h
10251 $i_unistd unistd.h"
10252 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
10253 case "$netdb_net_type" in
10254 '') try="extern struct netent *getnetbyaddr($xxx, int);"
10255 if ./protochk "$try" $hdrs; then
10256 echo "Your system accepts $xxx."
10257 netdb_net_type="$xxx"
10262 : In case none of those worked, prompt the user.
10263 case "$netdb_net_type" in
10264 '') rp='What is the type for the 1st argument to getnetbyaddr?'
10267 netdb_net_type=$ans
10271 *) : no getnetbyaddr, so pick harmless default
10272 netdb_net_type='long'
10276 : locate the preferred pager for this system
10290 '') dflt=/usr/ucb/more;;
10297 rp='What pager is used on your system?'
10301 : see what type pids are declared as in the kernel
10302 rp="What is the type of process ids on this system?"
10303 set pid_t pidtype int stdio.h sys/types.h
10306 : check for length of pointer
10310 $echo $n "Checking to see how big your pointers are...$c" >&4
10311 if test "$voidflags" -gt 7; then
10312 echo '#define VOID_PTR char *' > try.c
10314 echo '#define VOID_PTR void *' > try.c
10316 $cat >>try.c <<'EOCP'
10320 printf("%d\n", sizeof(VOID_PTR));
10325 if eval $compile_ok; then
10327 $echo " $ptrsize bytes." >&4
10330 echo "(I can't seem to compile the test program. Guessing...)" >&4
10331 rp="What is the size of a pointer (in bytes)?"
10339 : check for size of random number generator
10341 case "$randbits" in
10343 echo "Checking to see how many bits your rand function produces..." >&4
10345 #$i_unistd I_UNISTD
10346 #$i_stdlib I_STDLIB
10349 # include <unistd.h>
10352 # include <stdlib.h>
10355 $cat >>try.c <<'EOCP'
10359 register unsigned long tmp;
10360 register unsigned long max = 0L;
10362 for (i = 1000; i; i--) {
10363 tmp = (unsigned long)rand();
10364 if (tmp > max) max = tmp;
10366 for (i = 0; max; i++)
10372 if eval $compile_ok; then
10376 echo "(I can't seem to compile the test program...)"
10383 rp='How many bits does your rand() function produce?'
10388 : see if ar generates random libraries by itself
10390 echo "Checking how to generate random libraries on your machine..." >&4
10391 echo 'int bar1() { return bar2(); }' > bar1.c
10392 echo 'int bar2() { return 2; }' > bar2.c
10393 $cat > foo.c <<'EOP'
10394 main() { printf("%d\n", bar1()); exit(0); }
10396 $cc $ccflags -c bar1.c >/dev/null 2>&1
10397 $cc $ccflags -c bar2.c >/dev/null 2>&1
10398 $cc $ccflags -c foo.c >/dev/null 2>&1
10399 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
10400 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
10401 ./foobar >/dev/null 2>&1; then
10402 echo "$ar appears to generate random libraries itself."
10405 elif $ar ts bar$_a >/dev/null 2>&1 &&
10406 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
10407 ./foobar >/dev/null 2>&1; then
10408 echo "a table of contents needs to be added with '$ar ts'."
10415 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
10416 $test -f $ranlib || ranlib=''
10419 if $test -n "$ranlib"; then
10420 echo "your system has '$ranlib'; we'll use that."
10423 echo "your system doesn't seem to support random libraries"
10424 echo "so we'll use lorder and tsort to order the libraries."
10431 : see if sys/select.h has to be included
10432 set sys/select.h i_sysselct
10435 : see if we should include time.h, sys/time.h, or both
10437 if test "X$timeincl" = X; then
10438 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10439 $echo $n "I'm now running the test program...$c"
10440 $cat >try.c <<'EOCP'
10441 #include <sys/types.h>
10446 #ifdef SYSTIMEKERNEL
10449 #include <sys/time.h>
10452 #include <sys/select.h>
10458 struct timeval bar;
10461 struct timezone tzp;
10463 if (foo.tm_sec == foo.tm_sec)
10466 if (bar.tv_sec == bar.tv_sec)
10473 for s_timezone in '-DS_TIMEZONE' ''; do
10475 for s_timeval in '-DS_TIMEVAL' ''; do
10476 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10477 for i_time in '' '-DI_TIME'; do
10478 for i_systime in '-DI_SYSTIME' ''; do
10481 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10482 if eval $compile; then
10483 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10487 $echo $n "Succeeded with $flags$c"
10499 *SYSTIMEKERNEL*) i_systimek="$define"
10500 timeincl=`./findhdr sys/time.h`
10501 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10502 *) i_systimek="$undef";;
10505 *I_TIME*) i_time="$define"
10506 timeincl=`./findhdr time.h`" $timeincl"
10507 echo "We'll include <time.h>." >&4;;
10508 *) i_time="$undef";;
10511 *I_SYSTIME*) i_systime="$define"
10512 timeincl=`./findhdr sys/time.h`" $timeincl"
10513 echo "We'll include <sys/time.h>." >&4;;
10514 *) i_systime="$undef";;
10519 : check for fd_set items
10522 Checking to see how well your C compiler handles fd_set and friends ...
10524 $cat >fd_set.c <<EOCP
10525 #$i_systime I_SYS_TIME
10526 #$i_sysselct I_SYS_SELECT
10527 #$d_socket HAS_SOCKET
10528 #include <sys/types.h>
10530 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
10533 #include <sys/time.h>
10535 #ifdef I_SYS_SELECT
10536 #include <sys/select.h>
10545 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
10552 set fd_set -DTRYBITS
10553 if eval $compile; then
10554 d_fds_bits="$define"
10556 echo "Well, your system knows about the normal fd_set typedef..." >&4
10558 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
10559 d_fd_macros="$define"
10562 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
10564 d_fd_macros="$undef"
10568 Hmm, your compiler has some difficulty with fd_set. Checking further...
10571 if eval $compile; then
10572 d_fds_bits="$undef"
10574 echo "Well, your system has some sort of fd_set available..." >&4
10576 echo "and you have the normal fd_set macros." >&4
10577 d_fd_macros="$define"
10580 but not the normal fd_set macros! Gross! More work for me...
10582 d_fd_macros="$undef"
10585 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
10587 d_fds_bits="$undef"
10588 d_fd_macros="$undef"
10593 : check for type of arguments to select.
10594 case "$selecttype" in
10595 '') case "$d_select" in
10598 Checking to see what type of arguments are accepted by select().
10600 hdrs="$define sys/types.h
10601 $i_systime sys/time.h
10602 $i_sysselct sys/select.h
10603 $d_socket sys/socket.h"
10604 : The first arg can be int, unsigned, or size_t
10605 : The last arg may or may not be 'const'
10607 for xxx in 'fd_set *' 'int *'; do
10608 for nfd in 'int' 'size_t' 'unsigned' ; do
10609 for tmo in 'struct timeval *' 'const struct timeval *'; do
10611 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
10612 if ./protochk "$try" $hdrs; then
10613 echo "Your system accepts $xxx."
10622 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
10623 case "$d_fd_set" in
10624 $define) dflt="fd_set *" ;;
10633 *) : no select, so pick a harmless default
10640 : check for the select 'width'
10641 case "$selectminbits" in
10642 '') case "$d_select" in
10646 Checking to see how on how many bits at a time your select() operates...
10649 #include <sys/types.h>
10651 #$i_systime I_SYS_TIME
10652 #$i_systimek I_SYS_TIME_KERNEL
10657 # ifdef I_SYS_TIME_KERNEL
10660 # include <sys/time.h>
10661 # ifdef I_SYS_TIME_KERNEL
10665 #$i_sysselct I_SYS_SELECT
10666 #ifdef I_SYS_SELECT
10667 #include <sys/select.h>
10670 #define S sizeof($selecttype)
10672 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
10673 #define NBITS (NBYTES * 8)
10683 fp = fopen("try.c", "r");
10689 b = ($selecttype)s;
10690 for (i = 0; i < NBITS; i++)
10694 select(fd + 1, b, 0, 0, &t);
10695 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
10696 printf("%d\n", i + 1);
10701 if eval $compile_ok; then
10702 selectminbits=`./try`
10703 echo "Your select() operates on $selectminbits bits at a time." >&4
10705 rp='What is the minimum number of bits your select() operates on?'
10706 case "$byteorder" in
10707 1234|12345678) dflt=32 ;;
10712 selectminbits="$val"
10716 *) : no select, so pick a harmless default
10723 : Trace out the files included by signal.h, then look for SIGxxx names.
10724 : Remove SIGARRAYSIZE used by HPUX.
10725 : Remove SIGTYP void lines used by OS2.
10726 xxx=`echo '#include <signal.h>' |
10727 $cppstdin $cppminus $cppflags 2>/dev/null |
10728 $grep '^[ ]*#.*include' |
10729 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
10730 : Check this list of files to be sure we have parsed the cpp output ok.
10731 : This will also avoid potentially non-existent files, such
10734 for xx in $xxx /dev/null ; do
10735 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
10737 : If we have found no files, at least try signal.h
10738 case "$xxxfiles" in
10739 '') xxxfiles=`./findhdr signal.h` ;;
10742 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
10743 print substr($2, 4, 20)
10745 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
10746 print substr($3, 4, 20)
10748 : Append some common names just in case the awk scan failed.
10749 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
10750 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
10751 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
10752 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
10753 : generate a few handy files for later
10754 $cat > signal.c <<'EOCP'
10755 #include <sys/types.h>
10756 #include <signal.h>
10760 /* Strange style to avoid deeply-nested #if/#else/#endif */
10763 # define NSIG (_NSIG)
10769 # define NSIG (SIGMAX+1)
10775 # define NSIG (SIG_MAX+1)
10781 # define NSIG (MAXSIG+1)
10787 # define NSIG (MAX_SIG+1)
10792 # ifdef SIGARRAYSIZE
10793 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
10799 # define NSIG (_sys_nsig) /* Solaris 2.5 */
10803 /* Default to some arbitrary number that's big enough to get most
10804 of the common signals.
10810 printf("NSIG %d\n", NSIG);
10816 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
10818 printf "#ifdef SIG"; printf $1; printf "\n"
10819 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
10820 printf $1; printf ");\n"
10824 printf "#endif /* JUST_NSIG */\n";
10828 $cat >signal.awk <<'EOP'
10829 BEGIN { ndups = 0 }
10830 $1 ~ /^NSIG$/ { nsig = $2 }
10831 ($1 !~ /^NSIG$/) && (NF == 2) {
10832 if ($2 > maxsig) { maxsig = $2 }
10833 if (sig_name[$2]) {
10834 dup_name[ndups] = $1
10835 dup_num[ndups] = $2
10845 if (nsig == 0) { nsig = maxsig + 1 }
10846 for (n = 1; n < nsig; n++) {
10848 printf("%s %d\n", sig_name[n], sig_num[n])
10851 printf("NUM%d %d\n", n, n)
10854 for (n = 0; n < ndups; n++) {
10855 printf("%s %d\n", dup_name[n], dup_num[n])
10859 $cat >signal_cmd <<EOS
10861 if $test -s signal.lst; then
10862 echo "Using your existing signal.lst file"
10867 $cat >>signal_cmd <<'EOS'
10870 if eval $compile_ok; then
10871 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10873 echo "(I can't seem be able to compile the whole test program)" >&4
10874 echo "(I'll try it in little pieces.)" >&4
10875 set signal -DJUST_NSIG
10876 if eval $compile_ok; then
10877 ./signal$_exe > signal.nsg
10880 echo "I can't seem to figure out how many signals you have." >&4
10881 echo "Guessing 50." >&4
10882 echo 'NSIG 50' > signal.nsg
10884 : Now look at all the signal names, one at a time.
10885 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
10886 $cat > signal.c <<EOCP
10887 #include <sys/types.h>
10888 #include <signal.h>
10891 printf("$xx %d\n", SIG${xx});
10896 if eval $compile; then
10897 echo "SIG${xx} found."
10898 ./signal$_exe >> signal.ls1
10900 echo "SIG${xx} NOT found."
10903 if $test -s signal.ls1; then
10904 $cat signal.nsg signal.ls1 |
10905 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10909 if $test -s signal.lst; then
10912 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
10913 echo 'kill -l' >signal
10914 set X `csh -f <signal`
10918 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
10920 echo $@ | $tr ' ' $trnl | \
10921 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
10923 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
10925 chmod a+x signal_cmd
10926 $eunicefix signal_cmd
10928 : generate list of signal names
10930 case "$sig_name_init" in
10932 echo "Generating a list of signal names and numbers..." >&4
10934 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
10935 sig_name="ZERO $sig_name"
10936 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
10937 { printf "\"%s\", ", $1 }
10938 END { printf "0\n" }' signal.lst`
10939 sig_num=`$awk 'BEGIN { printf "0, " }
10940 { printf "%d, ", $2}
10941 END { printf "0\n"}' signal.lst`
10944 echo "The following signals are available:"
10946 echo $sig_name | $awk \
10947 'BEGIN { linelen = 0 }
10949 for (i = 1; i <= NF; i++) {
10950 name = "SIG" $i " "
10951 linelen = linelen + length(name)
10952 if (linelen > 70) {
10954 linelen = length(name)
10960 $rm -f signal signal.c signal.awk signal.lst signal_cmd
10962 : see what type is used for signed size_t
10963 set ssize_t ssizetype int stdio.h sys/types.h
10966 $cat > ssize.c <<EOM
10968 #include <sys/types.h>
10969 #define Size_t $sizetype
10970 #define SSize_t $dflt
10973 if (sizeof(Size_t) == sizeof(SSize_t))
10975 else if (sizeof(Size_t) == sizeof(int))
10984 if eval $compile_ok && ./ssize > /dev/null; then
10985 ssizetype=`./ssize`
10986 echo "I'll be using $ssizetype for functions returning a byte count." >&4
10989 Help! I can't compile and run the ssize_t test program: please enlighten me!
10990 (This is probably a misconfiguration in your system or libraries, and
10991 you really ought to fix it. Still, I'll try anyway.)
10993 I need a type that is the same size as $sizetype, but is guaranteed to
10994 be signed. Common values are ssize_t, int and long.
10997 rp="What signed type is the same size as $sizetype?"
11001 $rm -f ssize ssize.*
11003 : see what type of char stdio uses.
11005 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11006 echo "Your stdio uses unsigned chars." >&4
11007 stdchar="unsigned char"
11009 echo "Your stdio uses signed chars." >&4
11013 : see if time exists
11015 if test "X$d_time" = X -o X"$timetype" = X; then
11016 if set time val -f d_time; eval $csym; $val; then
11017 echo 'time() found.' >&4
11019 rp="What is the type returned by time() on this system?"
11020 set time_t timetype long stdio.h sys/types.h
11023 echo 'time() not found, hope that will do.' >&4
11031 : see what type uids are declared as in the kernel
11033 echo "Looking for the type for user ids returned by getuid()."
11034 set uid_t uidtype xxx stdio.h sys/types.h
11038 xxx=`./findhdr sys/user.h`
11039 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
11041 unsigned) dflt="$1 $2" ;;
11045 *) dflt="$uidtype";;
11048 uid_t) echo "uid_t found." ;;
11049 *) rp="What is the type for user ids returned by getuid()?"
11055 : see if dbm.h is available
11056 : see if dbmclose exists
11057 set dbmclose d_dbmclose
11060 case "$d_dbmclose" in
11070 *) set rpcsvc/dbm.h i_rpcsvcdbm
11075 *) echo "We won't be including <dbm.h>"
11085 : see if this is a sys/file.h system
11090 : do we need to include sys/file.h ?
11094 if $h_sysfile; then
11096 echo "We'll be including <sys/file.h>." >&4
11099 echo "We won't be including <sys/file.h>." >&4
11109 : see if fcntl.h is there
11114 : see if we can include fcntl.h
11120 echo "We'll be including <fcntl.h>." >&4
11123 if $h_sysfile; then
11124 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11126 echo "We won't be including <fcntl.h>." >&4
11138 : see if locale.h is available
11139 set locale.h i_locale
11142 : see if this is a math.h system
11146 : see if ndbm.h is available
11151 : see if dbm_open exists
11152 set dbm_open d_dbm_open
11154 case "$d_dbm_open" in
11157 echo "We won't be including <ndbm.h>"
11166 : see if net/errno.h is available
11168 set net/errno.h val
11171 : Unfortunately, it causes problems on some systems. Arrgh.
11174 cat > try.c <<'EOM'
11177 #include <net/errno.h>
11183 if $cc $ccflags -c try.c >/dev/null 2>&1; then
11184 echo "We'll be including <net/errno.h>." >&4
11186 echo "We won't be including <net/errno.h>." >&4
11195 : get C preprocessor symbols handy
11197 $echo $n "Hmm... $c"
11198 echo $al | $tr ' ' $trnl >Cppsym.know
11199 $cat <<EOSS >Cppsym
11207 case "\$list\$#" in
11210 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
11212 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
11215 unknown="\$unknown \$sym"
11225 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
11227 exit 0; _ _ _ _\1\\ \1\\
11230 echo "exit 1; _ _ _" >>Cppsym\$\$
11231 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
11233 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
11239 $rm -f Cppsym\$\$ Cppsym2\$\$
11244 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
11246 : now check the C compiler for additional symbols
11252 for i in \`$cc -v -c tmp.c 2>&1\`
11255 -D*) echo "\$i" | $sed 's/^-D//';;
11256 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
11263 ./ccsym > ccsym1.raw
11264 if $test -s ccsym1.raw; then
11265 $sort ccsym1.raw | $uniq >ccsym.raw
11267 mv ccsym1.raw ccsym.raw
11270 $awk '/\=/ { print $0; next }
11271 { print $0"=1" }' ccsym.raw >ccsym.list
11272 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
11273 $comm -13 ccsym.true ccsym.list >ccsym.own
11274 $comm -12 ccsym.true ccsym.list >ccsym.com
11275 $comm -23 ccsym.true ccsym.list >ccsym.cpp
11278 if $test -z ccsym.raw; then
11279 echo "Your C compiler doesn't seem to define any symbol!" >&4
11281 echo "However, your C preprocessor defines the following ones:"
11284 if $test -s ccsym.com; then
11285 echo "Your C compiler and pre-processor define these symbols:"
11286 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
11289 $test "$silent" || sleep 1
11291 if $test -s ccsym.cpp; then
11292 $test "$also" && echo " "
11293 echo "Your C pre-processor ${also}defines the following $symbols:"
11294 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
11296 $test "$silent" || sleep 1
11298 if $test -s ccsym.own; then
11299 $test "$also" && echo " "
11300 echo "Your C compiler ${also}defines the following cpp variables:"
11301 $sed -e 's/\(.*\)=1/\1/' ccsym.own
11302 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
11303 $test "$silent" || sleep 1
11308 : see if this is a termio system
11312 if $test `./findhdr termios.h`; then
11313 set tcsetattr i_termios
11319 "$define") echo "You have POSIX termios.h... good!" >&4;;
11320 *) if ./Cppsym pyr; then
11321 case "`/bin/universe`" in
11322 ucb) if $test `./findhdr sgtty.h`; then
11324 echo "<sgtty.h> found." >&4
11326 echo "System is pyramid with BSD universe."
11327 echo "<sgtty.h> not found--you could have problems." >&4
11329 *) if $test `./findhdr termio.h`; then
11331 echo "<termio.h> found." >&4
11333 echo "System is pyramid with USG universe."
11334 echo "<termio.h> not found--you could have problems." >&4
11338 if $test `./findhdr termio.h`; then
11339 echo "<termio.h> found." >&4
11341 elif $test `./findhdr sgtty.h`; then
11342 echo "<sgtty.h> found." >&4
11345 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
11348 if $test `./findhdr sgtty.h`; then
11349 echo "<sgtty.h> found." >&4
11351 elif $test `./findhdr termio.h`; then
11352 echo "<termio.h> found." >&4
11355 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
11359 set i_termio; eval $setvar
11360 val=$val2; set i_sgtty; eval $setvar
11361 val=$val3; set i_termios; eval $setvar
11363 : see if stdarg is available
11365 if $test `./findhdr stdarg.h`; then
11366 echo "<stdarg.h> found." >&4
11369 echo "<stdarg.h> NOT found." >&4
11373 : see if varags is available
11375 if $test `./findhdr varargs.h`; then
11376 echo "<varargs.h> found." >&4
11378 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11381 : set up the varargs testing programs
11382 $cat > varargs.c <<EOP
11384 #include <stdarg.h>
11387 #include <varargs.h>
11391 int f(char *p, ...)
11405 p = va_arg(ap, char *);
11410 $cat > varargs <<EOP
11412 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11421 : now check which varargs header should be included
11426 if `./varargs I_STDARG`; then
11428 elif `./varargs I_VARARGS`; then
11433 if `./varargs I_VARARGS`; then
11440 echo "I could not find the definition for va_dcl... You have problems..." >&4
11441 val="$undef"; set i_stdarg; eval $setvar
11442 val="$undef"; set i_varargs; eval $setvar
11447 case "$i_varhdr" in
11449 val="$define"; set i_stdarg; eval $setvar
11450 val="$undef"; set i_varargs; eval $setvar
11453 val="$undef"; set i_stdarg; eval $setvar
11454 val="$define"; set i_varargs; eval $setvar
11457 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11461 : see if stddef is available
11462 set stddef.h i_stddef
11465 : see if sys/access.h is available
11466 set sysaccess.h i_sysaccess
11469 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
11470 set sys/filio.h i_sysfilio
11473 if $test `./findhdr sys/ioctl.h`; then
11475 echo '<sys/ioctl.h> found.' >&4
11478 if $test $i_sysfilio = "$define"; then
11479 echo '<sys/ioctl.h> NOT found.' >&4
11481 $test $i_sgtty = "$define" && xxx="sgtty.h"
11482 $test $i_termio = "$define" && xxx="termio.h"
11483 $test $i_termios = "$define" && xxx="termios.h"
11484 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
11490 : see if this is a sys/param system
11491 set sys/param.h i_sysparam
11494 : see if sys/resource.h has to be included
11495 set sys/resource.h i_sysresrc
11498 : see if sys/security.h is available
11499 set syssecrt.h i_syssecrt
11502 : see if this is a sys/un.h system
11503 set sys/un.h i_sysun
11506 : see if this is a syswait system
11507 set sys/wait.h i_syswait
11510 : see if this is an utime system
11511 set utime.h i_utime
11514 : see if this is a values.h system
11515 set values.h i_values
11518 : see if this is a vfork system
11521 set vfork.h i_vfork
11529 : see if gdbm.h is available
11534 : see if gdbm_open exists
11535 set gdbm_open d_gdbm_open
11537 case "$d_gdbm_open" in
11540 echo "We won't be including <gdbm.h>"
11550 echo "Looking for extensions..." >&4
11553 : If we are using the old config.sh, known_extensions may contain
11554 : old or inaccurate or duplicate values.
11555 known_extensions=''
11556 nonxs_extensions=''
11557 : We do not use find because it might not be available.
11558 : We do not just use MANIFEST because the user may have dropped
11559 : some additional extensions into the source tree and expect them
11563 DynaLoader|dynaload) ;;
11564 *) if $test -f $xxx/$xxx.xs; then
11565 known_extensions="$known_extensions $xxx"
11566 elif $test -f $xxx/Makefile.PL; then
11567 nonxs_extensions="$nonxs_extensions $xxx"
11569 if $test -d $xxx; then
11570 # Look for nested extensions, eg. Devel/Dprof.
11573 if $test -f $yyy/$yyy.xs; then
11574 known_extensions="$known_extensions $xxx/$yyy"
11575 elif $test -f $yyy/Makefile.PL; then
11576 nonxs_extensions="$nonxs_extensions $xxx/$yyy"
11585 set X $nonxs_extensions
11587 nonxs_extensions="$*"
11588 set X $known_extensions
11590 known_extensions="$*"
11593 : Now see which are supported on this system.
11595 for xxx in $known_extensions ; do
11599 $define) avail_ext="$avail_ext $xxx" ;;
11602 GDBM_File|gdbm_fil)
11604 $define) avail_ext="$avail_ext $xxx" ;;
11607 NDBM_File|ndbm_fil)
11609 $define) avail_ext="$avail_ext $xxx" ;;
11612 ODBM_File|odbm_fil)
11613 case "${i_dbm}${i_rpcsvcdbm}" in
11614 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
11618 case "$useposix" in
11619 true|define|y) avail_ext="$avail_ext $xxx" ;;
11623 case "$useopcode" in
11624 true|define|y) avail_ext="$avail_ext $xxx" ;;
11628 case "$d_socket" in
11629 true|$define|y) avail_ext="$avail_ext $xxx" ;;
11633 case "$usethreads" in
11634 true|$define|y) avail_ext="$avail_ext $xxx" ;;
11638 : XXX Do we need a useipcsysv variable here
11639 case "${d_msg}${d_sem}${d_shm}" in
11640 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
11643 *) avail_ext="$avail_ext $xxx"
11652 : Now see which nonxs extensions are supported on this system.
11653 : For now assume all are.
11655 for xxx in $nonxs_extensions ; do
11657 *) nonxs_ext="$nonxs_ext $xxx"
11669 A number of extensions are supplied with $package. You may choose to
11670 compile these extensions for dynamic loading (the default), compile
11671 them into the $package executable (static loading), or not include
11672 them at all. Answer "none" to include no extensions.
11673 Note that DynaLoader is always built and need not be mentioned here.
11676 case "$dynamic_ext" in
11677 '') dflt="$avail_ext" ;;
11678 *) dflt="$dynamic_ext"
11679 # Perhaps we are reusing an old out-of-date config.sh.
11682 if test X"$dynamic_ext" != X"$avail_ext"; then
11684 NOTICE: Your previous config.sh list may be incorrect.
11685 The extensions now available to you are
11687 but the default list from your previous config.sh is
11699 rp="What extensions do you wish to load dynamically?"
11702 none) dynamic_ext=' ' ;;
11703 *) dynamic_ext="$ans" ;;
11706 case "$static_ext" in
11708 : Exclude those already listed in dynamic linking
11710 for xxx in $avail_ext; do
11711 case " $dynamic_ext " in
11713 *) dflt="$dflt $xxx" ;;
11720 *) dflt="$static_ext"
11727 rp="What extensions do you wish to load statically?"
11730 none) static_ext=' ' ;;
11731 *) static_ext="$ans" ;;
11736 A number of extensions are supplied with $package. Answer "none"
11737 to include no extensions.
11738 Note that DynaLoader is always built and need not be mentioned here.
11741 case "$static_ext" in
11742 '') dflt="$avail_ext" ;;
11743 *) dflt="$static_ext"
11744 # Perhaps we are reusing an old out-of-date config.sh.
11747 if test X"$static_ext" != X"$avail_ext"; then
11749 NOTICE: Your previous config.sh list may be incorrect.
11750 The extensions now available to you are
11752 but the default list from your previous config.sh is
11761 : Exclude those that are not xs extensions
11765 rp="What extensions do you wish to include?"
11768 none) static_ext=' ' ;;
11769 *) static_ext="$ans" ;;
11774 set X $dynamic_ext $static_ext $nonxs_ext
11778 : Remove build directory name from cppstdin so it can be used from
11779 : either the present location or the final installed location.
11781 : Get out of the UU directory to get correct path name.
11783 case "$cppstdin" in
11785 echo "Stripping down cppstdin path name"
11791 : end of configuration questions
11793 echo "End of configuration questions."
11796 : back to where it started
11797 if test -d ../UU; then
11801 : configuration may be patched via a 'config.over' file
11802 if $test -f config.over; then
11805 rp='I see a config.over file. Do you wish to load it?'
11808 n*) echo "OK, I'll ignore it.";;
11810 echo "Configuration override changes have been loaded."
11815 : in case they want portability, strip down executable paths
11816 case "$d_portable" in
11819 echo "Stripping down executable paths..." >&4
11820 for file in $loclist $trylist; do
11821 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
11822 eval $file="\$file"
11828 : create config.sh file
11830 echo "Creating config.sh..." >&4
11831 $spitshell <<EOT >config.sh
11834 # This file was produced by running the Configure script. It holds all the
11835 # definitions figured out by Configure. Should you modify one of these values,
11836 # do not forget to propagate your changes by running "Configure -der". You may
11837 # instead choose to run each of the .SH files by yourself, or "Configure -S".
11840 # Package name : $package
11841 # Source directory : $src
11842 # Configuration time: $cf_time
11843 # Configured by : $cf_by
11844 # Target system : $myuname
11854 Revision='$Revision'
11861 alignbytes='$alignbytes'
11862 ansi2knr='$ansi2knr'
11863 aphostname='$aphostname'
11864 apiversion='$apiversion'
11867 archlibexp='$archlibexp'
11868 archname='$archname'
11869 archobjs='$archobjs'
11877 byteorder='$byteorder'
11879 castflags='$castflags'
11882 cccdlflags='$cccdlflags'
11883 ccdlflags='$ccdlflags'
11886 cf_email='$cf_email'
11891 clocktype='$clocktype'
11893 compress='$compress'
11894 contains='$contains'
11898 cpp_stuff='$cpp_stuff'
11899 cppflags='$cppflags'
11901 cppminus='$cppminus'
11903 cppstdin='$cppstdin'
11904 cryptlib='$cryptlib'
11906 d_Gconvert='$d_Gconvert'
11907 d_access='$d_access'
11908 d_accessx='$d_accessx'
11910 d_archlib='$d_archlib'
11911 d_attribut='$d_attribut'
11915 d_bsdgetpgrp='$d_bsdgetpgrp'
11916 d_bsdsetpgrp='$d_bsdsetpgrp'
11918 d_casti32='$d_casti32'
11919 d_castneg='$d_castneg'
11920 d_charvspr='$d_charvspr'
11922 d_chroot='$d_chroot'
11923 d_chsize='$d_chsize'
11924 d_closedir='$d_closedir'
11928 d_cuserid='$d_cuserid'
11929 d_dbl_dig='$d_dbl_dig'
11930 d_dbmclose64='$d_dbmclose64'
11931 d_dbminit64='$d_dbminit64'
11932 d_delete64='$d_delete64'
11933 d_difftime='$d_difftime'
11934 d_dirent64s='$d_dirent64s'
11935 d_dirnamlen='$d_dirnamlen'
11936 d_dlerror='$d_dlerror'
11937 d_dlopen='$d_dlopen'
11938 d_dlsymun='$d_dlsymun'
11939 d_dosuid='$d_dosuid'
11941 d_eaccess='$d_eaccess'
11942 d_endgrent='$d_endgrent'
11943 d_endhent='$d_endhent'
11944 d_endnent='$d_endnent'
11945 d_endpent='$d_endpent'
11946 d_endpwent='$d_endpwent'
11947 d_endsent='$d_endsent'
11948 d_eofnblk='$d_eofnblk'
11949 d_eunice='$d_eunice'
11950 d_fchmod='$d_fchmod'
11951 d_fchown='$d_fchown'
11953 d_fd_macros='$d_fd_macros'
11954 d_fd_set='$d_fd_set'
11955 d_fds_bits='$d_fds_bits'
11956 d_fetch64='$d_fetch64'
11957 d_fgetpos64='$d_fgetpos64'
11958 d_fgetpos='$d_fgetpos'
11959 d_firstkey64='$d_firstkey64'
11960 d_flexfnam='$d_flexfnam'
11961 d_flock64s='$d_flock64s'
11963 d_fopen64='$d_fopen64'
11965 d_fpathconf='$d_fpathconf'
11966 d_freopen64='$d_freopen64'
11967 d_fseek64='$d_fseek64'
11968 d_fseeko64='$d_fseeko64'
11969 d_fseeko='$d_fseeko'
11970 d_fsetpos64='$d_fsetpos64'
11971 d_fsetpos='$d_fsetpos'
11972 d_fstat64='$d_fstat64'
11973 d_ftell64='$d_ftell64'
11974 d_ftello64='$d_ftello64'
11975 d_ftello='$d_ftello'
11977 d_ftruncate64='$d_ftruncate64'
11978 d_getgrent='$d_getgrent'
11979 d_getgrps='$d_getgrps'
11980 d_gethbyaddr='$d_gethbyaddr'
11981 d_gethbyname='$d_gethbyname'
11982 d_gethent='$d_gethent'
11983 d_gethname='$d_gethname'
11984 d_gethostprotos='$d_gethostprotos'
11985 d_getlogin='$d_getlogin'
11986 d_getnbyaddr='$d_getnbyaddr'
11987 d_getnbyname='$d_getnbyname'
11988 d_getnent='$d_getnent'
11989 d_getnetprotos='$d_getnetprotos'
11990 d_getpbyname='$d_getpbyname'
11991 d_getpbynumber='$d_getpbynumber'
11992 d_getpent='$d_getpent'
11993 d_getpgid='$d_getpgid'
11994 d_getpgrp2='$d_getpgrp2'
11995 d_getpgrp='$d_getpgrp'
11996 d_getppid='$d_getppid'
11997 d_getprior='$d_getprior'
11998 d_getprotoprotos='$d_getprotoprotos'
11999 d_getpwent='$d_getpwent'
12000 d_getsbyname='$d_getsbyname'
12001 d_getsbyport='$d_getsbyport'
12002 d_getsent='$d_getsent'
12003 d_getservprotos='$d_getservprotos'
12004 d_gettimeod='$d_gettimeod'
12005 d_gnulibc='$d_gnulibc'
12006 d_grpasswd='$d_grpasswd'
12009 d_inetaton='$d_inetaton'
12010 d_ino64t='$d_ino64t'
12011 d_int64t='$d_int64t'
12012 d_isascii='$d_isascii'
12013 d_killpg='$d_killpg'
12014 d_lchown='$d_lchown'
12016 d_locconv='$d_locconv'
12017 d_lockf64='$d_lockf64'
12019 d_longdbl='$d_longdbl'
12020 d_longlong='$d_longlong'
12021 d_lseek64='$d_lseek64'
12022 d_lstat64='$d_lstat64'
12025 d_mbstowcs='$d_mbstowcs'
12026 d_mbtowc='$d_mbtowc'
12027 d_memcmp='$d_memcmp'
12028 d_memcpy='$d_memcpy'
12029 d_memmove='$d_memmove'
12030 d_memset='$d_memset'
12032 d_mkfifo='$d_mkfifo'
12033 d_mktime='$d_mktime'
12035 d_msgctl='$d_msgctl'
12036 d_msgget='$d_msgget'
12037 d_msgrcv='$d_msgrcv'
12038 d_msgsnd='$d_msgsnd'
12039 d_mymalloc='$d_mymalloc'
12040 d_nextkey64='$d_nextkey64'
12042 d_off64t='$d_off64t'
12043 d_oldpthreads='$d_oldpthreads'
12044 d_oldsock='$d_oldsock'
12046 d_open64='$d_open64'
12047 d_opendir64='$d_opendir64'
12048 d_pathconf='$d_pathconf'
12050 d_phostname='$d_phostname'
12053 d_portable='$d_portable'
12054 d_pthread_yield='$d_pthread_yield'
12055 d_pthreads_created_joinable='$d_pthreads_created_joinable'
12057 d_pwchange='$d_pwchange'
12058 d_pwclass='$d_pwclass'
12059 d_pwcomment='$d_pwcomment'
12060 d_pwexpire='$d_pwexpire'
12061 d_pwgecos='$d_pwgecos'
12062 d_pwpasswd='$d_pwpasswd'
12063 d_pwquota='$d_pwquota'
12064 d_readdir64='$d_readdir64'
12065 d_readdir='$d_readdir'
12066 d_readlink='$d_readlink'
12067 d_rename='$d_rename'
12068 d_rewinddir='$d_rewinddir'
12070 d_safebcpy='$d_safebcpy'
12071 d_safemcpy='$d_safemcpy'
12072 d_sanemcmp='$d_sanemcmp'
12073 d_sched_yield='$d_sched_yield'
12074 d_seekdir64='$d_seekdir64'
12075 d_seekdir='$d_seekdir'
12076 d_select='$d_select'
12078 d_semctl='$d_semctl'
12079 d_semctl_semid_ds='$d_semctl_semid_ds'
12080 d_semctl_semun='$d_semctl_semun'
12081 d_semget='$d_semget'
12083 d_setegid='$d_setegid'
12084 d_seteuid='$d_seteuid'
12085 d_setgrent='$d_setgrent'
12086 d_setgrps='$d_setgrps'
12087 d_sethent='$d_sethent'
12088 d_setlinebuf='$d_setlinebuf'
12089 d_setlocale='$d_setlocale'
12090 d_setnent='$d_setnent'
12091 d_setpent='$d_setpent'
12092 d_setpgid='$d_setpgid'
12093 d_setpgrp2='$d_setpgrp2'
12094 d_setpgrp='$d_setpgrp'
12095 d_setprior='$d_setprior'
12096 d_setpwent='$d_setpwent'
12097 d_setregid='$d_setregid'
12098 d_setresgid='$d_setresgid'
12099 d_setresuid='$d_setresuid'
12100 d_setreuid='$d_setreuid'
12101 d_setrgid='$d_setrgid'
12102 d_setruid='$d_setruid'
12103 d_setsent='$d_setsent'
12104 d_setsid='$d_setsid'
12105 d_setvbuf='$d_setvbuf'
12109 d_shmatprototype='$d_shmatprototype'
12110 d_shmctl='$d_shmctl'
12112 d_shmget='$d_shmget'
12113 d_sigaction='$d_sigaction'
12114 d_sigsetjmp='$d_sigsetjmp'
12115 d_socket='$d_socket'
12116 d_sockpair='$d_sockpair'
12117 d_stat64='$d_stat64'
12118 d_statblks='$d_statblks'
12119 d_stdio_cnt_lval='$d_stdio_cnt_lval'
12120 d_stdio_ptr_lval='$d_stdio_ptr_lval'
12121 d_stdiobase='$d_stdiobase'
12122 d_stdstdio='$d_stdstdio'
12123 d_store64='$d_store64'
12124 d_strchr='$d_strchr'
12125 d_strcoll='$d_strcoll'
12126 d_strctcpy='$d_strctcpy'
12127 d_strerrm='$d_strerrm'
12128 d_strerror='$d_strerror'
12129 d_strtod='$d_strtod'
12130 d_strtol='$d_strtol'
12131 d_strtoul='$d_strtoul'
12132 d_strxfrm='$d_strxfrm'
12133 d_suidsafe='$d_suidsafe'
12134 d_symlink='$d_symlink'
12135 d_syscall='$d_syscall'
12136 d_sysconf='$d_sysconf'
12137 d_sysernlst='$d_sysernlst'
12138 d_syserrlst='$d_syserrlst'
12139 d_system='$d_system'
12140 d_tcgetpgrp='$d_tcgetpgrp'
12141 d_tcsetpgrp='$d_tcsetpgrp'
12142 d_telldir64='$d_telldir64'
12143 d_telldir='$d_telldir'
12146 d_tmpfile64='$d_tmpfile64'
12147 d_truncate64='$d_truncate64'
12148 d_truncate='$d_truncate'
12149 d_tzname='$d_tzname'
12152 d_union_semun='$d_union_semun'
12154 d_void_closedir='$d_void_closedir'
12155 d_voidsig='$d_voidsig'
12156 d_voidtty='$d_voidtty'
12157 d_volatile='$d_volatile'
12158 d_vprintf='$d_vprintf'
12160 d_waitpid='$d_waitpid'
12161 d_wcstombs='$d_wcstombs'
12162 d_wctomb='$d_wctomb'
12165 db_hashtype='$db_hashtype'
12166 db_prefixtype='$db_prefixtype'
12167 defvoidused='$defvoidused'
12168 direntrytype='$direntrytype'
12171 doublesize='$doublesize'
12172 dynamic_ext='$dynamic_ext'
12178 eunicefix='$eunicefix'
12181 extensions='$extensions'
12183 firstmakefile='$firstmakefile'
12185 fpostype='$fpostype'
12186 freetype='$freetype'
12187 full_csh='$full_csh'
12188 full_sed='$full_sed'
12189 gccversion='$gccversion'
12193 groupcat='$groupcat'
12194 groupstype='$groupstype'
12197 h_sysfile='$h_sysfile'
12201 i_arpainet='$i_arpainet'
12202 i_bsdioctl='$i_bsdioctl'
12205 i_dirent='$i_dirent'
12212 i_inttypes='$i_inttypes'
12213 i_limits='$i_limits'
12214 i_locale='$i_locale'
12215 i_malloc='$i_malloc'
12217 i_memory='$i_memory'
12220 i_neterrno='$i_neterrno'
12223 i_rpcsvcdbm='$i_rpcsvcdbm'
12226 i_stdarg='$i_stdarg'
12227 i_stddef='$i_stddef'
12228 i_stdlib='$i_stdlib'
12229 i_string='$i_string'
12230 i_sysaccess='$i_sysaccess'
12231 i_sysdir='$i_sysdir'
12232 i_sysfile='$i_sysfile'
12233 i_sysfilio='$i_sysfilio'
12235 i_sysioctl='$i_sysioctl'
12236 i_sysndir='$i_sysndir'
12237 i_sysparam='$i_sysparam'
12238 i_sysresrc='$i_sysresrc'
12239 i_syssecrt='$i_syssecrt'
12240 i_sysselct='$i_sysselct'
12241 i_syssockio='$i_syssockio'
12242 i_sysstat='$i_sysstat'
12243 i_systime='$i_systime'
12244 i_systimek='$i_systimek'
12245 i_systimes='$i_systimes'
12246 i_systypes='$i_systypes'
12248 i_syswait='$i_syswait'
12249 i_termio='$i_termio'
12250 i_termios='$i_termios'
12252 i_unistd='$i_unistd'
12254 i_values='$i_values'
12255 i_varargs='$i_varargs'
12256 i_varhdr='$i_varhdr'
12260 installarchlib='$installarchlib'
12261 installbin='$installbin'
12262 installman1dir='$installman1dir'
12263 installman3dir='$installman3dir'
12264 installprivlib='$installprivlib'
12265 installscript='$installscript'
12266 installsitearch='$installsitearch'
12267 installsitelib='$installsitelib'
12269 known_extensions='$known_extensions'
12273 lddlflags='$lddlflags'
12281 libswanted='$libswanted'
12287 locincpth='$locincpth'
12288 loclibpth='$loclibpth'
12289 longdblsize='$longdblsize'
12290 longlongsize='$longlongsize'
12291 longsize='$longsize'
12295 lseeksize='$lseeksize'
12296 lseektype='$lseektype'
12300 make_set_make='$make_set_make'
12301 mallocobj='$mallocobj'
12302 mallocsrc='$mallocsrc'
12303 malloctype='$malloctype'
12305 man1direxp='$man1direxp'
12308 man3direxp='$man3direxp'
12312 mips_type='$mips_type'
12315 modetype='$modetype'
12318 myarchname='$myarchname'
12319 mydomain='$mydomain'
12320 myhostname='$myhostname'
12323 netdb_hlen_type='$netdb_hlen_type'
12324 netdb_host_type='$netdb_host_type'
12325 netdb_name_type='$netdb_name_type'
12326 netdb_net_type='$netdb_net_type'
12329 nm_so_opt='$nm_so_opt'
12330 nonxs_ext='$nonxs_ext'
12332 o_nonblock='$o_nonblock'
12334 optimize='$optimize'
12335 orderlib='$orderlib'
12341 patchlevel='$patchlevel'
12342 path_sep='$path_sep'
12344 perladmin='$perladmin'
12345 perlpath='$perlpath'
12347 phostname='$phostname'
12353 prefixexp='$prefixexp'
12355 privlibexp='$privlibexp'
12356 prototype='$prototype'
12358 randbits='$randbits'
12360 rd_nodata='$rd_nodata'
12364 scriptdir='$scriptdir'
12365 scriptdirexp='$scriptdirexp'
12367 selectminbits='$selectminbits'
12368 selecttype='$selecttype'
12369 sendmail='$sendmail'
12372 sharpbang='$sharpbang'
12373 shmattype='$shmattype'
12374 shortsize='$shortsize'
12377 sig_name='$sig_name'
12378 sig_name_init='$sig_name_init'
12380 signal_t='$signal_t'
12381 sitearch='$sitearch'
12382 sitearchexp='$sitearchexp'
12384 sitelibexp='$sitelibexp'
12385 sizetype='$sizetype'
12390 sockethdr='$sockethdr'
12391 socketlib='$socketlib'
12393 spackage='$spackage'
12394 spitshell='$spitshell'
12397 ssizetype='$ssizetype'
12398 startperl='$startperl'
12400 static_ext='$static_ext'
12402 stdio_base='$stdio_base'
12403 stdio_bufsiz='$stdio_bufsiz'
12404 stdio_cnt='$stdio_cnt'
12405 stdio_filbuf='$stdio_filbuf'
12406 stdio_ptr='$stdio_ptr'
12409 subversion='$subversion'
12416 timeincl='$timeincl'
12417 timetype='$timetype'
12425 use64bits='$use64bits'
12427 usemymalloc='$usemymalloc'
12429 useopcode='$useopcode'
12430 useperlio='$useperlio'
12431 useposix='$useposix'
12433 useshrplib='$useshrplib'
12434 usethreads='$usethreads'
12435 usevfork='$usevfork'
12440 voidflags='$voidflags'
12446 : Add in command line options if available
12447 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
12449 : add special variables
12450 $test -f $src/patchlevel.h && \
12451 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
12452 echo "CONFIG=true" >>config.sh
12454 : propagate old symbols
12455 if $test -f UU/config.sh; then
12456 <UU/config.sh sort | uniq >UU/oldconfig.sh
12457 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
12458 sort | uniq -u >UU/oldsyms
12459 set X `cat UU/oldsyms`
12465 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
12467 echo "# Variables propagated from previous config.sh file." >>config.sh
12468 for sym in `cat UU/oldsyms`; do
12469 echo " Propagating $hint variable "'$'"$sym..."
12470 eval 'tmp="$'"${sym}"'"'
12472 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
12478 : Finish up by extracting the .SH files
12492 If you'd like to make any changes to the config.sh file before I begin
12493 to configure things, do it as a shell escape now (e.g. !vi config.sh).
12496 rp="Press return or use a shell escape to edit config.sh:"
12501 *) : in case they cannot read
12502 sh 1>&4 -c "$ans";;
12507 : if this fails, just run all the .SH files by hand
12514 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
12521 Now you need to generate make dependencies by running "make depend".
12522 You might prefer to run it in background: "make depend > makedepend.out &"
12523 It can take a while, so you might not want to run it right now.
12528 rp="Run make depend now?"
12532 make depend && echo "Now you must run a make."
12535 echo "You must run 'make depend' then 'make'."
12538 elif test -f [Mm]akefile; then
12540 echo "Now you must run a make."
12545 if $test -f Policy.sh; then
12548 If you compile $package on a different machine or from a different object
12549 directory, copy the Policy.sh file from this object directory to the
12550 new one before you run Configure -- this will help you with most of
12551 the policy defaults.
12555 if $test -f config.msg; then
12556 echo "Hmm. I also noted the following information while running:"
12558 $cat config.msg >&4
12561 $rm -f kit*isdone ark*isdone