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 Thu Jan 7 13:54:35 EET 1999 [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
412 d_old_pthread_create_joinable=''
413 old_pthread_create_joinable=''
660 ignore_versioned_solibs=''
785 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
788 : We must find out about Eunice early
790 if test -f /etc/unixtovms; then
791 eunicefix=/etc/unixtovms
793 if test -f /etc/unixtovms.exe; then
794 eunicefix=/etc/unixtovms.exe
798 : change the next line if compiling for Xenix/286 on Xenix/386
799 xlibpth='/usr/lib/386 /lib/386'
801 : Possible local library directories to search.
802 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
803 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
805 : general looking path for locating libraries
806 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
807 glibpth="$glibpth /lib /usr/lib $xlibpth"
808 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
809 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
811 : Private path used by Configure to find libraries. Its value
812 : is prepended to libpth. This variable takes care of special
813 : machines, like the mips. Usually, it should be empty.
816 : Possible local include directories to search.
817 : Set locincpth to "" in a hint file to defeat local include searches.
818 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
819 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
821 : no include file wanted by default
824 : list of known cpp symbols, sorted alphabetically
825 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
826 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
827 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
828 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
829 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
830 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
831 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
832 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
833 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
834 al="$al VMS Xenix286"
835 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
836 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
837 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
838 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
839 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
840 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
841 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
842 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
843 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
844 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
845 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
846 al="$al __SVR4_2__ __UMAXV__"
847 al="$al ____386BSD____ __alpha __alpha__ __amiga"
848 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
849 al="$al __host_mips__"
850 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
851 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
852 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
853 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
854 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
855 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
856 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
857 al="$al __mc88100 __mc88100__ __mips __mips__"
858 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
859 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
860 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
861 al="$al _host_mips _mips _unix"
862 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
863 al="$al apollo ardent att386 att3b"
864 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
865 al="$al cadmus clipper concurrent convex cray ctix"
866 al="$al dmert encore gcos gcx gimpel gould"
867 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
868 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
869 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
870 al="$al i186 i286 i386 i486 i8086"
871 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
872 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
873 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
874 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
875 al="$al mc88000 mc88100 merlin mert mips mvs n16"
876 al="$al ncl_el ncl_mr"
877 al="$al news1500 news1700 news1800 news1900 news3700"
878 al="$al news700 news800 news900 ns16000 ns32000"
879 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
880 al="$al parisc pc532 pdp11 plexus posix pyr"
881 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
882 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
883 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
884 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
885 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
886 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
889 : Trailing extension. Override this in a hint file, if needed.
891 : Extra object files, if any, needed on this platform.
894 : default library list
896 : some systems want to use only the non-versioned libso:s
897 ignore_versioned_solibs=''
898 : full support for void wanted by default
901 : set useposix=false in your hint file to disable the POSIX extension.
903 : set useopcode=false in your hint file to disable the Opcode extension.
905 : set use64bits on the Configure command line to enable 64 bit support.
906 : set usemultiplicity on the Configure command line to enable multiplicity.
907 : set usethreads on the Configure command line to enable threads.
908 : List of libraries we want.
909 : If anyone needs -lnet, put it in a hint file.
910 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
911 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
912 libswanted="$libswanted ucb bsd BSD PW x"
913 : We probably want to search /usr/shlib before most other libraries.
914 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
915 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
916 glibpth="/usr/shlib $glibpth"
917 : Do not use vfork unless overridden by a hint file.
920 : Find the basic shell for Bourne shell scripts
924 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
927 if test -f "$xxx"; then
930 : Build up a list and do a single loop so we can 'break' out.
931 pth=`echo $PATH | sed -e "s/$p_/ /g"`
932 for xxx in sh bash ksh pdksh ash; do
934 try="$try ${p}/${xxx}"
938 if test -f "$xxx"; then
941 elif test -f "$xxx.exe"; then
952 $me: Fatal Error: I can't find a Bourne Shell anywhere.
954 Usually it's in /bin/sh. How did you even get this far?
955 Please contact me (Jarkko Hietaniemi) at jhi@iki.fi and
956 we'll try to straighten this all out.
962 : see if sh knows # comments
963 if `$sh -c '#' >/dev/null 2>&1`; then
967 test -f $xcat || xcat=/usr/bin/cat
972 if test -s today; then
975 echo "#! $xcat" > try
979 if test -s today; then
987 echo "Your $sh doesn't grok # comments--I will strip them later on."
990 echo "exec grep -v '^[ ]*#'" >spitshell
993 spitshell=`pwd`/spitshell
995 echo "I presume that if # doesn't work, #! won't work either!"
1000 : figure out how to guarantee sh startup
1002 '') startsh=${sharpbang}${sh} ;;
1014 : echo "Yup, it does."
1016 echo "Hmm... '$startsh' does not guarantee sh startup..."
1017 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1022 : Save command line options in file UU/cmdline.opt for later use in
1023 : generating config.sh.
1024 cat > cmdline.opt <<EOSH
1025 # Configure command line arguments.
1032 cat >>cmdline.opt <<EOSH
1033 config_arg$argn='$arg'
1035 argn=`expr $argn + 1`
1038 : produce awk script to parse command line options
1039 cat >options.awk <<'EOF'
1041 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
1043 len = length(optstr);
1044 for (i = 1; i <= len; i++) {
1045 c = substr(optstr, i, 1);
1046 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1057 if (substr(str, 1, 1) != "-") {
1058 printf("'%s'\n", str);
1062 for (i = 2; i <= len; i++) {
1063 c = substr(str, i, 1);
1065 printf("-%s\n", substr(str, i));
1071 printf("'%s'\n", substr(str, i + 1));
1084 : process the command line options
1085 set X `for arg in "$@"; do echo "X$arg"; done |
1086 sed -e s/X// | awk -f options.awk`
1091 : set up default values
1102 cat >optdef.sh <<EOS
1108 while test $# -gt 0; do
1110 -d) shift; fastread=yes;;
1111 -e) shift; alldone=cont;;
1115 if test -r "$1"; then
1118 echo "$me: cannot read config file $1." >&2
1123 -h) shift; error=true;;
1124 -r) shift; reuseval=true;;
1125 -s) shift; silent=true; realsilent=true;;
1126 -E) shift; alldone=exit;;
1127 -K) shift; knowitall=true;;
1128 -O) shift; override=true;;
1129 -S) shift; silent=true; extractsh=true;;
1134 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1135 echo "$me: ignoring -D $1" >&2
1138 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1139 *) echo "$1='define'" >> optdef.sh;;
1146 *=) echo "$1" >> optdef.sh;;
1148 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1149 echo "$me: ignoring -U $1" >&2
1151 *) echo "$1='undef'" >> optdef.sh;;
1155 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1158 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1166 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1167 [-U symbol] [-U symbol=]
1168 -d : use defaults for all answers.
1169 -e : go on without questioning past the production of config.sh.
1170 -f : specify an alternate default configuration file.
1171 -h : print this help message and exit (with an error status).
1172 -r : reuse C symbols value if possible (skips costly nm extraction).
1173 -s : silent mode, only echoes questions and essential information.
1174 -D : define symbol to have some value:
1175 -D symbol symbol gets the value 'define'
1176 -D symbol=value symbol gets the value 'value'
1177 -E : stop at the end of questions, after having produced config.sh.
1178 -K : do not use unless you know what you are doing.
1179 -O : let -D and -U override definitions from loaded configuration file.
1180 -S : perform variable substitutions on all .SH files (can mix with -f)
1181 -U : undefine symbol:
1182 -U symbol symbol gets the value 'undef'
1183 -U symbol= symbol gets completely empty
1184 -V : print version number and exit (with a zero status).
1191 case "$fastread$alldone" in
1194 if test ! -t 0; then
1195 echo "Say 'sh Configure', not 'sh <Configure'"
1203 true) exec 1>/dev/null;;
1206 : run the defines and the undefines, if any, but leave the file out there...
1212 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1213 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1214 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1215 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1216 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1219 : Some greps do not return status, grrr.
1220 echo "grimblepritz" >grimble
1221 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1223 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1229 : the following should work in any shell
1233 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1234 cat >contains <<'EOSS'
1235 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1240 : Find the path to the source tree
1243 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1254 if test -f $rsrc/Configure && \
1255 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1257 : found it, so we are ok.
1260 for src in . .. ../.. ../../.. ../../../..; do
1261 if test -f ../$src/Configure && \
1262 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1273 Sorry, I can't seem to locate the source dir for $package. Please start
1274 Configure with an explicit path -- i.e. /some/path/Configure.
1282 echo "Sources for $package found in \"$src\"." >&4
1286 : script used to extract .SH files with variable substitutions
1287 cat >extract <<'EOS'
1289 echo "Doing variable substitutions on .SH files..."
1290 if test -f $src/MANIFEST; then
1291 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1293 echo "(Looking for .SH files under the source directory.)"
1294 set x `(cd $src; find . -name "*.SH" -print)`
1298 0) set x `(cd $src; echo *.SH)`; shift;;
1300 if test ! -f $src/$1; then
1306 while test $name; do
1307 if test ! -d "$name"; then
1308 create="$name $create";
1309 name=`echo $name | sed -e "s|^[^/]*$||"`;
1310 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1315 for file in $create; do
1324 dir=`expr X$file : 'X\(.*\)/'`
1325 file=`expr X$file : 'X.*/\(.*\)'`
1326 (cd $dir && . ./$file)
1336 dir=`expr X$file : 'X\(.*\)/'`
1337 file=`expr X$file : 'X.*/\(.*\)'`
1338 (set x $dir; shift; eval $mkdir_p)
1348 if test -f $src/config_h.SH; then
1349 if test ! -f config.h; then
1350 : oops, they left it out of MANIFEST, probably, so do it anyway.
1356 : extract files and exit if asked to do so
1357 case "$extractsh" in
1359 case "$realsilent" in
1363 case "$config_sh" in
1364 '') config_sh='config.sh';;
1367 echo "Fetching answers from $config_sh..."
1370 test "$override" && . ./optdef.sh
1379 : Eunice requires " " instead of "", can you believe it
1382 echo "Beginning of configuration questions for $package."
1384 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1386 : first determine how to suppress newline on echo command
1388 echo "Checking echo to see how to suppress newlines..."
1389 (echo "hi there\c" ; echo " ") >.echotmp
1390 if $contains c .echotmp >/dev/null 2>&1 ; then
1401 echo $n "The star should be here-->$c"
1405 : Now test for existence of everything in MANIFEST
1407 if test -f $rsrc/MANIFEST; then
1408 echo "First let's make sure your kit is complete. Checking..." >&4
1409 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1412 for filelist in x??; do
1413 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1415 if test -s missing; then
1419 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1421 You have the option of continuing the configuration process, despite the
1422 distinct possibility that your kit is damaged, by typing 'y'es. If you
1423 do, don't blame me if something goes wrong. I advise you to type 'n'o
1424 and contact the author (jhi@iki.fi).
1427 echo $n "Continue? [n] $c" >&4
1431 echo "Continuing..." >&4
1435 echo "ABORTING..." >&4
1440 echo "Looks good..."
1443 echo "There is no MANIFEST file. I hope your kit is complete !"
1448 : Find the appropriate value for a newline for tr
1449 if test -n "$DJGPP"; then
1452 if test X"$trnl" = X; then
1453 case "`echo foo|tr '\n' x 2>/dev/null`" in
1457 if test X"$trnl" = X; then
1458 case "`echo foo|tr '\012' x 2>/dev/null`" in
1459 foox) trnl='\012' ;;
1462 if test X"$trnl" = X; then
1465 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1471 : compute the number of columns on the terminal for proper question formatting
1476 : set up the echo used in my read
1477 myecho="case \"\$xxxm\" in
1478 '') echo $n \"\$rp $c\" >&4;;
1480 '') echo $n \"[\$xxxm] $c\";;
1482 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1484 echo $n \"[\$xxxm] $c\" >&4
1486 echo $n \"\$rp [\$xxxm] $c\" >&4
1492 : now set up to do reads with possible shell escape and default assignment
1498 case "\$fastread" in
1499 yes) case "\$dflt" in
1502 case "\$silent-\$rp" in
1507 *) case "\$silent" in
1508 true) case "\$rp" in
1513 while expr "X\$ans" : "X!" >/dev/null; do
1517 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1525 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1534 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1539 echo "(OK, I'll run with -d after this question.)" >&4
1542 echo "*** Sorry, \$1 not supported yet." >&4
1552 echo "*** Substitution done -- please confirm."
1554 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1559 echo "*** Error -- try again."
1566 case "\$ans\$xxxm\$nostick" in
1578 : create .config dir to save info across Configure sessions
1579 test -d ../.config || mkdir ../.config
1580 cat >../.config/README <<EOF
1581 This directory created by Configure to save information that should
1582 persist across sessions for $package.
1584 You may safely delete it if you wish.
1587 : general instructions
1590 user=`(logname) 2>/dev/null`
1592 '') user=`whoami 2>&1`;;
1594 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1597 rp='Would you like to see the instructions?'
1608 This installation shell script will examine your system and ask you questions
1609 to determine how the perl5 package should be installed. If you get
1610 stuck on a question, you may use a ! shell escape to start a subshell or
1611 execute a command. Many of the questions will have default answers in square
1612 brackets; typing carriage return will give you the default.
1614 On some of the questions which ask for file or directory names you are allowed
1615 to use the ~name construct to specify the login directory belonging to "name",
1616 even if you don't have a shell which knows about that. Questions where this is
1617 allowed will be marked "(~name ok)".
1621 dflt='Type carriage return to continue'
1625 The prompter used in this script allows you to use shell variables and
1626 backticks in your answers. You may use $1, $2, etc... to refer to the words
1627 in the default answer, as if the default line was a set of arguments given to a
1628 script shell. This means you may also use $* to repeat the whole default line,
1629 so you do not have to re-type everything to add something to the default.
1631 Everytime there is a substitution, you will have to confirm. If there is an
1632 error (e.g. an unmatched backtick), the default answer will remain unchanged
1633 and you will be prompted again.
1635 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1636 the questions and use the computed defaults (or the previous answers if there
1637 was already a config.sh file). Type 'Configure -h' for a list of options.
1638 You may also start interactively and then answer '& -d' at any prompt to turn
1639 on the non-interactive behaviour for the remainder of the execution.
1645 Much effort has been expended to ensure that this shell script will run on any
1646 Unix system. If despite that it blows up on yours, your best bet is to edit
1647 Configure and run it again. If you can't run Configure for some reason,
1648 you'll have to generate a config.sh file by hand. Whatever problems you
1649 have, let me (jhi@iki.fi) know how I blew it.
1651 This installation script affects things in two ways:
1653 1) it may do direct variable substitutions on some of the files included
1655 2) it builds a config.h file for inclusion in C programs. You may edit
1656 any of these files as the need arises after running this script.
1658 If you make a mistake on a question, there is no easy way to back up to it
1659 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1660 files. Configure will offer to let you do this before it runs the SH files.
1663 dflt='Type carriage return to continue'
1665 case "$firsttime" in
1666 true) echo $user >>../.config/instruct;;
1670 : find out where common programs are
1672 echo "Locating common programs..." >&4
1685 if test -d \$dir/\$thing; then
1691 for thisthing in \$dir/\$thing; do
1692 : just loop through to pick last item
1694 if test -f \$thisthing; then
1697 elif test -f \$dir/\$thing.exe; then
1698 if test -n "$DJGPP"; then
1699 echo \$dir/\$thing.exe
1701 : on Eunice apparently
1752 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1753 pth="$pth /lib /usr/lib"
1754 for file in $loclist; do
1758 if test -f "$xxx"; then
1761 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1762 xxx=`./loc $file $file $pth`
1765 '') xxx=`./loc $file $file $pth`;;
1766 *) xxx=`./loc $xxx $xxx $pth`;;
1772 echo $file is in $xxx.
1775 echo $file is in $xxx.
1778 echo "I don't know where '$file' is, and my life depends on it." >&4
1779 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1785 echo "Don't worry if any of the following aren't found..."
1787 for file in $trylist; do
1791 if test -f "$xxx"; then
1794 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1795 xxx=`./loc $file $file $pth`
1798 '') xxx=`./loc $file $file $pth`;;
1799 *) xxx=`./loc $xxx $xxx $pth`;;
1805 echo $file is in $xxx.
1808 echo $file is in $xxx.
1811 echo "I don't see $file out there, $say."
1818 echo "Substituting grep for egrep."
1824 echo "Substituting cp for ln."
1830 echo "Hopefully test is built into your sh."
1833 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1834 echo "Using the test built into your sh."
1842 echo "Hopefully echo is built into your sh."
1847 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1848 $echo $n "hi there$c" >foo1
1849 echo $n "hi there$c" >foo2
1850 if cmp foo1 foo2 >/dev/null 2>&1; then
1851 echo "They are compatible. In fact, they may be identical."
1858 They are not compatible! You are probably running ksh on a non-USG system.
1859 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1860 have echo built in and we may have to run some Bourne shell scripts. That
1861 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1864 $echo $n "The star should be here-->$c"
1871 : determine whether symbolic links are supported
1874 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1875 echo "Symbolic links are supported." >&4
1878 echo "Symbolic links are NOT supported." >&4
1883 : see whether [:lower:] and [:upper:] are supported character classes
1885 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1887 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1891 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1892 # (0xc9 and 0xd1), therefore that is a nice testing point.
1893 if test "X$up" = X -o "X$low" = X; then
1894 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1900 if test "X$up" = X -o "X$low" = X; then
1901 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1907 if test "X$up" = X -o "X$low" = X; then
1908 case "`echo IJ | od -x 2>/dev/null`" in
1910 echo "Hey, this might be EBCDIC." >&4
1911 if test "X$up" = X -o "X$low" = X; then
1912 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1913 ij) up='[A-IJ-RS-Z]'
1918 if test "X$up" = X -o "X$low" = X; then
1919 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1929 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
1931 echo "Using $up and $low to convert case." >&4
1934 echo "I don't know how to translate letters from upper to lower case." >&4
1935 echo "Your tr is not acting any way I know of." >&4
1939 : set up the translation script tr, must be called with ./tr of course
1943 '[A-Z][a-z]') exec $tr '$up' '$low';;
1944 '[a-z][A-Z]') exec $tr '$low' '$up';;
1951 : Try to determine whether config.sh was made on this system
1952 case "$config_sh" in
1954 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1955 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
1956 # because the A-Z/a-z are not consecutive.
1957 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1958 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1959 newmyuname="$myuname"
1961 case "$knowitall" in
1963 if test -f ../config.sh; then
1964 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1965 eval "`grep myuname= ../config.sh`"
1967 if test "X$myuname" = "X$newmyuname"; then
1975 : Get old answers from old config file if Configure was run on the
1976 : same system, otherwise use the hints.
1979 if test -f config.sh; then
1981 rp="I see a config.sh file. Shall I use it to set the defaults?"
1984 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1985 *) echo "Fetching default answers from your old config.sh file..." >&4
1993 : Older versions did not always set $sh. Catch re-use of such
2002 if test ! -f config.sh; then
2005 First time through, eh? I have some defaults handy for some systems
2006 that need some extra help getting the Configure answers right:
2009 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2011 : Half the following guesses are probably wrong... If you have better
2012 : tests or hints, please send them to jhi@iki.fi
2013 : The metaconfig authors would also appreciate a copy...
2014 $test -f /irix && osname=irix
2015 $test -f /xenix && osname=sco_xenix
2016 $test -f /dynix && osname=dynix
2017 $test -f /dnix && osname=dnix
2018 $test -f /lynx.os && osname=lynxos
2019 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2020 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2021 $test -f /bin/mips && /bin/mips && osname=mips
2022 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2023 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2024 $test -d /usr/apollo/bin && osname=apollo
2025 $test -f /etc/saf/_sactab && osname=svr4
2026 $test -d /usr/include/minix && osname=minix
2027 if $test -d /MachTen -o -d /MachTen_Folder; then
2029 if $test -x /sbin/version; then
2030 osvers=`/sbin/version | $awk '{print $2}' |
2031 $sed -e 's/[A-Za-z]$//'`
2032 elif $test -x /usr/etc/version; then
2033 osvers=`/usr/etc/version | $awk '{print $2}' |
2034 $sed -e 's/[A-Za-z]$//'`
2039 $test -f /sys/posix.dll &&
2040 $test -f /usr/bin/what &&
2041 set X `/usr/bin/what /sys/posix.dll` &&
2042 $test "$3" = UWIN &&
2045 if $test -f $uname; then
2053 umips) osname=umips ;;
2056 [23]100) osname=mips ;;
2057 next*) osname=next ;;
2059 if $test -f /etc/kconfig; then
2061 if test "$lns" = "ln -s"; then
2063 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2065 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2071 if test -n "$DJGPP"; then
2080 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2082 'not found') osvers="$4"."$3" ;;
2083 '<3240'|'<>3240') osvers=3.2.0 ;;
2084 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2085 '=3250'|'>3250') osvers=3.2.5 ;;
2089 *dc.osx) osname=dcosx
2095 domainos) osname=apollo
2101 dynixptx*) osname=dynixptx
2102 osvers=`echo "$4"|sed 's/^v//'`
2104 freebsd) osname=freebsd
2106 genix) osname=genix ;;
2108 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2124 netbsd*) osname=netbsd
2127 news-os) osvers="$3"
2129 4*) osname=newsos4 ;;
2133 bsd386) osname=bsd386
2136 POSIX-BC | posix-bc ) osname=posix-bc
2139 powerux | power_ux | powermax_os | powermaxos | \
2140 powerunix | power_unix) osname=powerux
2143 next*) osname=next ;;
2144 solaris) osname=solaris
2146 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2153 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2157 titanos) osname=titanos
2166 ultrix) osname=ultrix
2169 osf1|mls+) case "$5" in
2172 osvers=`echo "$3" | sed 's/^[xvt]//'`
2174 hp*) osname=hp_osf1 ;;
2175 mips) osname=mips_osf1 ;;
2184 $2) case "$osname" in
2188 : svr4.x or possibly later
2198 if test -f /stand/boot ; then
2199 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2200 if test -n "$INITPROG" -a -f "$INITPROG"; then
2201 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2202 if test -n "$isesix"; then
2210 *) if test -f /etc/systemid; then
2212 set `echo $3 | $sed 's/\./ /g'` $4
2213 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2215 elif $test -f $src/hints/sco_$1_$2.sh; then
2217 elif $test -f $src/hints/sco_$1.sh; then
2222 '') : Still unknown. Probably a generic Sys V.
2231 *) case "$osname" in
2232 '') : Still unknown. Probably a generic BSD.
2240 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2241 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2242 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2245 $rm -f UU/kernel.what
2246 elif test -d c:/.; then
2253 : Now look for a hint file osname_osvers, unless one has been
2254 : specified already.
2257 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2258 : Also try without trailing minor version numbers.
2259 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2260 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2261 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2262 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2265 *) case "$osvers" in
2268 *) if $test -f $src/hints/$file.sh ; then
2270 elif $test -f $src/hints/$xfile.sh ; then
2272 elif $test -f $src/hints/$xxfile.sh ; then
2274 elif $test -f $src/hints/$xxxfile.sh ; then
2276 elif $test -f $src/hints/$xxxxfile.sh ; then
2278 elif $test -f "$src/hints/${osname}.sh" ; then
2287 if $test -f Policy.sh ; then
2290 none) dflt="Policy" ;;
2291 *) dflt="Policy $dflt" ;;
2296 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2300 if $test -f Policy.sh ; then
2303 There's also a Policy hint file available, which should make the
2304 site-specific (policy) questions easier to answer.
2311 You may give one or more space-separated answers, or "none" if appropriate.
2312 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2313 is a good thing. DO NOT give a wrong version.
2317 rp="Which of these apply, if any?"
2320 for file in $tans; do
2321 if $test X$file = XPolicy -a -f Policy.sh; then
2323 $cat Policy.sh >> UU/config.sh
2324 elif $test -f $src/hints/$file.sh; then
2325 . $src/hints/$file.sh
2326 $cat $src/hints/$file.sh >> UU/config.sh
2327 elif $test X$tans = X -o X$tans = Xnone ; then
2330 : Give one chance to correct a possible typo.
2331 echo "$file.sh does not exist"
2333 rp="hint to use instead?"
2335 for file in $ans; do
2336 if $test -f "$src/hints/$file.sh"; then
2337 . $src/hints/$file.sh
2338 $cat $src/hints/$file.sh >> UU/config.sh
2339 elif $test X$ans = X -o X$ans = Xnone ; then
2342 echo "$file.sh does not exist -- ignored."
2349 : Remember our hint file for later.
2350 if $test -f "$src/hints/$file.sh" ; then
2360 echo "Fetching default answers from $config_sh..." >&4
2364 cp $config_sh config.sh 2>/dev/null
2374 test "$override" && . ./optdef.sh
2375 myuname="$newmyuname"
2377 : Restore computed paths
2378 for file in $loclist $trylist; do
2379 eval $file="\$_$file"
2384 Configure uses the operating system name and version to set some defaults.
2385 The default value is probably right if the name rings a bell. Otherwise,
2386 since spelling matters for me, either accept the default or answer "none"
2393 ''|' '|none) dflt=none ;;
2394 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2397 *) dflt="$osname" ;;
2399 rp="Operating system name?"
2403 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2409 ''|' '|none) dflt=none ;;
2410 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2411 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2413 ''|' ') dflt=none ;;
2418 *) dflt="$osvers" ;;
2420 rp="Operating system version?"
2427 : who configured the system
2428 cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
2429 cf_by=`(logname) 2>/dev/null`
2432 cf_by=`(whoami) 2>/dev/null`
2434 "") cf_by=unknown ;;
2438 : set up the script used to warn in case of inconsistency
2445 echo "*** WHOA THERE!!! ***" >&4
2446 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2447 rp=" Keep the $hint value?"
2450 y) td=$was; tu=$was;;
2454 : function used to set $1 to $val
2455 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2457 $define$undef) . ./whoa; eval "$var=\$td";;
2458 $undef$define) . ./whoa; eval "$var=\$tu";;
2459 *) eval "$var=$val";;
2462 : Look for a hint-file generated 'call-back-unit'. If the
2463 : user has specified that a threading perl is to be built,
2464 : we may need to set or change some other defaults.
2465 case "$usethreads" in
2467 if $test -f usethreads.cbu; then
2472 case "$d_oldpthreads" in
2473 '') : Configure tests would be welcome here. For now, assume undef.
2475 *) val="$d_oldpthreads" ;;
2480 case "$usemultiplicity" in
2481 $define|true|[yY]*) usemultiplicity="$define" ;;
2482 *) usemultiplicity="$undef" ;;
2484 case "$use64bits" in
2485 $define|true|[yY]*) use64bits="$define" ;;
2486 *) use64bits="$undef" ;;
2491 : determine the architecture name
2493 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2494 tarch=`arch`"-$osname"
2495 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2496 if uname -m > tmparch 2>&1 ; then
2497 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2498 -e 's/$/'"-$osname/" tmparch`
2506 case "$myarchname" in
2509 echo "(Your architecture name used to be $myarchname.)"
2516 *) dflt="$archname";;
2518 rp='What is your architecture name'
2521 case "$usethreads" in
2523 echo "Threads selected." >&4
2525 *-thread*) echo "...and architecture name already has -thread." >&4
2527 *) archname="$archname-thread"
2528 echo "...setting architecture name to $archname." >&4
2533 case "$usemultiplicity" in
2535 echo "Multiplicity selected." >&4
2537 *-multi*) echo "...and architecture name already has -multi." >&4
2539 *) archname="$archname-multi"
2540 echo "...setting architecture name to $archname." >&4
2545 case "$use64bits" in
2547 echo "Explicit 64-bitness selected." >&4
2548 case "$archname64" in
2553 *-$archname64*) echo "...and architecture name already has $archname64." >&4
2555 *) archname="$archname-$archname64"
2556 echo "...setting architecture name to $archname." >&4
2566 $define|true) afs=true ;;
2567 $undef|false) afs=false ;;
2568 *) if test -d /afs; then
2576 echo "AFS may be running... I'll be extra cautious then..." >&4
2578 echo "AFS does not seem to be running..." >&4
2581 : decide how portable to be. Allow command line overrides.
2582 case "$d_portable" in
2584 *) d_portable="$define" ;;
2587 : set up shell script to do ~ expansion
2593 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2596 if $test -f /bin/csh; then
2597 /bin/csh -f -c "glob \$1"
2602 name=\`$expr x\$1 : '..\([^/]*\)'\`
2603 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2604 if $test ! -d "\$dir"; then
2606 echo "\$me: can't locate home directory for: \$name" >&2
2611 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2627 : now set up to get a file name
2631 cat <<'EOSC' >>getfile
2644 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2645 fn=`echo $fn | sed 's/(.*)//'`
2651 loc_file=`expr $fn : '.*:\(.*\)'`
2652 fn=`expr $fn : '\(.*\):.*'`
2660 */*) fullpath=true;;
2669 *e*) exp_file=true;;
2672 *p*) nopath_ok=true;;
2677 *d*) type='Directory';;
2678 *l*) type='Locate';;
2683 Locate) what='File';;
2688 case "$d_portable" in
2696 while test "$type"; do
2701 true) rp="$rp (~name ok)";;
2704 if test -f UU/getfile.ok && \
2705 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2724 value=`UU/filexp $ans`
2727 if test "$ans" != "$value"; then
2728 echo "(That expands to $value on this system.)"
2742 /*) value="$ansexp" ;;
2747 echo "I shall only accept a full path name, as in /bin/ls." >&4
2748 echo "Use a ! shell escape if you wish to check pathnames." >&4
2751 echo "Please give a full path name, starting with slash." >&4
2754 echo "Note that using ~name is ok provided it expands well." >&4
2767 if test -f "$ansexp"; then
2769 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2771 echo "($value is not a plain file, but that's ok.)"
2776 if test -d "$ansexp"; then
2781 if test -d "$ansexp"; then
2782 echo "(Looking for $loc_file in directory $value.)"
2783 value="$value/$loc_file"
2784 ansexp="$ansexp/$loc_file"
2786 if test -f "$ansexp"; then
2789 case "$nopath_ok" in
2790 true) case "$value" in
2792 *) echo "Assuming $value will be in people's path."
2808 if test "$fastread" = yes; then
2813 rp="$what $value doesn't exist. Use that name anyway?"
2834 : determine root of directory hierarchy where package will be installed.
2837 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2845 By default, $package will be installed in $dflt/bin, manual
2846 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2847 all installation directories. Typically set to /usr/local, but you
2848 may choose /usr if you wish to install $package among your system
2849 binaries. If you wish to have binaries under /bin but manual pages
2850 under /usr/local/man, that's ok: you will be prompted separately
2851 for each of the installation directories, the prefix being only used
2852 to set the defaults.
2856 rp='Installation prefix to use?'
2864 *) oldprefix="$prefix";;
2871 : set the prefixit variable, to compute a suitable default value
2872 prefixit='case "$3" in
2874 case "$oldprefix" in
2875 "") eval "$1=\"\$$2\"";;
2882 ""|" ") eval "$1=\"\$$2\"";;
2888 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2890 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2891 /*-$oldprefix/*|\~*-$oldprefix/*)
2892 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2893 *) eval "$1=\"\$$2\"";;
2897 : set the base revision
2900 : get the patchlevel
2902 echo "Getting the current patchlevel..." >&4
2903 if $test -r $rsrc/patchlevel.h;then
2904 patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
2905 subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
2910 $echo $n "(You have $package" $c
2913 *) $echo $n " $baserev" $c ;;
2915 $echo $n " patchlevel $patchlevel" $c
2916 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
2919 if test 0 -eq "$subversion"; then
2920 version=`LC_ALL=C; export LC_ALL; \
2921 echo $baserev $patchlevel | \
2922 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2924 version=`LC_ALL=C; export LC_ALL; \
2925 echo $baserev $patchlevel $subversion | \
2926 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
2928 : Figure out perl API version. Perhaps this should be in patchlevel.h
2929 if test "$subversion" -lt 50; then
2930 apiversion=`LC_ALL=C; export LC_ALL; \
2931 echo $baserev $patchlevel | \
2932 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2934 apiversion="$version"
2937 : determine where private library files go
2938 : Usual default is /usr/local/lib/perl5/$version.
2939 : Also allow things like /opt/perl/lib/$version, since
2940 : /opt/perl/lib/perl5... would be redundant.
2942 *perl*) set dflt privlib lib/$version ;;
2943 *) set dflt privlib lib/$package/$version ;;
2948 There are some auxiliary files for $package that need to be put into a
2949 private library directory that is accessible by everyone.
2953 rp='Pathname where the private library files will reside?'
2955 if $test "X$privlibexp" != "X$ansexp"; then
2959 privlibexp="$ansexp"
2963 Since you are running AFS, I need to distinguish the directory in which
2964 private files reside from the directory in which they are installed (and from
2965 which they are presumably copied to the former directory by occult means).
2968 case "$installprivlib" in
2969 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2970 *) dflt="$installprivlib";;
2973 rp='Where will private files be installed?'
2975 installprivlib="$ans"
2977 installprivlib="$privlibexp"
2980 : set the prefixup variable, to restore leading tilda escape
2981 prefixup='case "$prefixexp" in
2983 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2986 : determine where public architecture dependent libraries go
2989 : privlib default is /usr/local/lib/$package/$version
2990 : archlib default is /usr/local/lib/$package/$version/$archname
2991 : privlib may have an optional trailing /share.
2992 tdflt=`echo $privlib | $sed 's,/share$,,'`
2993 tdflt=$tdflt/$archname
3002 $spackage contains architecture-dependent library files. If you are
3003 sharing libraries in a heterogeneous environment, you might store
3004 these files in a separate location. Otherwise, you can just include
3005 them with the rest of the public library files.
3009 rp='Where do you want to put the public architecture-dependent libraries?'
3012 archlibexp="$ansexp"
3017 Since you are running AFS, I need to distinguish the directory in
3018 which architecture-dependent library files reside from the directory
3019 in which they are installed (and from which they are presumably copied
3020 to the former directory by occult means).
3023 case "$installarchlib" in
3024 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
3025 *) dflt="$installarchlib";;
3028 rp='Where will architecture-dependent library files be installed?'
3030 installarchlib="$ans"
3032 installarchlib="$archlibexp"
3034 if $test X"$archlib" = X"$privlib"; then
3040 : make some quick guesses about what we are up against
3042 $echo $n "Hmm... $c"
3052 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3053 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3055 echo "Looks kind of like an OSF/1 system, but we'll see..."
3057 elif test `echo abc | tr a-z A-Z` = Abc ; then
3058 xxx=`./loc addbib blurfl $pth`
3059 if $test -f $xxx; then
3060 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3064 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3065 echo "Looks kind of like an extended USG system, but we'll see..."
3067 echo "Looks kind of like a USG system, but we'll see..."
3071 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3072 echo "Looks kind of like a BSD system, but we'll see..."
3076 echo "Looks kind of like a Version 7 system, but we'll see..."
3079 case "$eunicefix" in
3082 There is, however, a strange, musty smell in the air that reminds me of
3083 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3087 : it so happens the Eunice I know will not run shell scripts in Unix format
3091 echo "Congratulations. You aren't running Eunice."
3095 : Detect OS2. The p_ variable is set above in the Head.U unit.
3100 I have the feeling something is not exactly right, however...don't tell me...
3101 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3106 if test -f /xenix; then
3107 echo "Actually, this looks more like a XENIX system..."
3112 echo "It's not Xenix..."
3117 if test -f /venix; then
3118 echo "Actually, this looks more like a VENIX system..."
3125 echo "Nor is it Venix..."
3128 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3129 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3132 : see if setuid scripts can be secure
3135 Some kernels have a bug that prevents setuid #! scripts from being
3136 secure. Some sites have disabled setuid #! scripts because of this.
3138 First let's decide if your kernel supports secure setuid #! scripts.
3139 (If setuid #! scripts would be secure but have been disabled anyway,
3140 don't say that they are secure if asked.)
3145 if $test -d /dev/fd; then
3146 echo "#!$ls" >reflect
3147 chmod +x,u+s reflect
3148 ./reflect >flect 2>&1
3149 if $contains "/dev/fd" flect >/dev/null; then
3150 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3154 If you are not sure if they are secure, I can check but I'll need a
3155 username and password different from the one you are using right now.
3156 If you don't have such a username or don't want me to test, simply
3160 rp='Other username to test security of setuid scripts with?'
3165 case "$d_suidsafe" in
3166 '') echo "I'll assume setuid scripts are *not* secure." >&4
3169 echo "Well, the $hint value is *not* secure." >&4
3171 *) echo "Well, the $hint value *is* secure." >&4
3176 $rm -f reflect flect
3177 echo "#!$ls" >reflect
3178 chmod +x,u+s reflect
3181 echo '"su" will (probably) prompt you for '"$ans's password."
3182 su $ans -c './reflect >flect'
3183 if $contains "/dev/fd" flect >/dev/null; then
3184 echo "Okay, it looks like setuid scripts are secure." >&4
3187 echo "I don't think setuid scripts are secure." >&4
3192 rp='Does your kernel have *secure* setuid scripts?'
3195 [yY]*) val="$define";;
3200 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3201 echo "(That's for file descriptors, not floppy disks.)"
3207 $rm -f reflect flect
3209 : now see if they want to do setuid emulation
3212 case "$d_suidsafe" in
3215 echo "No need to emulate SUID scripts since they are secure here." >& 4
3219 Some systems have disabled setuid scripts, especially systems where
3220 setuid scripts cannot be secure. On systems where setuid scripts have
3221 been disabled, the setuid/setgid bits on scripts are currently
3222 useless. It is possible for $package to detect those bits and emulate
3223 setuid/setgid in a secure fashion. This emulation will only work if
3224 setuid scripts have been disabled in your kernel.
3228 "$define") dflt=y ;;
3231 rp="Do you want to do setuid/setgid emulation?"
3234 [yY]*) val="$define";;
3242 : determine where manual pages are on this system
3246 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3247 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3248 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3249 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3250 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3251 sysman=`./loc . /usr/man/man1 $syspath`
3254 if $test -d "$sysman"; then
3255 echo "System manual is in $sysman." >&4
3257 echo "Could not find manual pages in source form." >&4
3260 : see what memory models we can support
3263 $cat >pdp11.c <<'EOP'
3272 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3273 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3274 dflt='unsplit split'
3276 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3279 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3284 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3287 if $test -d /lib/large || $test -d /usr/lib/large; then
3290 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3299 Some systems have different model sizes. On most systems they are called
3300 small, medium, large, and huge. On the PDP11 they are called unsplit and
3301 split. If your system doesn't support different memory models, say "none".
3302 If you wish to force everything to one memory model, say "none" here and
3303 put the appropriate flags later when it asks you for other cc and ld flags.
3304 Venix systems may wish to put "none" and let the compiler figure things out.
3305 (In the following question multiple model names should be space separated.)
3307 The default for most systems is "none".
3310 rp="Which memory models are supported?"
3325 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3326 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3333 rp="What flag indicates separate I and D space?"
3341 *large*|*small*|*medium*|*huge*)
3348 rp="What flag indicates large model?"
3358 *huge*) case "$huge" in
3362 rp="What flag indicates huge model?"
3372 *medium*) case "$medium" in
3376 rp="What flag indicates medium model?"
3383 *) medium="$large";;
3386 *small*) case "$small" in
3390 rp="What flag indicates small model?"
3401 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3404 $rm -f pdp11.* pdp11
3406 : see if we need a special compiler
3414 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3415 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3429 On some older systems the default C compiler will not resolve multiple global
3430 references that happen to have the same name. On some such systems the "Mcc"
3431 command may be used to force these to be resolved. On other systems a "cc -M"
3432 command is required. (Note that the -M flag on other systems indicates a
3433 memory model to use!) If you have the Gnu C compiler, you might wish to use
3439 rp="Use which C compiler?"
3447 rp="Use which C compiler?"
3451 : Look for a hint-file generated 'call-back-unit'. Now that the
3452 : user has specified the compiler, we may need to set or change some
3454 if $test -f cc.cbu; then
3458 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3459 $cat >gccvers.c <<EOM
3464 printf("%s\n", __VERSION__);
3466 printf("%s\n", "1");
3472 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3473 gccversion=`./gccvers`
3474 case "$gccversion" in
3475 '') echo "You are not using GNU cc." ;;
3476 *) echo "You are using GNU cc $gccversion." ;;
3480 echo "*** WHOA THERE!!! ***" >&4
3481 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3482 case "$knowitall" in
3484 echo " You'd better start hunting for one and let me know about it." >&4
3490 case "$gccversion" in
3491 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3494 : What should the include directory be ?
3496 $echo $n "Hmm... $c"
3500 if $test -f /bin/mips && /bin/mips; then
3501 echo "Looks like a MIPS system..."
3502 $cat >usr.c <<'EOCP'
3503 #ifdef SYSTYPE_BSD43
3507 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3508 dflt='/bsd43/usr/include'
3512 mips_type='System V'
3514 $rm -f usr.c usr.out
3515 echo "and you're compiling with the $mips_type compiler and libraries."
3519 echo "Doesn't look like a MIPS system."
3529 case "$xxx_prompt" in
3532 rp='Where are the include files you want to use?'
3540 : see how we invoke the C preprocessor
3542 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3543 cat <<'EOT' >testcpp.c
3549 if test ! -f cppstdin; then
3550 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3552 echo "Keeping your $hint cppstdin wrapper."
3555 wrapper=`pwd`/cppstdin
3559 if $test "X$cppstdin" != "X" && \
3560 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3561 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3563 echo "You used to use $cppstdin $cppminus so we'll use that again."
3565 '') echo "But let's see if we can live without a wrapper..." ;;
3567 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3568 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3570 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3573 echo "(However, $cpprun $cpplast does not work, let's see...)"
3581 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3588 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3589 $cc -E <testcpp.c >testcpp.out 2>&1; \
3590 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3591 echo "Yup, it does."
3594 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3595 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3596 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3597 echo "Yup, it does."
3600 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3601 $cc -P <testcpp.c >testcpp.out 2>&1; \
3602 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3603 echo "Yipee, that works!"
3606 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3607 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3608 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3609 echo "At long last!"
3612 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3613 $cpp <testcpp.c >testcpp.out 2>&1; \
3614 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3618 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3619 $cpp - <testcpp.c >testcpp.out 2>&1; \
3620 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3621 echo "Hooray, it works! I was beginning to wonder."
3624 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3625 $wrapper <testcpp.c >testcpp.out 2>&1; \
3626 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3632 rp="No dice. I can't find a C preprocessor. Name one:"
3636 $x_cpp <testcpp.c >testcpp.out 2>&1
3637 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3638 echo "OK, that will do." >&4
3640 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3655 echo "Perhaps can we force $cc -E using a wrapper..."
3656 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3657 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3663 echo "Nope, we'll have to live without it..."
3678 *) $rm -f $wrapper;;
3680 $rm -f testcpp.c testcpp.out
3682 : Set private lib path
3685 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3690 '') dlist="$loclibpth $plibpth $glibpth";;
3691 *) dlist="$libpth";;
3694 : Now check and see which directories actually exist, avoiding duplicates
3698 if $test -d $xxx; then
3701 *) libpth="$libpth $xxx";;
3707 Some systems have incompatible or broken versions of libraries. Among
3708 the directories listed in the question below, please remove any you
3709 know not to be holding relevant libraries, and add any that are needed.
3710 Say "none" for none.
3721 rp="Directories to use for library searches?"
3728 : compute shared library extension
3731 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3741 On some systems, shared libraries may be available. Answer 'none' if
3742 you want to suppress searching of shared libraries for the remaining
3743 of this configuration.
3746 rp='What is the file extension used for shared libraries?'
3750 : Define several unixisms.
3751 : Hints files or command line option can be used to override them.
3752 : The convoluted testing is in case hints files set either the old
3755 '') case "$exe_ext" in
3757 *) _exe="$exe_ext" ;;
3762 '') case "$lib_ext" in
3769 '') case "$obj_ext" in
3776 '') case "$path_sep" in
3787 : Which makefile gets called first. This is used by make depend.
3788 case "$firstmakefile" in
3789 '') firstmakefile='makefile';;
3792 : Looking for optional libraries
3794 echo "Checking for optional libraries..." >&4
3799 case "$libswanted" in
3800 '') libswanted='c_s';;
3802 for thislib in $libswanted; do
3804 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3805 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3806 echo "Found -l$thislib (shared)."
3809 *) dflt="$dflt -l$thislib";;
3811 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3812 echo "Found -l$thislib (shared)."
3815 *) dflt="$dflt -l$thislib";;
3817 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3818 echo "Found -l$thislib."
3821 *) dflt="$dflt -l$thislib";;
3823 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3824 echo "Found -l$thislib."
3827 *) dflt="$dflt -l$thislib";;
3829 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3830 echo "Found -l${thislib}_s."
3833 *) dflt="$dflt -l${thislib}_s";;
3835 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3836 echo "Found -l$thislib."
3839 *) dflt="$dflt -l$thislib";;
3842 echo "No -l$thislib."
3853 ' '|'') dflt='none';;
3858 Some versions of Unix support shared libraries, which make executables smaller
3859 but make load time slightly longer.
3861 On some systems, mostly System V Release 3's, the shared library is included
3862 by putting the option "-lc_s" as the last thing on the cc command line when
3863 linking. Other systems use shared libraries by default. There may be other
3864 libraries needed to compile $package on your machine as well. If your system
3865 needs the "-lc_s" option, include it here. Include any other special libraries
3866 here as well. Say "none" for none.
3870 rp="Any additional libraries?"
3877 : determine optimize, if desired, or use for debug flag also
3879 ' '|$undef) dflt='none';;
3881 *) dflt="$optimize";;
3885 Some C compilers have problems with their optimizers. By default, $package
3886 compiles with the -O flag to use the optimizer. Alternately, you might want
3887 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3888 systems). Either flag can be specified here. To use neither flag, specify
3892 rp="What optimizer/debugger flag should be used?"
3896 'none') optimize=" ";;
3900 : We will not override a previous value, but we might want to
3901 : augment a hint file
3904 case "$gccversion" in
3905 1*) dflt='-fpcc-struct-return' ;;
3908 *-g*) dflt="$dflt -DDEBUGGING";;
3910 case "$gccversion" in
3911 2*) if test -d /etc/conf/kconfig.d &&
3912 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3921 case "$mips_type" in
3922 *BSD*|'') inclwanted="$locincpth $usrinc";;
3923 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3925 for thisincl in $inclwanted; do
3926 if $test -d $thisincl; then
3927 if $test x$thisincl != x$usrinc; then
3930 *) dflt="$dflt -I$thisincl";;
3936 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3938 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3946 *) dflt="$dflt -D$2";;
3951 set signal.h __LANGUAGE_C__; eval $inctest
3953 set signal.h LANGUAGE_C; eval $inctest
3957 none|recommended) dflt="$ccflags $dflt" ;;
3958 *) dflt="$ccflags";;
3966 Your C compiler may want other flags. For this question you should include
3967 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3968 but you should NOT include libraries or ld flags like -lwhatever. If you
3969 want $package to honor its debug switch, you should include -DDEBUGGING here.
3970 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3972 To use no flags, specify the word "none".
3978 rp="Any additional cc flags?"
3985 : the following weeds options from ccflags that are of no interest to cpp
3987 case "$gccversion" in
3988 1*) cppflags="$cppflags -D__GNUC__"
3990 case "$mips_type" in
3992 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3998 echo "Let me guess what the preprocessor flags are..." >&4
4012 *) ftry="$previous $flag";;
4014 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4015 >cpp1.out 2>/dev/null && \
4016 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4017 >cpp2.out 2>/dev/null && \
4018 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4019 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4021 cppflags="$cppflags $ftry"
4031 *-*) echo "They appear to be: $cppflags";;
4033 $rm -f cpp.c cpp?.out
4037 : flags used in final linking phase
4039 '') if ./venix; then
4045 *-posix*) dflt="$dflt -posix" ;;
4048 *) dflt="$ldflags";;
4051 : Try to guess additional flags to pick up local libraries.
4052 for thislibdir in $libpth; do
4053 case " $loclibpth " in
4056 *"-L$thislibdir "*) ;;
4057 *) dflt="$dflt -L$thislibdir" ;;
4069 Your C linker may need flags. For this question you should
4070 include -L/whatever and any other flags used by the C linker, but you
4071 should NOT include libraries like -lwhatever.
4073 Make sure you include the appropriate -L/path flags if your C linker
4074 does not normally search all of the directories you specified above,
4077 To use no flags, specify the word "none".
4081 rp="Any additional ld flags (NOT including libraries)?"
4087 rmlist="$rmlist pdp11"
4091 echo "Checking your choice of C compiler and flags for coherency..." >&4
4092 $cat > try.c <<'EOF'
4094 main() { printf("Ok\n"); exit(0); }
4096 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4098 $cat >try.msg <<'EOM'
4099 I've tried to compile and run the following simple program:
4102 $cat try.c >> try.msg
4104 $cat >> try.msg <<EOM
4111 and I got the following output:
4115 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4116 if sh -c './try' >>try.msg 2>&1; then
4120 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4123 cat >> try.msg <<'EOQS'
4124 If $libs contains -lsfio, and sfio is mis-configured, then it
4125 sometimes (apparently) runs and exits with a 0 status, but with no
4126 output! It may have to do with sfio's use of _exit vs. exit.
4129 rp="You have a big problem. Shall I abort Configure"
4136 echo "The program compiled OK, but exited with status $?." >>try.msg
4137 rp="You have a problem. Shall I abort Configure"
4141 echo "I can't compile the test program." >>try.msg
4142 rp="You have a BIG problem. Shall I abort Configure"
4148 case "$knowitall" in
4150 echo "(The supplied flags or libraries might be incorrect.)"
4158 *) echo "Ok. Stopping Configure." >&4
4163 n) echo "OK, that should do.";;
4165 $rm -f try try.* core
4167 : determine filename position in cpp output
4169 echo "Computing filename position in cpp output for #include directives..." >&4
4170 echo '#include <stdio.h>' > foo.c
4173 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4174 $grep '^[ ]*#.*stdio\.h' | \
4175 while read cline; do
4178 while $test \$# -gt 0; do
4179 if $test -r \`echo \$1 | $tr -d '"'\`; then
4184 pos=\`expr \$pos + 1\`
4196 *) pos="${fieldn}th";;
4198 echo "Your cpp writes the filename in the $pos field of the line."
4200 : locate header file
4205 if test -f $usrinc/\$wanted; then
4206 echo "$usrinc/\$wanted"
4209 awkprg='{ print \$$fieldn }'
4210 echo "#include <\$wanted>" > foo\$\$.c
4211 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4212 $grep "^[ ]*#.*\$wanted" | \
4213 while read cline; do
4214 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4216 */\$wanted) echo "\$name"; exit 0;;
4227 : define an alternate in-header-list? function
4228 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4229 cont=true; xxf="echo \"<\$1> found.\" >&4";
4230 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4231 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4233 case $# in 4) instead=instead;; *) instead="at last";; esac;
4234 while $test "$cont"; do
4236 var=$2; eval "was=\$$2";
4237 if $test "$xxx" && $test -r "$xxx";
4239 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4242 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4243 set $yyy; shift; shift; yyy=$@;
4244 case $# in 0) cont="";;
4245 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4246 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4247 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4248 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4252 do set $yyy; var=$2; eval "was=\$$2";
4253 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4254 set $yyy; shift; shift; yyy=$@;
4257 : see if this is a malloc.h system
4258 set malloc.h i_malloc
4261 : see if stdlib is available
4262 set stdlib.h i_stdlib
4265 : determine which malloc to compile in
4267 case "$usemymalloc" in
4268 ''|[yY]*|true|$define) dflt='y' ;;
4271 rp="Do you wish to attempt to use the malloc that comes with $package?"
4277 mallocsrc='malloc.c'
4278 mallocobj="malloc$_o"
4279 d_mymalloc="$define"
4282 : Remove malloc from list of libraries to use
4283 echo "Removing unneeded -lmalloc from library list" >&4
4284 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4287 echo "libs = $libs" >&4
4299 : compute the return types of malloc and free
4301 $cat >malloc.c <<END
4305 #include <sys/types.h>
4319 case "$malloctype" in
4321 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4328 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4332 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4339 echo "Your system uses $freetype free(), it would seem." >&4
4341 : Cruising for prototypes
4343 echo "Checking out function prototypes..." >&4
4344 $cat >prototype.c <<'EOCP'
4345 int main(int argc, char *argv[]) {
4348 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4349 echo "Your C compiler appears to support function prototypes."
4352 echo "Your C compiler doesn't seem to understand function prototypes."
4359 case "$prototype" in
4361 *) ansi2knr='ansi2knr'
4366 This version of $package can only be compiled by a compiler that
4367 understands function prototypes. Unfortunately, your C compiler
4369 doesn't seem to understand them. Sorry about that.
4371 If GNU cc is available for your system, perhaps you could try that instead.
4373 Eventually, we hope to support building Perl with pre-ANSI compilers.
4374 If you would like to help in that effort, please contact <perlbug@perl.org>.
4376 Aborting Configure now.
4382 : determine where public executables go
4387 rp='Pathname where the public executables will reside?'
4389 if $test "X$ansexp" != "X$binexp"; then
4397 Since you are running AFS, I need to distinguish the directory in which
4398 executables reside from the directory in which they are installed (and from
4399 which they are presumably copied to the former directory by occult means).
4402 case "$installbin" in
4403 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4404 *) dflt="$installbin";;
4407 rp='Where will public executables be installed?'
4411 installbin="$binexp"
4414 : define a shorthand compile call
4418 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4419 : define a shorthand compile call for compilations that should be ok.
4423 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4426 echo "Checking for GNU C Library..." >&4
4427 cat >gnulibc.c <<EOM
4439 if eval $compile_ok && ./gnulibc; then
4441 echo "You are using the GNU C Library"
4444 echo "You are not using the GNU C Library"
4450 : see if nm is to be used to determine whether a symbol is defined or not
4454 case "$d_gnulibc" in
4457 echo "nm probably won't work on the GNU C Library." >&4
4463 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4465 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4466 echo "'nm' won't be sufficient on this sytem." >&4
4472 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4473 if $test $dflt -gt 20; then
4483 true|$define) dflt=y;;
4490 I can use $nm to extract the symbols from your C libraries. This
4491 is a time consuming task which may generate huge output on the disk (up
4492 to 3 megabytes) but that should make the symbols extraction faster. The
4493 alternative is to skip the 'nm' extraction part and to compile a small
4494 test program instead to determine whether each symbol is present. If
4495 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4496 this may be the best solution.
4498 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4501 rp="Shall I use $nm to extract C symbols from the libraries?"
4504 [Nn]*) usenm=false;;
4513 : nm options which may be necessary
4515 '') if $test -f /mach_boot; then
4517 elif $test -d /usr/ccs/lib; then
4518 nm_opt='-p' # Solaris (and SunOS?)
4519 elif $test -f /dgux; then
4521 elif $test -f /lib64/rld; then
4522 nm_opt='-p' # 64-bit Irix
4528 : nm options which may be necessary for shared libraries but illegal
4529 : for archive libraries. Thank you, Linux.
4530 case "$nm_so_opt" in
4531 '') case "$myuname" in
4533 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4534 nm_so_opt='--dynamic'
4543 : get list of predefined functions in a handy place
4548 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4555 *) for thislib in $libs; do
4558 : Handle C library specially below.
4561 thislib=`echo $thislib | $sed -e 's/^-l//'`
4562 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4564 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4566 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4568 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4570 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4572 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4574 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4579 libnames="$libnames $try"
4581 *) libnames="$libnames $thislib" ;;
4590 for xxx in $libpth; do
4591 $test -r $1 || set $xxx/libc.$so
4592 : The messy sed command sorts on library version numbers.
4594 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4595 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4597 s/[0-9][0-9]*/0000&/g
4598 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4601 sort | $sed -e 's/^.* //'`
4604 $test -r $1 || set /usr/ccs/lib/libc.$so
4605 $test -r $1 || set /lib/libsys_s$_a
4611 if $test -r "$1"; then
4612 echo "Your (shared) C library seems to be in $1."
4614 elif $test -r /lib/libc && $test -r /lib/clib; then
4615 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4617 libc='/lib/clib /lib/libc'
4618 if $test -r /lib/syslib; then
4619 echo "(Your math library is in /lib/syslib.)"
4620 libc="$libc /lib/syslib"
4622 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4623 echo "Your C library seems to be in $libc, as you said before."
4624 elif $test -r $incpath/usr/lib/libc$_a; then
4625 libc=$incpath/usr/lib/libc$_a;
4626 echo "Your C library seems to be in $libc. That's fine."
4627 elif $test -r /lib/libc$_a; then
4629 echo "Your C library seems to be in $libc. You're normal."
4631 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4633 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4634 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4635 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4637 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4639 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4642 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4644 if $test -r "$tans"; then
4645 echo "Your C library seems to be in $tans, of all places."
4651 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4655 If the guess above is wrong (which it might be if you're using a strange
4656 compiler, or your machine supports multiple models), you can override it here.
4661 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4663 I can't seem to find your C library. I've looked in the following places:
4666 $sed 's/^/ /' libpath
4669 None of these seems to contain your C library. I need to get its name...
4674 rp='Where is your C library?'
4679 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4680 set X `cat libnames`
4683 case $# in 1) xxx=file; esac
4684 echo "Extracting names from the following $xxx for later perusal:" >&4
4686 $sed 's/^/ /' libnames >&4
4688 $echo $n "This may take a while...$c" >&4
4692 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4693 *) $nm $nm_opt $file 2>/dev/null;;
4698 $grep fprintf libc.tmp > libc.ptf
4699 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4700 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4702 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4704 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4706 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4708 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4710 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4712 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4714 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4716 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4718 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4720 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4722 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4724 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4726 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4727 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4729 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4731 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4733 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4735 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4737 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4739 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4741 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4743 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4745 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4747 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4749 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4751 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4753 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4756 $nm -p $* 2>/dev/null >libc.tmp
4757 $grep fprintf libc.tmp > libc.ptf
4758 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4759 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4765 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4767 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4768 for thisname in $libnames $libc; do
4769 $ar t $thisname >>libc.tmp
4771 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4773 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4774 # Repeat libc to extract forwarders to DLL entries too
4775 for thisname in $libnames $libc; do
4776 $ar tv $thisname >>libc.tmp
4777 # Revision 50 of EMX has bug in $ar.
4778 # it will not extract forwarders to DLL entries
4779 # Use emximp which will extract exactly them.
4780 emximp -o tmp.imp $thisname \
4782 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4783 < tmp.imp >>libc.tmp
4786 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4789 echo "$ar didn't seem to work right." >&4
4790 echo "Maybe this is a Cray...trying bld instead..." >&4
4791 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4793 for thisname in $libnames; do
4795 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4796 $ar t $thisname >>libc.tmp
4800 echo "That didn't work either. Giving up." >&4
4807 if $test -f /lib/syscalls.exp; then
4809 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4810 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4814 $rm -f libnames libpath
4816 : see if dld is available
4820 : is a C symbol defined?
4823 -v) tf=libc.tmp; tc=""; tdc="";;
4824 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4825 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4828 case "$reuseval-$4" in
4830 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4836 if $contains $tlook $tf >/dev/null 2>&1;
4841 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4842 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4850 $define) tval=true;;
4856 : define an is-in-libc? function
4857 inlibc='echo " "; td=$define; tu=$undef;
4858 sym=$1; var=$2; eval "was=\$$2";
4860 case "$reuseval$was" in
4870 echo "$sym() found." >&4;
4871 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4873 echo "$sym() NOT found." >&4;
4874 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4878 $define) echo "$sym() found." >&4;;
4879 *) echo "$sym() NOT found." >&4;;
4883 : see if dlopen exists
4890 : determine which dynamic loading, if any, to compile in
4892 dldir="ext/DynaLoader"
4905 $define) dflt='y' ;;
4908 $define) dflt='y' ;;
4910 : Does a dl_xxx.xs file exist for this operating system
4911 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
4914 rp="Do you wish to use dynamic loading?"
4921 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
4922 dflt="$dldir/dl_${osname}.xs"
4923 elif $test "$d_dlopen" = "$define" ; then
4924 dflt="$dldir/dl_dlopen.xs"
4925 elif $test "$i_dld" = "$define" ; then
4926 dflt="$dldir/dl_dld.xs"
4931 *) dflt="$dldir/$dlsrc"
4934 echo "The following dynamic loading files are available:"
4935 : Can not go over to $dldir because getfile has path hard-coded in.
4936 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
4937 rp="Source file to use for dynamic loading"
4939 # XXX This getfile call will fail the existence check if you try
4940 # building away from $src (this is not supported yet).
4944 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4948 Some systems may require passing special flags to $cc -c to
4949 compile modules that will be used to create a shared library.
4950 To use no flags, say "none".
4953 case "$cccdlflags" in
4954 '') case "$gccversion" in
4955 '') case "$osname" in
4957 next) dflt='none' ;;
4958 irix*) dflt='-KPIC' ;;
4959 svr4*|esix*|solaris) dflt='-KPIC' ;;
4960 sunos) dflt='-pic' ;;
4964 *) case "$osname" in
4965 svr4*|esix*|solaris) dflt='-fPIC' ;;
4970 *) dflt="$cccdlflags" ;;
4972 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4975 none) cccdlflags=' ' ;;
4976 *) cccdlflags="$ans" ;;
4981 Some systems use ld to create libraries that can be dynamically loaded,
4982 while other systems (such as those using ELF) use $cc.
4986 '') $cat >try.c <<'EOM'
4987 /* Test for whether ELF binaries are produced */
4992 int i = open("a.out",O_RDONLY);
4995 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
4996 exit(0); /* succeed (yes, it's ELF) */
5001 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5003 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5007 echo "I'll use ld to build dynamic libraries."
5016 rp="What command should be used to create dynamic libraries?"
5022 Some systems may require passing special flags to $ld to create a
5023 library that can be dynamically loaded. If your ld flags include
5024 -L/other/path options to locate libraries outside your loader's normal
5025 search path, you may need to specify those -L options here as well. To
5026 use no flags, say "none".
5029 case "$lddlflags" in
5030 '') case "$osname" in
5032 linux|irix*) dflt='-shared' ;;
5033 next) dflt='none' ;;
5034 solaris) dflt='-G' ;;
5035 sunos) dflt='-assert nodefinitions' ;;
5036 svr4*|esix*) dflt="-G $ldflags" ;;
5040 *) dflt="$lddlflags" ;;
5043 : Try to guess additional flags to pick up local libraries.
5044 : Be careful not to append to a plain 'none'
5048 for thisflag in $ldflags; do
5053 *) dflt="$dflt $thisflag" ;;
5060 ''|' ') dflt='none' ;;
5063 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5066 none) lddlflags=' ' ;;
5067 *) lddlflags="$ans" ;;
5072 Some systems may require passing special flags to $cc to indicate that
5073 the resulting executable will use dynamic linking. To use no flags,
5077 case "$ccdlflags" in
5078 '') case "$osname" in
5079 hpux) dflt='-Wl,-E' ;;
5080 linux) dflt='-rdynamic' ;;
5081 next) dflt='none' ;;
5082 sunos) dflt='none' ;;
5086 *) dflt="$ccdlflags" ;;
5088 rp="Any special flags to pass to $cc to use dynamic loading?"
5091 none) ccdlflags=' ' ;;
5092 *) ccdlflags="$ans" ;;
5106 # No dynamic loading being used, so don't bother even to prompt.
5109 *) case "$useshrplib" in
5110 '') case "$osname" in
5111 svr4*|dgux|dynixptx|esix|powerux)
5113 also='Building a shared libperl is required for dynamic loading to work on your system.'
5118 also='Building a shared libperl is needed for MAB support.'
5136 The perl executable is normally obtained by linking perlmain.c with
5137 libperl${_a}, any static extensions (usually just DynaLoader), and
5138 any other libraries needed on this system (such as -lm, etc.). Since
5139 your system supports dynamic loading, it is probably possible to build
5140 a shared libperl.$so. If you will have more than one executable linked
5141 to libperl.$so, this will significantly reduce the size of each
5142 executable, but it may have a noticeable affect on performance. The
5143 default is probably sensible for your system.
5147 rp="Build a shared libperl.$so (y/n)"
5152 # Why does next4 have to be so different?
5153 case "${osname}${osvers}" in
5154 next4*) xxx='DYLD_LIBRARY_PATH' ;;
5155 os2*) xxx='' ;; # Nothing special needed.
5156 *) xxx='LD_LIBRARY_PATH' ;;
5158 if test X"$xxx" != "X"; then
5159 $cat <<EOM | $tee -a ../config.msg >&4
5161 To build perl, you must add the current working directory to your
5162 $xxx environment variable before running make. You can do
5164 $xxx=\`pwd\`:\$$xxx; export $xxx
5165 for Bourne-style shells, or
5167 for Csh-style shells. You *MUST* do this before running make.
5172 *) useshrplib='false' ;;
5177 case "$useshrplib" in
5181 # Figure out a good name for libperl.so. Since it gets stored in
5182 # a version-specific architecture-dependent library, the version
5183 # number isn't really that important, except for making cc/ld happy.
5185 # A name such as libperl.so.3.1
5186 majmin="libperl.$so.$patchlevel.$subversion"
5187 # A name such as libperl.so.301
5188 majonly=`echo $patchlevel $subversion |
5189 $awk '{printf "%d%02d", $1, $2}'`
5190 majonly=libperl.$so.$majonly
5191 # I'd prefer to keep the os-specific stuff here to a minimum, and
5192 # rely on figuring it out from the naming of libc.
5193 case "${osname}${osvers}" in
5196 # XXX How handle the --version stuff for MAB?
5198 linux*) # ld won't link with a bare -lperl otherwise.
5201 *) # Try to guess based on whether libc has major.minor.
5203 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5204 *libc.$so.[0-9]*) dflt=$majonly ;;
5205 *) dflt=libperl.$so ;;
5215 I need to select a good name for the shared libperl. If your system uses
5216 library names with major and minor numbers, then you might want something
5217 like $majmin. Alternatively, if your system uses a single version
5218 number for shared libraries, then you might want to use $majonly.
5219 Or, your system might be quite happy with a simple libperl.$so.
5221 Since the shared libperl will get installed into a version-specific
5222 architecture-dependent directory, the version number of the shared perl
5223 library probably isn't important, so the default should be o.k.
5226 rp='What name do you want to give to the shared libperl?'
5229 echo "Ok, I'll use $libperl"
5232 libperl="libperl${_a}"
5236 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5240 WARNING: Use of the shrpdir variable for the installation location of
5241 the shared $libperl is not supported. It was never documented and
5242 will not work in this version. Let me (jhi@iki.fi)
5243 know of any problems this may cause.
5249 But your current setting of $shrpdir is
5250 the default anyway, so it's harmless.
5255 Further, your current attempted setting of $shrpdir
5256 conflicts with the value of $archlibexp/CORE
5257 that installperl will use.
5264 # How will the perl executable find the installed shared $libperl?
5265 # Add $xxx to ccdlflags.
5266 # If we can't figure out a command-line option, use $shrpenv to
5267 # set env LD_RUN_PATH. The main perl makefile uses this.
5268 shrpdir=$archlibexp/CORE
5271 if "$useshrplib"; then
5274 # We'll set it in Makefile.SH...
5280 xxx="-Wl,-R$shrpdir"
5282 linux|irix*|dec_osf)
5283 xxx="-Wl,-rpath,$shrpdir"
5286 # next doesn't like the default...
5289 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5295 # Only add $xxx if it isn't already in ccdlflags.
5296 case " $ccdlflags " in
5298 *) ccdlflags="$ccdlflags $xxx"
5301 Adding $xxx to the flags
5302 passed to $ld so that the perl executable will find the
5303 installed shared $libperl.
5311 # Respect a hint or command-line value.
5313 '') shrpenv="$tmp_shrpenv" ;;
5316 : determine where manual pages go
5317 set man1dir man1dir none
5321 $spackage has manual pages available in source form.
5325 echo "However, you don't have nroff, so they're probably useless to you."
5327 '') man1dir="none";;
5330 echo "If you don't want the manual sources installed, answer 'none'."
5335 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5336 lookpath="$lookpath $prefixexp/man/p_man/man1"
5337 lookpath="$lookpath $prefixexp/man/u_man/man1"
5338 lookpath="$lookpath $prefixexp/man/man.1"
5340 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5341 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5351 rp="Where do the main $spackage manual pages (source) go?"
5353 if $test "X$man1direxp" != "X$ansexp"; then
5357 man1direxp="$ansexp"
5365 Since you are running AFS, I need to distinguish the directory in which
5366 manual pages reside from the directory in which they are installed (and from
5367 which they are presumably copied to the former directory by occult means).
5370 case "$installman1dir" in
5371 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5372 *) dflt="$installman1dir";;
5375 rp='Where will man pages be installed?'
5377 installman1dir="$ans"
5379 installman1dir="$man1direxp"
5382 : What suffix to use on installed man pages
5389 rp="What suffix should be used for the main $spackage man pages?"
5391 '') case "$man1dir" in
5405 *) dflt="$man1ext";;
5412 : see if we can have long filenames
5414 rmlist="$rmlist /tmp/cf$$"
5415 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5416 first=123456789abcdef
5417 second=/tmp/cf$$/$first
5418 $rm -f $first $second
5419 if (echo hi >$first) 2>/dev/null; then
5420 if $test -f 123456789abcde; then
5421 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5424 if (echo hi >$second) 2>/dev/null; then
5425 if $test -f /tmp/cf$$/123456789abcde; then
5427 That's peculiar... You can have filenames longer than 14 characters, but only
5428 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5429 I shall consider your system cannot support long filenames at all.
5433 echo 'You can have filenames longer than 14 characters.' >&4
5438 How confusing! Some of your filesystems are sane enough to allow filenames
5439 longer than 14 characters but some others like /tmp can't even think about them.
5440 So, for now on, I shall assume your kernel does not allow them at all.
5447 You can't have filenames longer than 14 chars. You can't even think about them!
5453 $rm -rf /tmp/cf$$ 123456789abcde*
5455 : determine where library module manual pages go
5456 set man3dir man3dir none
5460 $spackage has manual pages for many of the library modules.
5466 However, you don't have nroff, so they're probably useless to you.
5469 '') man3dir="none";;
5473 case "$d_flexfnam" in
5476 However, your system can't handle the long file names like File::Basename.3.
5479 '') man3dir="none";;
5483 echo "If you don't want the manual sources installed, answer 'none'."
5484 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5486 '') case "$prefix" in
5487 *$prog*) dflt=`echo $man1dir |
5488 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5489 *) dflt="$privlib/man/man3" ;;
5493 *) dflt="$man3dir" ;;
5498 rp="Where do the $package library man pages (source) go?"
5500 if test "X$man3direxp" != "X$ansexp"; then
5505 man3direxp="$ansexp"
5513 Since you are running AFS, I need to distinguish the directory in which
5514 manual pages reside from the directory in which they are installed (and from
5515 which they are presumably copied to the former directory by occult means).
5518 case "$installman3dir" in
5519 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5520 *) dflt="$installman3dir";;
5523 rp='Where will man pages be installed?'
5525 installman3dir="$ans"
5527 installman3dir="$man3direxp"
5530 : What suffix to use on installed man pages
5537 rp="What suffix should be used for the $package library man pages?"
5539 '') case "$man3dir" in
5553 *) dflt="$man3ext";;
5560 : see if we have to deal with yellow pages, now NIS.
5561 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5562 if $test -f /usr/etc/nibindd; then
5564 echo "I'm fairly confident you're on a NeXT."
5566 rp='Do you get the hosts file via NetInfo?'
5575 y*) hostcat='nidump hosts .';;
5576 *) case "$hostcat" in
5577 nidump*) hostcat='';;
5587 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5595 rp='Are you getting the hosts file via yellow pages?'
5598 y*) hostcat='ypcat hosts';;
5599 *) hostcat='cat /etc/hosts';;
5605 '') hostcat='cat /etc/hosts';;
5608 '') groupcat='cat /etc/group';;
5611 '') passcat='cat /etc/passwd';;
5614 : now get the host name
5616 echo "Figuring out host name..." >&4
5617 case "$myhostname" in
5619 echo 'Maybe "hostname" will work...'
5620 if tans=`sh -c hostname 2>&1` ; then
5628 if $test "$cont"; then
5630 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5631 if tans=`cat /etc/systemid 2>&1` ; then
5633 phostname='cat /etc/systemid'
5634 echo "Whadyaknow. Xenix always was a bit strange..."
5637 elif $test -r /etc/systemid; then
5638 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5641 if $test "$cont"; then
5642 echo 'No, maybe "uuname -l" will work...'
5643 if tans=`sh -c 'uuname -l' 2>&1` ; then
5645 phostname='uuname -l'
5647 echo 'Strange. Maybe "uname -n" will work...'
5648 if tans=`sh -c 'uname -n' 2>&1` ; then
5650 phostname='uname -n'
5652 echo 'Oh well, maybe I can mine it out of whoami.h...'
5653 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5654 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5655 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5657 case "$myhostname" in
5658 '') echo "Does this machine have an identity crisis or something?"
5661 echo "Well, you said $myhostname before..."
5662 phostname='echo $myhostname';;
5668 : you do not want to know about this
5673 if $test "$myhostname" ; then
5675 rp='Your host name appears to be "'$myhostname'".'" Right?"
5683 : bad guess or no guess
5684 while $test "X$myhostname" = X ; do
5686 rp="Please type the (one word) name of your host:"
5691 : translate upper to lower if necessary
5692 case "$myhostname" in
5694 echo "(Normalizing case in your host name)"
5695 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5699 case "$myhostname" in
5701 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5702 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5703 echo "(Trimming domain name from host name--host name is now $myhostname)"
5705 *) case "$mydomain" in
5708 test "X$hostcat" = "Xypcat hosts" &&
5709 ypmatch "$myhostname" hosts 2>/dev/null |\
5710 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5713 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5714 /[ ]$myhostname[ . ]/p" > hosts
5717 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5718 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5719 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5720 hosts | $sort | $uniq | \
5721 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5722 case `$echo X$dflt` in
5723 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5726 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5731 tans=`./loc resolv.conf X /etc /usr/etc`
5732 if $test -f "$tans"; then
5733 echo "(Attempting domain name extraction from $tans)"
5734 dflt=.`$sed -n -e 's/ / /g' \
5735 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5736 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5738 .) dflt=.`$sed -n -e 's/ / /g' \
5739 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5740 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5747 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5748 dflt=.`sh -c domainname 2>/dev/null`
5751 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5756 .) echo "(Lost all hope -- silly guess then)"
5762 *) dflt="$mydomain";;
5766 rp="What is your domain name?"
5776 : translate upper to lower if necessary
5779 echo "(Normalizing case in your domain name)"
5780 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5784 : a little sanity check here
5785 case "$phostname" in
5788 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5789 $myhostname$mydomain|$myhostname) ;;
5791 case "$phostname" in
5793 echo "(That doesn't agree with your whoami.h file, by the way.)"
5796 echo "(That doesn't agree with your $phostname command, by the way.)"
5806 I need to get your e-mail address in Internet format if possible, i.e.
5807 something like user@host.domain. Please answer accurately since I have
5808 no easy means to double check it. The default value provided below
5809 is most probably close to the reality but may not be valid from outside
5810 your organization...
5814 while test "$cont"; do
5816 '') dflt="$cf_by@$myhostname$mydomain";;
5817 *) dflt="$cf_email";;
5819 rp='What is your e-mail address?'
5825 rp='Address does not look like an Internet one. Use it anyway?'
5841 If you or somebody else will be maintaining perl at your site, please
5842 fill in the correct e-mail address here so that they may be contacted
5843 if necessary. Currently, the "perlbug" program included with perl
5844 will send mail to this address in addition to perlbug@perl.com. You may
5845 enter "none" for no administrator.
5848 case "$perladmin" in
5849 '') dflt="$cf_email";;
5850 *) dflt="$perladmin";;
5852 rp='Perl administrator e-mail address'
5856 : figure out how to guarantee perl startup
5857 case "$startperl" in
5859 case "$sharpbang" in
5863 I can use the #! construct to start perl on your system. This will
5864 make startup of perl scripts faster, but may cause problems if you
5865 want to share those scripts and perl is not in a standard place
5866 ($binexp/perl) on all your platforms. The alternative is to force
5867 a shell by starting the script with a single ':' character.
5871 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
5874 none) startperl=": # use perl";;
5875 *) startperl="#!$ans"
5876 if $test 30 -lt `echo "$ans" | wc -c`; then
5879 WARNING: Some systems limit the #! command to 32 characters.
5880 If you experience difficulty running Perl scripts with #!, try
5881 installing Perl in a directory with a shorter pathname.
5887 *) startperl=": # use perl"
5892 echo "I'll use $startperl to start perl scripts."
5894 : figure best path for perl in scripts
5897 perlpath="$binexp/perl"
5898 case "$startperl" in
5903 I will use the "eval 'exec'" idiom to start Perl on your system.
5904 I can use the full path of your Perl binary for this purpose, but
5905 doing so may cause problems if you want to share those scripts and
5906 Perl is not always in a standard place ($binexp/perl).
5910 rp="What path shall I use in \"eval 'exec'\"?"
5917 case "$startperl" in
5919 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
5922 : determine where public executable scripts go
5923 set scriptdir scriptdir
5925 case "$scriptdir" in
5928 : guess some guesses
5929 $test -d /usr/share/scripts && dflt=/usr/share/scripts
5930 $test -d /usr/share/bin && dflt=/usr/share/bin
5931 $test -d /usr/local/script && dflt=/usr/local/script
5932 $test -d $prefixexp/script && dflt=$prefixexp/script
5936 *) dflt="$scriptdir"
5941 Some installations have a separate directory just for executable scripts so
5942 that they can mount it across multiple architectures but keep the scripts in
5943 one spot. You might, for example, have a subdirectory of /usr/share for this.
5944 Or you might just lump your scripts in with all your other executables.
5948 rp='Where do you keep publicly executable scripts?'
5950 if $test "X$ansexp" != "X$scriptdirexp"; then
5954 scriptdirexp="$ansexp"
5958 Since you are running AFS, I need to distinguish the directory in which
5959 scripts reside from the directory in which they are installed (and from
5960 which they are presumably copied to the former directory by occult means).
5963 case "$installscript" in
5964 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
5965 *) dflt="$installscript";;
5968 rp='Where will public scripts be installed?'
5970 installscript="$ans"
5972 installscript="$scriptdirexp"
5975 : determine where site specific libraries go.
5976 : Usual default is /usr/local/lib/perl5/site_perl/$apiversion
5977 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5979 *perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
5980 *) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
5985 The installation process will also create a directory for
5986 site-specific extensions and modules. Some users find it convenient
5987 to place all local files in this directory rather than in the main
5988 distribution directory.
5992 rp='Pathname for the site-specific library files?'
5994 if $test "X$sitelibexp" != "X$ansexp"; then
5998 sitelibexp="$ansexp"
6002 Since you are running AFS, I need to distinguish the directory in
6003 which site-specific files reside from the directory in which they are
6004 installed (and from which they are presumably copied to the former
6005 directory by occult means).
6008 case "$installsitelib" in
6009 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
6010 *) dflt="$installsitelib";;
6013 rp='Where will site-specific files be installed?'
6015 installsitelib="$ans"
6017 installsitelib="$sitelibexp"
6020 : determine where site specific architecture-dependent libraries go.
6021 : sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
6022 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6023 : sitelib may have an optional trailing /share.
6024 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6025 tdflt="$tdflt/$archname"
6026 set sitearch sitearch none
6029 '') dflt="$tdflt" ;;
6030 *) dflt="$sitearch" ;;
6034 The installation process will also create a directory for
6035 architecture-dependent site-specific extensions and modules.
6039 rp='Pathname for the site-specific architecture-dependent library files?'
6041 if $test "X$sitearchexp" != "X$ansexp"; then
6045 sitearchexp="$ansexp"
6049 Since you are running AFS, I need to distinguish the directory in
6050 which site-specific architecture-dependent library files reside from
6051 the directory in which they are installed (and from which they are
6052 presumably copied to the former directory by occult means).
6055 case "$installsitearch" in
6056 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
6057 *) dflt="$installsitearch";;
6060 rp='Where will site-specific architecture-dependent files be installed?'
6062 installsitearch="$ans"
6064 installsitearch="$sitearchexp"
6069 Previous version of $package used the standard IO mechanisms as defined
6070 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6071 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6072 the default. This abstraction layer can use AT&T's sfio (if you already
6073 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6074 problems with some extension modules. Using PerlIO with stdio is safe,
6075 but it is slower than plain stdio and therefore is not the default.
6077 If this doesn't make any sense to you, just accept the default 'n'.
6079 case "$useperlio" in
6080 $define|true|[yY]*) dflt='y';;
6083 rp='Use the experimental PerlIO abstraction layer?'
6090 echo "Ok, doing things the stdio way"
6097 : Check how to convert floats to strings.
6098 if test "X$d_Gconvert" = X; then
6100 echo "Checking for an efficient way to convert floats to strings."
6103 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6104 char *myname = "gconvert";
6107 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6108 char *myname = "gcvt";
6111 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6112 char *myname = "sprintf";
6118 checkit(expect, got)
6122 if (strcmp(expect, got)) {
6123 printf("%s oddity: Expected %s, got %s\n",
6124 myname, expect, got);
6134 /* This must be 1st test on (which?) platform */
6135 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6136 Gconvert(0.1, 8, 0, buf);
6137 checkit("0.1", buf);
6139 Gconvert(1.0, 8, 0, buf);
6142 Gconvert(0.0, 8, 0, buf);
6145 Gconvert(-1.0, 8, 0, buf);
6148 /* Some Linux gcvt's give 1.e+5 here. */
6149 Gconvert(100000.0, 8, 0, buf);
6150 checkit("100000", buf);
6152 /* Some Linux gcvt's give -1.e+5 here. */
6153 Gconvert(-100000.0, 8, 0, buf);
6154 checkit("-100000", buf);
6159 case "$d_Gconvert" in
6160 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6161 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6162 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6163 *) xxx_list='gconvert gcvt sprintf' ;;
6166 for xxx_convert in $xxx_list; do
6167 echo "Trying $xxx_convert"
6169 set try -DTRY_$xxx_convert
6170 if eval $compile; then
6171 echo "$xxx_convert" found. >&4
6173 echo "I'll use $xxx_convert to convert floats into a string." >&4
6176 echo "...But $xxx_convert didn't work as I expected."
6179 echo "$xxx_convert NOT found." >&4
6183 case "$xxx_convert" in
6184 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6185 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6186 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6190 : Initialize h_fcntl
6193 : Initialize h_sysfile
6196 : access call always available on UNIX
6200 : locate the flags for 'access()'
6204 $cat >access.c <<'EOCP'
6205 #include <sys/types.h>
6210 #include <sys/file.h>
6219 : check sys/file.h first, no particular reason here
6220 if $test `./findhdr sys/file.h` && \
6221 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
6223 echo "<sys/file.h> defines the *_OK access constants." >&4
6224 elif $test `./findhdr fcntl.h` && \
6225 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
6227 echo "<fcntl.h> defines the *_OK access constants." >&4
6228 elif $test `./findhdr unistd.h` && \
6229 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
6230 echo "<unistd.h> defines the *_OK access constants." >&4
6232 echo "I can't find the four *_OK access constants--I'll use mine." >&4
6238 : see if accessx exists
6239 set accessx d_accessx
6242 : see if alarm exists
6246 : Look for GNU-cc style attribute checking
6248 echo "Checking whether your compiler can handle __attribute__ ..." >&4
6249 $cat >attrib.c <<'EOCP'
6251 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
6253 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
6254 if $contains 'warning' attrib.out >/dev/null 2>&1; then
6255 echo "Your C compiler doesn't fully support __attribute__."
6258 echo "Your C compiler supports __attribute__."
6262 echo "Your C compiler doesn't seem to understand __attribute__ at all."
6269 : see if bcmp exists
6273 : see if bcopy exists
6277 : see if this is a unistd.h system
6278 set unistd.h i_unistd
6281 : see if getpgrp exists
6282 set getpgrp d_getpgrp
6285 case "$d_getpgrp" in
6288 echo "Checking to see which flavor of getpgrp is in use..."
6291 #include <sys/types.h>
6293 # include <unistd.h>
6297 if (getuid() == 0) {
6298 printf("(I see you are running Configure as super-user...)\n");
6302 if (getpgrp(1) == 0)
6311 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6312 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6314 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6315 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6318 echo "I can't seem to compile and run the test program."
6320 xxx="a USG one, i.e. you use getpgrp()."
6322 # SVR4 systems can appear rather BSD-ish.
6325 xxx="a BSD one, i.e. you use getpgrp(pid)."
6329 xxx="probably a USG one, i.e. you use getpgrp()."
6334 echo "Assuming your getpgrp is $xxx" >&4
6343 : see if setpgrp exists
6344 set setpgrp d_setpgrp
6347 case "$d_setpgrp" in
6350 echo "Checking to see which flavor of setpgrp is in use..."
6353 #include <sys/types.h>
6355 # include <unistd.h>
6359 if (getuid() == 0) {
6360 printf("(I see you are running Configure as super-user...)\n");
6364 if (-1 == setpgrp(1, 1))
6367 if (setpgrp() != -1)
6373 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6374 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6376 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6377 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6380 echo "(I can't seem to compile and run the test program.)"
6382 xxx="a USG one, i.e. you use setpgrp()."
6384 # SVR4 systems can appear rather BSD-ish.
6387 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6391 xxx="probably a USG one, i.e. you use setpgrp()."
6396 echo "Assuming your setpgrp is $xxx" >&4
6404 : see if bzero exists
6408 : check for lengths of integral types
6412 echo "Checking to see how big your integers are..." >&4
6413 $cat >intsize.c <<'EOCP'
6417 printf("intsize=%d;\n", sizeof(int));
6418 printf("longsize=%d;\n", sizeof(long));
6419 printf("shortsize=%d;\n", sizeof(short));
6424 if eval $compile_ok && ./intsize > /dev/null; then
6426 echo "Your integers are $intsize bytes long."
6427 echo "Your long integers are $longsize bytes long."
6428 echo "Your short integers are $shortsize bytes long."
6432 Help! I can't compile and run the intsize test program: please enlighten me!
6433 (This is probably a misconfiguration in your system or libraries, and
6434 you really ought to fix it. Still, I'll try anyway.)
6438 rp="What is the size of an integer (in bytes)?"
6442 rp="What is the size of a long integer (in bytes)?"
6446 rp="What is the size of a short integer (in bytes)?"
6452 $rm -f intsize intsize.*
6454 : see if signal is declared as pointer to function returning int or void
6456 xxx=`./findhdr signal.h`
6457 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6458 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6459 echo "You have int (*signal())() instead of void." >&4
6461 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6462 echo "You have void (*signal())()." >&4
6464 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6465 echo "You have int (*signal())() instead of void." >&4
6467 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6468 echo "You have void (*signal())()." >&4
6471 case "$d_voidsig" in
6473 echo "I can't determine whether signal handler returns void or int..." >&4
6475 rp="What type does your signal handler return?"
6482 echo "As you already told me, signal handler returns void." >&4
6485 *) echo "As you already told me, signal handler returns int." >&4
6492 case "$d_voidsig" in
6493 "$define") signal_t="void";;
6498 : check for ability to cast large floats to 32-bit ints.
6500 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6501 if $test "$intsize" -ge 4; then
6508 #include <sys/types.h>
6510 $signal_t blech(s) int s; { exit(3); }
6517 signal(SIGFPE, blech);
6519 /* Don't let compiler optimize the test away. Store the number
6520 in a writable string for gcc to pass to sscanf under HP/UX.
6522 sprintf(str, "2147483647");
6523 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6527 /* x86 processors will probably give 0x8000 0000, which is a
6528 sign change. We don't want that. We want to mimic SPARC
6529 behavior here, which is to preserve the sign and give
6532 if (i32 != ($xxx) f)
6538 if eval $compile_ok; then
6542 echo "(I can't seem to compile the test program--assuming it can't)"
6550 echo "Nope, it can't."
6557 : check for ability to cast negative floats to unsigned
6559 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6562 #include <sys/types.h>
6564 $signal_t blech(s) int s; { exit(7); }
6565 $signal_t blech_in_list(s) int s; { exit(4); }
6566 unsigned long dummy_long(p) unsigned long p; { return p; }
6567 unsigned int dummy_int(p) unsigned int p; { return p; }
6568 unsigned short dummy_short(p) unsigned short p; { return p; }
6572 unsigned long along;
6574 unsigned short ashort;
6578 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6579 a direct f = -123. assignment. gcc-2.8.0 reportedly
6580 optimized the whole file away
6582 /* Store the number in a writable string for gcc to pass to
6585 sprintf(str, "-123");
6586 sscanf(str, "%lf", &f); /* f = -123.; */
6588 signal(SIGFPE, blech);
6589 along = (unsigned long)f;
6590 aint = (unsigned int)f;
6591 ashort = (unsigned short)f;
6592 if (along != (unsigned long)-123)
6594 if (aint != (unsigned int)-123)
6596 if (ashort != (unsigned short)-123)
6598 sprintf(str, "1073741824.");
6599 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6602 along = (unsigned long)f;
6603 if (along != 0x80000000)
6607 along = (unsigned long)f;
6608 if (along != 0x7fffffff)
6612 along = (unsigned long)f;
6613 if (along != 0x80000001)
6617 signal(SIGFPE, blech_in_list);
6618 sprintf(str, "123.");
6619 sscanf(str, "%lf", &f); /* f = 123.; */
6620 along = dummy_long((unsigned long)f);
6621 aint = dummy_int((unsigned int)f);
6622 ashort = dummy_short((unsigned short)f);
6623 if (along != (unsigned long)123)
6625 if (aint != (unsigned int)123)
6627 if (ashort != (unsigned short)123)
6634 if eval $compile_ok; then
6638 echo "(I can't seem to compile the test program--assuming it can't)"
6641 case "$castflags" in
6646 echo "Nope, it can't."
6653 : see if vprintf exists
6655 if set vprintf val -f d_vprintf; eval $csym; $val; then
6656 echo 'vprintf() found.' >&4
6658 $cat >vprintf.c <<'EOF'
6659 #include <varargs.h>
6661 main() { xxx("foo"); }
6670 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6674 if eval $compile && ./vprintf; then
6675 echo "Your vsprintf() returns (int)." >&4
6678 echo "Your vsprintf() returns (char*)." >&4
6682 echo 'vprintf() NOT found.' >&4
6692 : see if chown exists
6696 : see if chroot exists
6700 : see if chsize exists
6704 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
6705 while $test $# -ge 2; do
6707 $define) echo "#include <$2>";;
6711 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
6712 if eval $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6721 : see if this is a sys/uio.h system
6722 set sys/uio.h i_sysuio
6725 echo "Checking to see if your system supports struct iovec..." >&4
6726 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
6728 case "$d_iovec_s" in
6729 "$define") echo "Yup, it does." >&4
6731 *) echo "Nope, it doesn't." >&4
6737 : see whether socket exists
6739 $echo $n "Hmm... $c" >&4
6740 if set socket val -f d_socket; eval $csym; $val; then
6741 echo "Looks like you have Berkeley networking support." >&4
6743 if set setsockopt val -f; eval $csym; $val; then
6746 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
6750 if $contains socklib libc.list >/dev/null 2>&1; then
6751 echo "Looks like you have Berkeley networking support." >&4
6753 : we will have to assume that it supports the 4.2 BSD interface
6756 echo "You don't have Berkeley networking in libc$_a..." >&4
6757 if test "X$d_socket" = "X$define"; then
6758 echo "...but you seem to believe that you have sockets." >&4
6760 for net in net socket
6762 if test -f /usr/lib/lib$net$_a; then
6763 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
6764 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
6765 if $contains socket libc.list >/dev/null 2>&1; then
6770 echo "...but the Wollongong group seems to have hacked it in." >&4
6771 sockethdr="-I/usr/netinclude"
6774 echo "Found Berkeley sockets interface in lib$net." >& 4
6775 if $contains setsockopt libc.list >/dev/null 2>&1; then
6778 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
6785 if test "X$d_socket" != "X$define"; then
6786 echo "or anywhere else I see." >&4
6794 : see if socketpair exists
6795 set socketpair d_sockpair
6800 echo "Checking the availability of certain socket constants..." >& 4
6801 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
6802 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
6804 #include <sys/types.h>
6805 #include <sys/socket.h>
6811 set try; if eval $compile; then
6814 set d_${enum}; eval $setvar
6818 set sendmsg d_sendmsg
6821 set recvmsg d_recvmsg
6825 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
6826 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
6828 case "$d_msghdr_s" in
6829 "$define") echo "Yup, it does." >&4
6831 *) echo "Nope, it doesn't." >&4
6835 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
6836 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
6838 case "$d_cmsghdr_s" in
6839 "$define") echo "Yup, it does." >&4
6841 *) echo "Nope, it doesn't." >&4
6845 : check for const keyword
6847 echo 'Checking to see if your C compiler knows about "const"...' >&4
6848 $cat >const.c <<'EOCP'
6849 typedef struct spug { int drokk; } spug;
6856 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
6858 echo "Yup, it does."
6861 echo "Nope, it doesn't."
6866 : see if crypt exists
6868 if set crypt val -f d_crypt; eval $csym; $val; then
6869 echo 'crypt() found.' >&4
6873 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
6874 if $test -z "$cryptlib"; then
6875 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
6879 if $test -z "$cryptlib"; then
6880 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
6884 if $test -z "$cryptlib"; then
6885 cryptlib=`./loc libcrypt$_a "" $libpth`
6889 if $test -z "$cryptlib"; then
6890 echo 'crypt() NOT found.' >&4
6899 : get csh whereabouts
6901 'csh') val="$undef" ;;
6906 : Respect a hint or command line value for full_csh.
6908 '') full_csh=$csh ;;
6911 : see if cuserid exists
6912 set cuserid d_cuserid
6915 : see if this is a limits.h system
6916 set limits.h i_limits
6919 : see if this is a float.h system
6923 : See if number of significant digits in a double precision number is known
6925 $cat >dbl_dig.c <<EOM
6935 printf("Contains DBL_DIG");
6938 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
6939 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
6940 echo "DBL_DIG found." >&4
6943 echo "DBL_DIG NOT found." >&4
6951 if $test X"$use64bits" = X"$define"; then
6952 : see if dbminit64 exists
6953 set dbminit64 d_dbminit64
6956 : see if dbmclose64 exists
6957 set dbmclose64 d_dbmclose64
6960 : see if fetch64 exists
6961 set fetch64 d_fetch64
6964 : see if store64 exists
6965 set store64 d_store64
6968 : see if delete64 exists
6969 set delete64 d_delete64
6972 : see if firstkey64 exists
6973 set firstkey64 d_firstkey64
6976 : see if nextkey64 exists
6977 set nextkey64 d_nextkey64
6981 for xxx in d_dbminit64 d_dbmclose64 d_fetch64 d_store64 d_delete64 d_firstkey64 d_nextkey64
6988 : see if difftime exists
6989 set difftime d_difftime
6992 : see if sys/stat.h is available
6993 set sys/stat.h i_sysstat
6996 : see if this is a dirent system
6998 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7000 echo "<dirent.h> found." >&4
7003 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7004 echo "<sys/dir.h> found." >&4
7007 xinc=`./findhdr sys/ndir.h`
7009 echo "<dirent.h> NOT found." >&4
7014 : Look for type of directory structure.
7016 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7018 case "$direntrytype" in
7021 $define) guess1='struct dirent' ;;
7022 *) guess1='struct direct' ;;
7025 *) guess1="$direntrytype"
7030 'struct dirent') guess2='struct direct' ;;
7031 *) guess2='struct dirent' ;;
7034 if $contains "$guess1" try.c >/dev/null 2>&1; then
7035 direntrytype="$guess1"
7036 echo "Your directory entries are $direntrytype." >&4
7037 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7038 direntrytype="$guess2"
7039 echo "Your directory entries seem to be $direntrytype." >&4
7041 echo "I don't recognize your system's directory entries." >&4
7042 rp="What type is used for directory entries on this system?"
7050 : see if the directory entry stores field length
7052 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7053 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7054 echo "Good, your directory entry keeps length information in d_namlen." >&4
7057 echo "Your directory entry does not know about the d_namlen field." >&4
7065 if $test X"$use64bits" = X"$define"; then
7066 : see if fstat64 exists
7067 set fstat64 d_fstat64
7070 : see if ftruncate64 exists
7071 set ftruncate64 d_ftruncate64
7074 : see if lockf64 exists
7075 set lockf64 d_lockf64
7078 : see if lseek64 exists
7079 set lseek64 d_lseek64
7082 : see if lstat64 exists
7083 set lstat64 d_lstat64
7086 : see if open64 exists
7090 : see if opendir64 exists
7091 set opendir64 d_opendir64
7094 : see if readdir64 exists
7095 set readdir64 d_readdir64
7098 : see if seekdir64 exists
7099 set seekdir64 d_seekdir64
7102 : see if stat64 exists
7106 : see if telldir64 exists
7107 set telldir64 d_telldir64
7110 : see if truncate64 exists
7111 set truncate64 d_truncate64
7116 echo $n "Checking to see if your system supports off64_t...$c" >&4
7118 #include <sys/types.h>
7119 off64_t foo() { off64_t x; x = 7; return x; }'
7121 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7123 echo " Yup, it does." >&4
7126 echo " Nope, it doesn't." >&4
7134 echo $n "Checking to see if your system supports ino64_t...$c" >&4
7136 case "$i_sysstat" in
7139 #include <sys/types.h>
7140 #include <sys/stat.h>
7141 ino64_t foo() { ino64_t x; x = 7; return x; }'
7143 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7149 if $test "X$val" = X"$define"; then
7150 echo " Yup, it does." >&4
7152 echo " Nope, it doesn't." >&4
7157 : check for struct flock64
7159 echo "Checking to see if your system supports struct flock64..." >&4
7161 set d_flock64_s flock64 l_len define fcntl.h
7168 case "$d_flock64_s" in
7169 "$define") echo "Yup, it does." >&4
7171 *) echo "Nope, it doesn't." >&4
7175 : check for struct dirent64
7177 echo "Checking to see if your system supports struct dirent64..." >&4
7178 set d_dirent64_s dirent64 d_off $i_dirent dirent.h
7180 case "$d_dirent64_s" in
7181 "$define") echo "Yup, it does." >&4
7183 *) echo "Nope, it doesn't." >&4
7189 for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64t d_ino64t d_flock64_s d_dirent64_s
7196 : see if dlerror exists
7199 set dlerror d_dlerror
7203 : see if dlfcn is available
7211 On a few systems, the dynamically loaded modules that perl generates and uses
7212 will need a different extension than shared libs. The default will probably
7220 rp='What is the extension of dynamically loaded modules'
7229 : Check if dlsym need a leading underscore
7235 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7236 $cat >dyna.c <<'EOM'
7245 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7247 #include <sys/types.h>
7261 int mode = RTLD_LAZY ;
7263 handle = dlopen("./dyna.$dlext", mode) ;
7264 if (handle == NULL) {
7269 symbol = dlsym(handle, "fred") ;
7270 if (symbol == NULL) {
7271 /* try putting a leading underscore */
7272 symbol = dlsym(handle, "_fred") ;
7273 if (symbol == NULL) {
7286 : Call the object file tmp-dyna.o in case dlext=o.
7287 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7288 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7289 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7290 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7293 1) echo "Test program failed using dlopen." >&4
7294 echo "Perhaps you should not use dynamic loading." >&4;;
7295 2) echo "Test program failed using dlsym." >&4
7296 echo "Perhaps you should not use dynamic loading." >&4;;
7297 3) echo "dlsym needs a leading underscore" >&4
7299 4) echo "dlsym doesn't need a leading underscore." >&4;;
7302 echo "I can't compile and run the test program." >&4
7307 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7312 hasproto='varname=$1; func=$2; shift; shift;
7313 while $test $# -ge 2; do
7315 $define) echo "#include <$2>";;
7319 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7320 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7321 echo "$func() prototype found.";
7324 echo "$func() prototype NOT found.";
7329 $rm -f try.c tryout.c'
7331 : see if prototype for drand48 is available
7333 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
7336 : see if dup2 exists
7340 : see if eaccess exists
7341 set eaccess d_eaccess
7344 : see if endgrent exists
7345 set endgrent d_endgrent
7348 : see if endhostent exists
7349 set endhostent d_endhent
7352 : see if endnetent exists
7353 set endnetent d_endnent
7356 : see if endprotoent exists
7357 set endprotoent d_endpent
7360 : see if endpwent exists
7361 set endpwent d_endpwent
7364 : see if endservent exists
7365 set endservent d_endsent
7368 : Locate the flags for 'open()'
7370 $cat >open3.c <<'EOCP'
7371 #include <sys/types.h>
7376 #include <sys/file.h>
7387 : check sys/file.h first to get FREAD on Sun
7388 if $test `./findhdr sys/file.h` && \
7389 set open3 -DI_SYS_FILE && eval $compile; then
7391 echo "<sys/file.h> defines the O_* constants..." >&4
7393 echo "and you have the 3 argument form of open()." >&4
7396 echo "but not the 3 argument form of open(). Oh, well." >&4
7399 elif $test `./findhdr fcntl.h` && \
7400 set open3 -DI_FCNTL && eval $compile; then
7402 echo "<fcntl.h> defines the O_* constants..." >&4
7404 echo "and you have the 3 argument form of open()." >&4
7407 echo "but not the 3 argument form of open(). Oh, well." >&4
7412 echo "I can't find the O_* constant definitions! You got problems." >&4
7418 : check for non-blocking I/O stuff
7419 case "$h_sysfile" in
7420 true) echo "#include <sys/file.h>" > head.c;;
7423 true) echo "#include <fcntl.h>" > head.c;;
7424 *) echo "#include <sys/fcntl.h>" > head.c;;
7429 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7430 case "$o_nonblock" in
7433 $cat >>try.c <<'EOCP'
7436 printf("O_NONBLOCK\n");
7440 printf("O_NDELAY\n");
7444 printf("FNDELAY\n");
7451 if eval $compile_ok; then
7453 case "$o_nonblock" in
7454 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
7455 *) echo "Seems like we can use $o_nonblock.";;
7458 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
7461 *) echo "Using $hint value $o_nonblock.";;
7463 $rm -f try try.* .out core
7466 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7472 #include <sys/types.h>
7474 #define MY_O_NONBLOCK $o_nonblock
7475 #ifndef errno /* XXX need better Configure test */
7478 $signal_t blech(x) int x; { exit(3); }
7480 $cat >> try.c <<'EOCP'
7488 pipe(pd); /* Down: child -> parent */
7489 pipe(pu); /* Up: parent -> child */
7492 close(pd[1]); /* Parent reads from pd[0] */
7493 close(pu[0]); /* Parent writes (blocking) to pu[1] */
7494 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
7496 signal(SIGALRM, blech);
7498 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
7500 sprintf(string, "%d\n", ret);
7501 write(2, string, strlen(string));
7504 if (errno == EAGAIN) {
7510 if (errno == EWOULDBLOCK)
7511 printf("EWOULDBLOCK\n");
7514 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
7515 sleep(2); /* Give it time to close our pipe */
7517 ret = read(pd[0], buf, 1); /* Should read EOF */
7519 sprintf(string, "%d\n", ret);
7520 write(3, string, strlen(string));
7524 close(pd[0]); /* We write to pd[1] */
7525 close(pu[1]); /* We read from pu[0] */
7526 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
7527 close(pd[1]); /* Pipe pd is now fully closed! */
7528 exit(0); /* Bye bye, thank you for playing! */
7532 if eval $compile_ok; then
7533 echo "$startsh" >mtry
7534 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
7536 ./mtry >/dev/null 2>&1
7538 0) eagain=`$cat try.out`;;
7539 1) echo "Could not perform non-blocking setting!";;
7540 2) echo "I did a successful read() for something that was not there!";;
7541 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
7542 *) echo "Something terribly wrong happened during testing.";;
7544 rd_nodata=`$cat try.ret`
7545 echo "A read() system call with no data present returns $rd_nodata."
7546 case "$rd_nodata" in
7549 echo "(That's peculiar, fixing that to be -1.)"
7555 echo "Forcing errno EAGAIN on read() with no data available."
7559 echo "Your read() sets errno to $eagain when no data is available."
7562 status=`$cat try.err`
7564 0) echo "And it correctly returns 0 to signal EOF.";;
7565 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
7566 *) echo "However, your read() returns '$status' on EOF??";;
7569 if test "$status" = "$rd_nodata"; then
7570 echo "WARNING: you can't distinguish between EOF and no data!"
7574 echo "I can't compile the test program--assuming errno EAGAIN will do."
7581 echo "Using $hint value $eagain."
7582 echo "Your read() returns $rd_nodata when no data is present."
7583 case "$d_eofnblk" in
7584 "$define") echo "And you can see EOF because read() returns 0.";;
7585 "$undef") echo "But you can't see EOF status from read() returned value.";;
7587 echo "(Assuming you can't see EOF status from read anyway.)"
7593 $rm -f try try.* .out core head.c mtry
7595 : see if fchmod exists
7599 : see if fchown exists
7603 : see if this is an fcntl system
7607 : see if sys/select.h has to be included
7608 set sys/select.h i_sysselct
7611 : see if we should include time.h, sys/time.h, or both
7613 if test "X$timeincl" = X; then
7614 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
7615 $echo $n "I'm now running the test program...$c"
7616 $cat >try.c <<'EOCP'
7617 #include <sys/types.h>
7622 #ifdef SYSTIMEKERNEL
7625 #include <sys/time.h>
7628 #include <sys/select.h>
7637 struct timezone tzp;
7639 if (foo.tm_sec == foo.tm_sec)
7642 if (bar.tv_sec == bar.tv_sec)
7649 for s_timezone in '-DS_TIMEZONE' ''; do
7651 for s_timeval in '-DS_TIMEVAL' ''; do
7652 for i_systimek in '' '-DSYSTIMEKERNEL'; do
7653 for i_time in '' '-DI_TIME'; do
7654 for i_systime in '-DI_SYSTIME' ''; do
7657 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
7658 if eval $compile; then
7659 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
7663 $echo $n "Succeeded with $flags$c"
7675 *SYSTIMEKERNEL*) i_systimek="$define"
7676 timeincl=`./findhdr sys/time.h`
7677 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
7678 *) i_systimek="$undef";;
7681 *I_TIME*) i_time="$define"
7682 timeincl=`./findhdr time.h`" $timeincl"
7683 echo "We'll include <time.h>." >&4;;
7684 *) i_time="$undef";;
7687 *I_SYSTIME*) i_systime="$define"
7688 timeincl=`./findhdr sys/time.h`" $timeincl"
7689 echo "We'll include <sys/time.h>." >&4;;
7690 *) i_systime="$undef";;
7695 : check for fd_set items
7698 Checking to see how well your C compiler handles fd_set and friends ...
7700 $cat >fd_set.c <<EOCP
7701 #$i_systime I_SYS_TIME
7702 #$i_sysselct I_SYS_SELECT
7703 #$d_socket HAS_SOCKET
7704 #include <sys/types.h>
7706 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
7709 #include <sys/time.h>
7712 #include <sys/select.h>
7721 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
7728 set fd_set -DTRYBITS
7729 if eval $compile; then
7730 d_fds_bits="$define"
7732 echo "Well, your system knows about the normal fd_set typedef..." >&4
7734 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
7735 d_fd_macros="$define"
7738 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
7740 d_fd_macros="$undef"
7744 Hmm, your compiler has some difficulty with fd_set. Checking further...
7747 if eval $compile; then
7750 echo "Well, your system has some sort of fd_set available..." >&4
7752 echo "and you have the normal fd_set macros." >&4
7753 d_fd_macros="$define"
7756 but not the normal fd_set macros! Gross! More work for me...
7758 d_fd_macros="$undef"
7761 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
7764 d_fd_macros="$undef"
7769 : see if fgetpos exists
7770 set fgetpos d_fgetpos
7774 if $test X"$use64bits" = X"$define"; then
7775 : see if fgetpos64 exists
7776 set fgetpos64 d_fgetpos64
7779 : see if fopen64 exists
7780 set freopen64 d_fopen64
7783 : see if freopen64 exists
7784 set freopen64 d_freopen64
7787 : see if fseek64 exists
7788 set fseek64 d_fseek64
7791 : see if fseeko64 exists
7792 set fseeko64 d_fseeko64
7795 : see if fsetpos64 exists
7796 set fsetpos64 d_fsetpos64
7799 : see if ftell64 exists
7800 set ftell64 d_ftell64
7803 : see if ftello64 exists
7804 set ftello64 d_ftello64
7807 : see if tmpfile64 exists
7808 set tmpfile64 d_tmpfile64
7812 for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
7819 : see if flock exists
7823 : see if fork exists
7827 : see if pathconf exists
7828 set pathconf d_pathconf
7831 : see if fpathconf exists
7832 set fpathconf d_fpathconf
7835 : see if fseeko exists
7839 : see if fsetpos exists
7840 set fsetpos d_fsetpos
7843 : see if ftello exists
7847 : see if getgrent exists
7848 set getgrent d_getgrent
7851 : see if gethostbyaddr exists
7852 set gethostbyaddr d_gethbyaddr
7855 : see if gethostbyname exists
7856 set gethostbyname d_gethbyname
7859 : see if gethostent exists
7860 set gethostent d_gethent
7863 : see how we will look up host name
7866 : dummy stub to allow use of elif
7867 elif set gethostname val -f d_gethname; eval $csym; $val; then
7868 echo 'gethostname() found.' >&4
7869 d_gethname="$define"
7871 elif set uname val -f d_uname; eval $csym; $val; then
7874 uname() was found, but you're running xenix, and older versions of xenix
7875 have a broken uname(). If you don't really know whether your xenix is old
7876 enough to have a broken system call, use the default answer.
7883 rp='Is your uname() broken?'
7886 n*) d_uname="$define"; call=uname;;
7889 echo 'uname() found.' >&4
7894 case "$d_gethname" in
7895 '') d_gethname="$undef";;
7898 '') d_uname="$undef";;
7900 case "$d_uname$d_gethname" in
7905 Every now and then someone has a $call() that lies about the hostname
7906 but can't be fixed for political or economic reasons. If you wish, I can
7907 pretend $call() isn't there and maybe compute hostname at run-time
7908 thanks to the '$phostname' command.
7911 rp="Shall I ignore $call() from now on?"
7914 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
7917 case "$phostname" in
7919 *) case "$aphostname" in
7925 file=`./loc $file $file $pth`
7926 aphostname=`echo $file $*`
7931 case "$d_uname$d_gethname" in
7934 case "$phostname" in
7936 echo "There will be no way for $package to get your hostname." >&4;;
7938 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
7942 case "$d_phostname" in
7943 '') d_phostname="$undef";;
7946 : see if this is a netdb.h system
7950 : see if prototypes for various gethostxxx netdb.h functions are available
7952 set d_gethostprotos gethostent $i_netdb netdb.h
7955 : see if getlogin exists
7956 set getlogin d_getlogin
7959 : see if getnetbyaddr exists
7960 set getnetbyaddr d_getnbyaddr
7963 : see if getnetbyname exists
7964 set getnetbyname d_getnbyname
7967 : see if getnetent exists
7968 set getnetent d_getnent
7971 : see if prototypes for various getnetxxx netdb.h functions are available
7973 set d_getnetprotos getnetent $i_netdb netdb.h
7977 : see if getprotobyname exists
7978 set getprotobyname d_getpbyname
7981 : see if getprotobynumber exists
7982 set getprotobynumber d_getpbynumber
7985 : see if getprotoent exists
7986 set getprotoent d_getpent
7989 : see if getpgid exists
7990 set getpgid d_getpgid
7993 : see if getpgrp2 exists
7994 set getpgrp2 d_getpgrp2
7997 : see if getppid exists
7998 set getppid d_getppid
8001 : see if getpriority exists
8002 set getpriority d_getprior
8005 : see if prototypes for various getprotoxxx netdb.h functions are available
8007 set d_getprotoprotos getprotoent $i_netdb netdb.h
8010 : see if getpwent exists
8011 set getpwent d_getpwent
8015 : see if getservbyname exists
8016 set getservbyname d_getsbyname
8019 : see if getservbyport exists
8020 set getservbyport d_getsbyport
8023 : see if getservent exists
8024 set getservent d_getsent
8027 : see if prototypes for various getservxxx netdb.h functions are available
8029 set d_getservprotos getservent $i_netdb netdb.h
8032 : see if gettimeofday or ftime exists
8033 set gettimeofday d_gettimeod
8035 case "$d_gettimeod" in
8041 val="$undef"; set d_ftime; eval $setvar
8044 case "$d_gettimeod$d_ftime" in
8047 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8051 : see if this is an grp system
8057 xxx=`./findhdr grp.h`
8058 $cppstdin $cppflags $cppminus < $xxx >$$.h
8060 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8072 set d_grpasswd; eval $setvar
8076 : see if this is a netinet/in.h or sys/in.h system
8077 set netinet/in.h i_niin sys/in.h i_sysin
8080 : see if arpa/inet.h has to be included
8081 set arpa/inet.h i_arpainet
8084 : see if htonl --and friends-- exists
8089 : Maybe they are macros.
8094 #include <sys/types.h>
8095 #$i_niin I_NETINET_IN
8097 #$i_arpainet I_ARPA_INET
8099 #include <netinet/in.h>
8105 #include <arpa/inet.h>
8108 printf("Defined as a macro.");
8111 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8112 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8114 echo "But it seems to be defined as a macro." >&4
8122 : see which of string.h or strings.h is needed
8124 strings=`./findhdr string.h`
8125 if $test "$strings" && $test -r "$strings"; then
8126 echo "Using <string.h> instead of <strings.h>." >&4
8130 strings=`./findhdr strings.h`
8131 if $test "$strings" && $test -r "$strings"; then
8132 echo "Using <strings.h> instead of <string.h>." >&4
8134 echo "No string header found -- You'll surely have problems." >&4
8140 "$undef") strings=`./findhdr strings.h`;;
8141 *) strings=`./findhdr string.h`;;
8146 if set index val -f; eval $csym; $val; then
8147 if set strchr val -f d_strchr; eval $csym; $val; then
8148 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8151 echo "strchr() found." >&4
8155 echo "index() found." >&4
8160 echo "index() found." >&4
8163 if set strchr val -f d_strchr; eval $csym; $val; then
8166 echo "strchr() found." >&4
8168 echo "No index() or strchr() found!" >&4
8173 set d_strchr; eval $setvar
8175 set d_index; eval $setvar
8177 : check whether inet_aton exists
8178 set inet_aton d_inetaton
8181 : see if inttypes.h is available
8182 : we want a real compile instead of Inhdr because some systems
8183 : have an inttypes.h which includes non-existent headers
8186 #include <inttypes.h>
8188 static int32_t foo32 = 0x12345678;
8192 if eval $compile; then
8193 echo "<inttypes.h> found." >&4
8196 echo "<inttypes.h> NOT found." >&4
8204 case "$use64bits" in
8207 echo $n "Checking to see if your system supports int64_t...$c" >&4
8209 #include <sys/types.h>
8210 #$i_inttypes I_INTTYPES
8212 #include <inttypes.h>
8214 int64_t foo() { int64_t x; x = 7; return x; }
8216 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8218 echo " Yup, it does." >&4
8221 echo " Nope, it doesn't." >&4
8234 $cat >isascii.c <<'EOCP'
8246 if eval $compile; then
8247 echo "isascii() found." >&4
8250 echo "isascii() NOT found." >&4
8257 : see if killpg exists
8261 : see if lchown exists
8263 $cat > try.c <<'EOCP'
8264 /* System header to define __stub macros and hopefully few prototypes,
8265 which can conflict with char lchown(); below. */
8267 /* Override any gcc2 internal prototype to avoid an error. */
8268 /* We use char because int might match the return type of a gcc2
8269 builtin and then its argument prototype would still apply. */
8272 /* The GNU C library defines this for functions which it implements
8273 to always fail with ENOSYS. Some functions are actually named
8274 something starting with __ and the normal name is an alias. */
8275 #if defined (__stub_lchown) || defined (__stub___lchown)
8283 if eval $compile; then
8284 $echo "lchown() found." >&4
8287 $echo "lchown() NOT found." >&4
8293 : see if link exists
8297 : see if localeconv exists
8298 set localeconv d_locconv
8301 : see if lockf exists
8305 : check for length of double
8307 case "$doublesize" in
8309 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
8310 $cat >try.c <<'EOCP'
8314 printf("%d\n", sizeof(double));
8318 if eval $compile_ok; then
8320 $echo " $doublesize bytes." >&4
8323 echo "(I can't seem to compile the test program. Guessing...)"
8324 rp="What is the size of a double precision number (in bytes)?"
8332 : check for long doubles
8334 echo $n "Checking to see if your system supports long doubles...$c" >&4
8335 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
8336 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8338 echo " Yup, it does." >&4
8341 echo " Nope, it doesn't." >&4
8347 : check for length of long double
8348 case "${d_longdbl}${longdblsize}" in
8351 $echo $n "Checking to see how big your long doubles are...$c" >&4
8352 $cat >try.c <<'EOCP'
8356 printf("%d\n", sizeof(long double));
8360 if eval $compile; then
8362 $echo " $longdblsize bytes." >&4
8366 echo "(I can't seem to compile the test program. Guessing...)" >&4
8367 rp="What is the size of a long double (in bytes)?"
8371 if $test "X$doublesize" = "X$longdblsize"; then
8372 echo "(That isn't any different from an ordinary double.)"
8378 : check for long long
8380 echo $n "Checking to see if your system supports long long...$c" >&4
8381 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
8382 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8384 echo " Yup, it does." >&4
8387 echo " Nope, it doesn't." >&4
8393 : check for length of long long
8394 case "${d_longlong}${longlongsize}" in
8397 $echo $n "Checking to see how big your long longs are...$c" >&4
8398 $cat >try.c <<'EOCP'
8402 printf("%d\n", sizeof(long long));
8406 if eval $compile_ok; then
8407 longlongsize=`./try`
8408 $echo " $longlongsize bytes." >&4
8412 echo "(I can't seem to compile the test program. Guessing...)"
8413 rp="What is the size of a long long (in bytes)?"
8417 if $test "X$longsize" = "X$longlongsize"; then
8418 echo "(That isn't any different from an ordinary long.)"
8424 : see if lstat exists
8428 : see if mblen exists
8432 : see if mbstowcs exists
8433 set mbstowcs d_mbstowcs
8436 : see if mbtowc exists
8440 : see if memcmp exists
8444 : see if memcpy exists
8448 : see if memmove exists
8449 set memmove d_memmove
8452 : see if memset exists
8456 : see if mkdir exists
8460 : see if mkfifo exists
8464 : see if mktime exists
8468 : see if msgctl exists
8472 : see if msgget exists
8476 : see if msgsnd exists
8480 : see if msgrcv exists
8484 : see how much of the 'msg*(2)' library is present.
8487 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
8488 *"$undef"*) h_msg=false;;
8492 case "`ipcs 2>&1`" in
8493 "SVID messages"*"not configured"*)
8494 echo "Your $osname does not have the msg*(2) configured." >&4
8509 : we could also check for sys/ipc.h ...
8510 if $h_msg && $test `./findhdr sys/msg.h`; then
8511 echo "You have the full msg*(2) library." >&4
8514 echo "You don't have the full msg*(2) library." >&4
8520 : see if nice exists
8524 : how to create joinable pthreads
8525 if test "X$usethreads" = "X$define"; then
8527 echo "Checking what constant to use for creating joinable pthreads..." >&4
8528 $cat >try.c <<'EOCP'
8529 #include <pthread.h>
8531 int detachstate = JOINABLE;
8534 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
8535 if eval $compile; then
8536 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&2
8537 val="$undef" # Yes, undef.
8538 set d_old_pthread_create_joinable
8541 set old_pthread_create_joinable
8544 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
8545 if eval $compile; then
8546 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&2
8548 set d_old_pthread_create_joinable
8550 val=PTHREAD_CREATE_UNDETACHED
8551 set old_pthread_create_joinable
8554 set try -DJOINABLE=__UNDETACHED
8555 if eval $compile; then
8556 echo "You seem to use __UNDETACHED." >&2
8558 set d_old_pthread_create_joinable
8561 set old_pthread_create_joinable
8564 echo "Egads, nothing obvious found. Guessing that you use 0." >&2
8566 set d_old_pthread_create_joinable
8569 set old_pthread_create_joinable
8576 d_old_pthread_create_joinable="$undef"
8577 old_pthread_create_joinable=""
8580 : see if pause exists
8584 : see if pipe exists
8588 : see if poll exists
8593 : see whether the various POSIXish _yields exist
8595 #include <pthread.h>
8601 #ifdef PTHREAD_YIELD
8604 #ifdef PTHREAD_YIELD_NULL
8605 pthread_yield(NULL);
8611 : see if sched_yield exists
8612 set try -DSCHED_YIELD
8613 if eval $compile; then
8615 sched_yield='sched_yield()'
8619 case "$usethreads" in
8622 $define) echo 'sched_yield() found.' >&4 ;;
8623 *) echo 'sched_yield() NOT found.' >&4 ;;
8629 : see if pthread_yield exists
8630 set try -DPTHREAD_YIELD
8631 if eval $compile; then
8633 case "$sched_yield" in
8634 '') sched_yield='pthread_yield()' ;;
8637 set try -DPTHREAD_YIELD_NULL
8638 if eval $compile; then
8640 case "$sched_yield" in
8641 '') sched_yield='pthread_yield(NULL)' ;;
8647 case "$usethreads" in
8650 $define) echo 'pthread_yield() found.' >&4 ;;
8651 *) echo 'pthread_yield() NOT found.' >&4 ;;
8658 case "$sched_yield" in
8659 '') sched_yield=undef ;;
8664 : see if this is a pwd.h system
8670 xxx=`./findhdr pwd.h`
8671 $cppstdin $cppflags $cppminus < $xxx >$$.h
8673 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
8681 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
8689 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
8697 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
8705 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
8713 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
8721 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
8729 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
8741 set d_pwquota; eval $setvar
8742 set d_pwage; eval $setvar
8743 set d_pwchange; eval $setvar
8744 set d_pwclass; eval $setvar
8745 set d_pwexpire; eval $setvar
8746 set d_pwcomment; eval $setvar
8747 set d_pwgecos; eval $setvar
8748 set d_pwpasswd; eval $setvar
8752 : see if readdir and friends exist
8753 set readdir d_readdir
8755 set seekdir d_seekdir
8757 set telldir d_telldir
8759 set rewinddir d_rewinddir
8762 : see if readlink exists
8763 set readlink d_readlink
8766 : see if readv exists
8770 : see if rename exists
8774 : see if rmdir exists
8778 : see if memory.h is available.
8783 : See if it conflicts with string.h
8789 $cppstdin $cppflags $cppminus < $strings > mem.h
8790 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
8792 echo "We won't be including <memory.h>."
8802 : can bcopy handle overlapping blocks?
8807 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
8814 $cat >>try.c <<'EOCP'
8817 # include <memory.h>
8820 # include <stdlib.h>
8823 # include <string.h>
8825 # include <strings.h>
8828 # include <unistd.h> /* Needed for NetBSD */
8832 char buf[128], abc[128];
8838 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
8840 for (align = 7; align >= 0; align--) {
8841 for (len = 36; len; len--) {
8844 for (off = 1; off <= len; off++) {
8845 bcopy(b, b+off, len);
8846 bcopy(b+off, b, len);
8847 if (bcmp(b, abc, len))
8856 if eval $compile_ok; then
8857 if ./try 2>/dev/null; then
8861 echo "It can't, sorry."
8862 case "$d_memmove" in
8863 "$define") echo "But that's Ok since you have memmove()." ;;
8867 echo "(I can't compile the test program, so we'll assume not...)"
8868 case "$d_memmove" in
8869 "$define") echo "But that's Ok since you have memmove()." ;;
8874 $rm -f try.* try core
8878 : can memcpy handle overlapping blocks?
8883 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
8890 $cat >>try.c <<'EOCP'
8893 # include <memory.h>
8896 # include <stdlib.h>
8899 # include <string.h>
8901 # include <strings.h>
8904 # include <unistd.h> /* Needed for NetBSD */
8908 char buf[128], abc[128];
8914 /* Copy "abcde..." string to char abc[] so that gcc doesn't
8915 try to store the string in read-only memory. */
8916 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
8918 for (align = 7; align >= 0; align--) {
8919 for (len = 36; len; len--) {
8921 memcpy(b, abc, len);
8922 for (off = 1; off <= len; off++) {
8923 memcpy(b+off, b, len);
8924 memcpy(b, b+off, len);
8925 if (memcmp(b, abc, len))
8934 if eval $compile_ok; then
8935 if ./try 2>/dev/null; then
8939 echo "It can't, sorry."
8940 case "$d_memmove" in
8941 "$define") echo "But that's Ok since you have memmove()." ;;
8945 echo "(I can't compile the test program, so we'll assume not...)"
8946 case "$d_memmove" in
8947 "$define") echo "But that's Ok since you have memmove()." ;;
8952 $rm -f try.* try core
8956 : can memcmp be trusted to compare relative magnitude?
8961 echo "Checking if your memcmp() can compare relative magnitude..." >&4
8968 $cat >>try.c <<'EOCP'
8971 # include <memory.h>
8974 # include <stdlib.h>
8977 # include <string.h>
8979 # include <strings.h>
8982 # include <unistd.h> /* Needed for NetBSD */
8988 if ((a < b) && memcmp(&a, &b, 1) < 0)
8994 if eval $compile_ok; then
8995 if ./try 2>/dev/null; then
8999 echo "No, it can't (it uses signed chars)."
9002 echo "(I can't compile the test program, so we'll assume not...)"
9006 $rm -f try.* try core
9010 : see if select exists
9014 : see if semctl exists
9018 : see if semget exists
9022 : see if semop exists
9026 : see how much of the 'sem*(2)' library is present.
9029 case "$d_semctl$d_semget$d_semop" in
9030 *"$undef"*) h_sem=false;;
9034 case "`ipcs 2>&1`" in
9035 "SVID messages"*"not configured"*)
9036 echo "Your $osname does not have the sem*(2) configured." >&4
9049 : we could also check for sys/ipc.h ...
9050 if $h_sem && $test `./findhdr sys/sem.h`; then
9051 echo "You have the full sem*(2) library." >&4
9054 echo "You don't have the full sem*(2) library." >&4
9060 : see whether sys/sem.h defines union semun
9062 $cat > try.c <<'END'
9063 #include <sys/types.h>
9064 #include <sys/ipc.h>
9065 #include <sys/sem.h>
9066 int main () { union semun semun; semun.buf = 0; }
9069 if eval $compile; then
9070 echo "You have union semun in <sys/sem.h>." >&4
9073 echo "You do not have union semun in <sys/sem.h>." >&4
9076 $rm -f try try.c try.h
9080 : see how to do semctl IPC_STAT
9083 : see whether semctl IPC_STAT can use union semun
9088 # define S_IRUSR S_IREAD
9089 # define S_IWUSR S_IWRITE
9090 # define S_IXUSR S_IEXEC
9092 # define S_IRUSR 0400
9093 # define S_IWUSR 0200
9094 # define S_IXUSR 0100
9096 # define S_IRGRP (S_IRUSR>>3)
9097 # define S_IWGRP (S_IWUSR>>3)
9098 # define S_IXGRP (S_IXUSR>>3)
9099 # define S_IROTH (S_IRUSR>>6)
9100 # define S_IWOTH (S_IWUSR>>6)
9101 # define S_IXOTH (S_IXUSR>>6)
9104 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9105 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9106 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9111 #include <sys/types.h>
9112 #include <sys/ipc.h>
9113 #include <sys/sem.h>
9114 #include <sys/stat.h>
9121 #$d_union_semun HAS_UNION_SEMUN
9124 #ifndef HAS_UNION_SEMUN
9127 struct semid_ds *buf;
9128 unsigned short *array;
9134 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9135 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9137 struct semid_ds argbuf;
9140 st = semctl(sem, 0, IPC_STAT, arg);
9144 # endif /* IPC_STAT */
9145 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9147 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9148 # endif /* IPC_RMID */
9149 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9151 #endif /* IPC_PRIVATE && ... */
9152 printf("semget failed: errno = %d\n", errno);
9158 if eval $compile; then
9161 semun) val="$define" ;;
9167 case "$d_semctl_semun" in
9169 echo "You can use union semun for semctl IPC_STAT." >&4
9172 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9177 : see whether semctl IPC_STAT can use struct semid_ds pointer
9178 $cat > try.c <<'END'
9179 #include <sys/types.h>
9180 #include <sys/ipc.h>
9181 #include <sys/sem.h>
9182 #include <sys/stat.h>
9190 struct semid_ds arg;
9193 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9194 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9197 st = semctl(sem, 0, IPC_STAT, &arg);
9199 printf("semid_ds\n");
9201 # endif /* IPC_STAT */
9202 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9204 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9205 # endif /* IPC_RMID */
9206 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9208 #endif /* IPC_PRIVATE && ... */
9209 printf("semget failed: errno = %d\n", errno);
9216 if eval $compile; then
9219 semid_ds) val="$define" ;;
9223 set d_semctl_semid_ds
9225 case "$d_semctl_semid_ds" in
9227 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9229 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9236 # We do not have the full sem*(2) library, so assume we can not
9242 set d_semctl_semid_ds
9247 : see if setegid exists
9248 set setegid d_setegid
9251 : see if seteuid exists
9252 set seteuid d_seteuid
9255 : see if setgrent exists
9256 set setgrent d_setgrent
9259 : see if sethostent exists
9260 set sethostent d_sethent
9263 : see if setlinebuf exists
9264 set setlinebuf d_setlinebuf
9267 : see if setlocale exists
9268 set setlocale d_setlocale
9271 : see if setnetent exists
9272 set setnetent d_setnent
9275 : see if setprotoent exists
9276 set setprotoent d_setpent
9279 : see if setpgid exists
9280 set setpgid d_setpgid
9283 : see if setpgrp2 exists
9284 set setpgrp2 d_setpgrp2
9287 : see if setpriority exists
9288 set setpriority d_setprior
9291 : see if setpwent exists
9292 set setpwent d_setpwent
9295 : see if setregid exists
9296 set setregid d_setregid
9298 set setresgid d_setresgid
9301 : see if setreuid exists
9302 set setreuid d_setreuid
9304 set setresuid d_setresuid
9307 : see if setrgid exists
9308 set setrgid d_setrgid
9311 : see if setruid exists
9312 set setruid d_setruid
9315 : see if setservent exists
9316 set setservent d_setsent
9319 : see if setsid exists
9323 : see if setvbuf exists
9324 set setvbuf d_setvbuf
9327 : see if sfio.h is available
9332 : see if sfio library is available
9343 : Ok, but do we want to use it.
9347 true|$define|[yY]*) dflt='y';;
9350 echo "$package can use the sfio library, but it is experimental."
9351 rp="You seem to have sfio available, do you want to try using it?"
9355 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
9357 : Remove sfio from list of libraries to use
9358 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
9361 echo "libs = $libs" >&4
9365 *) case "$usesfio" in
9367 echo "Sorry, cannot find sfio on this machine" >&4
9368 echo "Ignoring your setting of usesfio=$usesfio" >&4
9376 $define) usesfio='true';;
9377 *) usesfio='false';;
9380 : see if shmctl exists
9384 : see if shmget exists
9388 : see if shmat exists
9391 : see what shmat returns
9394 $cat >shmat.c <<'END'
9395 #include <sys/shm.h>
9398 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
9403 echo "and it returns ($shmattype)." >&4
9404 : see if a prototype for shmat is available
9405 xxx=`./findhdr sys/shm.h`
9406 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
9407 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
9418 set d_shmatprototype
9421 : see if shmdt exists
9425 : see how much of the 'shm*(2)' library is present.
9428 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
9429 *"$undef"*) h_shm=false;;
9433 case "`ipcs 2>&1`" in
9434 "SVID shared memory"*"not configured"*)
9435 echo "Your $osname does not have the shm*(2) configured." >&4
9450 : we could also check for sys/ipc.h ...
9451 if $h_shm && $test `./findhdr sys/shm.h`; then
9452 echo "You have the full shm*(2) library." >&4
9455 echo "You don't have the full shm*(2) library." >&4
9462 : see if we have sigaction
9463 if set sigaction val -f d_sigaction; eval $csym; $val; then
9464 echo 'sigaction() found.' >&4
9465 $cat > try.c <<'EOP'
9467 #include <sys/types.h>
9471 struct sigaction act, oact;
9475 if eval $compile_ok; then
9478 echo "But you don't seem to have a useable struct sigaction." >&4
9482 echo 'sigaction NOT found.' >&4
9485 set d_sigaction; eval $setvar
9486 $rm -f try try$_o try.c
9488 : see if sigsetjmp exists
9490 case "$d_sigsetjmp" in
9498 if (sigsetjmp(env,1))
9506 if eval $compile; then
9507 if ./try >/dev/null 2>&1; then
9508 echo "POSIX sigsetjmp found." >&4
9512 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
9518 echo "sigsetjmp not found." >&4
9522 *) val="$d_sigsetjmp"
9523 case "$d_sigsetjmp" in
9524 $define) echo "POSIX sigsetjmp found." >&4;;
9525 $undef) echo "sigsetjmp not found." >&4;;
9533 : see if stat knows about block sizes
9535 set d_statblks stat st_blocks $i_sysstat sys/stat.h
9538 : see if _ptr and _cnt from stdio act std
9540 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
9541 echo "(Looks like you have stdio.h from Linux.)"
9542 case "$stdio_ptr" in
9543 '') stdio_ptr='((fp)->_IO_read_ptr)'
9546 *) ptr_lval=$d_stdio_ptr_lval;;
9548 case "$stdio_cnt" in
9549 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
9552 *) cnt_lval=$d_stdio_cnt_lval;;
9554 case "$stdio_base" in
9555 '') stdio_base='((fp)->_IO_read_base)';;
9557 case "$stdio_bufsiz" in
9558 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
9561 case "$stdio_ptr" in
9562 '') stdio_ptr='((fp)->_ptr)'
9565 *) ptr_lval=$d_stdio_ptr_lval;;
9567 case "$stdio_cnt" in
9568 '') stdio_cnt='((fp)->_cnt)'
9571 *) cnt_lval=$d_stdio_cnt_lval;;
9573 case "$stdio_base" in
9574 '') stdio_base='((fp)->_base)';;
9576 case "$stdio_bufsiz" in
9577 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
9580 : test whether _ptr and _cnt really work
9581 echo "Checking how std your stdio is..." >&4
9584 #define FILE_ptr(fp) $stdio_ptr
9585 #define FILE_cnt(fp) $stdio_cnt
9587 FILE *fp = fopen("try.c", "r");
9590 18 <= FILE_cnt(fp) &&
9591 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
9599 if eval $compile; then
9601 echo "Your stdio acts pretty std."
9604 echo "Your stdio isn't very std."
9607 echo "Your stdio doesn't appear very std."
9613 : Can _ptr be used as an lvalue?
9614 case "$d_stdstdio$ptr_lval" in
9615 $define$define) val=$define ;;
9618 set d_stdio_ptr_lval
9621 : Can _cnt be used as an lvalue?
9622 case "$d_stdstdio$cnt_lval" in
9623 $define$define) val=$define ;;
9626 set d_stdio_cnt_lval
9629 : see if _base is also standard
9631 case "$d_stdstdio" in
9635 #define FILE_base(fp) $stdio_base
9636 #define FILE_bufsiz(fp) $stdio_bufsiz
9638 FILE *fp = fopen("try.c", "r");
9641 19 <= FILE_bufsiz(fp) &&
9642 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
9649 if eval $compile; then
9651 echo "And its _base field acts std."
9654 echo "But its _base field isn't std."
9657 echo "However, it seems to be lacking the _base field."
9665 : see if strcoll exists
9666 set strcoll d_strcoll
9669 : check for structure copying
9671 echo "Checking to see if your C compiler can copy structs..." >&4
9672 $cat >try.c <<'EOCP'
9682 if $cc -c try.c >/dev/null 2>&1 ; then
9687 echo "Nope, it can't."
9693 : see if strerror and/or sys_errlist[] exist
9695 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
9696 if set strerror val -f d_strerror; eval $csym; $val; then
9697 echo 'strerror() found.' >&4
9698 d_strerror="$define"
9699 d_strerrm='strerror(e)'
9700 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9701 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
9702 d_syserrlst="$define"
9704 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
9705 d_syserrlst="$undef"
9707 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
9708 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
9709 echo 'strerror() found in string header.' >&4
9710 d_strerror="$define"
9711 d_strerrm='strerror(e)'
9712 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9713 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
9714 d_syserrlst="$define"
9716 echo "(You don't appear to have any sys_errlist[], how can this be?)"
9717 d_syserrlst="$undef"
9719 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9720 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
9722 d_syserrlst="$define"
9723 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
9725 echo 'strerror() and sys_errlist[] NOT found.' >&4
9727 d_syserrlst="$undef"
9728 d_strerrm='"unknown"'
9732 : see if strtod exists
9736 : see if strtol exists
9740 : see if strtoul exists
9741 set strtoul d_strtoul
9744 : see if strxfrm exists
9745 set strxfrm d_strxfrm
9748 : see if symlink exists
9749 set symlink d_symlink
9752 : see if syscall exists
9753 set syscall d_syscall
9756 : see if sysconf exists
9757 set sysconf d_sysconf
9760 : see if system exists
9764 : see if tcgetpgrp exists
9765 set tcgetpgrp d_tcgetpgrp
9768 : see if tcsetpgrp exists
9769 set tcsetpgrp d_tcsetpgrp
9772 : define an is-a-typedef? function
9773 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9775 "") inclist="sys/types.h";;
9777 eval "varval=\$$var";
9781 for inc in $inclist; do
9782 echo "#include <$inc>" >>temp.c;
9784 echo "#ifdef $type" >> temp.c;
9785 echo "printf(\"We have $type\");" >> temp.c;
9786 echo "#endif" >> temp.c;
9787 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9788 if $contains $type temp.E >/dev/null 2>&1; then
9794 *) eval "$var=\$varval";;
9797 : define an is-a-typedef? function that prompts if the type is not available.
9798 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9800 "") inclist="sys/types.h";;
9802 eval "varval=\$$var";
9806 for inc in $inclist; do
9807 echo "#include <$inc>" >>temp.c;
9809 echo "#ifdef $type" >> temp.c;
9810 echo "printf(\"We have $type\");" >> temp.c;
9811 echo "#endif" >> temp.c;
9812 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9814 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9815 if $contains $type temp.E >/dev/null 2>&1; then
9816 echo "$type found." >&4;
9819 echo "$type NOT found." >&4;
9825 *) eval "$var=\$varval";;
9828 : see if this is a sys/times.h system
9829 set sys/times.h i_systimes
9832 : see if times exists
9834 if set times val -f d_times; eval $csym; $val; then
9835 echo 'times() found.' >&4
9838 case "$i_systimes" in
9839 "$define") inc='sys/times.h';;
9841 rp="What is the type returned by times() on this system?"
9842 set clock_t clocktype long stdio.h sys/types.h $inc
9845 echo 'times() NOT found, hope that will do.' >&4
9850 : see if truncate exists
9851 set truncate d_truncate
9854 : see if tzname[] exists
9856 if set tzname val -a d_tzname; eval $csym; $val; then
9858 echo 'tzname[] found.' >&4
9861 echo 'tzname[] NOT found.' >&4
9866 : see if umask exists
9870 : backward compatibility for d_hvfork
9871 if test X$d_hvfork != X; then
9875 : see if there is a vfork
9880 : Ok, but do we want to use it. vfork is reportedly unreliable in
9881 : perl on Solaris 2.x, and probably elsewhere.
9889 rp="Some systems have problems with vfork(). Do you want to use it?"
9894 echo "Ok, we won't use vfork()."
9903 $define) usevfork='true';;
9904 *) usevfork='false';;
9907 : see if this is an sysdir system
9908 set sys/dir.h i_sysdir
9911 : see if this is an sysndir system
9912 set sys/ndir.h i_sysndir
9915 : see if sys/types.h has to be included
9916 set sys/types.h i_systypes
9919 : see if closedir exists
9920 set closedir d_closedir
9923 case "$d_closedir" in
9926 echo "Checking whether closedir() returns a status..." >&4
9927 cat > closedir.c <<EOM
9928 #$i_dirent I_DIRENT /**/
9929 #$i_sysdir I_SYS_DIR /**/
9930 #$i_sysndir I_SYS_NDIR /**/
9931 #$i_systypes I_SYS_TYPES /**/
9933 #if defined(I_SYS_TYPES)
9934 #include <sys/types.h>
9936 #if defined(I_DIRENT)
9938 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
9939 #include <sys/dir.h>
9943 #include <sys/ndir.h>
9947 #include <ndir.h> /* may be wrong in the future */
9949 #include <sys/dir.h>
9954 int main() { return closedir(opendir(".")); }
9957 if eval $compile_ok; then
9958 if ./closedir > /dev/null 2>&1 ; then
9959 echo "Yes, it does."
9962 echo "No, it doesn't."
9966 echo "(I can't seem to compile the test program--assuming it doesn't)"
9977 : check for volatile keyword
9979 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
9980 $cat >try.c <<'EOCP'
9983 typedef struct _goo_struct goo_struct;
9984 goo_struct * volatile goo = ((goo_struct *)0);
9985 struct _goo_struct {
9990 typedef unsigned short foo_t;
9993 volatile foo_t blech;
9997 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
9999 echo "Yup, it does."
10002 echo "Nope, it doesn't."
10008 : see if there is a wait4
10012 : see if waitpid exists
10013 set waitpid d_waitpid
10016 : see if wcstombs exists
10017 set wcstombs d_wcstombs
10020 : see if wctomb exists
10021 set wctomb d_wctomb
10024 : see if writev exists
10025 set writev d_writev
10028 : preserve RCS keywords in files with variable substitution, grrr
10033 Revision='$Revision'
10035 : check for alignment requirements
10037 case "$alignbytes" in
10038 '') echo "Checking alignment constraints..." >&4
10039 $cat >try.c <<'EOCP'
10046 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
10050 if eval $compile_ok; then
10054 echo "(I can't seem to compile the test program...)"
10057 *) dflt="$alignbytes"
10060 rp="Doubles must be aligned on a how-many-byte boundary?"
10065 : check for ordering of bytes in a long
10066 case "$byteorder" in
10070 In the following, larger digits indicate more significance. A big-endian
10071 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10072 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10073 machines may have weird orders like 3412. A Cray will report 87654321. If
10074 the test program works the default is probably right.
10075 I'm now running the test program...
10077 $cat >try.c <<'EOCP'
10084 char c[sizeof(long)];
10087 if (sizeof(long) > 4)
10088 u.l = (0x08070605L << 32) | 0x04030201L;
10091 for (i = 0; i < sizeof(long); i++)
10092 printf("%c", u.c[i]+'0');
10099 if eval $compile && ./try > /dev/null; then
10102 [1-4][1-4][1-4][1-4]|12345678|87654321)
10103 echo "(The test program ran ok.)"
10104 echo "byteorder=$dflt"
10107 ????|????????) echo "(The test program ran ok.)" ;;
10108 *) echo "(The test program didn't run right for some reason.)" ;;
10113 (I can't seem to compile the test program. Guessing big-endian...)
10116 case "$xxx_prompt" in
10118 rp="What is the order of bytes in a long?"
10129 : how do we catenate cpp tokens here?
10131 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10132 $cat >cpp_stuff.c <<'EOCP'
10133 #define RCAT(a,b)a/**/b
10134 #define ACAT(a,b)a ## b
10138 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10139 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10140 echo "Oh! Smells like ANSI's been here." >&4
10141 echo "We can catify or stringify, separately or together!"
10143 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10144 echo "Ah, yes! The good old days!" >&4
10145 echo "However, in the good old days we don't know how to stringify and"
10146 echo "catify at the same time."
10150 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10151 to have to edit the values of CAT[2-5] in config.h...
10153 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10157 : see if this is a db.h system
10163 : Check db version.
10165 echo "Checking Berkeley DB version ..." >&4
10171 #include <sys/types.h>
10176 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
10177 int Major, Minor, Patch ;
10178 unsigned long Version ;
10179 (void)db_version(&Major, &Minor, &Patch) ;
10180 printf("You have Berkeley DB Version 2 or greater\n");
10182 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
10183 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
10184 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
10185 Major, Minor, Patch) ;
10187 /* check that db.h & libdb are compatible */
10188 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
10189 printf("db.h and libdb are incompatible\n") ;
10193 printf("db.h and libdb are compatible\n") ;
10195 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
10196 + DB_VERSION_PATCH ;
10198 /* needs to be >= 2.3.4 */
10199 if (Version < 2003004) {
10200 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
10201 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
10207 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
10208 printf("You have Berkeley DB Version 1\n");
10209 exit(0); /* DB version < 2: the coast is clear. */
10211 exit(1); /* <db.h> not Berkeley DB? */
10217 if eval $compile && ./try; then
10218 echo 'Looks OK.' >&4
10220 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
10224 : Remove db from list of libraries to use
10225 echo "Removing unusable -ldb from library list" >&4
10226 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
10229 echo "libs = $libs" >&4
10239 : Check the return type needed for hash
10241 echo "Checking return type needed for hash for Berkeley DB ..." >&4
10247 #include <sys/types.h>
10250 #ifndef DB_VERSION_MAJOR
10251 u_int32_t hash_cb (ptr, size)
10259 info.hash = hash_cb;
10263 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10264 if $contains warning try.out >>/dev/null 2>&1 ; then
10267 db_hashtype='u_int32_t'
10270 : XXX Maybe we should just give up here.
10271 db_hashtype=u_int32_t
10273 echo "Help: I can't seem to compile the db test program." >&4
10274 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
10277 echo "Your version of Berkeley DB uses $db_hashtype for hash."
10279 *) db_hashtype=u_int32_t
10284 : Check the return type needed for prefix
10286 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
10292 #include <sys/types.h>
10295 #ifndef DB_VERSION_MAJOR
10296 size_t prefix_cb (key1, key2)
10304 info.prefix = prefix_cb;
10308 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10309 if $contains warning try.out >>/dev/null 2>&1 ; then
10310 db_prefixtype='int'
10312 db_prefixtype='size_t'
10315 db_prefixtype='size_t'
10316 : XXX Maybe we should just give up here.
10318 echo "Help: I can't seem to compile the db test program." >&4
10319 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
10322 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
10324 *) db_prefixtype='size_t'
10328 : check for void type
10330 echo "Checking to see how well your C compiler groks the void type..." >&4
10331 case "$voidflags" in
10333 $cat >try.c <<'EOCP'
10339 extern void moo(); /* function returning void */
10340 void (*goo)(); /* ptr to func returning void */
10342 void *hue; /* generic ptr */
10357 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
10358 voidflags=$defvoidused
10359 echo "Good. It appears to support void to the level $package wants.">&4
10360 if $contains warning .out >/dev/null 2>&1; then
10361 echo "However, you might get some warnings that look like this:"
10365 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
10366 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
10367 echo "It supports 1..."
10368 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
10369 echo "It also supports 2..."
10370 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
10372 echo "And it supports 4 but not 8 definitely."
10374 echo "It doesn't support 4..."
10375 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
10377 echo "But it supports 8."
10380 echo "Neither does it support 8."
10384 echo "It does not support 2..."
10385 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
10387 echo "But it supports 4 and 8."
10389 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
10391 echo "And it supports 4 but has not heard about 8."
10393 echo "However it supports 8 but not 4."
10398 echo "There is no support at all for void."
10403 case "$voidflags" in
10405 *) $cat >&4 <<'EOM'
10406 Support flag bits are:
10407 1: basic void declarations.
10408 2: arrays of pointers to functions returning void.
10409 4: operations between pointers to and addresses of void functions.
10410 8: generic void pointers.
10413 rp="Your void support flags add up to what?"
10421 : How can we generate normalized random numbers ?
10423 echo "Looking for a random number function..." >&4
10424 case "$randfunc" in
10426 if set drand48 val -f; eval $csym; $val; then
10428 echo "Good, found drand48()." >&4
10429 elif set random val -f; eval $csym; $val; then
10431 echo "OK, found random()." >&4
10434 echo "Yick, looks like I have to use rand()." >&4
10445 *-Dmy_rand=*|*-Dmy_srand=*)
10446 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
10447 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
10448 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
10449 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
10453 while $test "$cont"; do
10454 rp="Use which function to generate random numbers?"
10456 if $test "$ans" = "$dflt"; then
10462 if set $ans val -f; eval $csym; $val; then
10466 rp="I cannot find function $ans. Use that name anyway?"
10475 case "$randfunc" in
10477 drand01="drand48()"
10483 case "$randbits" in
10485 echo "Checking to see how many bits your $randfunc() function produces..." >&4
10487 #$i_unistd I_UNISTD
10488 #$i_stdlib I_STDLIB
10491 # include <unistd.h>
10494 # include <stdlib.h>
10499 register unsigned long tmp;
10500 register unsigned long max = 0L;
10502 for (i = 1000; i; i--) {
10503 tmp = (unsigned long) $randfunc();
10504 if (tmp > max) max = tmp;
10506 for (i = 0; max; i++)
10512 if eval $compile_ok; then
10516 echo "(I can't seem to compile the test program...)"
10523 rp="How many bits does your $randfunc() function produce?"
10527 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10528 seedfunc="s$randfunc"
10529 randseedtype=unsigned
10533 rp="How many bits does your $randfunc() function produce?"
10536 seedfunc="s$randfunc"
10537 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10538 if set $seedfunc val -f; eval $csym; $val; then
10539 echo "(Using $seedfunc() to seed random generator)"
10541 echo "(Warning: no $seedfunc() to seed random generator)"
10544 randseedtype=unsigned
10552 echo "Determining whether or not we are on an EBCDIC system..." >&4
10553 $cat >tebcdic.c <<'EOM'
10556 if ('M'==0xd4) return 0;
10563 if eval $compile_ok; then
10565 echo "You have EBCDIC." >&4
10568 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
10571 echo "I'm unable to compile the test program." >&4
10572 echo "I'll assume ASCII or some ISO Latin." >&4
10574 $rm -f tebcdic.c tebcdic
10578 : see what type file positions are declared as in the library
10579 rp="What is the type for file position used by fsetpos()?"
10580 set fpos_t fpostype long stdio.h sys/types.h
10583 : Store the full pathname to the sed program for use in the C program
10586 : see what type gids are declared as in the kernel
10588 echo "Looking for the type for group ids returned by getgid()."
10589 set gid_t gidtype xxx stdio.h sys/types.h
10593 xxx=`./findhdr sys/user.h`
10594 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
10596 unsigned) dflt="$1 $2" ;;
10600 *) dflt="$gidtype";;
10603 gid_t) echo "gid_t found." ;;
10604 *) rp="What is the type for group ids returned by getgid()?"
10610 : see if getgroups exists
10611 set getgroups d_getgrps
10614 : see if setgroups exists
10615 set setgroups d_setgrps
10619 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
10621 case "$d_getgrps$d_setgrps" in
10623 case "$groupstype" in
10624 '') dflt="$gidtype" ;;
10625 *) dflt="$groupstype" ;;
10628 What type of pointer is the second argument to getgroups() and setgroups()?
10629 Usually this is the same as group ids, $gidtype, but not always.
10632 rp='What type pointer is the second argument to getgroups() and setgroups()?'
10636 *) groupstype="$gidtype";;
10639 : see what type lseek is declared as in the kernel
10640 rp="What is the type used for lseek's offset on this system?"
10641 set off_t lseektype long stdio.h sys/types.h
10645 $echo $n "Checking to see how big your file offsets are...$c" >&4
10647 #include <sys/types.h>
10651 printf("%d\n", sizeof($lseektype));
10655 if eval $compile_ok; then
10657 $echo " $lseeksize bytes." >&4
10661 echo "(I can't seem to compile the test program. Guessing...)"
10662 rp="What is the size of your file offsets (in bytes)?"
10669 echo "Checking if your $make program sets \$(MAKE)..." >&4
10670 case "$make_set_make" in
10672 $sed 's/^X //' > testmake.mak << 'EOF'
10674 X @echo 'maketemp="$(MAKE)"'
10676 case "`$make -f testmake.mak 2>/dev/null`" in
10677 *maketemp=*) make_set_make='#' ;;
10678 *) make_set_make="MAKE=$make" ;;
10680 $rm -f testmake.mak
10683 case "$make_set_make" in
10684 '#') echo "Yup, it does.";;
10685 *) echo "Nope, it doesn't.";;
10688 : see what type is used for mode_t
10689 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
10690 set mode_t modetype int stdio.h sys/types.h
10693 : define a fucntion to check prototypes
10694 $cat > protochk <<EOSH
10697 optimize="$optimize"
10699 prototype="$prototype"
10704 $cat >> protochk <<'EOSH'
10709 while test $# -ge 2; do
10711 $define) echo "#include <$2>" >> try.c ;;
10712 literal) echo "$2" >> try.c ;;
10716 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10717 cat >> try.c <<'EOCP'
10718 #ifdef CAN_PROTOTYPE
10719 #define _(args) args
10724 echo "$foo" >> try.c
10725 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10726 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10732 $eunicefix protochk
10734 : see what type is used for size_t
10735 rp="What is the type used for the length parameter for string functions?"
10736 set size_t sizetype 'unsigned int' stdio.h sys/types.h
10739 : check for type of arguments to gethostbyaddr.
10740 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
10741 case "$d_gethbyaddr" in
10745 Checking to see what type of arguments are accepted by gethostbyaddr().
10747 hdrs="$define sys/types.h
10748 $d_socket sys/socket.h
10749 $i_niin netinet/in.h
10751 $i_unistd unistd.h"
10752 : The first arg can 'char *' or 'void *'
10753 : The second arg is some of integral type
10754 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
10755 for yyy in size_t long int; do
10756 case "$netdb_host_type" in
10757 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
10758 if ./protochk "$try" $hdrs; then
10759 echo "Your system accepts $xxx for the first arg."
10760 echo "...and $yyy for the second arg."
10761 netdb_host_type="$xxx"
10762 netdb_hlen_type="$yyy"
10768 : In case none of those worked, prompt the user.
10769 case "$netdb_host_type" in
10770 '') rp='What is the type for the 1st argument to gethostbyaddr?'
10773 netdb_host_type=$ans
10774 rp='What is the type for the 2nd argument to gethostbyaddr?'
10777 netdb_hlen_type=$ans
10781 *) : no gethostbyaddr, so pick harmless defaults
10782 netdb_host_type='char *'
10783 netdb_hlen_type="$sizetype"
10786 # Remove the "const" if needed. -- but then we'll have a
10788 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
10791 : check for type of argument to gethostbyname.
10792 if test "X$netdb_name_type" = X ; then
10793 case "$d_gethbyname" in
10797 Checking to see what type of argument is accepted by gethostbyname().
10799 hdrs="$define sys/types.h
10800 $d_socket sys/socket.h
10801 $i_niin netinet/in.h
10803 $i_unistd unistd.h"
10804 for xxx in "const char *" "char *"; do
10805 case "$netdb_name_type" in
10806 '') try="extern struct hostent *gethostbyname($xxx);"
10807 if ./protochk "$try" $hdrs; then
10808 echo "Your system accepts $xxx."
10809 netdb_name_type="$xxx"
10814 : In case none of those worked, prompt the user.
10815 case "$netdb_name_type" in
10816 '') rp='What is the type for the 1st argument to gethostbyname?'
10819 netdb_name_type=$ans
10823 *) : no gethostbyname, so pick harmless default
10824 netdb_name_type='char *'
10829 : check for type of 1st argument to getnetbyaddr.
10830 if test "X$netdb_net_type" = X ; then
10831 case "$d_getnbyaddr" in
10835 Checking to see what type of 1st argument is accepted by getnetbyaddr().
10837 hdrs="$define sys/types.h
10838 $d_socket sys/socket.h
10839 $i_niin netinet/in.h
10841 $i_unistd unistd.h"
10842 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
10843 case "$netdb_net_type" in
10844 '') try="extern struct netent *getnetbyaddr($xxx, int);"
10845 if ./protochk "$try" $hdrs; then
10846 echo "Your system accepts $xxx."
10847 netdb_net_type="$xxx"
10852 : In case none of those worked, prompt the user.
10853 case "$netdb_net_type" in
10854 '') rp='What is the type for the 1st argument to getnetbyaddr?'
10857 netdb_net_type=$ans
10861 *) : no getnetbyaddr, so pick harmless default
10862 netdb_net_type='long'
10866 : locate the preferred pager for this system
10880 '') dflt=/usr/ucb/more;;
10887 rp='What pager is used on your system?'
10891 : see what type pids are declared as in the kernel
10892 rp="What is the type of process ids on this system?"
10893 set pid_t pidtype int stdio.h sys/types.h
10896 : check for length of pointer
10900 $echo $n "Checking to see how big your pointers are...$c" >&4
10901 if test "$voidflags" -gt 7; then
10902 echo '#define VOID_PTR char *' > try.c
10904 echo '#define VOID_PTR void *' > try.c
10906 $cat >>try.c <<'EOCP'
10910 printf("%d\n", sizeof(VOID_PTR));
10915 if eval $compile_ok; then
10917 $echo " $ptrsize bytes." >&4
10920 echo "(I can't seem to compile the test program. Guessing...)" >&4
10921 rp="What is the size of a pointer (in bytes)?"
10929 : see if ar generates random libraries by itself
10931 echo "Checking how to generate random libraries on your machine..." >&4
10932 echo 'int bar1() { return bar2(); }' > bar1.c
10933 echo 'int bar2() { return 2; }' > bar2.c
10934 $cat > foo.c <<'EOP'
10935 main() { printf("%d\n", bar1()); exit(0); }
10937 $cc $ccflags -c bar1.c >/dev/null 2>&1
10938 $cc $ccflags -c bar2.c >/dev/null 2>&1
10939 $cc $ccflags -c foo.c >/dev/null 2>&1
10940 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
10941 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
10942 ./foobar >/dev/null 2>&1; then
10943 echo "$ar appears to generate random libraries itself."
10946 elif $ar ts bar$_a >/dev/null 2>&1 &&
10947 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
10948 ./foobar >/dev/null 2>&1; then
10949 echo "a table of contents needs to be added with '$ar ts'."
10956 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
10957 $test -f $ranlib || ranlib=''
10960 if $test -n "$ranlib"; then
10961 echo "your system has '$ranlib'; we'll use that."
10964 echo "your system doesn't seem to support random libraries"
10965 echo "so we'll use lorder and tsort to order the libraries."
10972 : check for type of arguments to select.
10973 case "$selecttype" in
10974 '') case "$d_select" in
10977 Checking to see what type of arguments are accepted by select().
10979 hdrs="$define sys/types.h
10980 $i_systime sys/time.h
10981 $i_sysselct sys/select.h
10982 $d_socket sys/socket.h"
10983 : The first arg can be int, unsigned, or size_t
10984 : The last arg may or may not be 'const'
10986 : void pointer has been seen but using that
10987 : breaks the selectminbits test
10988 for xxx in 'fd_set *' 'int *'; do
10989 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
10990 for tmo in 'struct timeval *' 'const struct timeval *'; do
10992 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
10993 if ./protochk "$try" $hdrs; then
10994 echo "Your system accepts $xxx."
11003 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
11004 case "$d_fd_set" in
11005 $define) dflt="fd_set *" ;;
11014 *) : no select, so pick a harmless default
11021 : check for the select 'width'
11022 case "$selectminbits" in
11023 '') case "$d_select" in
11027 Checking to see on how many bits at a time your select() operates...
11030 #include <sys/types.h>
11032 #$i_systime I_SYS_TIME
11033 #$i_systimek I_SYS_TIME_KERNEL
11038 # ifdef I_SYS_TIME_KERNEL
11041 # include <sys/time.h>
11042 # ifdef I_SYS_TIME_KERNEL
11046 #$i_sysselct I_SYS_SELECT
11047 #ifdef I_SYS_SELECT
11048 #include <sys/select.h>
11052 #define S sizeof(*(b))
11054 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
11055 #define NBITS (NBYTES * 8)
11064 fp = fopen("try.c", "r");
11070 b = ($selecttype)s;
11071 for (i = 0; i < NBITS; i++)
11075 select(fd + 1, b, 0, 0, &t);
11076 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
11077 printf("%d\n", i + 1);
11082 if eval $compile_ok; then
11083 selectminbits=`./try`
11084 case "$selectminbits" in
11086 Cannot figure out on how many bits at a time your select() operates.
11087 I'll play safe and guess it is 32 bits.
11093 *) bits="$selectminbits bits" ;;
11095 echo "Your select() operates on $bits at a time." >&4
11097 rp='What is the minimum number of bits your select() operates on?'
11098 case "$byteorder" in
11099 1234|12345678) dflt=32 ;;
11104 selectminbits="$val"
11108 *) : no select, so pick a harmless default
11115 : Trace out the files included by signal.h, then look for SIGxxx names.
11116 : Remove SIGARRAYSIZE used by HPUX.
11117 : Remove SIGTYP void lines used by OS2.
11118 xxx=`echo '#include <signal.h>' |
11119 $cppstdin $cppminus $cppflags 2>/dev/null |
11120 $grep '^[ ]*#.*include' |
11121 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
11122 : Check this list of files to be sure we have parsed the cpp output ok.
11123 : This will also avoid potentially non-existent files, such
11126 for xx in $xxx /dev/null ; do
11127 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
11129 : If we have found no files, at least try signal.h
11130 case "$xxxfiles" in
11131 '') xxxfiles=`./findhdr signal.h` ;;
11134 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
11135 print substr($2, 4, 20)
11137 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
11138 print substr($3, 4, 20)
11140 : Append some common names just in case the awk scan failed.
11141 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
11142 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
11143 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
11144 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
11145 : generate a few handy files for later
11146 $cat > signal.c <<'EOCP'
11147 #include <sys/types.h>
11148 #include <signal.h>
11152 /* Strange style to avoid deeply-nested #if/#else/#endif */
11155 # define NSIG (_NSIG)
11161 # define NSIG (SIGMAX+1)
11167 # define NSIG (SIG_MAX+1)
11173 # define NSIG (MAXSIG+1)
11179 # define NSIG (MAX_SIG+1)
11184 # ifdef SIGARRAYSIZE
11185 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
11191 # define NSIG (_sys_nsig) /* Solaris 2.5 */
11195 /* Default to some arbitrary number that's big enough to get most
11196 of the common signals.
11202 printf("NSIG %d\n", NSIG);
11208 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
11210 printf "#ifdef SIG"; printf $1; printf "\n"
11211 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
11212 printf $1; printf ");\n"
11216 printf "#endif /* JUST_NSIG */\n";
11220 $cat >signal.awk <<'EOP'
11221 BEGIN { ndups = 0 }
11222 $1 ~ /^NSIG$/ { nsig = $2 }
11223 ($1 !~ /^NSIG$/) && (NF == 2) {
11224 if ($2 > maxsig) { maxsig = $2 }
11225 if (sig_name[$2]) {
11226 dup_name[ndups] = $1
11227 dup_num[ndups] = $2
11237 if (nsig == 0) { nsig = maxsig + 1 }
11238 for (n = 1; n < nsig; n++) {
11240 printf("%s %d\n", sig_name[n], sig_num[n])
11243 printf("NUM%d %d\n", n, n)
11246 for (n = 0; n < ndups; n++) {
11247 printf("%s %d\n", dup_name[n], dup_num[n])
11251 $cat >signal_cmd <<EOS
11253 if $test -s signal.lst; then
11254 echo "Using your existing signal.lst file"
11259 $cat >>signal_cmd <<'EOS'
11262 if eval $compile_ok; then
11263 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11265 echo "(I can't seem be able to compile the whole test program)" >&4
11266 echo "(I'll try it in little pieces.)" >&4
11267 set signal -DJUST_NSIG
11268 if eval $compile_ok; then
11269 ./signal$_exe > signal.nsg
11272 echo "I can't seem to figure out how many signals you have." >&4
11273 echo "Guessing 50." >&4
11274 echo 'NSIG 50' > signal.nsg
11276 : Now look at all the signal names, one at a time.
11277 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
11278 $cat > signal.c <<EOCP
11279 #include <sys/types.h>
11280 #include <signal.h>
11283 printf("$xx %d\n", SIG${xx});
11288 if eval $compile; then
11289 echo "SIG${xx} found."
11290 ./signal$_exe >> signal.ls1
11292 echo "SIG${xx} NOT found."
11295 if $test -s signal.ls1; then
11296 $cat signal.nsg signal.ls1 |
11297 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11301 if $test -s signal.lst; then
11304 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
11305 echo 'kill -l' >signal
11306 set X `csh -f <signal`
11310 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
11312 echo $@ | $tr ' ' $trnl | \
11313 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
11315 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
11317 chmod a+x signal_cmd
11318 $eunicefix signal_cmd
11320 : generate list of signal names
11322 case "$sig_name_init" in
11324 *) case "$sig_num_init" in
11325 ''|*,*) doinit=yes ;;
11330 echo "Generating a list of signal names and numbers..." >&4
11332 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
11333 sig_name="ZERO $sig_name"
11334 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
11335 { printf "\"%s\", ", $1 }
11336 END { printf "0\n" }' signal.lst`
11337 sig_num=`$awk '{printf "%d ", $2}' signal.lst`
11338 sig_num="0 $sig_num"
11339 sig_num_init=`$awk 'BEGIN { printf "0, " }
11340 { printf "%d, ", $2}
11341 END { printf "0\n"}' signal.lst`
11344 echo "The following signals are available:"
11346 echo $sig_name | $awk \
11347 'BEGIN { linelen = 0 }
11349 for (i = 1; i <= NF; i++) {
11350 name = "SIG" $i " "
11351 linelen = linelen + length(name)
11352 if (linelen > 70) {
11354 linelen = length(name)
11360 $rm -f signal signal.c signal.awk signal.lst signal_cmd
11362 : see what type is used for signed size_t
11363 set ssize_t ssizetype int stdio.h sys/types.h
11366 $cat > ssize.c <<EOM
11368 #include <sys/types.h>
11369 #define Size_t $sizetype
11370 #define SSize_t $dflt
11373 if (sizeof(Size_t) == sizeof(SSize_t))
11375 else if (sizeof(Size_t) == sizeof(int))
11384 if eval $compile_ok && ./ssize > /dev/null; then
11385 ssizetype=`./ssize`
11386 echo "I'll be using $ssizetype for functions returning a byte count." >&4
11389 Help! I can't compile and run the ssize_t test program: please enlighten me!
11390 (This is probably a misconfiguration in your system or libraries, and
11391 you really ought to fix it. Still, I'll try anyway.)
11393 I need a type that is the same size as $sizetype, but is guaranteed to
11394 be signed. Common values are ssize_t, int and long.
11397 rp="What signed type is the same size as $sizetype?"
11401 $rm -f ssize ssize.*
11403 : see what type of char stdio uses.
11405 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11406 echo "Your stdio uses unsigned chars." >&4
11407 stdchar="unsigned char"
11409 echo "Your stdio uses signed chars." >&4
11413 : see if time exists
11415 if test "X$d_time" = X -o X"$timetype" = X; then
11416 if set time val -f d_time; eval $csym; $val; then
11417 echo 'time() found.' >&4
11419 rp="What is the type returned by time() on this system?"
11420 set time_t timetype long stdio.h sys/types.h
11423 echo 'time() not found, hope that will do.' >&4
11431 : see what type uids are declared as in the kernel
11433 echo "Looking for the type for user ids returned by getuid()."
11434 set uid_t uidtype xxx stdio.h sys/types.h
11438 xxx=`./findhdr sys/user.h`
11439 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
11441 unsigned) dflt="$1 $2" ;;
11445 *) dflt="$uidtype";;
11448 uid_t) echo "uid_t found." ;;
11449 *) rp="What is the type for user ids returned by getuid()?"
11455 : see if dbm.h is available
11456 : see if dbmclose exists
11457 set dbmclose d_dbmclose
11460 case "$d_dbmclose" in
11470 *) set rpcsvc/dbm.h i_rpcsvcdbm
11475 *) echo "We won't be including <dbm.h>"
11485 : see if this is a sys/file.h system
11490 : do we need to include sys/file.h ?
11494 if $h_sysfile; then
11496 echo "We'll be including <sys/file.h>." >&4
11499 echo "We won't be including <sys/file.h>." >&4
11509 : see if fcntl.h is there
11514 : see if we can include fcntl.h
11520 echo "We'll be including <fcntl.h>." >&4
11523 if $h_sysfile; then
11524 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11526 echo "We won't be including <fcntl.h>." >&4
11538 : see if locale.h is available
11539 set locale.h i_locale
11542 : see if mach cthreads are available
11543 if test "X$usethreads" = "X$define"; then
11544 set mach/cthreads.h i_machcthr
11547 i_machcthr="$undef"
11552 : see if this is a math.h system
11556 : see if ndbm.h is available
11561 : see if dbm_open exists
11562 set dbm_open d_dbm_open
11564 case "$d_dbm_open" in
11567 echo "We won't be including <ndbm.h>"
11576 : see if net/errno.h is available
11578 set net/errno.h val
11581 : Unfortunately, it causes problems on some systems. Arrgh.
11584 cat > try.c <<'EOM'
11587 #include <net/errno.h>
11593 if $cc $ccflags -c try.c >/dev/null 2>&1; then
11594 echo "We'll be including <net/errno.h>." >&4
11596 echo "We won't be including <net/errno.h>." >&4
11605 : see if this is a poll.h system
11609 : get C preprocessor symbols handy
11611 $echo $n "Hmm... $c"
11612 echo $al | $tr ' ' $trnl >Cppsym.know
11613 $cat <<EOSS >Cppsym
11621 case "\$list\$#" in
11624 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
11626 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
11629 unknown="\$unknown \$sym"
11639 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
11641 exit 0; _ _ _ _\1\\ \1\\
11644 echo "exit 1; _ _ _" >>Cppsym\$\$
11645 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
11647 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
11653 $rm -f Cppsym\$\$ Cppsym2\$\$
11658 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
11660 : now check the C compiler for additional symbols
11666 for i in \`$cc -v -c tmp.c 2>&1\`
11669 -D*) echo "\$i" | $sed 's/^-D//';;
11670 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
11677 ./ccsym > ccsym1.raw
11678 if $test -s ccsym1.raw; then
11679 $sort ccsym1.raw | $uniq >ccsym.raw
11681 mv ccsym1.raw ccsym.raw
11684 $awk '/\=/ { print $0; next }
11685 { print $0"=1" }' ccsym.raw >ccsym.list
11686 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
11687 $comm -13 ccsym.true ccsym.list >ccsym.own
11688 $comm -12 ccsym.true ccsym.list >ccsym.com
11689 $comm -23 ccsym.true ccsym.list >ccsym.cpp
11692 if $test -z ccsym.raw; then
11693 echo "Your C compiler doesn't seem to define any symbol!" >&4
11695 echo "However, your C preprocessor defines the following ones:"
11698 if $test -s ccsym.com; then
11699 echo "Your C compiler and pre-processor define these symbols:"
11700 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
11703 $test "$silent" || sleep 1
11705 if $test -s ccsym.cpp; then
11706 $test "$also" && echo " "
11707 echo "Your C pre-processor ${also}defines the following $symbols:"
11708 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
11710 $test "$silent" || sleep 1
11712 if $test -s ccsym.own; then
11713 $test "$also" && echo " "
11714 echo "Your C compiler ${also}defines the following cpp variables:"
11715 $sed -e 's/\(.*\)=1/\1/' ccsym.own
11716 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
11717 $test "$silent" || sleep 1
11722 : see if this is a termio system
11726 if $test `./findhdr termios.h`; then
11727 set tcsetattr i_termios
11733 "$define") echo "You have POSIX termios.h... good!" >&4;;
11734 *) if ./Cppsym pyr; then
11735 case "`/bin/universe`" in
11736 ucb) if $test `./findhdr sgtty.h`; then
11738 echo "<sgtty.h> found." >&4
11740 echo "System is pyramid with BSD universe."
11741 echo "<sgtty.h> not found--you could have problems." >&4
11743 *) if $test `./findhdr termio.h`; then
11745 echo "<termio.h> found." >&4
11747 echo "System is pyramid with USG universe."
11748 echo "<termio.h> not found--you could have problems." >&4
11752 if $test `./findhdr termio.h`; then
11753 echo "<termio.h> found." >&4
11755 elif $test `./findhdr sgtty.h`; then
11756 echo "<sgtty.h> found." >&4
11759 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
11762 if $test `./findhdr sgtty.h`; then
11763 echo "<sgtty.h> found." >&4
11765 elif $test `./findhdr termio.h`; then
11766 echo "<termio.h> found." >&4
11769 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
11773 set i_termio; eval $setvar
11774 val=$val2; set i_sgtty; eval $setvar
11775 val=$val3; set i_termios; eval $setvar
11777 : see if stdarg is available
11779 if $test `./findhdr stdarg.h`; then
11780 echo "<stdarg.h> found." >&4
11783 echo "<stdarg.h> NOT found." >&4
11787 : see if varags is available
11789 if $test `./findhdr varargs.h`; then
11790 echo "<varargs.h> found." >&4
11792 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11795 : set up the varargs testing programs
11796 $cat > varargs.c <<EOP
11798 #include <stdarg.h>
11801 #include <varargs.h>
11805 int f(char *p, ...)
11819 p = va_arg(ap, char *);
11824 $cat > varargs <<EOP
11826 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11835 : now check which varargs header should be included
11840 if `./varargs I_STDARG`; then
11842 elif `./varargs I_VARARGS`; then
11847 if `./varargs I_VARARGS`; then
11854 echo "I could not find the definition for va_dcl... You have problems..." >&4
11855 val="$undef"; set i_stdarg; eval $setvar
11856 val="$undef"; set i_varargs; eval $setvar
11861 case "$i_varhdr" in
11863 val="$define"; set i_stdarg; eval $setvar
11864 val="$undef"; set i_varargs; eval $setvar
11867 val="$undef"; set i_stdarg; eval $setvar
11868 val="$define"; set i_varargs; eval $setvar
11871 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11875 : see if stddef is available
11876 set stddef.h i_stddef
11879 : see if sys/access.h is available
11880 set sys/access.h i_sysaccess
11883 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
11884 set sys/filio.h i_sysfilio
11887 if $test `./findhdr sys/ioctl.h`; then
11889 echo '<sys/ioctl.h> found.' >&4
11892 if $test $i_sysfilio = "$define"; then
11893 echo '<sys/ioctl.h> NOT found.' >&4
11895 $test $i_sgtty = "$define" && xxx="sgtty.h"
11896 $test $i_termio = "$define" && xxx="termio.h"
11897 $test $i_termios = "$define" && xxx="termios.h"
11898 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
11904 : see if this is a sys/param system
11905 set sys/param.h i_sysparam
11908 : see if sys/resource.h has to be included
11909 set sys/resource.h i_sysresrc
11912 : see if sys/security.h is available
11913 set sys/security.h i_syssecrt
11916 : see if this is a sys/un.h system
11917 set sys/un.h i_sysun
11920 : see if this is a syswait system
11921 set sys/wait.h i_syswait
11924 : see if this is an utime system
11925 set utime.h i_utime
11928 : see if this is a values.h system
11929 set values.h i_values
11932 : see if this is a vfork system
11935 set vfork.h i_vfork
11943 : see if gdbm.h is available
11948 : see if gdbm_open exists
11949 set gdbm_open d_gdbm_open
11951 case "$d_gdbm_open" in
11954 echo "We won't be including <gdbm.h>"
11964 echo "Looking for extensions..." >&4
11967 : If we are using the old config.sh, known_extensions may contain
11968 : old or inaccurate or duplicate values.
11969 known_extensions=''
11970 nonxs_extensions=''
11971 : We do not use find because it might not be available.
11972 : We do not just use MANIFEST because the user may have dropped
11973 : some additional extensions into the source tree and expect them
11977 DynaLoader|dynaload) ;;
11978 *) if $test -f $xxx/$xxx.xs; then
11979 known_extensions="$known_extensions $xxx"
11980 elif $test -f $xxx/Makefile.PL; then
11981 nonxs_extensions="$nonxs_extensions $xxx"
11983 if $test -d $xxx; then
11984 # Look for nested extensions, eg. Devel/Dprof.
11987 if $test -f $yyy/$yyy.xs; then
11988 known_extensions="$known_extensions $xxx/$yyy"
11989 elif $test -f $yyy/Makefile.PL; then
11990 nonxs_extensions="$nonxs_extensions $xxx/$yyy"
11999 set X $nonxs_extensions
12001 nonxs_extensions="$*"
12002 set X $known_extensions
12004 known_extensions="$*"
12007 : Now see which are supported on this system.
12009 for xxx in $known_extensions ; do
12013 $define) avail_ext="$avail_ext $xxx" ;;
12016 GDBM_File|gdbm_fil)
12018 $define) avail_ext="$avail_ext $xxx" ;;
12021 NDBM_File|ndbm_fil)
12023 $define) avail_ext="$avail_ext $xxx" ;;
12026 ODBM_File|odbm_fil)
12027 case "${i_dbm}${i_rpcsvcdbm}" in
12028 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
12032 case "$useposix" in
12033 true|define|y) avail_ext="$avail_ext $xxx" ;;
12037 case "$useopcode" in
12038 true|define|y) avail_ext="$avail_ext $xxx" ;;
12042 case "$d_socket" in
12043 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12047 case "$usethreads" in
12048 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12052 : XXX Do we need a useipcsysv variable here
12053 case "${d_msg}${d_sem}${d_shm}" in
12054 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
12057 *) avail_ext="$avail_ext $xxx"
12066 : Now see which nonxs extensions are supported on this system.
12067 : For now assume all are.
12069 for xxx in $nonxs_extensions ; do
12071 *) nonxs_ext="$nonxs_ext $xxx"
12083 A number of extensions are supplied with $package. You may choose to
12084 compile these extensions for dynamic loading (the default), compile
12085 them into the $package executable (static loading), or not include
12086 them at all. Answer "none" to include no extensions.
12087 Note that DynaLoader is always built and need not be mentioned here.
12090 case "$dynamic_ext" in
12091 '') dflt="$avail_ext" ;;
12092 *) dflt="$dynamic_ext"
12093 # Perhaps we are reusing an old out-of-date config.sh.
12096 if test X"$dynamic_ext" != X"$avail_ext"; then
12098 NOTICE: Your previous config.sh list may be incorrect.
12099 The extensions now available to you are
12101 but the default list from your previous config.sh is
12113 rp="What extensions do you wish to load dynamically?"
12116 none) dynamic_ext=' ' ;;
12117 *) dynamic_ext="$ans" ;;
12120 case "$static_ext" in
12122 : Exclude those already listed in dynamic linking
12124 for xxx in $avail_ext; do
12125 case " $dynamic_ext " in
12127 *) dflt="$dflt $xxx" ;;
12134 *) dflt="$static_ext"
12141 rp="What extensions do you wish to load statically?"
12144 none) static_ext=' ' ;;
12145 *) static_ext="$ans" ;;
12150 A number of extensions are supplied with $package. Answer "none"
12151 to include no extensions.
12152 Note that DynaLoader is always built and need not be mentioned here.
12155 case "$static_ext" in
12156 '') dflt="$avail_ext" ;;
12157 *) dflt="$static_ext"
12158 # Perhaps we are reusing an old out-of-date config.sh.
12161 if test X"$static_ext" != X"$avail_ext"; then
12163 NOTICE: Your previous config.sh list may be incorrect.
12164 The extensions now available to you are
12166 but the default list from your previous config.sh is
12175 : Exclude those that are not xs extensions
12179 rp="What extensions do you wish to include?"
12182 none) static_ext=' ' ;;
12183 *) static_ext="$ans" ;;
12188 set X $dynamic_ext $static_ext $nonxs_ext
12192 : Remove build directory name from cppstdin so it can be used from
12193 : either the present location or the final installed location.
12195 : Get out of the UU directory to get correct path name.
12197 case "$cppstdin" in
12199 echo "Stripping down cppstdin path name"
12205 : end of configuration questions
12207 echo "End of configuration questions."
12210 : back to where it started
12211 if test -d ../UU; then
12215 : configuration may be patched via a 'config.over' file
12216 if $test -f config.over; then
12219 rp='I see a config.over file. Do you wish to load it?'
12222 n*) echo "OK, I'll ignore it.";;
12224 echo "Configuration override changes have been loaded."
12229 : in case they want portability, strip down executable paths
12230 case "$d_portable" in
12233 echo "Stripping down executable paths..." >&4
12234 for file in $loclist $trylist; do
12235 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
12236 eval $file="\$file"
12242 : create config.sh file
12244 echo "Creating config.sh..." >&4
12245 $spitshell <<EOT >config.sh
12248 # This file was produced by running the Configure script. It holds all the
12249 # definitions figured out by Configure. Should you modify one of these values,
12250 # do not forget to propagate your changes by running "Configure -der". You may
12251 # instead choose to run each of the .SH files by yourself, or "Configure -S".
12254 # Package name : $package
12255 # Source directory : $src
12256 # Configuration time: $cf_time
12257 # Configured by : $cf_by
12258 # Target system : $myuname
12268 Revision='$Revision'
12275 alignbytes='$alignbytes'
12276 ansi2knr='$ansi2knr'
12277 aphostname='$aphostname'
12278 apiversion='$apiversion'
12281 archlibexp='$archlibexp'
12282 archname64='$archname64'
12283 archname='$archname'
12284 archobjs='$archobjs'
12292 byteorder='$byteorder'
12294 castflags='$castflags'
12297 cccdlflags='$cccdlflags'
12298 ccdlflags='$ccdlflags'
12301 cf_email='$cf_email'
12306 clocktype='$clocktype'
12308 compress='$compress'
12309 contains='$contains'
12313 cpp_stuff='$cpp_stuff'
12314 cppflags='$cppflags'
12316 cppminus='$cppminus'
12318 cppstdin='$cppstdin'
12319 cryptlib='$cryptlib'
12321 d_Gconvert='$d_Gconvert'
12322 d_access='$d_access'
12323 d_accessx='$d_accessx'
12325 d_archlib='$d_archlib'
12326 d_attribut='$d_attribut'
12330 d_bsdgetpgrp='$d_bsdgetpgrp'
12331 d_bsdsetpgrp='$d_bsdsetpgrp'
12333 d_casti32='$d_casti32'
12334 d_castneg='$d_castneg'
12335 d_charvspr='$d_charvspr'
12337 d_chroot='$d_chroot'
12338 d_chsize='$d_chsize'
12339 d_closedir='$d_closedir'
12340 d_cmsghdr_s='$d_cmsghdr_s'
12344 d_cuserid='$d_cuserid'
12345 d_dbl_dig='$d_dbl_dig'
12346 d_dbmclose64='$d_dbmclose64'
12347 d_dbminit64='$d_dbminit64'
12348 d_delete64='$d_delete64'
12349 d_difftime='$d_difftime'
12350 d_dirent64_s='$d_dirent64_s'
12351 d_dirnamlen='$d_dirnamlen'
12352 d_dlerror='$d_dlerror'
12353 d_dlopen='$d_dlopen'
12354 d_dlsymun='$d_dlsymun'
12355 d_dosuid='$d_dosuid'
12356 d_drand48proto='$d_drand48proto'
12358 d_eaccess='$d_eaccess'
12359 d_endgrent='$d_endgrent'
12360 d_endhent='$d_endhent'
12361 d_endnent='$d_endnent'
12362 d_endpent='$d_endpent'
12363 d_endpwent='$d_endpwent'
12364 d_endsent='$d_endsent'
12365 d_eofnblk='$d_eofnblk'
12366 d_eunice='$d_eunice'
12367 d_fchmod='$d_fchmod'
12368 d_fchown='$d_fchown'
12370 d_fd_macros='$d_fd_macros'
12371 d_fd_set='$d_fd_set'
12372 d_fds_bits='$d_fds_bits'
12373 d_fetch64='$d_fetch64'
12374 d_fgetpos64='$d_fgetpos64'
12375 d_fgetpos='$d_fgetpos'
12376 d_firstkey64='$d_firstkey64'
12377 d_flexfnam='$d_flexfnam'
12378 d_flock64_s='$d_flock64_s'
12380 d_fopen64='$d_fopen64'
12382 d_fpathconf='$d_fpathconf'
12383 d_freopen64='$d_freopen64'
12384 d_fseek64='$d_fseek64'
12385 d_fseeko64='$d_fseeko64'
12386 d_fseeko='$d_fseeko'
12387 d_fsetpos64='$d_fsetpos64'
12388 d_fsetpos='$d_fsetpos'
12389 d_fstat64='$d_fstat64'
12390 d_ftell64='$d_ftell64'
12391 d_ftello64='$d_ftello64'
12392 d_ftello='$d_ftello'
12394 d_ftruncate64='$d_ftruncate64'
12395 d_getgrent='$d_getgrent'
12396 d_getgrps='$d_getgrps'
12397 d_gethbyaddr='$d_gethbyaddr'
12398 d_gethbyname='$d_gethbyname'
12399 d_gethent='$d_gethent'
12400 d_gethname='$d_gethname'
12401 d_gethostprotos='$d_gethostprotos'
12402 d_getlogin='$d_getlogin'
12403 d_getnbyaddr='$d_getnbyaddr'
12404 d_getnbyname='$d_getnbyname'
12405 d_getnent='$d_getnent'
12406 d_getnetprotos='$d_getnetprotos'
12407 d_getpbyname='$d_getpbyname'
12408 d_getpbynumber='$d_getpbynumber'
12409 d_getpent='$d_getpent'
12410 d_getpgid='$d_getpgid'
12411 d_getpgrp2='$d_getpgrp2'
12412 d_getpgrp='$d_getpgrp'
12413 d_getppid='$d_getppid'
12414 d_getprior='$d_getprior'
12415 d_getprotoprotos='$d_getprotoprotos'
12416 d_getpwent='$d_getpwent'
12417 d_getsbyname='$d_getsbyname'
12418 d_getsbyport='$d_getsbyport'
12419 d_getsent='$d_getsent'
12420 d_getservprotos='$d_getservprotos'
12421 d_gettimeod='$d_gettimeod'
12422 d_gnulibc='$d_gnulibc'
12423 d_grpasswd='$d_grpasswd'
12426 d_inetaton='$d_inetaton'
12427 d_ino64t='$d_ino64t'
12428 d_int64t='$d_int64t'
12429 d_iovec_s='$d_iovec_s'
12430 d_isascii='$d_isascii'
12431 d_killpg='$d_killpg'
12432 d_lchown='$d_lchown'
12434 d_locconv='$d_locconv'
12435 d_lockf64='$d_lockf64'
12437 d_longdbl='$d_longdbl'
12438 d_longlong='$d_longlong'
12439 d_lseek64='$d_lseek64'
12440 d_lstat64='$d_lstat64'
12443 d_mbstowcs='$d_mbstowcs'
12444 d_mbtowc='$d_mbtowc'
12445 d_memcmp='$d_memcmp'
12446 d_memcpy='$d_memcpy'
12447 d_memmove='$d_memmove'
12448 d_memset='$d_memset'
12450 d_mkfifo='$d_mkfifo'
12451 d_mktime='$d_mktime'
12453 d_msg_ctrunc='$d_msg_ctrunc'
12454 d_msg_dontroute='$d_msg_dontroute'
12455 d_msg_oob='$d_msg_oob'
12456 d_msg_peek='$d_msg_peek'
12457 d_msg_proxy='$d_msg_proxy'
12458 d_msgctl='$d_msgctl'
12459 d_msgget='$d_msgget'
12460 d_msghdr_s='$d_msghdr_s'
12461 d_msgrcv='$d_msgrcv'
12462 d_msgsnd='$d_msgsnd'
12463 d_mymalloc='$d_mymalloc'
12464 d_nextkey64='$d_nextkey64'
12466 d_off64t='$d_off64t'
12467 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
12468 d_oldpthreads='$d_oldpthreads'
12469 d_oldsock='$d_oldsock'
12471 d_open64='$d_open64'
12472 d_opendir64='$d_opendir64'
12473 d_pathconf='$d_pathconf'
12475 d_phostname='$d_phostname'
12478 d_portable='$d_portable'
12479 d_pthread_yield='$d_pthread_yield'
12481 d_pwchange='$d_pwchange'
12482 d_pwclass='$d_pwclass'
12483 d_pwcomment='$d_pwcomment'
12484 d_pwexpire='$d_pwexpire'
12485 d_pwgecos='$d_pwgecos'
12486 d_pwpasswd='$d_pwpasswd'
12487 d_pwquota='$d_pwquota'
12488 d_readdir64='$d_readdir64'
12489 d_readdir='$d_readdir'
12490 d_readlink='$d_readlink'
12492 d_recvmsg='$d_recvmsg'
12493 d_rename='$d_rename'
12494 d_rewinddir='$d_rewinddir'
12496 d_safebcpy='$d_safebcpy'
12497 d_safemcpy='$d_safemcpy'
12498 d_sanemcmp='$d_sanemcmp'
12499 d_sched_yield='$d_sched_yield'
12500 d_scm_rights='$d_scm_rights'
12501 d_seekdir64='$d_seekdir64'
12502 d_seekdir='$d_seekdir'
12503 d_select='$d_select'
12505 d_semctl='$d_semctl'
12506 d_semctl_semid_ds='$d_semctl_semid_ds'
12507 d_semctl_semun='$d_semctl_semun'
12508 d_semget='$d_semget'
12510 d_sendmsg='$d_sendmsg'
12511 d_setegid='$d_setegid'
12512 d_seteuid='$d_seteuid'
12513 d_setgrent='$d_setgrent'
12514 d_setgrps='$d_setgrps'
12515 d_sethent='$d_sethent'
12516 d_setlinebuf='$d_setlinebuf'
12517 d_setlocale='$d_setlocale'
12518 d_setnent='$d_setnent'
12519 d_setpent='$d_setpent'
12520 d_setpgid='$d_setpgid'
12521 d_setpgrp2='$d_setpgrp2'
12522 d_setpgrp='$d_setpgrp'
12523 d_setprior='$d_setprior'
12524 d_setpwent='$d_setpwent'
12525 d_setregid='$d_setregid'
12526 d_setresgid='$d_setresgid'
12527 d_setresuid='$d_setresuid'
12528 d_setreuid='$d_setreuid'
12529 d_setrgid='$d_setrgid'
12530 d_setruid='$d_setruid'
12531 d_setsent='$d_setsent'
12532 d_setsid='$d_setsid'
12533 d_setvbuf='$d_setvbuf'
12537 d_shmatprototype='$d_shmatprototype'
12538 d_shmctl='$d_shmctl'
12540 d_shmget='$d_shmget'
12541 d_sigaction='$d_sigaction'
12542 d_sigsetjmp='$d_sigsetjmp'
12543 d_socket='$d_socket'
12544 d_sockpair='$d_sockpair'
12545 d_stat64='$d_stat64'
12546 d_statblks='$d_statblks'
12547 d_stdio_cnt_lval='$d_stdio_cnt_lval'
12548 d_stdio_ptr_lval='$d_stdio_ptr_lval'
12549 d_stdiobase='$d_stdiobase'
12550 d_stdstdio='$d_stdstdio'
12551 d_store64='$d_store64'
12552 d_strchr='$d_strchr'
12553 d_strcoll='$d_strcoll'
12554 d_strctcpy='$d_strctcpy'
12555 d_strerrm='$d_strerrm'
12556 d_strerror='$d_strerror'
12557 d_strtod='$d_strtod'
12558 d_strtol='$d_strtol'
12559 d_strtoul='$d_strtoul'
12560 d_strxfrm='$d_strxfrm'
12561 d_suidsafe='$d_suidsafe'
12562 d_symlink='$d_symlink'
12563 d_syscall='$d_syscall'
12564 d_sysconf='$d_sysconf'
12565 d_sysernlst='$d_sysernlst'
12566 d_syserrlst='$d_syserrlst'
12567 d_system='$d_system'
12568 d_tcgetpgrp='$d_tcgetpgrp'
12569 d_tcsetpgrp='$d_tcsetpgrp'
12570 d_telldir64='$d_telldir64'
12571 d_telldir='$d_telldir'
12574 d_tmpfile64='$d_tmpfile64'
12575 d_truncate64='$d_truncate64'
12576 d_truncate='$d_truncate'
12577 d_tzname='$d_tzname'
12580 d_union_semun='$d_union_semun'
12582 d_void_closedir='$d_void_closedir'
12583 d_voidsig='$d_voidsig'
12584 d_voidtty='$d_voidtty'
12585 d_volatile='$d_volatile'
12586 d_vprintf='$d_vprintf'
12588 d_waitpid='$d_waitpid'
12589 d_wcstombs='$d_wcstombs'
12590 d_wctomb='$d_wctomb'
12591 d_writev='$d_writev'
12594 db_hashtype='$db_hashtype'
12595 db_prefixtype='$db_prefixtype'
12596 defvoidused='$defvoidused'
12597 direntrytype='$direntrytype'
12600 doublesize='$doublesize'
12602 dynamic_ext='$dynamic_ext'
12608 eunicefix='$eunicefix'
12611 extensions='$extensions'
12613 firstmakefile='$firstmakefile'
12615 fpostype='$fpostype'
12616 freetype='$freetype'
12617 full_csh='$full_csh'
12618 full_sed='$full_sed'
12619 gccversion='$gccversion'
12623 groupcat='$groupcat'
12624 groupstype='$groupstype'
12627 h_sysfile='$h_sysfile'
12631 i_arpainet='$i_arpainet'
12632 i_bsdioctl='$i_bsdioctl'
12635 i_dirent='$i_dirent'
12642 i_inttypes='$i_inttypes'
12643 i_limits='$i_limits'
12644 i_locale='$i_locale'
12645 i_machcthr='$i_machcthr'
12646 i_malloc='$i_malloc'
12648 i_memory='$i_memory'
12651 i_neterrno='$i_neterrno'
12655 i_rpcsvcdbm='$i_rpcsvcdbm'
12658 i_stdarg='$i_stdarg'
12659 i_stddef='$i_stddef'
12660 i_stdlib='$i_stdlib'
12661 i_string='$i_string'
12662 i_sysaccess='$i_sysaccess'
12663 i_sysdir='$i_sysdir'
12664 i_sysfile='$i_sysfile'
12665 i_sysfilio='$i_sysfilio'
12667 i_sysioctl='$i_sysioctl'
12668 i_sysndir='$i_sysndir'
12669 i_sysparam='$i_sysparam'
12670 i_sysresrc='$i_sysresrc'
12671 i_syssecrt='$i_syssecrt'
12672 i_sysselct='$i_sysselct'
12673 i_syssockio='$i_syssockio'
12674 i_sysstat='$i_sysstat'
12675 i_systime='$i_systime'
12676 i_systimek='$i_systimek'
12677 i_systimes='$i_systimes'
12678 i_systypes='$i_systypes'
12679 i_sysuio='$i_sysuio'
12681 i_syswait='$i_syswait'
12682 i_termio='$i_termio'
12683 i_termios='$i_termios'
12685 i_unistd='$i_unistd'
12687 i_values='$i_values'
12688 i_varargs='$i_varargs'
12689 i_varhdr='$i_varhdr'
12691 ignore_versioned_solibs='$ignore_versioned_solibs'
12694 installarchlib='$installarchlib'
12695 installbin='$installbin'
12696 installman1dir='$installman1dir'
12697 installman3dir='$installman3dir'
12698 installprivlib='$installprivlib'
12699 installscript='$installscript'
12700 installsitearch='$installsitearch'
12701 installsitelib='$installsitelib'
12703 known_extensions='$known_extensions'
12707 lddlflags='$lddlflags'
12715 libswanted='$libswanted'
12721 locincpth='$locincpth'
12722 loclibpth='$loclibpth'
12723 longdblsize='$longdblsize'
12724 longlongsize='$longlongsize'
12725 longsize='$longsize'
12729 lseeksize='$lseeksize'
12730 lseektype='$lseektype'
12734 make_set_make='$make_set_make'
12735 mallocobj='$mallocobj'
12736 mallocsrc='$mallocsrc'
12737 malloctype='$malloctype'
12739 man1direxp='$man1direxp'
12742 man3direxp='$man3direxp'
12746 mips_type='$mips_type'
12749 modetype='$modetype'
12752 myarchname='$myarchname'
12753 mydomain='$mydomain'
12754 myhostname='$myhostname'
12757 netdb_hlen_type='$netdb_hlen_type'
12758 netdb_host_type='$netdb_host_type'
12759 netdb_name_type='$netdb_name_type'
12760 netdb_net_type='$netdb_net_type'
12763 nm_so_opt='$nm_so_opt'
12764 nonxs_ext='$nonxs_ext'
12766 o_nonblock='$o_nonblock'
12768 old_pthread_create_joinable='$old_pthread_create_joinable'
12769 optimize='$optimize'
12770 orderlib='$orderlib'
12776 patchlevel='$patchlevel'
12777 path_sep='$path_sep'
12779 perladmin='$perladmin'
12780 perlpath='$perlpath'
12782 phostname='$phostname'
12788 prefixexp='$prefixexp'
12790 privlibexp='$privlibexp'
12791 prototype='$prototype'
12793 randbits='$randbits'
12794 randfunc='$randfunc'
12795 randseedtype='$randseedtype'
12797 rd_nodata='$rd_nodata'
12801 sched_yield='$sched_yield'
12802 scriptdir='$scriptdir'
12803 scriptdirexp='$scriptdirexp'
12805 seedfunc='$seedfunc'
12806 selectminbits='$selectminbits'
12807 selecttype='$selecttype'
12808 sendmail='$sendmail'
12811 sharpbang='$sharpbang'
12812 shmattype='$shmattype'
12813 shortsize='$shortsize'
12816 sig_name='$sig_name'
12817 sig_name_init='$sig_name_init'
12819 sig_num_init='$sig_num_init'
12820 signal_t='$signal_t'
12821 sitearch='$sitearch'
12822 sitearchexp='$sitearchexp'
12824 sitelibexp='$sitelibexp'
12825 sizetype='$sizetype'
12830 sockethdr='$sockethdr'
12831 socketlib='$socketlib'
12833 spackage='$spackage'
12834 spitshell='$spitshell'
12837 ssizetype='$ssizetype'
12838 startperl='$startperl'
12840 static_ext='$static_ext'
12842 stdio_base='$stdio_base'
12843 stdio_bufsiz='$stdio_bufsiz'
12844 stdio_cnt='$stdio_cnt'
12845 stdio_filbuf='$stdio_filbuf'
12846 stdio_ptr='$stdio_ptr'
12849 subversion='$subversion'
12856 timeincl='$timeincl'
12857 timetype='$timetype'
12865 use64bits='$use64bits'
12867 usemultiplicity='$usemultiplicity'
12868 usemymalloc='$usemymalloc'
12870 useopcode='$useopcode'
12871 useperlio='$useperlio'
12872 useposix='$useposix'
12874 useshrplib='$useshrplib'
12875 usethreads='$usethreads'
12876 usevfork='$usevfork'
12881 voidflags='$voidflags'
12887 : Add in command line options if available
12888 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
12890 : add special variables
12891 $test -f $src/patchlevel.h && \
12892 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
12893 echo "CONFIG=true" >>config.sh
12895 : propagate old symbols
12896 if $test -f UU/config.sh; then
12897 <UU/config.sh sort | uniq >UU/oldconfig.sh
12898 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
12899 sort | uniq -u >UU/oldsyms
12900 set X `cat UU/oldsyms`
12906 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
12908 echo "# Variables propagated from previous config.sh file." >>config.sh
12909 for sym in `cat UU/oldsyms`; do
12910 echo " Propagating $hint variable "'$'"$sym..."
12911 eval 'tmp="$'"${sym}"'"'
12913 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
12919 : Finish up by extracting the .SH files
12933 If you'd like to make any changes to the config.sh file before I begin
12934 to configure things, do it as a shell escape now (e.g. !vi config.sh).
12937 rp="Press return or use a shell escape to edit config.sh:"
12942 *) : in case they cannot read
12943 sh 1>&4 -c "$ans";;
12948 : if this fails, just run all the .SH files by hand
12955 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
12962 Now you need to generate make dependencies by running "$make depend".
12963 You might prefer to run it in background: "$make depend > makedepend.out &"
12964 It can take a while, so you might not want to run it right now.
12969 rp="Run $make depend now?"
12973 $make depend && echo "Now you must run a $make."
12976 echo "You must run '$make depend' then '$make'."
12979 elif test -f [Mm]akefile; then
12981 echo "Now you must run a $make."
12986 if $test -f Policy.sh; then
12989 If you compile $package on a different machine or from a different object
12990 directory, copy the Policy.sh file from this object directory to the
12991 new one before you run Configure -- this will help you with most of
12992 the policy defaults.
12996 if $test -f config.msg; then
12997 echo "Hmm. I also noted the following information while running:"
12999 $cat config.msg >&4
13002 $rm -f kit*isdone ark*isdone