3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Tue Jul 7 10:10:21 EDT 1998 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by doughera@lafayette.edu)
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`
60 if test X"$trnl" = X; then
61 case "`echo foo|tr '\n' x 2>/dev/null`" in
67 if test X"$trnl" = X; then
68 case "`echo foo|tr '\012' x 2>/dev/null`" in
74 if test X"$trnl" = X; then
77 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
83 : Proper separator for the PATH environment variable
85 : On OS/2 this directory should exist if this is not floppy only system :-]
86 if test -d c:/. ; then
87 if test -n "$OS2_SHELL"; then
89 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
90 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
91 elif test -n "$DJGPP"; then
97 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
98 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
99 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
100 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
101 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
102 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
103 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
104 paths="$paths /sbin /usr/sbin /usr/libexec"
108 case "$p_$PATH$p_" in
110 *) test -d $p && PATH=$PATH$p_$p ;;
117 : shall we be using ksh?
123 if (PATH=.; alias -x) >/dev/null 2>&1; then
126 if test -f /hp-ux -a -f /bin/ksh; then
127 needksh='to avoid sh bug in "here document" expansion'
129 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
130 if test X`/usr/bin/uname -v` = X4; then
131 avoidksh="to avoid AIX 4's /bin/sh"
135 case "$inksh/$needksh" in
142 case "$inksh/$avoidksh" in
148 case "$inksh/$needksh-$avoidksh-" in
151 (I see you are using the Korn shell. Some ksh's blow up on $me,
152 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
158 echo "(Feeding myself to $newsh $reason.)"
160 Configure|*/Configure) exec $newsh $0 "$@";;
161 *) exec $newsh Configure "$@";;
166 : if needed set CDPATH to a harmless value that is not chatty
167 : avoid bash 2.02 problems with empty CDPATH.
171 *bash*) CDPATH='.' ;;
176 : Configure runs within the UU subdirectory
177 test -d UU || mkdir UU
430 d_pthreads_created_joinable=''
738 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
741 : We must find out about Eunice early
743 if test -f /etc/unixtovms; then
744 eunicefix=/etc/unixtovms
746 if test -f /etc/unixtovms.exe; then
747 eunicefix=/etc/unixtovms.exe
750 : list of known cpp symbols, sorted alphabetically
751 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
752 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
753 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
754 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
755 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
756 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
757 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
758 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
759 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
760 al="$al VMS Xenix286"
761 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
762 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
763 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
764 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
765 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
766 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
767 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
768 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
769 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
770 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
771 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
772 al="$al __SVR4_2__ __UMAXV__"
773 al="$al ____386BSD____ __alpha __alpha__ __amiga"
774 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
775 al="$al __host_mips__"
776 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
777 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
778 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
779 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
780 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
781 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
782 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
783 al="$al __mc88100 __mc88100__ __mips __mips__"
784 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
785 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
786 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
787 al="$al _host_mips _mips _unix"
788 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
789 al="$al apollo ardent att386 att3b"
790 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
791 al="$al cadmus clipper concurrent convex cray ctix"
792 al="$al dmert encore gcos gcx gimpel gould"
793 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
794 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
795 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
796 al="$al i186 i286 i386 i486 i8086"
797 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
798 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
799 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
800 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
801 al="$al mc88000 mc88100 merlin mert mips mvs n16"
802 al="$al ncl_el ncl_mr"
803 al="$al news1500 news1700 news1800 news1900 news3700"
804 al="$al news700 news800 news900 ns16000 ns32000"
805 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
806 al="$al parisc pc532 pdp11 plexus posix pyr"
807 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
808 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
809 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
810 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
811 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
812 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
816 : change the next line if compiling for Xenix/286 on Xenix/386
817 xlibpth='/usr/lib/386 /lib/386'
819 : Possible local library directories to search.
820 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
821 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
823 : general looking path for locating libraries
824 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
825 glibpth="$glibpth /lib /usr/lib $xlibpth"
826 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
827 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
829 : Private path used by Configure to find libraries. Its value
830 : is prepended to libpth. This variable takes care of special
831 : machines, like the mips. Usually, it should be empty.
834 : default library list
836 : Possible local include directories to search.
837 : Set locincpth to "" in a hint file to defeat local include searches.
838 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
839 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
841 : no include file wanted by default
844 : Trailing extension. Override this in a hint file, if needed.
846 : Extra object files, if any, needed on this platform.
849 : full support for void wanted by default
852 : set useposix=false in your hint file to disable the POSIX extension.
854 : set useopcode=false in your hint file to disable the Opcode extension.
856 : set usethreads on the Configure command line to enable threads.
857 : List of libraries we want.
858 : If anyone needs -lnet, put it in a hint file.
859 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
860 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
861 libswanted="$libswanted ucb bsd BSD PW x"
862 : We probably want to search /usr/shlib before most other libraries.
863 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
864 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
865 glibpth="/usr/shlib $glibpth"
866 : Do not use vfork unless overridden by a hint file.
869 : Find the basic shell for Bourne shell scripts
873 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
876 if test -f "$xxx"; then
879 : Build up a list and do a single loop so we can 'break' out.
880 pth=`echo $PATH | sed -e "s/$p_/ /g"`
881 for xxx in sh bash ksh pdksh ash; do
883 try="$try ${p}/${xxx}"
887 if test -f "$xxx"; then
890 elif test -f "$xxx.exe"; then
901 $me: Fatal Error: I can't find a Bourne Shell anywhere.
903 Usually it's in /bin/sh. How did you even get this far?
904 Please contact me (Andy Dougherty) at doughera@lafayette.edu and
905 we'll try to straighten this all out.
911 : see if sh knows # comments
912 if `$sh -c '#' >/dev/null 2>&1`; then
916 test -f $xcat || xcat=/usr/bin/cat
921 if test -s today; then
924 echo "#! $xcat" > try
928 if test -s today; then
936 echo "Your $sh doesn't grok # comments--I will strip them later on."
939 echo "exec grep -v '^[ ]*#'" >spitshell
942 spitshell=`pwd`/spitshell
944 echo "I presume that if # doesn't work, #! won't work either!"
949 : figure out how to guarantee sh startup
951 '') startsh=${sharpbang}${sh} ;;
963 : echo "Yup, it does."
965 echo "Hmm... '$startsh' does not guarantee sh startup..."
966 echo "You may have to fix up the shell scripts to make sure $sh runs them."
971 : Save command line options in file UU/cmdline.opt for later use in
972 : generating config.sh.
973 cat > cmdline.opt <<EOSH
974 # Configure command line arguments.
981 cat >>cmdline.opt <<EOSH
982 config_arg$argn='$arg'
984 argn=`expr $argn + 1`
987 : produce awk script to parse command line options
988 cat >options.awk <<'EOF'
990 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
992 len = length(optstr);
993 for (i = 1; i <= len; i++) {
994 c = substr(optstr, i, 1);
995 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1006 if (substr(str, 1, 1) != "-") {
1007 printf("'%s'\n", str);
1011 for (i = 2; i <= len; i++) {
1012 c = substr(str, i, 1);
1014 printf("-%s\n", substr(str, i));
1020 printf("'%s'\n", substr(str, i + 1));
1033 : process the command line options
1034 set X `for arg in "$@"; do echo "X$arg"; done |
1035 sed -e s/X// | awk -f options.awk`
1040 : set up default values
1051 cat >optdef.sh <<EOS
1057 while test $# -gt 0; do
1059 -d) shift; fastread=yes;;
1060 -e) shift; alldone=cont;;
1064 if test -r "$1"; then
1067 echo "$me: cannot read config file $1." >&2
1072 -h) shift; error=true;;
1073 -r) shift; reuseval=true;;
1074 -s) shift; silent=true; realsilent=true;;
1075 -E) shift; alldone=exit;;
1076 -K) shift; knowitall=true;;
1077 -O) shift; override=true;;
1078 -S) shift; silent=true; extractsh=true;;
1083 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1084 echo "$me: ignoring -D $1" >&2
1087 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1088 *) echo "$1='define'" >> optdef.sh;;
1095 *=) echo "$1" >> optdef.sh;;
1097 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1098 echo "$me: ignoring -U $1" >&2
1100 *) echo "$1='undef'" >> optdef.sh;;
1104 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1107 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1115 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1116 [-U symbol] [-U symbol=]
1117 -d : use defaults for all answers.
1118 -e : go on without questioning past the production of config.sh.
1119 -f : specify an alternate default configuration file.
1120 -h : print this help message and exit (with an error status).
1121 -r : reuse C symbols value if possible (skips costly nm extraction).
1122 -s : silent mode, only echoes questions and essential information.
1123 -D : define symbol to have some value:
1124 -D symbol symbol gets the value 'define'
1125 -D symbol=value symbol gets the value 'value'
1126 -E : stop at the end of questions, after having produced config.sh.
1127 -K : do not use unless you know what you are doing.
1128 -O : let -D and -U override definitions from loaded configuration file.
1129 -S : perform variable substitutions on all .SH files (can mix with -f)
1130 -U : undefine symbol:
1131 -U symbol symbol gets the value 'undef'
1132 -U symbol= symbol gets completely empty
1133 -V : print version number and exit (with a zero status).
1140 case "$fastread$alldone" in
1143 if test ! -t 0; then
1144 echo "Say 'sh Configure', not 'sh <Configure'"
1152 true) exec 1>/dev/null;;
1155 : run the defines and the undefines, if any, but leave the file out there...
1161 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1162 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1163 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1164 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1165 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1168 : Some greps do not return status, grrr.
1169 echo "grimblepritz" >grimble
1170 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1172 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1178 : the following should work in any shell
1182 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1183 cat >contains <<'EOSS'
1184 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1189 : Find the path to the source tree
1192 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1203 if test -f $rsrc/Configure && \
1204 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1206 : found it, so we are ok.
1209 for src in . .. ../.. ../../.. ../../../..; do
1210 if test -f ../$src/Configure && \
1211 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1222 Sorry, I can't seem to locate the source dir for $package. Please start
1223 Configure with an explicit path -- i.e. /some/path/Configure.
1231 echo "Sources for $package found in \"$src\"." >&4
1235 : script used to extract .SH files with variable substitutions
1236 cat >extract <<'EOS'
1238 echo "Doing variable substitutions on .SH files..."
1239 if test -f $src/MANIFEST; then
1240 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'`
1242 echo "(Looking for .SH files under the source directory.)"
1243 set x `(cd $src; find . -name "*.SH" -print)`
1247 0) set x `(cd $src; echo *.SH)`; shift;;
1249 if test ! -f $src/$1; then
1255 while test $name; do
1256 if test ! -d "$name"; then
1257 create="$name $create";
1258 name=`echo $name | sed -e "s|^[^/]*$||"`;
1259 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1264 for file in $create; do
1273 dir=`expr X$file : 'X\(.*\)/'`
1274 file=`expr X$file : 'X.*/\(.*\)'`
1275 (cd $dir && . ./$file)
1285 dir=`expr X$file : 'X\(.*\)/'`
1286 file=`expr X$file : 'X.*/\(.*\)'`
1287 (set x $dir; shift; eval $mkdir_p)
1297 if test -f $src/config_h.SH; then
1298 if test ! -f config.h; then
1299 : oops, they left it out of MANIFEST, probably, so do it anyway.
1305 : extract files and exit if asked to do so
1306 case "$extractsh" in
1308 case "$realsilent" in
1312 case "$config_sh" in
1313 '') config_sh='config.sh';;
1316 echo "Fetching answers from $config_sh..."
1319 test "$override" && . ./optdef.sh
1328 : Eunice requires " " instead of "", can you believe it
1331 echo "Beginning of configuration questions for $package."
1333 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1335 : first determine how to suppress newline on echo command
1337 echo "Checking echo to see how to suppress newlines..."
1338 (echo "hi there\c" ; echo " ") >.echotmp
1339 if $contains c .echotmp >/dev/null 2>&1 ; then
1350 echo $n "The star should be here-->$c"
1354 : Now test for existence of everything in MANIFEST
1356 if test -f $rsrc/MANIFEST; then
1357 echo "First let's make sure your kit is complete. Checking..." >&4
1358 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1361 for filelist in x??; do
1362 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1364 if test -s missing; then
1368 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1370 You have the option of continuing the configuration process, despite the
1371 distinct possibility that your kit is damaged, by typing 'y'es. If you
1372 do, don't blame me if something goes wrong. I advise you to type 'n'o
1373 and contact the author (doughera@lafayette.edu).
1376 echo $n "Continue? [n] $c" >&4
1380 echo "Continuing..." >&4
1384 echo "ABORTING..." >&4
1389 echo "Looks good..."
1392 echo "There is no MANIFEST file. I hope your kit is complete !"
1396 : compute the number of columns on the terminal for proper question formatting
1401 : set up the echo used in my read
1402 myecho="case \"\$xxxm\" in
1403 '') echo $n \"\$rp $c\" >&4;;
1405 '') echo $n \"[\$xxxm] $c\";;
1407 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1409 echo $n \"[\$xxxm] $c\" >&4
1411 echo $n \"\$rp [\$xxxm] $c\" >&4
1417 : now set up to do reads with possible shell escape and default assignment
1423 case "\$fastread" in
1424 yes) case "\$dflt" in
1427 case "\$silent-\$rp" in
1432 *) case "\$silent" in
1433 true) case "\$rp" in
1438 while expr "X\$ans" : "X!" >/dev/null; do
1442 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1450 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1459 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1464 echo "(OK, I'll run with -d after this question.)" >&4
1467 echo "*** Sorry, \$1 not supported yet." >&4
1477 echo "*** Substitution done -- please confirm."
1479 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1484 echo "*** Error -- try again."
1491 case "\$ans\$xxxm\$nostick" in
1503 : create .config dir to save info across Configure sessions
1504 test -d ../.config || mkdir ../.config
1505 cat >../.config/README <<EOF
1506 This directory created by Configure to save information that should
1507 persist across sessions for $package.
1509 You may safely delete it if you wish.
1512 : general instructions
1515 user=`(logname) 2>/dev/null`
1517 '') user=`whoami 2>&1`;;
1519 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1522 rp='Would you like to see the instructions?'
1533 This installation shell script will examine your system and ask you questions
1534 to determine how the perl5 package should be installed. If you get
1535 stuck on a question, you may use a ! shell escape to start a subshell or
1536 execute a command. Many of the questions will have default answers in square
1537 brackets; typing carriage return will give you the default.
1539 On some of the questions which ask for file or directory names you are allowed
1540 to use the ~name construct to specify the login directory belonging to "name",
1541 even if you don't have a shell which knows about that. Questions where this is
1542 allowed will be marked "(~name ok)".
1546 dflt='Type carriage return to continue'
1550 The prompter used in this script allows you to use shell variables and
1551 backticks in your answers. You may use $1, $2, etc... to refer to the words
1552 in the default answer, as if the default line was a set of arguments given to a
1553 script shell. This means you may also use $* to repeat the whole default line,
1554 so you do not have to re-type everything to add something to the default.
1556 Everytime there is a substitution, you will have to confirm. If there is an
1557 error (e.g. an unmatched backtick), the default answer will remain unchanged
1558 and you will be prompted again.
1560 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1561 the questions and use the computed defaults (or the previous answers if there
1562 was already a config.sh file). Type 'Configure -h' for a list of options.
1563 You may also start interactively and then answer '& -d' at any prompt to turn
1564 on the non-interactive behaviour for the remainder of the execution.
1570 Much effort has been expended to ensure that this shell script will run on any
1571 Unix system. If despite that it blows up on yours, your best bet is to edit
1572 Configure and run it again. If you can't run Configure for some reason,
1573 you'll have to generate a config.sh file by hand. Whatever problems you
1574 have, let me (doughera@lafayette.edu) know how I blew it.
1576 This installation script affects things in two ways:
1578 1) it may do direct variable substitutions on some of the files included
1580 2) it builds a config.h file for inclusion in C programs. You may edit
1581 any of these files as the need arises after running this script.
1583 If you make a mistake on a question, there is no easy way to back up to it
1584 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1585 files. Configure will offer to let you do this before it runs the SH files.
1588 dflt='Type carriage return to continue'
1590 case "$firsttime" in
1591 true) echo $user >>../.config/instruct;;
1595 : find out where common programs are
1597 echo "Locating common programs..." >&4
1610 if test -d \$dir/\$thing; then
1616 for thisthing in \$dir/\$thing; do
1617 : just loop through to pick last item
1619 if test -f \$thisthing; then
1622 elif test -f \$dir/\$thing.exe; then
1623 if test -n "$DJGPP"; then
1624 echo \$dir/\$thing.exe
1626 : on Eunice apparently
1681 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1682 pth="$pth /lib /usr/lib"
1683 for file in $loclist; do
1687 if test -f "$xxx"; then
1690 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1691 xxx=`./loc $file $file $pth`
1694 '') xxx=`./loc $file $file $pth`;;
1695 *) xxx=`./loc $xxx $xxx $pth`;;
1701 echo $file is in $xxx.
1704 echo $file is in $xxx.
1707 echo "I don't know where '$file' is, and my life depends on it." >&4
1708 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1714 echo "Don't worry if any of the following aren't found..."
1716 for file in $trylist; do
1720 if test -f "$xxx"; then
1723 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1724 xxx=`./loc $file $file $pth`
1727 '') xxx=`./loc $file $file $pth`;;
1728 *) xxx=`./loc $xxx $xxx $pth`;;
1734 echo $file is in $xxx.
1737 echo $file is in $xxx.
1740 echo "I don't see $file out there, $say."
1747 echo "Substituting grep for egrep."
1753 echo "Substituting cp for ln."
1759 echo "Hopefully test is built into your sh."
1762 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1763 echo "Using the test built into your sh."
1771 echo "Hopefully echo is built into your sh."
1776 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1777 $echo $n "hi there$c" >foo1
1778 echo $n "hi there$c" >foo2
1779 if cmp foo1 foo2 >/dev/null 2>&1; then
1780 echo "They are compatible. In fact, they may be identical."
1787 They are not compatible! You are probably running ksh on a non-USG system.
1788 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1789 have echo built in and we may have to run some Bourne shell scripts. That
1790 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1793 $echo $n "The star should be here-->$c"
1800 : determine whether symbolic links are supported
1803 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1804 echo "Symbolic links are supported." >&4
1807 echo "Symbolic links are NOT supported." >&4
1812 : see whether [:lower:] and [:upper:] are supported character classes
1814 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1816 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1820 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1821 # (0xc9 and 0xd1), therefore that is a nice testing point.
1822 if test "X$up" = X -o "X$low" = X; then
1823 case "`echo IJ | tr '[I-J]' '[i-j]' 2>/dev/null`" in
1829 if test "X$up" = X -o "X$low" = X; then
1830 case "`echo IJ | tr I-J i-j 2>/dev/null`" in
1836 if test "X$up" = X -o "X$low" = X; then
1837 case "`echo IJ | od -x 2>/dev/null`" in
1839 echo "Hey, this might be EBCDIC." >&4
1840 if test "X$up" = X -o "X$low" = X; then
1841 case "`echo IJ | tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1842 ij) up='[A-IJ-RS-Z]'
1847 if test "X$up" = X -o "X$low" = X; then
1848 case "`echo IJ | tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1858 case "`echo IJ | tr \"$up\" \"$low\" 2>/dev/null`" in
1860 echo "Using $up and $low to convert case." >&4
1863 echo "I don't know how to translate letters from upper to lower case." >&4
1864 echo "Your tr is not acting any way I know of." >&4
1868 : set up the translation script tr, must be called with ./tr of course
1872 '[A-Z][a-z]') exec $tr '$up' '$low';;
1873 '[a-z][A-Z]') exec $tr '$low' '$up';;
1880 : Try to determine whether config.sh was made on this system
1881 case "$config_sh" in
1883 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1884 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
1885 # because the A-Z/a-z are not consecutive.
1886 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1887 ./tr '[A-Z]' '[a-z]' | tr $trnl ' '`
1888 newmyuname="$myuname"
1890 case "$knowitall" in
1892 if test -f ../config.sh; then
1893 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1894 eval "`grep myuname= ../config.sh`"
1896 if test "X$myuname" = "X$newmyuname"; then
1904 : Get old answers from old config file if Configure was run on the
1905 : same system, otherwise use the hints.
1908 if test -f config.sh; then
1910 rp="I see a config.sh file. Shall I use it to set the defaults?"
1913 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1914 *) echo "Fetching default answers from your old config.sh file..." >&4
1922 : Older versions did not always set $sh. Catch re-use of such
1931 if test ! -f config.sh; then
1934 First time through, eh? I have some defaults handy for some systems
1935 that need some extra help getting the Configure answers right:
1938 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
1940 : Half the following guesses are probably wrong... If you have better
1941 : tests or hints, please send them to doughera@lafayette.edu
1942 : The metaconfig authors would also appreciate a copy...
1943 $test -f /irix && osname=irix
1944 $test -f /xenix && osname=sco_xenix
1945 $test -f /dynix && osname=dynix
1946 $test -f /dnix && osname=dnix
1947 $test -f /lynx.os && osname=lynxos
1948 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1949 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
1950 $test -f /bin/mips && /bin/mips && osname=mips
1951 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1952 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1953 $test -d /usr/apollo/bin && osname=apollo
1954 $test -f /etc/saf/_sactab && osname=svr4
1955 $test -d /usr/include/minix && osname=minix
1956 if $test -d /MachTen; then
1958 if $test -x /sbin/version; then
1959 osvers=`/sbin/version | $awk '{print $2}' |
1960 $sed -e 's/[A-Za-z]$//'`
1961 elif $test -x /usr/etc/version; then
1962 osvers=`/usr/etc/version | $awk '{print $2}' |
1963 $sed -e 's/[A-Za-z]$//'`
1968 if $test -f $uname; then
1976 umips) osname=umips ;;
1979 [23]100) osname=mips ;;
1980 next*) osname=next ;;
1982 if $test -f /etc/kconfig; then
1984 if test "$lns" = "ln -s"; then
1986 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1988 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1994 if test -n "$DJGPP"; then
2003 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2005 'not found') osvers="$4"."$3" ;;
2006 '<3240'|'<>3240') osvers=3.2.0 ;;
2007 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2008 '=3250'|'>3250') osvers=3.2.5 ;;
2012 *dc.osx) osname=dcosx
2018 domainos) osname=apollo
2024 dynixptx*) osname=dynixptx
2027 freebsd) osname=freebsd
2029 genix) osname=genix ;;
2031 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2047 netbsd*) osname=netbsd
2050 news-os) osvers="$3"
2052 4*) osname=newsos4 ;;
2056 bsd386) osname=bsd386
2059 powerux | power_ux | powermax_os | powermaxos | \
2060 powerunix | power_unix) osname=powerux
2063 next*) osname=next ;;
2064 solaris) osname=solaris
2066 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2073 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2077 titanos) osname=titanos
2086 ultrix) osname=ultrix
2089 osf1|mls+) case "$5" in
2092 osvers=`echo "$3" | sed 's/^[xvt]//'`
2094 hp*) osname=hp_osf1 ;;
2095 mips) osname=mips_osf1 ;;
2104 $2) case "$osname" in
2108 : svr4.x or possibly later
2118 if test -f /stand/boot ; then
2119 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2120 if test -n "$INITPROG" -a -f "$INITPROG"; then
2121 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2122 if test -n "$isesix"; then
2130 *) if test -f /etc/systemid; then
2132 set `echo $3 | $sed 's/\./ /g'` $4
2133 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2135 elif $test -f $src/hints/sco_$1_$2.sh; then
2137 elif $test -f $src/hints/sco_$1.sh; then
2142 '') : Still unknown. Probably a generic Sys V.
2151 *) case "$osname" in
2152 '') : Still unknown. Probably a generic BSD.
2160 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2161 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2162 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2165 $rm -f UU/kernel.what
2166 elif test -d c:/.; then
2173 : Now look for a hint file osname_osvers, unless one has been
2174 : specified already.
2177 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2178 : Also try without trailing minor version numbers.
2179 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2180 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2181 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2182 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2185 *) case "$osvers" in
2188 *) if $test -f $src/hints/$file.sh ; then
2190 elif $test -f $src/hints/$xfile.sh ; then
2192 elif $test -f $src/hints/$xxfile.sh ; then
2194 elif $test -f $src/hints/$xxxfile.sh ; then
2196 elif $test -f $src/hints/$xxxxfile.sh ; then
2198 elif $test -f "$src/hints/${osname}.sh" ; then
2207 if $test -f Policy.sh ; then
2210 none) dflt="Policy" ;;
2211 *) dflt="Policy $dflt" ;;
2216 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2220 if $test -f Policy.sh ; then
2223 There's also a Policy hint file available, which should make the
2224 site-specific (policy) questions easier to answer.
2231 You may give one or more space-separated answers, or "none" if appropriate.
2232 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2233 is a good thing. DO NOT give a wrong version.
2237 rp="Which of these apply, if any?"
2240 for file in $tans; do
2241 if $test X$file = XPolicy -a -f Policy.sh; then
2243 $cat Policy.sh >> UU/config.sh
2244 elif $test -f $src/hints/$file.sh; then
2245 . $src/hints/$file.sh
2246 $cat $src/hints/$file.sh >> UU/config.sh
2247 elif $test X$tans = X -o X$tans = Xnone ; then
2250 : Give one chance to correct a possible typo.
2251 echo "$file.sh does not exist"
2253 rp="hint to use instead?"
2255 for file in $ans; do
2256 if $test -f "$src/hints/$file.sh"; then
2257 . $src/hints/$file.sh
2258 $cat $src/hints/$file.sh >> UU/config.sh
2259 elif $test X$ans = X -o X$ans = Xnone ; then
2262 echo "$file.sh does not exist -- ignored."
2269 : Remember our hint file for later.
2270 if $test -f "$src/hints/$file.sh" ; then
2280 echo "Fetching default answers from $config_sh..." >&4
2284 cp $config_sh config.sh 2>/dev/null
2294 test "$override" && . ./optdef.sh
2295 myuname="$newmyuname"
2297 : Restore computed paths
2298 for file in $loclist $trylist; do
2299 eval $file="\$_$file"
2304 Configure uses the operating system name and version to set some defaults.
2305 The default value is probably right if the name rings a bell. Otherwise,
2306 since spelling matters for me, either accept the default or answer "none"
2313 ''|' '|none) dflt=none ;;
2314 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2317 *) dflt="$osname" ;;
2319 rp="Operating system name?"
2323 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2329 ''|' '|none) dflt=none ;;
2330 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2331 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2333 ''|' ') dflt=none ;;
2338 *) dflt="$osvers" ;;
2340 rp="Operating system version?"
2347 : who configured the system
2348 cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
2349 cf_by=`(logname) 2>/dev/null`
2352 cf_by=`(whoami) 2>/dev/null`
2354 "") cf_by=unknown ;;
2358 : set up the script used to warn in case of inconsistency
2365 echo "*** WHOA THERE!!! ***" >&4
2366 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2367 rp=" Keep the $hint value?"
2370 y) td=$was; tu=$was;;
2374 : function used to set $1 to $val
2375 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2377 $define$undef) . ./whoa; eval "$var=\$td";;
2378 $undef$define) . ./whoa; eval "$var=\$tu";;
2379 *) eval "$var=$val";;
2384 Perl can be built to take advantage of threads, on some systems.
2385 To do so, Configure must be run with -Dusethreads.
2386 (See README.threads for details.)
2388 case "$usethreads" in
2389 $define|true|[yY]*) dflt='y';;
2392 rp='Build a threading Perl?'
2395 y|Y) val="$define" ;;
2400 : Look for a hint-file generated 'call-back-unit'. Now that the
2401 : user has specified if a threading perl is to be built, we may need
2402 : to set or change some other defaults.
2403 if $test -f usethreads.cbu; then
2406 case "$d_oldpthreads" in
2407 '') : Configure tests would be welcome here. For now, assume undef.
2409 *) val="$d_oldpthreads" ;;
2414 : determine the architecture name
2416 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2417 tarch=`arch`"-$osname"
2418 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2419 if uname -m > tmparch 2>&1 ; then
2420 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2421 -e 's/$/'"-$osname/" tmparch`
2429 case "$myarchname" in
2432 echo "(Your architecture name used to be $myarchname.)"
2438 *) dflt="$archname";;
2440 rp='What is your architecture name'
2442 case "$usethreads" in
2443 $define) echo "Threads selected." >&4
2445 *-thread) echo "...and architecture name already ends in -thread." >&4
2448 *) archname="$ans-thread"
2449 echo "...setting architecture name to $archname." >&4
2453 *) archname="$ans" ;;
2459 $define|true) afs=true ;;
2460 $undef|false) afs=false ;;
2461 *) if test -d /afs; then
2469 echo "AFS may be running... I'll be extra cautious then..." >&4
2471 echo "AFS does not seem to be running..." >&4
2474 : decide how portable to be. Allow command line overrides.
2475 case "$d_portable" in
2477 *) d_portable="$define" ;;
2480 : set up shell script to do ~ expansion
2486 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2489 if $test -f /bin/csh; then
2490 /bin/csh -f -c "glob \$1"
2495 name=\`$expr x\$1 : '..\([^/]*\)'\`
2496 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2497 if $test ! -d "\$dir"; then
2499 echo "\$me: can't locate home directory for: \$name" >&2
2504 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2520 : now set up to get a file name
2524 cat <<'EOSC' >>getfile
2537 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2538 fn=`echo $fn | sed 's/(.*)//'`
2544 loc_file=`expr $fn : '.*:\(.*\)'`
2545 fn=`expr $fn : '\(.*\):.*'`
2553 */*) fullpath=true;;
2562 *e*) exp_file=true;;
2565 *p*) nopath_ok=true;;
2570 *d*) type='Directory';;
2571 *l*) type='Locate';;
2576 Locate) what='File';;
2581 case "$d_portable" in
2589 while test "$type"; do
2594 true) rp="$rp (~name ok)";;
2597 if test -f UU/getfile.ok && \
2598 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2617 value=`UU/filexp $ans`
2620 if test "$ans" != "$value"; then
2621 echo "(That expands to $value on this system.)"
2635 /*) value="$ansexp" ;;
2640 echo "I shall only accept a full path name, as in /bin/ls." >&4
2641 echo "Use a ! shell escape if you wish to check pathnames." >&4
2644 echo "Please give a full path name, starting with slash." >&4
2647 echo "Note that using ~name is ok provided it expands well." >&4
2660 if test -f "$ansexp"; then
2662 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2664 echo "($value is not a plain file, but that's ok.)"
2669 if test -d "$ansexp"; then
2674 if test -d "$ansexp"; then
2675 echo "(Looking for $loc_file in directory $value.)"
2676 value="$value/$loc_file"
2677 ansexp="$ansexp/$loc_file"
2679 if test -f "$ansexp"; then
2682 case "$nopath_ok" in
2683 true) case "$value" in
2685 *) echo "Assuming $value will be in people's path."
2701 if test "$fastread" = yes; then
2706 rp="$what $value doesn't exist. Use that name anyway?"
2727 : determine root of directory hierarchy where package will be installed.
2730 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2738 By default, $package will be installed in $dflt/bin, manual
2739 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2740 all installation directories. Typically set to /usr/local, but you
2741 may choose /usr if you wish to install $package among your system
2742 binaries. If you wish to have binaries under /bin but manual pages
2743 under /usr/local/man, that's ok: you will be prompted separately
2744 for each of the installation directories, the prefix being only used
2745 to set the defaults.
2749 rp='Installation prefix to use?'
2757 *) oldprefix="$prefix";;
2764 : set the prefixit variable, to compute a suitable default value
2765 prefixit='case "$3" in
2767 case "$oldprefix" in
2768 "") eval "$1=\"\$$2\"";;
2775 ""|" ") eval "$1=\"\$$2\"";;
2781 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2783 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2784 /*-$oldprefix/*|\~*-$oldprefix/*)
2785 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2786 *) eval "$1=\"\$$2\"";;
2790 : set the base revision
2793 : get the patchlevel
2795 echo "Getting the current patchlevel..." >&4
2796 if $test -r $rsrc/patchlevel.h;then
2797 patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
2798 subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
2803 $echo $n "(You have $package" $c
2806 *) $echo $n " $baserev" $c ;;
2808 $echo $n " patchlevel $patchlevel" $c
2809 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
2812 if test 0 -eq "$subversion"; then
2813 version=`LC_ALL=C; export LC_ALL; \
2814 echo $baserev $patchlevel | \
2815 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2817 version=`LC_ALL=C; export LC_ALL; \
2818 echo $baserev $patchlevel $subversion | \
2819 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
2821 : Figure out perl API version. Perhaps this should be in patchlevel.h
2822 if test "$subversion" -lt 50; then
2823 apiversion=`LC_ALL=C; export LC_ALL; \
2824 echo $baserev $patchlevel | \
2825 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2827 apiversion="$version"
2830 : determine where private library files go
2831 : Usual default is /usr/local/lib/perl5/$version.
2832 : Also allow things like /opt/perl/lib/$version, since
2833 : /opt/perl/lib/perl5... would be redundant.
2835 *perl*) set dflt privlib lib/$version ;;
2836 *) set dflt privlib lib/$package/$version ;;
2841 There are some auxiliary files for $package that need to be put into a
2842 private library directory that is accessible by everyone.
2846 rp='Pathname where the private library files will reside?'
2848 if $test "X$privlibexp" != "X$ansexp"; then
2852 privlibexp="$ansexp"
2856 Since you are running AFS, I need to distinguish the directory in which
2857 private files reside from the directory in which they are installed (and from
2858 which they are presumably copied to the former directory by occult means).
2861 case "$installprivlib" in
2862 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2863 *) dflt="$installprivlib";;
2866 rp='Where will private files be installed?'
2868 installprivlib="$ans"
2870 installprivlib="$privlibexp"
2873 : set the prefixup variable, to restore leading tilda escape
2874 prefixup='case "$prefixexp" in
2876 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2879 : determine where public architecture dependent libraries go
2882 : privlib default is /usr/local/lib/$package/$version
2883 : archlib default is /usr/local/lib/$package/$version/$archname
2884 : privlib may have an optional trailing /share.
2885 tdflt=`echo $privlib | $sed 's,/share$,,'`
2886 tdflt=$tdflt/$archname
2895 $spackage contains architecture-dependent library files. If you are
2896 sharing libraries in a heterogeneous environment, you might store
2897 these files in a separate location. Otherwise, you can just include
2898 them with the rest of the public library files.
2902 rp='Where do you want to put the public architecture-dependent libraries?'
2905 archlibexp="$ansexp"
2910 Since you are running AFS, I need to distinguish the directory in
2911 which architecture-dependent library files reside from the directory
2912 in which they are installed (and from which they are presumably copied
2913 to the former directory by occult means).
2916 case "$installarchlib" in
2917 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2918 *) dflt="$installarchlib";;
2921 rp='Where will architecture-dependent library files be installed?'
2923 installarchlib="$ans"
2925 installarchlib="$archlibexp"
2927 if $test X"$archlib" = X"$privlib"; then
2933 : make some quick guesses about what we are up against
2935 $echo $n "Hmm... $c"
2945 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2946 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2948 echo "Looks kind of like an OSF/1 system, but we'll see..."
2950 elif test `echo abc | tr a-z A-Z` = Abc ; then
2951 xxx=`./loc addbib blurfl $pth`
2952 if $test -f $xxx; then
2953 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2957 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2958 echo "Looks kind of like an extended USG system, but we'll see..."
2960 echo "Looks kind of like a USG system, but we'll see..."
2964 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2965 echo "Looks kind of like a BSD system, but we'll see..."
2969 echo "Looks kind of like a Version 7 system, but we'll see..."
2972 case "$eunicefix" in
2975 There is, however, a strange, musty smell in the air that reminds me of
2976 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2980 : it so happens the Eunice I know will not run shell scripts in Unix format
2984 echo "Congratulations. You aren't running Eunice."
2988 : Detect OS2. The p_ variable is set above in the Head.U unit.
2993 I have the feeling something is not exactly right, however...don't tell me...
2994 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2999 if test -f /xenix; then
3000 echo "Actually, this looks more like a XENIX system..."
3005 echo "It's not Xenix..."
3010 if test -f /venix; then
3011 echo "Actually, this looks more like a VENIX system..."
3018 echo "Nor is it Venix..."
3021 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3022 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3025 : see if setuid scripts can be secure
3028 Some kernels have a bug that prevents setuid #! scripts from being
3029 secure. Some sites have disabled setuid #! scripts because of this.
3031 First let's decide if your kernel supports secure setuid #! scripts.
3032 (If setuid #! scripts would be secure but have been disabled anyway,
3033 don't say that they are secure if asked.)
3038 if $test -d /dev/fd; then
3039 echo "#!$ls" >reflect
3040 chmod +x,u+s reflect
3041 ./reflect >flect 2>&1
3042 if $contains "/dev/fd" flect >/dev/null; then
3043 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3047 If you are not sure if they are secure, I can check but I'll need a
3048 username and password different from the one you are using right now.
3049 If you don't have such a username or don't want me to test, simply
3053 rp='Other username to test security of setuid scripts with?'
3058 case "$d_suidsafe" in
3059 '') echo "I'll assume setuid scripts are *not* secure." >&4
3062 echo "Well, the $hint value is *not* secure." >&4
3064 *) echo "Well, the $hint value *is* secure." >&4
3069 $rm -f reflect flect
3070 echo "#!$ls" >reflect
3071 chmod +x,u+s reflect
3074 echo '"su" will (probably) prompt you for '"$ans's password."
3075 su $ans -c './reflect >flect'
3076 if $contains "/dev/fd" flect >/dev/null; then
3077 echo "Okay, it looks like setuid scripts are secure." >&4
3080 echo "I don't think setuid scripts are secure." >&4
3085 rp='Does your kernel have *secure* setuid scripts?'
3088 [yY]*) val="$define";;
3093 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3094 echo "(That's for file descriptors, not floppy disks.)"
3100 $rm -f reflect flect
3102 : now see if they want to do setuid emulation
3105 case "$d_suidsafe" in
3108 echo "No need to emulate SUID scripts since they are secure here." >& 4
3112 Some systems have disabled setuid scripts, especially systems where
3113 setuid scripts cannot be secure. On systems where setuid scripts have
3114 been disabled, the setuid/setgid bits on scripts are currently
3115 useless. It is possible for $package to detect those bits and emulate
3116 setuid/setgid in a secure fashion. This emulation will only work if
3117 setuid scripts have been disabled in your kernel.
3121 "$define") dflt=y ;;
3124 rp="Do you want to do setuid/setgid emulation?"
3127 [yY]*) val="$define";;
3135 : determine where manual pages are on this system
3139 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3140 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3141 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3142 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3143 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3144 sysman=`./loc . /usr/man/man1 $syspath`
3147 if $test -d "$sysman"; then
3148 echo "System manual is in $sysman." >&4
3150 echo "Could not find manual pages in source form." >&4
3153 : see what memory models we can support
3156 $cat >pdp11.c <<'EOP'
3165 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3166 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3167 dflt='unsplit split'
3169 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3172 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3177 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3180 if $test -d /lib/large || $test -d /usr/lib/large; then
3183 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3192 Some systems have different model sizes. On most systems they are called
3193 small, medium, large, and huge. On the PDP11 they are called unsplit and
3194 split. If your system doesn't support different memory models, say "none".
3195 If you wish to force everything to one memory model, say "none" here and
3196 put the appropriate flags later when it asks you for other cc and ld flags.
3197 Venix systems may wish to put "none" and let the compiler figure things out.
3198 (In the following question multiple model names should be space separated.)
3200 The default for most systems is "none".
3203 rp="Which memory models are supported?"
3218 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3219 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3226 rp="What flag indicates separate I and D space?"
3234 *large*|*small*|*medium*|*huge*)
3241 rp="What flag indicates large model?"
3251 *huge*) case "$huge" in
3255 rp="What flag indicates huge model?"
3265 *medium*) case "$medium" in
3269 rp="What flag indicates medium model?"
3276 *) medium="$large";;
3279 *small*) case "$small" in
3283 rp="What flag indicates small model?"
3294 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3297 $rm -f pdp11.* pdp11
3299 : see if we need a special compiler
3307 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3308 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3322 On some older systems the default C compiler will not resolve multiple global
3323 references that happen to have the same name. On some such systems the "Mcc"
3324 command may be used to force these to be resolved. On other systems a "cc -M"
3325 command is required. (Note that the -M flag on other systems indicates a
3326 memory model to use!) If you have the Gnu C compiler, you might wish to use
3332 rp="Use which C compiler?"
3340 rp="Use which C compiler?"
3344 : Look for a hint-file generated 'call-back-unit'. Now that the
3345 : user has specified the compiler, we may need to set or change some
3347 if $test -f cc.cbu; then
3351 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3352 $cat >gccvers.c <<EOM
3357 printf("%s\n", __VERSION__);
3359 printf("%s\n", "1");
3365 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3366 gccversion=`./gccvers`
3367 case "$gccversion" in
3368 '') echo "You are not using GNU cc." ;;
3369 *) echo "You are using GNU cc $gccversion." ;;
3373 echo "*** WHOA THERE!!! ***" >&4
3374 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3375 case "$knowitall" in
3377 echo " You'd better start hunting for one and let me know about it." >&4
3383 case "$gccversion" in
3384 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3387 : What should the include directory be ?
3389 $echo $n "Hmm... $c"
3393 if $test -f /bin/mips && /bin/mips; then
3394 echo "Looks like a MIPS system..."
3395 $cat >usr.c <<'EOCP'
3396 #ifdef SYSTYPE_BSD43
3400 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3401 dflt='/bsd43/usr/include'
3405 mips_type='System V'
3407 $rm -f usr.c usr.out
3408 echo "and you're compiling with the $mips_type compiler and libraries."
3412 echo "Doesn't look like a MIPS system."
3422 case "$xxx_prompt" in
3425 rp='Where are the include files you want to use?'
3433 : see how we invoke the C preprocessor
3435 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3436 cat <<'EOT' >testcpp.c
3442 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3444 wrapper=`pwd`/cppstdin
3448 if $test "X$cppstdin" != "X" && \
3449 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3450 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3452 echo "You used to use $cppstdin $cppminus so we'll use that again."
3454 '') echo "But let's see if we can live without a wrapper..." ;;
3456 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3457 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3459 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3462 echo "(However, $cpprun $cpplast does not work, let's see...)"
3470 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3477 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3478 $cc -E <testcpp.c >testcpp.out 2>&1; \
3479 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3480 echo "Yup, it does."
3483 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3484 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3485 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3486 echo "Yup, it does."
3489 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3490 $cc -P <testcpp.c >testcpp.out 2>&1; \
3491 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3492 echo "Yipee, that works!"
3495 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3496 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3497 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3498 echo "At long last!"
3501 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3502 $cpp <testcpp.c >testcpp.out 2>&1; \
3503 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3507 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3508 $cpp - <testcpp.c >testcpp.out 2>&1; \
3509 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3510 echo "Hooray, it works! I was beginning to wonder."
3513 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3514 $wrapper <testcpp.c >testcpp.out 2>&1; \
3515 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3521 rp="No dice. I can't find a C preprocessor. Name one:"
3525 $x_cpp <testcpp.c >testcpp.out 2>&1
3526 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3527 echo "OK, that will do." >&4
3529 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3544 echo "Perhaps can we force $cc -E using a wrapper..."
3545 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3546 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3552 echo "Nope, we'll have to live without it..."
3567 *) $rm -f $wrapper;;
3569 $rm -f testcpp.c testcpp.out
3571 : Set private lib path
3574 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3579 '') dlist="$loclibpth $plibpth $glibpth";;
3580 *) dlist="$libpth";;
3583 : Now check and see which directories actually exist, avoiding duplicates
3587 if $test -d $xxx; then
3590 *) libpth="$libpth $xxx";;
3596 Some systems have incompatible or broken versions of libraries. Among
3597 the directories listed in the question below, please remove any you
3598 know not to be holding relevant libraries, and add any that are needed.
3599 Say "none" for none.
3610 rp="Directories to use for library searches?"
3617 : compute shared library extension
3620 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3630 On some systems, shared libraries may be available. Answer 'none' if
3631 you want to suppress searching of shared libraries for the remaining
3632 of this configuration.
3635 rp='What is the file extension used for shared libraries?'
3639 : Define several unixisms.
3640 : Hints files or command line option can be used to override them.
3641 : The convoluted testing is in case hints files set either the old
3644 '') case "$exe_ext" in
3646 *) _exe="$exe_ext" ;;
3651 '') case "$lib_ext" in
3658 '') case "$obj_ext" in
3665 '') case "$path_sep" in
3676 : Which makefile gets called first. This is used by make depend.
3677 case "$firstmakefile" in
3678 '') firstmakefile='makefile';;
3681 : Looking for optional libraries
3683 echo "Checking for optional libraries..." >&4
3688 case "$libswanted" in
3689 '') libswanted='c_s';;
3691 for thislib in $libswanted; do
3693 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
3694 echo "Found -l$thislib (shared)."
3697 *) dflt="$dflt -l$thislib";;
3699 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3700 echo "Found -l$thislib (shared)."
3703 *) dflt="$dflt -l$thislib";;
3705 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3706 echo "Found -l$thislib."
3709 *) dflt="$dflt -l$thislib";;
3711 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3712 echo "Found -l$thislib."
3715 *) dflt="$dflt -l$thislib";;
3717 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3718 echo "Found -l${thislib}_s."
3721 *) dflt="$dflt -l${thislib}_s";;
3723 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3724 echo "Found -l$thislib."
3727 *) dflt="$dflt -l$thislib";;
3730 echo "No -l$thislib."
3741 ' '|'') dflt='none';;
3746 Some versions of Unix support shared libraries, which make executables smaller
3747 but make load time slightly longer.
3749 On some systems, mostly System V Release 3's, the shared library is included
3750 by putting the option "-lc_s" as the last thing on the cc command line when
3751 linking. Other systems use shared libraries by default. There may be other
3752 libraries needed to compile $package on your machine as well. If your system
3753 needs the "-lc_s" option, include it here. Include any other special libraries
3754 here as well. Say "none" for none.
3758 rp="Any additional libraries?"
3765 : determine optimize, if desired, or use for debug flag also
3767 ' '|$undef) dflt='none';;
3769 *) dflt="$optimize";;
3773 Some C compilers have problems with their optimizers. By default, $package
3774 compiles with the -O flag to use the optimizer. Alternately, you might want
3775 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3776 systems). Either flag can be specified here. To use neither flag, specify
3780 rp="What optimizer/debugger flag should be used?"
3784 'none') optimize=" ";;
3788 : We will not override a previous value, but we might want to
3789 : augment a hint file
3792 case "$gccversion" in
3793 1*) dflt='-fpcc-struct-return' ;;
3796 *-g*) dflt="$dflt -DDEBUGGING";;
3798 case "$gccversion" in
3799 2*) if test -d /etc/conf/kconfig.d &&
3800 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3809 case "$mips_type" in
3810 *BSD*|'') inclwanted="$locincpth $usrinc";;
3811 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3813 for thisincl in $inclwanted; do
3814 if $test -d $thisincl; then
3815 if $test x$thisincl != x$usrinc; then
3818 *) dflt="$dflt -I$thisincl";;
3824 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3826 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3834 *) dflt="$dflt -D$2";;
3839 set signal.h __LANGUAGE_C__; eval $inctest
3841 set signal.h LANGUAGE_C; eval $inctest
3845 none|recommended) dflt="$ccflags $dflt" ;;
3846 *) dflt="$ccflags";;
3854 Your C compiler may want other flags. For this question you should include
3855 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3856 but you should NOT include libraries or ld flags like -lwhatever. If you
3857 want $package to honor its debug switch, you should include -DDEBUGGING here.
3858 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3860 To use no flags, specify the word "none".
3866 rp="Any additional cc flags?"
3873 : the following weeds options from ccflags that are of no interest to cpp
3875 case "$gccversion" in
3876 1*) cppflags="$cppflags -D__GNUC__"
3878 case "$mips_type" in
3880 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3886 echo "Let me guess what the preprocessor flags are..." >&4
3900 *) ftry="$previous $flag";;
3902 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3903 >cpp1.out 2>/dev/null && \
3904 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3905 >cpp2.out 2>/dev/null && \
3906 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3907 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3909 cppflags="$cppflags $ftry"
3919 *-*) echo "They appear to be: $cppflags";;
3921 $rm -f cpp.c cpp?.out
3925 : flags used in final linking phase
3927 '') if ./venix; then
3933 *-posix*) dflt="$dflt -posix" ;;
3936 *) dflt="$ldflags";;
3939 : Try to guess additional flags to pick up local libraries.
3940 for thislibdir in $libpth; do
3941 case " $loclibpth " in
3944 *"-L$thislibdir "*) ;;
3945 *) dflt="$dflt -L$thislibdir" ;;
3957 Your C linker may need flags. For this question you should
3958 include -L/whatever and any other flags used by the C linker, but you
3959 should NOT include libraries like -lwhatever.
3961 Make sure you include the appropriate -L/path flags if your C linker
3962 does not normally search all of the directories you specified above,
3965 To use no flags, specify the word "none".
3969 rp="Any additional ld flags (NOT including libraries)?"
3975 rmlist="$rmlist pdp11"
3979 echo "Checking your choice of C compiler and flags for coherency..." >&4
3980 set X $cc $optimize $ccflags $ldflags -o try try.c $libs
3983 I've tried to compile and run a simple program with:
3988 and I got the following output:
3991 $cat > try.c <<'EOF'
3993 main() { printf("Ok\n"); exit(0); }
3996 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
3997 if sh -c './try' >>try.msg 2>&1; then
4001 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4004 cat >> try.msg <<'EOQS'
4005 If $libs contains -lsfio, and sfio is mis-configured, then it
4006 sometimes (apparently) runs and exits with a 0 status, but with no
4007 output! It may have to do with sfio's use of _exit vs. exit.
4010 rp="You have a big problem. Shall I abort Configure"
4017 echo "The program compiled OK, but exited with status $?." >>try.msg
4018 rp="You have a problem. Shall I abort Configure"
4022 echo "I can't compile the test program." >>try.msg
4023 rp="You have a BIG problem. Shall I abort Configure"
4029 case "$knowitall" in
4031 echo "(The supplied flags might be incorrect with this C compiler.)"
4039 *) echo "Ok. Stopping Configure." >&4
4044 n) echo "OK, that should do.";;
4046 $rm -f try try.* core
4048 : determine filename position in cpp output
4050 echo "Computing filename position in cpp output for #include directives..." >&4
4051 echo '#include <stdio.h>' > foo.c
4054 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4055 $grep '^[ ]*#.*stdio\.h' | \
4056 while read cline; do
4059 while $test \$# -gt 0; do
4060 if $test -r \`echo \$1 | $tr -d '"'\`; then
4065 pos=\`expr \$pos + 1\`
4077 *) pos="${fieldn}th";;
4079 echo "Your cpp writes the filename in the $pos field of the line."
4081 : locate header file
4086 if test -f $usrinc/\$wanted; then
4087 echo "$usrinc/\$wanted"
4090 awkprg='{ print \$$fieldn }'
4091 echo "#include <\$wanted>" > foo\$\$.c
4092 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4093 $grep "^[ ]*#.*\$wanted" | \
4094 while read cline; do
4095 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4097 */\$wanted) echo "\$name"; exit 0;;
4108 : define an alternate in-header-list? function
4109 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4110 cont=true; xxf="echo \"<\$1> found.\" >&4";
4111 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4112 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4114 case $# in 4) instead=instead;; *) instead="at last";; esac;
4115 while $test "$cont"; do
4117 var=$2; eval "was=\$$2";
4118 if $test "$xxx" && $test -r "$xxx";
4120 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4123 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4124 set $yyy; shift; shift; yyy=$@;
4125 case $# in 0) cont="";;
4126 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4127 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4128 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4129 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4133 do set $yyy; var=$2; eval "was=\$$2";
4134 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4135 set $yyy; shift; shift; yyy=$@;
4138 : see if this is a malloc.h system
4139 set malloc.h i_malloc
4142 : see if stdlib is available
4143 set stdlib.h i_stdlib
4146 : determine which malloc to compile in
4148 case "$usemymalloc" in
4149 ''|y*|true) dflt='y' ;;
4150 n*|false) dflt='n' ;;
4151 *) dflt="$usemymalloc" ;;
4153 rp="Do you wish to attempt to use the malloc that comes with $package?"
4159 mallocsrc='malloc.c'
4160 mallocobj="malloc$_o"
4161 d_mymalloc="$define"
4164 : Remove malloc from list of libraries to use
4165 echo "Removing unneeded -lmalloc from library list" >&4
4166 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4169 echo "libs = $libs" >&4
4181 : compute the return types of malloc and free
4183 $cat >malloc.c <<END
4187 #include <sys/types.h>
4201 case "$malloctype" in
4203 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4210 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4214 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4221 echo "Your system uses $freetype free(), it would seem." >&4
4223 : Cruising for prototypes
4225 echo "Checking out function prototypes..." >&4
4226 $cat >prototype.c <<'EOCP'
4227 main(int argc, char *argv[]) {
4230 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4231 echo "Your C compiler appears to support function prototypes."
4234 echo "Your C compiler doesn't seem to understand function prototypes."
4241 case "$prototype" in
4243 *) ansi2knr='ansi2knr'
4248 This version of $package can only be compiled by a compiler that
4249 understands function prototypes. Unfortunately, your C compiler
4251 doesn't seem to understand them. Sorry about that.
4253 If GNU cc is avaiable for your system, perhaps you could try that instead.
4255 Eventually, we hope to support building Perl with pre-ANSI compilers.
4256 If you would like to help in that effort, please contact <perlbug@perl.org>.
4258 Aborting Configure now.
4264 : determine where public executables go
4269 rp='Pathname where the public executables will reside?'
4271 if $test "X$ansexp" != "X$binexp"; then
4279 Since you are running AFS, I need to distinguish the directory in which
4280 executables reside from the directory in which they are installed (and from
4281 which they are presumably copied to the former directory by occult means).
4284 case "$installbin" in
4285 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4286 *) dflt="$installbin";;
4289 rp='Where will public executables be installed?'
4293 installbin="$binexp"
4296 : define a shorthand compile call
4300 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4301 : define a shorthand compile call for compilations that should be ok.
4305 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4308 echo "Determining whether or not we are on an EBCDIC system..." >&4
4309 cat >tebcdic.c <<EOM
4312 if ('M'==0xd4) return 0;
4316 $cc $ccflags $ldflags -o tebcdic tebcdic.c $libs >/dev/null 2>&1
4318 echo "You have EBCDIC. Adding -DEBCDIC to ccflags." >&4
4319 ccflags="$ccflags -DEBCDIC"
4322 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
4325 rm -f tebcdic.c tebcdic
4330 echo "Checking for GNU C Library..." >&4
4331 cat >gnulibc.c <<EOM
4344 if eval $compile_ok && ./gnulibc; then
4346 echo "You are using the GNU C Library"
4349 echo "You are not using the GNU C Library"
4355 : see if nm is to be used to determine whether a symbol is defined or not
4359 case "$d_gnulibc" in
4362 echo "nm probably won't work on the GNU C Library." >&4
4368 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4370 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4371 echo "'nm' won't be sufficient on this sytem." >&4
4377 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4378 if $test $dflt -gt 20; then
4388 true|$define) dflt=y;;
4395 I can use $nm to extract the symbols from your C libraries. This
4396 is a time consuming task which may generate huge output on the disk (up
4397 to 3 megabytes) but that should make the symbols extraction faster. The
4398 alternative is to skip the 'nm' extraction part and to compile a small
4399 test program instead to determine whether each symbol is present. If
4400 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4401 this may be the best solution.
4403 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4406 rp="Shall I use $nm to extract C symbols from the libraries?"
4409 [Nn]*) usenm=false;;
4418 : nm options which may be necessary
4420 '') if $test -f /mach_boot; then
4422 elif $test -d /usr/ccs/lib; then
4423 nm_opt='-p' # Solaris (and SunOS?)
4424 elif $test -f /dgux; then
4426 elif $test -f /lib64/rld; then
4427 nm_opt='-p' # 64-bit Irix
4433 : nm options which may be necessary for shared libraries but illegal
4434 : for archive libraries. Thank you, Linux.
4435 case "$nm_so_opt" in
4436 '') case "$myuname" in
4438 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4439 nm_so_opt='--dynamic'
4448 : get list of predefined functions in a handy place
4453 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4460 *) for thislib in $libs; do
4463 : Handle C library specially below.
4466 thislib=`echo $thislib | $sed -e 's/^-l//'`
4467 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4469 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4471 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4473 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4475 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4477 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4479 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4484 libnames="$libnames $try"
4486 *) libnames="$libnames $thislib" ;;
4495 for xxx in $libpth; do
4496 $test -r $1 || set $xxx/libc.$so
4497 : The messy sed command sorts on library version numbers.
4499 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4500 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4502 s/[0-9][0-9]*/0000&/g
4503 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4506 sort | $sed -e 's/^.* //'`
4509 $test -r $1 || set /usr/ccs/lib/libc.$so
4510 $test -r $1 || set /lib/libsys_s$_a
4516 if $test -r "$1"; then
4517 echo "Your (shared) C library seems to be in $1."
4519 elif $test -r /lib/libc && $test -r /lib/clib; then
4520 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4522 libc='/lib/clib /lib/libc'
4523 if $test -r /lib/syslib; then
4524 echo "(Your math library is in /lib/syslib.)"
4525 libc="$libc /lib/syslib"
4527 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4528 echo "Your C library seems to be in $libc, as you said before."
4529 elif $test -r $incpath/usr/lib/libc$_a; then
4530 libc=$incpath/usr/lib/libc$_a;
4531 echo "Your C library seems to be in $libc. That's fine."
4532 elif $test -r /lib/libc$_a; then
4534 echo "Your C library seems to be in $libc. You're normal."
4536 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4538 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4539 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4540 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4542 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4544 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4547 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4549 if $test -r "$tans"; then
4550 echo "Your C library seems to be in $tans, of all places."
4556 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4560 If the guess above is wrong (which it might be if you're using a strange
4561 compiler, or your machine supports multiple models), you can override it here.
4566 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4568 I can't seem to find your C library. I've looked in the following places:
4571 $sed 's/^/ /' libpath
4574 None of these seems to contain your C library. I need to get its name...
4579 rp='Where is your C library?'
4584 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4585 set X `cat libnames`
4588 case $# in 1) xxx=file; esac
4589 echo "Extracting names from the following $xxx for later perusal:" >&4
4591 $sed 's/^/ /' libnames >&4
4593 $echo $n "This may take a while...$c" >&4
4597 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4598 *) $nm $nm_opt $file 2>/dev/null;;
4603 $grep fprintf libc.tmp > libc.ptf
4604 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4605 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4607 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4609 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4611 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4615 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4619 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4623 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4627 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4631 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4632 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4636 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4640 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4644 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4648 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4652 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4656 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4661 $nm -p $* 2>/dev/null >libc.tmp
4662 $grep fprintf libc.tmp > libc.ptf
4663 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4664 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4670 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4672 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4673 for thisname in $libnames $libc; do
4674 $ar t $thisname >>libc.tmp
4676 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4678 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4679 # Repeat libc to extract forwarders to DLL entries too
4680 for thisname in $libnames $libc; do
4681 $ar tv $thisname >>libc.tmp
4682 # Revision 50 of EMX has bug in $ar.
4683 # it will not extract forwarders to DLL entries
4684 # Use emximp which will extract exactly them.
4685 emximp -o tmp.imp $thisname \
4687 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4688 < tmp.imp >>libc.tmp
4691 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4694 echo "$ar didn't seem to work right." >&4
4695 echo "Maybe this is a Cray...trying bld instead..." >&4
4696 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4698 for thisname in $libnames; do
4700 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4701 $ar t $thisname >>libc.tmp
4705 echo "That didn't work either. Giving up." >&4
4712 if $test -f /lib/syscalls.exp; then
4714 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4715 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4719 $rm -f libnames libpath
4721 : see if dld is available
4725 : is a C symbol defined?
4728 -v) tf=libc.tmp; tc=""; tdc="";;
4729 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4730 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4733 case "$reuseval-$4" in
4735 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4741 if $contains $tlook $tf >/dev/null 2>&1;
4746 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4747 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4755 $define) tval=true;;
4761 : define an is-in-libc? function
4762 inlibc='echo " "; td=$define; tu=$undef;
4763 sym=$1; var=$2; eval "was=\$$2";
4765 case "$reuseval$was" in
4775 echo "$sym() found." >&4;
4776 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4778 echo "$sym() NOT found." >&4;
4779 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4783 $define) echo "$sym() found." >&4;;
4784 *) echo "$sym() NOT found." >&4;;
4788 : see if dlopen exists
4795 : determine which dynamic loading, if any, to compile in
4797 dldir="ext/DynaLoader"
4810 $define) dflt='y' ;;
4813 $define) dflt='y' ;;
4815 : Does a dl_xxx.xs file exist for this operating system
4816 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
4819 rp="Do you wish to use dynamic loading?"
4826 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
4827 dflt="$dldir/dl_${osname}.xs"
4828 elif $test "$d_dlopen" = "$define" ; then
4829 dflt="$dldir/dl_dlopen.xs"
4830 elif $test "$i_dld" = "$define" ; then
4831 dflt="$dldir/dl_dld.xs"
4836 *) dflt="$dldir/$dlsrc"
4839 echo "The following dynamic loading files are available:"
4840 : Can not go over to $dldir because getfile has path hard-coded in.
4841 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
4842 rp="Source file to use for dynamic loading"
4844 # XXX This getfile call will fail the existence check if you try
4845 # building away from $src (this is not supported yet).
4849 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4853 Some systems may require passing special flags to $cc -c to
4854 compile modules that will be used to create a shared library.
4855 To use no flags, say "none".
4858 case "$cccdlflags" in
4859 '') case "$gccversion" in
4860 '') case "$osname" in
4862 next) dflt='none' ;;
4863 irix*) dflt='-KPIC' ;;
4864 svr4*|esix*|solaris) dflt='-KPIC' ;;
4865 sunos) dflt='-pic' ;;
4869 *) case "$osname" in
4870 svr4*|esix*|solaris) dflt='-fPIC' ;;
4875 *) dflt="$cccdlflags" ;;
4877 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4880 none) cccdlflags=' ' ;;
4881 *) cccdlflags="$ans" ;;
4886 Some systems use ld to create libraries that can be dynamically loaded,
4887 while other systems (such as those using ELF) use $cc.
4891 '') $cat >try.c <<'EOM'
4892 /* Test for whether ELF binaries are produced */
4897 int i = open("a.out",O_RDONLY);
4900 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
4901 exit(0); /* succeed (yes, it's ELF) */
4906 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
4908 You appear to have ELF support. I'll use $cc to build dynamic libraries.
4912 echo "I'll use ld to build dynamic libraries."
4921 rp="What command should be used to create dynamic libraries?"
4927 Some systems may require passing special flags to $ld to create a
4928 library that can be dynamically loaded. If your ld flags include
4929 -L/other/path options to locate libraries outside your loader's normal
4930 search path, you may need to specify those -L options here as well. To
4931 use no flags, say "none".
4934 case "$lddlflags" in
4935 '') case "$osname" in
4937 linux|irix*) dflt='-shared' ;;
4938 next) dflt='none' ;;
4939 solaris) dflt='-G' ;;
4940 sunos) dflt='-assert nodefinitions' ;;
4941 svr4*|esix*) dflt="-G $ldflags" ;;
4945 *) dflt="$lddlflags" ;;
4948 : Try to guess additional flags to pick up local libraries.
4949 for thisflag in $ldflags; do
4954 *) dflt="$dflt $thisflag" ;;
4961 ''|' ') dflt='none' ;;
4964 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
4967 none) lddlflags=' ' ;;
4968 *) lddlflags="$ans" ;;
4973 Some systems may require passing special flags to $cc to indicate that
4974 the resulting executable will use dynamic linking. To use no flags,
4978 case "$ccdlflags" in
4979 '') case "$osname" in
4980 hpux) dflt='-Wl,-E' ;;
4981 linux) dflt='-rdynamic' ;;
4982 next) dflt='none' ;;
4983 sunos) dflt='none' ;;
4987 *) dflt="$ccdlflags" ;;
4989 rp="Any special flags to pass to $cc to use dynamic loading?"
4992 none) ccdlflags=' ' ;;
4993 *) ccdlflags="$ans" ;;
5007 # No dynamic loading being used, so don't bother even to prompt.
5010 *) case "$useshrplib" in
5011 '') case "$osname" in
5012 svr4*|dgux|dynixptx|esix|powerux)
5014 also='Building a shared libperl is required for dynamic loading to work on your system.'
5019 also='Building a shared libperl is needed for MAB support.'
5037 The perl executable is normally obtained by linking perlmain.c with
5038 libperl${_a}, any static extensions (usually just DynaLoader), and
5039 any other libraries needed on this system (such as -lm, etc.). Since
5040 your system supports dynamic loading, it is probably possible to build
5041 a shared libperl.$so. If you will have more than one executable linked
5042 to libperl.$so, this will significantly reduce the size of each
5043 executable, but it may have a noticeable affect on performance. The
5044 default is probably sensible for your system.
5048 rp="Build a shared libperl.$so (y/n)"
5053 # Why does next4 have to be so different?
5054 case "${osname}${osvers}" in
5055 next4*) xxx='DYLD_LIBRARY_PATH' ;;
5056 os2*) xxx='' ;; # Nothing special needed.
5057 *) xxx='LD_LIBRARY_PATH' ;;
5059 if test X"$xxx" != "X"; then
5060 $cat <<EOM | $tee -a ../config.msg >&4
5062 To build perl, you must add the current working directory to your
5063 $xxx environment variable before running make. You can do
5065 $xxx=\`pwd\`; export $xxx
5066 for Bourne-style shells, or
5068 for Csh-style shells. You *MUST* do this before running make.
5073 *) useshrplib='false' ;;
5078 case "$useshrplib" in
5082 # Figure out a good name for libperl.so. Since it gets stored in
5083 # a version-specific architecture-dependent library, the version
5084 # number isn't really that important, except for making cc/ld happy.
5086 # A name such as libperl.so.3.1
5087 majmin="libperl.$so.$patchlevel.$subversion"
5088 # A name such as libperl.so.301
5089 majonly=`echo $patchlevel $subversion |
5090 $awk '{printf "%d%02d", $1, $2}'`
5091 majonly=libperl.$so.$majonly
5092 # I'd prefer to keep the os-specific stuff here to a minimum, and
5093 # rely on figuring it out from the naming of libc.
5094 case "${osname}${osvers}" in
5097 # XXX How handle the --version stuff for MAB?
5099 linux*) # ld won't link with a bare -lperl otherwise.
5102 *) # Try to guess based on whether libc has major.minor.
5104 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5105 *libc.$so.[0-9]*) dflt=$majonly ;;
5106 *) dflt=libperl.$so ;;
5116 I need to select a good name for the shared libperl. If your system uses
5117 library names with major and minor numbers, then you might want something
5118 like $majmin. Alternatively, if your system uses a single version
5119 number for shared libraries, then you might want to use $majonly.
5120 Or, your system might be quite happy with a simple libperl.$so.
5122 Since the shared libperl will get installed into a version-specific
5123 architecture-dependent directory, the version number of the shared perl
5124 library probably isn't important, so the default should be o.k.
5127 rp='What name do you want to give to the shared libperl?'
5130 echo "Ok, I'll use $libperl"
5133 libperl="libperl${_a}"
5137 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5141 WARNING: Use of the shrpdir variable for the installation location of
5142 the shared $libperl is not supported. It was never documented and
5143 will not work in this version. Let me (doughera@lafayette.edu)
5144 know of any problems this may cause.
5150 But your current setting of $shrpdir is
5151 the default anyway, so it's harmless.
5156 Further, your current attempted setting of $shrpdir
5157 conflicts with the value of $archlibexp/CORE
5158 that installperl will use.
5165 # How will the perl executable find the installed shared $libperl?
5166 # Add $xxx to ccdlflags.
5167 # If we can't figure out a command-line option, use $shrpenv to
5168 # set env LD_RUN_PATH. The main perl makefile uses this.
5169 shrpdir=$archlibexp/CORE
5172 if "$useshrplib"; then
5175 # We'll set it in Makefile.SH...
5181 xxx="-Wl,-R$shrpdir"
5183 linux|irix*|dec_osf)
5184 xxx="-Wl,-rpath,$shrpdir"
5187 # next doesn't like the default...
5190 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5196 # Only add $xxx if it isn't already in ccdlflags.
5197 case " $ccdlflags " in
5199 *) ccdlflags="$ccdlflags $xxx"
5202 Adding $xxx to the flags
5203 passed to $ld so that the perl executable will find the
5204 installed shared $libperl.
5212 # Respect a hint or command-line value.
5214 '') shrpenv="$tmp_shrpenv" ;;
5217 : determine where manual pages go
5218 set man1dir man1dir none
5222 $spackage has manual pages available in source form.
5226 echo "However, you don't have nroff, so they're probably useless to you."
5228 '') man1dir="none";;
5231 echo "If you don't want the manual sources installed, answer 'none'."
5236 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5237 lookpath="$lookpath $prefixexp/man/p_man/man1"
5238 lookpath="$lookpath $prefixexp/man/u_man/man1"
5239 lookpath="$lookpath $prefixexp/man/man.1"
5241 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5242 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5252 rp="Where do the main $spackage manual pages (source) go?"
5254 if $test "X$man1direxp" != "X$ansexp"; then
5258 man1direxp="$ansexp"
5266 Since you are running AFS, I need to distinguish the directory in which
5267 manual pages reside from the directory in which they are installed (and from
5268 which they are presumably copied to the former directory by occult means).
5271 case "$installman1dir" in
5272 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5273 *) dflt="$installman1dir";;
5276 rp='Where will man pages be installed?'
5278 installman1dir="$ans"
5280 installman1dir="$man1direxp"
5283 : What suffix to use on installed man pages
5290 rp="What suffix should be used for the main $spackage man pages?"
5292 '') case "$man1dir" in
5306 *) dflt="$man1ext";;
5313 : see if we can have long filenames
5315 rmlist="$rmlist /tmp/cf$$"
5316 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5317 first=123456789abcdef
5318 second=/tmp/cf$$/$first
5319 $rm -f $first $second
5320 if (echo hi >$first) 2>/dev/null; then
5321 if $test -f 123456789abcde; then
5322 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5325 if (echo hi >$second) 2>/dev/null; then
5326 if $test -f /tmp/cf$$/123456789abcde; then
5328 That's peculiar... You can have filenames longer than 14 characters, but only
5329 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5330 I shall consider your system cannot support long filenames at all.
5334 echo 'You can have filenames longer than 14 characters.' >&4
5339 How confusing! Some of your filesystems are sane enough to allow filenames
5340 longer than 14 characters but some others like /tmp can't even think about them.
5341 So, for now on, I shall assume your kernel does not allow them at all.
5348 You can't have filenames longer than 14 chars. You can't even think about them!
5354 $rm -rf /tmp/cf$$ 123456789abcde*
5356 : determine where library module manual pages go
5357 set man3dir man3dir none
5361 $spackage has manual pages for many of the library modules.
5367 However, you don't have nroff, so they're probably useless to you.
5370 '') man3dir="none";;
5374 case "$d_flexfnam" in
5377 However, your system can't handle the long file names like File::Basename.3.
5380 '') man3dir="none";;
5384 echo "If you don't want the manual sources installed, answer 'none'."
5385 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5387 '') case "$prefix" in
5388 *$prog*) dflt=`echo $man1dir |
5389 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5390 *) dflt="$privlib/man/man3" ;;
5394 *) dflt="$man3dir" ;;
5399 rp="Where do the $package library man pages (source) go?"
5401 if test "X$man3direxp" != "X$ansexp"; then
5406 man3direxp="$ansexp"
5414 Since you are running AFS, I need to distinguish the directory in which
5415 manual pages reside from the directory in which they are installed (and from
5416 which they are presumably copied to the former directory by occult means).
5419 case "$installman3dir" in
5420 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5421 *) dflt="$installman3dir";;
5424 rp='Where will man pages be installed?'
5426 installman3dir="$ans"
5428 installman3dir="$man3direxp"
5431 : What suffix to use on installed man pages
5438 rp="What suffix should be used for the $package library man pages?"
5440 '') case "$man3dir" in
5454 *) dflt="$man3ext";;
5461 : see if we have to deal with yellow pages, now NIS.
5462 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5463 if $test -f /usr/etc/nibindd; then
5465 echo "I'm fairly confident you're on a NeXT."
5467 rp='Do you get the hosts file via NetInfo?'
5476 y*) hostcat='nidump hosts .';;
5477 *) case "$hostcat" in
5478 nidump*) hostcat='';;
5488 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5496 rp='Are you getting the hosts file via yellow pages?'
5499 y*) hostcat='ypcat hosts';;
5500 *) hostcat='cat /etc/hosts';;
5506 '') hostcat='cat /etc/hosts';;
5509 '') groupcat='cat /etc/group';;
5512 '') passcat='cat /etc/passwd';;
5515 : now get the host name
5517 echo "Figuring out host name..." >&4
5518 case "$myhostname" in
5520 echo 'Maybe "hostname" will work...'
5521 if tans=`sh -c hostname 2>&1` ; then
5529 if $test "$cont"; then
5531 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5532 if tans=`cat /etc/systemid 2>&1` ; then
5534 phostname='cat /etc/systemid'
5535 echo "Whadyaknow. Xenix always was a bit strange..."
5538 elif $test -r /etc/systemid; then
5539 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5542 if $test "$cont"; then
5543 echo 'No, maybe "uuname -l" will work...'
5544 if tans=`sh -c 'uuname -l' 2>&1` ; then
5546 phostname='uuname -l'
5548 echo 'Strange. Maybe "uname -n" will work...'
5549 if tans=`sh -c 'uname -n' 2>&1` ; then
5551 phostname='uname -n'
5553 echo 'Oh well, maybe I can mine it out of whoami.h...'
5554 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5555 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5556 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5558 case "$myhostname" in
5559 '') echo "Does this machine have an identity crisis or something?"
5562 echo "Well, you said $myhostname before..."
5563 phostname='echo $myhostname';;
5569 : you do not want to know about this
5574 if $test "$myhostname" ; then
5576 rp='Your host name appears to be "'$myhostname'".'" Right?"
5584 : bad guess or no guess
5585 while $test "X$myhostname" = X ; do
5587 rp="Please type the (one word) name of your host:"
5592 : translate upper to lower if necessary
5593 case "$myhostname" in
5595 echo "(Normalizing case in your host name)"
5596 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5600 case "$myhostname" in
5602 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5603 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5604 echo "(Trimming domain name from host name--host name is now $myhostname)"
5606 *) case "$mydomain" in
5609 test "X$hostcat" = "Xypcat hosts" &&
5610 ypmatch "$myhostname" hosts 2>/dev/null |\
5611 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5614 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5615 /[ ]$myhostname[ . ]/p" > hosts
5618 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5619 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5620 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5621 hosts | $sort | $uniq | \
5622 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5623 case `$echo X$dflt` in
5624 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5627 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5632 tans=`./loc resolv.conf X /etc /usr/etc`
5633 if $test -f "$tans"; then
5634 echo "(Attempting domain name extraction from $tans)"
5635 dflt=.`$sed -n -e 's/ / /g' \
5636 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5637 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5639 .) dflt=.`$sed -n -e 's/ / /g' \
5640 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5641 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5648 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5649 dflt=.`sh -c domainname 2>/dev/null`
5652 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5657 .) echo "(Lost all hope -- silly guess then)"
5663 *) dflt="$mydomain";;
5667 rp="What is your domain name?"
5677 : translate upper to lower if necessary
5680 echo "(Normalizing case in your domain name)"
5681 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5685 : a little sanity check here
5686 case "$phostname" in
5689 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5690 $myhostname$mydomain|$myhostname) ;;
5692 case "$phostname" in
5694 echo "(That doesn't agree with your whoami.h file, by the way.)"
5697 echo "(That doesn't agree with your $phostname command, by the way.)"
5707 I need to get your e-mail address in Internet format if possible, i.e.
5708 something like user@host.domain. Please answer accurately since I have
5709 no easy means to double check it. The default value provided below
5710 is most probably close to the reality but may not be valid from outside
5711 your organization...
5715 while test "$cont"; do
5717 '') dflt="$cf_by@$myhostname$mydomain";;
5718 *) dflt="$cf_email";;
5720 rp='What is your e-mail address?'
5726 rp='Address does not look like an Internet one. Use it anyway?'
5742 If you or somebody else will be maintaining perl at your site, please
5743 fill in the correct e-mail address here so that they may be contacted
5744 if necessary. Currently, the "perlbug" program included with perl
5745 will send mail to this address in addition to perlbug@perl.com. You may
5746 enter "none" for no administrator.
5749 case "$perladmin" in
5750 '') dflt="$cf_email";;
5751 *) dflt="$perladmin";;
5753 rp='Perl administrator e-mail address'
5757 : figure out how to guarantee perl startup
5758 case "$startperl" in
5760 case "$sharpbang" in
5764 I can use the #! construct to start perl on your system. This will
5765 make startup of perl scripts faster, but may cause problems if you
5766 want to share those scripts and perl is not in a standard place
5767 ($binexp/perl) on all your platforms. The alternative is to force
5768 a shell by starting the script with a single ':' character.
5772 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
5775 none) startperl=": # use perl";;
5776 *) startperl="#!$ans"
5777 if $test 30 -lt `echo "$ans" | wc -c`; then
5780 WARNING: Some systems limit the #! command to 32 characters.
5781 If you experience difficulty running Perl scripts with #!, try
5782 installing Perl in a directory with a shorter pathname.
5788 *) startperl=": # use perl"
5793 echo "I'll use $startperl to start perl scripts."
5795 : figure best path for perl in scripts
5798 perlpath="$binexp/perl"
5799 case "$startperl" in
5804 I will use the "eval 'exec'" idiom to start Perl on your system.
5805 I can use the full path of your Perl binary for this purpose, but
5806 doing so may cause problems if you want to share those scripts and
5807 Perl is not always in a standard place ($binexp/perl).
5811 rp="What path shall I use in \"eval 'exec'\"?"
5818 case "$startperl" in
5820 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
5823 : determine where public executable scripts go
5824 set scriptdir scriptdir
5826 case "$scriptdir" in
5829 : guess some guesses
5830 $test -d /usr/share/scripts && dflt=/usr/share/scripts
5831 $test -d /usr/share/bin && dflt=/usr/share/bin
5832 $test -d /usr/local/script && dflt=/usr/local/script
5833 $test -d $prefixexp/script && dflt=$prefixexp/script
5837 *) dflt="$scriptdir"
5842 Some installations have a separate directory just for executable scripts so
5843 that they can mount it across multiple architectures but keep the scripts in
5844 one spot. You might, for example, have a subdirectory of /usr/share for this.
5845 Or you might just lump your scripts in with all your other executables.
5849 rp='Where do you keep publicly executable scripts?'
5851 if $test "X$ansexp" != "X$scriptdirexp"; then
5855 scriptdirexp="$ansexp"
5859 Since you are running AFS, I need to distinguish the directory in which
5860 scripts reside from the directory in which they are installed (and from
5861 which they are presumably copied to the former directory by occult means).
5864 case "$installscript" in
5865 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
5866 *) dflt="$installscript";;
5869 rp='Where will public scripts be installed?'
5871 installscript="$ans"
5873 installscript="$scriptdirexp"
5876 : determine where site specific libraries go.
5877 : Usual default is /usr/local/lib/perl5/site_perl/$apiversion
5878 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5880 *perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
5881 *) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
5886 The installation process will also create a directory for
5887 site-specific extensions and modules. Some users find it convenient
5888 to place all local files in this directory rather than in the main
5889 distribution directory.
5893 rp='Pathname for the site-specific library files?'
5895 if $test "X$sitelibexp" != "X$ansexp"; then
5899 sitelibexp="$ansexp"
5903 Since you are running AFS, I need to distinguish the directory in
5904 which site-specific files reside from the directory in which they are
5905 installed (and from which they are presumably copied to the former
5906 directory by occult means).
5909 case "$installsitelib" in
5910 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
5911 *) dflt="$installsitelib";;
5914 rp='Where will site-specific files be installed?'
5916 installsitelib="$ans"
5918 installsitelib="$sitelibexp"
5921 : determine where site specific architecture-dependent libraries go.
5922 : sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
5923 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
5924 : sitelib may have an optional trailing /share.
5925 tdflt=`echo $sitelib | $sed 's,/share$,,'`
5926 tdflt="$tdflt/$archname"
5927 set sitearch sitearch none
5930 '') dflt="$tdflt" ;;
5931 *) dflt="$sitearch" ;;
5935 The installation process will also create a directory for
5936 architecture-dependent site-specific extensions and modules.
5940 rp='Pathname for the site-specific architecture-dependent library files?'
5942 if $test "X$sitearchexp" != "X$ansexp"; then
5946 sitearchexp="$ansexp"
5950 Since you are running AFS, I need to distinguish the directory in
5951 which site-specific architecture-dependent library files reside from
5952 the directory in which they are installed (and from which they are
5953 presumably copied to the former directory by occult means).
5956 case "$installsitearch" in
5957 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
5958 *) dflt="$installsitearch";;
5961 rp='Where will site-specific architecture-dependent files be installed?'
5963 installsitearch="$ans"
5965 installsitearch="$sitearchexp"
5970 Previous version of $package used the standard IO mechanisms as defined
5971 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
5972 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
5973 the default. This abstraction layer can use AT&T's sfio (if you already
5974 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
5975 problems with some extension modules. Using PerlIO with stdio is safe,
5976 but it is slower than plain stdio and therefore is not the default.
5978 If this doesn't make any sense to you, just accept the default 'n'.
5980 case "$useperlio" in
5981 $define|true|[yY]*) dflt='y';;
5984 rp='Use the experimental PerlIO abstraction layer?'
5991 echo "Ok, doing things the stdio way"
5998 : Check how to convert floats to strings.
5999 if test "X$d_Gconvert" = X; then
6001 echo "Checking for an efficient way to convert floats to strings."
6004 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6005 char *myname = "gconvert";
6008 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6009 char *myname = "gcvt";
6012 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6013 char *myname = "sprintf";
6019 checkit(expect, got)
6023 if (strcmp(expect, got)) {
6024 printf("%s oddity: Expected %s, got %s\n",
6025 myname, expect, got);
6036 /* This must be 1st test on (which?) platform */
6037 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6038 Gconvert(0.1, 8, 0, buf);
6039 checkit("0.1", buf);
6041 Gconvert(1.0, 8, 0, buf);
6044 Gconvert(0.0, 8, 0, buf);
6047 Gconvert(-1.0, 8, 0, buf);
6050 /* Some Linux gcvt's give 1.e+5 here. */
6051 Gconvert(100000.0, 8, 0, buf);
6052 checkit("100000", buf);
6054 /* Some Linux gcvt's give -1.e+5 here. */
6055 Gconvert(-100000.0, 8, 0, buf);
6056 checkit("-100000", buf);
6061 case "$d_Gconvert" in
6062 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6063 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6064 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6065 *) xxx_list='gconvert gcvt sprintf' ;;
6068 for xxx_convert in $xxx_list; do
6069 echo "Trying $xxx_convert"
6071 set try -DTRY_$xxx_convert
6072 if eval $compile; then
6073 echo "$xxx_convert" found. >&4
6075 echo "I'll use $xxx_convert to convert floats into a string." >&4
6078 echo "...But $xxx_convert didn't work as I expected."
6081 echo "$xxx_convert NOT found." >&4
6085 case "$xxx_convert" in
6086 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6087 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6088 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6092 : Initialize h_fcntl
6095 : Initialize h_sysfile
6098 : access call always available on UNIX
6102 : locate the flags for 'access()'
6106 $cat >access.c <<'EOCP'
6107 #include <sys/types.h>
6112 #include <sys/file.h>
6121 : check sys/file.h first, no particular reason here
6122 if $test `./findhdr sys/file.h` && \
6123 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
6125 echo "<sys/file.h> defines the *_OK access constants." >&4
6126 elif $test `./findhdr fcntl.h` && \
6127 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
6129 echo "<fcntl.h> defines the *_OK access constants." >&4
6130 elif $test `./findhdr unistd.h` && \
6131 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
6132 echo "<unistd.h> defines the *_OK access constants." >&4
6134 echo "I can't find the four *_OK access constants--I'll use mine." >&4
6140 : see if alarm exists
6144 : Look for GNU-cc style attribute checking
6146 echo "Checking whether your compiler can handle __attribute__ ..." >&4
6147 $cat >attrib.c <<'EOCP'
6149 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
6151 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
6152 if $contains 'warning' attrib.out >/dev/null 2>&1; then
6153 echo "Your C compiler doesn't fully support __attribute__."
6156 echo "Your C compiler supports __attribute__."
6160 echo "Your C compiler doesn't seem to understand __attribute__ at all."
6167 : see if bcmp exists
6171 : see if bcopy exists
6175 : see if this is a unistd.h system
6176 set unistd.h i_unistd
6179 : see if getpgrp exists
6180 set getpgrp d_getpgrp
6183 case "$d_getpgrp" in
6186 echo "Checking to see which flavor of getpgrp is in use..."
6189 #include <sys/types.h>
6191 # include <unistd.h>
6195 if (getuid() == 0) {
6196 printf("(I see you are running Configure as super-user...)\n");
6200 if (getpgrp(1) == 0)
6209 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6210 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6212 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6213 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6216 echo "I can't seem to compile and run the test program."
6218 xxx="a USG one, i.e. you use getpgrp()."
6220 # SVR4 systems can appear rather BSD-ish.
6223 xxx="a BSD one, i.e. you use getpgrp(pid)."
6227 xxx="probably a USG one, i.e. you use getpgrp()."
6232 echo "Assuming your getpgrp is $xxx" >&4
6241 : see if setpgrp exists
6242 set setpgrp d_setpgrp
6245 case "$d_setpgrp" in
6248 echo "Checking to see which flavor of setpgrp is in use..."
6251 #include <sys/types.h>
6253 # include <unistd.h>
6257 if (getuid() == 0) {
6258 printf("(I see you are running Configure as super-user...)\n");
6262 if (-1 == setpgrp(1, 1))
6265 if (setpgrp() != -1)
6271 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6272 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6274 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6275 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6278 echo "(I can't seem to compile and run the test program.)"
6280 xxx="a USG one, i.e. you use setpgrp()."
6282 # SVR4 systems can appear rather BSD-ish.
6285 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6289 xxx="probably a USG one, i.e. you use setpgrp()."
6294 echo "Assuming your setpgrp is $xxx" >&4
6302 : see if bzero exists
6306 : check for lengths of integral types
6310 echo "Checking to see how big your integers are..." >&4
6311 $cat >intsize.c <<'EOCP'
6315 printf("intsize=%d;\n", sizeof(int));
6316 printf("longsize=%d;\n", sizeof(long));
6317 printf("shortsize=%d;\n", sizeof(short));
6322 if eval $compile_ok && ./intsize > /dev/null; then
6324 echo "Your integers are $intsize bytes long."
6325 echo "Your long integers are $longsize bytes long."
6326 echo "Your short integers are $shortsize bytes long."
6330 Help! I can't compile and run the intsize test program: please enlighten me!
6331 (This is probably a misconfiguration in your system or libraries, and
6332 you really ought to fix it. Still, I'll try anyway.)
6336 rp="What is the size of an integer (in bytes)?"
6340 rp="What is the size of a long integer (in bytes)?"
6344 rp="What is the size of a short integer (in bytes)?"
6350 $rm -f intsize intsize.*
6352 : see if signal is declared as pointer to function returning int or void
6354 xxx=`./findhdr signal.h`
6355 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6356 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6357 echo "You have int (*signal())() instead of void." >&4
6359 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6360 echo "You have void (*signal())()." >&4
6362 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6363 echo "You have int (*signal())() instead of void." >&4
6365 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6366 echo "You have void (*signal())()." >&4
6369 case "$d_voidsig" in
6371 echo "I can't determine whether signal handler returns void or int..." >&4
6373 rp="What type does your signal handler return?"
6380 echo "As you already told me, signal handler returns void." >&4
6383 *) echo "As you already told me, signal handler returns int." >&4
6390 case "$d_voidsig" in
6391 "$define") signal_t="void";;
6396 : check for ability to cast large floats to 32-bit ints.
6398 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6399 if $test "$intsize" -ge 4; then
6406 #include <sys/types.h>
6408 $signal_t blech(s) int s; { exit(3); }
6415 signal(SIGFPE, blech);
6417 /* Don't let compiler optimize the test away. Store the number
6418 in a writable string for gcc to pass to sscanf under HP/UX.
6420 sprintf(str, "2147483647");
6421 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6425 /* x86 processors will probably give 0x8000 0000, which is a
6426 sign change. We don't want that. We want to mimic SPARC
6427 behavior here, which is to preserve the sign and give
6430 if (i32 != ($xxx) f)
6436 if eval $compile_ok; then
6440 echo "(I can't seem to compile the test program--assuming it can't)"
6448 echo "Nope, it can't."
6455 : check for ability to cast negative floats to unsigned
6457 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6460 #include <sys/types.h>
6462 $signal_t blech(s) int s; { exit(7); }
6463 $signal_t blech_in_list(s) int s; { exit(4); }
6464 unsigned long dummy_long(p) unsigned long p; { return p; }
6465 unsigned int dummy_int(p) unsigned int p; { return p; }
6466 unsigned short dummy_short(p) unsigned short p; { return p; }
6470 unsigned long along;
6472 unsigned short ashort;
6476 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6477 a direct f = -123. assignment. gcc-2.8.0 reportedly
6478 optimized the whole file away
6480 /* Store the number in a writable string for gcc to pass to
6483 sprintf(str, "-123");
6484 sscanf(str, "%lf", &f); /* f = -123.; */
6486 signal(SIGFPE, blech);
6487 along = (unsigned long)f;
6488 aint = (unsigned int)f;
6489 ashort = (unsigned short)f;
6490 if (along != (unsigned long)-123)
6492 if (aint != (unsigned int)-123)
6494 if (ashort != (unsigned short)-123)
6496 sprintf(str, "1073741824.");
6497 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6500 along = (unsigned long)f;
6501 if (along != 0x80000000)
6505 along = (unsigned long)f;
6506 if (along != 0x7fffffff)
6510 along = (unsigned long)f;
6511 if (along != 0x80000001)
6515 signal(SIGFPE, blech_in_list);
6516 sprintf(str, "123.");
6517 sscanf(str, "%lf", &f); /* f = 123.; */
6518 along = dummy_long((unsigned long)f);
6519 aint = dummy_int((unsigned int)f);
6520 ashort = dummy_short((unsigned short)f);
6521 if (along != (unsigned long)123)
6523 if (aint != (unsigned int)123)
6525 if (ashort != (unsigned short)123)
6532 if eval $compile_ok; then
6536 echo "(I can't seem to compile the test program--assuming it can't)"
6539 case "$castflags" in
6544 echo "Nope, it can't."
6551 : see if vprintf exists
6553 if set vprintf val -f d_vprintf; eval $csym; $val; then
6554 echo 'vprintf() found.' >&4
6556 $cat >vprintf.c <<'EOF'
6557 #include <varargs.h>
6559 main() { xxx("foo"); }
6568 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6572 if eval $compile && ./vprintf; then
6573 echo "Your vsprintf() returns (int)." >&4
6576 echo "Your vsprintf() returns (char*)." >&4
6580 echo 'vprintf() NOT found.' >&4
6590 : see if chown exists
6594 : see if chroot exists
6598 : see if chsize exists
6602 : check for const keyword
6604 echo 'Checking to see if your C compiler knows about "const"...' >&4
6605 $cat >const.c <<'EOCP'
6606 typedef struct spug { int drokk; } spug;
6613 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
6615 echo "Yup, it does."
6618 echo "Nope, it doesn't."
6623 : see if crypt exists
6625 if set crypt val -f d_crypt; eval $csym; $val; then
6626 echo 'crypt() found.' >&4
6630 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
6631 if $test -z "$cryptlib"; then
6632 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
6636 if $test -z "$cryptlib"; then
6637 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
6641 if $test -z "$cryptlib"; then
6642 cryptlib=`./loc libcrypt$_a "" $libpth`
6646 if $test -z "$cryptlib"; then
6647 echo 'crypt() NOT found.' >&4
6656 : see if cuserid exists
6657 set cuserid d_cuserid
6660 : see if this is a limits.h system
6661 set limits.h i_limits
6664 : see if this is a float.h system
6668 : See if number of significant digits in a double precision number is known
6670 $cat >dbl_dig.c <<EOM
6680 printf("Contains DBL_DIG");
6683 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
6684 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
6685 echo "DBL_DIG found." >&4
6688 echo "DBL_DIG NOT found." >&4
6695 : see if difftime exists
6696 set difftime d_difftime
6699 : see if this is a dirent system
6701 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
6703 echo "<dirent.h> found." >&4
6706 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
6707 echo "<sys/dir.h> found." >&4
6710 xinc=`./findhdr sys/ndir.h`
6712 echo "<dirent.h> NOT found." >&4
6717 : Look for type of directory structure.
6719 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6721 case "$direntrytype" in
6724 $define) guess1='struct dirent' ;;
6725 *) guess1='struct direct' ;;
6728 *) guess1="$direntrytype"
6733 'struct dirent') guess2='struct direct' ;;
6734 *) guess2='struct dirent' ;;
6737 if $contains "$guess1" try.c >/dev/null 2>&1; then
6738 direntrytype="$guess1"
6739 echo "Your directory entries are $direntrytype." >&4
6740 elif $contains "$guess2" try.c >/dev/null 2>&1; then
6741 direntrytype="$guess2"
6742 echo "Your directory entries seem to be $direntrytype." >&4
6744 echo "I don't recognize your system's directory entries." >&4
6745 rp="What type is used for directory entries on this system?"
6753 : see if the directory entry stores field length
6755 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6756 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
6757 echo "Good, your directory entry keeps length information in d_namlen." >&4
6760 echo "Your directory entry does not know about the d_namlen field." >&4
6767 : see if dlerror exists
6770 set dlerror d_dlerror
6774 : see if dlfcn is available
6782 On a few systems, the dynamically loaded modules that perl generates and uses
6783 will need a different extension than shared libs. The default will probably
6791 rp='What is the extension of dynamically loaded modules'
6800 : Check if dlsym need a leading underscore
6806 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
6807 $cat >dyna.c <<'EOM'
6816 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
6818 #include <sys/types.h>
6832 int mode = RTLD_LAZY ;
6834 handle = dlopen("./dyna.$dlext", mode) ;
6835 if (handle == NULL) {
6840 symbol = dlsym(handle, "fred") ;
6841 if (symbol == NULL) {
6842 /* try putting a leading underscore */
6843 symbol = dlsym(handle, "_fred") ;
6844 if (symbol == NULL) {
6857 : Call the object file tmp-dyna.o in case dlext=o.
6858 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
6859 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
6860 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
6861 $cc $ccflags $ldflags $cccdlflags $ccdlflags -o fred fred.c $libs > /dev/null 2>&1; then
6864 1) echo "Test program failed using dlopen." >&4
6865 echo "Perhaps you should not use dynamic loading." >&4;;
6866 2) echo "Test program failed using dlsym." >&4
6867 echo "Perhaps you should not use dynamic loading." >&4;;
6868 3) echo "dlsym needs a leading underscore" >&4
6870 4) echo "dlsym doesn't need a leading underscore." >&4;;
6873 echo "I can't compile and run the test program." >&4
6878 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
6883 : see if dup2 exists
6887 : see if endhostent exists
6888 set endhostent d_endhent
6891 : see if endnetent exists
6892 set endnetent d_endnent
6895 : see if endprotoent exists
6896 set endprotoent d_endpent
6899 : see if endservent exists
6900 set endservent d_endsent
6903 : Locate the flags for 'open()'
6905 $cat >open3.c <<'EOCP'
6906 #include <sys/types.h>
6911 #include <sys/file.h>
6922 : check sys/file.h first to get FREAD on Sun
6923 if $test `./findhdr sys/file.h` && \
6924 set open3 -DI_SYS_FILE && eval $compile; then
6926 echo "<sys/file.h> defines the O_* constants..." >&4
6928 echo "and you have the 3 argument form of open()." >&4
6931 echo "but not the 3 argument form of open(). Oh, well." >&4
6934 elif $test `./findhdr fcntl.h` && \
6935 set open3 -DI_FCNTL && eval $compile; then
6937 echo "<fcntl.h> defines the O_* constants..." >&4
6939 echo "and you have the 3 argument form of open()." >&4
6942 echo "but not the 3 argument form of open(). Oh, well." >&4
6947 echo "I can't find the O_* constant definitions! You got problems." >&4
6953 : check for non-blocking I/O stuff
6954 case "$h_sysfile" in
6955 true) echo "#include <sys/file.h>" > head.c;;
6958 true) echo "#include <fcntl.h>" > head.c;;
6959 *) echo "#include <sys/fcntl.h>" > head.c;;
6964 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
6965 case "$o_nonblock" in
6968 $cat >>try.c <<'EOCP'
6971 printf("O_NONBLOCK\n");
6975 printf("O_NDELAY\n");
6979 printf("FNDELAY\n");
6986 if eval $compile_ok; then
6988 case "$o_nonblock" in
6989 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
6990 *) echo "Seems like we can use $o_nonblock.";;
6993 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
6996 *) echo "Using $hint value $o_nonblock.";;
6998 $rm -f try try.* .out core
7001 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7007 #include <sys/types.h>
7009 #define MY_O_NONBLOCK $o_nonblock
7010 #ifndef errno /* XXX need better Configure test */
7013 $signal_t blech(x) int x; { exit(3); }
7015 $cat >> try.c <<'EOCP'
7023 pipe(pd); /* Down: child -> parent */
7024 pipe(pu); /* Up: parent -> child */
7027 close(pd[1]); /* Parent reads from pd[0] */
7028 close(pu[0]); /* Parent writes (blocking) to pu[1] */
7029 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
7031 signal(SIGALRM, blech);
7033 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
7035 sprintf(string, "%d\n", ret);
7036 write(2, string, strlen(string));
7039 if (errno == EAGAIN) {
7045 if (errno == EWOULDBLOCK)
7046 printf("EWOULDBLOCK\n");
7049 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
7050 sleep(2); /* Give it time to close our pipe */
7052 ret = read(pd[0], buf, 1); /* Should read EOF */
7054 sprintf(string, "%d\n", ret);
7055 write(3, string, strlen(string));
7059 close(pd[0]); /* We write to pd[1] */
7060 close(pu[1]); /* We read from pu[0] */
7061 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
7062 close(pd[1]); /* Pipe pd is now fully closed! */
7063 exit(0); /* Bye bye, thank you for playing! */
7067 if eval $compile_ok; then
7068 echo "$startsh" >mtry
7069 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
7071 ./mtry >/dev/null 2>&1
7073 0) eagain=`$cat try.out`;;
7074 1) echo "Could not perform non-blocking setting!";;
7075 2) echo "I did a successful read() for something that was not there!";;
7076 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
7077 *) echo "Something terribly wrong happened during testing.";;
7079 rd_nodata=`$cat try.ret`
7080 echo "A read() system call with no data present returns $rd_nodata."
7081 case "$rd_nodata" in
7084 echo "(That's peculiar, fixing that to be -1.)"
7090 echo "Forcing errno EAGAIN on read() with no data available."
7094 echo "Your read() sets errno to $eagain when no data is available."
7097 status=`$cat try.err`
7099 0) echo "And it correctly returns 0 to signal EOF.";;
7100 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
7101 *) echo "However, your read() returns '$status' on EOF??";;
7104 if test "$status" = "$rd_nodata"; then
7105 echo "WARNING: you can't distinguish between EOF and no data!"
7109 echo "I can't compile the test program--assuming errno EAGAIN will do."
7116 echo "Using $hint value $eagain."
7117 echo "Your read() returns $rd_nodata when no data is present."
7118 case "$d_eofnblk" in
7119 "$define") echo "And you can see EOF because read() returns 0.";;
7120 "$undef") echo "But you can't see EOF status from read() returned value.";;
7122 echo "(Assuming you can't see EOF status from read anyway.)"
7128 $rm -f try try.* .out core head.c mtry
7130 : see if fchmod exists
7134 : see if fchown exists
7138 : see if this is an fcntl system
7142 : see if fgetpos exists
7143 set fgetpos d_fgetpos
7146 : see if flock exists
7150 : see if fork exists
7154 : see if pathconf exists
7155 set pathconf d_pathconf
7158 : see if fpathconf exists
7159 set fpathconf d_fpathconf
7162 : see if fsetpos exists
7163 set fsetpos d_fsetpos
7166 : see if gethostbyaddr exists
7167 set gethostbyaddr d_gethbyaddr
7170 : see if gethostbyname exists
7171 set gethostbyname d_gethbyname
7174 : see if gethostent exists
7175 set gethostent d_gethent
7178 hasproto='varname=$1; func=$2; shift; shift;
7179 while $test $# -ge 2; do
7181 $define) echo "#include <$2>";;
7185 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7186 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7187 echo "$func() prototype found.";
7190 echo "$func() prototype NOT found.";
7195 $rm -f try.c tryout.c'
7197 : see if this is a netdb.h system
7201 : see if prototypes for various gethostxxx netdb.h functions are available
7203 set d_gethostprotos gethostent $i_netdb netdb.h
7206 : see if getlogin exists
7207 set getlogin d_getlogin
7210 : see if getnetbyaddr exists
7211 set getnetbyaddr d_getnbyaddr
7214 : see if getnetbyname exists
7215 set getnetbyname d_getnbyname
7218 : see if getnetent exists
7219 set getnetent d_getnent
7222 : see if prototypes for various getnetxxx netdb.h functions are available
7224 set d_getnetprotos getnetent $i_netdb netdb.h
7228 : see if getprotobyname exists
7229 set getprotobyname d_getpbyname
7232 : see if getprotobynumber exists
7233 set getprotobynumber d_getpbynumber
7236 : see if getprotoent exists
7237 set getprotoent d_getpent
7240 : see if getpgid exists
7241 set getpgid d_getpgid
7244 : see if getpgrp2 exists
7245 set getpgrp2 d_getpgrp2
7248 : see if getppid exists
7249 set getppid d_getppid
7252 : see if getpriority exists
7253 set getpriority d_getprior
7256 : see if prototypes for various getprotoxxx netdb.h functions are available
7258 set d_getprotoprotos getprotoent $i_netdb netdb.h
7261 : see if getservbyname exists
7262 set getservbyname d_getsbyname
7265 : see if getservbyport exists
7266 set getservbyport d_getsbyport
7269 : see if getservent exists
7270 set getservent d_getsent
7273 : see if prototypes for various getservxxx netdb.h functions are available
7275 set d_getservprotos getservent $i_netdb netdb.h
7278 : see if gettimeofday or ftime exists
7279 set gettimeofday d_gettimeod
7281 case "$d_gettimeod" in
7287 val="$undef"; set d_ftime; eval $setvar
7290 case "$d_gettimeod$d_ftime" in
7293 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
7297 : see if this is a netinet/in.h or sys/in.h system
7298 set netinet/in.h i_niin sys/in.h i_sysin
7301 : see if this is an arpa/inet.h
7302 set arpa/inet.h i_arpa_inet
7305 : see if htonl --and friends-- exists
7310 : Maybe they are macros.
7315 #include <sys/types.h>
7316 #$i_niin I_NETINET_IN
7318 #$i_arpainet I_ARPA_INET
7320 #include <netinet/in.h>
7326 #include <arpa/inet.h>
7329 printf("Defined as a macro.");
7332 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
7333 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
7335 echo "But it seems to be defined as a macro." >&4
7343 : see which of string.h or strings.h is needed
7345 strings=`./findhdr string.h`
7346 if $test "$strings" && $test -r "$strings"; then
7347 echo "Using <string.h> instead of <strings.h>." >&4
7351 strings=`./findhdr strings.h`
7352 if $test "$strings" && $test -r "$strings"; then
7353 echo "Using <strings.h> instead of <string.h>." >&4
7355 echo "No string header found -- You'll surely have problems." >&4
7361 "$undef") strings=`./findhdr strings.h`;;
7362 *) strings=`./findhdr string.h`;;
7367 if set index val -f; eval $csym; $val; then
7368 if set strchr val -f d_strchr; eval $csym; $val; then
7369 if $contains strchr "$strings" >/dev/null 2>&1 ; then
7372 echo "strchr() found." >&4
7376 echo "index() found." >&4
7381 echo "index() found." >&4
7384 if set strchr val -f d_strchr; eval $csym; $val; then
7387 echo "strchr() found." >&4
7389 echo "No index() or strchr() found!" >&4
7394 set d_strchr; eval $setvar
7396 set d_index; eval $setvar
7398 : check whether inet_aton exists
7399 set inet_aton d_inetaton
7404 $cat >isascii.c <<'EOCP'
7416 if eval $compile; then
7417 echo "isascii() found." >&4
7420 echo "isascii() NOT found." >&4
7427 : see if killpg exists
7431 : see if lchown exists
7433 $cat > try.c <<'EOCP'
7434 /* System header to define __stub macros and hopefully few prototypes,
7435 which can conflict with char lchown(); below. */
7437 /* Override any gcc2 internal prototype to avoid an error. */
7438 /* We use char because int might match the return type of a gcc2
7439 builtin and then its argument prototype would still apply. */
7442 /* The GNU C library defines this for functions which it implements
7443 to always fail with ENOSYS. Some functions are actually named
7444 something starting with __ and the normal name is an alias. */
7445 #if defined (__stub_lchown) || defined (__stub___lchown)
7453 if eval $compile; then
7454 $echo "lchown() found." >&4
7457 $echo "lchown() NOT found." >&4
7463 : see if link exists
7467 : see if localeconv exists
7468 set localeconv d_locconv
7471 : see if lockf exists
7475 : check for long doubles
7477 echo $n "Checking to see if your system supports long doubles...$c" >&4
7478 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7479 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7481 echo " Yup, it does." >&4
7484 echo " Nope, it doesn't." >&4
7490 : check for length of long double
7491 case "${d_longdbl}${longdblsize}" in
7494 $echo $n "Checking to see how big your long doubles are...$c" >&4
7495 $cat >try.c <<'EOCP'
7499 printf("%d\n", sizeof(long double));
7503 if eval $compile; then
7505 $echo " $longdblsize bytes." >&4
7509 echo "(I can't seem to compile the test program. Guessing...)" >&4
7510 rp="What is the size of a long double (in bytes)?"
7518 : check for long long
7520 echo $n "Checking to see if your system supports long long...$c" >&4
7521 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
7522 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7524 echo " Yup, it does." >&4
7527 echo " Nope, it doesn't." >&4
7533 : check for length of long long
7534 case "${d_longlong}${longlongsize}" in
7537 $echo $n "Checking to see how big your long longs are...$c" >&4
7538 $cat >try.c <<'EOCP'
7542 printf("%d\n", sizeof(long long));
7546 if eval $compile_ok; then
7547 longlongsize=`./try`
7548 $echo " $longlongsize bytes." >&4
7552 echo "(I can't seem to compile the test program. Guessing...)"
7553 rp="What is the size of a long long (in bytes)?"
7561 : see if lstat exists
7565 : see if mblen exists
7569 : see if mbstowcs exists
7570 set mbstowcs d_mbstowcs
7573 : see if mbtowc exists
7577 : see if memcmp exists
7581 : see if memcpy exists
7585 : see if memmove exists
7586 set memmove d_memmove
7589 : see if memset exists
7593 : see if mkdir exists
7597 : see if mkfifo exists
7601 : see if mktime exists
7605 : see if msgctl exists
7609 : see if msgget exists
7613 : see if msgsnd exists
7617 : see if msgrcv exists
7621 : see how much of the 'msg*(2)' library is present.
7624 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
7625 *"$undef"*) h_msg=false;;
7627 : we could also check for sys/ipc.h ...
7628 if $h_msg && $test `./findhdr sys/msg.h`; then
7629 echo "You have the full msg*(2) library." >&4
7632 echo "You don't have the full msg*(2) library." >&4
7638 : see if nice exists
7642 : see if pause exists
7646 : see if pipe exists
7650 : see if poll exists
7655 : see whether the various POSIXish _yields exist within given cccmd
7657 #include <pthread.h>
7663 : see if pthread_yield exists within given cccmd,
7664 : if we do not usethreads this may well end up undef.
7665 set try -DYIELD=pthread_yield
7666 if eval $compile; then
7668 echo 'pthread_yield() found.' >&4
7671 echo 'pthread_yield() NOT found.' >&4
7676 : see if sched_yield exists within given cccmd,
7677 : if we do not usethreads this may well end up undef.
7678 set try -DYIELD=sched_yield
7679 if eval $compile; then
7681 echo 'sched_yield() found.' >&4
7684 echo 'sched_yield() NOT found.' >&4
7690 : test whether pthreads are created in joinable -- aka undetached -- state
7691 if test "X$usethreads" = "X$define"; then
7692 echo $n "Checking whether pthreads are created joinable. $c" >&4
7693 $cat >try.c <<'EOCP'
7694 #include <pthread.h>
7697 pthread_attr_t attr;
7700 pthread_attr_init(&attr) == 0 &&
7701 pthread_attr_getdetachstate(&attr, &detachstate) == 0 &&
7702 detachstate == PTHREAD_CREATE_DETACHED ?
7703 "detached" : "joinable");
7708 if eval $compile; then
7711 detached) echo "Nope, they aren't." >&4 ;;
7712 *) echo "Yup, they are." >&4 ;;
7716 echo "(I can't execute the test program--assuming they are.)" >&4
7721 detached) val="$undef" ;;
7724 set d_pthreads_created_joinable
7727 d_pthreads_created_joinable="$undef"
7730 : see if this is a pwd.h system
7736 : see if setpwent exists
7737 set setpwent d_setpwent
7740 : see if getpwent exists
7741 set getpwent d_getpwent
7744 : see if endpwent exists
7745 set endpwent d_endpwent
7748 xxx=`./findhdr pwd.h`
7749 $cppstdin $cppflags $cppminus < $xxx >$$.h
7751 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
7759 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
7767 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
7775 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
7783 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
7791 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
7799 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
7807 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
7817 *) # Assume all is lost as far as the d_*pw* go.
7819 set d_setpwent; eval $setvar
7820 set d_getpwent; eval $setvar
7821 set d_endpwent; eval $setvar
7822 set d_pwquota; eval $setvar
7823 set d_pwage; eval $setvar
7824 set d_pwchange; eval $setvar
7825 set d_pwclass; eval $setvar
7826 set d_pwexpire; eval $setvar
7827 set d_pwcomment; eval $setvar
7828 set d_pwgecos; eval $setvar
7829 set d_pwpasswd; eval $setvar
7833 : see if readdir and friends exist
7834 set readdir d_readdir
7836 set seekdir d_seekdir
7838 set telldir d_telldir
7840 set rewinddir d_rewinddir
7843 : see if readlink exists
7844 set readlink d_readlink
7847 : see if rename exists
7851 : see if rmdir exists
7855 : see if memory.h is available.
7860 : See if it conflicts with string.h
7866 $cppstdin $cppflags $cppminus < $strings > mem.h
7867 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
7869 echo "We won't be including <memory.h>."
7879 : can bcopy handle overlapping blocks?
7884 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
7891 $cat >>try.c <<'EOCP'
7894 # include <memory.h>
7897 # include <stdlib.h>
7900 # include <string.h>
7902 # include <strings.h>
7905 # include <unistd.h> /* Needed for NetBSD */
7909 char buf[128], abc[128];
7915 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
7917 for (align = 7; align >= 0; align--) {
7918 for (len = 36; len; len--) {
7921 for (off = 1; off <= len; off++) {
7922 bcopy(b, b+off, len);
7923 bcopy(b+off, b, len);
7924 if (bcmp(b, abc, len))
7933 if eval $compile_ok; then
7934 if ./try 2>/dev/null; then
7938 echo "It can't, sorry."
7939 case "$d_memmove" in
7940 "$define") echo "But that's Ok since you have memmove()." ;;
7944 echo "(I can't compile the test program, so we'll assume not...)"
7945 case "$d_memmove" in
7946 "$define") echo "But that's Ok since you have memmove()." ;;
7951 $rm -f try.* try core
7955 : can memcpy handle overlapping blocks?
7960 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
7967 $cat >>try.c <<'EOCP'
7970 # include <memory.h>
7973 # include <stdlib.h>
7976 # include <string.h>
7978 # include <strings.h>
7981 # include <unistd.h> /* Needed for NetBSD */
7985 char buf[128], abc[128];
7991 /* Copy "abcde..." string to char abc[] so that gcc doesn't
7992 try to store the string in read-only memory. */
7993 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
7995 for (align = 7; align >= 0; align--) {
7996 for (len = 36; len; len--) {
7998 memcpy(b, abc, len);
7999 for (off = 1; off <= len; off++) {
8000 memcpy(b+off, b, len);
8001 memcpy(b, b+off, len);
8002 if (memcmp(b, abc, len))
8011 if eval $compile_ok; then
8012 if ./try 2>/dev/null; then
8016 echo "It can't, sorry."
8017 case "$d_memmove" in
8018 "$define") echo "But that's Ok since you have memmove()." ;;
8022 echo "(I can't compile the test program, so we'll assume not...)"
8023 case "$d_memmove" in
8024 "$define") echo "But that's Ok since you have memmove()." ;;
8029 $rm -f try.* try core
8033 : can memcmp be trusted to compare relative magnitude?
8038 echo "Checking if your memcmp() can compare relative magnitude..." >&4
8045 $cat >>try.c <<'EOCP'
8048 # include <memory.h>
8051 # include <stdlib.h>
8054 # include <string.h>
8056 # include <strings.h>
8059 # include <unistd.h> /* Needed for NetBSD */
8065 if ((a < b) && memcmp(&a, &b, 1) < 0)
8071 if eval $compile_ok; then
8072 if ./try 2>/dev/null; then
8076 echo "No, it can't (it uses signed chars)."
8079 echo "(I can't compile the test program, so we'll assume not...)"
8083 $rm -f try.* try core
8087 : see if select exists
8091 : see if semctl exists
8095 : see if semget exists
8099 : see if semop exists
8103 : see how much of the 'sem*(2)' library is present.
8106 case "$d_semctl$d_semget$d_semop" in
8107 *"$undef"*) h_sem=false;;
8109 : we could also check for sys/ipc.h ...
8110 if $h_sem && $test `./findhdr sys/sem.h`; then
8111 echo "You have the full sem*(2) library." >&4
8114 echo "You don't have the full sem*(2) library." >&4
8120 : see whether sys/sem.h defines union semun
8122 $cat > try.c <<'END'
8123 #include <sys/types.h>
8124 #include <sys/ipc.h>
8125 #include <sys/sem.h>
8126 int main () { union semun semun; semun.buf = 0; }
8129 if eval $compile; then
8130 echo "You have union semun in <sys/sem.h>." >&4
8133 echo "You do not have union semun in <sys/sem.h>." >&4
8140 : see how to do semctl IPC_STAT
8143 : see whether semctl IPC_STAT can use union semun
8146 #include <sys/types.h>
8147 #include <sys/ipc.h>
8148 #include <sys/sem.h>
8149 #include <sys/stat.h>
8155 #$d_union_semun HAS_UNION_SEMUN
8158 #ifndef HAS_UNION_SEMUN
8161 struct semid_ds *buf;
8162 unsigned short *array;
8168 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8169 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8171 struct semid_ds argbuf;
8174 st = semctl(sem, 0, IPC_STAT, arg);
8178 # endif /* IPC_STAT */
8179 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8181 if (semctl(sem, 0, IPC_RMID, arg) != 0)
8182 # endif /* IPC_RMID */
8183 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8185 #endif /* IPC_PRIVATE && ... */
8186 printf("semget failed: errno = %d\n", errno);
8192 if eval $compile; then
8195 semun) val="$define" ;;
8201 case "$d_semctl_semun" in
8203 echo "You can use union semun for semctl IPC_STAT." >&4
8206 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
8211 : see whether semctl IPC_STAT can use struct semid_ds pointer
8212 $cat > try.c <<'END'
8213 #include <sys/types.h>
8214 #include <sys/ipc.h>
8215 #include <sys/sem.h>
8216 #include <sys/stat.h>
8223 struct semid_ds arg;
8226 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8227 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8230 st = semctl(sem, 0, IPC_STAT, &arg);
8232 printf("semid_ds\n");
8234 # endif /* IPC_STAT */
8235 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8237 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
8238 # endif /* IPC_RMID */
8239 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8241 #endif /* IPC_PRIVATE && ... */
8242 printf("semget failed: errno = %d\n", errno);
8249 if eval $compile; then
8252 semid_ds) val="$define" ;;
8256 set d_semctl_semid_ds
8258 case "$d_semctl_semid_ds" in
8260 echo "You can $also use struct semid_ds * for semctl IPC_STAT." >&4
8262 *) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4
8268 # We do not have the full sem*(2) library, so assume we can not
8274 set d_semctl_semid_ds
8279 : see if setegid exists
8280 set setegid d_setegid
8283 : see if seteuid exists
8284 set seteuid d_seteuid
8287 : see if sethostent exists
8288 set sethostent d_sethent
8291 : see if setlinebuf exists
8292 set setlinebuf d_setlinebuf
8295 : see if setlocale exists
8296 set setlocale d_setlocale
8299 : see if setnetent exists
8300 set setnetent d_setnent
8303 : see if setprotoent exists
8304 set setprotoent d_setpent
8307 : see if setpgid exists
8308 set setpgid d_setpgid
8311 : see if setpgrp2 exists
8312 set setpgrp2 d_setpgrp2
8315 : see if setpriority exists
8316 set setpriority d_setprior
8319 : see if setregid exists
8320 set setregid d_setregid
8322 set setresgid d_setresgid
8325 : see if setreuid exists
8326 set setreuid d_setreuid
8328 set setresuid d_setresuid
8331 : see if setrgid exists
8332 set setrgid d_setrgid
8335 : see if setruid exists
8336 set setruid d_setruid
8339 : see if setservent exists
8340 set setservent d_setsent
8343 : see if setsid exists
8347 : see if setvbuf exists
8348 set setvbuf d_setvbuf
8351 : see if sfio.h is available
8356 : see if sfio library is available
8367 : Ok, but do we want to use it.
8371 true|$define|[yY]*) dflt='y';;
8374 echo "$package can use the sfio library, but it is experimental."
8375 rp="You seem to have sfio available, do you want to try using it?"
8379 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
8381 : Remove sfio from list of libraries to use
8382 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
8385 echo "libs = $libs" >&4
8389 *) case "$usesfio" in
8391 echo "Sorry, cannot find sfio on this machine" >&4
8392 echo "Ignoring your setting of usesfio=$usesfio" >&4
8400 $define) usesfio='true';;
8401 *) usesfio='false';;
8404 : see if shmctl exists
8408 : see if shmget exists
8412 : see if shmat exists
8415 : see what shmat returns
8418 $cat >shmat.c <<'END'
8419 #include <sys/shm.h>
8422 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
8427 echo "and it returns ($shmattype)." >&4
8428 : see if a prototype for shmat is available
8429 xxx=`./findhdr sys/shm.h`
8430 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
8431 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
8442 set d_shmatprototype
8445 : see if shmdt exists
8449 : see how much of the 'shm*(2)' library is present.
8452 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
8453 *"$undef"*) h_shm=false;;
8455 : we could also check for sys/ipc.h ...
8456 if $h_shm && $test `./findhdr sys/shm.h`; then
8457 echo "You have the full shm*(2) library." >&4
8460 echo "You don't have the full shm*(2) library." >&4
8467 : see if we have sigaction
8468 if set sigaction val -f d_sigaction; eval $csym; $val; then
8469 echo 'sigaction() found.' >&4
8470 $cat > try.c <<'EOP'
8472 #include <sys/types.h>
8476 struct sigaction act, oact;
8480 if eval $compile_ok; then
8483 echo "But you don't seem to have a useable struct sigaction." >&4
8487 echo 'sigaction NOT found.' >&4
8490 set d_sigaction; eval $setvar
8491 $rm -f try try$_o try.c
8493 : see if sigsetjmp exists
8495 case "$d_sigsetjmp" in
8503 if (sigsetjmp(env,1))
8511 if eval $compile; then
8512 if ./try >/dev/null 2>&1; then
8513 echo "POSIX sigsetjmp found." >&4
8517 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
8523 echo "sigsetjmp not found." >&4
8527 *) val="$d_sigsetjmp"
8528 case "$d_sigsetjmp" in
8529 $define) echo "POSIX sigsetjmp found." >&4;;
8530 $undef) echo "sigsetjmp not found." >&4;;
8540 : see whether socket exists
8542 $echo $n "Hmm... $c" >&4
8543 if set socket val -f d_socket; eval $csym; $val; then
8544 echo "Looks like you have Berkeley networking support." >&4
8546 if set setsockopt val -f; eval $csym; $val; then
8549 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
8553 if $contains socklib libc.list >/dev/null 2>&1; then
8554 echo "Looks like you have Berkeley networking support." >&4
8556 : we will have to assume that it supports the 4.2 BSD interface
8559 echo "You don't have Berkeley networking in libc$_a..." >&4
8560 if test -f /usr/lib/libnet$_a; then
8561 ( ($nm $nm_opt /usr/lib/libnet$_a | eval $nm_extract) || \
8562 $ar t /usr/lib/libnet$_a) 2>/dev/null >> libc.list
8563 if $contains socket libc.list >/dev/null 2>&1; then
8564 echo "...but the Wollongong group seems to have hacked it in." >&4
8566 sockethdr="-I/usr/netinclude"
8568 if $contains setsockopt libc.list >/dev/null 2>&1; then
8571 echo "...using the old 4.1c interface, rather than 4.2" >&4
8575 echo "or even in libnet$_a, which is peculiar." >&4
8580 echo "or anywhere else I see." >&4
8587 : see if socketpair exists
8588 set socketpair d_sockpair
8591 : see if stat knows about block sizes
8593 xxx=`./findhdr sys/stat.h`
8594 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
8595 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
8596 echo "Your stat() knows about block sizes." >&4
8599 echo "Your stat() doesn't know about block sizes." >&4
8603 echo "Your stat() doesn't know about block sizes." >&4
8609 : see if _ptr and _cnt from stdio act std
8611 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
8612 echo "(Looks like you have stdio.h from Linux.)"
8613 case "$stdio_ptr" in
8614 '') stdio_ptr='((fp)->_IO_read_ptr)'
8617 *) ptr_lval=$d_stdio_ptr_lval;;
8619 case "$stdio_cnt" in
8620 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
8623 *) cnt_lval=$d_stdio_cnt_lval;;
8625 case "$stdio_base" in
8626 '') stdio_base='((fp)->_IO_read_base)';;
8628 case "$stdio_bufsiz" in
8629 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
8632 case "$stdio_ptr" in
8633 '') stdio_ptr='((fp)->_ptr)'
8636 *) ptr_lval=$d_stdio_ptr_lval;;
8638 case "$stdio_cnt" in
8639 '') stdio_cnt='((fp)->_cnt)'
8642 *) cnt_lval=$d_stdio_cnt_lval;;
8644 case "$stdio_base" in
8645 '') stdio_base='((fp)->_base)';;
8647 case "$stdio_bufsiz" in
8648 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
8651 : test whether _ptr and _cnt really work
8652 echo "Checking how std your stdio is..." >&4
8655 #define FILE_ptr(fp) $stdio_ptr
8656 #define FILE_cnt(fp) $stdio_cnt
8658 FILE *fp = fopen("try.c", "r");
8661 18 <= FILE_cnt(fp) &&
8662 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
8670 if eval $compile; then
8672 echo "Your stdio acts pretty std."
8675 echo "Your stdio isn't very std."
8678 echo "Your stdio doesn't appear very std."
8684 : Can _ptr be used as an lvalue?
8685 case "$d_stdstdio$ptr_lval" in
8686 $define$define) val=$define ;;
8689 set d_stdio_ptr_lval
8692 : Can _cnt be used as an lvalue?
8693 case "$d_stdstdio$cnt_lval" in
8694 $define$define) val=$define ;;
8697 set d_stdio_cnt_lval
8700 : see if _base is also standard
8702 case "$d_stdstdio" in
8706 #define FILE_base(fp) $stdio_base
8707 #define FILE_bufsiz(fp) $stdio_bufsiz
8709 FILE *fp = fopen("try.c", "r");
8712 19 <= FILE_bufsiz(fp) &&
8713 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
8720 if eval $compile; then
8722 echo "And its _base field acts std."
8725 echo "But its _base field isn't std."
8728 echo "However, it seems to be lacking the _base field."
8736 : see if strcoll exists
8737 set strcoll d_strcoll
8740 : check for structure copying
8742 echo "Checking to see if your C compiler can copy structs..." >&4
8743 $cat >try.c <<'EOCP'
8753 if $cc -c try.c >/dev/null 2>&1 ; then
8758 echo "Nope, it can't."
8764 : see if strerror and/or sys_errlist[] exist
8766 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
8767 if set strerror val -f d_strerror; eval $csym; $val; then
8768 echo 'strerror() found.' >&4
8769 d_strerror="$define"
8770 d_strerrm='strerror(e)'
8771 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8772 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
8773 d_syserrlst="$define"
8775 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
8776 d_syserrlst="$undef"
8778 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
8779 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
8780 echo 'strerror() found in string header.' >&4
8781 d_strerror="$define"
8782 d_strerrm='strerror(e)'
8783 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8784 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
8785 d_syserrlst="$define"
8787 echo "(You don't appear to have any sys_errlist[], how can this be?)"
8788 d_syserrlst="$undef"
8790 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8791 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
8793 d_syserrlst="$define"
8794 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
8796 echo 'strerror() and sys_errlist[] NOT found.' >&4
8798 d_syserrlst="$undef"
8799 d_strerrm='"unknown"'
8803 : see if strtod exists
8807 : see if strtol exists
8811 : see if strtoul exists
8812 set strtoul d_strtoul
8815 : see if strxfrm exists
8816 set strxfrm d_strxfrm
8819 : see if symlink exists
8820 set symlink d_symlink
8823 : see if syscall exists
8824 set syscall d_syscall
8827 : see if sysconf exists
8828 set sysconf d_sysconf
8831 : see if system exists
8835 : see if tcgetpgrp exists
8836 set tcgetpgrp d_tcgetpgrp
8839 : see if tcsetpgrp exists
8840 set tcsetpgrp d_tcsetpgrp
8843 : define an is-a-typedef? function
8844 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8846 "") inclist="sys/types.h";;
8848 eval "varval=\$$var";
8852 for inc in $inclist; do
8853 echo "#include <$inc>" >>temp.c;
8855 echo "#ifdef $type" >> temp.c;
8856 echo "printf(\"We have $type\");" >> temp.c;
8857 echo "#endif" >> temp.c;
8858 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8859 if $contains $type temp.E >/dev/null 2>&1; then
8865 *) eval "$var=\$varval";;
8868 : define an is-a-typedef? function that prompts if the type is not available.
8869 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8871 "") inclist="sys/types.h";;
8873 eval "varval=\$$var";
8877 for inc in $inclist; do
8878 echo "#include <$inc>" >>temp.c;
8880 echo "#ifdef $type" >> temp.c;
8881 echo "printf(\"We have $type\");" >> temp.c;
8882 echo "#endif" >> temp.c;
8883 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8885 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8886 if $contains $type temp.E >/dev/null 2>&1; then
8887 echo "$type found." >&4;
8890 echo "$type NOT found." >&4;
8896 *) eval "$var=\$varval";;
8899 : see if this is a sys/times.h system
8900 set sys/times.h i_systimes
8903 : see if times exists
8905 if set times val -f d_times; eval $csym; $val; then
8906 echo 'times() found.' >&4
8909 case "$i_systimes" in
8910 "$define") inc='sys/times.h';;
8912 rp="What is the type returned by times() on this system?"
8913 set clock_t clocktype long stdio.h sys/types.h $inc
8916 echo 'times() NOT found, hope that will do.' >&4
8921 : see if truncate exists
8922 set truncate d_truncate
8925 : see if tzname[] exists
8927 if set tzname val -a d_tzname; eval $csym; $val; then
8929 echo 'tzname[] found.' >&4
8932 echo 'tzname[] NOT found.' >&4
8937 : see if umask exists
8941 : see how we will look up host name
8944 : dummy stub to allow use of elif
8945 elif set uname val -f d_uname; eval $csym; $val; then
8948 uname() was found, but you're running xenix, and older versions of xenix
8949 have a broken uname(). If you don't really know whether your xenix is old
8950 enough to have a broken system call, use the default answer.
8957 rp='Is your uname() broken?'
8960 n*) d_uname="$define"; call=uname;;
8963 echo 'uname() found.' >&4
8968 case "$d_gethname" in
8969 '') d_gethname="$undef";;
8972 '') d_uname="$undef";;
8974 case "$d_phostname" in
8975 '') d_phostname="$undef";;
8978 : backward compatibility for d_hvfork
8979 if test X$d_hvfork != X; then
8983 : see if there is a vfork
8988 : Ok, but do we want to use it. vfork is reportedly unreliable in
8989 : perl on Solaris 2.x, and probably elsewhere.
8997 rp="Some systems have problems with vfork(). Do you want to use it?"
9002 echo "Ok, we won't use vfork()."
9011 $define) usevfork='true';;
9012 *) usevfork='false';;
9015 : see if this is an sysdir system
9016 set sys/dir.h i_sysdir
9019 : see if this is an sysndir system
9020 set sys/ndir.h i_sysndir
9023 : see if sys/types.h has to be included
9024 set sys/types.h i_systypes
9027 : see if closedir exists
9028 set closedir d_closedir
9031 case "$d_closedir" in
9034 echo "Checking whether closedir() returns a status..." >&4
9035 cat > closedir.c <<EOM
9036 #$i_dirent I_DIRENT /**/
9037 #$i_sysdir I_SYS_DIR /**/
9038 #$i_sysndir I_SYS_NDIR /**/
9039 #$i_systypes I_SYS_TYPES /**/
9041 #if defined(I_SYS_TYPES)
9042 #include <sys/types.h>
9044 #if defined(I_DIRENT)
9046 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
9047 #include <sys/dir.h>
9051 #include <sys/ndir.h>
9055 #include <ndir.h> /* may be wrong in the future */
9057 #include <sys/dir.h>
9062 int main() { return closedir(opendir(".")); }
9065 if eval $compile_ok; then
9066 if ./closedir > /dev/null 2>&1 ; then
9067 echo "Yes, it does."
9070 echo "No, it doesn't."
9074 echo "(I can't seem to compile the test program--assuming it doesn't)"
9085 : check for volatile keyword
9087 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
9088 $cat >try.c <<'EOCP'
9091 typedef struct _goo_struct goo_struct;
9092 goo_struct * volatile goo = ((goo_struct *)0);
9093 struct _goo_struct {
9098 typedef unsigned short foo_t;
9101 volatile foo_t blech;
9105 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
9107 echo "Yup, it does."
9110 echo "Nope, it doesn't."
9116 : see if there is a wait4
9120 : see if waitpid exists
9121 set waitpid d_waitpid
9124 : see if wcstombs exists
9125 set wcstombs d_wcstombs
9128 : see if wctomb exists
9132 : preserve RCS keywords in files with variable substitution, grrr
9137 Revision='$Revision'
9139 : check for alignment requirements
9141 case "$alignbytes" in
9142 '') echo "Checking alignment constraints..." >&4
9143 $cat >try.c <<'EOCP'
9150 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
9154 if eval $compile_ok; then
9158 echo "(I can't seem to compile the test program...)"
9161 *) dflt="$alignbytes"
9164 rp="Doubles must be aligned on a how-many-byte boundary?"
9169 : check for ordering of bytes in a long
9170 case "$byteorder" in
9174 In the following, larger digits indicate more significance. A big-endian
9175 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
9176 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
9177 machines may have weird orders like 3412. A Cray will report 87654321. If
9178 the test program works the default is probably right.
9179 I'm now running the test program...
9181 $cat >try.c <<'EOCP'
9188 char c[sizeof(long)];
9191 if (sizeof(long) > 4)
9192 u.l = (0x08070605L << 32) | 0x04030201L;
9195 for (i = 0; i < sizeof(long); i++)
9196 printf("%c", u.c[i]+'0');
9203 if eval $compile && ./try > /dev/null; then
9206 [1-4][1-4][1-4][1-4]|12345678|87654321)
9207 echo "(The test program ran ok.)"
9208 echo "byteorder=$dflt"
9211 ????|????????) echo "(The test program ran ok.)" ;;
9212 *) echo "(The test program didn't run right for some reason.)" ;;
9217 (I can't seem to compile the test program. Guessing big-endian...)
9220 case "$xxx_prompt" in
9222 rp="What is the order of bytes in a long?"
9233 : how do we catenate cpp tokens here?
9235 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
9236 $cat >cpp_stuff.c <<'EOCP'
9237 #define RCAT(a,b)a/**/b
9238 #define ACAT(a,b)a ## b
9242 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
9243 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
9244 echo "Oh! Smells like ANSI's been here." >&4
9245 echo "We can catify or stringify, separately or together!"
9247 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
9248 echo "Ah, yes! The good old days!" >&4
9249 echo "However, in the good old days we don't know how to stringify and"
9250 echo "catify at the same time."
9254 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
9255 to have to edit the values of CAT[2-5] in config.h...
9257 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
9261 : see if this is a db.h system
9269 echo "Checking Berkeley DB version ..." >&4
9275 #include <sys/types.h>
9280 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
9281 int Major, Minor, Patch ;
9282 unsigned long Version ;
9283 (void)db_version(&Major, &Minor, &Patch) ;
9284 printf("You have Berkeley DB Version 2 or greater\n");
9286 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
9287 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
9288 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
9289 Major, Minor, Patch) ;
9291 /* check that db.h & libdb are compatible */
9292 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
9293 printf("db.h and libdb are incompatible\n") ;
9297 printf("db.h and libdb are compatible\n") ;
9299 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
9300 + DB_VERSION_PATCH ;
9302 /* needs to be >= 2.3.4 */
9303 if (Version < 2003004) {
9304 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
9305 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
9311 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
9312 printf("You have Berkeley DB Version 1\n");
9313 exit(0); /* DB version < 2: the coast is clear. */
9315 exit(1); /* <db.h> not Berkeley DB? */
9321 if eval $compile && ./try; then
9322 echo 'Looks OK.' >&4
9324 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
9328 : Remove db from list of libraries to use
9329 echo "Removing unusable -ldb from library list" >&4
9330 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
9333 echo "libs = $libs" >&4
9343 : Check the return type needed for hash
9345 echo "Checking return type needed for hash for Berkeley DB ..." >&4
9351 #include <sys/types.h>
9354 #ifndef DB_VERSION_MAJOR
9355 u_int32_t hash_cb (ptr, size)
9363 info.hash = hash_cb;
9367 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9368 if $contains warning try.out >>/dev/null 2>&1 ; then
9371 db_hashtype='u_int32_t'
9374 : XXX Maybe we should just give up here.
9375 db_hashtype=u_int32_t
9377 echo "Help: I can't seem to compile the db test program." >&4
9378 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
9381 echo "Your version of Berkeley DB uses $db_hashtype for hash."
9383 *) db_hashtype=u_int32_t
9388 : Check the return type needed for prefix
9390 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
9396 #include <sys/types.h>
9399 #ifndef DB_VERSION_MAJOR
9400 size_t prefix_cb (key1, key2)
9408 info.prefix = prefix_cb;
9412 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9413 if $contains warning try.out >>/dev/null 2>&1 ; then
9416 db_prefixtype='size_t'
9419 db_prefixtype='size_t'
9420 : XXX Maybe we should just give up here.
9422 echo "Help: I can't seem to compile the db test program." >&4
9423 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
9426 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
9428 *) db_prefixtype='size_t'
9432 : check for void type
9434 echo "Checking to see how well your C compiler groks the void type..." >&4
9435 case "$voidflags" in
9437 $cat >try.c <<'EOCP'
9443 extern void moo(); /* function returning void */
9444 void (*goo)(); /* ptr to func returning void */
9446 void *hue; /* generic ptr */
9461 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
9462 voidflags=$defvoidused
9463 echo "Good. It appears to support void to the level $package wants.">&4
9464 if $contains warning .out >/dev/null 2>&1; then
9465 echo "However, you might get some warnings that look like this:"
9469 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
9470 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
9471 echo "It supports 1..."
9472 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
9473 echo "It also supports 2..."
9474 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
9476 echo "And it supports 4 but not 8 definitely."
9478 echo "It doesn't support 4..."
9479 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
9481 echo "But it supports 8."
9484 echo "Neither does it support 8."
9488 echo "It does not support 2..."
9489 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
9491 echo "But it supports 4 and 8."
9493 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
9495 echo "And it supports 4 but has not heard about 8."
9497 echo "However it supports 8 but not 4."
9502 echo "There is no support at all for void."
9507 case "$voidflags" in
9510 Support flag bits are:
9511 1: basic void declarations.
9512 2: arrays of pointers to functions returning void.
9513 4: operations between pointers to and addresses of void functions.
9514 8: generic void pointers.
9517 rp="Your void support flags add up to what?"
9524 : check for length of double
9526 case "$doublesize" in
9528 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
9529 $cat >try.c <<'EOCP'
9533 printf("%d\n", sizeof(double));
9537 if eval $compile_ok; then
9539 $echo " $doublesize bytes." >&4
9542 echo "(I can't seem to compile the test program. Guessing...)"
9543 rp="What is the size of a double precision number (in bytes)?"
9551 : see what type file positions are declared as in the library
9552 rp="What is the type for file position used by fsetpos()?"
9553 set fpos_t fpostype long stdio.h sys/types.h
9556 : get csh whereabouts
9558 'csh') val="$undef" ;;
9563 : Respect a hint or command line value for full_csh.
9565 '') full_csh=$csh ;;
9568 : Store the full pathname to the sed program for use in the C program
9571 : see what type gids are declared as in the kernel
9573 echo "Looking for the type for group ids returned by getgid()."
9574 set gid_t gidtype xxx stdio.h sys/types.h
9578 xxx=`./findhdr sys/user.h`
9579 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
9581 unsigned) dflt="$1 $2" ;;
9585 *) dflt="$gidtype";;
9588 gid_t) echo "gid_t found." ;;
9589 *) rp="What is the type for group ids returned by getgid()?"
9595 : see if getgroups exists
9596 set getgroups d_getgrps
9599 : see if setgroups exists
9600 set setgroups d_setgrps
9604 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
9606 case "$d_getgrps$d_setgrps" in
9608 case "$groupstype" in
9609 '') dflt="$gidtype" ;;
9610 *) dflt="$groupstype" ;;
9613 What type of pointer is the second argument to getgroups() and setgroups()?
9614 Usually this is the same as group ids, $gidtype, but not always.
9617 rp='What type pointer is the second argument to getgroups() and setgroups()?'
9621 *) groupstype="$gidtype";;
9624 : see what type lseek is declared as in the kernel
9625 rp="What is the type used for lseek's offset on this system?"
9626 set off_t lseektype long stdio.h sys/types.h
9630 echo "Checking if your $make program sets \$(MAKE)..." >&4
9631 case "$make_set_make" in
9633 $sed 's/^X //' > testmake.mak << 'EOF'
9635 X @echo 'maketemp="$(MAKE)"'
9637 case "`$make -f testmake.mak 2>/dev/null`" in
9638 *maketemp=*) make_set_make='#' ;;
9639 *) make_set_make="MAKE=$make" ;;
9644 case "$make_set_make" in
9645 '#') echo "Yup, it does.";;
9646 *) echo "Nope, it doesn't.";;
9649 : see what type is used for mode_t
9650 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
9651 set mode_t modetype int stdio.h sys/types.h
9654 : define a fucntion to check prototypes
9655 $cat > protochk <<EOSH
9658 optimize="$optimize"
9660 prototype="$prototype"
9665 $cat >> protochk <<'EOSH'
9670 while test $# -ge 2; do
9672 $define) echo "#include <$2>" >> try.c ;;
9673 literal) echo "$2" >> try.c ;;
9677 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9678 cat >> try.c <<'EOCP'
9679 #ifdef CAN_PROTOTYPE
9680 #define _(args) args
9685 echo "$foo" >> try.c
9686 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9687 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9695 : see what type is used for size_t
9696 rp="What is the type used for the length parameter for string functions?"
9697 set size_t sizetype 'unsigned int' stdio.h sys/types.h
9700 : check for type of arguments to gethostbyaddr.
9701 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
9702 case "$d_gethbyaddr" in
9706 Checking to see what type of arguments are accepted by gethostbyaddr().
9708 hdrs="$define sys/types.h
9709 $d_socket sys/socket.h
9710 $i_niin netinet/in.h
9713 : The first arg can 'char *' or 'void *'
9714 : The second arg is some of integral type
9715 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
9716 for yyy in size_t long int; do
9717 case "$netdb_host_type" in
9718 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
9719 if ./protochk "$try" $hdrs; then
9720 echo "Your system accepts $xxx for the first arg."
9721 echo "...and $yyy for the second arg."
9722 netdb_host_type="$xxx"
9723 netdb_hlen_type="$yyy"
9729 : In case none of those worked, prompt the user.
9730 case "$netdb_host_type" in
9731 '') rp='What is the type for the 1st argument to gethostbyaddr?'
9734 netdb_host_type=$ans
9735 rp='What is the type for the 2nd argument to gethostbyaddr?'
9738 netdb_hlen_type=$ans
9742 *) : no gethostbyaddr, so pick harmless defaults
9743 netdb_host_type='char *'
9744 netdb_hlen_type="$sizetype"
9747 # Remove the "const" if needed. -- but then we'll have a
9749 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
9752 : check for type of argument to gethostbyname.
9753 if test "X$netdb_name_type" = X ; then
9754 case "$d_gethbyname" in
9758 Checking to see what type of argument is accepted by gethostbyname().
9760 hdrs="$define sys/types.h
9761 $d_socket sys/socket.h
9762 $i_niin netinet/in.h
9765 for xxx in "const char *" "char *"; do
9766 case "$netdb_name_type" in
9767 '') try="extern struct hostent *gethostbyname($xxx);"
9768 if ./protochk "$try" $hdrs; then
9769 echo "Your system accepts $xxx."
9770 netdb_name_type="$xxx"
9775 : In case none of those worked, prompt the user.
9776 case "$netdb_name_type" in
9777 '') rp='What is the type for the 1st argument to gethostbyname?'
9780 netdb_name_type=$ans
9784 *) : no gethostbyname, so pick harmless default
9785 netdb_name_type='char *'
9790 : check for type of 1st argument to getnetbyaddr.
9791 if test "X$netdb_net_type" = X ; then
9792 case "$d_getnbyaddr" in
9796 Checking to see what type of 1st argument is accepted by getnetbyaddr().
9798 hdrs="$define sys/types.h
9799 $d_socket sys/socket.h
9800 $i_niin netinet/in.h
9803 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
9804 case "$netdb_net_type" in
9805 '') try="extern struct netent *getnetbyaddr($xxx, int);"
9806 if ./protochk "$try" $hdrs; then
9807 echo "Your system accepts $xxx."
9808 netdb_net_type="$xxx"
9813 : In case none of those worked, prompt the user.
9814 case "$netdb_net_type" in
9815 '') rp='What is the type for the 1st argument to getnetbyaddr?'
9822 *) : no getnetbyaddr, so pick harmless default
9823 netdb_net_type='long'
9827 : locate the preferred pager for this system
9841 '') dflt=/usr/ucb/more;;
9848 rp='What pager is used on your system?'
9852 : see what type pids are declared as in the kernel
9853 rp="What is the type of process ids on this system?"
9854 set pid_t pidtype int stdio.h sys/types.h
9857 : check for length of pointer
9861 $echo $n "Checking to see how big your pointers are...$c" >&4
9862 if test "$voidflags" -gt 7; then
9863 echo '#define VOID_PTR char *' > try.c
9865 echo '#define VOID_PTR void *' > try.c
9867 $cat >>try.c <<'EOCP'
9871 printf("%d\n", sizeof(VOID_PTR));
9876 if eval $compile_ok; then
9878 $echo " $ptrsize bytes." >&4
9881 echo "(I can't seem to compile the test program. Guessing...)" >&4
9882 rp="What is the size of a pointer (in bytes)?"
9890 : check for size of random number generator
9894 echo "Checking to see how many bits your rand function produces..." >&4
9900 # include <unistd.h>
9903 # include <stdlib.h>
9906 $cat >>try.c <<'EOCP'
9910 register unsigned long tmp;
9911 register unsigned long max = 0L;
9913 for (i = 1000; i; i--) {
9914 tmp = (unsigned long)rand();
9915 if (tmp > max) max = tmp;
9917 for (i = 0; max; i++)
9923 if eval $compile_ok; then
9927 echo "(I can't seem to compile the test program...)"
9934 rp='How many bits does your rand() function produce?'
9939 : see if ar generates random libraries by itself
9941 echo "Checking how to generate random libraries on your machine..." >&4
9942 echo 'int bar1() { return bar2(); }' > bar1.c
9943 echo 'int bar2() { return 2; }' > bar2.c
9944 $cat > foo.c <<'EOP'
9945 main() { printf("%d\n", bar1()); exit(0); }
9947 $cc $ccflags -c bar1.c >/dev/null 2>&1
9948 $cc $ccflags -c bar2.c >/dev/null 2>&1
9949 $cc $ccflags -c foo.c >/dev/null 2>&1
9950 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
9951 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
9952 ./foobar >/dev/null 2>&1; then
9953 echo "$ar appears to generate random libraries itself."
9956 elif $ar ts bar$_a >/dev/null 2>&1 &&
9957 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
9958 ./foobar >/dev/null 2>&1; then
9959 echo "a table of contents needs to be added with '$ar ts'."
9966 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
9967 $test -f $ranlib || ranlib=''
9970 if $test -n "$ranlib"; then
9971 echo "your system has '$ranlib'; we'll use that."
9974 echo "your system doesn't seem to support random libraries"
9975 echo "so we'll use lorder and tsort to order the libraries."
9982 : see if sys/select.h has to be included
9983 set sys/select.h i_sysselct
9986 : see if we should include time.h, sys/time.h, or both
9988 if test "X$timeincl" = X; then
9989 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9990 $echo $n "I'm now running the test program...$c"
9991 $cat >try.c <<'EOCP'
9992 #include <sys/types.h>
9997 #ifdef SYSTIMEKERNEL
10000 #include <sys/time.h>
10003 #include <sys/select.h>
10009 struct timeval bar;
10012 struct timezone tzp;
10014 if (foo.tm_sec == foo.tm_sec)
10017 if (bar.tv_sec == bar.tv_sec)
10024 for s_timezone in '-DS_TIMEZONE' ''; do
10026 for s_timeval in '-DS_TIMEVAL' ''; do
10027 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10028 for i_time in '' '-DI_TIME'; do
10029 for i_systime in '-DI_SYSTIME' ''; do
10032 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10033 if eval $compile; then
10034 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10038 $echo $n "Succeeded with $flags$c"
10050 *SYSTIMEKERNEL*) i_systimek="$define"
10051 timeincl=`./findhdr sys/time.h`
10052 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10053 *) i_systimek="$undef";;
10056 *I_TIME*) i_time="$define"
10057 timeincl=`./findhdr time.h`" $timeincl"
10058 echo "We'll include <time.h>." >&4;;
10059 *) i_time="$undef";;
10062 *I_SYSTIME*) i_systime="$define"
10063 timeincl=`./findhdr sys/time.h`" $timeincl"
10064 echo "We'll include <sys/time.h>." >&4;;
10065 *) i_systime="$undef";;
10070 : check for fd_set items
10073 Checking to see how well your C compiler handles fd_set and friends ...
10075 $cat >fd_set.c <<EOCP
10076 #$i_systime I_SYS_TIME
10077 #$i_sysselct I_SYS_SELECT
10078 #$d_socket HAS_SOCKET
10079 #include <sys/types.h>
10081 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
10084 #include <sys/time.h>
10086 #ifdef I_SYS_SELECT
10087 #include <sys/select.h>
10096 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
10103 set fd_set -DTRYBITS
10104 if eval $compile; then
10105 d_fds_bits="$define"
10107 echo "Well, your system knows about the normal fd_set typedef..." >&4
10109 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
10110 d_fd_macros="$define"
10113 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
10115 d_fd_macros="$undef"
10119 Hmm, your compiler has some difficulty with fd_set. Checking further...
10122 if eval $compile; then
10123 d_fds_bits="$undef"
10125 echo "Well, your system has some sort of fd_set available..." >&4
10127 echo "and you have the normal fd_set macros." >&4
10128 d_fd_macros="$define"
10131 but not the normal fd_set macros! Gross! More work for me...
10133 d_fd_macros="$undef"
10136 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
10138 d_fds_bits="$undef"
10139 d_fd_macros="$undef"
10144 : check for type of arguments to select.
10145 case "$selecttype" in
10146 '') case "$d_select" in
10149 Checking to see what type of arguments are accepted by select().
10151 hdrs="$define sys/types.h
10152 $i_systime sys/time.h
10153 $i_sysselct sys/select.h
10154 $d_socket sys/socket.h"
10155 : The first arg can be int, unsigned, or size_t
10156 : The last arg may or may not be 'const'
10158 for xxx in 'fd_set *' 'int *'; do
10159 for nfd in 'int' 'size_t' 'unsigned' ; do
10160 for tmo in 'struct timeval *' 'const struct timeval *'; do
10162 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
10163 if ./protochk "$try" $hdrs; then
10164 echo "Your system accepts $xxx."
10173 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
10174 case "$d_fd_set" in
10175 $define) dflt="fd_set *" ;;
10184 *) : no select, so pick a harmless default
10191 : Trace out the files included by signal.h, then look for SIGxxx names.
10192 : Remove SIGARRAYSIZE used by HPUX.
10193 : Remove SIGTYP void lines used by OS2.
10194 xxx=`echo '#include <signal.h>' |
10195 $cppstdin $cppminus $cppflags 2>/dev/null |
10196 $grep '^[ ]*#.*include' |
10197 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
10198 : Check this list of files to be sure we have parsed the cpp output ok.
10199 : This will also avoid potentially non-existent files, such
10202 for xx in $xxx /dev/null ; do
10203 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
10205 : If we have found no files, at least try signal.h
10206 case "$xxxfiles" in
10207 '') xxxfiles=`./findhdr signal.h` ;;
10210 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
10211 print substr($2, 4, 20)
10213 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
10214 print substr($3, 4, 20)
10216 : Append some common names just in case the awk scan failed.
10217 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
10218 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
10219 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
10220 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
10221 : generate a few handy files for later
10222 $cat > signal.c <<'EOCP'
10223 #include <sys/types.h>
10224 #include <signal.h>
10228 /* Strange style to avoid deeply-nested #if/#else/#endif */
10231 # define NSIG (_NSIG)
10237 # define NSIG (SIGMAX+1)
10243 # define NSIG (SIG_MAX+1)
10249 # define NSIG (MAXSIG+1)
10255 # define NSIG (MAX_SIG+1)
10260 # ifdef SIGARRAYSIZE
10261 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
10267 # define NSIG (_sys_nsig) /* Solaris 2.5 */
10271 /* Default to some arbitrary number that's big enough to get most
10272 of the common signals.
10278 printf("NSIG %d\n", NSIG);
10284 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
10286 printf "#ifdef SIG"; printf $1; printf "\n"
10287 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
10288 printf $1; printf ");\n"
10292 printf "#endif /* JUST_NSIG */\n";
10296 $cat >signal.awk <<'EOP'
10297 BEGIN { ndups = 0 }
10298 $1 ~ /^NSIG$/ { nsig = $2 }
10299 ($1 !~ /^NSIG$/) && (NF == 2) {
10300 if ($2 > maxsig) { maxsig = $2 }
10301 if (sig_name[$2]) {
10302 dup_name[ndups] = $1
10303 dup_num[ndups] = $2
10313 if (nsig == 0) { nsig = maxsig + 1 }
10314 for (n = 1; n < nsig; n++) {
10316 printf("%s %d\n", sig_name[n], sig_num[n])
10319 printf("NUM%d %d\n", n, n)
10322 for (n = 0; n < ndups; n++) {
10323 printf("%s %d\n", dup_name[n], dup_num[n])
10327 $cat >signal_cmd <<EOS
10329 if $test -s signal.lst; then
10330 echo "Using your existing signal.lst file"
10335 $cat >>signal_cmd <<'EOS'
10338 if eval $compile_ok; then
10339 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10341 echo "(I can't seem be able to compile the whole test program)" >&4
10342 echo "(I'll try it in little pieces.)" >&4
10343 set signal -DJUST_NSIG
10344 if eval $compile_ok; then
10345 ./signal$_exe > signal.nsg
10348 echo "I can't seem to figure out how many signals you have." >&4
10349 echo "Guessing 50." >&4
10350 echo 'NSIG 50' > signal.nsg
10352 : Now look at all the signal names, one at a time.
10353 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
10354 $cat > signal.c <<EOCP
10355 #include <sys/types.h>
10356 #include <signal.h>
10359 printf("$xx %d\n", SIG${xx});
10364 if eval $compile; then
10365 echo "SIG${xx} found."
10366 ./signal$_exe >> signal.ls1
10368 echo "SIG${xx} NOT found."
10371 if $test -s signal.ls1; then
10372 $cat signal.nsg signal.ls1 |
10373 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10377 if $test -s signal.lst; then
10380 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
10381 echo 'kill -l' >signal
10382 set X `csh -f <signal`
10386 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
10388 echo $@ | $tr ' ' $trnl | \
10389 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
10391 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
10393 chmod a+x signal_cmd
10394 $eunicefix signal_cmd
10396 : generate list of signal names
10398 case "$sig_name_init" in
10400 echo "Generating a list of signal names and numbers..." >&4
10402 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
10403 sig_name="ZERO $sig_name"
10404 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
10405 { printf "\"%s\", ", $1 }
10406 END { printf "0\n" }' signal.lst`
10407 sig_num=`$awk 'BEGIN { printf "0, " }
10408 { printf "%d, ", $2}
10409 END { printf "0\n"}' signal.lst`
10412 echo "The following signals are available:"
10414 echo $sig_name | $awk \
10415 'BEGIN { linelen = 0 }
10417 for (i = 1; i <= NF; i++) {
10418 name = "SIG" $i " "
10419 linelen = linelen + length(name)
10420 if (linelen > 70) {
10422 linelen = length(name)
10428 $rm -f signal signal.c signal.awk signal.lst signal_cmd
10430 : see what type is used for signed size_t
10431 set ssize_t ssizetype int stdio.h sys/types.h
10434 $cat > ssize.c <<EOM
10436 #include <sys/types.h>
10437 #define Size_t $sizetype
10438 #define SSize_t $dflt
10441 if (sizeof(Size_t) == sizeof(SSize_t))
10443 else if (sizeof(Size_t) == sizeof(int))
10452 if eval $compile_ok && ./ssize > /dev/null; then
10453 ssizetype=`./ssize`
10454 echo "I'll be using $ssizetype for functions returning a byte count." >&4
10457 Help! I can't compile and run the ssize_t test program: please enlighten me!
10458 (This is probably a misconfiguration in your system or libraries, and
10459 you really ought to fix it. Still, I'll try anyway.)
10461 I need a type that is the same size as $sizetype, but is guaranteed to
10462 be signed. Common values are ssize_t, int and long.
10465 rp="What signed type is the same size as $sizetype?"
10469 $rm -f ssize ssize.*
10471 : see what type of char stdio uses.
10473 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
10474 echo "Your stdio uses unsigned chars." >&4
10475 stdchar="unsigned char"
10477 echo "Your stdio uses signed chars." >&4
10481 : see if time exists
10483 if test "X$d_time" = X -o X"$timetype" = X; then
10484 if set time val -f d_time; eval $csym; $val; then
10485 echo 'time() found.' >&4
10487 rp="What is the type returned by time() on this system?"
10488 set time_t timetype long stdio.h sys/types.h
10491 echo 'time() not found, hope that will do.' >&4
10499 : see what type uids are declared as in the kernel
10501 echo "Looking for the type for user ids returned by getuid()."
10502 set uid_t uidtype xxx stdio.h sys/types.h
10506 xxx=`./findhdr sys/user.h`
10507 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
10509 unsigned) dflt="$1 $2" ;;
10513 *) dflt="$uidtype";;
10516 uid_t) echo "uid_t found." ;;
10517 *) rp="What is the type for user ids returned by getuid()?"
10523 : see if dbm.h is available
10524 : see if dbmclose exists
10525 set dbmclose d_dbmclose
10528 case "$d_dbmclose" in
10538 *) set rpcsvc/dbm.h i_rpcsvcdbm
10543 *) echo "We won't be including <dbm.h>"
10553 : see if this is a sys/file.h system
10558 : do we need to include sys/file.h ?
10562 if $h_sysfile; then
10564 echo "We'll be including <sys/file.h>." >&4
10567 echo "We won't be including <sys/file.h>." >&4
10577 : see if fcntl.h is there
10582 : see if we can include fcntl.h
10588 echo "We'll be including <fcntl.h>." >&4
10591 if $h_sysfile; then
10592 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10594 echo "We won't be including <fcntl.h>." >&4
10606 : see if this is an grp system
10612 : see if setgrent exists
10613 set setgrent d_setgrent
10616 : see if getgrent exists
10617 set getgrent d_getgrent
10620 : see if endgrent exists
10621 set endgrent d_endgrent
10624 xxx=`./findhdr grp.h`
10625 $cppstdin $cppflags $cppminus < $xxx >$$.h
10627 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10637 *) # Assume all is lost as far as the d_*gr* go.
10639 set d_setgrent; eval $setvar
10640 set d_getgrent; eval $setvar
10641 set d_endgrent; eval $setvar
10642 set d_grpasswd; eval $setvar
10646 : see if locale.h is available
10647 set locale.h i_locale
10650 : see if this is a math.h system
10654 : see if ndbm.h is available
10659 : see if dbm_open exists
10660 set dbm_open d_dbm_open
10662 case "$d_dbm_open" in
10665 echo "We won't be including <ndbm.h>"
10674 : see if net/errno.h is available
10676 set net/errno.h val
10679 : Unfortunately, it causes problems on some systems. Arrgh.
10682 cat > try.c <<'EOM'
10685 #include <net/errno.h>
10691 if $cc $ccflags -c try.c >/dev/null 2>&1; then
10692 echo "We'll be including <net/errno.h>." >&4
10694 echo "We won't be including <net/errno.h>." >&4
10703 : get C preprocessor symbols handy
10705 $echo $n "Hmm... $c"
10706 echo $al | $tr ' ' $trnl >Cppsym.know
10707 $cat <<EOSS >Cppsym
10715 case "\$list\$#" in
10718 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
10720 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
10723 unknown="\$unknown \$sym"
10733 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
10735 exit 0; _ _ _ _\1\\ \1\\
10738 echo "exit 1; _ _ _" >>Cppsym\$\$
10739 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
10741 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
10747 $rm -f Cppsym\$\$ Cppsym2\$\$
10752 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
10754 : now check the C compiler for additional symbols
10760 for i in \`$cc -v -c tmp.c 2>&1\`
10763 -D*) echo "\$i" | $sed 's/^-D//';;
10764 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
10771 ./ccsym | $sort | $uniq >ccsym.raw
10772 $awk '/\=/ { print $0; next }
10773 { print $0"=1" }' ccsym.raw >ccsym.list
10774 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
10775 $comm -13 ccsym.true ccsym.list >ccsym.own
10776 $comm -12 ccsym.true ccsym.list >ccsym.com
10777 $comm -23 ccsym.true ccsym.list >ccsym.cpp
10780 if $test -z ccsym.raw; then
10781 echo "Your C compiler doesn't seem to define any symbol!" >&4
10783 echo "However, your C preprocessor defines the following ones:"
10786 if $test -s ccsym.com; then
10787 echo "Your C compiler and pre-processor define these symbols:"
10788 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
10791 $test "$silent" || sleep 1
10793 if $test -s ccsym.cpp; then
10794 $test "$also" && echo " "
10795 echo "Your C pre-processor ${also}defines the following $symbols:"
10796 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
10798 $test "$silent" || sleep 1
10800 if $test -s ccsym.own; then
10801 $test "$also" && echo " "
10802 echo "Your C compiler ${also}defines the following cpp variables:"
10803 $sed -e 's/\(.*\)=1/\1/' ccsym.own
10804 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
10805 $test "$silent" || sleep 1
10810 : see if this is a termio system
10814 if $test `./findhdr termios.h`; then
10815 set tcsetattr i_termios
10821 "$define") echo "You have POSIX termios.h... good!" >&4;;
10822 *) if ./Cppsym pyr; then
10823 case "`/bin/universe`" in
10824 ucb) if $test `./findhdr sgtty.h`; then
10826 echo "<sgtty.h> found." >&4
10828 echo "System is pyramid with BSD universe."
10829 echo "<sgtty.h> not found--you could have problems." >&4
10831 *) if $test `./findhdr termio.h`; then
10833 echo "<termio.h> found." >&4
10835 echo "System is pyramid with USG universe."
10836 echo "<termio.h> not found--you could have problems." >&4
10840 if $test `./findhdr termio.h`; then
10841 echo "<termio.h> found." >&4
10843 elif $test `./findhdr sgtty.h`; then
10844 echo "<sgtty.h> found." >&4
10847 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
10850 if $test `./findhdr sgtty.h`; then
10851 echo "<sgtty.h> found." >&4
10853 elif $test `./findhdr termio.h`; then
10854 echo "<termio.h> found." >&4
10857 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
10861 set i_termio; eval $setvar
10862 val=$val2; set i_sgtty; eval $setvar
10863 val=$val3; set i_termios; eval $setvar
10865 : see if stdarg is available
10867 if $test `./findhdr stdarg.h`; then
10868 echo "<stdarg.h> found." >&4
10871 echo "<stdarg.h> NOT found." >&4
10875 : see if varags is available
10877 if $test `./findhdr varargs.h`; then
10878 echo "<varargs.h> found." >&4
10880 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10883 : set up the varargs testing programs
10884 $cat > varargs.c <<EOP
10886 #include <stdarg.h>
10889 #include <varargs.h>
10893 int f(char *p, ...)
10907 p = va_arg(ap, char *);
10912 $cat > varargs <<EOP
10914 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10923 : now check which varargs header should be included
10928 if `./varargs I_STDARG`; then
10930 elif `./varargs I_VARARGS`; then
10935 if `./varargs I_VARARGS`; then
10942 echo "I could not find the definition for va_dcl... You have problems..." >&4
10943 val="$undef"; set i_stdarg; eval $setvar
10944 val="$undef"; set i_varargs; eval $setvar
10949 case "$i_varhdr" in
10951 val="$define"; set i_stdarg; eval $setvar
10952 val="$undef"; set i_varargs; eval $setvar
10955 val="$undef"; set i_stdarg; eval $setvar
10956 val="$define"; set i_varargs; eval $setvar
10959 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10963 : see if stddef is available
10964 set stddef.h i_stddef
10967 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
10968 set sys/filio.h i_sysfilio
10971 if $test `./findhdr sys/ioctl.h`; then
10973 echo '<sys/ioctl.h> found.' >&4
10976 if $test $i_sysfilio = "$define"; then
10977 echo '<sys/ioctl.h> NOT found.' >&4
10979 $test $i_sgtty = "$define" && xxx="sgtty.h"
10980 $test $i_termio = "$define" && xxx="termio.h"
10981 $test $i_termios = "$define" && xxx="termios.h"
10982 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
10988 : see if this is a sys/param system
10989 set sys/param.h i_sysparam
10992 : see if sys/resource.h has to be included
10993 set sys/resource.h i_sysresrc
10996 : see if sys/stat.h is available
10997 set sys/stat.h i_sysstat
11000 : see if this is a sys/un.h system
11001 set sys/un.h i_sysun
11004 : see if this is a syswait system
11005 set sys/wait.h i_syswait
11008 : see if this is an utime system
11009 set utime.h i_utime
11012 : see if this is a values.h system
11013 set values.h i_values
11016 : see if this is a vfork system
11019 set vfork.h i_vfork
11027 : see if gdbm.h is available
11032 : see if gdbm_open exists
11033 set gdbm_open d_gdbm_open
11035 case "$d_gdbm_open" in
11038 echo "We won't be including <gdbm.h>"
11048 echo "Looking for extensions..." >&4
11051 : If we are using the old config.sh, known_extensions may contain
11052 : old or inaccurate or duplicate values.
11053 known_extensions=''
11054 nonxs_extensions=''
11055 : We do not use find because it might not be available.
11056 : We do not just use MANIFEST because the user may have dropped
11057 : some additional extensions into the source tree and expect them
11061 DynaLoader|dynaload) ;;
11062 *) if $test -f $xxx/$xxx.xs; then
11063 known_extensions="$known_extensions $xxx"
11064 elif $test -f $xxx/Makefile.PL; then
11065 nonxs_extensions="$nonxs_extensions $xxx"
11067 if $test -d $xxx; then
11068 # Look for nested extensions, eg. Devel/Dprof.
11071 if $test -f $yyy/$yyy.xs; then
11072 known_extensions="$known_extensions $xxx/$yyy"
11073 elif $test -f $yyy/Makefile.PL; then
11074 nonxs_extensions="$nonxs_extensions $xxx/$yyy"
11083 set X $nonxs_extensions
11085 nonxs_extensions="$*"
11086 set X $known_extensions
11088 known_extensions="$*"
11091 : Now see which are supported on this system.
11093 for xxx in $known_extensions ; do
11097 $define) avail_ext="$avail_ext $xxx" ;;
11100 GDBM_File|gdbm_fil)
11102 $define) avail_ext="$avail_ext $xxx" ;;
11105 NDBM_File|ndbm_fil)
11107 $define) avail_ext="$avail_ext $xxx" ;;
11110 ODBM_File|odbm_fil)
11111 case "${i_dbm}${i_rpcsvcdbm}" in
11112 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
11116 case "$useposix" in
11117 true|define|y) avail_ext="$avail_ext $xxx" ;;
11121 case "$useopcode" in
11122 true|define|y) avail_ext="$avail_ext $xxx" ;;
11126 case "$d_socket" in
11127 true|$define|y) avail_ext="$avail_ext $xxx" ;;
11131 case "$usethreads" in
11132 true|$define|y) avail_ext="$avail_ext $xxx" ;;
11136 case "${d_msg}${d_sem}${d_shm}" in
11137 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
11140 *) avail_ext="$avail_ext $xxx"
11149 : Now see which nonxs extensions are supported on this system.
11150 : For now assume all are.
11152 for xxx in $nonxs_extensions ; do
11154 *) nonxs_ext="$nonxs_ext $xxx"
11166 A number of extensions are supplied with $package. You may choose to
11167 compile these extensions for dynamic loading (the default), compile
11168 them into the $package executable (static loading), or not include
11169 them at all. Answer "none" to include no extensions.
11170 Note that DynaLoader is always built and need not be mentioned here.
11173 case "$dynamic_ext" in
11174 '') dflt="$avail_ext" ;;
11175 *) dflt="$dynamic_ext"
11176 # Perhaps we are reusing an old out-of-date config.sh.
11179 if test X"$dynamic_ext" != X"$avail_ext"; then
11181 NOTICE: Your previous config.sh list may be incorrect.
11182 The extensions now available to you are
11184 but the default list from your previous config.sh is
11196 rp="What extensions do you wish to load dynamically?"
11199 none) dynamic_ext=' ' ;;
11200 *) dynamic_ext="$ans" ;;
11203 case "$static_ext" in
11205 : Exclude those already listed in dynamic linking
11207 for xxx in $avail_ext; do
11208 case " $dynamic_ext " in
11210 *) dflt="$dflt $xxx" ;;
11217 *) dflt="$static_ext"
11224 rp="What extensions do you wish to load statically?"
11227 none) static_ext=' ' ;;
11228 *) static_ext="$ans" ;;
11233 A number of extensions are supplied with $package. Answer "none"
11234 to include no extensions.
11235 Note that DynaLoader is always built and need not be mentioned here.
11238 case "$static_ext" in
11239 '') dflt="$avail_ext" ;;
11240 *) dflt="$static_ext"
11241 # Perhaps we are reusing an old out-of-date config.sh.
11244 if test X"$static_ext" != X"$avail_ext"; then
11246 NOTICE: Your previous config.sh list may be incorrect.
11247 The extensions now available to you are
11249 but the default list from your previous config.sh is
11258 : Exclude those that are not xs extensions
11262 rp="What extensions do you wish to include?"
11265 none) static_ext=' ' ;;
11266 *) static_ext="$ans" ;;
11271 set X $dynamic_ext $static_ext $nonxs_ext
11275 : Remove build directory name from cppstdin so it can be used from
11276 : either the present location or the final installed location.
11278 : Get out of the UU directory to get correct path name.
11280 case "$cppstdin" in
11282 echo "Stripping down cppstdin path name"
11288 : end of configuration questions
11290 echo "End of configuration questions."
11293 : back to where it started
11294 if test -d ../UU; then
11298 : configuration may be patched via a 'config.over' file
11299 if $test -f config.over; then
11302 rp='I see a config.over file. Do you wish to load it?'
11305 n*) echo "OK, I'll ignore it.";;
11307 echo "Configuration override changes have been loaded."
11312 : in case they want portability, strip down executable paths
11313 case "$d_portable" in
11316 echo "Stripping down executable paths..." >&4
11317 for file in $loclist $trylist; do
11318 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
11319 eval $file="\$file"
11325 : create config.sh file
11327 echo "Creating config.sh..." >&4
11328 $spitshell <<EOT >config.sh
11331 # This file was produced by running the Configure script. It holds all the
11332 # definitions figured out by Configure. Should you modify one of these values,
11333 # do not forget to propagate your changes by running "Configure -der". You may
11334 # instead choose to run each of the .SH files by yourself, or "Configure -S".
11337 # Package name : $package
11338 # Source directory : $src
11339 # Configuration time: $cf_time
11340 # Configured by : $cf_by
11341 # Target system : $myuname
11351 Revision='$Revision'
11358 alignbytes='$alignbytes'
11359 ansi2knr='$ansi2knr'
11360 aphostname='$aphostname'
11361 apiversion='$apiversion'
11364 archlibexp='$archlibexp'
11365 archname='$archname'
11366 archobjs='$archobjs'
11374 byteorder='$byteorder'
11376 castflags='$castflags'
11379 cccdlflags='$cccdlflags'
11380 ccdlflags='$ccdlflags'
11383 cf_email='$cf_email'
11388 clocktype='$clocktype'
11390 compress='$compress'
11391 contains='$contains'
11395 cpp_stuff='$cpp_stuff'
11396 cppflags='$cppflags'
11398 cppminus='$cppminus'
11400 cppstdin='$cppstdin'
11401 cryptlib='$cryptlib'
11403 d_Gconvert='$d_Gconvert'
11404 d_access='$d_access'
11406 d_archlib='$d_archlib'
11407 d_attribut='$d_attribut'
11411 d_bsdgetpgrp='$d_bsdgetpgrp'
11412 d_bsdsetpgrp='$d_bsdsetpgrp'
11414 d_casti32='$d_casti32'
11415 d_castneg='$d_castneg'
11416 d_charvspr='$d_charvspr'
11418 d_chroot='$d_chroot'
11419 d_chsize='$d_chsize'
11420 d_closedir='$d_closedir'
11424 d_cuserid='$d_cuserid'
11425 d_dbl_dig='$d_dbl_dig'
11426 d_difftime='$d_difftime'
11427 d_dirnamlen='$d_dirnamlen'
11428 d_dlerror='$d_dlerror'
11429 d_dlopen='$d_dlopen'
11430 d_dlsymun='$d_dlsymun'
11431 d_dosuid='$d_dosuid'
11433 d_endgrent='$d_endgrent'
11434 d_endhent='$d_endhent'
11435 d_endnent='$d_endnent'
11436 d_endpent='$d_endpent'
11437 d_endpwent='$d_endpwent'
11438 d_endsent='$d_endsent'
11439 d_eofnblk='$d_eofnblk'
11440 d_eunice='$d_eunice'
11441 d_fchmod='$d_fchmod'
11442 d_fchown='$d_fchown'
11444 d_fd_macros='$d_fd_macros'
11445 d_fd_set='$d_fd_set'
11446 d_fds_bits='$d_fds_bits'
11447 d_fgetpos='$d_fgetpos'
11448 d_flexfnam='$d_flexfnam'
11451 d_fpathconf='$d_fpathconf'
11452 d_fsetpos='$d_fsetpos'
11454 d_getgrent='$d_getgrent'
11455 d_getgrps='$d_getgrps'
11456 d_gethbyaddr='$d_gethbyaddr'
11457 d_gethbyname='$d_gethbyname'
11458 d_gethent='$d_gethent'
11459 d_gethname='$d_gethname'
11460 d_gethostprotos='$d_gethostprotos'
11461 d_getlogin='$d_getlogin'
11462 d_getnbyaddr='$d_getnbyaddr'
11463 d_getnbyname='$d_getnbyname'
11464 d_getnent='$d_getnent'
11465 d_getnetprotos='$d_getnetprotos'
11466 d_getpbyname='$d_getpbyname'
11467 d_getpbynumber='$d_getpbynumber'
11468 d_getpent='$d_getpent'
11469 d_getpgid='$d_getpgid'
11470 d_getpgrp2='$d_getpgrp2'
11471 d_getpgrp='$d_getpgrp'
11472 d_getppid='$d_getppid'
11473 d_getprior='$d_getprior'
11474 d_getprotoprotos='$d_getprotoprotos'
11475 d_getpwent='$d_getpwent'
11476 d_getsbyname='$d_getsbyname'
11477 d_getsbyport='$d_getsbyport'
11478 d_getsent='$d_getsent'
11479 d_getservprotos='$d_getservprotos'
11480 d_gettimeod='$d_gettimeod'
11481 d_gnulibc='$d_gnulibc'
11482 d_grpasswd='$d_grpasswd'
11485 d_inetaton='$d_inetaton'
11486 d_isascii='$d_isascii'
11487 d_killpg='$d_killpg'
11488 d_lchown='$d_lchown'
11490 d_locconv='$d_locconv'
11492 d_longdbl='$d_longdbl'
11493 d_longlong='$d_longlong'
11496 d_mbstowcs='$d_mbstowcs'
11497 d_mbtowc='$d_mbtowc'
11498 d_memcmp='$d_memcmp'
11499 d_memcpy='$d_memcpy'
11500 d_memmove='$d_memmove'
11501 d_memset='$d_memset'
11503 d_mkfifo='$d_mkfifo'
11504 d_mktime='$d_mktime'
11506 d_msgctl='$d_msgctl'
11507 d_msgget='$d_msgget'
11508 d_msgrcv='$d_msgrcv'
11509 d_msgsnd='$d_msgsnd'
11510 d_mymalloc='$d_mymalloc'
11512 d_oldpthreads='$d_oldpthreads'
11513 d_oldsock='$d_oldsock'
11515 d_pathconf='$d_pathconf'
11517 d_phostname='$d_phostname'
11520 d_portable='$d_portable'
11521 d_pthread_yield='$d_pthread_yield'
11522 d_pthreads_created_joinable='$d_pthreads_created_joinable'
11524 d_pwchange='$d_pwchange'
11525 d_pwclass='$d_pwclass'
11526 d_pwcomment='$d_pwcomment'
11527 d_pwexpire='$d_pwexpire'
11528 d_pwgecos='$d_pwgecos'
11529 d_pwquota='$d_pwquota'
11530 d_pwpasswd='$d_pwpasswd'
11531 d_readdir='$d_readdir'
11532 d_readlink='$d_readlink'
11533 d_rename='$d_rename'
11534 d_rewinddir='$d_rewinddir'
11536 d_safebcpy='$d_safebcpy'
11537 d_safemcpy='$d_safemcpy'
11538 d_sanemcmp='$d_sanemcmp'
11539 d_sched_yield='$d_sched_yield'
11540 d_seekdir='$d_seekdir'
11541 d_select='$d_select'
11543 d_semctl='$d_semctl'
11544 d_semctl_semid_ds='$d_semctl_semid_ds'
11545 d_semctl_semun='$d_semctl_semun'
11546 d_semget='$d_semget'
11548 d_setegid='$d_setegid'
11549 d_seteuid='$d_seteuid'
11550 d_setgrent='$d_setgrent'
11551 d_setgrps='$d_setgrps'
11552 d_sethent='$d_sethent'
11553 d_setlinebuf='$d_setlinebuf'
11554 d_setlocale='$d_setlocale'
11555 d_setnent='$d_setnent'
11556 d_setpent='$d_setpent'
11557 d_setpgid='$d_setpgid'
11558 d_setpgrp2='$d_setpgrp2'
11559 d_setpgrp='$d_setpgrp'
11560 d_setprior='$d_setprior'
11561 d_setpwent='$d_setpwent'
11562 d_setregid='$d_setregid'
11563 d_setresgid='$d_setresgid'
11564 d_setresuid='$d_setresuid'
11565 d_setreuid='$d_setreuid'
11566 d_setrgid='$d_setrgid'
11567 d_setruid='$d_setruid'
11568 d_setsent='$d_setsent'
11569 d_setsid='$d_setsid'
11570 d_setvbuf='$d_setvbuf'
11574 d_shmatprototype='$d_shmatprototype'
11575 d_shmctl='$d_shmctl'
11577 d_shmget='$d_shmget'
11578 d_sigaction='$d_sigaction'
11579 d_sigsetjmp='$d_sigsetjmp'
11580 d_socket='$d_socket'
11581 d_sockpair='$d_sockpair'
11582 d_statblks='$d_statblks'
11583 d_stdio_cnt_lval='$d_stdio_cnt_lval'
11584 d_stdio_ptr_lval='$d_stdio_ptr_lval'
11585 d_stdiobase='$d_stdiobase'
11586 d_stdstdio='$d_stdstdio'
11587 d_strchr='$d_strchr'
11588 d_strcoll='$d_strcoll'
11589 d_strctcpy='$d_strctcpy'
11590 d_strerrm='$d_strerrm'
11591 d_strerror='$d_strerror'
11592 d_strtod='$d_strtod'
11593 d_strtol='$d_strtol'
11594 d_strtoul='$d_strtoul'
11595 d_strxfrm='$d_strxfrm'
11596 d_suidsafe='$d_suidsafe'
11597 d_symlink='$d_symlink'
11598 d_syscall='$d_syscall'
11599 d_sysconf='$d_sysconf'
11600 d_sysernlst='$d_sysernlst'
11601 d_syserrlst='$d_syserrlst'
11602 d_system='$d_system'
11603 d_tcgetpgrp='$d_tcgetpgrp'
11604 d_tcsetpgrp='$d_tcsetpgrp'
11605 d_telldir='$d_telldir'
11608 d_truncate='$d_truncate'
11609 d_tzname='$d_tzname'
11612 d_union_semun='$d_union_semun'
11614 d_void_closedir='$d_void_closedir'
11615 d_voidsig='$d_voidsig'
11616 d_voidtty='$d_voidtty'
11617 d_volatile='$d_volatile'
11618 d_vprintf='$d_vprintf'
11620 d_waitpid='$d_waitpid'
11621 d_wcstombs='$d_wcstombs'
11622 d_wctomb='$d_wctomb'
11625 db_hashtype='$db_hashtype'
11626 db_prefixtype='$db_prefixtype'
11627 defvoidused='$defvoidused'
11628 direntrytype='$direntrytype'
11631 doublesize='$doublesize'
11632 dynamic_ext='$dynamic_ext'
11638 eunicefix='$eunicefix'
11641 extensions='$extensions'
11643 firstmakefile='$firstmakefile'
11645 fpostype='$fpostype'
11646 freetype='$freetype'
11647 full_csh='$full_csh'
11648 full_sed='$full_sed'
11649 gccversion='$gccversion'
11653 groupcat='$groupcat'
11654 groupstype='$groupstype'
11657 h_sysfile='$h_sysfile'
11661 i_arpa_inet='$i_arpa_inet'
11662 i_bsdioctl='$i_bsdioctl'
11665 i_dirent='$i_dirent'
11672 i_limits='$i_limits'
11673 i_locale='$i_locale'
11674 i_malloc='$i_malloc'
11676 i_memory='$i_memory'
11679 i_neterrno='$i_neterrno'
11682 i_rpcsvcdbm='$i_rpcsvcdbm'
11685 i_stdarg='$i_stdarg'
11686 i_stddef='$i_stddef'
11687 i_stdlib='$i_stdlib'
11688 i_string='$i_string'
11689 i_sysdir='$i_sysdir'
11690 i_sysfile='$i_sysfile'
11691 i_sysfilio='$i_sysfilio'
11693 i_sysioctl='$i_sysioctl'
11694 i_sysndir='$i_sysndir'
11695 i_sysparam='$i_sysparam'
11696 i_sysresrc='$i_sysresrc'
11697 i_sysselct='$i_sysselct'
11698 i_syssockio='$i_syssockio'
11699 i_sysstat='$i_sysstat'
11700 i_systime='$i_systime'
11701 i_systimek='$i_systimek'
11702 i_systimes='$i_systimes'
11703 i_systypes='$i_systypes'
11705 i_syswait='$i_syswait'
11706 i_termio='$i_termio'
11707 i_termios='$i_termios'
11709 i_unistd='$i_unistd'
11711 i_values='$i_values'
11712 i_varargs='$i_varargs'
11713 i_varhdr='$i_varhdr'
11717 installarchlib='$installarchlib'
11718 installbin='$installbin'
11719 installman1dir='$installman1dir'
11720 installman3dir='$installman3dir'
11721 installprivlib='$installprivlib'
11722 installscript='$installscript'
11723 installsitearch='$installsitearch'
11724 installsitelib='$installsitelib'
11726 known_extensions='$known_extensions'
11730 lddlflags='$lddlflags'
11738 libswanted='$libswanted'
11744 locincpth='$locincpth'
11745 loclibpth='$loclibpth'
11746 longdblsize='$longdblsize'
11747 longlongsize='$longlongsize'
11748 longsize='$longsize'
11752 lseektype='$lseektype'
11756 make_set_make='$make_set_make'
11757 mallocobj='$mallocobj'
11758 mallocsrc='$mallocsrc'
11759 malloctype='$malloctype'
11761 man1direxp='$man1direxp'
11764 man3direxp='$man3direxp'
11768 mips_type='$mips_type'
11771 modetype='$modetype'
11774 myarchname='$myarchname'
11775 mydomain='$mydomain'
11776 myhostname='$myhostname'
11779 netdb_hlen_type='$netdb_hlen_type'
11780 netdb_host_type='$netdb_host_type'
11781 netdb_name_type='$netdb_name_type'
11782 netdb_net_type='$netdb_net_type'
11785 nm_so_opt='$nm_so_opt'
11786 nonxs_ext='$nonxs_ext'
11788 o_nonblock='$o_nonblock'
11790 optimize='$optimize'
11791 orderlib='$orderlib'
11797 patchlevel='$patchlevel'
11798 path_sep='$path_sep'
11800 perladmin='$perladmin'
11801 perlpath='$perlpath'
11803 phostname='$phostname'
11809 prefixexp='$prefixexp'
11811 privlibexp='$privlibexp'
11812 prototype='$prototype'
11814 randbits='$randbits'
11816 rd_nodata='$rd_nodata'
11820 scriptdir='$scriptdir'
11821 scriptdirexp='$scriptdirexp'
11823 selecttype='$selecttype'
11824 sendmail='$sendmail'
11827 sharpbang='$sharpbang'
11828 shmattype='$shmattype'
11829 shortsize='$shortsize'
11832 sig_name='$sig_name'
11833 sig_name_init='$sig_name_init'
11835 signal_t='$signal_t'
11836 sitearch='$sitearch'
11837 sitearchexp='$sitearchexp'
11839 sitelibexp='$sitelibexp'
11840 sizetype='$sizetype'
11845 sockethdr='$sockethdr'
11846 socketlib='$socketlib'
11848 spackage='$spackage'
11849 spitshell='$spitshell'
11852 ssizetype='$ssizetype'
11853 startperl='$startperl'
11855 static_ext='$static_ext'
11857 stdio_base='$stdio_base'
11858 stdio_bufsiz='$stdio_bufsiz'
11859 stdio_cnt='$stdio_cnt'
11860 stdio_filbuf='$stdio_filbuf'
11861 stdio_ptr='$stdio_ptr'
11864 subversion='$subversion'
11871 timeincl='$timeincl'
11872 timetype='$timetype'
11881 usemymalloc='$usemymalloc'
11883 useopcode='$useopcode'
11884 useperlio='$useperlio'
11885 useposix='$useposix'
11887 useshrplib='$useshrplib'
11888 usethreads='$usethreads'
11889 usevfork='$usevfork'
11894 voidflags='$voidflags'
11900 : Add in command line options if available
11901 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
11903 : add special variables
11904 $test -f $src/patchlevel.h && \
11905 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
11906 echo "CONFIG=true" >>config.sh
11908 : propagate old symbols
11909 if $test -f UU/config.sh; then
11910 <UU/config.sh sort | uniq >UU/oldconfig.sh
11911 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
11912 sort | uniq -u >UU/oldsyms
11913 set X `cat UU/oldsyms`
11919 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
11921 echo "# Variables propagated from previous config.sh file." >>config.sh
11922 for sym in `cat UU/oldsyms`; do
11923 echo " Propagating $hint variable "'$'"$sym..."
11924 eval 'tmp="$'"${sym}"'"'
11926 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
11932 : Finish up by extracting the .SH files
11946 If you'd like to make any changes to the config.sh file before I begin
11947 to configure things, do it as a shell escape now (e.g. !vi config.sh).
11950 rp="Press return or use a shell escape to edit config.sh:"
11955 *) : in case they cannot read
11956 sh 1>&4 -c "$ans";;
11961 : if this fails, just run all the .SH files by hand
11966 if test -d ebcdic; then
11967 echo "This is an EBCDIC system, moving the right parser files in place." >&4
11968 # Try to save the ASCII versions, just in case.
11969 test -f perly.c.ascii || mv perly.c perly.c.ascii
11970 test -f perly.h.ascii || mv perly.h perly.h.ascii
11972 cp -pf ebcdic/perly.c perly.c
11973 cp -pf ebcdic/perly.h perly.h
11975 test -f x2p/a2p.c.ascii || mv x2p/a2p.c x2p/a2p.c.ascii
11977 cp -pf ebcdic/a2p.c x2p/a2p.c
11979 echo "This is an EBCDIC system but there's no ebcdic directory." >&4
11980 echo "This will not do." >&4
11990 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
11997 Now you need to generate make dependencies by running "make depend".
11998 You might prefer to run it in background: "make depend > makedepend.out &"
11999 It can take a while, so you might not want to run it right now.
12004 rp="Run make depend now?"
12008 make depend && echo "Now you must run a make."
12011 echo "You must run 'make depend' then 'make'."
12014 elif test -f [Mm]akefile; then
12016 echo "Now you must run a make."
12021 if $test -f Policy.sh; then
12024 If you compile $package on a different machine or from a different object
12025 directory, copy the Policy.sh file from this object directory to the
12026 new one before you run Configure -- this will help you with most of
12027 the policy defaults.
12031 if $test -f config.msg; then
12032 echo "Hmm. I also noted the following information while running:"
12034 $cat config.msg >&4
12037 $rm -f kit*isdone ark*isdone