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 Tue Jul 7 10:10:21 EDT 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
414 d_pthreads_created_joinable=''
623 ignore_versioned_solibs=''
731 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
740 : We must find out about Eunice early
742 if test -f /etc/unixtovms; then
743 eunicefix=/etc/unixtovms
745 if test -f /etc/unixtovms.exe; then
746 eunicefix=/etc/unixtovms.exe
749 : list of known cpp symbols, sorted alphabetically
750 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
751 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
752 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
753 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
754 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
755 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
756 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
757 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
758 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
759 al="$al VMS Xenix286"
760 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI _POWER"
761 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
762 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
763 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
764 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
765 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
766 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
767 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
768 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
769 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
770 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
771 al="$al __SVR4_2__ __UMAXV__"
772 al="$al ____386BSD____ __alpha __alpha__ __amiga"
773 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
774 al="$al __host_mips__"
775 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
776 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
777 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
778 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
779 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
780 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
781 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
782 al="$al __mc88100 __mc88100__ __mips __mips__"
783 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
784 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
785 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
786 al="$al _host_mips _mips _unix"
787 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
788 al="$al apollo ardent att386 att3b"
789 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
790 al="$al cadmus clipper concurrent convex cray ctix"
791 al="$al dmert encore gcos gcx gimpel gould"
792 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
793 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
794 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
795 al="$al i186 i286 i386 i486 i8086"
796 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
797 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
798 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
799 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
800 al="$al mc88000 mc88100 merlin mert mips mvs n16"
801 al="$al ncl_el ncl_mr"
802 al="$al news1500 news1700 news1800 news1900 news3700"
803 al="$al news700 news800 news900 ns16000 ns32000"
804 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
805 al="$al parisc pc532 pdp11 plexus posix pyr"
806 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
807 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
808 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
809 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
810 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
811 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
815 : change the next line if compiling for Xenix/286 on Xenix/386
816 xlibpth='/usr/lib/386 /lib/386'
818 : Possible local library directories to search.
819 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
820 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
822 : general looking path for locating libraries
823 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
824 glibpth="$glibpth /lib /usr/lib $xlibpth"
825 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
826 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
828 : Private path used by Configure to find libraries. Its value
829 : is prepended to libpth. This variable takes care of special
830 : machines, like the mips. Usually, it should be empty.
833 : default library list
835 : some systems want only to use the non-versioned libso:s
836 ignore_versioned_solibs=''
837 : Possible local include directories to search.
838 : Set locincpth to "" in a hint file to defeat local include searches.
839 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
840 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
842 : no include file wanted by default
845 : Trailing extension. Override this in a hint file, if needed.
847 : Extra object files, if any, needed on this platform.
850 : full support for void wanted by default
853 : set useposix=false in your hint file to disable the POSIX extension.
855 : set useopcode=false in your hint file to disable the Opcode extension.
857 : set usethreads on the Configure command line to enable threads.
858 : List of libraries we want.
859 : If anyone needs -lnet, put it in a hint file.
860 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
861 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
862 libswanted="$libswanted ucb bsd BSD PW x util"
863 : We probably want to search /usr/shlib before most other libraries.
864 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
865 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
866 glibpth="/usr/shlib $glibpth"
867 : Do not use vfork unless overridden by a hint file.
870 : Find the basic shell for Bourne shell scripts
874 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
877 if test -f "$xxx"; then
880 : Build up a list and do a single loop so we can 'break' out.
881 pth=`echo $PATH | sed -e "s/$p_/ /g"`
882 for xxx in sh bash ksh pdksh ash; do
884 try="$try ${p}/${xxx}"
888 if test -f "$xxx"; then
891 elif test -f "$xxx.exe"; then
902 $me: Fatal Error: I can't find a Bourne Shell anywhere.
904 Usually it's in /bin/sh. How did you even get this far?
905 Please contact perlbug@perl.com and we'll try to straighten this all out.
911 : see if sh knows # comments
912 if `$sh -c '#' >/dev/null 2>&1`; then
916 test -f $xcat || xcat=/usr/bin/cat
921 if test -s today; then
924 echo "#! $xcat" > try
928 if test -s today; then
936 echo "Your $sh doesn't grok # comments--I will strip them later on."
939 echo "exec grep -v '^[ ]*#'" >spitshell
942 spitshell=`pwd`/spitshell
944 echo "I presume that if # doesn't work, #! won't work either!"
949 : figure out how to guarantee sh startup
951 '') startsh=${sharpbang}${sh} ;;
963 : echo "Yup, it does."
965 echo "Hmm... '$startsh' does not guarantee sh startup..."
966 echo "You may have to fix up the shell scripts to make sure $sh runs them."
971 : Save command line options in file UU/cmdline.opt for later use in
972 : generating config.sh.
973 cat > cmdline.opt <<EOSH
974 # Configure command line arguments.
981 cat >>cmdline.opt <<EOSH
982 config_arg$argn='$arg'
984 argn=`expr $argn + 1`
987 : produce awk script to parse command line options
988 cat >options.awk <<'EOF'
990 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
992 len = length(optstr);
993 for (i = 1; i <= len; i++) {
994 c = substr(optstr, i, 1);
995 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1006 if (substr(str, 1, 1) != "-") {
1007 printf("'%s'\n", str);
1011 for (i = 2; i <= len; i++) {
1012 c = substr(str, i, 1);
1014 printf("-%s\n", substr(str, i));
1020 printf("'%s'\n", substr(str, i + 1));
1033 : process the command line options
1034 set X `for arg in "$@"; do echo "X$arg"; done |
1035 sed -e s/X// | awk -f options.awk`
1040 : set up default values
1051 cat >optdef.sh <<EOS
1057 while test $# -gt 0; do
1059 -d) shift; fastread=yes;;
1060 -e) shift; alldone=cont;;
1064 if test -r "$1"; then
1067 echo "$me: cannot read config file $1." >&2
1072 -h) shift; error=true;;
1073 -r) shift; reuseval=true;;
1074 -s) shift; silent=true; realsilent=true;;
1075 -E) shift; alldone=exit;;
1076 -K) shift; knowitall=true;;
1077 -O) shift; override=true;;
1078 -S) shift; silent=true; extractsh=true;;
1083 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1084 echo "$me: ignoring -D $1" >&2
1087 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1088 *) echo "$1='define'" >> optdef.sh;;
1095 *=) echo "$1" >> optdef.sh;;
1097 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1098 echo "$me: ignoring -U $1" >&2
1100 *) echo "$1='undef'" >> optdef.sh;;
1104 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1107 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1115 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1116 [-U symbol] [-U symbol=]
1117 -d : use defaults for all answers.
1118 -e : go on without questioning past the production of config.sh.
1119 -f : specify an alternate default configuration file.
1120 -h : print this help message and exit (with an error status).
1121 -r : reuse C symbols value if possible (skips costly nm extraction).
1122 -s : silent mode, only echoes questions and essential information.
1123 -D : define symbol to have some value:
1124 -D symbol symbol gets the value 'define'
1125 -D symbol=value symbol gets the value 'value'
1126 -E : stop at the end of questions, after having produced config.sh.
1127 -K : do not use unless you know what you are doing.
1128 -O : let -D and -U override definitions from loaded configuration file.
1129 -S : perform variable substitutions on all .SH files (can mix with -f)
1130 -U : undefine symbol:
1131 -U symbol symbol gets the value 'undef'
1132 -U symbol= symbol gets completely empty
1133 -V : print version number and exit (with a zero status).
1140 case "$fastread$alldone" in
1143 if test ! -t 0; then
1144 echo "Say 'sh Configure', not 'sh <Configure'"
1152 true) exec 1>/dev/null;;
1155 : run the defines and the undefines, if any, but leave the file out there...
1161 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1162 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1163 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1164 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1165 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1168 : Some greps do not return status, grrr.
1169 echo "grimblepritz" >grimble
1170 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1172 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1178 : the following should work in any shell
1182 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1183 cat >contains <<'EOSS'
1184 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1189 : Find the path to the source tree
1192 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1203 if test -f $rsrc/Configure && \
1204 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1206 : found it, so we are ok.
1209 for src in . .. ../.. ../../.. ../../../..; do
1210 if test -f ../$src/Configure && \
1211 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1222 Sorry, I can't seem to locate the source dir for $package. Please start
1223 Configure with an explicit path -- i.e. /some/path/Configure.
1231 echo "Sources for $package found in \"$src\"." >&4
1235 : script used to extract .SH files with variable substitutions
1236 cat >extract <<'EOS'
1238 echo "Doing variable substitutions on .SH files..."
1239 if test -f $src/MANIFEST; then
1240 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1242 echo "(Looking for .SH files under the source directory.)"
1243 set x `(cd $src; find . -name "*.SH" -print)`
1247 0) set x `(cd $src; echo *.SH)`; shift;;
1249 if test ! -f $src/$1; then
1255 while test $name; do
1256 if test ! -d "$name"; then
1257 create="$name $create";
1258 name=`echo $name | sed -e "s|^[^/]*$||"`;
1259 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1264 for file in $create; do
1273 dir=`expr X$file : 'X\(.*\)/'`
1274 file=`expr X$file : 'X.*/\(.*\)'`
1275 (cd $dir && . ./$file)
1285 dir=`expr X$file : 'X\(.*\)/'`
1286 file=`expr X$file : 'X.*/\(.*\)'`
1287 (set x $dir; shift; eval $mkdir_p)
1297 if test -f $src/config_h.SH; then
1298 if test ! -f config.h; then
1299 : oops, they left it out of MANIFEST, probably, so do it anyway.
1305 : extract files and exit if asked to do so
1306 case "$extractsh" in
1308 case "$realsilent" in
1312 case "$config_sh" in
1313 '') config_sh='config.sh';;
1316 echo "Fetching answers from $config_sh..."
1319 test "$override" && . ./optdef.sh
1328 : Eunice requires " " instead of "", can you believe it
1331 echo "Beginning of configuration questions for $package."
1333 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1335 : first determine how to suppress newline on echo command
1337 echo "Checking echo to see how to suppress newlines..."
1338 (echo "hi there\c" ; echo " ") >.echotmp
1339 if $contains c .echotmp >/dev/null 2>&1 ; then
1350 echo $n "The star should be here-->$c"
1354 : Now test for existence of everything in MANIFEST
1356 if test -f $rsrc/MANIFEST; then
1357 echo "First let's make sure your kit is complete. Checking..." >&4
1358 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1361 for filelist in x??; do
1362 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1364 if test -s missing; then
1368 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1370 You have the option of continuing the configuration process, despite the
1371 distinct possibility that your kit is damaged, by typing 'y'es. If you
1372 do, don't blame me if something goes wrong. I advise you to type 'n'o
1373 and then contact perlbug@perl.com.
1376 echo $n "Continue? [n] $c" >&4
1380 echo "Continuing..." >&4
1384 echo "ABORTING..." >&4
1389 echo "Looks good..."
1392 echo "There is no MANIFEST file. I hope your kit is complete !"
1397 : Find the appropriate value for a newline for tr
1398 if test -n "$DJGPP"; then
1401 if test X"$trnl" = X; then
1402 case "`echo foo|tr '\n' x 2>/dev/null`" in
1406 if test X"$trnl" = X; then
1407 case "`echo foo|tr '\012' x 2>/dev/null`" in
1408 foox) trnl='\012' ;;
1411 if test X"$trnl" = X; then
1414 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1420 : compute the number of columns on the terminal for proper question formatting
1425 : set up the echo used in my read
1426 myecho="case \"\$xxxm\" in
1427 '') echo $n \"\$rp $c\" >&4;;
1429 '') echo $n \"[\$xxxm] $c\";;
1431 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1433 echo $n \"[\$xxxm] $c\" >&4
1435 echo $n \"\$rp [\$xxxm] $c\" >&4
1441 : now set up to do reads with possible shell escape and default assignment
1447 case "\$fastread" in
1448 yes) case "\$dflt" in
1451 case "\$silent-\$rp" in
1456 *) case "\$silent" in
1457 true) case "\$rp" in
1462 while expr "X\$ans" : "X!" >/dev/null; do
1466 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1474 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1483 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1488 echo "(OK, I'll run with -d after this question.)" >&4
1491 echo "*** Sorry, \$1 not supported yet." >&4
1501 echo "*** Substitution done -- please confirm."
1503 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1508 echo "*** Error -- try again."
1515 case "\$ans\$xxxm\$nostick" in
1527 : create .config dir to save info across Configure sessions
1528 test -d ../.config || mkdir ../.config
1529 cat >../.config/README <<EOF
1530 This directory created by Configure to save information that should
1531 persist across sessions for $package.
1533 You may safely delete it if you wish.
1536 : general instructions
1539 user=`(logname) 2>/dev/null`
1541 '') user=`whoami 2>&1`;;
1543 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1546 rp='Would you like to see the instructions?'
1557 This installation shell script will examine your system and ask you questions
1558 to determine how the perl5 package should be installed. If you get
1559 stuck on a question, you may use a ! shell escape to start a subshell or
1560 execute a command. Many of the questions will have default answers in square
1561 brackets; typing carriage return will give you the default.
1563 On some of the questions which ask for file or directory names you are allowed
1564 to use the ~name construct to specify the login directory belonging to "name",
1565 even if you don't have a shell which knows about that. Questions where this is
1566 allowed will be marked "(~name ok)".
1570 dflt='Type carriage return to continue'
1574 The prompter used in this script allows you to use shell variables and
1575 backticks in your answers. You may use $1, $2, etc... to refer to the words
1576 in the default answer, as if the default line was a set of arguments given to a
1577 script shell. This means you may also use $* to repeat the whole default line,
1578 so you do not have to re-type everything to add something to the default.
1580 Everytime there is a substitution, you will have to confirm. If there is an
1581 error (e.g. an unmatched backtick), the default answer will remain unchanged
1582 and you will be prompted again.
1584 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1585 the questions and use the computed defaults (or the previous answers if there
1586 was already a config.sh file). Type 'Configure -h' for a list of options.
1587 You may also start interactively and then answer '& -d' at any prompt to turn
1588 on the non-interactive behaviour for the remainder of the execution.
1594 Much effort has been expended to ensure that this shell script will run on any
1595 Unix system. If despite that it blows up on yours, your best bet is to edit
1596 Configure and run it again. If you can't run Configure for some reason,
1597 you'll have to generate a config.sh file by hand. Whatever problems you
1598 have, let perlbug@perl.com know how I blew it.
1600 This installation script affects things in two ways:
1602 1) it may do direct variable substitutions on some of the files included
1604 2) it builds a config.h file for inclusion in C programs. You may edit
1605 any of these files as the need arises after running this script.
1607 If you make a mistake on a question, there is no easy way to back up to it
1608 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1609 files. Configure will offer to let you do this before it runs the SH files.
1612 dflt='Type carriage return to continue'
1614 case "$firsttime" in
1615 true) echo $user >>../.config/instruct;;
1619 : find out where common programs are
1621 echo "Locating common programs..." >&4
1634 if test -d \$dir/\$thing; then
1640 for thisthing in \$dir/\$thing; do
1641 : just loop through to pick last item
1643 if test -f \$thisthing; then
1646 elif test -f \$dir/\$thing.exe; then
1647 if test -n "$DJGPP"; then
1648 echo \$dir/\$thing.exe
1650 : on Eunice apparently
1705 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1706 pth="$pth /lib /usr/lib"
1707 for file in $loclist; do
1711 if test -f "$xxx"; then
1714 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1715 xxx=`./loc $file $file $pth`
1718 '') xxx=`./loc $file $file $pth`;;
1719 *) xxx=`./loc $xxx $xxx $pth`;;
1725 echo $file is in $xxx.
1728 echo $file is in $xxx.
1731 echo "I don't know where '$file' is, and my life depends on it." >&4
1732 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1738 echo "Don't worry if any of the following aren't found..."
1740 for file in $trylist; do
1744 if test -f "$xxx"; then
1747 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1748 xxx=`./loc $file $file $pth`
1751 '') xxx=`./loc $file $file $pth`;;
1752 *) xxx=`./loc $xxx $xxx $pth`;;
1758 echo $file is in $xxx.
1761 echo $file is in $xxx.
1764 echo "I don't see $file out there, $say."
1771 echo "Substituting grep for egrep."
1777 echo "Substituting cp for ln."
1783 echo "Hopefully test is built into your sh."
1786 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1787 echo "Using the test built into your sh."
1795 echo "Hopefully echo is built into your sh."
1800 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1801 $echo $n "hi there$c" >foo1
1802 echo $n "hi there$c" >foo2
1803 if cmp foo1 foo2 >/dev/null 2>&1; then
1804 echo "They are compatible. In fact, they may be identical."
1811 They are not compatible! You are probably running ksh on a non-USG system.
1812 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1813 have echo built in and we may have to run some Bourne shell scripts. That
1814 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1817 $echo $n "The star should be here-->$c"
1824 : determine whether symbolic links are supported
1827 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1828 echo "Symbolic links are supported." >&4
1831 echo "Symbolic links are NOT supported." >&4
1836 : see whether [:lower:] and [:upper:] are supported character classes
1838 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1840 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1844 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1845 # (0xc9 and 0xd1), therefore that is a nice testing point.
1846 if test "X$up" = X -o "X$low" = X; then
1847 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1853 if test "X$up" = X -o "X$low" = X; then
1854 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1860 if test "X$up" = X -o "X$low" = X; then
1861 case "`echo IJ | od -x 2>/dev/null`" in
1863 echo "Hey, this might be EBCDIC." >&4
1864 if test "X$up" = X -o "X$low" = X; then
1865 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1866 ij) up='[A-IJ-RS-Z]'
1871 if test "X$up" = X -o "X$low" = X; then
1872 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1882 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
1884 echo "Using $up and $low to convert case." >&4
1887 echo "I don't know how to translate letters from upper to lower case." >&4
1888 echo "Your tr is not acting any way I know of." >&4
1892 : set up the translation script tr, must be called with ./tr of course
1896 '[A-Z][a-z]') exec $tr '$up' '$low';;
1897 '[a-z][A-Z]') exec $tr '$low' '$up';;
1904 : Try to determine whether config.sh was made on this system
1905 case "$config_sh" in
1907 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1908 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
1909 # because the A-Z/a-z are not consecutive.
1910 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1911 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1912 newmyuname="$myuname"
1914 case "$knowitall" in
1916 if test -f ../config.sh; then
1917 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1918 eval "`grep myuname= ../config.sh`"
1920 if test "X$myuname" = "X$newmyuname"; then
1928 : Get old answers from old config file if Configure was run on the
1929 : same system, otherwise use the hints.
1932 if test -f config.sh; then
1934 rp="I see a config.sh file. Shall I use it to set the defaults?"
1937 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1938 *) echo "Fetching default answers from your old config.sh file..." >&4
1946 : Older versions did not always set $sh. Catch re-use of such
1955 if test ! -f config.sh; then
1958 First time through, eh? I have some defaults handy for some systems
1959 that need some extra help getting the Configure answers right:
1962 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
1964 : Half the following guesses are probably wrong... If you have better
1965 : tests or hints, please send them to perlbug@perl.com
1966 : The metaconfig authors would also appreciate a copy...
1967 $test -f /irix && osname=irix
1968 $test -f /xenix && osname=sco_xenix
1969 $test -f /dynix && osname=dynix
1970 $test -f /dnix && osname=dnix
1971 $test -f /lynx.os && osname=lynxos
1972 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1973 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
1974 $test -f /bin/mips && /bin/mips && osname=mips
1975 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1976 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1977 $test -d /usr/apollo/bin && osname=apollo
1978 $test -f /etc/saf/_sactab && osname=svr4
1979 $test -d /usr/include/minix && osname=minix
1980 if $test -d /MachTen -o -d /MachTen_Folder; then
1982 if $test -x /sbin/version; then
1983 osvers=`/sbin/version | $awk '{print $2}' |
1984 $sed -e 's/[A-Za-z]$//'`
1985 elif $test -x /usr/etc/version; then
1986 osvers=`/usr/etc/version | $awk '{print $2}' |
1987 $sed -e 's/[A-Za-z]$//'`
1992 $test -f /sys/posix.dll &&
1993 $test -f /usr/bin/what &&
1994 set X `/usr/bin/what /sys/posix.dll` &&
1995 $test "$3" = UWIN &&
1998 if $test -f $uname; then
2006 umips) osname=umips ;;
2009 [23]100) osname=mips ;;
2010 next*) osname=next ;;
2012 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2013 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2016 elif $test -f /etc/kconfig; then
2018 if test "$lns" = "ln -s"; then
2020 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2022 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2029 if test -n "$DJGPP"; then
2038 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2040 'not found') osvers="$4"."$3" ;;
2041 '<3240'|'<>3240') osvers=3.2.0 ;;
2042 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2043 '=3250'|'>3250') osvers=3.2.5 ;;
2047 *dc.osx) osname=dcosx
2053 domainos) osname=apollo
2059 dynixptx*) osname=dynixptx
2060 osvers=`echo "$4" | $sed 's/^v//'`
2062 freebsd) osname=freebsd
2064 genix) osname=genix ;;
2066 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2082 netbsd*) osname=netbsd
2085 news-os) osvers="$3"
2087 4*) osname=newsos4 ;;
2091 bsd386) osname=bsd386
2094 powerux | power_ux | powermax_os | powermaxos | \
2095 powerunix | power_unix) osname=powerux
2098 next*) osname=next ;;
2099 solaris) osname=solaris
2101 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2108 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2112 titanos) osname=titanos
2121 ultrix) osname=ultrix
2124 osf1|mls+) case "$5" in
2127 osvers=`echo "$3" | sed 's/^[xvt]//'`
2129 hp*) osname=hp_osf1 ;;
2130 mips) osname=mips_osf1 ;;
2139 $2) case "$osname" in
2143 : svr4.x or possibly later
2153 if test -f /stand/boot ; then
2154 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2155 if test -n "$INITPROG" -a -f "$INITPROG"; then
2156 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2157 if test -n "$isesix"; then
2165 *) if test -f /etc/systemid; then
2167 set `echo $3 | $sed 's/\./ /g'` $4
2168 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2170 elif $test -f $src/hints/sco_$1_$2.sh; then
2172 elif $test -f $src/hints/sco_$1.sh; then
2177 '') : Still unknown. Probably a generic Sys V.
2186 *) case "$osname" in
2187 '') : Still unknown. Probably a generic BSD.
2195 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2196 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2197 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2200 $rm -f UU/kernel.what
2201 elif test -d c:/.; then
2208 : Now look for a hint file osname_osvers, unless one has been
2209 : specified already.
2212 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2213 : Also try without trailing minor version numbers.
2214 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2215 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2216 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2217 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2220 *) case "$osvers" in
2223 *) if $test -f $src/hints/$file.sh ; then
2225 elif $test -f $src/hints/$xfile.sh ; then
2227 elif $test -f $src/hints/$xxfile.sh ; then
2229 elif $test -f $src/hints/$xxxfile.sh ; then
2231 elif $test -f $src/hints/$xxxxfile.sh ; then
2233 elif $test -f "$src/hints/${osname}.sh" ; then
2242 if $test -f Policy.sh ; then
2245 none) dflt="Policy" ;;
2246 *) dflt="Policy $dflt" ;;
2251 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2255 if $test -f Policy.sh ; then
2258 There's also a Policy hint file available, which should make the
2259 site-specific (policy) questions easier to answer.
2266 You may give one or more space-separated answers, or "none" if appropriate.
2267 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2268 is a good thing. DO NOT give a wrong version.
2272 rp="Which of these apply, if any?"
2275 for file in $tans; do
2276 if $test X$file = XPolicy -a -f Policy.sh; then
2278 $cat Policy.sh >> UU/config.sh
2279 elif $test -f $src/hints/$file.sh; then
2280 . $src/hints/$file.sh
2281 $cat $src/hints/$file.sh >> UU/config.sh
2282 elif $test X$tans = X -o X$tans = Xnone ; then
2285 : Give one chance to correct a possible typo.
2286 echo "$file.sh does not exist"
2288 rp="hint to use instead?"
2290 for file in $ans; do
2291 if $test -f "$src/hints/$file.sh"; then
2292 . $src/hints/$file.sh
2293 $cat $src/hints/$file.sh >> UU/config.sh
2294 elif $test X$ans = X -o X$ans = Xnone ; then
2297 echo "$file.sh does not exist -- ignored."
2304 : Remember our hint file for later.
2305 if $test -f "$src/hints/$file.sh" ; then
2315 echo "Fetching default answers from $config_sh..." >&4
2319 cp $config_sh config.sh 2>/dev/null
2329 test "$override" && . ./optdef.sh
2330 myuname="$newmyuname"
2332 : Restore computed paths
2333 for file in $loclist $trylist; do
2334 eval $file="\$_$file"
2339 Configure uses the operating system name and version to set some defaults.
2340 The default value is probably right if the name rings a bell. Otherwise,
2341 since spelling matters for me, either accept the default or answer "none"
2348 ''|' '|none) dflt=none ;;
2349 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2352 *) dflt="$osname" ;;
2354 rp="Operating system name?"
2358 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2364 ''|' '|none) dflt=none ;;
2365 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2366 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2368 ''|' ') dflt=none ;;
2373 *) dflt="$osvers" ;;
2375 rp="Operating system version?"
2382 : who configured the system
2383 cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
2384 cf_by=`(logname) 2>/dev/null`
2387 cf_by=`(whoami) 2>/dev/null`
2389 "") cf_by=unknown ;;
2393 : set up the script used to warn in case of inconsistency
2400 echo "*** WHOA THERE!!! ***" >&4
2401 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2402 rp=" Keep the $hint value?"
2405 y) td=$was; tu=$was;;
2409 : function used to set $1 to $val
2410 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2412 $define$undef) . ./whoa; eval "$var=\$td";;
2413 $undef$define) . ./whoa; eval "$var=\$tu";;
2414 *) eval "$var=$val";;
2419 Perl can be built to take advantage of threads, on some systems.
2420 To do so, Configure must be run with -Dusethreads.
2422 Note that threading is a highly experimental feature, and
2423 some known race conditions still remain. If you choose to try
2424 it, be very sure to not actually deploy it for production
2425 purposes. README.threads has more details, and is required
2426 reading if you enable threads.
2428 case "$usethreads" in
2429 $define|true|[yY]*) dflt='y';;
2432 rp='Build a threading Perl?'
2435 y|Y) val="$define" ;;
2441 case "$d_oldpthreads" in
2442 '') : Configure tests would be welcome here. For now, assume undef.
2444 *) val="$d_oldpthreads" ;;
2450 case "$usethreads" in
2451 "$define"|true|[yY]*)
2452 : Look for a hint-file generated 'call-back-unit'. If the
2453 : user has specified that a threading perl is to be built,
2454 : we may need to set or change some other defaults.
2455 if $test -f usethreads.cbu; then
2459 aix|dec_osf|dos_djgpp|freebsd|hpux|irix|linux|next|openbsd|os2|solaris|vmesa)
2460 # Known thread-capable platforms.
2464 $osname is not known to support threads.
2465 Please let perlbug@perl.com know how to do that.
2467 Cannot continue, aborting.
2475 : determine the architecture name
2477 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2478 tarch=`arch`"-$osname"
2479 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2480 if uname -m > tmparch 2>&1 ; then
2481 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2482 -e 's/$/'"-$osname/" tmparch`
2490 case "$myarchname" in
2493 echo "(Your architecture name used to be $myarchname.)"
2499 *) dflt="$archname";;
2501 rp='What is your architecture name'
2503 case "$usethreads" in
2504 $define) echo "Threads selected." >&4
2506 *-thread) echo "...and architecture name already ends in -thread." >&4
2509 *) archname="$ans-thread"
2510 echo "...setting architecture name to $archname." >&4
2514 *) archname="$ans" ;;
2520 $define|true) afs=true ;;
2521 $undef|false) afs=false ;;
2522 *) if test -d /afs; then
2530 echo "AFS may be running... I'll be extra cautious then..." >&4
2532 echo "AFS does not seem to be running..." >&4
2535 : decide how portable to be. Allow command line overrides.
2536 case "$d_portable" in
2538 *) d_portable="$define" ;;
2541 : set up shell script to do ~ expansion
2547 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2550 if $test -f /bin/csh; then
2551 /bin/csh -f -c "glob \$1"
2556 name=\`$expr x\$1 : '..\([^/]*\)'\`
2557 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2558 if $test ! -d "\$dir"; then
2560 echo "\$me: can't locate home directory for: \$name" >&2
2565 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2581 : now set up to get a file name
2585 cat <<'EOSC' >>getfile
2598 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2599 fn=`echo $fn | sed 's/(.*)//'`
2605 loc_file=`expr $fn : '.*:\(.*\)'`
2606 fn=`expr $fn : '\(.*\):.*'`
2614 */*) fullpath=true;;
2623 *e*) exp_file=true;;
2626 *p*) nopath_ok=true;;
2631 *d*) type='Directory';;
2632 *l*) type='Locate';;
2637 Locate) what='File';;
2642 case "$d_portable" in
2650 while test "$type"; do
2655 true) rp="$rp (~name ok)";;
2658 if test -f UU/getfile.ok && \
2659 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2678 value=`UU/filexp $ans`
2681 if test "$ans" != "$value"; then
2682 echo "(That expands to $value on this system.)"
2696 /*) value="$ansexp" ;;
2701 echo "I shall only accept a full path name, as in /bin/ls." >&4
2702 echo "Use a ! shell escape if you wish to check pathnames." >&4
2705 echo "Please give a full path name, starting with slash." >&4
2708 echo "Note that using ~name is ok provided it expands well." >&4
2721 if test -f "$ansexp"; then
2723 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2725 echo "($value is not a plain file, but that's ok.)"
2730 if test -d "$ansexp"; then
2735 if test -d "$ansexp"; then
2736 echo "(Looking for $loc_file in directory $value.)"
2737 value="$value/$loc_file"
2738 ansexp="$ansexp/$loc_file"
2740 if test -f "$ansexp"; then
2743 case "$nopath_ok" in
2744 true) case "$value" in
2746 *) echo "Assuming $value will be in people's path."
2762 if test "$fastread" = yes; then
2767 rp="$what $value doesn't exist. Use that name anyway?"
2788 : determine root of directory hierarchy where package will be installed.
2791 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2799 By default, $package will be installed in $dflt/bin, manual
2800 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2801 all installation directories. Typically set to /usr/local, but you
2802 may choose /usr if you wish to install $package among your system
2803 binaries. If you wish to have binaries under /bin but manual pages
2804 under /usr/local/man, that's ok: you will be prompted separately
2805 for each of the installation directories, the prefix being only used
2806 to set the defaults.
2810 rp='Installation prefix to use?'
2818 *) oldprefix="$prefix";;
2825 : set the prefixit variable, to compute a suitable default value
2826 prefixit='case "$3" in
2828 case "$oldprefix" in
2829 "") eval "$1=\"\$$2\"";;
2836 ""|" ") eval "$1=\"\$$2\"";;
2842 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2844 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2845 /*-$oldprefix/*|\~*-$oldprefix/*)
2846 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2847 *) eval "$1=\"\$$2\"";;
2851 : set the base revision
2854 : get the patchlevel
2856 echo "Getting the current patchlevel..." >&4
2857 if $test -r $rsrc/patchlevel.h;then
2858 patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
2859 subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
2864 $echo $n "(You have $package" $c
2867 *) $echo $n " $baserev" $c ;;
2869 $echo $n " patchlevel $patchlevel" $c
2870 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
2873 if test 0 -eq "$subversion"; then
2874 version=`LC_ALL=C; export LC_ALL; \
2875 echo $baserev $patchlevel | \
2876 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2878 version=`LC_ALL=C; export LC_ALL; \
2879 echo $baserev $patchlevel $subversion | \
2880 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
2882 : Figure out perl API version. Perhaps this should be in patchlevel.h
2883 if test "$subversion" -lt 50; then
2884 apiversion=`LC_ALL=C; export LC_ALL; \
2885 echo $baserev $patchlevel | \
2886 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2888 apiversion="$version"
2891 : determine where private library files go
2892 : Usual default is /usr/local/lib/perl5/$version.
2893 : Also allow things like /opt/perl/lib/$version, since
2894 : /opt/perl/lib/perl5... would be redundant.
2896 *perl*) set dflt privlib lib/$version ;;
2897 *) set dflt privlib lib/$package/$version ;;
2902 There are some auxiliary files for $package that need to be put into a
2903 private library directory that is accessible by everyone.
2907 rp='Pathname where the private library files will reside?'
2909 if $test "X$privlibexp" != "X$ansexp"; then
2913 privlibexp="$ansexp"
2917 Since you are running AFS, I need to distinguish the directory in which
2918 private files reside from the directory in which they are installed (and from
2919 which they are presumably copied to the former directory by occult means).
2922 case "$installprivlib" in
2923 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2924 *) dflt="$installprivlib";;
2927 rp='Where will private files be installed?'
2929 installprivlib="$ans"
2931 installprivlib="$privlibexp"
2934 : set the prefixup variable, to restore leading tilda escape
2935 prefixup='case "$prefixexp" in
2937 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2940 : determine where public architecture dependent libraries go
2943 : privlib default is /usr/local/lib/$package/$version
2944 : archlib default is /usr/local/lib/$package/$version/$archname
2945 : privlib may have an optional trailing /share.
2946 tdflt=`echo $privlib | $sed 's,/share$,,'`
2947 tdflt=$tdflt/$archname
2956 $spackage contains architecture-dependent library files. If you are
2957 sharing libraries in a heterogeneous environment, you might store
2958 these files in a separate location. Otherwise, you can just include
2959 them with the rest of the public library files.
2963 rp='Where do you want to put the public architecture-dependent libraries?'
2966 archlibexp="$ansexp"
2971 Since you are running AFS, I need to distinguish the directory in
2972 which architecture-dependent library files reside from the directory
2973 in which they are installed (and from which they are presumably copied
2974 to the former directory by occult means).
2977 case "$installarchlib" in
2978 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2979 *) dflt="$installarchlib";;
2982 rp='Where will architecture-dependent library files be installed?'
2984 installarchlib="$ans"
2986 installarchlib="$archlibexp"
2988 if $test X"$archlib" = X"$privlib"; then
2994 : make some quick guesses about what we are up against
2996 $echo $n "Hmm... $c"
3006 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3007 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3009 echo "Looks kind of like an OSF/1 system, but we'll see..."
3011 elif test `echo abc | tr a-z A-Z` = Abc ; then
3012 xxx=`./loc addbib blurfl $pth`
3013 if $test -f $xxx; then
3014 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3018 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3019 echo "Looks kind of like an extended USG system, but we'll see..."
3021 echo "Looks kind of like a USG system, but we'll see..."
3025 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3026 echo "Looks kind of like a BSD system, but we'll see..."
3030 echo "Looks kind of like a Version 7 system, but we'll see..."
3033 case "$eunicefix" in
3036 There is, however, a strange, musty smell in the air that reminds me of
3037 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3041 : it so happens the Eunice I know will not run shell scripts in Unix format
3045 echo "Congratulations. You aren't running Eunice."
3049 : Detect OS2. The p_ variable is set above in the Head.U unit.
3054 I have the feeling something is not exactly right, however...don't tell me...
3055 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3060 if test -f /xenix; then
3061 echo "Actually, this looks more like a XENIX system..."
3066 echo "It's not Xenix..."
3071 if test -f /venix; then
3072 echo "Actually, this looks more like a VENIX system..."
3079 echo "Nor is it Venix..."
3082 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3083 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3086 : see if setuid scripts can be secure
3089 Some kernels have a bug that prevents setuid #! scripts from being
3090 secure. Some sites have disabled setuid #! scripts because of this.
3092 First let's decide if your kernel supports secure setuid #! scripts.
3093 (If setuid #! scripts would be secure but have been disabled anyway,
3094 don't say that they are secure if asked.)
3099 if $test -d /dev/fd; then
3100 echo "#!$ls" >reflect
3101 chmod +x,u+s reflect
3102 ./reflect >flect 2>&1
3103 if $contains "/dev/fd" flect >/dev/null; then
3104 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3108 If you are not sure if they are secure, I can check but I'll need a
3109 username and password different from the one you are using right now.
3110 If you don't have such a username or don't want me to test, simply
3114 rp='Other username to test security of setuid scripts with?'
3119 case "$d_suidsafe" in
3120 '') echo "I'll assume setuid scripts are *not* secure." >&4
3123 echo "Well, the $hint value is *not* secure." >&4
3125 *) echo "Well, the $hint value *is* secure." >&4
3130 $rm -f reflect flect
3131 echo "#!$ls" >reflect
3132 chmod +x,u+s reflect
3135 echo '"su" will (probably) prompt you for '"$ans's password."
3136 su $ans -c './reflect >flect'
3137 if $contains "/dev/fd" flect >/dev/null; then
3138 echo "Okay, it looks like setuid scripts are secure." >&4
3141 echo "I don't think setuid scripts are secure." >&4
3146 rp='Does your kernel have *secure* setuid scripts?'
3149 [yY]*) val="$define";;
3154 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3155 echo "(That's for file descriptors, not floppy disks.)"
3161 $rm -f reflect flect
3163 : now see if they want to do setuid emulation
3166 case "$d_suidsafe" in
3169 echo "No need to emulate SUID scripts since they are secure here." >& 4
3173 Some systems have disabled setuid scripts, especially systems where
3174 setuid scripts cannot be secure. On systems where setuid scripts have
3175 been disabled, the setuid/setgid bits on scripts are currently
3176 useless. It is possible for $package to detect those bits and emulate
3177 setuid/setgid in a secure fashion. This emulation will only work if
3178 setuid scripts have been disabled in your kernel.
3182 "$define") dflt=y ;;
3185 rp="Do you want to do setuid/setgid emulation?"
3188 [yY]*) val="$define";;
3196 : determine where manual pages are on this system
3200 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3201 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3202 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3203 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3204 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3205 sysman=`./loc . /usr/man/man1 $syspath`
3208 if $test -d "$sysman"; then
3209 echo "System manual is in $sysman." >&4
3211 echo "Could not find manual pages in source form." >&4
3214 : see what memory models we can support
3217 $cat >pdp11.c <<'EOP'
3226 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3227 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3228 dflt='unsplit split'
3230 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3233 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3238 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3241 if $test -d /lib/large || $test -d /usr/lib/large; then
3244 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3253 Some systems have different model sizes. On most systems they are called
3254 small, medium, large, and huge. On the PDP11 they are called unsplit and
3255 split. If your system doesn't support different memory models, say "none".
3256 If you wish to force everything to one memory model, say "none" here and
3257 put the appropriate flags later when it asks you for other cc and ld flags.
3258 Venix systems may wish to put "none" and let the compiler figure things out.
3259 (In the following question multiple model names should be space separated.)
3261 The default for most systems is "none".
3264 rp="Which memory models are supported?"
3279 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3280 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3287 rp="What flag indicates separate I and D space?"
3295 *large*|*small*|*medium*|*huge*)
3302 rp="What flag indicates large model?"
3312 *huge*) case "$huge" in
3316 rp="What flag indicates huge model?"
3326 *medium*) case "$medium" in
3330 rp="What flag indicates medium model?"
3337 *) medium="$large";;
3340 *small*) case "$small" in
3344 rp="What flag indicates small model?"
3355 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3358 $rm -f pdp11.* pdp11
3360 : see if we need a special compiler
3368 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3369 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3383 On some older systems the default C compiler will not resolve multiple global
3384 references that happen to have the same name. On some such systems the "Mcc"
3385 command may be used to force these to be resolved. On other systems a "cc -M"
3386 command is required. (Note that the -M flag on other systems indicates a
3387 memory model to use!) If you have the Gnu C compiler, you might wish to use
3393 rp="Use which C compiler?"
3401 rp="Use which C compiler?"
3405 : Look for a hint-file generated 'call-back-unit'. Now that the
3406 : user has specified the compiler, we may need to set or change some
3408 if $test -f cc.cbu; then
3412 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3413 $cat >gccvers.c <<EOM
3418 printf("%s\n", __VERSION__);
3420 printf("%s\n", "1");
3426 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3427 gccversion=`./gccvers`
3428 case "$gccversion" in
3429 '') echo "You are not using GNU cc." ;;
3430 *) echo "You are using GNU cc $gccversion." ;;
3434 echo "*** WHOA THERE!!! ***" >&4
3435 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3436 case "$knowitall" in
3438 echo " You'd better start hunting for one and let me know about it." >&4
3444 case "$gccversion" in
3445 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3448 : What should the include directory be ?
3450 $echo $n "Hmm... $c"
3454 if $test -f /bin/mips && /bin/mips; then
3455 echo "Looks like a MIPS system..."
3456 $cat >usr.c <<'EOCP'
3457 #ifdef SYSTYPE_BSD43
3461 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3462 dflt='/bsd43/usr/include'
3466 mips_type='System V'
3468 $rm -f usr.c usr.out
3469 echo "and you're compiling with the $mips_type compiler and libraries."
3473 echo "Doesn't look like a MIPS system."
3483 case "$xxx_prompt" in
3486 rp='Where are the include files you want to use?'
3494 : see how we invoke the C preprocessor
3496 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3497 cat <<'EOT' >testcpp.c
3503 if test ! -f cppstdin; then
3504 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3506 echo "Keeping your $hint cppstdin wrapper."
3509 wrapper=`pwd`/cppstdin
3513 if $test "X$cppstdin" != "X" && \
3514 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3515 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3517 echo "You used to use $cppstdin $cppminus so we'll use that again."
3519 '') echo "But let's see if we can live without a wrapper..." ;;
3521 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3522 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3524 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3527 echo "(However, $cpprun $cpplast does not work, let's see...)"
3535 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3542 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3543 $cc -E <testcpp.c >testcpp.out 2>&1; \
3544 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3545 echo "Yup, it does."
3548 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3549 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3550 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3551 echo "Yup, it does."
3554 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3555 $cc -P <testcpp.c >testcpp.out 2>&1; \
3556 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3557 echo "Yipee, that works!"
3560 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3561 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3562 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3563 echo "At long last!"
3566 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3567 $cpp <testcpp.c >testcpp.out 2>&1; \
3568 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3572 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3573 $cpp - <testcpp.c >testcpp.out 2>&1; \
3574 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3575 echo "Hooray, it works! I was beginning to wonder."
3578 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3579 $wrapper <testcpp.c >testcpp.out 2>&1; \
3580 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3586 rp="No dice. I can't find a C preprocessor. Name one:"
3590 $x_cpp <testcpp.c >testcpp.out 2>&1
3591 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3592 echo "OK, that will do." >&4
3594 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3609 echo "Perhaps can we force $cc -E using a wrapper..."
3610 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3611 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3617 echo "Nope, we'll have to live without it..."
3631 "$wrapper"|'cppstdin') ;;
3632 *) $rm -f $wrapper;;
3634 $rm -f testcpp.c testcpp.out
3636 : Set private lib path
3639 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3644 '') dlist="$loclibpth $plibpth $glibpth";;
3645 *) dlist="$libpth";;
3648 : Now check and see which directories actually exist, avoiding duplicates
3652 if $test -d $xxx; then
3655 *) libpth="$libpth $xxx";;
3661 Some systems have incompatible or broken versions of libraries. Among
3662 the directories listed in the question below, please remove any you
3663 know not to be holding relevant libraries, and add any that are needed.
3664 Say "none" for none.
3675 rp="Directories to use for library searches?"
3682 : compute shared library extension
3685 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3695 On some systems, shared libraries may be available. Answer 'none' if
3696 you want to suppress searching of shared libraries for the remaining
3697 of this configuration.
3700 rp='What is the file extension used for shared libraries?'
3704 : Define several unixisms.
3705 : Hints files or command line option can be used to override them.
3706 : The convoluted testing is in case hints files set either the old
3709 '') case "$exe_ext" in
3711 *) _exe="$exe_ext" ;;
3716 '') case "$lib_ext" in
3723 '') case "$obj_ext" in
3730 '') case "$path_sep" in
3741 : Which makefile gets called first. This is used by make depend.
3742 case "$firstmakefile" in
3743 '') firstmakefile='makefile';;
3746 : Looking for optional libraries
3748 echo "Checking for optional libraries..." >&4
3753 case "$libswanted" in
3754 '') libswanted='c_s';;
3756 for thislib in $libswanted; do
3758 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3759 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3760 echo "Found -l$thislib (shared)."
3763 *) dflt="$dflt -l$thislib";;
3765 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3766 echo "Found -l$thislib (shared)."
3769 *) dflt="$dflt -l$thislib";;
3771 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3772 echo "Found -l$thislib."
3775 *) dflt="$dflt -l$thislib";;
3777 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3778 echo "Found -l$thislib."
3781 *) dflt="$dflt -l$thislib";;
3783 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3784 echo "Found -l${thislib}_s."
3787 *) dflt="$dflt -l${thislib}_s";;
3789 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3790 echo "Found -l$thislib."
3793 *) dflt="$dflt -l$thislib";;
3796 echo "No -l$thislib."
3807 ' '|'') dflt='none';;
3812 Some versions of Unix support shared libraries, which make executables smaller
3813 but make load time slightly longer.
3815 On some systems, mostly System V Release 3's, the shared library is included
3816 by putting the option "-lc_s" as the last thing on the cc command line when
3817 linking. Other systems use shared libraries by default. There may be other
3818 libraries needed to compile $package on your machine as well. If your system
3819 needs the "-lc_s" option, include it here. Include any other special libraries
3820 here as well. Say "none" for none.
3824 rp="Any additional libraries?"
3831 : determine optimize, if desired, or use for debug flag also
3833 ' '|$undef) dflt='none';;
3835 *) dflt="$optimize";;
3839 Some C compilers have problems with their optimizers. By default, $package
3840 compiles with the -O flag to use the optimizer. Alternately, you might want
3841 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3842 systems). Either flag can be specified here. To use neither flag, specify
3846 rp="What optimizer/debugger flag should be used?"
3850 'none') optimize=" ";;
3854 : We will not override a previous value, but we might want to
3855 : augment a hint file
3858 case "$gccversion" in
3859 1*) dflt='-fpcc-struct-return' ;;
3862 *-g*) dflt="$dflt -DDEBUGGING";;
3864 case "$gccversion" in
3865 2*) if test -d /etc/conf/kconfig.d &&
3866 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3875 case "$mips_type" in
3876 *BSD*|'') inclwanted="$locincpth $usrinc";;
3877 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3879 for thisincl in $inclwanted; do
3880 if $test -d $thisincl; then
3881 if $test x$thisincl != x$usrinc; then
3884 *) dflt="$dflt -I$thisincl";;
3890 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3892 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3900 *) dflt="$dflt -D$2";;
3904 set signal.h LANGUAGE_C; eval $inctest
3907 none|recommended) dflt="$ccflags $dflt" ;;
3908 *) dflt="$ccflags";;
3916 Your C compiler may want other flags. For this question you should include
3917 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3918 but you should NOT include libraries or ld flags like -lwhatever. If you
3919 want $package to honor its debug switch, you should include -DDEBUGGING here.
3920 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3922 To use no flags, specify the word "none".
3928 rp="Any additional cc flags?"
3935 : the following weeds options from ccflags that are of no interest to cpp
3937 case "$gccversion" in
3938 1*) cppflags="$cppflags -D__GNUC__"
3940 case "$mips_type" in
3942 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3948 echo "Let me guess what the preprocessor flags are..." >&4
3962 *) ftry="$previous $flag";;
3964 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3965 >cpp1.out 2>/dev/null && \
3966 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3967 >cpp2.out 2>/dev/null && \
3968 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3969 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3971 cppflags="$cppflags $ftry"
3981 *-*) echo "They appear to be: $cppflags";;
3983 $rm -f cpp.c cpp?.out
3987 : flags used in final linking phase
3989 '') if ./venix; then
3995 *-posix*) dflt="$dflt -posix" ;;
3998 *) dflt="$ldflags";;
4001 : Try to guess additional flags to pick up local libraries.
4002 for thislibdir in $libpth; do
4003 case " $loclibpth " in
4006 *"-L$thislibdir "*) ;;
4007 *) dflt="$dflt -L$thislibdir" ;;
4019 Your C linker may need flags. For this question you should
4020 include -L/whatever and any other flags used by the C linker, but you
4021 should NOT include libraries like -lwhatever.
4023 Make sure you include the appropriate -L/path flags if your C linker
4024 does not normally search all of the directories you specified above,
4027 To use no flags, specify the word "none".
4031 rp="Any additional ld flags (NOT including libraries)?"
4037 rmlist="$rmlist pdp11"
4041 echo "Checking your choice of C compiler and flags for coherency..." >&4
4042 $cat > try.c <<'EOF'
4044 int main() { printf("Ok\n"); exit(0); }
4046 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4048 $cat >try.msg <<'EOM'
4049 I've tried to compile and run the following simple program:
4052 $cat try.c >> try.msg
4054 $cat >> try.msg <<EOM
4061 and I got the following output:
4065 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4066 if sh -c './try' >>try.msg 2>&1; then
4070 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4073 cat >> try.msg <<'EOQS'
4074 If $libs contains -lsfio, and sfio is mis-configured, then it
4075 sometimes (apparently) runs and exits with a 0 status, but with no
4076 output! It may have to do with sfio's use of _exit vs. exit.
4079 rp="You have a big problem. Shall I abort Configure"
4086 echo "The program compiled OK, but exited with status $?." >>try.msg
4087 rp="You have a problem. Shall I abort Configure"
4091 echo "I can't compile the test program." >>try.msg
4092 rp="You have a BIG problem. Shall I abort Configure"
4098 case "$knowitall" in
4100 echo "(The supplied flags or libraries might be incorrect.)"
4108 *) echo "Ok. Stopping Configure." >&4
4113 n) echo "OK, that should do.";;
4115 $rm -f try try.* core
4117 : determine filename position in cpp output
4119 echo "Computing filename position in cpp output for #include directives..." >&4
4120 echo '#include <stdio.h>' > foo.c
4123 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4124 $grep '^[ ]*#.*stdio\.h' | \
4125 while read cline; do
4128 while $test \$# -gt 0; do
4129 if $test -r \`echo \$1 | $tr -d '"'\`; then
4134 pos=\`expr \$pos + 1\`
4146 *) pos="${fieldn}th";;
4148 echo "Your cpp writes the filename in the $pos field of the line."
4150 : locate header file
4155 if test -f $usrinc/\$wanted; then
4156 echo "$usrinc/\$wanted"
4159 awkprg='{ print \$$fieldn }'
4160 echo "#include <\$wanted>" > foo\$\$.c
4161 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4162 $grep "^[ ]*#.*\$wanted" | \
4163 while read cline; do
4164 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4166 */\$wanted) echo "\$name"; exit 0;;
4177 : define an alternate in-header-list? function
4178 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4179 cont=true; xxf="echo \"<\$1> found.\" >&4";
4180 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4181 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4183 case $# in 4) instead=instead;; *) instead="at last";; esac;
4184 while $test "$cont"; do
4186 var=$2; eval "was=\$$2";
4187 if $test "$xxx" && $test -r "$xxx";
4189 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4192 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4193 set $yyy; shift; shift; yyy=$@;
4194 case $# in 0) cont="";;
4195 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4196 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4197 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4198 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4202 do set $yyy; var=$2; eval "was=\$$2";
4203 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4204 set $yyy; shift; shift; yyy=$@;
4207 : see if this is a malloc.h system
4208 set malloc.h i_malloc
4211 : see if stdlib is available
4212 set stdlib.h i_stdlib
4215 : determine which malloc to compile in
4217 case "$usemymalloc" in
4218 ''|[yY]*|true|$define) dflt='y' ;;
4221 rp="Do you wish to attempt to use the malloc that comes with $package?"
4227 mallocsrc='malloc.c'
4228 mallocobj="malloc$_o"
4229 d_mymalloc="$define"
4232 : Remove malloc from list of libraries to use
4233 echo "Removing unneeded -lmalloc from library list" >&4
4234 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4237 echo "libs = $libs" >&4
4249 : compute the return types of malloc and free
4251 $cat >malloc.c <<END
4255 #include <sys/types.h>
4269 case "$malloctype" in
4271 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4278 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4282 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4289 echo "Your system uses $freetype free(), it would seem." >&4
4291 : Cruising for prototypes
4293 echo "Checking out function prototypes..." >&4
4294 $cat >prototype.c <<'EOCP'
4295 int main(int argc, char *argv[]) {
4298 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4299 echo "Your C compiler appears to support function prototypes."
4302 echo "Your C compiler doesn't seem to understand function prototypes."
4309 case "$prototype" in
4311 *) ansi2knr='ansi2knr'
4316 This version of $package can only be compiled by a compiler that
4317 understands function prototypes. Unfortunately, your C compiler
4319 doesn't seem to understand them. Sorry about that.
4321 If GNU cc is available for your system, perhaps you could try that instead.
4323 Eventually, we hope to support building Perl with pre-ANSI compilers.
4324 If you would like to help in that effort, please contact <perlbug@perl.org>.
4326 Aborting Configure now.
4332 : determine where public executables go
4337 rp='Pathname where the public executables will reside?'
4339 if $test "X$ansexp" != "X$binexp"; then
4347 Since you are running AFS, I need to distinguish the directory in which
4348 executables reside from the directory in which they are installed (and from
4349 which they are presumably copied to the former directory by occult means).
4352 case "$installbin" in
4353 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4354 *) dflt="$installbin";;
4357 rp='Where will public executables be installed?'
4361 installbin="$binexp"
4365 if test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4367 Many scripts expect to perl to be installed as /usr/bin/perl.
4368 I can install the perl you are about to compile also as /usr/bin/perl
4369 (in addition to $installbin/perl).
4371 case "$installusrbinperl" in
4372 "$undef"|[nN]*) dflt='n';;
4375 rp="Do you want to install perl as /usr/bin/perl?"
4378 [yY]*) val="$define";;
4384 set installusrbinperl
4387 : define a shorthand compile call
4391 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4392 : define a shorthand compile call for compilations that should be ok.
4396 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4399 echo "Checking for GNU C Library..." >&4
4400 cat >gnulibc.c <<EOM
4412 if eval $compile_ok && ./gnulibc; then
4414 echo "You are using the GNU C Library"
4417 echo "You are not using the GNU C Library"
4423 : see if nm is to be used to determine whether a symbol is defined or not
4427 case "$d_gnulibc" in
4430 echo "nm probably won't work on the GNU C Library." >&4
4436 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4438 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4439 echo "'nm' won't be sufficient on this sytem." >&4
4445 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4446 if $test $dflt -gt 20; then
4456 true|$define) dflt=y;;
4463 I can use $nm to extract the symbols from your C libraries. This
4464 is a time consuming task which may generate huge output on the disk (up
4465 to 3 megabytes) but that should make the symbols extraction faster. The
4466 alternative is to skip the 'nm' extraction part and to compile a small
4467 test program instead to determine whether each symbol is present. If
4468 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4469 this may be the best solution.
4471 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4474 rp="Shall I use $nm to extract C symbols from the libraries?"
4477 [Nn]*) usenm=false;;
4486 : nm options which may be necessary
4488 '') if $test -f /mach_boot; then
4490 elif $test -d /usr/ccs/lib; then
4491 nm_opt='-p' # Solaris (and SunOS?)
4492 elif $test -f /dgux; then
4494 elif $test -f /lib64/rld; then
4495 nm_opt='-p' # 64-bit Irix
4501 : nm options which may be necessary for shared libraries but illegal
4502 : for archive libraries. Thank you, Linux.
4503 case "$nm_so_opt" in
4504 '') case "$myuname" in
4506 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4507 nm_so_opt='--dynamic'
4516 : get list of predefined functions in a handy place
4521 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4528 *) for thislib in $libs; do
4531 : Handle C library specially below.
4534 thislib=`echo $thislib | $sed -e 's/^-l//'`
4535 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4537 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4539 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4541 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4543 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4545 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4547 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4552 libnames="$libnames $try"
4554 *) libnames="$libnames $thislib" ;;
4563 for xxx in $libpth; do
4564 $test -r $1 || set $xxx/libc.$so
4565 : The messy sed command sorts on library version numbers.
4567 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4568 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4570 s/[0-9][0-9]*/0000&/g
4571 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4574 sort | $sed -e 's/^.* //'`
4577 $test -r $1 || set /usr/ccs/lib/libc.$so
4578 $test -r $1 || set /lib/libsys_s$_a
4584 if $test -r "$1"; then
4585 echo "Your (shared) C library seems to be in $1."
4587 elif $test -r /lib/libc && $test -r /lib/clib; then
4588 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4590 libc='/lib/clib /lib/libc'
4591 if $test -r /lib/syslib; then
4592 echo "(Your math library is in /lib/syslib.)"
4593 libc="$libc /lib/syslib"
4595 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4596 echo "Your C library seems to be in $libc, as you said before."
4597 elif $test -r $incpath/usr/lib/libc$_a; then
4598 libc=$incpath/usr/lib/libc$_a;
4599 echo "Your C library seems to be in $libc. That's fine."
4600 elif $test -r /lib/libc$_a; then
4602 echo "Your C library seems to be in $libc. You're normal."
4604 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4606 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4607 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4608 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4610 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4612 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4615 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4617 if $test -r "$tans"; then
4618 echo "Your C library seems to be in $tans, of all places."
4624 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4628 If the guess above is wrong (which it might be if you're using a strange
4629 compiler, or your machine supports multiple models), you can override it here.
4634 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4636 I can't seem to find your C library. I've looked in the following places:
4639 $sed 's/^/ /' libpath
4642 None of these seems to contain your C library. I need to get its name...
4647 rp='Where is your C library?'
4652 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4653 set X `cat libnames`
4656 case $# in 1) xxx=file; esac
4657 echo "Extracting names from the following $xxx for later perusal:" >&4
4659 $sed 's/^/ /' libnames >&4
4661 $echo $n "This may take a while...$c" >&4
4665 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4666 *) $nm $nm_opt $file 2>/dev/null;;
4671 $grep fprintf libc.tmp > libc.ptf
4672 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4673 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4675 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4677 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4679 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4681 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4683 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4685 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4687 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4689 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4691 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4693 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4695 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4697 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4699 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4700 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4702 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4704 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4706 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4708 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4710 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4712 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4714 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4716 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4718 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4720 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4722 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4724 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4726 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4728 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
4730 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4733 $nm -p $* 2>/dev/null >libc.tmp
4734 $grep fprintf libc.tmp > libc.ptf
4735 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4736 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4742 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4744 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4745 for thisname in $libnames $libc; do
4746 $ar t $thisname >>libc.tmp
4748 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4750 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4751 # Repeat libc to extract forwarders to DLL entries too
4752 for thisname in $libnames $libc; do
4753 $ar tv $thisname >>libc.tmp
4754 # Revision 50 of EMX has bug in $ar.
4755 # it will not extract forwarders to DLL entries
4756 # Use emximp which will extract exactly them.
4757 emximp -o tmp.imp $thisname \
4759 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4760 < tmp.imp >>libc.tmp
4763 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4766 echo "$ar didn't seem to work right." >&4
4767 echo "Maybe this is a Cray...trying bld instead..." >&4
4768 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4770 for thisname in $libnames; do
4772 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4773 $ar t $thisname >>libc.tmp
4777 echo "That didn't work either. Giving up." >&4
4784 if $test -f /lib/syscalls.exp; then
4786 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4787 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
4791 $rm -f libnames libpath
4793 : see if dld is available
4797 : is a C symbol defined?
4800 -v) tf=libc.tmp; tc=""; tdc="";;
4801 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4802 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4805 case "$reuseval-$4" in
4807 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4813 if $contains $tlook $tf >/dev/null 2>&1;
4818 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4819 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4827 $define) tval=true;;
4833 : define an is-in-libc? function
4834 inlibc='echo " "; td=$define; tu=$undef;
4835 sym=$1; var=$2; eval "was=\$$2";
4837 case "$reuseval$was" in
4847 echo "$sym() found." >&4;
4848 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4850 echo "$sym() NOT found." >&4;
4851 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4855 $define) echo "$sym() found." >&4;;
4856 *) echo "$sym() NOT found." >&4;;
4860 : see if dlopen exists
4867 : determine which dynamic loading, if any, to compile in
4869 dldir="ext/DynaLoader"
4882 $define) dflt='y' ;;
4885 $define) dflt='y' ;;
4887 : Does a dl_xxx.xs file exist for this operating system
4888 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
4891 rp="Do you wish to use dynamic loading?"
4898 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
4899 dflt="$dldir/dl_${osname}.xs"
4900 elif $test "$d_dlopen" = "$define" ; then
4901 dflt="$dldir/dl_dlopen.xs"
4902 elif $test "$i_dld" = "$define" ; then
4903 dflt="$dldir/dl_dld.xs"
4908 *) dflt="$dldir/$dlsrc"
4911 echo "The following dynamic loading files are available:"
4912 : Can not go over to $dldir because getfile has path hard-coded in.
4913 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
4914 rp="Source file to use for dynamic loading"
4916 # XXX This getfile call will fail the existence check if you try
4917 # building away from $src (this is not supported yet).
4921 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4925 Some systems may require passing special flags to $cc -c to
4926 compile modules that will be used to create a shared library.
4927 To use no flags, say "none".
4930 case "$cccdlflags" in
4931 '') case "$gccversion" in
4932 '') case "$osname" in
4934 next) dflt='none' ;;
4935 irix*) dflt='-KPIC' ;;
4936 svr4*|esix*|solaris) dflt='-KPIC' ;;
4937 sunos) dflt='-pic' ;;
4941 *) case "$osname" in
4942 svr4*|esix*|solaris) dflt='-fPIC' ;;
4947 *) dflt="$cccdlflags" ;;
4949 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4952 none) cccdlflags=' ' ;;
4953 *) cccdlflags="$ans" ;;
4958 Some systems use ld to create libraries that can be dynamically loaded,
4959 while other systems (such as those using ELF) use $cc.
4963 '') $cat >try.c <<'EOM'
4964 /* Test for whether ELF binaries are produced */
4969 int i = open("a.out",O_RDONLY);
4972 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
4973 exit(0); /* succeed (yes, it's ELF) */
4978 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
4980 You appear to have ELF support. I'll use $cc to build dynamic libraries.
4984 echo "I'll use ld to build dynamic libraries."
4993 rp="What command should be used to create dynamic libraries?"
4999 Some systems may require passing special flags to $ld to create a
5000 library that can be dynamically loaded. If your ld flags include
5001 -L/other/path options to locate libraries outside your loader's normal
5002 search path, you may need to specify those -L options here as well. To
5003 use no flags, say "none".
5006 case "$lddlflags" in
5007 '') case "$osname" in
5009 linux|irix*) dflt='-shared' ;;
5010 next) dflt='none' ;;
5011 solaris) dflt='-G' ;;
5012 beos) dflt='-nostart' ;;
5013 sunos) dflt='-assert nodefinitions' ;;
5014 svr4*|esix*) dflt="-G $ldflags" ;;
5018 *) dflt="$lddlflags" ;;
5021 : Try to guess additional flags to pick up local libraries.
5022 : Be careful not to append to a plain 'none'
5026 for thisflag in $ldflags; do
5031 *) dflt="$dflt $thisflag" ;;
5038 ''|' ') dflt='none' ;;
5041 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5044 none) lddlflags=' ' ;;
5045 *) lddlflags="$ans" ;;
5050 Some systems may require passing special flags to $cc to indicate that
5051 the resulting executable will use dynamic linking. To use no flags,
5055 case "$ccdlflags" in
5056 '') case "$osname" in
5057 hpux) dflt='-Wl,-E' ;;
5058 linux) dflt='-rdynamic' ;;
5059 next) dflt='none' ;;
5060 sunos) dflt='none' ;;
5064 *) dflt="$ccdlflags" ;;
5066 rp="Any special flags to pass to $cc to use dynamic loading?"
5069 none) ccdlflags=' ' ;;
5070 *) ccdlflags="$ans" ;;
5084 # No dynamic loading being used, so don't bother even to prompt.
5087 *) case "$useshrplib" in
5088 '') case "$osname" in
5089 svr4*|dgux|dynixptx|esix|powerux|beos)
5091 also='Building a shared libperl is required for dynamic loading to work on your system.'
5096 also='Building a shared libperl is needed for MAB support.'
5114 The perl executable is normally obtained by linking perlmain.c with
5115 libperl${_a}, any static extensions (usually just DynaLoader), and
5116 any other libraries needed on this system (such as -lm, etc.). Since
5117 your system supports dynamic loading, it is probably possible to build
5118 a shared libperl.$so. If you will have more than one executable linked
5119 to libperl.$so, this will significantly reduce the size of each
5120 executable, but it may have a noticeable affect on performance. The
5121 default is probably sensible for your system.
5125 rp="Build a shared libperl.$so (y/n)"
5130 # Why does next4 have to be so different?
5131 case "${osname}${osvers}" in
5132 next4*) xxx='DYLD_LIBRARY_PATH' ;;
5133 os2*) xxx='' ;; # Nothing special needed.
5135 *) xxx='LD_LIBRARY_PATH' ;;
5138 *) useshrplib='false' ;;
5143 case "$useshrplib" in
5147 # Figure out a good name for libperl.so. Since it gets stored in
5148 # a version-specific architecture-dependent library, the version
5149 # number isn't really that important, except for making cc/ld happy.
5151 # A name such as libperl.so.3.1
5152 majmin="libperl.$so.$patchlevel.$subversion"
5153 # A name such as libperl.so.301
5154 majonly=`echo $patchlevel $subversion |
5155 $awk '{printf "%d%02d", $1, $2}'`
5156 majonly=libperl.$so.$majonly
5157 # I'd prefer to keep the os-specific stuff here to a minimum, and
5158 # rely on figuring it out from the naming of libc.
5159 case "${osname}${osvers}" in
5162 # XXX How handle the --version stuff for MAB?
5164 linux*) # ld won't link with a bare -lperl otherwise.
5167 *) # Try to guess based on whether libc has major.minor.
5169 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5170 *libc.$so.[0-9]*) dflt=$majonly ;;
5171 *) dflt=libperl.$so ;;
5181 I need to select a good name for the shared libperl. If your system uses
5182 library names with major and minor numbers, then you might want something
5183 like $majmin. Alternatively, if your system uses a single version
5184 number for shared libraries, then you might want to use $majonly.
5185 Or, your system might be quite happy with a simple libperl.$so.
5187 Since the shared libperl will get installed into a version-specific
5188 architecture-dependent directory, the version number of the shared perl
5189 library probably isn't important, so the default should be o.k.
5192 rp='What name do you want to give to the shared libperl?'
5195 echo "Ok, I'll use $libperl"
5198 libperl="libperl${_a}"
5202 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5206 WARNING: Use of the shrpdir variable for the installation location of
5207 the shared $libperl is not supported. It was never documented and
5208 will not work in this version. Let perlbug@perl.com
5209 know of any problems this may cause.
5215 But your current setting of $shrpdir is
5216 the default anyway, so it's harmless.
5221 Further, your current attempted setting of $shrpdir
5222 conflicts with the value of $archlibexp/CORE
5223 that installperl will use.
5230 # How will the perl executable find the installed shared $libperl?
5231 # Add $xxx to ccdlflags.
5232 # If we can't figure out a command-line option, use $shrpenv to
5233 # set env LD_RUN_PATH. The main perl makefile uses this.
5234 shrpdir=$archlibexp/CORE
5237 if "$useshrplib"; then
5240 # We'll set it in Makefile.SH...
5246 xxx="-Wl,-R$shrpdir"
5248 linux|irix*|dec_osf)
5249 xxx="-Wl,-rpath,$shrpdir"
5252 # next doesn't like the default...
5255 # beos doesn't like the default, either.
5258 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5264 # Only add $xxx if it isn't already in ccdlflags.
5265 case " $ccdlflags " in
5267 *) ccdlflags="$ccdlflags $xxx"
5270 Adding $xxx to the flags
5271 passed to $ld so that the perl executable will find the
5272 installed shared $libperl.
5280 # Respect a hint or command-line value.
5282 '') shrpenv="$tmp_shrpenv" ;;
5285 : determine where manual pages go
5286 set man1dir man1dir none
5290 $spackage has manual pages available in source form.
5294 echo "However, you don't have nroff, so they're probably useless to you."
5296 '') man1dir="none";;
5299 echo "If you don't want the manual sources installed, answer 'none'."
5304 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5305 lookpath="$lookpath $prefixexp/man/p_man/man1"
5306 lookpath="$lookpath $prefixexp/man/u_man/man1"
5307 lookpath="$lookpath $prefixexp/man/man.1"
5309 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5310 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5320 rp="Where do the main $spackage manual pages (source) go?"
5322 if $test "X$man1direxp" != "X$ansexp"; then
5326 man1direxp="$ansexp"
5334 Since you are running AFS, I need to distinguish the directory in which
5335 manual pages reside from the directory in which they are installed (and from
5336 which they are presumably copied to the former directory by occult means).
5339 case "$installman1dir" in
5340 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5341 *) dflt="$installman1dir";;
5344 rp='Where will man pages be installed?'
5346 installman1dir="$ans"
5348 installman1dir="$man1direxp"
5351 : What suffix to use on installed man pages
5358 rp="What suffix should be used for the main $spackage man pages?"
5360 '') case "$man1dir" in
5374 *) dflt="$man1ext";;
5381 : see if we can have long filenames
5383 rmlist="$rmlist /tmp/cf$$"
5384 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5385 first=123456789abcdef
5386 second=/tmp/cf$$/$first
5387 $rm -f $first $second
5388 if (echo hi >$first) 2>/dev/null; then
5389 if $test -f 123456789abcde; then
5390 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5393 if (echo hi >$second) 2>/dev/null; then
5394 if $test -f /tmp/cf$$/123456789abcde; then
5396 That's peculiar... You can have filenames longer than 14 characters, but only
5397 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5398 I shall consider your system cannot support long filenames at all.
5402 echo 'You can have filenames longer than 14 characters.' >&4
5407 How confusing! Some of your filesystems are sane enough to allow filenames
5408 longer than 14 characters but some others like /tmp can't even think about them.
5409 So, for now on, I shall assume your kernel does not allow them at all.
5416 You can't have filenames longer than 14 chars. You can't even think about them!
5422 $rm -rf /tmp/cf$$ 123456789abcde*
5424 : determine where library module manual pages go
5425 set man3dir man3dir none
5429 $spackage has manual pages for many of the library modules.
5435 However, you don't have nroff, so they're probably useless to you.
5438 '') man3dir="none";;
5442 case "$d_flexfnam" in
5445 However, your system can't handle the long file names like File::Basename.3.
5448 '') man3dir="none";;
5452 echo "If you don't want the manual sources installed, answer 'none'."
5453 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5455 '') case "$prefix" in
5456 *$prog*) dflt=`echo $man1dir |
5457 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5458 *) dflt="$privlib/man/man3" ;;
5462 *) dflt="$man3dir" ;;
5467 rp="Where do the $package library man pages (source) go?"
5469 if test "X$man3direxp" != "X$ansexp"; then
5474 man3direxp="$ansexp"
5482 Since you are running AFS, I need to distinguish the directory in which
5483 manual pages reside from the directory in which they are installed (and from
5484 which they are presumably copied to the former directory by occult means).
5487 case "$installman3dir" in
5488 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5489 *) dflt="$installman3dir";;
5492 rp='Where will man pages be installed?'
5494 installman3dir="$ans"
5496 installman3dir="$man3direxp"
5499 : What suffix to use on installed man pages
5506 rp="What suffix should be used for the $package library man pages?"
5508 '') case "$man3dir" in
5522 *) dflt="$man3ext";;
5529 : see if we have to deal with yellow pages, now NIS.
5530 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5531 if $test -f /usr/etc/nibindd; then
5533 echo "I'm fairly confident you're on a NeXT."
5535 rp='Do you get the hosts file via NetInfo?'
5544 y*) hostcat='nidump hosts .';;
5545 *) case "$hostcat" in
5546 nidump*) hostcat='';;
5556 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5564 rp='Are you getting the hosts file via yellow pages?'
5567 y*) hostcat='ypcat hosts';;
5568 *) hostcat='cat /etc/hosts';;
5574 '') hostcat='cat /etc/hosts';;
5577 '') groupcat='cat /etc/group';;
5580 '') passcat='cat /etc/passwd';;
5583 : now get the host name
5585 echo "Figuring out host name..." >&4
5586 case "$myhostname" in
5588 echo 'Maybe "hostname" will work...'
5589 if tans=`sh -c hostname 2>&1` ; then
5597 if $test "$cont"; then
5599 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5600 if tans=`cat /etc/systemid 2>&1` ; then
5602 phostname='cat /etc/systemid'
5603 echo "Whadyaknow. Xenix always was a bit strange..."
5606 elif $test -r /etc/systemid; then
5607 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5610 if $test "$cont"; then
5611 echo 'No, maybe "uuname -l" will work...'
5612 if tans=`sh -c 'uuname -l' 2>&1` ; then
5614 phostname='uuname -l'
5616 echo 'Strange. Maybe "uname -n" will work...'
5617 if tans=`sh -c 'uname -n' 2>&1` ; then
5619 phostname='uname -n'
5621 echo 'Oh well, maybe I can mine it out of whoami.h...'
5622 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5623 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5624 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5626 case "$myhostname" in
5627 '') echo "Does this machine have an identity crisis or something?"
5630 echo "Well, you said $myhostname before..."
5631 phostname='echo $myhostname';;
5637 : you do not want to know about this
5642 if $test "$myhostname" ; then
5644 rp='Your host name appears to be "'$myhostname'".'" Right?"
5652 : bad guess or no guess
5653 while $test "X$myhostname" = X ; do
5655 rp="Please type the (one word) name of your host:"
5660 : translate upper to lower if necessary
5661 case "$myhostname" in
5663 echo "(Normalizing case in your host name)"
5664 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5668 case "$myhostname" in
5670 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5671 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5672 echo "(Trimming domain name from host name--host name is now $myhostname)"
5674 *) case "$mydomain" in
5677 test "X$hostcat" = "Xypcat hosts" &&
5678 ypmatch "$myhostname" hosts 2>/dev/null |\
5679 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5682 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5683 /[ ]$myhostname[ . ]/p" > hosts
5686 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5687 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5688 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5689 hosts | $sort | $uniq | \
5690 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5691 case `$echo X$dflt` in
5692 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5695 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5700 tans=`./loc resolv.conf X /etc /usr/etc`
5701 if $test -f "$tans"; then
5702 echo "(Attempting domain name extraction from $tans)"
5703 dflt=.`$sed -n -e 's/ / /g' \
5704 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5705 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5707 .) dflt=.`$sed -n -e 's/ / /g' \
5708 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5709 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5716 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5717 dflt=.`sh -c domainname 2>/dev/null`
5720 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5725 .) echo "(Lost all hope -- silly guess then)"
5731 *) dflt="$mydomain";;
5735 rp="What is your domain name?"
5745 : translate upper to lower if necessary
5748 echo "(Normalizing case in your domain name)"
5749 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5753 : a little sanity check here
5754 case "$phostname" in
5757 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5758 $myhostname$mydomain|$myhostname) ;;
5760 case "$phostname" in
5762 echo "(That doesn't agree with your whoami.h file, by the way.)"
5765 echo "(That doesn't agree with your $phostname command, by the way.)"
5775 I need to get your e-mail address in Internet format if possible, i.e.
5776 something like user@host.domain. Please answer accurately since I have
5777 no easy means to double check it. The default value provided below
5778 is most probably close to the reality but may not be valid from outside
5779 your organization...
5783 while test "$cont"; do
5785 '') dflt="$cf_by@$myhostname$mydomain";;
5786 *) dflt="$cf_email";;
5788 rp='What is your e-mail address?'
5794 rp='Address does not look like an Internet one. Use it anyway?'
5810 If you or somebody else will be maintaining perl at your site, please
5811 fill in the correct e-mail address here so that they may be contacted
5812 if necessary. Currently, the "perlbug" program included with perl
5813 will send mail to this address in addition to perlbug@perl.com. You may
5814 enter "none" for no administrator.
5817 case "$perladmin" in
5818 '') dflt="$cf_email";;
5819 *) dflt="$perladmin";;
5821 rp='Perl administrator e-mail address'
5825 : figure out how to guarantee perl startup
5826 case "$startperl" in
5828 case "$sharpbang" in
5832 I can use the #! construct to start perl on your system. This will
5833 make startup of perl scripts faster, but may cause problems if you
5834 want to share those scripts and perl is not in a standard place
5835 ($binexp/perl) on all your platforms. The alternative is to force
5836 a shell by starting the script with a single ':' character.
5840 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
5843 none) startperl=": # use perl";;
5844 *) startperl="#!$ans"
5845 if $test 30 -lt `echo "$ans" | wc -c`; then
5848 WARNING: Some systems limit the #! command to 32 characters.
5849 If you experience difficulty running Perl scripts with #!, try
5850 installing Perl in a directory with a shorter pathname.
5856 *) startperl=": # use perl"
5861 echo "I'll use $startperl to start perl scripts."
5863 : figure best path for perl in scripts
5866 perlpath="$binexp/perl"
5867 case "$startperl" in
5872 I will use the "eval 'exec'" idiom to start Perl on your system.
5873 I can use the full path of your Perl binary for this purpose, but
5874 doing so may cause problems if you want to share those scripts and
5875 Perl is not always in a standard place ($binexp/perl).
5879 rp="What path shall I use in \"eval 'exec'\"?"
5886 case "$startperl" in
5888 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
5891 : determine where public executable scripts go
5892 set scriptdir scriptdir
5894 case "$scriptdir" in
5897 : guess some guesses
5898 $test -d /usr/share/scripts && dflt=/usr/share/scripts
5899 $test -d /usr/share/bin && dflt=/usr/share/bin
5900 $test -d /usr/local/script && dflt=/usr/local/script
5901 $test -d $prefixexp/script && dflt=$prefixexp/script
5905 *) dflt="$scriptdir"
5910 Some installations have a separate directory just for executable scripts so
5911 that they can mount it across multiple architectures but keep the scripts in
5912 one spot. You might, for example, have a subdirectory of /usr/share for this.
5913 Or you might just lump your scripts in with all your other executables.
5917 rp='Where do you keep publicly executable scripts?'
5919 if $test "X$ansexp" != "X$scriptdirexp"; then
5923 scriptdirexp="$ansexp"
5927 Since you are running AFS, I need to distinguish the directory in which
5928 scripts reside from the directory in which they are installed (and from
5929 which they are presumably copied to the former directory by occult means).
5932 case "$installscript" in
5933 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
5934 *) dflt="$installscript";;
5937 rp='Where will public scripts be installed?'
5939 installscript="$ans"
5941 installscript="$scriptdirexp"
5944 : determine where site specific libraries go.
5945 : Usual default is /usr/local/lib/perl5/site_perl/$apiversion
5946 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5948 *perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
5949 *) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
5954 The installation process will also create a directory for
5955 site-specific extensions and modules. Some users find it convenient
5956 to place all local files in this directory rather than in the main
5957 distribution directory.
5961 rp='Pathname for the site-specific library files?'
5963 if $test "X$sitelibexp" != "X$ansexp"; then
5967 sitelibexp="$ansexp"
5971 Since you are running AFS, I need to distinguish the directory in
5972 which site-specific files reside from the directory in which they are
5973 installed (and from which they are presumably copied to the former
5974 directory by occult means).
5977 case "$installsitelib" in
5978 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
5979 *) dflt="$installsitelib";;
5982 rp='Where will site-specific files be installed?'
5984 installsitelib="$ans"
5986 installsitelib="$sitelibexp"
5989 : determine where site specific architecture-dependent libraries go.
5990 : sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
5991 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
5992 : sitelib may have an optional trailing /share.
5993 tdflt=`echo $sitelib | $sed 's,/share$,,'`
5994 tdflt="$tdflt/$archname"
5995 set sitearch sitearch none
5998 '') dflt="$tdflt" ;;
5999 *) dflt="$sitearch" ;;
6003 The installation process will also create a directory for
6004 architecture-dependent site-specific extensions and modules.
6008 rp='Pathname for the site-specific architecture-dependent library files?'
6010 if $test "X$sitearchexp" != "X$ansexp"; then
6014 sitearchexp="$ansexp"
6018 Since you are running AFS, I need to distinguish the directory in
6019 which site-specific architecture-dependent library files reside from
6020 the directory in which they are installed (and from which they are
6021 presumably copied to the former directory by occult means).
6024 case "$installsitearch" in
6025 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
6026 *) dflt="$installsitearch";;
6029 rp='Where will site-specific architecture-dependent files be installed?'
6031 installsitearch="$ans"
6033 installsitearch="$sitearchexp"
6038 Previous version of $package used the standard IO mechanisms as defined
6039 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6040 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6041 the default. This abstraction layer can use AT&T's sfio (if you already
6042 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6043 problems with some extension modules. Using PerlIO with stdio is safe,
6044 but it is slower than plain stdio and therefore is not the default.
6046 If this doesn't make any sense to you, just accept the default 'n'.
6048 case "$useperlio" in
6049 $define|true|[yY]*) dflt='y';;
6052 rp='Use the experimental PerlIO abstraction layer?'
6059 echo "Ok, doing things the stdio way"
6066 : Check how to convert floats to strings.
6067 if test "X$d_Gconvert" = X; then
6069 echo "Checking for an efficient way to convert floats to strings."
6072 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6073 char *myname = "gconvert";
6076 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6077 char *myname = "gcvt";
6080 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6081 char *myname = "sprintf";
6087 checkit(expect, got)
6091 if (strcmp(expect, got)) {
6092 printf("%s oddity: Expected %s, got %s\n",
6093 myname, expect, got);
6103 /* This must be 1st test on (which?) platform */
6104 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6105 Gconvert(0.1, 8, 0, buf);
6106 checkit("0.1", buf);
6108 Gconvert(1.0, 8, 0, buf);
6111 Gconvert(0.0, 8, 0, buf);
6114 Gconvert(-1.0, 8, 0, buf);
6117 /* Some Linux gcvt's give 1.e+5 here. */
6118 Gconvert(100000.0, 8, 0, buf);
6119 checkit("100000", buf);
6121 /* Some Linux gcvt's give -1.e+5 here. */
6122 Gconvert(-100000.0, 8, 0, buf);
6123 checkit("-100000", buf);
6128 case "$d_Gconvert" in
6129 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6130 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6131 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6132 *) xxx_list='gconvert gcvt sprintf' ;;
6135 for xxx_convert in $xxx_list; do
6136 echo "Trying $xxx_convert"
6138 set try -DTRY_$xxx_convert
6139 if eval $compile; then
6140 echo "$xxx_convert" found. >&4
6142 echo "I'll use $xxx_convert to convert floats into a string." >&4
6145 echo "...But $xxx_convert didn't work as I expected."
6148 echo "$xxx_convert NOT found." >&4
6152 case "$xxx_convert" in
6153 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6154 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6155 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6159 : Initialize h_fcntl
6162 : Initialize h_sysfile
6165 : access call always available on UNIX
6169 : locate the flags for 'access()'
6173 $cat >access.c <<'EOCP'
6174 #include <sys/types.h>
6179 #include <sys/file.h>
6188 : check sys/file.h first, no particular reason here
6189 if $test `./findhdr sys/file.h` && \
6190 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
6192 echo "<sys/file.h> defines the *_OK access constants." >&4
6193 elif $test `./findhdr fcntl.h` && \
6194 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
6196 echo "<fcntl.h> defines the *_OK access constants." >&4
6197 elif $test `./findhdr unistd.h` && \
6198 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
6199 echo "<unistd.h> defines the *_OK access constants." >&4
6201 echo "I can't find the four *_OK access constants--I'll use mine." >&4
6207 : see if alarm exists
6211 : Look for GNU-cc style attribute checking
6213 echo "Checking whether your compiler can handle __attribute__ ..." >&4
6214 $cat >attrib.c <<'EOCP'
6216 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
6218 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
6219 if $contains 'warning' attrib.out >/dev/null 2>&1; then
6220 echo "Your C compiler doesn't fully support __attribute__."
6223 echo "Your C compiler supports __attribute__."
6227 echo "Your C compiler doesn't seem to understand __attribute__ at all."
6234 : see if bcmp exists
6238 : see if bcopy exists
6242 : see if this is a unistd.h system
6243 set unistd.h i_unistd
6246 : see if getpgrp exists
6247 set getpgrp d_getpgrp
6250 case "$d_getpgrp" in
6253 echo "Checking to see which flavor of getpgrp is in use..."
6256 #include <sys/types.h>
6258 # include <unistd.h>
6262 if (getuid() == 0) {
6263 printf("(I see you are running Configure as super-user...)\n");
6267 if (getpgrp(1) == 0)
6276 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6277 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6279 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6280 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6283 echo "I can't seem to compile and run the test program."
6285 xxx="a USG one, i.e. you use getpgrp()."
6287 # SVR4 systems can appear rather BSD-ish.
6290 xxx="a BSD one, i.e. you use getpgrp(pid)."
6294 xxx="probably a USG one, i.e. you use getpgrp()."
6299 echo "Assuming your getpgrp is $xxx" >&4
6308 : see if setpgrp exists
6309 set setpgrp d_setpgrp
6312 case "$d_setpgrp" in
6315 echo "Checking to see which flavor of setpgrp is in use..."
6318 #include <sys/types.h>
6320 # include <unistd.h>
6324 if (getuid() == 0) {
6325 printf("(I see you are running Configure as super-user...)\n");
6329 if (-1 == setpgrp(1, 1))
6332 if (setpgrp() != -1)
6338 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6339 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6341 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6342 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6345 echo "(I can't seem to compile and run the test program.)"
6347 xxx="a USG one, i.e. you use setpgrp()."
6349 # SVR4 systems can appear rather BSD-ish.
6352 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6356 xxx="probably a USG one, i.e. you use setpgrp()."
6361 echo "Assuming your setpgrp is $xxx" >&4
6369 : see if bzero exists
6373 : check for lengths of integral types
6377 echo "Checking to see how big your integers are..." >&4
6378 $cat >intsize.c <<'EOCP'
6382 printf("intsize=%d;\n", sizeof(int));
6383 printf("longsize=%d;\n", sizeof(long));
6384 printf("shortsize=%d;\n", sizeof(short));
6389 if eval $compile_ok && ./intsize > /dev/null; then
6391 echo "Your integers are $intsize bytes long."
6392 echo "Your long integers are $longsize bytes long."
6393 echo "Your short integers are $shortsize bytes long."
6397 Help! I can't compile and run the intsize test program: please enlighten me!
6398 (This is probably a misconfiguration in your system or libraries, and
6399 you really ought to fix it. Still, I'll try anyway.)
6403 rp="What is the size of an integer (in bytes)?"
6407 rp="What is the size of a long integer (in bytes)?"
6411 rp="What is the size of a short integer (in bytes)?"
6417 $rm -f intsize intsize.*
6419 : see if signal is declared as pointer to function returning int or void
6421 xxx=`./findhdr signal.h`
6422 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6423 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6424 echo "You have int (*signal())() instead of void." >&4
6426 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6427 echo "You have void (*signal())()." >&4
6429 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6430 echo "You have int (*signal())() instead of void." >&4
6432 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6433 echo "You have void (*signal())()." >&4
6436 case "$d_voidsig" in
6438 echo "I can't determine whether signal handler returns void or int..." >&4
6440 rp="What type does your signal handler return?"
6447 echo "As you already told me, signal handler returns void." >&4
6450 *) echo "As you already told me, signal handler returns int." >&4
6457 case "$d_voidsig" in
6458 "$define") signal_t="void";;
6463 : check for ability to cast large floats to 32-bit ints.
6465 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6466 if $test "$intsize" -ge 4; then
6473 #include <sys/types.h>
6475 $signal_t blech(s) int s; { exit(3); }
6482 signal(SIGFPE, blech);
6484 /* Don't let compiler optimize the test away. Store the number
6485 in a writable string for gcc to pass to sscanf under HP/UX.
6487 sprintf(str, "2147483647");
6488 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6492 /* x86 processors will probably give 0x8000 0000, which is a
6493 sign change. We don't want that. We want to mimic SPARC
6494 behavior here, which is to preserve the sign and give
6497 if (i32 != ($xxx) f)
6503 if eval $compile_ok; then
6507 echo "(I can't seem to compile the test program--assuming it can't)"
6515 echo "Nope, it can't."
6522 : check for ability to cast negative floats to unsigned
6524 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6527 #include <sys/types.h>
6529 $signal_t blech(s) int s; { exit(7); }
6530 $signal_t blech_in_list(s) int s; { exit(4); }
6531 unsigned long dummy_long(p) unsigned long p; { return p; }
6532 unsigned int dummy_int(p) unsigned int p; { return p; }
6533 unsigned short dummy_short(p) unsigned short p; { return p; }
6537 unsigned long along;
6539 unsigned short ashort;
6543 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6544 a direct f = -123. assignment. gcc-2.8.0 reportedly
6545 optimized the whole file away
6547 /* Store the number in a writable string for gcc to pass to
6550 sprintf(str, "-123");
6551 sscanf(str, "%lf", &f); /* f = -123.; */
6553 signal(SIGFPE, blech);
6554 along = (unsigned long)f;
6555 aint = (unsigned int)f;
6556 ashort = (unsigned short)f;
6557 if (along != (unsigned long)-123)
6559 if (aint != (unsigned int)-123)
6561 if (ashort != (unsigned short)-123)
6563 sprintf(str, "1073741824.");
6564 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6567 along = (unsigned long)f;
6568 if (along != 0x80000000)
6572 along = (unsigned long)f;
6573 if (along != 0x7fffffff)
6577 along = (unsigned long)f;
6578 if (along != 0x80000001)
6582 signal(SIGFPE, blech_in_list);
6583 sprintf(str, "123.");
6584 sscanf(str, "%lf", &f); /* f = 123.; */
6585 along = dummy_long((unsigned long)f);
6586 aint = dummy_int((unsigned int)f);
6587 ashort = dummy_short((unsigned short)f);
6588 if (along != (unsigned long)123)
6590 if (aint != (unsigned int)123)
6592 if (ashort != (unsigned short)123)
6599 if eval $compile_ok; then
6603 echo "(I can't seem to compile the test program--assuming it can't)"
6606 case "$castflags" in
6611 echo "Nope, it can't."
6618 : see if vprintf exists
6620 if set vprintf val -f d_vprintf; eval $csym; $val; then
6621 echo 'vprintf() found.' >&4
6623 $cat >vprintf.c <<'EOF'
6624 #include <varargs.h>
6626 int main() { xxx("foo"); }
6635 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6639 if eval $compile && ./vprintf; then
6640 echo "Your vsprintf() returns (int)." >&4
6643 echo "Your vsprintf() returns (char*)." >&4
6647 echo 'vprintf() NOT found.' >&4
6657 : see if chown exists
6661 : see if chroot exists
6665 : see if chsize exists
6669 : check for const keyword
6671 echo 'Checking to see if your C compiler knows about "const"...' >&4
6672 $cat >const.c <<'EOCP'
6673 typedef struct spug { int drokk; } spug;
6680 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
6682 echo "Yup, it does."
6685 echo "Nope, it doesn't."
6690 : see if crypt exists
6692 if set crypt val -f d_crypt; eval $csym; $val; then
6693 echo 'crypt() found.' >&4
6697 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
6698 if $test -z "$cryptlib"; then
6699 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
6703 if $test -z "$cryptlib"; then
6704 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
6708 if $test -z "$cryptlib"; then
6709 cryptlib=`./loc libcrypt$_a "" $libpth`
6713 if $test -z "$cryptlib"; then
6714 echo 'crypt() NOT found.' >&4
6723 : see if cuserid exists
6724 set cuserid d_cuserid
6727 : see if this is a limits.h system
6728 set limits.h i_limits
6731 : see if this is a float.h system
6735 : See if number of significant digits in a double precision number is known
6737 $cat >dbl_dig.c <<EOM
6747 printf("Contains DBL_DIG");
6750 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
6751 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
6752 echo "DBL_DIG found." >&4
6755 echo "DBL_DIG NOT found." >&4
6762 : see if difftime exists
6763 set difftime d_difftime
6766 : see if sys/stat.h is available
6767 set sys/stat.h i_sysstat
6770 : see if this is a dirent system
6772 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
6774 echo "<dirent.h> found." >&4
6777 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
6778 echo "<sys/dir.h> found." >&4
6781 xinc=`./findhdr sys/ndir.h`
6783 echo "<dirent.h> NOT found." >&4
6788 : Look for type of directory structure.
6790 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6792 case "$direntrytype" in
6795 $define) guess1='struct dirent' ;;
6796 *) guess1='struct direct' ;;
6799 *) guess1="$direntrytype"
6804 'struct dirent') guess2='struct direct' ;;
6805 *) guess2='struct dirent' ;;
6808 if $contains "$guess1" try.c >/dev/null 2>&1; then
6809 direntrytype="$guess1"
6810 echo "Your directory entries are $direntrytype." >&4
6811 elif $contains "$guess2" try.c >/dev/null 2>&1; then
6812 direntrytype="$guess2"
6813 echo "Your directory entries seem to be $direntrytype." >&4
6815 echo "I don't recognize your system's directory entries." >&4
6816 rp="What type is used for directory entries on this system?"
6824 : see if the directory entry stores field length
6826 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6827 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
6828 echo "Good, your directory entry keeps length information in d_namlen." >&4
6831 echo "Your directory entry does not know about the d_namlen field." >&4
6838 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
6839 while $test $# -ge 2; do
6841 $define) echo "#include <$2>";;
6845 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
6846 if eval $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6855 : see if dlerror exists
6858 set dlerror d_dlerror
6862 : see if dlfcn is available
6870 On a few systems, the dynamically loaded modules that perl generates and uses
6871 will need a different extension than shared libs. The default will probably
6879 rp='What is the extension of dynamically loaded modules'
6888 : Check if dlsym need a leading underscore
6894 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
6895 $cat >dyna.c <<'EOM'
6904 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
6906 #include <sys/types.h>
6920 int mode = RTLD_LAZY ;
6922 handle = dlopen("./dyna.$dlext", mode) ;
6923 if (handle == NULL) {
6928 symbol = dlsym(handle, "fred") ;
6929 if (symbol == NULL) {
6930 /* try putting a leading underscore */
6931 symbol = dlsym(handle, "_fred") ;
6932 if (symbol == NULL) {
6945 : Call the object file tmp-dyna.o in case dlext=o.
6946 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
6947 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
6948 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
6949 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
6952 1) echo "Test program failed using dlopen." >&4
6953 echo "Perhaps you should not use dynamic loading." >&4;;
6954 2) echo "Test program failed using dlsym." >&4
6955 echo "Perhaps you should not use dynamic loading." >&4;;
6956 3) echo "dlsym needs a leading underscore" >&4
6958 4) echo "dlsym doesn't need a leading underscore." >&4;;
6961 echo "I can't compile and run the test program." >&4
6966 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
6971 : see if dup2 exists
6975 : see if endhostent exists
6976 set endhostent d_endhent
6979 : see if endnetent exists
6980 set endnetent d_endnent
6983 : see if endprotoent exists
6984 set endprotoent d_endpent
6987 : see if endservent exists
6988 set endservent d_endsent
6991 : Locate the flags for 'open()'
6993 $cat >open3.c <<'EOCP'
6994 #include <sys/types.h>
6999 #include <sys/file.h>
7010 : check sys/file.h first to get FREAD on Sun
7011 if $test `./findhdr sys/file.h` && \
7012 set open3 -DI_SYS_FILE && eval $compile; then
7014 echo "<sys/file.h> defines the O_* constants..." >&4
7016 echo "and you have the 3 argument form of open()." >&4
7019 echo "but not the 3 argument form of open(). Oh, well." >&4
7022 elif $test `./findhdr fcntl.h` && \
7023 set open3 -DI_FCNTL && eval $compile; then
7025 echo "<fcntl.h> defines the O_* constants..." >&4
7027 echo "and you have the 3 argument form of open()." >&4
7030 echo "but not the 3 argument form of open(). Oh, well." >&4
7035 echo "I can't find the O_* constant definitions! You got problems." >&4
7041 : check for non-blocking I/O stuff
7042 case "$h_sysfile" in
7043 true) echo "#include <sys/file.h>" > head.c;;
7046 true) echo "#include <fcntl.h>" > head.c;;
7047 *) echo "#include <sys/fcntl.h>" > head.c;;
7052 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7053 case "$o_nonblock" in
7056 $cat >>try.c <<'EOCP'
7059 printf("O_NONBLOCK\n");
7063 printf("O_NDELAY\n");
7067 printf("FNDELAY\n");
7074 if eval $compile_ok; then
7076 case "$o_nonblock" in
7077 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
7078 *) echo "Seems like we can use $o_nonblock.";;
7081 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
7084 *) echo "Using $hint value $o_nonblock.";;
7086 $rm -f try try.* .out core
7089 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7095 #include <sys/types.h>
7097 #define MY_O_NONBLOCK $o_nonblock
7098 #ifndef errno /* XXX need better Configure test */
7101 $signal_t blech(x) int x; { exit(3); }
7103 $cat >> try.c <<'EOCP'
7111 pipe(pd); /* Down: child -> parent */
7112 pipe(pu); /* Up: parent -> child */
7115 close(pd[1]); /* Parent reads from pd[0] */
7116 close(pu[0]); /* Parent writes (blocking) to pu[1] */
7117 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
7119 signal(SIGALRM, blech);
7121 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
7123 sprintf(string, "%d\n", ret);
7124 write(2, string, strlen(string));
7127 if (errno == EAGAIN) {
7133 if (errno == EWOULDBLOCK)
7134 printf("EWOULDBLOCK\n");
7137 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
7138 sleep(2); /* Give it time to close our pipe */
7140 ret = read(pd[0], buf, 1); /* Should read EOF */
7142 sprintf(string, "%d\n", ret);
7143 write(3, string, strlen(string));
7147 close(pd[0]); /* We write to pd[1] */
7148 close(pu[1]); /* We read from pu[0] */
7149 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
7150 close(pd[1]); /* Pipe pd is now fully closed! */
7151 exit(0); /* Bye bye, thank you for playing! */
7155 if eval $compile_ok; then
7156 echo "$startsh" >mtry
7157 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
7159 ./mtry >/dev/null 2>&1
7161 0) eagain=`$cat try.out`;;
7162 1) echo "Could not perform non-blocking setting!";;
7163 2) echo "I did a successful read() for something that was not there!";;
7164 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
7165 *) echo "Something terribly wrong happened during testing.";;
7167 rd_nodata=`$cat try.ret`
7168 echo "A read() system call with no data present returns $rd_nodata."
7169 case "$rd_nodata" in
7172 echo "(That's peculiar, fixing that to be -1.)"
7178 echo "Forcing errno EAGAIN on read() with no data available."
7182 echo "Your read() sets errno to $eagain when no data is available."
7185 status=`$cat try.err`
7187 0) echo "And it correctly returns 0 to signal EOF.";;
7188 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
7189 *) echo "However, your read() returns '$status' on EOF??";;
7192 if test "$status" = "$rd_nodata"; then
7193 echo "WARNING: you can't distinguish between EOF and no data!"
7197 echo "I can't compile the test program--assuming errno EAGAIN will do."
7204 echo "Using $hint value $eagain."
7205 echo "Your read() returns $rd_nodata when no data is present."
7206 case "$d_eofnblk" in
7207 "$define") echo "And you can see EOF because read() returns 0.";;
7208 "$undef") echo "But you can't see EOF status from read() returned value.";;
7210 echo "(Assuming you can't see EOF status from read anyway.)"
7216 $rm -f try try.* .out core head.c mtry
7218 : see if fchmod exists
7222 : see if fchown exists
7226 : see if this is an fcntl system
7230 : see if fgetpos exists
7231 set fgetpos d_fgetpos
7234 : see if flock exists
7238 : see if fork exists
7242 : see if pathconf exists
7243 set pathconf d_pathconf
7246 : see if fpathconf exists
7247 set fpathconf d_fpathconf
7250 : see if fsetpos exists
7251 set fsetpos d_fsetpos
7254 : see if gethostbyaddr exists
7255 set gethostbyaddr d_gethbyaddr
7258 : see if gethostbyname exists
7259 set gethostbyname d_gethbyname
7262 : see if this is a sys/param system
7263 set sys/param.h i_sysparam
7266 : see if this is a sys/mount.h system
7267 set sys/mount.h i_sysmount
7270 : see if fstatfs exists
7271 set fstatfs d_fstatfs
7274 : see if statfs knows about mount flags
7276 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
7279 : see if this is a sysstatvfs.h system
7280 set sys/statvfs.h i_sysstatvfs
7283 : see if fstatvfs exists
7284 set fstatvfs d_fstatvfs
7287 : see if gethostent exists
7288 set gethostent d_gethent
7291 hasproto='varname=$1; func=$2; shift; shift;
7292 while $test $# -ge 2; do
7294 $define) echo "#include <$2>";;
7298 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7299 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7300 echo "$func() prototype found.";
7303 echo "$func() prototype NOT found.";
7308 $rm -f try.c tryout.c'
7310 : see if this is a netdb.h system
7314 : see if prototypes for various gethostxxx netdb.h functions are available
7316 set d_gethostprotos gethostent $i_netdb netdb.h
7319 : see if getlogin exists
7320 set getlogin d_getlogin
7323 : see if getnetbyaddr exists
7324 set getnetbyaddr d_getnbyaddr
7327 : see if getnetbyname exists
7328 set getnetbyname d_getnbyname
7331 : see if getnetent exists
7332 set getnetent d_getnent
7335 : see if prototypes for various getnetxxx netdb.h functions are available
7337 set d_getnetprotos getnetent $i_netdb netdb.h
7341 : see if getprotobyname exists
7342 set getprotobyname d_getpbyname
7345 : see if getprotobynumber exists
7346 set getprotobynumber d_getpbynumber
7349 : see if getprotoent exists
7350 set getprotoent d_getpent
7353 : see if this is a mntent.h system
7354 set mntent.h i_mntent
7357 : see if getmntent exists
7358 set getmntent d_getmntent
7361 : see if hasmntopt exists
7362 set hasmntopt d_hasmntopt
7365 : see if getpgid exists
7366 set getpgid d_getpgid
7369 : see if getpgrp2 exists
7370 set getpgrp2 d_getpgrp2
7373 : see if getppid exists
7374 set getppid d_getppid
7377 : see if getpriority exists
7378 set getpriority d_getprior
7381 : see if prototypes for various getprotoxxx netdb.h functions are available
7383 set d_getprotoprotos getprotoent $i_netdb netdb.h
7386 : see if getservbyname exists
7387 set getservbyname d_getsbyname
7390 : see if getservbyport exists
7391 set getservbyport d_getsbyport
7394 : see if getservent exists
7395 set getservent d_getsent
7398 : see if prototypes for various getservxxx netdb.h functions are available
7400 set d_getservprotos getservent $i_netdb netdb.h
7403 : see if gettimeofday or ftime exists
7404 set gettimeofday d_gettimeod
7406 case "$d_gettimeod" in
7412 val="$undef"; set d_ftime; eval $setvar
7415 case "$d_gettimeod$d_ftime" in
7418 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
7422 : see if this is a netinet/in.h or sys/in.h system
7423 set netinet/in.h i_niin sys/in.h i_sysin
7426 : see if arpa/inet.h has to be included
7427 set arpa/inet.h i_arpainet
7430 : see if htonl --and friends-- exists
7435 : Maybe they are macros.
7440 #include <sys/types.h>
7441 #$i_niin I_NETINET_IN
7443 #$i_arpainet I_ARPA_INET
7445 #include <netinet/in.h>
7451 #include <arpa/inet.h>
7454 printf("Defined as a macro.");
7457 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
7458 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
7460 echo "But it seems to be defined as a macro." >&4
7468 : see which of string.h or strings.h is needed
7470 strings=`./findhdr string.h`
7471 if $test "$strings" && $test -r "$strings"; then
7472 echo "Using <string.h> instead of <strings.h>." >&4
7476 strings=`./findhdr strings.h`
7477 if $test "$strings" && $test -r "$strings"; then
7478 echo "Using <strings.h> instead of <string.h>." >&4
7480 echo "No string header found -- You'll surely have problems." >&4
7486 "$undef") strings=`./findhdr strings.h`;;
7487 *) strings=`./findhdr string.h`;;
7492 if set index val -f; eval $csym; $val; then
7493 if set strchr val -f d_strchr; eval $csym; $val; then
7494 if $contains strchr "$strings" >/dev/null 2>&1 ; then
7497 echo "strchr() found." >&4
7501 echo "index() found." >&4
7506 echo "index() found." >&4
7509 if set strchr val -f d_strchr; eval $csym; $val; then
7512 echo "strchr() found." >&4
7514 echo "No index() or strchr() found!" >&4
7519 set d_strchr; eval $setvar
7521 set d_index; eval $setvar
7523 : check whether inet_aton exists
7524 set inet_aton d_inetaton
7529 $cat >isascii.c <<'EOCP'
7541 if eval $compile; then
7542 echo "isascii() found." >&4
7545 echo "isascii() NOT found." >&4
7552 : see if killpg exists
7556 : see if lchown exists
7558 $cat > try.c <<'EOCP'
7559 /* System header to define __stub macros and hopefully few prototypes,
7560 which can conflict with char lchown(); below. */
7562 /* Override any gcc2 internal prototype to avoid an error. */
7563 /* We use char because int might match the return type of a gcc2
7564 builtin and then its argument prototype would still apply. */
7567 /* The GNU C library defines this for functions which it implements
7568 to always fail with ENOSYS. Some functions are actually named
7569 something starting with __ and the normal name is an alias. */
7570 #if defined (__stub_lchown) || defined (__stub___lchown)
7578 if eval $compile; then
7579 $echo "lchown() found." >&4
7582 $echo "lchown() NOT found." >&4
7588 : see if link exists
7592 : see if localeconv exists
7593 set localeconv d_locconv
7596 : see if lockf exists
7600 : check for long doubles
7602 echo $n "Checking to see if your system supports long doubles...$c" >&4
7603 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7604 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7606 echo " Yup, it does." >&4
7609 echo " Nope, it doesn't." >&4
7615 : check for length of long double
7616 case "${d_longdbl}${longdblsize}" in
7619 $echo $n "Checking to see how big your long doubles are...$c" >&4
7620 $cat >try.c <<'EOCP'
7624 printf("%d\n", sizeof(long double));
7628 if eval $compile; then
7630 $echo " $longdblsize bytes." >&4
7634 echo "(I can't seem to compile the test program. Guessing...)" >&4
7635 rp="What is the size of a long double (in bytes)?"
7639 if $test "X$doublesize" = "X$longdblsize"; then
7640 echo "(That isn't any different from an ordinary double.)"
7646 : check for long long
7648 echo $n "Checking to see if your system supports long long...$c" >&4
7649 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
7650 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7652 echo " Yup, it does." >&4
7655 echo " Nope, it doesn't." >&4
7661 : check for length of long long
7662 case "${d_longlong}${longlongsize}" in
7665 $echo $n "Checking to see how big your long longs are...$c" >&4
7666 $cat >try.c <<'EOCP'
7670 printf("%d\n", sizeof(long long));
7674 if eval $compile_ok; then
7675 longlongsize=`./try`
7676 $echo " $longlongsize bytes." >&4
7680 echo "(I can't seem to compile the test program. Guessing...)"
7681 rp="What is the size of a long long (in bytes)?"
7685 if $test "X$longsize" = "X$longlongsize"; then
7686 echo "(That isn't any different from an ordinary long.)"
7692 : see if lstat exists
7696 : see if mblen exists
7700 : see if mbstowcs exists
7701 set mbstowcs d_mbstowcs
7704 : see if mbtowc exists
7708 : see if memcmp exists
7712 : see if memcpy exists
7716 : see if memmove exists
7717 set memmove d_memmove
7720 : see if memset exists
7724 : see if mkdir exists
7728 : see if mkfifo exists
7732 : see if mktime exists
7736 : see if msgctl exists
7740 : see if msgget exists
7744 : see if msgsnd exists
7748 : see if msgrcv exists
7752 : see how much of the 'msg*(2)' library is present.
7755 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
7756 *"$undef"*) h_msg=false;;
7760 case "`ipcs 2>&1`" in
7761 "SVID messages"*"not configured"*)
7762 echo "Your $osname does not have the msg*(2) configured." >&4
7777 : we could also check for sys/ipc.h ...
7778 if $h_msg && $test `./findhdr sys/msg.h`; then
7779 echo "You have the full msg*(2) library." >&4
7782 echo "You don't have the full msg*(2) library." >&4
7788 : see if nice exists
7792 : see if pause exists
7796 : see if pipe exists
7800 : see if poll exists
7805 : see whether the various POSIXish _yields exist
7807 #include <pthread.h>
7813 : see if pthread_yield exists within given cccmd,
7814 : if we do not usethreads this may well end up undef.
7815 set try -DYIELD=pthread_yield
7816 if eval $compile; then
7818 echo 'pthread_yield() found.' >&4
7821 echo 'pthread_yield() NOT found.' >&4
7826 : see if sched_yield exists within given cccmd,
7827 : if we do not usethreads this may well end up undef.
7828 set try -DYIELD=sched_yield
7829 if eval $compile; then
7831 echo 'sched_yield() found.' >&4
7834 echo 'sched_yield() NOT found.' >&4
7840 : see if this is a pthread.h system
7841 set pthread.h i_pthread
7844 : see if this is a mach/cthreads.h system
7845 set mach/cthreads.h i_machcthreads
7848 : test whether pthreads are created in joinable -- aka undetached -- state
7849 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
7850 echo $n "Checking whether pthreads are created joinable. $c" >&4
7852 #include <pthread.h>
7855 pthread_attr_t attr;
7858 pthread_attr_init(&attr) == 0 &&
7859 pthread_attr_getdetachstate(&attr, &detachstate) == 0 &&
7860 detachstate == PTHREAD_CREATE_DETACHED ?
7861 "detached" : "joinable");
7866 if eval $compile; then
7869 detached) echo "Nope, they aren't." >&4 ;;
7870 *) echo "Yup, they are." >&4 ;;
7874 echo "(I can't execute the test program--assuming they are.)" >&4
7879 detached) val="$undef" ;;
7882 set d_pthreads_created_joinable
7885 d_pthreads_created_joinable="$undef"
7888 : see if this is a pwd.h system
7894 : see if setpwent exists
7895 set setpwent d_setpwent
7898 : see if getpwent exists
7899 set getpwent d_getpwent
7902 : see if endpwent exists
7903 set endpwent d_endpwent
7906 xxx=`./findhdr pwd.h`
7907 $cppstdin $cppflags $cppminus < $xxx >$$.h
7909 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
7917 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
7925 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
7933 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
7941 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
7949 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
7957 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
7965 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
7975 *) # Assume all is lost as far as the d_*pw* go.
7977 set d_setpwent; eval $setvar
7978 set d_getpwent; eval $setvar
7979 set d_endpwent; eval $setvar
7980 set d_pwquota; eval $setvar
7981 set d_pwage; eval $setvar
7982 set d_pwchange; eval $setvar
7983 set d_pwclass; eval $setvar
7984 set d_pwexpire; eval $setvar
7985 set d_pwcomment; eval $setvar
7986 set d_pwgecos; eval $setvar
7987 set d_pwpasswd; eval $setvar
7991 : see if readdir and friends exist
7992 set readdir d_readdir
7994 set seekdir d_seekdir
7996 set telldir d_telldir
7998 set rewinddir d_rewinddir
8001 : see if readlink exists
8002 set readlink d_readlink
8005 : see if rename exists
8009 : see if rmdir exists
8013 : see if memory.h is available.
8018 : See if it conflicts with string.h
8024 $cppstdin $cppflags $cppminus < $strings > mem.h
8025 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
8027 echo "We won't be including <memory.h>."
8037 : can bcopy handle overlapping blocks?
8042 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
8049 $cat >>try.c <<'EOCP'
8052 # include <memory.h>
8055 # include <stdlib.h>
8058 # include <string.h>
8060 # include <strings.h>
8063 # include <unistd.h> /* Needed for NetBSD */
8067 char buf[128], abc[128];
8073 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
8075 for (align = 7; align >= 0; align--) {
8076 for (len = 36; len; len--) {
8079 for (off = 1; off <= len; off++) {
8080 bcopy(b, b+off, len);
8081 bcopy(b+off, b, len);
8082 if (bcmp(b, abc, len))
8091 if eval $compile_ok; then
8092 if ./try 2>/dev/null; then
8096 echo "It can't, sorry."
8097 case "$d_memmove" in
8098 "$define") echo "But that's Ok since you have memmove()." ;;
8102 echo "(I can't compile the test program, so we'll assume not...)"
8103 case "$d_memmove" in
8104 "$define") echo "But that's Ok since you have memmove()." ;;
8109 $rm -f try.* try core
8113 : can memcpy handle overlapping blocks?
8118 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
8125 $cat >>try.c <<'EOCP'
8128 # include <memory.h>
8131 # include <stdlib.h>
8134 # include <string.h>
8136 # include <strings.h>
8139 # include <unistd.h> /* Needed for NetBSD */
8143 char buf[128], abc[128];
8149 /* Copy "abcde..." string to char abc[] so that gcc doesn't
8150 try to store the string in read-only memory. */
8151 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
8153 for (align = 7; align >= 0; align--) {
8154 for (len = 36; len; len--) {
8156 memcpy(b, abc, len);
8157 for (off = 1; off <= len; off++) {
8158 memcpy(b+off, b, len);
8159 memcpy(b, b+off, len);
8160 if (memcmp(b, abc, len))
8169 if eval $compile_ok; then
8170 if ./try 2>/dev/null; then
8174 echo "It can't, sorry."
8175 case "$d_memmove" in
8176 "$define") echo "But that's Ok since you have memmove()." ;;
8180 echo "(I can't compile the test program, so we'll assume not...)"
8181 case "$d_memmove" in
8182 "$define") echo "But that's Ok since you have memmove()." ;;
8187 $rm -f try.* try core
8191 : can memcmp be trusted to compare relative magnitude?
8196 echo "Checking if your memcmp() can compare relative magnitude..." >&4
8203 $cat >>try.c <<'EOCP'
8206 # include <memory.h>
8209 # include <stdlib.h>
8212 # include <string.h>
8214 # include <strings.h>
8217 # include <unistd.h> /* Needed for NetBSD */
8223 if ((a < b) && memcmp(&a, &b, 1) < 0)
8229 if eval $compile_ok; then
8230 if ./try 2>/dev/null; then
8234 echo "No, it can't (it uses signed chars)."
8237 echo "(I can't compile the test program, so we'll assume not...)"
8241 $rm -f try.* try core
8245 : see if select exists
8249 : see if semctl exists
8253 : see if semget exists
8257 : see if semop exists
8261 : see how much of the 'sem*(2)' library is present.
8264 case "$d_semctl$d_semget$d_semop" in
8265 *"$undef"*) h_sem=false;;
8269 case "`ipcs 2>&1`" in
8270 "SVID messages"*"not configured"*)
8271 echo "Your $osname does not have the sem*(2) configured." >&4
8284 : we could also check for sys/ipc.h ...
8285 if $h_sem && $test `./findhdr sys/sem.h`; then
8286 echo "You have the full sem*(2) library." >&4
8289 echo "You don't have the full sem*(2) library." >&4
8295 : see whether sys/sem.h defines union semun
8297 $cat > try.c <<'END'
8298 #include <sys/types.h>
8299 #include <sys/ipc.h>
8300 #include <sys/sem.h>
8301 int main () { union semun semun; semun.buf = 0; }
8304 if eval $compile; then
8305 echo "You have union semun in <sys/sem.h>." >&4
8308 echo "You do not have union semun in <sys/sem.h>." >&4
8315 : see how to do semctl IPC_STAT
8318 : see whether semctl IPC_STAT can use union semun
8323 # define S_IRUSR S_IREAD
8324 # define S_IWUSR S_IWRITE
8325 # define S_IXUSR S_IEXEC
8327 # define S_IRUSR 0400
8328 # define S_IWUSR 0200
8329 # define S_IXUSR 0100
8331 # define S_IRGRP (S_IRUSR>>3)
8332 # define S_IWGRP (S_IWUSR>>3)
8333 # define S_IXGRP (S_IXUSR>>3)
8334 # define S_IROTH (S_IRUSR>>6)
8335 # define S_IWOTH (S_IWUSR>>6)
8336 # define S_IXOTH (S_IXUSR>>6)
8339 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
8340 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
8341 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
8346 #include <sys/types.h>
8347 #include <sys/ipc.h>
8348 #include <sys/sem.h>
8349 #include <sys/stat.h>
8355 #$d_union_semun HAS_UNION_SEMUN
8358 #ifndef HAS_UNION_SEMUN
8361 struct semid_ds *buf;
8362 unsigned short *array;
8368 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8369 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8371 struct semid_ds argbuf;
8374 st = semctl(sem, 0, IPC_STAT, arg);
8378 # endif /* IPC_STAT */
8379 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8381 if (semctl(sem, 0, IPC_RMID, arg) != 0)
8382 # endif /* IPC_RMID */
8383 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8385 #endif /* IPC_PRIVATE && ... */
8386 printf("semget failed: errno = %d\n", errno);
8392 if eval $compile; then
8395 semun) val="$define" ;;
8401 case "$d_semctl_semun" in
8403 echo "You can use union semun for semctl IPC_STAT." >&4
8406 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
8411 : see whether semctl IPC_STAT can use struct semid_ds pointer
8412 $cat > try.c <<'END'
8413 #include <sys/types.h>
8414 #include <sys/ipc.h>
8415 #include <sys/sem.h>
8416 #include <sys/stat.h>
8424 struct semid_ds arg;
8427 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8428 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8431 st = semctl(sem, 0, IPC_STAT, &arg);
8433 printf("semid_ds\n");
8435 # endif /* IPC_STAT */
8436 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8438 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
8439 # endif /* IPC_RMID */
8440 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8442 #endif /* IPC_PRIVATE && ... */
8443 printf("semget failed: errno = %d\n", errno);
8450 if eval $compile; then
8453 semid_ds) val="$define" ;;
8457 set d_semctl_semid_ds
8459 case "$d_semctl_semid_ds" in
8461 echo "You can ${also}use struct semid_ds* for semctl IPC_STAT." >&4
8463 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
8470 # We do not have the full sem*(2) library, so assume we can not
8476 set d_semctl_semid_ds
8481 : see if setegid exists
8482 set setegid d_setegid
8485 : see if seteuid exists
8486 set seteuid d_seteuid
8489 : see if sethostent exists
8490 set sethostent d_sethent
8493 : see if setlinebuf exists
8494 set setlinebuf d_setlinebuf
8497 : see if setlocale exists
8498 set setlocale d_setlocale
8501 : see if setnetent exists
8502 set setnetent d_setnent
8505 : see if setprotoent exists
8506 set setprotoent d_setpent
8509 : see if setpgid exists
8510 set setpgid d_setpgid
8513 : see if setpgrp2 exists
8514 set setpgrp2 d_setpgrp2
8517 : see if setpriority exists
8518 set setpriority d_setprior
8521 : see if setproctitle exists
8522 set setproctitle d_setproctitle
8525 : see if setregid exists
8526 set setregid d_setregid
8528 set setresgid d_setresgid
8531 : see if setreuid exists
8532 set setreuid d_setreuid
8534 set setresuid d_setresuid
8537 : see if setrgid exists
8538 set setrgid d_setrgid
8541 : see if setruid exists
8542 set setruid d_setruid
8545 : see if setservent exists
8546 set setservent d_setsent
8549 : see if setsid exists
8553 : see if setvbuf exists
8554 set setvbuf d_setvbuf
8557 : see if sfio.h is available
8562 : see if sfio library is available
8573 : Ok, but do we want to use it.
8577 true|$define|[yY]*) dflt='y';;
8580 echo "$package can use the sfio library, but it is experimental."
8581 rp="You seem to have sfio available, do you want to try using it?"
8585 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
8587 : Remove sfio from list of libraries to use
8588 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
8591 echo "libs = $libs" >&4
8595 *) case "$usesfio" in
8597 echo "Sorry, cannot find sfio on this machine" >&4
8598 echo "Ignoring your setting of usesfio=$usesfio" >&4
8606 $define) usesfio='true';;
8607 *) usesfio='false';;
8610 : see if shmctl exists
8614 : see if shmget exists
8618 : see if shmat exists
8621 : see what shmat returns
8624 $cat >shmat.c <<'END'
8625 #include <sys/shm.h>
8628 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
8633 echo "and it returns ($shmattype)." >&4
8634 : see if a prototype for shmat is available
8635 xxx=`./findhdr sys/shm.h`
8636 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
8637 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
8648 set d_shmatprototype
8651 : see if shmdt exists
8655 : see how much of the 'shm*(2)' library is present.
8658 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
8659 *"$undef"*) h_shm=false;;
8663 case "`ipcs 2>&1`" in
8664 "SVID shared memory"*"not configured"*)
8665 echo "But your $osname does not have the shm*(2) configured." >&4
8680 : we could also check for sys/ipc.h ...
8681 if $h_shm && $test `./findhdr sys/shm.h`; then
8682 echo "You have the full shm*(2) library." >&4
8685 echo "You don't have the full shm*(2) library." >&4
8692 : see if we have sigaction
8693 if set sigaction val -f d_sigaction; eval $csym; $val; then
8694 echo 'sigaction() found.' >&4
8695 $cat > try.c <<'EOP'
8697 #include <sys/types.h>
8701 struct sigaction act, oact;
8705 if eval $compile_ok; then
8708 echo "But you don't seem to have a useable struct sigaction." >&4
8712 echo 'sigaction NOT found.' >&4
8715 set d_sigaction; eval $setvar
8716 $rm -f try try$_o try.c
8718 : see if sigsetjmp exists
8720 case "$d_sigsetjmp" in
8728 if (sigsetjmp(env,1))
8736 if eval $compile; then
8737 if ./try >/dev/null 2>&1; then
8738 echo "POSIX sigsetjmp found." >&4
8742 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
8748 echo "sigsetjmp not found." >&4
8752 *) val="$d_sigsetjmp"
8753 case "$d_sigsetjmp" in
8754 $define) echo "POSIX sigsetjmp found." >&4;;
8755 $undef) echo "sigsetjmp not found." >&4;;
8765 : see whether socket exists
8767 $echo $n "Hmm... $c" >&4
8768 if set socket val -f d_socket; eval $csym; $val; then
8769 echo "Looks like you have Berkeley networking support." >&4
8771 if set setsockopt val -f; eval $csym; $val; then
8774 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
8778 if $contains socklib libc.list >/dev/null 2>&1; then
8779 echo "Looks like you have Berkeley networking support." >&4
8781 : we will have to assume that it supports the 4.2 BSD interface
8784 echo "You don't have Berkeley networking in libc$_a..." >&4
8785 for net in net socket
8787 if test -f /usr/lib/lib$net$_a; then
8788 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8789 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8790 if $contains socket libc.list >/dev/null 2>&1; then
8794 echo "...but the Wollongong group seems to have hacked it in." >&4
8796 sockethdr="-I/usr/netinclude"
8799 echo "Found Berkeley sockets interface in lib$net." >& 4
8800 if $contains setsockopt libc.list >/dev/null 2>&1; then
8803 echo "...using the old 4.1c interface, rather than 4.2" >&4
8810 if test "X$d_socket" != "X$define"; then
8811 echo "or anywhere else I see." >&4
8818 : see if socketpair exists
8819 set socketpair d_sockpair
8822 : see if stat knows about block sizes
8824 set d_statblks stat st_blocks $i_sysstat sys/stat.h
8827 : see if _ptr and _cnt from stdio act std
8829 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
8830 echo "(Looks like you have stdio.h from Linux.)"
8831 case "$stdio_ptr" in
8832 '') stdio_ptr='((fp)->_IO_read_ptr)'
8835 *) ptr_lval=$d_stdio_ptr_lval;;
8837 case "$stdio_cnt" in
8838 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
8841 *) cnt_lval=$d_stdio_cnt_lval;;
8843 case "$stdio_base" in
8844 '') stdio_base='((fp)->_IO_read_base)';;
8846 case "$stdio_bufsiz" in
8847 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
8850 case "$stdio_ptr" in
8851 '') stdio_ptr='((fp)->_ptr)'
8854 *) ptr_lval=$d_stdio_ptr_lval;;
8856 case "$stdio_cnt" in
8857 '') stdio_cnt='((fp)->_cnt)'
8860 *) cnt_lval=$d_stdio_cnt_lval;;
8862 case "$stdio_base" in
8863 '') stdio_base='((fp)->_base)';;
8865 case "$stdio_bufsiz" in
8866 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
8869 : test whether _ptr and _cnt really work
8870 echo "Checking how std your stdio is..." >&4
8873 #define FILE_ptr(fp) $stdio_ptr
8874 #define FILE_cnt(fp) $stdio_cnt
8876 FILE *fp = fopen("try.c", "r");
8879 18 <= FILE_cnt(fp) &&
8880 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
8888 if eval $compile; then
8890 echo "Your stdio acts pretty std."
8893 echo "Your stdio isn't very std."
8896 echo "Your stdio doesn't appear very std."
8902 : Can _ptr be used as an lvalue?
8903 case "$d_stdstdio$ptr_lval" in
8904 $define$define) val=$define ;;
8907 set d_stdio_ptr_lval
8910 : Can _cnt be used as an lvalue?
8911 case "$d_stdstdio$cnt_lval" in
8912 $define$define) val=$define ;;
8915 set d_stdio_cnt_lval
8918 : see if _base is also standard
8920 case "$d_stdstdio" in
8924 #define FILE_base(fp) $stdio_base
8925 #define FILE_bufsiz(fp) $stdio_bufsiz
8927 FILE *fp = fopen("try.c", "r");
8930 19 <= FILE_bufsiz(fp) &&
8931 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
8938 if eval $compile; then
8940 echo "And its _base field acts std."
8943 echo "But its _base field isn't std."
8946 echo "However, it seems to be lacking the _base field."
8954 : see if strcoll exists
8955 set strcoll d_strcoll
8958 : check for structure copying
8960 echo "Checking to see if your C compiler can copy structs..." >&4
8961 $cat >try.c <<'EOCP'
8971 if $cc -c try.c >/dev/null 2>&1 ; then
8976 echo "Nope, it can't."
8982 : see if strerror and/or sys_errlist[] exist
8984 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
8985 if set strerror val -f d_strerror; eval $csym; $val; then
8986 echo 'strerror() found.' >&4
8987 d_strerror="$define"
8988 d_strerrm='strerror(e)'
8989 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8990 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
8991 d_syserrlst="$define"
8993 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
8994 d_syserrlst="$undef"
8996 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
8997 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
8998 echo 'strerror() found in string header.' >&4
8999 d_strerror="$define"
9000 d_strerrm='strerror(e)'
9001 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9002 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
9003 d_syserrlst="$define"
9005 echo "(You don't appear to have any sys_errlist[], how can this be?)"
9006 d_syserrlst="$undef"
9008 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9009 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
9011 d_syserrlst="$define"
9012 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
9014 echo 'strerror() and sys_errlist[] NOT found.' >&4
9016 d_syserrlst="$undef"
9017 d_strerrm='"unknown"'
9021 : see if strtod exists
9025 : see if strtol exists
9029 : see if strtoul exists
9030 set strtoul d_strtoul
9033 : see if strxfrm exists
9034 set strxfrm d_strxfrm
9037 : see if symlink exists
9038 set symlink d_symlink
9041 : see if syscall exists
9042 set syscall d_syscall
9045 : see if sysconf exists
9046 set sysconf d_sysconf
9049 : see if system exists
9053 : see if tcgetpgrp exists
9054 set tcgetpgrp d_tcgetpgrp
9057 : see if tcsetpgrp exists
9058 set tcsetpgrp d_tcsetpgrp
9061 : define an is-a-typedef? function
9062 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9064 "") inclist="sys/types.h";;
9066 eval "varval=\$$var";
9070 for inc in $inclist; do
9071 echo "#include <$inc>" >>temp.c;
9073 echo "#ifdef $type" >> temp.c;
9074 echo "printf(\"We have $type\");" >> temp.c;
9075 echo "#endif" >> temp.c;
9076 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9077 if $contains $type temp.E >/dev/null 2>&1; then
9083 *) eval "$var=\$varval";;
9086 : define an is-a-typedef? function that prompts if the type is not available.
9087 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9089 "") inclist="sys/types.h";;
9091 eval "varval=\$$var";
9095 for inc in $inclist; do
9096 echo "#include <$inc>" >>temp.c;
9098 echo "#ifdef $type" >> temp.c;
9099 echo "printf(\"We have $type\");" >> temp.c;
9100 echo "#endif" >> temp.c;
9101 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9103 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9104 if $contains $type temp.E >/dev/null 2>&1; then
9105 echo "$type found." >&4;
9108 echo "$type NOT found." >&4;
9114 *) eval "$var=\$varval";;
9117 : see if this is a sys/times.h system
9118 set sys/times.h i_systimes
9121 : see if times exists
9123 if set times val -f d_times; eval $csym; $val; then
9124 echo 'times() found.' >&4
9127 case "$i_systimes" in
9128 "$define") inc='sys/times.h';;
9130 rp="What is the type returned by times() on this system?"
9131 set clock_t clocktype long stdio.h sys/types.h $inc
9134 echo 'times() NOT found, hope that will do.' >&4
9139 : see if truncate exists
9140 set truncate d_truncate
9143 : see if tzname[] exists
9145 if set tzname val -a d_tzname; eval $csym; $val; then
9147 echo 'tzname[] found.' >&4
9150 echo 'tzname[] NOT found.' >&4
9155 : see if umask exists
9159 : see how we will look up host name
9162 : dummy stub to allow use of elif
9163 elif set uname val -f d_uname; eval $csym; $val; then
9166 uname() was found, but you're running xenix, and older versions of xenix
9167 have a broken uname(). If you don't really know whether your xenix is old
9168 enough to have a broken system call, use the default answer.
9175 rp='Is your uname() broken?'
9178 n*) d_uname="$define"; call=uname;;
9181 echo 'uname() found.' >&4
9186 case "$d_gethname" in
9187 '') d_gethname="$undef";;
9190 '') d_uname="$undef";;
9192 case "$d_phostname" in
9193 '') d_phostname="$undef";;
9196 : backward compatibility for d_hvfork
9197 if test X$d_hvfork != X; then
9201 : see if there is a vfork
9206 : Ok, but do we want to use it. vfork is reportedly unreliable in
9207 : perl on Solaris 2.x, and probably elsewhere.
9217 Perl can only use a vfork() that doesn't suffer from strict
9218 restrictions on calling functions or modifying global data in
9219 the child. For example, glibc-2.1 contains such a vfork()
9220 that is unsuitable. If your system provides a proper fork()
9221 call, chances are that you do NOT want perl to use vfork().
9224 rp="Do you still want to use vfork()?"
9229 echo "Ok, we won't use vfork()."
9238 $define) usevfork='true';;
9239 *) usevfork='false';;
9242 : see if this is an sysdir system
9243 set sys/dir.h i_sysdir
9246 : see if this is an sysndir system
9247 set sys/ndir.h i_sysndir
9250 : see if sys/types.h has to be included
9251 set sys/types.h i_systypes
9254 : see if closedir exists
9255 set closedir d_closedir
9258 case "$d_closedir" in
9261 echo "Checking whether closedir() returns a status..." >&4
9262 cat > closedir.c <<EOM
9263 #$i_dirent I_DIRENT /**/
9264 #$i_sysdir I_SYS_DIR /**/
9265 #$i_sysndir I_SYS_NDIR /**/
9266 #$i_systypes I_SYS_TYPES /**/
9268 #if defined(I_SYS_TYPES)
9269 #include <sys/types.h>
9271 #if defined(I_DIRENT)
9273 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
9274 #include <sys/dir.h>
9278 #include <sys/ndir.h>
9282 #include <ndir.h> /* may be wrong in the future */
9284 #include <sys/dir.h>
9289 int main() { return closedir(opendir(".")); }
9292 if eval $compile_ok; then
9293 if ./closedir > /dev/null 2>&1 ; then
9294 echo "Yes, it does."
9297 echo "No, it doesn't."
9301 echo "(I can't seem to compile the test program--assuming it doesn't)"
9312 : check for volatile keyword
9314 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
9315 $cat >try.c <<'EOCP'
9318 typedef struct _goo_struct goo_struct;
9319 goo_struct * volatile goo = ((goo_struct *)0);
9320 struct _goo_struct {
9325 typedef unsigned short foo_t;
9328 volatile foo_t blech;
9332 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
9334 echo "Yup, it does."
9337 echo "Nope, it doesn't."
9343 : see if there is a wait4
9347 : see if waitpid exists
9348 set waitpid d_waitpid
9351 : see if wcstombs exists
9352 set wcstombs d_wcstombs
9355 : see if wctomb exists
9359 : preserve RCS keywords in files with variable substitution, grrr
9364 Revision='$Revision'
9366 : check for alignment requirements
9368 case "$alignbytes" in
9369 '') echo "Checking alignment constraints..." >&4
9370 $cat >try.c <<'EOCP'
9377 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
9381 if eval $compile_ok; then
9385 echo "(I can't seem to compile the test program...)"
9388 *) dflt="$alignbytes"
9391 rp="Doubles must be aligned on a how-many-byte boundary?"
9396 : check for ordering of bytes in a long
9397 case "$byteorder" in
9401 In the following, larger digits indicate more significance. A big-endian
9402 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
9403 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
9404 machines may have weird orders like 3412. A Cray will report 87654321. If
9405 the test program works the default is probably right.
9406 I'm now running the test program...
9408 $cat >try.c <<'EOCP'
9415 char c[sizeof(long)];
9418 if (sizeof(long) > 4)
9419 u.l = (0x08070605L << 32) | 0x04030201L;
9422 for (i = 0; i < sizeof(long); i++)
9423 printf("%c", u.c[i]+'0');
9430 if eval $compile && ./try > /dev/null; then
9433 [1-4][1-4][1-4][1-4]|12345678|87654321)
9434 echo "(The test program ran ok.)"
9435 echo "byteorder=$dflt"
9438 ????|????????) echo "(The test program ran ok.)" ;;
9439 *) echo "(The test program didn't run right for some reason.)" ;;
9444 (I can't seem to compile the test program. Guessing big-endian...)
9447 case "$xxx_prompt" in
9449 rp="What is the order of bytes in a long?"
9460 : how do we catenate cpp tokens here?
9462 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
9463 $cat >cpp_stuff.c <<'EOCP'
9464 #define RCAT(a,b)a/**/b
9465 #define ACAT(a,b)a ## b
9469 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
9470 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
9471 echo "Oh! Smells like ANSI's been here." >&4
9472 echo "We can catify or stringify, separately or together!"
9474 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
9475 echo "Ah, yes! The good old days!" >&4
9476 echo "However, in the good old days we don't know how to stringify and"
9477 echo "catify at the same time."
9481 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
9482 to have to edit the values of CAT[2-5] in config.h...
9484 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
9488 : see if this is a db.h system
9496 echo "Checking Berkeley DB version ..." >&4
9502 #include <sys/types.h>
9507 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
9508 int Major, Minor, Patch ;
9509 unsigned long Version ;
9510 (void)db_version(&Major, &Minor, &Patch) ;
9511 printf("You have Berkeley DB Version 2 or greater\n");
9513 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
9514 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
9515 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
9516 Major, Minor, Patch) ;
9518 /* check that db.h & libdb are compatible */
9519 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
9520 printf("db.h and libdb are incompatible\n") ;
9524 printf("db.h and libdb are compatible\n") ;
9526 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
9527 + DB_VERSION_PATCH ;
9529 /* needs to be >= 2.3.4 */
9530 if (Version < 2003004) {
9531 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
9532 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
9538 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
9539 printf("You have Berkeley DB Version 1\n");
9540 exit(0); /* DB version < 2: the coast is clear. */
9542 exit(1); /* <db.h> not Berkeley DB? */
9548 if eval $compile && ./try; then
9549 echo 'Looks OK.' >&4
9551 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
9555 : Remove db from list of libraries to use
9556 echo "Removing unusable -ldb from library list" >&4
9557 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
9560 echo "libs = $libs" >&4
9570 : Check the return type needed for hash
9572 echo "Checking return type needed for hash for Berkeley DB ..." >&4
9578 #include <sys/types.h>
9581 #ifndef DB_VERSION_MAJOR
9582 u_int32_t hash_cb (ptr, size)
9590 info.hash = hash_cb;
9594 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9595 if $contains warning try.out >>/dev/null 2>&1 ; then
9598 db_hashtype='u_int32_t'
9601 : XXX Maybe we should just give up here.
9602 db_hashtype=u_int32_t
9604 echo "Help: I can't seem to compile the db test program." >&4
9605 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
9608 echo "Your version of Berkeley DB uses $db_hashtype for hash."
9610 *) db_hashtype=u_int32_t
9615 : Check the return type needed for prefix
9617 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
9623 #include <sys/types.h>
9626 #ifndef DB_VERSION_MAJOR
9627 size_t prefix_cb (key1, key2)
9635 info.prefix = prefix_cb;
9639 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9640 if $contains warning try.out >>/dev/null 2>&1 ; then
9643 db_prefixtype='size_t'
9646 db_prefixtype='size_t'
9647 : XXX Maybe we should just give up here.
9649 echo "Help: I can't seem to compile the db test program." >&4
9650 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
9653 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
9655 *) db_prefixtype='size_t'
9659 : check for void type
9661 echo "Checking to see how well your C compiler groks the void type..." >&4
9662 case "$voidflags" in
9664 $cat >try.c <<'EOCP'
9670 extern void moo(); /* function returning void */
9671 void (*goo)(); /* ptr to func returning void */
9673 void *hue; /* generic ptr */
9686 int main() { sub(); }
9688 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
9689 voidflags=$defvoidused
9690 echo "Good. It appears to support void to the level $package wants.">&4
9691 if $contains warning .out >/dev/null 2>&1; then
9692 echo "However, you might get some warnings that look like this:"
9696 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
9697 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
9698 echo "It supports 1..."
9699 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
9700 echo "It also supports 2..."
9701 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
9703 echo "And it supports 4 but not 8 definitely."
9705 echo "It doesn't support 4..."
9706 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
9708 echo "But it supports 8."
9711 echo "Neither does it support 8."
9715 echo "It does not support 2..."
9716 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
9718 echo "But it supports 4 and 8."
9720 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
9722 echo "And it supports 4 but has not heard about 8."
9724 echo "However it supports 8 but not 4."
9729 echo "There is no support at all for void."
9734 case "$voidflags" in
9737 Support flag bits are:
9738 1: basic void declarations.
9739 2: arrays of pointers to functions returning void.
9740 4: operations between pointers to and addresses of void functions.
9741 8: generic void pointers.
9744 rp="Your void support flags add up to what?"
9751 : check for length of double
9753 case "$doublesize" in
9755 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
9756 $cat >try.c <<'EOCP'
9760 printf("%d\n", sizeof(double));
9764 if eval $compile_ok; then
9766 $echo " $doublesize bytes." >&4
9769 echo "(I can't seem to compile the test program. Guessing...)"
9770 rp="What is the size of a double precision number (in bytes)?"
9779 echo "Determining whether or not we are on an EBCDIC system..." >&4
9780 $cat >tebcdic.c <<EOM
9783 if ('M'==0xd4) return 0;
9789 if eval $compile_ok; then
9791 echo "You have EBCDIC." >&4
9794 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
9797 echo "I'm unable to compile the test program." >&4
9798 echo "I'll assume ASCII or some ISO Latin." >&4
9800 $rm -f tebcdic.c tebcdic
9804 : see what type file positions are declared as in the library
9805 rp="What is the type for file position used by fsetpos()?"
9806 set fpos_t fpostype long stdio.h sys/types.h
9809 : get csh whereabouts
9811 'csh') val="$undef" ;;
9816 : Respect a hint or command line value for full_csh.
9818 '') full_csh=$csh ;;
9821 : Store the full pathname to the sed program for use in the C program
9824 : Store the full pathname to the ar program for use in the Makefile.SH
9825 : Respect a hint or command line value for full_ar.
9830 : see what type gids are declared as in the kernel
9832 echo "Looking for the type for group ids returned by getgid()."
9833 set gid_t gidtype xxx stdio.h sys/types.h
9837 xxx=`./findhdr sys/user.h`
9838 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
9840 unsigned) dflt="$1 $2" ;;
9844 *) dflt="$gidtype";;
9847 gid_t) echo "gid_t found." ;;
9848 *) rp="What is the type for group ids returned by getgid()?"
9854 : see if getgroups exists
9855 set getgroups d_getgrps
9858 : see if setgroups exists
9859 set setgroups d_setgrps
9863 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
9865 case "$d_getgrps$d_setgrps" in
9867 case "$groupstype" in
9868 '') dflt="$gidtype" ;;
9869 *) dflt="$groupstype" ;;
9872 What type of pointer is the second argument to getgroups() and setgroups()?
9873 Usually this is the same as group ids, $gidtype, but not always.
9876 rp='What type pointer is the second argument to getgroups() and setgroups()?'
9880 *) groupstype="$gidtype";;
9883 : see what type lseek is declared as in the kernel
9884 rp="What is the type used for lseek's offset on this system?"
9885 set off_t lseektype long stdio.h sys/types.h
9889 echo "Checking if your $make program sets \$(MAKE)..." >&4
9890 case "$make_set_make" in
9892 $sed 's/^X //' > testmake.mak << 'EOF'
9894 X @echo 'maketemp="$(MAKE)"'
9896 case "`$make -f testmake.mak 2>/dev/null`" in
9897 *maketemp=*) make_set_make='#' ;;
9898 *) make_set_make="MAKE=$make" ;;
9903 case "$make_set_make" in
9904 '#') echo "Yup, it does.";;
9905 *) echo "Nope, it doesn't.";;
9908 : see what type is used for mode_t
9909 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
9910 set mode_t modetype int stdio.h sys/types.h
9913 : define a fucntion to check prototypes
9914 $cat > protochk <<EOSH
9917 optimize="$optimize"
9919 prototype="$prototype"
9924 $cat >> protochk <<'EOSH'
9929 while test $# -ge 2; do
9931 $define) echo "#include <$2>" >> try.c ;;
9932 literal) echo "$2" >> try.c ;;
9936 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9937 cat >> try.c <<'EOCP'
9938 #ifdef CAN_PROTOTYPE
9939 #define _(args) args
9944 echo "$foo" >> try.c
9945 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9946 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9954 : see what type is used for size_t
9955 rp="What is the type used for the length parameter for string functions?"
9956 set size_t sizetype 'unsigned int' stdio.h sys/types.h
9959 : check for type of arguments to gethostbyaddr.
9960 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
9961 case "$d_gethbyaddr" in
9965 Checking to see what type of arguments are accepted by gethostbyaddr().
9967 hdrs="$define sys/types.h
9968 $d_socket sys/socket.h
9969 $i_niin netinet/in.h
9972 : The first arg can 'char *' or 'void *'
9973 : The second arg is some of integral type
9974 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
9975 for yyy in size_t long int; do
9976 case "$netdb_host_type" in
9977 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
9978 if ./protochk "$try" $hdrs; then
9979 echo "Your system accepts $xxx for the first arg."
9980 echo "...and $yyy for the second arg."
9981 netdb_host_type="$xxx"
9982 netdb_hlen_type="$yyy"
9988 : In case none of those worked, prompt the user.
9989 case "$netdb_host_type" in
9990 '') rp='What is the type for the 1st argument to gethostbyaddr?'
9993 netdb_host_type=$ans
9994 rp='What is the type for the 2nd argument to gethostbyaddr?'
9997 netdb_hlen_type=$ans
10001 *) : no gethostbyaddr, so pick harmless defaults
10002 netdb_host_type='char *'
10003 netdb_hlen_type="$sizetype"
10006 # Remove the "const" if needed. -- but then we'll have a
10008 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
10011 : check for type of argument to gethostbyname.
10012 if test "X$netdb_name_type" = X ; then
10013 case "$d_gethbyname" in
10017 Checking to see what type of argument is accepted by gethostbyname().
10019 hdrs="$define sys/types.h
10020 $d_socket sys/socket.h
10021 $i_niin netinet/in.h
10023 $i_unistd unistd.h"
10024 for xxx in "const char *" "char *"; do
10025 case "$netdb_name_type" in
10026 '') try="extern struct hostent *gethostbyname($xxx);"
10027 if ./protochk "$try" $hdrs; then
10028 echo "Your system accepts $xxx."
10029 netdb_name_type="$xxx"
10034 : In case none of those worked, prompt the user.
10035 case "$netdb_name_type" in
10036 '') rp='What is the type for the 1st argument to gethostbyname?'
10039 netdb_name_type=$ans
10043 *) : no gethostbyname, so pick harmless default
10044 netdb_name_type='char *'
10049 : check for type of 1st argument to getnetbyaddr.
10050 if test "X$netdb_net_type" = X ; then
10051 case "$d_getnbyaddr" in
10055 Checking to see what type of 1st argument is accepted by getnetbyaddr().
10057 hdrs="$define sys/types.h
10058 $d_socket sys/socket.h
10059 $i_niin netinet/in.h
10061 $i_unistd unistd.h"
10062 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
10063 case "$netdb_net_type" in
10064 '') try="extern struct netent *getnetbyaddr($xxx, int);"
10065 if ./protochk "$try" $hdrs; then
10066 echo "Your system accepts $xxx."
10067 netdb_net_type="$xxx"
10072 : In case none of those worked, prompt the user.
10073 case "$netdb_net_type" in
10074 '') rp='What is the type for the 1st argument to getnetbyaddr?'
10077 netdb_net_type=$ans
10081 *) : no getnetbyaddr, so pick harmless default
10082 netdb_net_type='long'
10086 : locate the preferred pager for this system
10100 '') dflt=/usr/ucb/more;;
10107 rp='What pager is used on your system?'
10111 : see what type pids are declared as in the kernel
10112 rp="What is the type of process ids on this system?"
10113 set pid_t pidtype int stdio.h sys/types.h
10116 : check for length of pointer
10120 $echo $n "Checking to see how big your pointers are...$c" >&4
10121 if test "$voidflags" -gt 7; then
10122 echo '#define VOID_PTR char *' > try.c
10124 echo '#define VOID_PTR void *' > try.c
10126 $cat >>try.c <<'EOCP'
10130 printf("%d\n", sizeof(VOID_PTR));
10135 if eval $compile_ok; then
10137 $echo " $ptrsize bytes." >&4
10140 echo "(I can't seem to compile the test program. Guessing...)" >&4
10141 rp="What is the size of a pointer (in bytes)?"
10149 : check for size of random number generator
10151 case "$randbits" in
10153 echo "Checking to see how many bits your rand function produces..." >&4
10155 #$i_unistd I_UNISTD
10156 #$i_stdlib I_STDLIB
10159 # include <unistd.h>
10162 # include <stdlib.h>
10165 $cat >>try.c <<'EOCP'
10169 register unsigned long tmp;
10170 register unsigned long max = 0L;
10172 for (i = 1000; i; i--) {
10173 tmp = (unsigned long)rand();
10174 if (tmp > max) max = tmp;
10176 for (i = 0; max; i++)
10182 if eval $compile_ok; then
10186 echo "(I can't seem to compile the test program...)"
10193 rp='How many bits does your rand() function produce?'
10198 : see if ar generates random libraries by itself
10200 echo "Checking how to generate random libraries on your machine..." >&4
10201 echo 'int bar1() { return bar2(); }' > bar1.c
10202 echo 'int bar2() { return 2; }' > bar2.c
10203 $cat > foo.c <<'EOP'
10204 int main() { printf("%d\n", bar1()); exit(0); }
10206 $cc $ccflags -c bar1.c >/dev/null 2>&1
10207 $cc $ccflags -c bar2.c >/dev/null 2>&1
10208 $cc $ccflags -c foo.c >/dev/null 2>&1
10209 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
10210 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
10211 ./foobar >/dev/null 2>&1; then
10212 echo "$ar appears to generate random libraries itself."
10215 elif $ar ts bar$_a >/dev/null 2>&1 &&
10216 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
10217 ./foobar >/dev/null 2>&1; then
10218 echo "a table of contents needs to be added with '$ar ts'."
10225 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
10226 $test -f $ranlib || ranlib=''
10229 if $test -n "$ranlib"; then
10230 echo "your system has '$ranlib'; we'll use that."
10233 echo "your system doesn't seem to support random libraries"
10234 echo "so we'll use lorder and tsort to order the libraries."
10241 : see if sys/select.h has to be included
10242 set sys/select.h i_sysselct
10245 : see if we should include time.h, sys/time.h, or both
10247 if test "X$timeincl" = X; then
10248 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10249 $echo $n "I'm now running the test program...$c"
10250 $cat >try.c <<'EOCP'
10251 #include <sys/types.h>
10256 #ifdef SYSTIMEKERNEL
10259 #include <sys/time.h>
10262 #include <sys/select.h>
10268 struct timeval bar;
10271 struct timezone tzp;
10273 if (foo.tm_sec == foo.tm_sec)
10276 if (bar.tv_sec == bar.tv_sec)
10283 for s_timezone in '-DS_TIMEZONE' ''; do
10285 for s_timeval in '-DS_TIMEVAL' ''; do
10286 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10287 for i_time in '' '-DI_TIME'; do
10288 for i_systime in '-DI_SYSTIME' ''; do
10291 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10292 if eval $compile; then
10293 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10297 $echo $n "Succeeded with $flags$c"
10309 *SYSTIMEKERNEL*) i_systimek="$define"
10310 timeincl=`./findhdr sys/time.h`
10311 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10312 *) i_systimek="$undef";;
10315 *I_TIME*) i_time="$define"
10316 timeincl=`./findhdr time.h`" $timeincl"
10317 echo "We'll include <time.h>." >&4;;
10318 *) i_time="$undef";;
10321 *I_SYSTIME*) i_systime="$define"
10322 timeincl=`./findhdr sys/time.h`" $timeincl"
10323 echo "We'll include <sys/time.h>." >&4;;
10324 *) i_systime="$undef";;
10329 : check for fd_set items
10332 Checking to see how well your C compiler handles fd_set and friends ...
10334 $cat >fd_set.c <<EOCP
10335 #$i_systime I_SYS_TIME
10336 #$i_sysselct I_SYS_SELECT
10337 #$d_socket HAS_SOCKET
10338 #include <sys/types.h>
10340 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
10343 #include <sys/time.h>
10345 #ifdef I_SYS_SELECT
10346 #include <sys/select.h>
10355 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
10362 set fd_set -DTRYBITS
10363 if eval $compile; then
10364 d_fds_bits="$define"
10366 echo "Well, your system knows about the normal fd_set typedef..." >&4
10368 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
10369 d_fd_macros="$define"
10372 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
10374 d_fd_macros="$undef"
10378 Hmm, your compiler has some difficulty with fd_set. Checking further...
10381 if eval $compile; then
10382 d_fds_bits="$undef"
10384 echo "Well, your system has some sort of fd_set available..." >&4
10386 echo "and you have the normal fd_set macros." >&4
10387 d_fd_macros="$define"
10390 but not the normal fd_set macros! Gross! More work for me...
10392 d_fd_macros="$undef"
10395 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
10397 d_fds_bits="$undef"
10398 d_fd_macros="$undef"
10403 : check for type of arguments to select.
10404 case "$selecttype" in
10405 '') case "$d_select" in
10408 Checking to see what type of arguments are accepted by select().
10410 hdrs="$define sys/types.h
10411 $i_systime sys/time.h
10412 $i_sysselct sys/select.h
10413 $d_socket sys/socket.h"
10414 : The first arg can be int, unsigned, or size_t
10415 : The last arg may or may not be 'const'
10417 : void pointer has been seen but using that
10418 : breaks the selectminbits test
10419 for xxx in 'fd_set *' 'int *'; do
10420 for nfd in 'int' 'size_t' 'unsigned' 'unsigned long'; do
10421 for tmo in 'struct timeval *' 'const struct timeval *'; do
10423 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
10424 if ./protochk "$try" $hdrs; then
10425 echo "Your system accepts $xxx."
10434 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
10435 case "$d_fd_set" in
10436 $define) dflt="fd_set *" ;;
10445 *) : no select, so pick a harmless default
10452 : check for the select 'width'
10453 case "$selectminbits" in
10454 '') case "$d_select" in
10458 Checking to see on how many bits at a time your select() operates...
10461 #include <sys/types.h>
10463 #$i_systime I_SYS_TIME
10464 #$i_systimek I_SYS_TIME_KERNEL
10469 # ifdef I_SYS_TIME_KERNEL
10472 # include <sys/time.h>
10473 # ifdef I_SYS_TIME_KERNEL
10477 #$i_sysselct I_SYS_SELECT
10478 #ifdef I_SYS_SELECT
10479 #include <sys/select.h>
10483 #define S sizeof(*(b))
10485 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
10486 #define NBITS (NBYTES * 8)
10495 fp = fopen("try.c", "r");
10501 b = ($selecttype)s;
10502 for (i = 0; i < NBITS; i++)
10506 select(fd + 1, b, 0, 0, &t);
10507 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
10508 printf("%d\n", i + 1);
10513 if eval $compile_ok; then
10514 selectminbits=`./try`
10515 case "$selectminbits" in
10517 Cannot figure out on how many bits at a time your select() operates.
10518 I'll play safe and guess it is 32 bits.
10524 *) bits="$selectminbits bits" ;;
10526 echo "Your select() operates on $bits at a time." >&4
10528 rp='What is the minimum number of bits your select() operates on?'
10529 case "$byteorder" in
10530 1234|12345678) dflt=32 ;;
10535 selectminbits="$val"
10539 *) : no select, so pick a harmless default
10546 : Trace out the files included by signal.h, then look for SIGxxx names.
10547 : Remove SIGARRAYSIZE used by HPUX.
10548 : Remove SIGTYP void lines used by OS2.
10549 xxx=`echo '#include <signal.h>' |
10550 $cppstdin $cppminus $cppflags 2>/dev/null |
10551 $grep '^[ ]*#.*include' |
10552 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
10553 : Check this list of files to be sure we have parsed the cpp output ok.
10554 : This will also avoid potentially non-existent files, such
10557 for xx in $xxx /dev/null ; do
10558 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
10560 : If we have found no files, at least try signal.h
10561 case "$xxxfiles" in
10562 '') xxxfiles=`./findhdr signal.h` ;;
10565 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
10566 print substr($2, 4, 20)
10568 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
10569 print substr($3, 4, 20)
10571 : Append some common names just in case the awk scan failed.
10572 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
10573 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
10574 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
10575 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
10576 : generate a few handy files for later
10577 $cat > signal.c <<'EOCP'
10578 #include <sys/types.h>
10579 #include <signal.h>
10583 /* Strange style to avoid deeply-nested #if/#else/#endif */
10586 # define NSIG (_NSIG)
10592 # define NSIG (SIGMAX+1)
10598 # define NSIG (SIG_MAX+1)
10604 # define NSIG (MAXSIG+1)
10610 # define NSIG (MAX_SIG+1)
10615 # ifdef SIGARRAYSIZE
10616 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
10622 # define NSIG (_sys_nsig) /* Solaris 2.5 */
10626 /* Default to some arbitrary number that's big enough to get most
10627 of the common signals.
10633 printf("NSIG %d\n", NSIG);
10639 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
10641 printf "#ifdef SIG"; printf $1; printf "\n"
10642 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
10643 printf $1; printf ");\n"
10647 printf "#endif /* JUST_NSIG */\n";
10651 $cat >signal.awk <<'EOP'
10652 BEGIN { ndups = 0 }
10653 $1 ~ /^NSIG$/ { nsig = $2 }
10654 ($1 !~ /^NSIG$/) && (NF == 2) {
10655 if ($2 > maxsig) { maxsig = $2 }
10656 if (sig_name[$2]) {
10657 dup_name[ndups] = $1
10658 dup_num[ndups] = $2
10668 if (nsig == 0) { nsig = maxsig + 1 }
10669 for (n = 1; n < nsig; n++) {
10671 printf("%s %d\n", sig_name[n], sig_num[n])
10674 printf("NUM%d %d\n", n, n)
10677 for (n = 0; n < ndups; n++) {
10678 printf("%s %d\n", dup_name[n], dup_num[n])
10682 $cat >signal_cmd <<EOS
10684 if $test -s signal.lst; then
10685 echo "Using your existing signal.lst file"
10690 $cat >>signal_cmd <<'EOS'
10693 if eval $compile_ok; then
10694 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10696 echo "(I can't seem be able to compile the whole test program)" >&4
10697 echo "(I'll try it in little pieces.)" >&4
10698 set signal -DJUST_NSIG
10699 if eval $compile_ok; then
10700 ./signal$_exe > signal.nsg
10703 echo "I can't seem to figure out how many signals you have." >&4
10704 echo "Guessing 50." >&4
10705 echo 'NSIG 50' > signal.nsg
10707 : Now look at all the signal names, one at a time.
10708 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
10709 $cat > signal.c <<EOCP
10710 #include <sys/types.h>
10711 #include <signal.h>
10714 printf("$xx %d\n", SIG${xx});
10719 if eval $compile; then
10720 echo "SIG${xx} found."
10721 ./signal$_exe >> signal.ls1
10723 echo "SIG${xx} NOT found."
10726 if $test -s signal.ls1; then
10727 $cat signal.nsg signal.ls1 |
10728 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10732 if $test -s signal.lst; then
10735 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
10736 echo 'kill -l' >signal
10737 set X `csh -f <signal`
10741 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
10743 echo $@ | $tr ' ' $trnl | \
10744 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
10746 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
10748 chmod a+x signal_cmd
10749 $eunicefix signal_cmd
10751 : generate list of signal names
10753 case "$sig_name_init" in
10755 *) case "$sig_num_init" in
10756 ''|*,*) doinit=yes ;;
10761 echo "Generating a list of signal names and numbers..." >&4
10763 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
10764 sig_name="ZERO $sig_name"
10765 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
10766 { printf "\"%s\", ", $1 }
10767 END { printf "0\n" }' signal.lst`
10768 sig_num=`$awk '{printf "%d ", $2}' signal.lst`
10769 sig_num="0 $sig_num"
10770 sig_num_init=`$awk 'BEGIN { printf "0, " }
10771 { printf "%d, ", $2}
10772 END { printf "0\n"}' signal.lst`
10775 echo "The following signals are available:"
10777 echo $sig_name | $awk \
10778 'BEGIN { linelen = 0 }
10780 for (i = 1; i <= NF; i++) {
10781 name = "SIG" $i " "
10782 linelen = linelen + length(name)
10783 if (linelen > 70) {
10785 linelen = length(name)
10791 $rm -f signal signal.c signal.awk signal.lst signal_cmd
10793 : see what type is used for signed size_t
10794 set ssize_t ssizetype int stdio.h sys/types.h
10797 $cat > ssize.c <<EOM
10799 #include <sys/types.h>
10800 #define Size_t $sizetype
10801 #define SSize_t $dflt
10804 if (sizeof(Size_t) == sizeof(SSize_t))
10806 else if (sizeof(Size_t) == sizeof(int))
10815 if eval $compile_ok && ./ssize > /dev/null; then
10816 ssizetype=`./ssize`
10817 echo "I'll be using $ssizetype for functions returning a byte count." >&4
10820 Help! I can't compile and run the ssize_t test program: please enlighten me!
10821 (This is probably a misconfiguration in your system or libraries, and
10822 you really ought to fix it. Still, I'll try anyway.)
10824 I need a type that is the same size as $sizetype, but is guaranteed to
10825 be signed. Common values are ssize_t, int and long.
10828 rp="What signed type is the same size as $sizetype?"
10832 $rm -f ssize ssize.*
10834 : see what type of char stdio uses.
10836 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
10837 echo "Your stdio uses unsigned chars." >&4
10838 stdchar="unsigned char"
10840 echo "Your stdio uses signed chars." >&4
10844 : see if time exists
10846 if test "X$d_time" = X -o X"$timetype" = X; then
10847 if set time val -f d_time; eval $csym; $val; then
10848 echo 'time() found.' >&4
10850 rp="What is the type returned by time() on this system?"
10851 set time_t timetype long stdio.h sys/types.h
10854 echo 'time() not found, hope that will do.' >&4
10862 : see what type uids are declared as in the kernel
10864 echo "Looking for the type for user ids returned by getuid()."
10865 set uid_t uidtype xxx stdio.h sys/types.h
10869 xxx=`./findhdr sys/user.h`
10870 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
10872 unsigned) dflt="$1 $2" ;;
10876 *) dflt="$uidtype";;
10879 uid_t) echo "uid_t found." ;;
10880 *) rp="What is the type for user ids returned by getuid()?"
10886 : see if dbm.h is available
10887 : see if dbmclose exists
10888 set dbmclose d_dbmclose
10891 case "$d_dbmclose" in
10901 *) set rpcsvc/dbm.h i_rpcsvcdbm
10906 *) echo "We won't be including <dbm.h>"
10916 : see if this is a sys/file.h system
10921 : do we need to include sys/file.h ?
10925 if $h_sysfile; then
10927 echo "We'll be including <sys/file.h>." >&4
10930 echo "We won't be including <sys/file.h>." >&4
10940 : see if fcntl.h is there
10945 : see if we can include fcntl.h
10951 echo "We'll be including <fcntl.h>." >&4
10954 if $h_sysfile; then
10955 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10957 echo "We won't be including <fcntl.h>." >&4
10969 : see if this is an grp system
10975 : see if setgrent exists
10976 set setgrent d_setgrent
10979 : see if getgrent exists
10980 set getgrent d_getgrent
10983 : see if endgrent exists
10984 set endgrent d_endgrent
10987 xxx=`./findhdr grp.h`
10988 $cppstdin $cppflags $cppminus < $xxx >$$.h
10990 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11000 *) # Assume all is lost as far as the d_*gr* go.
11002 set d_setgrent; eval $setvar
11003 set d_getgrent; eval $setvar
11004 set d_endgrent; eval $setvar
11005 set d_grpasswd; eval $setvar
11009 : see if this is a libutil.h system
11010 set libutil.h i_libutil
11013 : see if locale.h is available
11014 set locale.h i_locale
11017 : see if this is a math.h system
11021 : see if ndbm.h is available
11026 : see if dbm_open exists
11027 set dbm_open d_dbm_open
11029 case "$d_dbm_open" in
11032 echo "We won't be including <ndbm.h>"
11041 : see if net/errno.h is available
11043 set net/errno.h val
11046 : Unfortunately, it causes problems on some systems. Arrgh.
11049 cat > try.c <<'EOM'
11052 #include <net/errno.h>
11058 if $cc $ccflags -c try.c >/dev/null 2>&1; then
11059 echo "We'll be including <net/errno.h>." >&4
11061 echo "We won't be including <net/errno.h>." >&4
11070 : get C preprocessor symbols handy
11072 $echo $n "Hmm... $c"
11073 echo $al | $tr ' ' $trnl >Cppsym.know
11074 $cat <<EOSS >Cppsym
11082 case "\$list\$#" in
11085 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
11087 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
11090 unknown="\$unknown \$sym"
11100 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
11102 exit 0; _ _ _ _\1\\ \1\\
11105 echo "exit 1; _ _ _" >>Cppsym\$\$
11106 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
11108 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
11114 $rm -f Cppsym\$\$ Cppsym2\$\$
11119 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
11121 : now check the C compiler for additional symbols
11122 postprocess_cc_v=''
11124 aix) postprocess_cc_v="|$tr , ' '" ;;
11131 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
11134 -D*) echo "\$i" | $sed 's/^-D//';;
11135 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
11140 unset postprocess_cc_v
11143 ./ccsym > ccsym1.raw
11144 if $test -s ccsym1.raw; then
11145 $sort ccsym1.raw | $uniq >ccsym.raw
11147 mv ccsym1.raw ccsym.raw
11150 $awk '/\=/ { print $0; next }
11151 { print $0"=1" }' ccsym.raw >ccsym.list
11152 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
11153 $comm -13 ccsym.true ccsym.list >ccsym.own
11154 $comm -12 ccsym.true ccsym.list >ccsym.com
11155 $comm -23 ccsym.true ccsym.list >ccsym.cpp
11157 if $test -z ccsym.raw; then
11158 echo "Your C compiler doesn't seem to define any symbol!" >&4
11160 echo "However, your C preprocessor defines the following ones:"
11163 cppsymbols=`$cat Cppsym.true`
11164 cppsymbols=`echo $cppsymbols`
11165 cppccsymbols="$cppsymbols"
11167 if $test -s ccsym.com; then
11168 echo "Your C compiler and pre-processor define these symbols:"
11169 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
11172 $test "$silent" || sleep 1
11173 cppccsymbols=`$cat ccsym.com`
11174 cppccsymbols=`echo $cppccsymbols`
11176 if $test -s ccsym.cpp; then
11177 $test "$also" && echo " "
11178 echo "Your C pre-processor ${also}defines the following symbols:"
11179 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
11181 $test "$silent" || sleep 1
11182 cppsymbols=`$cat ccsym.cpp`
11183 cppsymbols=`echo $cppsymbols`
11185 if $test -s ccsym.own; then
11186 $test "$also" && echo " "
11187 echo "Your C compiler ${also}defines the following cpp symbols:"
11188 $sed -e 's/\(.*\)=1/\1/' ccsym.own
11189 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
11190 $test "$silent" || sleep 1
11191 ccsymbols=`$cat ccsym.own`
11192 ccsymbols=`echo $ccsymbols`
11197 : see if this is a termio system
11201 if $test `./findhdr termios.h`; then
11202 set tcsetattr i_termios
11208 "$define") echo "You have POSIX termios.h... good!" >&4;;
11209 *) if ./Cppsym pyr; then
11210 case "`/bin/universe`" in
11211 ucb) if $test `./findhdr sgtty.h`; then
11213 echo "<sgtty.h> found." >&4
11215 echo "System is pyramid with BSD universe."
11216 echo "<sgtty.h> not found--you could have problems." >&4
11218 *) if $test `./findhdr termio.h`; then
11220 echo "<termio.h> found." >&4
11222 echo "System is pyramid with USG universe."
11223 echo "<termio.h> not found--you could have problems." >&4
11227 if $test `./findhdr termio.h`; then
11228 echo "<termio.h> found." >&4
11230 elif $test `./findhdr sgtty.h`; then
11231 echo "<sgtty.h> found." >&4
11234 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
11237 if $test `./findhdr sgtty.h`; then
11238 echo "<sgtty.h> found." >&4
11240 elif $test `./findhdr termio.h`; then
11241 echo "<termio.h> found." >&4
11244 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
11248 set i_termio; eval $setvar
11249 val=$val2; set i_sgtty; eval $setvar
11250 val=$val3; set i_termios; eval $setvar
11252 : see if stdarg is available
11254 if $test `./findhdr stdarg.h`; then
11255 echo "<stdarg.h> found." >&4
11258 echo "<stdarg.h> NOT found." >&4
11262 : see if varags is available
11264 if $test `./findhdr varargs.h`; then
11265 echo "<varargs.h> found." >&4
11267 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11270 : set up the varargs testing programs
11271 $cat > varargs.c <<EOP
11273 #include <stdarg.h>
11276 #include <varargs.h>
11280 int f(char *p, ...)
11294 p = va_arg(ap, char *);
11299 $cat > varargs <<EOP
11301 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11310 : now check which varargs header should be included
11315 if `./varargs I_STDARG`; then
11317 elif `./varargs I_VARARGS`; then
11322 if `./varargs I_VARARGS`; then
11329 echo "I could not find the definition for va_dcl... You have problems..." >&4
11330 val="$undef"; set i_stdarg; eval $setvar
11331 val="$undef"; set i_varargs; eval $setvar
11336 case "$i_varhdr" in
11338 val="$define"; set i_stdarg; eval $setvar
11339 val="$undef"; set i_varargs; eval $setvar
11342 val="$undef"; set i_stdarg; eval $setvar
11343 val="$define"; set i_varargs; eval $setvar
11346 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11350 : see if stddef is available
11351 set stddef.h i_stddef
11354 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
11355 set sys/filio.h i_sysfilio
11358 if $test `./findhdr sys/ioctl.h`; then
11360 echo '<sys/ioctl.h> found.' >&4
11363 if $test $i_sysfilio = "$define"; then
11364 echo '<sys/ioctl.h> NOT found.' >&4
11366 $test $i_sgtty = "$define" && xxx="sgtty.h"
11367 $test $i_termio = "$define" && xxx="termio.h"
11368 $test $i_termios = "$define" && xxx="termios.h"
11369 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
11375 : see if sys/resource.h has to be included
11376 set sys/resource.h i_sysresrc
11379 : see if this is a sys/un.h system
11380 set sys/un.h i_sysun
11383 : see if this is a syswait system
11384 set sys/wait.h i_syswait
11387 : see if this is an utime system
11388 set utime.h i_utime
11391 : see if this is a values.h system
11392 set values.h i_values
11395 : see if this is a vfork system
11398 set vfork.h i_vfork
11406 : see if gdbm.h is available
11411 : see if gdbm_open exists
11412 set gdbm_open d_gdbm_open
11414 case "$d_gdbm_open" in
11417 echo "We won't be including <gdbm.h>"
11427 echo "Looking for extensions..." >&4
11430 : If we are using the old config.sh, known_extensions may contain
11431 : old or inaccurate or duplicate values.
11432 known_extensions=''
11433 nonxs_extensions=''
11434 : We do not use find because it might not be available.
11435 : We do not just use MANIFEST because the user may have dropped
11436 : some additional extensions into the source tree and expect them
11440 DynaLoader|dynaload) ;;
11441 *) if $test -f $xxx/$xxx.xs; then
11442 known_extensions="$known_extensions $xxx"
11443 elif $test -f $xxx/Makefile.PL; then
11444 nonxs_extensions="$nonxs_extensions $xxx"
11446 if $test -d $xxx; then
11447 # Look for nested extensions, eg. Devel/Dprof.
11450 if $test -f $yyy/$yyy.xs; then
11451 known_extensions="$known_extensions $xxx/$yyy"
11452 elif $test -f $yyy/Makefile.PL; then
11453 nonxs_extensions="$nonxs_extensions $xxx/$yyy"
11462 set X $nonxs_extensions
11464 nonxs_extensions="$*"
11465 set X $known_extensions
11467 known_extensions="$*"
11470 : Now see which are supported on this system.
11472 for xxx in $known_extensions ; do
11476 $define) avail_ext="$avail_ext $xxx" ;;
11479 GDBM_File|gdbm_fil)
11481 $define) avail_ext="$avail_ext $xxx" ;;
11484 NDBM_File|ndbm_fil)
11486 $define) avail_ext="$avail_ext $xxx" ;;
11489 ODBM_File|odbm_fil)
11490 case "${i_dbm}${i_rpcsvcdbm}" in
11491 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
11495 case "$useposix" in
11496 true|define|y) avail_ext="$avail_ext $xxx" ;;
11500 case "$useopcode" in
11501 true|define|y) avail_ext="$avail_ext $xxx" ;;
11505 case "$d_socket" in
11506 true|$define|y) avail_ext="$avail_ext $xxx" ;;
11510 case "$usethreads" in
11511 true|$define|y) avail_ext="$avail_ext $xxx" ;;
11515 : XXX Do we need a useipcsysv variable here
11516 case "${d_msg}${d_sem}${d_shm}" in
11517 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
11520 *) avail_ext="$avail_ext $xxx"
11529 : Now see which nonxs extensions are supported on this system.
11530 : For now assume all are.
11532 for xxx in $nonxs_extensions ; do
11534 *) nonxs_ext="$nonxs_ext $xxx"
11546 A number of extensions are supplied with $package. You may choose to
11547 compile these extensions for dynamic loading (the default), compile
11548 them into the $package executable (static loading), or not include
11549 them at all. Answer "none" to include no extensions.
11550 Note that DynaLoader is always built and need not be mentioned here.
11553 case "$dynamic_ext" in
11554 '') dflt="$avail_ext" ;;
11555 *) dflt="$dynamic_ext"
11556 # Perhaps we are reusing an old out-of-date config.sh.
11559 if test X"$dynamic_ext" != X"$avail_ext"; then
11561 NOTICE: Your previous config.sh list may be incorrect.
11562 The extensions now available to you are
11564 but the default list from your previous config.sh is
11576 rp="What extensions do you wish to load dynamically?"
11579 none) dynamic_ext=' ' ;;
11580 *) dynamic_ext="$ans" ;;
11583 case "$static_ext" in
11585 : Exclude those already listed in dynamic linking
11587 for xxx in $avail_ext; do
11588 case " $dynamic_ext " in
11590 *) dflt="$dflt $xxx" ;;
11597 *) dflt="$static_ext"
11604 rp="What extensions do you wish to load statically?"
11607 none) static_ext=' ' ;;
11608 *) static_ext="$ans" ;;
11613 A number of extensions are supplied with $package. Answer "none"
11614 to include no extensions.
11615 Note that DynaLoader is always built and need not be mentioned here.
11618 case "$static_ext" in
11619 '') dflt="$avail_ext" ;;
11620 *) dflt="$static_ext"
11621 # Perhaps we are reusing an old out-of-date config.sh.
11624 if test X"$static_ext" != X"$avail_ext"; then
11626 NOTICE: Your previous config.sh list may be incorrect.
11627 The extensions now available to you are
11629 but the default list from your previous config.sh is
11638 : Exclude those that are not xs extensions
11642 rp="What extensions do you wish to include?"
11645 none) static_ext=' ' ;;
11646 *) static_ext="$ans" ;;
11651 set X $dynamic_ext $static_ext $nonxs_ext
11655 : Remove build directory name from cppstdin so it can be used from
11656 : either the present location or the final installed location.
11658 : Get out of the UU directory to get correct path name.
11660 case "$cppstdin" in
11662 echo "Stripping down cppstdin path name"
11668 : end of configuration questions
11670 echo "End of configuration questions."
11673 : back to where it started
11674 if test -d ../UU; then
11678 : configuration may be patched via a 'config.over' file
11679 if $test -f config.over; then
11682 rp='I see a config.over file. Do you wish to load it?'
11685 n*) echo "OK, I'll ignore it.";;
11687 echo "Configuration override changes have been loaded."
11692 : in case they want portability, strip down executable paths
11693 case "$d_portable" in
11696 echo "Stripping down executable paths..." >&4
11697 for file in $loclist $trylist; do
11698 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
11699 eval $file="\$file"
11705 : create config.sh file
11707 echo "Creating config.sh..." >&4
11708 $spitshell <<EOT >config.sh
11711 # This file was produced by running the Configure script. It holds all the
11712 # definitions figured out by Configure. Should you modify one of these values,
11713 # do not forget to propagate your changes by running "Configure -der". You may
11714 # instead choose to run each of the .SH files by yourself, or "Configure -S".
11717 # Package name : $package
11718 # Source directory : $src
11719 # Configuration time: $cf_time
11720 # Configured by : $cf_by
11721 # Target system : $myuname
11731 Revision='$Revision'
11738 alignbytes='$alignbytes'
11739 ansi2knr='$ansi2knr'
11740 aphostname='$aphostname'
11741 apiversion='$apiversion'
11744 archlibexp='$archlibexp'
11745 archname='$archname'
11746 archobjs='$archobjs'
11754 byteorder='$byteorder'
11756 castflags='$castflags'
11759 cccdlflags='$cccdlflags'
11760 ccdlflags='$ccdlflags'
11762 ccsymbols='$ccsymbols'
11764 cf_email='$cf_email'
11769 clocktype='$clocktype'
11771 compress='$compress'
11772 contains='$contains'
11776 cpp_stuff='$cpp_stuff'
11777 cppflags='$cppflags'
11779 cppminus='$cppminus'
11781 cppstdin='$cppstdin'
11782 cppsymbols='$cppsymbols'
11783 cppccsymbols='$cppccsymbols'
11784 cryptlib='$cryptlib'
11786 d_Gconvert='$d_Gconvert'
11787 d_access='$d_access'
11789 d_archlib='$d_archlib'
11790 d_attribut='$d_attribut'
11794 d_bsdgetpgrp='$d_bsdgetpgrp'
11795 d_bsdsetpgrp='$d_bsdsetpgrp'
11797 d_casti32='$d_casti32'
11798 d_castneg='$d_castneg'
11799 d_charvspr='$d_charvspr'
11801 d_chroot='$d_chroot'
11802 d_chsize='$d_chsize'
11803 d_closedir='$d_closedir'
11807 d_cuserid='$d_cuserid'
11808 d_dbl_dig='$d_dbl_dig'
11809 d_difftime='$d_difftime'
11810 d_dirnamlen='$d_dirnamlen'
11811 d_dlerror='$d_dlerror'
11812 d_dlopen='$d_dlopen'
11813 d_dlsymun='$d_dlsymun'
11814 d_dosuid='$d_dosuid'
11816 d_endgrent='$d_endgrent'
11817 d_endhent='$d_endhent'
11818 d_endnent='$d_endnent'
11819 d_endpent='$d_endpent'
11820 d_endpwent='$d_endpwent'
11821 d_endsent='$d_endsent'
11822 d_eofnblk='$d_eofnblk'
11823 d_eunice='$d_eunice'
11824 d_fchmod='$d_fchmod'
11825 d_fchown='$d_fchown'
11827 d_fd_macros='$d_fd_macros'
11828 d_fd_set='$d_fd_set'
11829 d_fds_bits='$d_fds_bits'
11830 d_fgetpos='$d_fgetpos'
11831 d_flexfnam='$d_flexfnam'
11834 d_fpathconf='$d_fpathconf'
11835 d_fsetpos='$d_fsetpos'
11836 d_fstatfs='$d_fstatfs'
11837 d_statfsflags='$d_statfsflags'
11838 d_fstatvfs='$d_fstatvfs'
11839 d_getmntent='$d_getmntent'
11840 d_hasmntopt='$d_hasmntopt'
11842 d_getgrent='$d_getgrent'
11843 d_getgrps='$d_getgrps'
11844 d_gethbyaddr='$d_gethbyaddr'
11845 d_gethbyname='$d_gethbyname'
11846 d_gethent='$d_gethent'
11847 d_gethname='$d_gethname'
11848 d_gethostprotos='$d_gethostprotos'
11849 d_getlogin='$d_getlogin'
11850 d_getnbyaddr='$d_getnbyaddr'
11851 d_getnbyname='$d_getnbyname'
11852 d_getnent='$d_getnent'
11853 d_getnetprotos='$d_getnetprotos'
11854 d_getpbyname='$d_getpbyname'
11855 d_getpbynumber='$d_getpbynumber'
11856 d_getpent='$d_getpent'
11857 d_getpgid='$d_getpgid'
11858 d_getpgrp2='$d_getpgrp2'
11859 d_getpgrp='$d_getpgrp'
11860 d_getppid='$d_getppid'
11861 d_getprior='$d_getprior'
11862 d_getprotoprotos='$d_getprotoprotos'
11863 d_getpwent='$d_getpwent'
11864 d_getsbyname='$d_getsbyname'
11865 d_getsbyport='$d_getsbyport'
11866 d_getsent='$d_getsent'
11867 d_getservprotos='$d_getservprotos'
11868 d_gettimeod='$d_gettimeod'
11869 d_gnulibc='$d_gnulibc'
11870 d_grpasswd='$d_grpasswd'
11873 d_inetaton='$d_inetaton'
11874 d_isascii='$d_isascii'
11875 d_killpg='$d_killpg'
11876 d_lchown='$d_lchown'
11878 d_locconv='$d_locconv'
11880 d_longdbl='$d_longdbl'
11881 d_longlong='$d_longlong'
11884 d_mbstowcs='$d_mbstowcs'
11885 d_mbtowc='$d_mbtowc'
11886 d_memcmp='$d_memcmp'
11887 d_memcpy='$d_memcpy'
11888 d_memmove='$d_memmove'
11889 d_memset='$d_memset'
11891 d_mkfifo='$d_mkfifo'
11892 d_mktime='$d_mktime'
11894 d_msgctl='$d_msgctl'
11895 d_msgget='$d_msgget'
11896 d_msgrcv='$d_msgrcv'
11897 d_msgsnd='$d_msgsnd'
11898 d_mymalloc='$d_mymalloc'
11900 d_oldpthreads='$d_oldpthreads'
11901 d_oldsock='$d_oldsock'
11903 d_pathconf='$d_pathconf'
11905 d_phostname='$d_phostname'
11908 d_portable='$d_portable'
11909 d_pthread_yield='$d_pthread_yield'
11910 d_pthreads_created_joinable='$d_pthreads_created_joinable'
11912 d_pwchange='$d_pwchange'
11913 d_pwclass='$d_pwclass'
11914 d_pwcomment='$d_pwcomment'
11915 d_pwexpire='$d_pwexpire'
11916 d_pwgecos='$d_pwgecos'
11917 d_pwquota='$d_pwquota'
11918 d_pwpasswd='$d_pwpasswd'
11919 d_readdir='$d_readdir'
11920 d_readlink='$d_readlink'
11921 d_rename='$d_rename'
11922 d_rewinddir='$d_rewinddir'
11924 d_safebcpy='$d_safebcpy'
11925 d_safemcpy='$d_safemcpy'
11926 d_sanemcmp='$d_sanemcmp'
11927 d_sched_yield='$d_sched_yield'
11928 d_seekdir='$d_seekdir'
11929 d_select='$d_select'
11931 d_semctl='$d_semctl'
11932 d_semctl_semid_ds='$d_semctl_semid_ds'
11933 d_semctl_semun='$d_semctl_semun'
11934 d_semget='$d_semget'
11936 d_setegid='$d_setegid'
11937 d_seteuid='$d_seteuid'
11938 d_setgrent='$d_setgrent'
11939 d_setgrps='$d_setgrps'
11940 d_sethent='$d_sethent'
11941 d_setlinebuf='$d_setlinebuf'
11942 d_setlocale='$d_setlocale'
11943 d_setnent='$d_setnent'
11944 d_setpent='$d_setpent'
11945 d_setpgid='$d_setpgid'
11946 d_setpgrp2='$d_setpgrp2'
11947 d_setpgrp='$d_setpgrp'
11948 d_setprior='$d_setprior'
11949 d_setproctitle='$d_setproctitle'
11950 d_setpwent='$d_setpwent'
11951 d_setregid='$d_setregid'
11952 d_setresgid='$d_setresgid'
11953 d_setresuid='$d_setresuid'
11954 d_setreuid='$d_setreuid'
11955 d_setrgid='$d_setrgid'
11956 d_setruid='$d_setruid'
11957 d_setsent='$d_setsent'
11958 d_setsid='$d_setsid'
11959 d_setvbuf='$d_setvbuf'
11963 d_shmatprototype='$d_shmatprototype'
11964 d_shmctl='$d_shmctl'
11966 d_shmget='$d_shmget'
11967 d_sigaction='$d_sigaction'
11968 d_sigsetjmp='$d_sigsetjmp'
11969 d_socket='$d_socket'
11970 d_sockpair='$d_sockpair'
11971 d_statblks='$d_statblks'
11972 d_stdio_cnt_lval='$d_stdio_cnt_lval'
11973 d_stdio_ptr_lval='$d_stdio_ptr_lval'
11974 d_stdiobase='$d_stdiobase'
11975 d_stdstdio='$d_stdstdio'
11976 d_strchr='$d_strchr'
11977 d_strcoll='$d_strcoll'
11978 d_strctcpy='$d_strctcpy'
11979 d_strerrm='$d_strerrm'
11980 d_strerror='$d_strerror'
11981 d_strtod='$d_strtod'
11982 d_strtol='$d_strtol'
11983 d_strtoul='$d_strtoul'
11984 d_strxfrm='$d_strxfrm'
11985 d_suidsafe='$d_suidsafe'
11986 d_symlink='$d_symlink'
11987 d_syscall='$d_syscall'
11988 d_sysconf='$d_sysconf'
11989 d_sysernlst='$d_sysernlst'
11990 d_syserrlst='$d_syserrlst'
11991 d_system='$d_system'
11992 d_tcgetpgrp='$d_tcgetpgrp'
11993 d_tcsetpgrp='$d_tcsetpgrp'
11994 d_telldir='$d_telldir'
11997 d_truncate='$d_truncate'
11998 d_tzname='$d_tzname'
12001 d_union_semun='$d_union_semun'
12003 d_void_closedir='$d_void_closedir'
12004 d_voidsig='$d_voidsig'
12005 d_voidtty='$d_voidtty'
12006 d_volatile='$d_volatile'
12007 d_vprintf='$d_vprintf'
12009 d_waitpid='$d_waitpid'
12010 d_wcstombs='$d_wcstombs'
12011 d_wctomb='$d_wctomb'
12014 db_hashtype='$db_hashtype'
12015 db_prefixtype='$db_prefixtype'
12016 defvoidused='$defvoidused'
12017 direntrytype='$direntrytype'
12020 doublesize='$doublesize'
12021 dynamic_ext='$dynamic_ext'
12027 eunicefix='$eunicefix'
12030 extensions='$extensions'
12032 firstmakefile='$firstmakefile'
12034 fpostype='$fpostype'
12035 freetype='$freetype'
12037 full_csh='$full_csh'
12038 full_sed='$full_sed'
12039 gccversion='$gccversion'
12043 groupcat='$groupcat'
12044 groupstype='$groupstype'
12047 h_sysfile='$h_sysfile'
12051 i_arpainet='$i_arpainet'
12052 i_bsdioctl='$i_bsdioctl'
12055 i_dirent='$i_dirent'
12062 i_libutil='$i_libutil'
12063 i_limits='$i_limits'
12064 i_locale='$i_locale'
12065 i_malloc='$i_malloc'
12066 i_machcthreads='$i_machcthreads'
12068 i_memory='$i_memory'
12069 i_mntent='$i_mntent'
12072 i_neterrno='$i_neterrno'
12075 i_pthread='$i_pthread'
12076 i_rpcsvcdbm='$i_rpcsvcdbm'
12079 i_stdarg='$i_stdarg'
12080 i_stddef='$i_stddef'
12081 i_stdlib='$i_stdlib'
12082 i_string='$i_string'
12083 i_sysdir='$i_sysdir'
12084 i_sysfile='$i_sysfile'
12085 i_sysfilio='$i_sysfilio'
12087 i_sysioctl='$i_sysioctl'
12088 i_sysmount='$i_sysmount'
12089 i_sysndir='$i_sysndir'
12090 i_sysparam='$i_sysparam'
12091 i_sysresrc='$i_sysresrc'
12092 i_sysselct='$i_sysselct'
12093 i_syssockio='$i_syssockio'
12094 i_sysstat='$i_sysstat'
12095 i_sysstatvfs='$i_sysstatvfs'
12096 i_systime='$i_systime'
12097 i_systimek='$i_systimek'
12098 i_systimes='$i_systimes'
12099 i_systypes='$i_systypes'
12101 i_syswait='$i_syswait'
12102 i_termio='$i_termio'
12103 i_termios='$i_termios'
12105 i_unistd='$i_unistd'
12107 i_values='$i_values'
12108 i_varargs='$i_varargs'
12109 i_varhdr='$i_varhdr'
12111 ignore_versioned_solibs='$ignore_versioned_solibs'
12114 installarchlib='$installarchlib'
12115 installbin='$installbin'
12116 installman1dir='$installman1dir'
12117 installman3dir='$installman3dir'
12118 installprivlib='$installprivlib'
12119 installscript='$installscript'
12120 installsitearch='$installsitearch'
12121 installsitelib='$installsitelib'
12122 installusrbinperl='$installusrbinperl'
12124 known_extensions='$known_extensions'
12128 lddlflags='$lddlflags'
12136 libswanted='$libswanted'
12142 locincpth='$locincpth'
12143 loclibpth='$loclibpth'
12144 longdblsize='$longdblsize'
12145 longlongsize='$longlongsize'
12146 longsize='$longsize'
12150 lseektype='$lseektype'
12154 make_set_make='$make_set_make'
12155 mallocobj='$mallocobj'
12156 mallocsrc='$mallocsrc'
12157 malloctype='$malloctype'
12159 man1direxp='$man1direxp'
12162 man3direxp='$man3direxp'
12166 mips_type='$mips_type'
12169 modetype='$modetype'
12172 myarchname='$myarchname'
12173 mydomain='$mydomain'
12174 myhostname='$myhostname'
12177 netdb_hlen_type='$netdb_hlen_type'
12178 netdb_host_type='$netdb_host_type'
12179 netdb_name_type='$netdb_name_type'
12180 netdb_net_type='$netdb_net_type'
12183 nm_so_opt='$nm_so_opt'
12184 nonxs_ext='$nonxs_ext'
12186 o_nonblock='$o_nonblock'
12188 optimize='$optimize'
12189 orderlib='$orderlib'
12195 patchlevel='$patchlevel'
12196 path_sep='$path_sep'
12198 perladmin='$perladmin'
12199 perlpath='$perlpath'
12201 phostname='$phostname'
12207 prefixexp='$prefixexp'
12209 privlibexp='$privlibexp'
12210 prototype='$prototype'
12212 randbits='$randbits'
12214 rd_nodata='$rd_nodata'
12218 scriptdir='$scriptdir'
12219 scriptdirexp='$scriptdirexp'
12221 selectminbits='$selectminbits'
12222 selecttype='$selecttype'
12223 sendmail='$sendmail'
12226 sharpbang='$sharpbang'
12227 shmattype='$shmattype'
12228 shortsize='$shortsize'
12231 sig_name='$sig_name'
12232 sig_name_init='$sig_name_init'
12234 sig_num_init='$sig_num_init'
12235 signal_t='$signal_t'
12236 sitearch='$sitearch'
12237 sitearchexp='$sitearchexp'
12239 sitelibexp='$sitelibexp'
12240 sizetype='$sizetype'
12245 sockethdr='$sockethdr'
12246 socketlib='$socketlib'
12248 spackage='$spackage'
12249 spitshell='$spitshell'
12252 ssizetype='$ssizetype'
12253 startperl='$startperl'
12255 static_ext='$static_ext'
12257 stdio_base='$stdio_base'
12258 stdio_bufsiz='$stdio_bufsiz'
12259 stdio_cnt='$stdio_cnt'
12260 stdio_filbuf='$stdio_filbuf'
12261 stdio_ptr='$stdio_ptr'
12264 subversion='$subversion'
12271 timeincl='$timeincl'
12272 timetype='$timetype'
12281 usemymalloc='$usemymalloc'
12283 useopcode='$useopcode'
12284 useperlio='$useperlio'
12285 useposix='$useposix'
12287 useshrplib='$useshrplib'
12288 usethreads='$usethreads'
12289 usevfork='$usevfork'
12294 voidflags='$voidflags'
12300 : Add in command line options if available
12301 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
12303 : add special variables
12304 $test -f $src/patchlevel.h && \
12305 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
12306 echo "CONFIG=true" >>config.sh
12308 : propagate old symbols
12309 if $test -f UU/config.sh; then
12310 <UU/config.sh sort | uniq >UU/oldconfig.sh
12311 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
12312 sort | uniq -u >UU/oldsyms
12313 set X `cat UU/oldsyms`
12319 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
12321 echo "# Variables propagated from previous config.sh file." >>config.sh
12322 for sym in `cat UU/oldsyms`; do
12323 echo " Propagating $hint variable "'$'"$sym..."
12324 eval 'tmp="$'"${sym}"'"'
12326 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
12332 : Finish up by extracting the .SH files
12346 If you'd like to make any changes to the config.sh file before I begin
12347 to configure things, do it as a shell escape now (e.g. !vi config.sh).
12350 rp="Press return or use a shell escape to edit config.sh:"
12355 *) : in case they cannot read
12356 sh 1>&4 -c "$ans";;
12361 : if this fails, just run all the .SH files by hand
12368 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
12375 Now you need to generate make dependencies by running "make depend".
12376 You might prefer to run it in background: "make depend > makedepend.out &"
12377 It can take a while, so you might not want to run it right now.
12382 rp="Run make depend now?"
12386 make depend && echo "Now you must run a make."
12389 echo "You must run 'make depend' then 'make'."
12392 elif test -f [Mm]akefile; then
12394 echo "Now you must run a make."
12399 if $test -f Policy.sh; then
12402 If you compile $package on a different machine or from a different object
12403 directory, copy the Policy.sh file from this object directory to the
12404 new one before you run Configure -- this will help you with most of
12405 the policy defaults.
12409 if $test -f config.msg; then
12410 echo "Hmm. I also noted the following information while running:"
12412 $cat config.msg >&4
12415 $rm -f kit*isdone ark*isdone