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 Jun 9 14:56:54 EDT 1998 [metaconfig 3.0 PL70]
28 SCO csh still thinks true is false. Write to SCO today and tell them that next
29 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
31 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
32 we'd have to do is go in and swap the && and || tokens, wherever they are.)
34 [End of diatribe. We now return you to your regularly scheduled programming...]
38 OOPS! You naughty creature! You didn't run Configure with sh!
39 I will attempt to remedy the situation by running sh for you...
42 true || cat /tmp/c1$$ /tmp/c2$$
43 true || exec sh $0 $argv:q
45 (exit $?0) || cat /tmp/c2$$
46 (exit $?0) || exec sh $0 $argv:q
47 rm -f /tmp/c1$$ /tmp/c2$$
49 : compute my invocation name
53 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
58 : Proper separator for the PATH environment variable
60 : On OS/2 this directory should exist if this is not floppy only system :-]
61 if test -d c:/. ; then
62 if test -n "$OS2_SHELL"; then
64 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
65 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
66 elif test -n "$DJGPP"; then
72 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
73 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
74 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
75 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
76 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
77 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
78 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
79 paths="$paths /sbin /usr/sbin /usr/libexec"
85 *) test -d $p && PATH=$PATH$p_$p ;;
92 : shall we be using ksh?
98 if (PATH=.; alias -x) >/dev/null 2>&1; then
101 if test -f /hp-ux -a -f /bin/ksh; then
102 needksh='to avoid sh bug in "here document" expansion'
104 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
105 if test X`/usr/bin/uname -v` = X4; then
106 avoidksh="to avoid AIX 4's /bin/sh"
110 case "$inksh/$needksh" in
117 case "$inksh/$avoidksh" in
123 case "$inksh/$needksh-$avoidksh-" in
126 (I see you are using the Korn shell. Some ksh's blow up on $me,
127 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
133 echo "(Feeding myself to $newsh $reason.)"
135 Configure|*/Configure) exec $newsh $0 "$@";;
136 *) exec $newsh Configure "$@";;
141 : Configure runs within the UU subdirectory
142 test -d UU || mkdir UU
395 d_pthreads_created_joinable=''
692 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
695 : We must find out about Eunice early
697 if test -f /etc/unixtovms; then
698 eunicefix=/etc/unixtovms
700 if test -f /etc/unixtovms.exe; then
701 eunicefix=/etc/unixtovms.exe
704 : list of known cpp symbols, sorted alphabetically
705 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
706 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
707 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
708 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
709 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
710 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
711 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
712 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
713 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
714 al="$al VMS Xenix286"
715 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
716 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
717 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
718 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
719 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
720 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
721 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
722 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
723 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
724 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
725 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
726 al="$al __SVR4_2__ __UMAXV__"
727 al="$al ____386BSD____ __alpha __alpha__ __amiga"
728 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
729 al="$al __host_mips__"
730 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
731 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
732 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
733 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
734 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
735 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
736 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
737 al="$al __mc88100 __mc88100__ __mips __mips__"
738 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
739 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
740 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
741 al="$al _host_mips _mips _unix"
742 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
743 al="$al apollo ardent att386 att3b"
744 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
745 al="$al cadmus clipper concurrent convex cray ctix"
746 al="$al dmert encore gcos gcx gimpel gould"
747 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
748 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
749 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
750 al="$al i186 i286 i386 i486 i8086"
751 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
752 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
753 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
754 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
755 al="$al mc88000 mc88100 merlin mert mips mvs n16"
756 al="$al ncl_el ncl_mr"
757 al="$al news1500 news1700 news1800 news1900 news3700"
758 al="$al news700 news800 news900 ns16000 ns32000"
759 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
760 al="$al parisc pc532 pdp11 plexus posix pyr"
761 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
762 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
763 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
764 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
765 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
766 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
770 : change the next line if compiling for Xenix/286 on Xenix/386
771 xlibpth='/usr/lib/386 /lib/386'
773 : Possible local library directories to search.
774 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
775 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
777 : general looking path for locating libraries
778 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
779 glibpth="$glibpth /lib /usr/lib $xlibpth"
780 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
781 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
783 : Private path used by Configure to find libraries. Its value
784 : is prepended to libpth. This variable takes care of special
785 : machines, like the mips. Usually, it should be empty.
788 : default library list
790 : full support for void wanted by default
793 : Possible local include directories to search.
794 : Set locincpth to "" in a hint file to defeat local include searches.
795 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
796 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
798 : no include file wanted by default
801 : Trailing extension. Override this in a hint file, if needed.
803 : Extra object files, if any, needed on this platform.
806 : set useposix=false in your hint file to disable the POSIX extension.
808 : set useopcode=false in your hint file to disable the Opcode extension.
810 : set usethreads on the Configure command line to enable threads.
811 : List of libraries we want.
812 : If anyone needs -lnet, put it in a hint file.
813 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
814 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
815 libswanted="$libswanted ucb bsd BSD PW x"
816 : We probably want to search /usr/shlib before most other libraries.
817 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
818 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
819 glibpth="/usr/shlib $glibpth"
820 : Do not use vfork unless overridden by a hint file.
823 : Find the basic shell for Bourne shell scripts
827 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
830 if test -f "$xxx"; then
833 : Build up a list and do a single loop so we can 'break' out.
834 pth=`echo $PATH | sed -e "s/$p_/ /g"`
835 for xxx in sh bash ksh pdksh ash; do
837 try="$try ${p}/${xxx}"
841 if test -f "$xxx"; then
844 elif test -f "$xxx.exe"; then
855 $me: Fatal Error: I can't find a Bourne Shell anywhere.
857 Usually it's in /bin/sh. How did you even get this far?
858 Please contact me (Andy Dougherty) at doughera@lafcol.lafayette.edu and
859 we'll try to straighten this all out.
865 : see if sh knows # comments
866 if `$sh -c '#' >/dev/null 2>&1`; then
870 test -f $xcat || xcat=/usr/bin/cat
875 if test -s today; then
878 echo "#! $xcat" > try
882 if test -s today; then
890 echo "Your $sh doesn't grok # comments--I will strip them later on."
893 echo "exec grep -v '^[ ]*#'" >spitshell
896 spitshell=`pwd`/spitshell
898 echo "I presume that if # doesn't work, #! won't work either!"
903 : figure out how to guarantee sh startup
905 '') startsh=${sharpbang}${sh} ;;
917 : echo "Yup, it does."
919 echo "Hmm... '$startsh' does not guarantee sh startup..."
920 echo "You may have to fix up the shell scripts to make sure $sh runs them."
925 : Save command line options in file UU/cmdline.opt for later use in
926 : generating config.sh.
927 cat > cmdline.opt <<EOSH
928 # Configure command line arguments.
935 cat >>cmdline.opt <<EOSH
936 config_arg$argn='$arg'
938 argn=`expr $argn + 1`
941 : produce awk script to parse command line options
942 cat >options.awk <<'EOF'
944 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
946 len = length(optstr);
947 for (i = 1; i <= len; i++) {
948 c = substr(optstr, i, 1);
949 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
960 if (substr(str, 1, 1) != "-") {
961 printf("'%s'\n", str);
965 for (i = 2; i <= len; i++) {
966 c = substr(str, i, 1);
968 printf("-%s\n", substr(str, i));
974 printf("'%s'\n", substr(str, i + 1));
987 : process the command line options
988 set X `for arg in "$@"; do echo "X$arg"; done |
989 sed -e s/X// | awk -f options.awk`
994 : set up default values
1005 cat >optdef.sh <<EOS
1011 while test $# -gt 0; do
1013 -d) shift; fastread=yes;;
1014 -e) shift; alldone=cont;;
1018 if test -r "$1"; then
1021 echo "$me: cannot read config file $1." >&2
1026 -h) shift; error=true;;
1027 -r) shift; reuseval=true;;
1028 -s) shift; silent=true; realsilent=true;;
1029 -E) shift; alldone=exit;;
1030 -K) shift; knowitall=true;;
1031 -O) shift; override=true;;
1032 -S) shift; silent=true; extractsh=true;;
1037 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1038 echo "$me: ignoring -D $1" >&2
1041 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1042 *) echo "$1='define'" >> optdef.sh;;
1049 *=) echo "$1" >> optdef.sh;;
1051 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1052 echo "$me: ignoring -U $1" >&2
1054 *) echo "$1='undef'" >> optdef.sh;;
1058 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1061 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1069 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1070 [-U symbol] [-U symbol=]
1071 -d : use defaults for all answers.
1072 -e : go on without questioning past the production of config.sh.
1073 -f : specify an alternate default configuration file.
1074 -h : print this help message and exit (with an error status).
1075 -r : reuse C symbols value if possible (skips costly nm extraction).
1076 -s : silent mode, only echoes questions and essential information.
1077 -D : define symbol to have some value:
1078 -D symbol symbol gets the value 'define'
1079 -D symbol=value symbol gets the value 'value'
1080 -E : stop at the end of questions, after having produced config.sh.
1081 -K : do not use unless you know what you are doing.
1082 -O : let -D and -U override definitions from loaded configuration file.
1083 -S : perform variable substitutions on all .SH files (can mix with -f)
1084 -U : undefine symbol:
1085 -U symbol symbol gets the value 'undef'
1086 -U symbol= symbol gets completely empty
1087 -V : print version number and exit (with a zero status).
1094 case "$fastread$alldone" in
1097 if test ! -t 0; then
1098 echo "Say 'sh Configure', not 'sh <Configure'"
1106 true) exec 1>/dev/null;;
1109 : run the defines and the undefines, if any, but leave the file out there...
1115 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1116 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1117 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1118 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1119 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1122 : Some greps do not return status, grrr.
1123 echo "grimblepritz" >grimble
1124 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1126 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1132 : the following should work in any shell
1136 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1137 cat >contains <<'EOSS'
1138 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1143 : Find the path to the source tree
1146 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1157 if test -f $rsrc/Configure && \
1158 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1160 : found it, so we are ok.
1163 for src in . .. ../.. ../../.. ../../../..; do
1164 if test -f ../$src/Configure && \
1165 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1176 Sorry, I can't seem to locate the source dir for $package. Please start
1177 Configure with an explicit path -- i.e. /some/path/Configure.
1185 echo "Sources for $package found in \"$src\"." >&4
1189 : script used to extract .SH files with variable substitutions
1190 cat >extract <<'EOS'
1192 echo "Doing variable substitutions on .SH files..."
1193 if test -f $src/MANIFEST; then
1194 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'`
1196 echo "(Looking for .SH files under the source directory.)"
1197 set x `(cd $src; find . -name "*.SH" -print)`
1201 0) set x `(cd $src; echo *.SH)`; shift;;
1203 if test ! -f $src/$1; then
1209 while test $name; do
1210 if test ! -d "$name"; then
1211 create="$name $create";
1212 name=`echo $name | sed -e "s|^[^/]*$||"`;
1213 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1218 for file in $create; do
1227 dir=`expr X$file : 'X\(.*\)/'`
1228 file=`expr X$file : 'X.*/\(.*\)'`
1229 (cd $dir && . ./$file)
1239 dir=`expr X$file : 'X\(.*\)/'`
1240 file=`expr X$file : 'X.*/\(.*\)'`
1241 (set x $dir; shift; eval $mkdir_p)
1251 if test -f $src/config_h.SH; then
1252 if test ! -f config.h; then
1253 : oops, they left it out of MANIFEST, probably, so do it anyway.
1259 : extract files and exit if asked to do so
1260 case "$extractsh" in
1262 case "$realsilent" in
1266 case "$config_sh" in
1267 '') config_sh='config.sh';;
1270 echo "Fetching answers from $config_sh..."
1273 test "$override" && . ./optdef.sh
1282 : Eunice requires " " instead of "", can you believe it
1285 echo "Beginning of configuration questions for $package."
1287 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1289 : first determine how to suppress newline on echo command
1291 echo "Checking echo to see how to suppress newlines..."
1292 (echo "hi there\c" ; echo " ") >.echotmp
1293 if $contains c .echotmp >/dev/null 2>&1 ; then
1304 echo $n "The star should be here-->$c"
1308 : Now test for existence of everything in MANIFEST
1310 if test -f $rsrc/MANIFEST; then
1311 echo "First let's make sure your kit is complete. Checking..." >&4
1312 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1315 for filelist in x??; do
1316 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1318 if test -s missing; then
1322 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1324 You have the option of continuing the configuration process, despite the
1325 distinct possibility that your kit is damaged, by typing 'y'es. If you
1326 do, don't blame me if something goes wrong. I advise you to type 'n'o
1327 and contact the author (doughera@lafcol.lafayette.edu).
1330 echo $n "Continue? [n] $c" >&4
1334 echo "Continuing..." >&4
1338 echo "ABORTING..." >&4
1343 echo "Looks good..."
1346 echo "There is no MANIFEST file. I hope your kit is complete !"
1350 : compute the number of columns on the terminal for proper question formatting
1355 : set up the echo used in my read
1356 myecho="case \"\$xxxm\" in
1357 '') echo $n \"\$rp $c\" >&4;;
1359 '') echo $n \"[\$xxxm] $c\";;
1361 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1363 echo $n \"[\$xxxm] $c\" >&4
1365 echo $n \"\$rp [\$xxxm] $c\" >&4
1371 : now set up to do reads with possible shell escape and default assignment
1377 case "\$fastread" in
1378 yes) case "\$dflt" in
1381 case "\$silent-\$rp" in
1386 *) case "\$silent" in
1387 true) case "\$rp" in
1392 while expr "X\$ans" : "X!" >/dev/null; do
1396 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1404 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1413 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1418 echo "(OK, I'll run with -d after this question.)" >&4
1421 echo "*** Sorry, \$1 not supported yet." >&4
1431 echo "*** Substitution done -- please confirm."
1433 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1438 echo "*** Error -- try again."
1445 case "\$ans\$xxxm\$nostick" in
1457 : create .config dir to save info across Configure sessions
1458 test -d ../.config || mkdir ../.config
1459 cat >../.config/README <<EOF
1460 This directory created by Configure to save information that should
1461 persist across sessions for $package.
1463 You may safely delete it if you wish.
1466 : general instructions
1469 user=`(logname) 2>/dev/null`
1471 '') user=`whoami 2>&1`;;
1473 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1476 rp='Would you like to see the instructions?'
1487 This installation shell script will examine your system and ask you questions
1488 to determine how the perl5 package should be installed. If you get
1489 stuck on a question, you may use a ! shell escape to start a subshell or
1490 execute a command. Many of the questions will have default answers in square
1491 brackets; typing carriage return will give you the default.
1493 On some of the questions which ask for file or directory names you are allowed
1494 to use the ~name construct to specify the login directory belonging to "name",
1495 even if you don't have a shell which knows about that. Questions where this is
1496 allowed will be marked "(~name ok)".
1500 dflt='Type carriage return to continue'
1504 The prompter used in this script allows you to use shell variables and
1505 backticks in your answers. You may use $1, $2, etc... to refer to the words
1506 in the default answer, as if the default line was a set of arguments given to a
1507 script shell. This means you may also use $* to repeat the whole default line,
1508 so you do not have to re-type everything to add something to the default.
1510 Everytime there is a substitution, you will have to confirm. If there is an
1511 error (e.g. an unmatched backtick), the default answer will remain unchanged
1512 and you will be prompted again.
1514 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1515 the questions and use the computed defaults (or the previous answers if there
1516 was already a config.sh file). Type 'Configure -h' for a list of options.
1517 You may also start interactively and then answer '& -d' at any prompt to turn
1518 on the non-interactive behaviour for the remainder of the execution.
1524 Much effort has been expended to ensure that this shell script will run on any
1525 Unix system. If despite that it blows up on yours, your best bet is to edit
1526 Configure and run it again. If you can't run Configure for some reason,
1527 you'll have to generate a config.sh file by hand. Whatever problems you
1528 have, let me (doughera@lafcol.lafayette.edu) know how I blew it.
1530 This installation script affects things in two ways:
1532 1) it may do direct variable substitutions on some of the files included
1534 2) it builds a config.h file for inclusion in C programs. You may edit
1535 any of these files as the need arises after running this script.
1537 If you make a mistake on a question, there is no easy way to back up to it
1538 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1539 files. Configure will offer to let you do this before it runs the SH files.
1542 dflt='Type carriage return to continue'
1544 case "$firsttime" in
1545 true) echo $user >>../.config/instruct;;
1549 : find out where common programs are
1551 echo "Locating common programs..." >&4
1564 if test -d \$dir/\$thing; then
1570 for thisthing in \$dir/\$thing; do
1571 : just loop through to pick last item
1573 if test -f \$thisthing; then
1576 elif test -f \$dir/\$thing.exe; then
1577 if test -n "$DJGPP"; then
1578 echo \$dir/\$thing.exe
1580 : on Eunice apparently
1635 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1636 pth="$pth /lib /usr/lib"
1637 for file in $loclist; do
1641 if test -f "$xxx"; then
1644 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1645 xxx=`./loc $file $file $pth`
1648 '') xxx=`./loc $file $file $pth`;;
1649 *) xxx=`./loc $xxx $xxx $pth`;;
1655 echo $file is in $xxx.
1658 echo $file is in $xxx.
1661 echo "I don't know where '$file' is, and my life depends on it." >&4
1662 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1668 echo "Don't worry if any of the following aren't found..."
1670 for file in $trylist; do
1674 if test -f "$xxx"; then
1677 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1678 xxx=`./loc $file $file $pth`
1681 '') xxx=`./loc $file $file $pth`;;
1682 *) xxx=`./loc $xxx $xxx $pth`;;
1688 echo $file is in $xxx.
1691 echo $file is in $xxx.
1694 echo "I don't see $file out there, $say."
1701 echo "Substituting grep for egrep."
1707 echo "Substituting cp for ln."
1713 echo "Hopefully test is built into your sh."
1716 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1717 echo "Using the test built into your sh."
1725 echo "Hopefully echo is built into your sh."
1730 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1731 $echo $n "hi there$c" >foo1
1732 echo $n "hi there$c" >foo2
1733 if cmp foo1 foo2 >/dev/null 2>&1; then
1734 echo "They are compatible. In fact, they may be identical."
1741 They are not compatible! You are probably running ksh on a non-USG system.
1742 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1743 have echo built in and we may have to run some Bourne shell scripts. That
1744 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1747 $echo $n "The star should be here-->$c"
1754 : determine whether symbolic links are supported
1757 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1758 echo "Symbolic links are supported." >&4
1761 echo "Symbolic links are NOT supported." >&4
1766 : see whether [:lower:] and [:upper:] are supported character classes
1770 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1772 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1777 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1780 : set up the translation script tr, must be called with ./tr of course
1784 '[A-Z][a-z]') exec $tr '$up' '$low';;
1785 '[a-z][A-Z]') exec $tr '$low' '$up';;
1792 : Try to determine whether config.sh was made on this system
1793 case "$config_sh" in
1795 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1796 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1797 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1798 newmyuname="$myuname"
1800 case "$knowitall" in
1802 if test -f ../config.sh; then
1803 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1804 eval "`grep myuname= ../config.sh`"
1806 if test "X$myuname" = "X$newmyuname"; then
1814 : Get old answers from old config file if Configure was run on the
1815 : same system, otherwise use the hints.
1818 if test -f config.sh; then
1820 rp="I see a config.sh file. Shall I use it to set the defaults?"
1823 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1824 *) echo "Fetching default answers from your old config.sh file..." >&4
1832 : Older versions did not always set $sh. Catch re-use of such
1841 if test ! -f config.sh; then
1844 First time through, eh? I have some defaults handy for some systems
1845 that need some extra help getting the Configure answers right:
1848 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
1850 : Half the following guesses are probably wrong... If you have better
1851 : tests or hints, please send them to doughera@lafcol.lafayette.edu
1852 : The metaconfig authors would also appreciate a copy...
1853 $test -f /irix && osname=irix
1854 $test -f /xenix && osname=sco_xenix
1855 $test -f /dynix && osname=dynix
1856 $test -f /dnix && osname=dnix
1857 $test -f /lynx.os && osname=lynxos
1858 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1859 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
1860 $test -f /bin/mips && /bin/mips && osname=mips
1861 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1862 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1863 $test -d /usr/apollo/bin && osname=apollo
1864 $test -f /etc/saf/_sactab && osname=svr4
1865 $test -d /usr/include/minix && osname=minix
1866 if $test -d /MachTen; then
1868 if $test -x /sbin/version; then
1869 osvers=`/sbin/version | $awk '{print $2}' |
1870 $sed -e 's/[A-Za-z]$//'`
1871 elif $test -x /usr/etc/version; then
1872 osvers=`/usr/etc/version | $awk '{print $2}' |
1873 $sed -e 's/[A-Za-z]$//'`
1878 if $test -f $uname; then
1886 umips) osname=umips ;;
1889 [23]100) osname=mips ;;
1890 next*) osname=next ;;
1892 if $test -f /etc/kconfig; then
1894 if test "$lns" = "ln -s"; then
1896 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1898 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1904 if test -n "$DJGPP"; then
1913 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1915 'not found') osvers="$4"."$3" ;;
1916 '<3240'|'<>3240') osvers=3.2.0 ;;
1917 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1918 '=3250'|'>3250') osvers=3.2.5 ;;
1922 *dc.osx) osname=dcosx
1928 domainos) osname=apollo
1934 dynixptx*) osname=dynixptx
1937 freebsd) osname=freebsd
1939 genix) osname=genix ;;
1944 *.10.*) osvers=10 ;;
1945 *.11.*) osvers=11 ;;
1946 *.12.*) osvers=12 ;;
1962 netbsd*) osname=netbsd
1965 news-os) osvers="$3"
1967 4*) osname=newsos4 ;;
1971 bsd386) osname=bsd386
1974 powerux | power_ux | powermax_os | powermaxos | \
1975 powerunix | power_unix) osname=powerux
1978 next*) osname=next ;;
1979 solaris) osname=solaris
1981 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1988 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1992 titanos) osname=titanos
2001 ultrix) osname=ultrix
2004 osf1|mls+) case "$5" in
2007 osvers=`echo "$3" | sed 's/^[xvt]//'`
2009 hp*) osname=hp_osf1 ;;
2010 mips) osname=mips_osf1 ;;
2019 $2) case "$osname" in
2023 : svr4.x or possibly later
2033 if test -f /stand/boot ; then
2034 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2035 if test -n "$INITPROG" -a -f "$INITPROG"; then
2036 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2037 if test -n "$isesix"; then
2045 *) if test -f /etc/systemid; then
2047 set `echo $3 | $sed 's/\./ /g'` $4
2048 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2050 elif $test -f $src/hints/sco_$1_$2.sh; then
2052 elif $test -f $src/hints/sco_$1.sh; then
2057 '') : Still unknown. Probably a generic Sys V.
2066 *) case "$osname" in
2067 '') : Still unknown. Probably a generic BSD.
2075 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2076 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2077 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2080 $rm -f UU/kernel.what
2081 elif test -d c:/.; then
2088 : Now look for a hint file osname_osvers, unless one has been
2089 : specified already.
2092 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2093 : Also try without trailing minor version numbers.
2094 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2095 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2096 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2097 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2100 *) case "$osvers" in
2103 *) if $test -f $src/hints/$file.sh ; then
2105 elif $test -f $src/hints/$xfile.sh ; then
2107 elif $test -f $src/hints/$xxfile.sh ; then
2109 elif $test -f $src/hints/$xxxfile.sh ; then
2111 elif $test -f $src/hints/$xxxxfile.sh ; then
2113 elif $test -f "$src/hints/${osname}.sh" ; then
2122 if $test -f Policy.sh ; then
2125 none) dflt="Policy" ;;
2126 *) dflt="Policy $dflt" ;;
2131 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2135 if $test -f Policy.sh ; then
2138 There's also a Policy hint file available, which should make the
2139 site-specific (policy) questions easier to answer.
2146 You may give one or more space-separated answers, or "none" if appropriate.
2147 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2148 is a good thing. DO NOT give a wrong version.
2152 rp="Which of these apply, if any?"
2155 for file in $tans; do
2156 if $test X$file = XPolicy -a -f Policy.sh; then
2158 $cat Policy.sh >> UU/config.sh
2159 elif $test -f $src/hints/$file.sh; then
2160 . $src/hints/$file.sh
2161 $cat $src/hints/$file.sh >> UU/config.sh
2162 elif $test X$tans = X -o X$tans = Xnone ; then
2165 : Give one chance to correct a possible typo.
2166 echo "$file.sh does not exist"
2168 rp="hint to use instead?"
2170 for file in $ans; do
2171 if $test -f "$src/hints/$file.sh"; then
2172 . $src/hints/$file.sh
2173 $cat $src/hints/$file.sh >> UU/config.sh
2174 elif $test X$ans = X -o X$ans = Xnone ; then
2177 echo "$file.sh does not exist -- ignored."
2184 : Remember our hint file for later.
2185 if $test -f "$src/hints/$file.sh" ; then
2195 echo "Fetching default answers from $config_sh..." >&4
2199 cp $config_sh config.sh 2>/dev/null
2209 test "$override" && . ./optdef.sh
2210 myuname="$newmyuname"
2212 : Restore computed paths
2213 for file in $loclist $trylist; do
2214 eval $file="\$_$file"
2219 Configure uses the operating system name and version to set some defaults.
2220 The default value is probably right if the name rings a bell. Otherwise,
2221 since spelling matters for me, either accept the default or answer "none"
2228 ''|' '|none) dflt=none ;;
2229 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2232 *) dflt="$osname" ;;
2234 rp="Operating system name?"
2238 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2244 ''|' '|none) dflt=none ;;
2245 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2246 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2248 ''|' ') dflt=none ;;
2253 *) dflt="$osvers" ;;
2255 rp="Operating system version?"
2262 : who configured the system
2263 cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
2264 cf_by=`(logname) 2>/dev/null`
2267 cf_by=`(whoami) 2>/dev/null`
2269 "") cf_by=unknown ;;
2273 : set up the script used to warn in case of inconsistency
2280 echo "*** WHOA THERE!!! ***" >&4
2281 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2282 rp=" Keep the $hint value?"
2285 y) td=$was; tu=$was;;
2289 : function used to set $1 to $val
2290 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2292 $define$undef) . ./whoa; eval "$var=\$td";;
2293 $undef$define) . ./whoa; eval "$var=\$tu";;
2294 *) eval "$var=$val";;
2299 Perl can be built to take advantage of threads, on some systems.
2300 To do so, Configure must be run with -Dusethreads.
2301 (See README.threads for details.)
2303 case "$usethreads" in
2304 $define|true|[yY]*) dflt='y';;
2307 rp='Build a threading Perl?'
2310 y|Y) val="$define" ;;
2315 : Look for a hint-file generated 'call-back-unit'. Now that the
2316 : user has specified if a threading perl is to be built, we may need
2317 : to set or change some other defaults.
2318 if $test -f usethreads.cbu; then
2321 case "$d_oldpthreads" in
2322 '') : Configure tests would be welcome here. For now, assume undef.
2324 *) val="$d_oldpthreads" ;;
2329 : determine the architecture name
2331 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2332 tarch=`arch`"-$osname"
2333 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2334 if uname -m > tmparch 2>&1 ; then
2335 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2336 -e 's/$/'"-$osname/" tmparch`
2344 case "$myarchname" in
2347 echo "(Your architecture name used to be $myarchname.)"
2353 *) dflt="$archname";;
2355 rp='What is your architecture name'
2357 case "$usethreads" in
2358 $define) echo "Threads selected." >&4
2360 *-thread) echo "...and architecture name already ends in -thread." >&4
2363 *) archname="$ans-thread"
2364 echo "...setting architecture name to $archname." >&4
2368 *) archname="$ans" ;;
2374 $define|true) afs=true ;;
2375 $undef|false) afs=false ;;
2376 *) if test -d /afs; then
2384 echo "AFS may be running... I'll be extra cautious then..." >&4
2386 echo "AFS does not seem to be running..." >&4
2389 : decide how portable to be. Allow command line overrides.
2390 case "$d_portable" in
2392 *) d_portable="$define" ;;
2395 : set up shell script to do ~ expansion
2401 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2404 if $test -f /bin/csh; then
2405 /bin/csh -f -c "glob \$1"
2410 name=\`$expr x\$1 : '..\([^/]*\)'\`
2411 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2412 if $test ! -d "\$dir"; then
2414 echo "\$me: can't locate home directory for: \$name" >&2
2419 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2435 : now set up to get a file name
2439 cat <<'EOSC' >>getfile
2452 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2453 fn=`echo $fn | sed 's/(.*)//'`
2459 loc_file=`expr $fn : '.*:\(.*\)'`
2460 fn=`expr $fn : '\(.*\):.*'`
2468 */*) fullpath=true;;
2477 *e*) exp_file=true;;
2480 *p*) nopath_ok=true;;
2485 *d*) type='Directory';;
2486 *l*) type='Locate';;
2491 Locate) what='File';;
2496 case "$d_portable" in
2504 while test "$type"; do
2509 true) rp="$rp (~name ok)";;
2512 if test -f UU/getfile.ok && \
2513 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2532 value=`UU/filexp $ans`
2535 if test "$ans" != "$value"; then
2536 echo "(That expands to $value on this system.)"
2550 /*) value="$ansexp" ;;
2555 echo "I shall only accept a full path name, as in /bin/ls." >&4
2556 echo "Use a ! shell escape if you wish to check pathnames." >&4
2559 echo "Please give a full path name, starting with slash." >&4
2562 echo "Note that using ~name is ok provided it expands well." >&4
2575 if test -f "$ansexp"; then
2577 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2579 echo "($value is not a plain file, but that's ok.)"
2584 if test -d "$ansexp"; then
2589 if test -d "$ansexp"; then
2590 echo "(Looking for $loc_file in directory $value.)"
2591 value="$value/$loc_file"
2592 ansexp="$ansexp/$loc_file"
2594 if test -f "$ansexp"; then
2597 case "$nopath_ok" in
2598 true) case "$value" in
2600 *) echo "Assuming $value will be in people's path."
2616 if test "$fastread" = yes; then
2621 rp="$what $value doesn't exist. Use that name anyway?"
2642 : determine root of directory hierarchy where package will be installed.
2645 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2653 By default, $package will be installed in $dflt/bin, manual
2654 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2655 all installation directories. Typically set to /usr/local, but you
2656 may choose /usr if you wish to install $package among your system
2657 binaries. If you wish to have binaries under /bin but manual pages
2658 under /usr/local/man, that's ok: you will be prompted separately
2659 for each of the installation directories, the prefix being only used
2660 to set the defaults.
2664 rp='Installation prefix to use?'
2672 *) oldprefix="$prefix";;
2679 : set the prefixit variable, to compute a suitable default value
2680 prefixit='case "$3" in
2682 case "$oldprefix" in
2683 "") eval "$1=\"\$$2\"";;
2690 ""|" ") eval "$1=\"\$$2\"";;
2696 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2698 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2699 /*-$oldprefix/*|\~*-$oldprefix/*)
2700 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2701 *) eval "$1=\"\$$2\"";;
2705 : determine where private library files go
2706 : Usual default is /usr/local/lib/perl5. Also allow things like
2707 : /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
2709 *perl*) set dflt privlib lib ;;
2710 *) set dflt privlib lib/$package ;;
2715 There are some auxiliary files for $package that need to be put into a
2716 private library directory that is accessible by everyone.
2720 rp='Pathname where the private library files will reside?'
2722 if $test "X$privlibexp" != "X$ansexp"; then
2726 privlibexp="$ansexp"
2730 Since you are running AFS, I need to distinguish the directory in which
2731 private files reside from the directory in which they are installed (and from
2732 which they are presumably copied to the former directory by occult means).
2735 case "$installprivlib" in
2736 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2737 *) dflt="$installprivlib";;
2740 rp='Where will private files be installed?'
2742 installprivlib="$ans"
2744 installprivlib="$privlibexp"
2747 : set the base revision
2750 : get the patchlevel
2752 echo "Getting the current patchlevel..." >&4
2753 if $test -r $rsrc/patchlevel.h;then
2754 patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
2755 subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
2760 $echo $n "(You have $package" $c
2763 *) $echo $n " $baserev" $c ;;
2765 $echo $n " patchlevel $patchlevel" $c
2766 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
2769 : set the prefixup variable, to restore leading tilda escape
2770 prefixup='case "$prefixexp" in
2772 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2775 : determine where public architecture dependent libraries go
2781 '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
2785 *) if test 0 -eq "$subversion"; then
2786 version=`LC_ALL=C; export LC_ALL; \
2787 echo $baserev $patchlevel | \
2788 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2790 version=`LC_ALL=C; export LC_ALL; \
2791 echo $baserev $patchlevel $subversion | \
2792 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
2794 dflt="$privlib/$archname/$version"
2804 $spackage contains architecture-dependent library files. If you are
2805 sharing libraries in a heterogeneous environment, you might store
2806 these files in a separate location. Otherwise, you can just include
2807 them with the rest of the public library files.
2811 rp='Where do you want to put the public architecture-dependent libraries?'
2814 archlibexp="$ansexp"
2819 Since you are running AFS, I need to distinguish the directory in
2820 which architecture-dependent library files reside from the directory
2821 in which they are installed (and from which they are presumably copied
2822 to the former directory by occult means).
2825 case "$installarchlib" in
2826 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2827 *) dflt="$installarchlib";;
2830 rp='Where will architecture-dependent library files be installed?'
2832 installarchlib="$ans"
2834 installarchlib="$archlibexp"
2836 if $test X"$archlib" = X"$privlib"; then
2842 : make some quick guesses about what we are up against
2844 $echo $n "Hmm... $c"
2854 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2855 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2857 echo "Looks kind of like an OSF/1 system, but we'll see..."
2859 elif test `echo abc | tr a-z A-Z` = Abc ; then
2860 xxx=`./loc addbib blurfl $pth`
2861 if $test -f $xxx; then
2862 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2866 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2867 echo "Looks kind of like an extended USG system, but we'll see..."
2869 echo "Looks kind of like a USG system, but we'll see..."
2873 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2874 echo "Looks kind of like a BSD system, but we'll see..."
2878 echo "Looks kind of like a Version 7 system, but we'll see..."
2881 case "$eunicefix" in
2884 There is, however, a strange, musty smell in the air that reminds me of
2885 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2889 : it so happens the Eunice I know will not run shell scripts in Unix format
2893 echo "Congratulations. You aren't running Eunice."
2897 : Detect OS2. The p_ variable is set above in the Head.U unit.
2902 I have the feeling something is not exactly right, however...don't tell me...
2903 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2908 if test -f /xenix; then
2909 echo "Actually, this looks more like a XENIX system..."
2914 echo "It's not Xenix..."
2919 if test -f /venix; then
2920 echo "Actually, this looks more like a VENIX system..."
2927 echo "Nor is it Venix..."
2930 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2931 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2934 : see if setuid scripts can be secure
2937 Some kernels have a bug that prevents setuid #! scripts from being
2938 secure. Some sites have disabled setuid #! scripts because of this.
2940 First let's decide if your kernel supports secure setuid #! scripts.
2941 (If setuid #! scripts would be secure but have been disabled anyway,
2942 don't say that they are secure if asked.)
2947 if $test -d /dev/fd; then
2948 echo "#!$ls" >reflect
2949 chmod +x,u+s reflect
2950 ./reflect >flect 2>&1
2951 if $contains "/dev/fd" flect >/dev/null; then
2952 echo "Congratulations, your kernel has secure setuid scripts!" >&4
2956 If you are not sure if they are secure, I can check but I'll need a
2957 username and password different from the one you are using right now.
2958 If you don't have such a username or don't want me to test, simply
2962 rp='Other username to test security of setuid scripts with?'
2967 case "$d_suidsafe" in
2968 '') echo "I'll assume setuid scripts are *not* secure." >&4
2971 echo "Well, the $hint value is *not* secure." >&4
2973 *) echo "Well, the $hint value *is* secure." >&4
2978 $rm -f reflect flect
2979 echo "#!$ls" >reflect
2980 chmod +x,u+s reflect
2983 echo '"su" will (probably) prompt you for '"$ans's password."
2984 su $ans -c './reflect >flect'
2985 if $contains "/dev/fd" flect >/dev/null; then
2986 echo "Okay, it looks like setuid scripts are secure." >&4
2989 echo "I don't think setuid scripts are secure." >&4
2994 rp='Does your kernel have *secure* setuid scripts?'
2997 [yY]*) val="$define";;
3002 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3003 echo "(That's for file descriptors, not floppy disks.)"
3009 $rm -f reflect flect
3011 : now see if they want to do setuid emulation
3014 case "$d_suidsafe" in
3017 echo "No need to emulate SUID scripts since they are secure here." >& 4
3021 Some systems have disabled setuid scripts, especially systems where
3022 setuid scripts cannot be secure. On systems where setuid scripts have
3023 been disabled, the setuid/setgid bits on scripts are currently
3024 useless. It is possible for $package to detect those bits and emulate
3025 setuid/setgid in a secure fashion. This emulation will only work if
3026 setuid scripts have been disabled in your kernel.
3030 "$define") dflt=y ;;
3033 rp="Do you want to do setuid/setgid emulation?"
3036 [yY]*) val="$define";;
3044 : determine where manual pages are on this system
3048 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3049 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3050 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3051 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3052 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3053 sysman=`./loc . /usr/man/man1 $syspath`
3056 if $test -d "$sysman"; then
3057 echo "System manual is in $sysman." >&4
3059 echo "Could not find manual pages in source form." >&4
3062 : see what memory models we can support
3065 $cat >pdp11.c <<'EOP'
3074 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3075 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3076 dflt='unsplit split'
3078 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3081 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3086 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3089 if $test -d /lib/large || $test -d /usr/lib/large; then
3092 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3101 Some systems have different model sizes. On most systems they are called
3102 small, medium, large, and huge. On the PDP11 they are called unsplit and
3103 split. If your system doesn't support different memory models, say "none".
3104 If you wish to force everything to one memory model, say "none" here and
3105 put the appropriate flags later when it asks you for other cc and ld flags.
3106 Venix systems may wish to put "none" and let the compiler figure things out.
3107 (In the following question multiple model names should be space separated.)
3109 The default for most systems is "none".
3112 rp="Which memory models are supported?"
3127 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3128 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3135 rp="What flag indicates separate I and D space?"
3143 *large*|*small*|*medium*|*huge*)
3150 rp="What flag indicates large model?"
3160 *huge*) case "$huge" in
3164 rp="What flag indicates huge model?"
3174 *medium*) case "$medium" in
3178 rp="What flag indicates medium model?"
3185 *) medium="$large";;
3188 *small*) case "$small" in
3192 rp="What flag indicates small model?"
3203 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3206 $rm -f pdp11.* pdp11
3208 : see if we need a special compiler
3216 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3217 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3231 On some older systems the default C compiler will not resolve multiple global
3232 references that happen to have the same name. On some such systems the "Mcc"
3233 command may be used to force these to be resolved. On other systems a "cc -M"
3234 command is required. (Note that the -M flag on other systems indicates a
3235 memory model to use!) If you have the Gnu C compiler, you might wish to use
3241 rp="Use which C compiler?"
3249 rp="Use which C compiler?"
3253 : Look for a hint-file generated 'call-back-unit'. Now that the
3254 : user has specified the compiler, we may need to set or change some
3256 if $test -f cc.cbu; then
3260 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3261 $cat >gccvers.c <<EOM
3266 printf("%s\n", __VERSION__);
3268 printf("%s\n", "1");
3274 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3275 gccversion=`./gccvers`
3276 case "$gccversion" in
3277 '') echo "You are not using GNU cc." ;;
3278 *) echo "You are using GNU cc $gccversion." ;;
3282 echo "*** WHOA THERE!!! ***" >&4
3283 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3284 case "$knowitall" in
3286 echo " You'd better start hunting for one and let me know about it." >&4
3292 case "$gccversion" in
3293 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3296 : What should the include directory be ?
3298 $echo $n "Hmm... $c"
3302 if $test -f /bin/mips && /bin/mips; then
3303 echo "Looks like a MIPS system..."
3304 $cat >usr.c <<'EOCP'
3305 #ifdef SYSTYPE_BSD43
3309 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3310 dflt='/bsd43/usr/include'
3314 mips_type='System V'
3316 $rm -f usr.c usr.out
3317 echo "and you're compiling with the $mips_type compiler and libraries."
3321 echo "Doesn't look like a MIPS system."
3331 case "$xxx_prompt" in
3334 rp='Where are the include files you want to use?'
3342 : see how we invoke the C preprocessor
3344 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3345 cat <<'EOT' >testcpp.c
3351 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3353 wrapper=`pwd`/cppstdin
3357 if $test "X$cppstdin" != "X" && \
3358 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3359 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3361 echo "You used to use $cppstdin $cppminus so we'll use that again."
3363 '') echo "But let's see if we can live without a wrapper..." ;;
3365 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3366 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3368 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3371 echo "(However, $cpprun $cpplast does not work, let's see...)"
3379 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3386 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3387 $cc -E <testcpp.c >testcpp.out 2>&1; \
3388 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3389 echo "Yup, it does."
3392 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3393 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3394 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3395 echo "Yup, it does."
3398 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3399 $cc -P <testcpp.c >testcpp.out 2>&1; \
3400 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3401 echo "Yipee, that works!"
3404 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3405 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3406 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3407 echo "At long last!"
3410 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3411 $cpp <testcpp.c >testcpp.out 2>&1; \
3412 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3416 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3417 $cpp - <testcpp.c >testcpp.out 2>&1; \
3418 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3419 echo "Hooray, it works! I was beginning to wonder."
3422 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3423 $wrapper <testcpp.c >testcpp.out 2>&1; \
3424 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3430 rp="No dice. I can't find a C preprocessor. Name one:"
3434 $x_cpp <testcpp.c >testcpp.out 2>&1
3435 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3436 echo "OK, that will do." >&4
3438 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3453 echo "Perhaps can we force $cc -E using a wrapper..."
3454 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3455 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3461 echo "Nope, we'll have to live without it..."
3476 *) $rm -f $wrapper;;
3478 $rm -f testcpp.c testcpp.out
3480 : Set private lib path
3483 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3488 '') dlist="$loclibpth $plibpth $glibpth";;
3489 *) dlist="$libpth";;
3492 : Now check and see which directories actually exist, avoiding duplicates
3496 if $test -d $xxx; then
3499 *) libpth="$libpth $xxx";;
3505 Some systems have incompatible or broken versions of libraries. Among
3506 the directories listed in the question below, please remove any you
3507 know not to be holding relevant libraries, and add any that are needed.
3508 Say "none" for none.
3519 rp="Directories to use for library searches?"
3526 : compute shared library extension
3529 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3539 On some systems, shared libraries may be available. Answer 'none' if
3540 you want to suppress searching of shared libraries for the remaining
3541 of this configuration.
3544 rp='What is the file extension used for shared libraries?'
3548 : Define several unixisms.
3549 : Hints files or command line option can be used to override them.
3550 : The convoluted testing is in case hints files set either the old
3553 '') case "$exe_ext" in
3555 *) _exe="$exe_ext" ;;
3560 '') case "$lib_ext" in
3567 '') case "$obj_ext" in
3574 '') case "$path_sep" in
3585 : Which makefile gets called first. This is used by make depend.
3586 case "$firstmakefile" in
3587 '') firstmakefile='makefile';;
3590 : Looking for optional libraries
3592 echo "Checking for optional libraries..." >&4
3597 case "$libswanted" in
3598 '') libswanted='c_s';;
3600 for thislib in $libswanted; do
3602 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
3603 echo "Found -l$thislib (shared)."
3606 *) dflt="$dflt -l$thislib";;
3608 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3609 echo "Found -l$thislib (shared)."
3612 *) dflt="$dflt -l$thislib";;
3614 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3615 echo "Found -l$thislib."
3618 *) dflt="$dflt -l$thislib";;
3620 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3621 echo "Found -l$thislib."
3624 *) dflt="$dflt -l$thislib";;
3626 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3627 echo "Found -l${thislib}_s."
3630 *) dflt="$dflt -l${thislib}_s";;
3632 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3633 echo "Found -l$thislib."
3636 *) dflt="$dflt -l$thislib";;
3639 echo "No -l$thislib."
3650 ' '|'') dflt='none';;
3655 Some versions of Unix support shared libraries, which make executables smaller
3656 but make load time slightly longer.
3658 On some systems, mostly System V Release 3's, the shared library is included
3659 by putting the option "-lc_s" as the last thing on the cc command line when
3660 linking. Other systems use shared libraries by default. There may be other
3661 libraries needed to compile $package on your machine as well. If your system
3662 needs the "-lc_s" option, include it here. Include any other special libraries
3663 here as well. Say "none" for none.
3667 rp="Any additional libraries?"
3674 : determine optimize, if desired, or use for debug flag also
3676 ' '|$undef) dflt='none';;
3678 *) dflt="$optimize";;
3682 Some C compilers have problems with their optimizers. By default, $package
3683 compiles with the -O flag to use the optimizer. Alternately, you might want
3684 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3685 systems). Either flag can be specified here. To use neither flag, specify
3689 rp="What optimizer/debugger flag should be used?"
3693 'none') optimize=" ";;
3697 : We will not override a previous value, but we might want to
3698 : augment a hint file
3701 case "$gccversion" in
3702 1*) dflt='-fpcc-struct-return' ;;
3705 *-g*) dflt="$dflt -DDEBUGGING";;
3707 case "$gccversion" in
3708 2*) if test -d /etc/conf/kconfig.d &&
3709 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3718 case "$mips_type" in
3719 *BSD*|'') inclwanted="$locincpth $usrinc";;
3720 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3722 for thisincl in $inclwanted; do
3723 if $test -d $thisincl; then
3724 if $test x$thisincl != x$usrinc; then
3727 *) dflt="$dflt -I$thisincl";;
3733 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3735 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3743 *) dflt="$dflt -D$2";;
3748 set signal.h __LANGUAGE_C__; eval $inctest
3750 set signal.h LANGUAGE_C; eval $inctest
3754 none|recommended) dflt="$ccflags $dflt" ;;
3755 *) dflt="$ccflags";;
3763 Your C compiler may want other flags. For this question you should include
3764 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3765 but you should NOT include libraries or ld flags like -lwhatever. If you
3766 want $package to honor its debug switch, you should include -DDEBUGGING here.
3767 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3769 To use no flags, specify the word "none".
3775 rp="Any additional cc flags?"
3782 : the following weeds options from ccflags that are of no interest to cpp
3784 case "$gccversion" in
3785 1*) cppflags="$cppflags -D__GNUC__"
3787 case "$mips_type" in
3789 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3795 echo "Let me guess what the preprocessor flags are..." >&4
3809 *) ftry="$previous $flag";;
3811 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3812 >cpp1.out 2>/dev/null && \
3813 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3814 >cpp2.out 2>/dev/null && \
3815 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3816 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3818 cppflags="$cppflags $ftry"
3828 *-*) echo "They appear to be: $cppflags";;
3830 $rm -f cpp.c cpp?.out
3834 : flags used in final linking phase
3836 '') if ./venix; then
3842 *-posix*) dflt="$dflt -posix" ;;
3845 *) dflt="$ldflags";;
3848 : Try to guess additional flags to pick up local libraries.
3849 for thislibdir in $libpth; do
3850 case " $loclibpth " in
3853 *"-L$thislibdir "*) ;;
3854 *) dflt="$dflt -L$thislibdir" ;;
3866 Your C linker may need flags. For this question you should
3867 include -L/whatever and any other flags used by the C linker, but you
3868 should NOT include libraries like -lwhatever.
3870 Make sure you include the appropriate -L/path flags if your C linker
3871 does not normally search all of the directories you specified above,
3874 To use no flags, specify the word "none".
3878 rp="Any additional ld flags (NOT including libraries)?"
3884 rmlist="$rmlist pdp11"
3888 echo "Checking your choice of C compiler and flags for coherency..." >&4
3889 set X $cc $optimize $ccflags $ldflags -o try try.c $libs
3892 I've tried to compile and run a simple program with:
3897 and I got the following output:
3900 $cat > try.c <<'EOF'
3902 main() { printf("Ok\n"); exit(0); }
3905 if sh -c "$cc $optimize $ccflags $ldflags -o try try.c $libs" >>try.msg 2>&1; then
3906 if sh -c './try' >>try.msg 2>&1; then
3910 *) echo 'The program compiled OK, but produced no output.' >> try.msg
3913 cat >> try.msg <<'EOQS'
3914 If $libs contains -lsfio, and sfio is mis-configured, then it
3915 sometimes (apparently) runs and exits with a 0 status, but with no
3916 output! It may have to do with sfio's use of _exit vs. exit.
3919 rp="You have a big problem. Shall I abort Configure"
3926 echo "The program compiled OK, but exited with status $?." >>try.msg
3927 rp="You have a problem. Shall I abort Configure"
3931 echo "I can't compile the test program." >>try.msg
3932 rp="You have a BIG problem. Shall I abort Configure"
3938 case "$knowitall" in
3940 echo "(The supplied flags might be incorrect with this C compiler.)"
3948 *) echo "Ok. Stopping Configure." >&4
3953 n) echo "OK, that should do.";;
3955 $rm -f try try.* core
3957 : Cruising for prototypes
3959 echo "Checking out function prototypes..." >&4
3960 $cat >prototype.c <<'EOCP'
3961 main(int argc, char *argv[]) {
3964 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
3965 echo "Your C compiler appears to support function prototypes."
3968 echo "Your C compiler doesn't seem to understand function prototypes."
3975 case "$prototype" in
3977 *) ansi2knr='ansi2knr'
3982 This version of $package can only be compiled by a compiler that
3983 understands function prototypes. Unfortunately, your C compiler
3985 doesn't seem to understand them. Sorry about that.
3987 If GNU cc is avaiable for your system, perhaps you could try that instead.
3989 Eventually, we hope to support building Perl with pre-ANSI compilers.
3990 If you would like to help in that effort, please contact <perlbug@perl.org>.
3992 Aborting Configure now.
3998 : determine where public executables go
4003 rp='Pathname where the public executables will reside?'
4005 if $test "X$ansexp" != "X$binexp"; then
4013 Since you are running AFS, I need to distinguish the directory in which
4014 executables reside from the directory in which they are installed (and from
4015 which they are presumably copied to the former directory by occult means).
4018 case "$installbin" in
4019 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4020 *) dflt="$installbin";;
4023 rp='Where will public executables be installed?'
4027 installbin="$binexp"
4030 : define a shorthand compile call
4034 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4035 : define a shorthand compile call for compilations that should be ok.
4039 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4042 echo "Checking for GNU C Library..." >&4
4043 cat >gnulibc.c <<EOM
4056 if eval $compile_ok && ./gnulibc; then
4058 echo "You are using the GNU C Library"
4061 echo "You are not using the GNU C Library"
4067 : see if nm is to be used to determine whether a symbol is defined or not
4071 case "$d_gnulibc" in
4074 echo "nm probably won't work on the GNU C Library." >&4
4080 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4082 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4083 echo "'nm' won't be sufficient on this sytem." >&4
4089 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4090 if $test $dflt -gt 20; then
4100 true|$define) dflt=y;;
4107 I can use $nm to extract the symbols from your C libraries. This
4108 is a time consuming task which may generate huge output on the disk (up
4109 to 3 megabytes) but that should make the symbols extraction faster. The
4110 alternative is to skip the 'nm' extraction part and to compile a small
4111 test program instead to determine whether each symbol is present. If
4112 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4113 this may be the best solution.
4115 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4118 rp="Shall I use $nm to extract C symbols from the libraries?"
4121 [Nn]*) usenm=false;;
4130 : nm options which may be necessary
4132 '') if $test -f /mach_boot; then
4134 elif $test -d /usr/ccs/lib; then
4135 nm_opt='-p' # Solaris (and SunOS?)
4136 elif $test -f /dgux; then
4138 elif $test -f /lib64/rld; then
4139 nm_opt='-p' # 64-bit Irix
4145 : nm options which may be necessary for shared libraries but illegal
4146 : for archive libraries. Thank you, Linux.
4147 case "$nm_so_opt" in
4148 '') case "$myuname" in
4150 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4151 nm_so_opt='--dynamic'
4160 : get list of predefined functions in a handy place
4165 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4172 *) for thislib in $libs; do
4175 : Handle C library specially below.
4178 thislib=`echo $thislib | $sed -e 's/^-l//'`
4179 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4181 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4183 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4185 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4187 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4189 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4191 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4196 libnames="$libnames $try"
4198 *) libnames="$libnames $thislib" ;;
4207 for xxx in $libpth; do
4208 $test -r $1 || set $xxx/libc.$so
4209 : The messy sed command sorts on library version numbers.
4211 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4212 tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
4214 s/[0-9][0-9]*/0000&/g
4215 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4218 sort | $sed -e 's/^.* //'`
4221 $test -r $1 || set /usr/ccs/lib/libc.$so
4222 $test -r $1 || set /lib/libsys_s$_a
4228 if $test -r "$1"; then
4229 echo "Your (shared) C library seems to be in $1."
4231 elif $test -r /lib/libc && $test -r /lib/clib; then
4232 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4234 libc='/lib/clib /lib/libc'
4235 if $test -r /lib/syslib; then
4236 echo "(Your math library is in /lib/syslib.)"
4237 libc="$libc /lib/syslib"
4239 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4240 echo "Your C library seems to be in $libc, as you said before."
4241 elif $test -r $incpath/usr/lib/libc$_a; then
4242 libc=$incpath/usr/lib/libc$_a;
4243 echo "Your C library seems to be in $libc. That's fine."
4244 elif $test -r /lib/libc$_a; then
4246 echo "Your C library seems to be in $libc. You're normal."
4248 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4250 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4251 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4252 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4254 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4256 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4259 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4261 if $test -r "$tans"; then
4262 echo "Your C library seems to be in $tans, of all places."
4268 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4272 If the guess above is wrong (which it might be if you're using a strange
4273 compiler, or your machine supports multiple models), you can override it here.
4278 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
4280 I can't seem to find your C library. I've looked in the following places:
4283 $sed 's/^/ /' libpath
4286 None of these seems to contain your C library. I need to get its name...
4291 rp='Where is your C library?'
4296 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
4297 set X `cat libnames`
4300 case $# in 1) xxx=file; esac
4301 echo "Extracting names from the following $xxx for later perusal:" >&4
4303 $sed 's/^/ /' libnames >&4
4305 $echo $n "This may take a while...$c" >&4
4309 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4310 *) $nm $nm_opt $file 2>/dev/null;;
4315 $grep fprintf libc.tmp > libc.ptf
4316 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4317 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4319 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4321 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4323 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4325 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4327 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4329 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4331 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4333 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4335 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4337 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4339 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4341 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4343 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4344 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4346 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4348 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4350 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4352 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4354 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4356 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4358 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4360 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4362 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4364 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4366 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4368 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4370 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4373 $nm -p $* 2>/dev/null >libc.tmp
4374 $grep fprintf libc.tmp > libc.ptf
4375 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4376 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4382 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4384 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4385 for thisname in $libnames $libc; do
4386 $ar t $thisname >>libc.tmp
4388 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4390 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4391 # Repeat libc to extract forwarders to DLL entries too
4392 for thisname in $libnames $libc; do
4393 $ar tv $thisname >>libc.tmp
4394 # Revision 50 of EMX has bug in $ar.
4395 # it will not extract forwarders to DLL entries
4396 # Use emximp which will extract exactly them.
4397 emximp -o tmp.imp $thisname \
4399 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4400 < tmp.imp >>libc.tmp
4403 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4406 echo "$ar didn't seem to work right." >&4
4407 echo "Maybe this is a Cray...trying bld instead..." >&4
4408 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4410 for thisname in $libnames; do
4412 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4413 $ar t $thisname >>libc.tmp
4417 echo "That didn't work either. Giving up." >&4
4424 if $test -f /lib/syscalls.exp; then
4426 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4427 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4431 $rm -f libnames libpath
4433 : determine filename position in cpp output
4435 echo "Computing filename position in cpp output for #include directives..." >&4
4436 echo '#include <stdio.h>' > foo.c
4439 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4440 $grep '^[ ]*#.*stdio\.h' | \
4441 while read cline; do
4444 while $test \$# -gt 0; do
4445 if $test -r \`echo \$1 | $tr -d '"'\`; then
4450 pos=\`expr \$pos + 1\`
4462 *) pos="${fieldn}th";;
4464 echo "Your cpp writes the filename in the $pos field of the line."
4466 : locate header file
4471 if test -f $usrinc/\$wanted; then
4472 echo "$usrinc/\$wanted"
4475 awkprg='{ print \$$fieldn }'
4476 echo "#include <\$wanted>" > foo\$\$.c
4477 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4478 $grep "^[ ]*#.*\$wanted" | \
4479 while read cline; do
4480 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4482 */\$wanted) echo "\$name"; exit 0;;
4493 : define an alternate in-header-list? function
4494 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4495 cont=true; xxf="echo \"<\$1> found.\" >&4";
4496 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4497 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4499 case $# in 4) instead=instead;; *) instead="at last";; esac;
4500 while $test "$cont"; do
4502 var=$2; eval "was=\$$2";
4503 if $test "$xxx" && $test -r "$xxx";
4505 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4508 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4509 set $yyy; shift; shift; yyy=$@;
4510 case $# in 0) cont="";;
4511 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4512 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4513 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4514 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4518 do set $yyy; var=$2; eval "was=\$$2";
4519 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4520 set $yyy; shift; shift; yyy=$@;
4523 : see if dld is available
4527 : is a C symbol defined?
4530 -v) tf=libc.tmp; tc=""; tdc="";;
4531 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4532 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4535 case "$reuseval-$4" in
4537 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4543 if $contains $tlook $tf >/dev/null 2>&1;
4548 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4549 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4557 $define) tval=true;;
4563 : define an is-in-libc? function
4564 inlibc='echo " "; td=$define; tu=$undef;
4565 sym=$1; var=$2; eval "was=\$$2";
4567 case "$reuseval$was" in
4577 echo "$sym() found." >&4;
4578 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4580 echo "$sym() NOT found." >&4;
4581 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4585 $define) echo "$sym() found." >&4;;
4586 *) echo "$sym() NOT found." >&4;;
4590 : see if dlopen exists
4597 : determine which dynamic loading, if any, to compile in
4599 dldir="ext/DynaLoader"
4612 $define) dflt='y' ;;
4615 $define) dflt='y' ;;
4617 : Does a dl_xxx.xs file exist for this operating system
4618 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
4621 rp="Do you wish to use dynamic loading?"
4628 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
4629 dflt="$dldir/dl_${osname}.xs"
4630 elif $test "$d_dlopen" = "$define" ; then
4631 dflt="$dldir/dl_dlopen.xs"
4632 elif $test "$i_dld" = "$define" ; then
4633 dflt="$dldir/dl_dld.xs"
4638 *) dflt="$dldir/$dlsrc"
4641 echo "The following dynamic loading files are available:"
4642 : Can not go over to $dldir because getfile has path hard-coded in.
4643 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
4644 rp="Source file to use for dynamic loading"
4646 # XXX This getfile call will fail the existence check if you try
4647 # building away from $src (this is not supported yet).
4651 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4655 Some systems may require passing special flags to $cc -c to
4656 compile modules that will be used to create a shared library.
4657 To use no flags, say "none".
4660 case "$cccdlflags" in
4661 '') case "$gccversion" in
4662 '') case "$osname" in
4664 next) dflt='none' ;;
4665 irix*) dflt='-KPIC' ;;
4666 svr4*|esix*|solaris)
4668 *-DDEBUGGING*) dflt='-KPIC' ;;
4672 sunos) dflt='-pic' ;;
4676 *) case "$osname" in
4677 svr4*|esix*|solaris)
4679 *-DDEBUGGING*) dflt='-fPIC' ;;
4686 *) dflt="$cccdlflags" ;;
4688 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4691 none) cccdlflags=' ' ;;
4692 *) cccdlflags="$ans" ;;
4697 Some systems use ld to create libraries that can be dynamically loaded,
4698 while other systems (such as those using ELF) use $cc.
4702 '') $cat >try.c <<'EOM'
4703 /* Test for whether ELF binaries are produced */
4708 int i = open("a.out",O_RDONLY);
4711 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
4712 exit(0); /* succeed (yes, it's ELF) */
4717 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
4719 You appear to have ELF support. I'll use $cc to build dynamic libraries.
4723 echo "I'll use ld to build dynamic libraries."
4732 rp="What command should be used to create dynamic libraries?"
4738 Some systems may require passing special flags to $ld to create a
4739 library that can be dynamically loaded. If your ld flags include
4740 -L/other/path options to locate libraries outside your loader's normal
4741 search path, you may need to specify those -L options here as well. To
4742 use no flags, say "none".
4745 case "$lddlflags" in
4746 '') case "$osname" in
4748 linux|irix*) dflt='-shared' ;;
4749 next) dflt='none' ;;
4750 solaris) dflt='-G' ;;
4751 sunos) dflt='-assert nodefinitions' ;;
4752 svr4*|esix*) dflt="-G $ldflags" ;;
4756 *) dflt="$lddlflags" ;;
4759 : Try to guess additional flags to pick up local libraries.
4760 for thisflag in $ldflags; do
4765 *) dflt="$dflt $thisflag" ;;
4775 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
4778 none) lddlflags=' ' ;;
4779 *) lddlflags="$ans" ;;
4784 Some systems may require passing special flags to $cc to indicate that
4785 the resulting executable will use dynamic linking. To use no flags,
4789 case "$ccdlflags" in
4790 '') case "$osname" in
4791 hpux) dflt='-Wl,-E' ;;
4792 linux) dflt='-rdynamic' ;;
4793 next) dflt='none' ;;
4794 sunos) dflt='none' ;;
4797 *) dflt="$ccdlflags" ;;
4799 rp="Any special flags to pass to $cc to use dynamic loading?"
4802 none) ccdlflags=' ' ;;
4803 *) ccdlflags="$ans" ;;
4817 # No dynamic loading being used, so don't bother even to prompt.
4820 *) case "$useshrplib" in
4821 '') case "$osname" in
4822 svr4*|dgux|dynixptx|esix|powerux)
4824 also='Building a shared libperl is required for dynamic loading to work on your system.'
4829 also='Building a shared libperl is needed for MAB support.'
4847 The perl executable is normally obtained by linking perlmain.c with
4848 libperl${_a}, any static extensions (usually just DynaLoader), and
4849 any other libraries needed on this system (such as -lm, etc.). Since
4850 your system supports dynamic loading, it is probably possible to build
4851 a shared libperl.$so. If you will have more than one executable linked
4852 to libperl.$so, this will significantly reduce the size of each
4853 executable, but it may have a noticeable affect on performance. The
4854 default is probably sensible for your system.
4858 rp="Build a shared libperl.$so (y/n)"
4863 # Why does next4 have to be so different?
4864 case "${osname}${osvers}" in
4865 next4*) xxx='DYLD_LIBRARY_PATH' ;;
4866 os2*) xxx='' ;; # Nothing special needed.
4867 *) xxx='LD_LIBRARY_PATH' ;;
4869 if test X"$xxx" != "X"; then
4870 $cat <<EOM | $tee -a ../config.msg >&4
4872 To build perl, you must add the current working directory to your
4873 $xxx environment variable before running make. You can do
4875 $xxx=\`pwd\`; export $xxx
4876 for Bourne-style shells, or
4878 for Csh-style shells. You *MUST* do this before running make.
4883 *) useshrplib='false' ;;
4888 case "$useshrplib" in
4892 # Figure out a good name for libperl.so. Since it gets stored in
4893 # a version-specific architecture-dependent library, the version
4894 # number isn't really that important, except for making cc/ld happy.
4896 # A name such as libperl.so.3.1
4897 majmin="libperl.$so.$patchlevel.$subversion"
4898 # A name such as libperl.so.301
4899 majonly=`echo $patchlevel $subversion |
4900 $awk '{printf "%d%02d", $1, $2}'`
4901 majonly=libperl.$so.$majonly
4902 # I'd prefer to keep the os-specific stuff here to a minimum, and
4903 # rely on figuring it out from the naming of libc.
4904 case "${osname}${osvers}" in
4907 # XXX How handle the --version stuff for MAB?
4909 linux*) # ld won't link with a bare -lperl otherwise.
4912 *) # Try to guess based on whether libc has major.minor.
4914 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
4915 *libc.$so.[0-9]*) dflt=$majonly ;;
4916 *) dflt=libperl.$so ;;
4926 I need to select a good name for the shared libperl. If your system uses
4927 library names with major and minor numbers, then you might want something
4928 like $majmin. Alternatively, if your system uses a single version
4929 number for shared libraries, then you might want to use $majonly.
4930 Or, your system might be quite happy with a simple libperl.$so.
4932 Since the shared libperl will get installed into a version-specific
4933 architecture-dependent directory, the version number of the shared perl
4934 library probably isn't important, so the default should be o.k.
4937 rp='What name do you want to give to the shared libperl?'
4940 echo "Ok, I'll use $libperl"
4943 libperl="libperl${_a}"
4947 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
4951 WARNING: Use of the shrpdir variable for the installation location of
4952 the shared $libperl is not supported. It was never documented and
4953 will not work in this version. Let me (doughera@lafcol.lafayette.edu)
4954 know of any problems this may cause.
4960 But your current setting of $shrpdir is
4961 the default anyway, so it's harmless.
4966 Further, your current attempted setting of $shrpdir
4967 conflicts with the value of $archlibexp/CORE
4968 that installperl will use.
4975 # How will the perl executable find the installed shared $libperl?
4976 # Add $xxx to ccdlflags.
4977 # If we can't figure out a command-line option, use $shrpenv to
4978 # set env LD_RUN_PATH. The main perl makefile uses this.
4979 shrpdir=$archlibexp/CORE
4982 if "$useshrplib"; then
4985 # We'll set it in Makefile.SH...
4991 xxx="-Wl,-R$shrpdir"
4993 linux|irix*|dec_osf)
4994 xxx="-Wl,-rpath,$shrpdir"
4997 # next doesn't like the default...
5000 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5006 # Only add $xxx if it isn't already in ccdlflags.
5007 case " $ccdlflags " in
5009 *) ccdlflags="$ccdlflags $xxx"
5012 Adding $xxx to the flags
5013 passed to $ld so that the perl executable will find the
5014 installed shared $libperl.
5022 # Respect a hint or command-line value.
5024 '') shrpenv="$tmp_shrpenv" ;;
5027 : determine where manual pages go
5028 set man1dir man1dir none
5032 $spackage has manual pages available in source form.
5036 echo "However, you don't have nroff, so they're probably useless to you."
5038 '') man1dir="none";;
5041 echo "If you don't want the manual sources installed, answer 'none'."
5046 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5047 lookpath="$lookpath $prefixexp/man/p_man/man1"
5048 lookpath="$lookpath $prefixexp/man/u_man/man1"
5049 lookpath="$lookpath $prefixexp/man/man.1"
5051 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5052 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5062 rp="Where do the main $spackage manual pages (source) go?"
5064 if $test "X$man1direxp" != "X$ansexp"; then
5068 man1direxp="$ansexp"
5076 Since you are running AFS, I need to distinguish the directory in which
5077 manual pages reside from the directory in which they are installed (and from
5078 which they are presumably copied to the former directory by occult means).
5081 case "$installman1dir" in
5082 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5083 *) dflt="$installman1dir";;
5086 rp='Where will man pages be installed?'
5088 installman1dir="$ans"
5090 installman1dir="$man1direxp"
5093 : What suffix to use on installed man pages
5100 rp="What suffix should be used for the main $spackage man pages?"
5102 '') case "$man1dir" in
5116 *) dflt="$man1ext";;
5123 : see if we can have long filenames
5125 rmlist="$rmlist /tmp/cf$$"
5126 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5127 first=123456789abcdef
5128 second=/tmp/cf$$/$first
5129 $rm -f $first $second
5130 if (echo hi >$first) 2>/dev/null; then
5131 if $test -f 123456789abcde; then
5132 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5135 if (echo hi >$second) 2>/dev/null; then
5136 if $test -f /tmp/cf$$/123456789abcde; then
5138 That's peculiar... You can have filenames longer than 14 characters, but only
5139 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5140 I shall consider your system cannot support long filenames at all.
5144 echo 'You can have filenames longer than 14 characters.' >&4
5149 How confusing! Some of your filesystems are sane enough to allow filenames
5150 longer than 14 characters but some others like /tmp can't even think about them.
5151 So, for now on, I shall assume your kernel does not allow them at all.
5158 You can't have filenames longer than 14 chars. You can't even think about them!
5164 $rm -rf /tmp/cf$$ 123456789abcde*
5166 : determine where library module manual pages go
5167 set man3dir man3dir none
5171 $spackage has manual pages for many of the library modules.
5177 However, you don't have nroff, so they're probably useless to you.
5180 '') man3dir="none";;
5184 case "$d_flexfnam" in
5187 However, your system can't handle the long file names like File::Basename.3.
5190 '') man3dir="none";;
5194 echo "If you don't want the manual sources installed, answer 'none'."
5195 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5197 '') case "$prefix" in
5198 *$prog*) dflt=`echo $man1dir |
5199 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5200 *) dflt="$privlib/man/man3" ;;
5204 *) dflt="$man3dir" ;;
5209 rp="Where do the $package library man pages (source) go?"
5211 if test "X$man3direxp" != "X$ansexp"; then
5216 man3direxp="$ansexp"
5224 Since you are running AFS, I need to distinguish the directory in which
5225 manual pages reside from the directory in which they are installed (and from
5226 which they are presumably copied to the former directory by occult means).
5229 case "$installman3dir" in
5230 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5231 *) dflt="$installman3dir";;
5234 rp='Where will man pages be installed?'
5236 installman3dir="$ans"
5238 installman3dir="$man3direxp"
5241 : What suffix to use on installed man pages
5248 rp="What suffix should be used for the $package library man pages?"
5250 '') case "$man3dir" in
5264 *) dflt="$man3ext";;
5271 : see if we have to deal with yellow pages, now NIS.
5272 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5273 if $test -f /usr/etc/nibindd; then
5275 echo "I'm fairly confident you're on a NeXT."
5277 rp='Do you get the hosts file via NetInfo?'
5286 y*) hostcat='nidump hosts .';;
5287 *) case "$hostcat" in
5288 nidump*) hostcat='';;
5298 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5306 rp='Are you getting the hosts file via yellow pages?'
5309 y*) hostcat='ypcat hosts';;
5310 *) hostcat='cat /etc/hosts';;
5316 '') hostcat='cat /etc/hosts';;
5319 '') groupcat='cat /etc/group';;
5322 '') passcat='cat /etc/passwd';;
5325 : now get the host name
5327 echo "Figuring out host name..." >&4
5328 case "$myhostname" in
5330 echo 'Maybe "hostname" will work...'
5331 if tans=`sh -c hostname 2>&1` ; then
5339 if $test "$cont"; then
5341 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5342 if tans=`cat /etc/systemid 2>&1` ; then
5344 phostname='cat /etc/systemid'
5345 echo "Whadyaknow. Xenix always was a bit strange..."
5348 elif $test -r /etc/systemid; then
5349 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5352 if $test "$cont"; then
5353 echo 'No, maybe "uuname -l" will work...'
5354 if tans=`sh -c 'uuname -l' 2>&1` ; then
5356 phostname='uuname -l'
5358 echo 'Strange. Maybe "uname -n" will work...'
5359 if tans=`sh -c 'uname -n' 2>&1` ; then
5361 phostname='uname -n'
5363 echo 'Oh well, maybe I can mine it out of whoami.h...'
5364 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5365 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5366 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5368 case "$myhostname" in
5369 '') echo "Does this machine have an identity crisis or something?"
5372 echo "Well, you said $myhostname before..."
5373 phostname='echo $myhostname';;
5379 : you do not want to know about this
5384 if $test "$myhostname" ; then
5386 rp='Your host name appears to be "'$myhostname'".'" Right?"
5394 : bad guess or no guess
5395 while $test "X$myhostname" = X ; do
5397 rp="Please type the (one word) name of your host:"
5402 : translate upper to lower if necessary
5403 case "$myhostname" in
5405 echo "(Normalizing case in your host name)"
5406 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5410 case "$myhostname" in
5412 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5413 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5414 echo "(Trimming domain name from host name--host name is now $myhostname)"
5416 *) case "$mydomain" in
5419 test "X$hostcat" = "Xypcat hosts" &&
5420 ypmatch "$myhostname" hosts 2>/dev/null |\
5421 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5424 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5425 /[ ]$myhostname[ . ]/p" > hosts
5428 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5429 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5430 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5431 hosts | $sort | $uniq | \
5432 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5433 case `$echo X$dflt` in
5434 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5437 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5442 tans=`./loc resolv.conf X /etc /usr/etc`
5443 if $test -f "$tans"; then
5444 echo "(Attempting domain name extraction from $tans)"
5445 dflt=.`$sed -n -e 's/ / /g' \
5446 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5447 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5449 .) dflt=.`$sed -n -e 's/ / /g' \
5450 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5451 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5458 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5459 dflt=.`sh -c domainname 2>/dev/null`
5462 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5467 .) echo "(Lost all hope -- silly guess then)"
5473 *) dflt="$mydomain";;
5477 rp="What is your domain name?"
5487 : translate upper to lower if necessary
5490 echo "(Normalizing case in your domain name)"
5491 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5495 : a little sanity check here
5496 case "$phostname" in
5499 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5500 $myhostname$mydomain|$myhostname) ;;
5502 case "$phostname" in
5504 echo "(That doesn't agree with your whoami.h file, by the way.)"
5507 echo "(That doesn't agree with your $phostname command, by the way.)"
5517 I need to get your e-mail address in Internet format if possible, i.e.
5518 something like user@host.domain. Please answer accurately since I have
5519 no easy means to double check it. The default value provided below
5520 is most probably close to the reality but may not be valid from outside
5521 your organization...
5525 while test "$cont"; do
5527 '') dflt="$cf_by@$myhostname$mydomain";;
5528 *) dflt="$cf_email";;
5530 rp='What is your e-mail address?'
5536 rp='Address does not look like an Internet one. Use it anyway?'
5552 If you or somebody else will be maintaining perl at your site, please
5553 fill in the correct e-mail address here so that they may be contacted
5554 if necessary. Currently, the "perlbug" program included with perl
5555 will send mail to this address in addition to perlbug@perl.com. You may
5556 enter "none" for no administrator.
5559 case "$perladmin" in
5560 '') dflt="$cf_email";;
5561 *) dflt="$perladmin";;
5563 rp='Perl administrator e-mail address'
5567 : figure out how to guarantee perl startup
5568 case "$startperl" in
5570 case "$sharpbang" in
5574 I can use the #! construct to start perl on your system. This will
5575 make startup of perl scripts faster, but may cause problems if you
5576 want to share those scripts and perl is not in a standard place
5577 ($binexp/perl) on all your platforms. The alternative is to force
5578 a shell by starting the script with a single ':' character.
5582 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
5585 none) startperl=": # use perl";;
5586 *) startperl="#!$ans"
5587 if $test 30 -lt `echo "$ans" | wc -c`; then
5590 WARNING: Some systems limit the #! command to 32 characters.
5591 If you experience difficulty running Perl scripts with #!, try
5592 installing Perl in a directory with a shorter pathname.
5598 *) startperl=": # use perl"
5603 echo "I'll use $startperl to start perl scripts."
5605 : figure best path for perl in scripts
5608 perlpath="$binexp/perl"
5609 case "$startperl" in
5614 I will use the "eval 'exec'" idiom to start Perl on your system.
5615 I can use the full path of your Perl binary for this purpose, but
5616 doing so may cause problems if you want to share those scripts and
5617 Perl is not always in a standard place ($binexp/perl).
5621 rp="What path shall I use in \"eval 'exec'\"?"
5628 case "$startperl" in
5630 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
5633 : determine where public executable scripts go
5634 set scriptdir scriptdir
5636 case "$scriptdir" in
5639 : guess some guesses
5640 $test -d /usr/share/scripts && dflt=/usr/share/scripts
5641 $test -d /usr/share/bin && dflt=/usr/share/bin
5642 $test -d /usr/local/script && dflt=/usr/local/script
5643 $test -d $prefixexp/script && dflt=$prefixexp/script
5647 *) dflt="$scriptdir"
5652 Some installations have a separate directory just for executable scripts so
5653 that they can mount it across multiple architectures but keep the scripts in
5654 one spot. You might, for example, have a subdirectory of /usr/share for this.
5655 Or you might just lump your scripts in with all your other executables.
5659 rp='Where do you keep publicly executable scripts?'
5661 if $test "X$ansexp" != "X$scriptdirexp"; then
5665 scriptdirexp="$ansexp"
5669 Since you are running AFS, I need to distinguish the directory in which
5670 scripts reside from the directory in which they are installed (and from
5671 which they are presumably copied to the former directory by occult means).
5674 case "$installscript" in
5675 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
5676 *) dflt="$installscript";;
5679 rp='Where will public scripts be installed?'
5681 installscript="$ans"
5683 installscript="$scriptdirexp"
5686 : determine where site specific libraries go.
5691 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5692 dflt="$privlib/site_$prog" ;;
5693 *) dflt="$sitelib" ;;
5697 The installation process will also create a directory for
5698 site-specific extensions and modules. Some users find it convenient
5699 to place all local files in this directory rather than in the main
5700 distribution directory.
5704 rp='Pathname for the site-specific library files?'
5706 if $test "X$sitelibexp" != "X$ansexp"; then
5710 sitelibexp="$ansexp"
5714 Since you are running AFS, I need to distinguish the directory in
5715 which site-specific files reside from the directory in which they are
5716 installed (and from which they are presumably copied to the former
5717 directory by occult means).
5720 case "$installsitelib" in
5721 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
5722 *) dflt="$installsitelib";;
5725 rp='Where will site-specific files be installed?'
5727 installsitelib="$ans"
5729 installsitelib="$sitelibexp"
5732 : determine where site specific architecture-dependent libraries go.
5733 xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'`
5734 : xxx is usuually lib/site_perl/archname.
5735 set sitearch sitearch none
5738 '') dflt="$sitelib/$archname" ;;
5739 *) dflt="$sitearch" ;;
5743 The installation process will also create a directory for
5744 architecture-dependent site-specific extensions and modules.
5748 rp='Pathname for the site-specific architecture-dependent library files?'
5750 if $test "X$sitearchexp" != "X$ansexp"; then
5754 sitearchexp="$ansexp"
5758 Since you are running AFS, I need to distinguish the directory in
5759 which site-specific architecture-dependent library files reside from
5760 the directory in which they are installed (and from which they are
5761 presumably copied to the former directory by occult means).
5764 case "$installsitearch" in
5765 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
5766 *) dflt="$installsitearch";;
5769 rp='Where will site-specific architecture-dependent files be installed?'
5771 installsitearch="$ans"
5773 installsitearch="$sitearchexp"
5778 Previous version of $package used the standard IO mechanisms as defined
5779 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
5780 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
5781 the default. This abstraction layer can use AT&T's sfio (if you already
5782 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
5783 problems with some extension modules. Using PerlIO with stdio is safe,
5784 but it is slower than plain stdio and therefore is not the default.
5786 If this doesn't make any sense to you, just accept the default 'n'.
5788 case "$useperlio" in
5789 $define|true|[yY]*) dflt='y';;
5792 rp='Use the experimental PerlIO abstraction layer?'
5799 echo "Ok, doing things the stdio way"
5806 : Check how to convert floats to strings.
5808 echo "Checking for an efficient way to convert floats to strings."
5811 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
5812 char *myname = "gconvert";
5815 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
5816 char *myname = "gcvt";
5819 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
5820 char *myname = "sprintf";
5826 checkit(expect, got)
5830 if (strcmp(expect, got)) {
5831 printf("%s oddity: Expected %s, got %s\n",
5832 myname, expect, got);
5843 /* This must be 1st test on (which?) platform */
5844 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
5845 Gconvert(0.1, 8, 0, buf);
5846 checkit("0.1", buf);
5848 Gconvert(1.0, 8, 0, buf);
5851 Gconvert(0.0, 8, 0, buf);
5854 Gconvert(-1.0, 8, 0, buf);
5857 /* Some Linux gcvt's give 1.e+5 here. */
5858 Gconvert(100000.0, 8, 0, buf);
5859 checkit("100000", buf);
5861 /* Some Linux gcvt's give -1.e+5 here. */
5862 Gconvert(-100000.0, 8, 0, buf);
5863 checkit("-100000", buf);
5868 case "$d_Gconvert" in
5869 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
5870 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
5871 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
5872 *) xxx_list='gconvert gcvt sprintf' ;;
5875 for xxx_convert in $xxx_list; do
5876 echo "Trying $xxx_convert"
5878 set try -DTRY_$xxx_convert
5879 if eval $compile; then
5880 echo "$xxx_convert" found. >&4
5882 echo "I'll use $xxx_convert to convert floats into a string." >&4
5885 echo "...But $xxx_convert didn't work as I expected."
5888 echo "$xxx_convert NOT found." >&4
5892 case "$xxx_convert" in
5893 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
5894 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
5895 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
5898 : Initialize h_fcntl
5901 : Initialize h_sysfile
5904 : access call always available on UNIX
5908 : locate the flags for 'access()'
5912 $cat >access.c <<'EOCP'
5913 #include <sys/types.h>
5918 #include <sys/file.h>
5927 : check sys/file.h first, no particular reason here
5928 if $test `./findhdr sys/file.h` && \
5929 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
5931 echo "<sys/file.h> defines the *_OK access constants." >&4
5932 elif $test `./findhdr fcntl.h` && \
5933 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
5935 echo "<fcntl.h> defines the *_OK access constants." >&4
5936 elif $test `./findhdr unistd.h` && \
5937 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
5938 echo "<unistd.h> defines the *_OK access constants." >&4
5940 echo "I can't find the four *_OK access constants--I'll use mine." >&4
5946 : see if alarm exists
5950 : Look for GNU-cc style attribute checking
5952 echo "Checking whether your compiler can handle __attribute__ ..." >&4
5953 $cat >attrib.c <<'EOCP'
5955 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
5957 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
5958 if $contains 'warning' attrib.out >/dev/null 2>&1; then
5959 echo "Your C compiler doesn't fully support __attribute__."
5962 echo "Your C compiler supports __attribute__."
5966 echo "Your C compiler doesn't seem to understand __attribute__ at all."
5973 : see if bcmp exists
5977 : see if bcopy exists
5981 : see if this is a unistd.h system
5982 set unistd.h i_unistd
5985 : see if getpgrp exists
5986 set getpgrp d_getpgrp
5989 case "$d_getpgrp" in
5992 echo "Checking to see which flavor of getpgrp is in use..."
5995 #include <sys/types.h>
5997 # include <unistd.h>
6001 if (getuid() == 0) {
6002 printf("(I see you are running Configure as super-user...)\n");
6006 if (getpgrp(1) == 0)
6015 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6016 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6018 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6019 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6022 echo "I can't seem to compile and run the test program."
6024 xxx="a USG one, i.e. you use getpgrp()."
6026 # SVR4 systems can appear rather BSD-ish.
6029 xxx="a BSD one, i.e. you use getpgrp(pid)."
6033 xxx="probably a USG one, i.e. you use getpgrp()."
6038 echo "Assuming your getpgrp is $xxx" >&4
6047 : see if setpgrp exists
6048 set setpgrp d_setpgrp
6051 case "$d_setpgrp" in
6054 echo "Checking to see which flavor of setpgrp is in use..."
6057 #include <sys/types.h>
6059 # include <unistd.h>
6063 if (getuid() == 0) {
6064 printf("(I see you are running Configure as super-user...)\n");
6068 if (-1 == setpgrp(1, 1))
6071 if (setpgrp() != -1)
6077 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6078 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6080 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6081 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6084 echo "(I can't seem to compile and run the test program.)"
6086 xxx="a USG one, i.e. you use setpgrp()."
6088 # SVR4 systems can appear rather BSD-ish.
6091 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6095 xxx="probably a USG one, i.e. you use setpgrp()."
6100 echo "Assuming your setpgrp is $xxx" >&4
6108 : see if bzero exists
6112 : check for lengths of integral types
6116 echo "Checking to see how big your integers are..." >&4
6117 $cat >intsize.c <<'EOCP'
6121 printf("intsize=%d;\n", sizeof(int));
6122 printf("longsize=%d;\n", sizeof(long));
6123 printf("shortsize=%d;\n", sizeof(short));
6128 if eval $compile_ok && ./intsize > /dev/null; then
6130 echo "Your integers are $intsize bytes long."
6131 echo "Your long integers are $longsize bytes long."
6132 echo "Your short integers are $shortsize bytes long."
6136 Help! I can't compile and run the intsize test program: please enlighten me!
6137 (This is probably a misconfiguration in your system or libraries, and
6138 you really ought to fix it. Still, I'll try anyway.)
6142 rp="What is the size of an integer (in bytes)?"
6146 rp="What is the size of a long integer (in bytes)?"
6150 rp="What is the size of a short integer (in bytes)?"
6156 $rm -f intsize intsize.*
6158 : see if signal is declared as pointer to function returning int or void
6160 xxx=`./findhdr signal.h`
6161 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6162 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6163 echo "You have int (*signal())() instead of void." >&4
6165 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6166 echo "You have void (*signal())()." >&4
6168 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6169 echo "You have int (*signal())() instead of void." >&4
6171 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6172 echo "You have void (*signal())()." >&4
6175 case "$d_voidsig" in
6177 echo "I can't determine whether signal handler returns void or int..." >&4
6179 rp="What type does your signal handler return?"
6186 echo "As you already told me, signal handler returns void." >&4
6189 *) echo "As you already told me, signal handler returns int." >&4
6196 case "$d_voidsig" in
6197 "$define") signal_t="void";;
6202 : check for ability to cast large floats to 32-bit ints.
6204 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6205 if $test "$intsize" -ge 4; then
6212 #include <sys/types.h>
6214 $signal_t blech(s) int s; { exit(3); }
6221 signal(SIGFPE, blech);
6223 /* Don't let compiler optimize the test away. Store the number
6224 in a writable string for gcc to pass to sscanf under HP/UX.
6226 sprintf(str, "2147483647");
6227 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6231 /* x86 processors will probably give 0x8000 0000, which is a
6232 sign change. We don't want that. We want to mimic SPARC
6233 behavior here, which is to preserve the sign and give
6236 if (i32 != ($xxx) f)
6242 if eval $compile_ok; then
6246 echo "(I can't seem to compile the test program--assuming it can't)"
6254 echo "Nope, it can't."
6261 : check for ability to cast negative floats to unsigned
6263 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6266 #include <sys/types.h>
6268 $signal_t blech(s) int s; { exit(7); }
6269 $signal_t blech_in_list(s) int s; { exit(4); }
6270 unsigned long dummy_long(p) unsigned long p; { return p; }
6271 unsigned int dummy_int(p) unsigned int p; { return p; }
6272 unsigned short dummy_short(p) unsigned short p; { return p; }
6276 unsigned long along;
6278 unsigned short ashort;
6282 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6283 a direct f = -123. assignment. gcc-2.8.0 reportedly
6284 optimized the whole file away
6286 /* Store the number in a writable string for gcc to pass to
6289 sprintf(str, "-123");
6290 sscanf(str, "%lf", &f); /* f = -123.; */
6292 signal(SIGFPE, blech);
6293 along = (unsigned long)f;
6294 aint = (unsigned int)f;
6295 ashort = (unsigned short)f;
6296 if (along != (unsigned long)-123)
6298 if (aint != (unsigned int)-123)
6300 if (ashort != (unsigned short)-123)
6302 sprintf(str, "1073741824.");
6303 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6306 along = (unsigned long)f;
6307 if (along != 0x80000000)
6311 along = (unsigned long)f;
6312 if (along != 0x7fffffff)
6316 along = (unsigned long)f;
6317 if (along != 0x80000001)
6321 signal(SIGFPE, blech_in_list);
6322 sprintf(str, "123.");
6323 sscanf(str, "%lf", &f); /* f = 123.; */
6324 along = dummy_long((unsigned long)f);
6325 aint = dummy_int((unsigned int)f);
6326 ashort = dummy_short((unsigned short)f);
6327 if (along != (unsigned long)123)
6329 if (aint != (unsigned int)123)
6331 if (ashort != (unsigned short)123)
6338 if eval $compile_ok; then
6342 echo "(I can't seem to compile the test program--assuming it can't)"
6345 case "$castflags" in
6350 echo "Nope, it can't."
6357 : see if vprintf exists
6359 if set vprintf val -f d_vprintf; eval $csym; $val; then
6360 echo 'vprintf() found.' >&4
6362 $cat >vprintf.c <<'EOF'
6363 #include <varargs.h>
6365 main() { xxx("foo"); }
6374 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6378 if eval $compile && ./vprintf; then
6379 echo "Your vsprintf() returns (int)." >&4
6382 echo "Your vsprintf() returns (char*)." >&4
6386 echo 'vprintf() NOT found.' >&4
6396 : see if chown exists
6400 : see if chroot exists
6404 : see if chsize exists
6408 : check for const keyword
6410 echo 'Checking to see if your C compiler knows about "const"...' >&4
6411 $cat >const.c <<'EOCP'
6412 typedef struct spug { int drokk; } spug;
6419 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
6421 echo "Yup, it does."
6424 echo "Nope, it doesn't."
6429 : see if crypt exists
6431 if set crypt val -f d_crypt; eval $csym; $val; then
6432 echo 'crypt() found.' >&4
6436 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
6437 if $test -z "$cryptlib"; then
6438 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
6442 if $test -z "$cryptlib"; then
6443 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
6447 if $test -z "$cryptlib"; then
6448 cryptlib=`./loc libcrypt$_a "" $libpth`
6452 if $test -z "$cryptlib"; then
6453 echo 'crypt() NOT found.' >&4
6462 : see if cuserid exists
6463 set cuserid d_cuserid
6466 : see if this is a limits.h system
6467 set limits.h i_limits
6470 : see if this is a float.h system
6474 : See if number of significant digits in a double precision number is known
6476 $cat >dbl_dig.c <<EOM
6486 printf("Contains DBL_DIG");
6489 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
6490 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
6491 echo "DBL_DIG found." >&4
6494 echo "DBL_DIG NOT found." >&4
6501 : see if difftime exists
6502 set difftime d_difftime
6505 : see if this is a dirent system
6507 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
6509 echo "<dirent.h> found." >&4
6512 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
6513 echo "<sys/dir.h> found." >&4
6516 xinc=`./findhdr sys/ndir.h`
6518 echo "<dirent.h> NOT found." >&4
6523 : Look for type of directory structure.
6525 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6527 case "$direntrytype" in
6530 $define) guess1='struct dirent' ;;
6531 *) guess1='struct direct' ;;
6534 *) guess1="$direntrytype"
6539 'struct dirent') guess2='struct direct' ;;
6540 *) guess2='struct dirent' ;;
6543 if $contains "$guess1" try.c >/dev/null 2>&1; then
6544 direntrytype="$guess1"
6545 echo "Your directory entries are $direntrytype." >&4
6546 elif $contains "$guess2" try.c >/dev/null 2>&1; then
6547 direntrytype="$guess2"
6548 echo "Your directory entries seem to be $direntrytype." >&4
6550 echo "I don't recognize your system's directory entries." >&4
6551 rp="What type is used for directory entries on this system?"
6559 : see if the directory entry stores field length
6561 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6562 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
6563 echo "Good, your directory entry keeps length information in d_namlen." >&4
6566 echo "Your directory entry does not know about the d_namlen field." >&4
6573 : see if dlerror exists
6576 set dlerror d_dlerror
6580 : see if dlfcn is available
6588 On a few systems, the dynamically loaded modules that perl generates and uses
6589 will need a different extension than shared libs. The default will probably
6597 rp='What is the extension of dynamically loaded modules'
6606 : Check if dlsym need a leading underscore
6612 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
6613 $cat >dyna.c <<'EOM'
6622 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
6624 #include <sys/types.h>
6638 int mode = RTLD_LAZY ;
6640 handle = dlopen("./dyna.$dlext", mode) ;
6641 if (handle == NULL) {
6646 symbol = dlsym(handle, "fred") ;
6647 if (symbol == NULL) {
6648 /* try putting a leading underscore */
6649 symbol = dlsym(handle, "_fred") ;
6650 if (symbol == NULL) {
6663 : Call the object file tmp-dyna.o in case dlext=o.
6664 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
6665 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
6666 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
6667 $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
6670 1) echo "Test program failed using dlopen." >&4
6671 echo "Perhaps you should not use dynamic loading." >&4;;
6672 2) echo "Test program failed using dlsym." >&4
6673 echo "Perhaps you should not use dynamic loading." >&4;;
6674 3) echo "dlsym needs a leading underscore" >&4
6676 4) echo "dlsym doesn't need a leading underscore." >&4;;
6679 echo "I can't compile and run the test program." >&4
6684 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
6689 : see if dup2 exists
6693 : see if endhostent exists
6694 set endhostent d_endhent
6697 : see if endnetent exists
6698 set endnetent d_endnent
6701 : see if endprotoent exists
6702 set endprotoent d_endpent
6705 : see if endservent exists
6706 set endservent d_endsent
6709 : Locate the flags for 'open()'
6711 $cat >open3.c <<'EOCP'
6712 #include <sys/types.h>
6717 #include <sys/file.h>
6728 : check sys/file.h first to get FREAD on Sun
6729 if $test `./findhdr sys/file.h` && \
6730 set open3 -DI_SYS_FILE && eval $compile; then
6732 echo "<sys/file.h> defines the O_* constants..." >&4
6734 echo "and you have the 3 argument form of open()." >&4
6737 echo "but not the 3 argument form of open(). Oh, well." >&4
6740 elif $test `./findhdr fcntl.h` && \
6741 set open3 -DI_FCNTL && eval $compile; then
6743 echo "<fcntl.h> defines the O_* constants..." >&4
6745 echo "and you have the 3 argument form of open()." >&4
6748 echo "but not the 3 argument form of open(). Oh, well." >&4
6753 echo "I can't find the O_* constant definitions! You got problems." >&4
6759 : check for non-blocking I/O stuff
6760 case "$h_sysfile" in
6761 true) echo "#include <sys/file.h>" > head.c;;
6764 true) echo "#include <fcntl.h>" > head.c;;
6765 *) echo "#include <sys/fcntl.h>" > head.c;;
6770 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
6771 case "$o_nonblock" in
6774 $cat >>try.c <<'EOCP'
6777 printf("O_NONBLOCK\n");
6781 printf("O_NDELAY\n");
6785 printf("FNDELAY\n");
6792 if eval $compile_ok; then
6794 case "$o_nonblock" in
6795 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
6796 *) echo "Seems like we can use $o_nonblock.";;
6799 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
6802 *) echo "Using $hint value $o_nonblock.";;
6804 $rm -f try try.* .out core
6807 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
6813 #include <sys/types.h>
6815 #define MY_O_NONBLOCK $o_nonblock
6816 #ifndef errno /* XXX need better Configure test */
6819 $signal_t blech(x) int x; { exit(3); }
6821 $cat >> try.c <<'EOCP'
6829 pipe(pd); /* Down: child -> parent */
6830 pipe(pu); /* Up: parent -> child */
6833 close(pd[1]); /* Parent reads from pd[0] */
6834 close(pu[0]); /* Parent writes (blocking) to pu[1] */
6835 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
6837 signal(SIGALRM, blech);
6839 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
6841 sprintf(string, "%d\n", ret);
6842 write(2, string, strlen(string));
6845 if (errno == EAGAIN) {
6851 if (errno == EWOULDBLOCK)
6852 printf("EWOULDBLOCK\n");
6855 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
6856 sleep(2); /* Give it time to close our pipe */
6858 ret = read(pd[0], buf, 1); /* Should read EOF */
6860 sprintf(string, "%d\n", ret);
6861 write(3, string, strlen(string));
6865 close(pd[0]); /* We write to pd[1] */
6866 close(pu[1]); /* We read from pu[0] */
6867 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
6868 close(pd[1]); /* Pipe pd is now fully closed! */
6869 exit(0); /* Bye bye, thank you for playing! */
6873 if eval $compile_ok; then
6874 echo "$startsh" >mtry
6875 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
6877 ./mtry >/dev/null 2>&1
6879 0) eagain=`$cat try.out`;;
6880 1) echo "Could not perform non-blocking setting!";;
6881 2) echo "I did a successful read() for something that was not there!";;
6882 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
6883 *) echo "Something terribly wrong happened during testing.";;
6885 rd_nodata=`$cat try.ret`
6886 echo "A read() system call with no data present returns $rd_nodata."
6887 case "$rd_nodata" in
6890 echo "(That's peculiar, fixing that to be -1.)"
6896 echo "Forcing errno EAGAIN on read() with no data available."
6900 echo "Your read() sets errno to $eagain when no data is available."
6903 status=`$cat try.err`
6905 0) echo "And it correctly returns 0 to signal EOF.";;
6906 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
6907 *) echo "However, your read() returns '$status' on EOF??";;
6910 if test "$status" = "$rd_nodata"; then
6911 echo "WARNING: you can't distinguish between EOF and no data!"
6915 echo "I can't compile the test program--assuming errno EAGAIN will do."
6922 echo "Using $hint value $eagain."
6923 echo "Your read() returns $rd_nodata when no data is present."
6924 case "$d_eofnblk" in
6925 "$define") echo "And you can see EOF because read() returns 0.";;
6926 "$undef") echo "But you can't see EOF status from read() returned value.";;
6928 echo "(Assuming you can't see EOF status from read anyway.)"
6934 $rm -f try try.* .out core head.c mtry
6936 : see if fchmod exists
6940 : see if fchown exists
6944 : see if this is an fcntl system
6948 : see if fgetpos exists
6949 set fgetpos d_fgetpos
6952 : see if flock exists
6956 : see if fork exists
6960 : see if pathconf exists
6961 set pathconf d_pathconf
6964 : see if fpathconf exists
6965 set fpathconf d_fpathconf
6968 : see if fsetpos exists
6969 set fsetpos d_fsetpos
6972 : see if gethostbyaddr exists
6973 set gethostbyaddr d_gethbyaddr
6976 : see if gethostbyname exists
6977 set gethostbyname d_gethbyname
6980 : see if gethostent exists
6981 set gethostent d_gethent
6984 hasproto='varname=$1; func=$2; shift; shift;
6985 while $test $# -ge 2; do
6987 $define) echo "#include <$2>";;
6991 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
6992 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
6993 echo "$func() prototype found.";
6996 echo "$func() prototype NOT found.";
7001 $rm -f try.c tryout.c'
7003 : see if this is a netdb.h system
7007 : see if prototypes for various gethostxxx netdb.h functions are available
7009 set d_gethostprotos gethostent $i_netdb netdb.h
7012 : see if getlogin exists
7013 set getlogin d_getlogin
7016 : see if getnetbyaddr exists
7017 set getnetbyaddr d_getnbyaddr
7020 : see if getnetbyname exists
7021 set getnetbyname d_getnbyname
7024 : see if getnetent exists
7025 set getnetent d_getnent
7028 : see if prototypes for various getnetxxx netdb.h functions are available
7030 set d_getnetprotos getnetent $i_netdb netdb.h
7034 : see if getprotobyname exists
7035 set getprotobyname d_getpbyname
7038 : see if getprotobynumber exists
7039 set getprotobynumber d_getpbynumber
7042 : see if getprotoent exists
7043 set getprotoent d_getpent
7046 : see if getpgid exists
7047 set getpgid d_getpgid
7050 : see if getpgrp2 exists
7051 set getpgrp2 d_getpgrp2
7054 : see if getppid exists
7055 set getppid d_getppid
7058 : see if getpriority exists
7059 set getpriority d_getprior
7062 : see if prototypes for various getprotoxxx netdb.h functions are available
7064 set d_getprotoprotos getprotoent $i_netdb netdb.h
7068 : see if getservbyname exists
7069 set getservbyname d_getsbyname
7072 : see if getservbyport exists
7073 set getservbyport d_getsbyport
7076 : see if getservent exists
7077 set getservent d_getsent
7080 : see if prototypes for various getservxxx netdb.h functions are available
7082 set d_getservprotos getservent $i_netdb netdb.h
7085 : see if gettimeofday or ftime exists
7086 set gettimeofday d_gettimeod
7088 case "$d_gettimeod" in
7094 val="$undef"; set d_ftime; eval $setvar
7097 case "$d_gettimeod$d_ftime" in
7100 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
7104 : see if this is a netinet/in.h or sys/in.h system
7105 set netinet/in.h i_niin sys/in.h i_sysin
7108 : see if htonl --and friends-- exists
7113 : Maybe they are macros.
7118 #include <sys/types.h>
7119 #$i_niin I_NETINET_IN
7122 #include <netinet/in.h>
7128 printf("Defined as a macro.");
7131 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
7132 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
7134 echo "But it seems to be defined as a macro." >&4
7142 : see which of string.h or strings.h is needed
7144 strings=`./findhdr string.h`
7145 if $test "$strings" && $test -r "$strings"; then
7146 echo "Using <string.h> instead of <strings.h>." >&4
7150 strings=`./findhdr strings.h`
7151 if $test "$strings" && $test -r "$strings"; then
7152 echo "Using <strings.h> instead of <string.h>." >&4
7154 echo "No string header found -- You'll surely have problems." >&4
7160 "$undef") strings=`./findhdr strings.h`;;
7161 *) strings=`./findhdr string.h`;;
7166 if set index val -f; eval $csym; $val; then
7167 if set strchr val -f d_strchr; eval $csym; $val; then
7168 if $contains strchr "$strings" >/dev/null 2>&1 ; then
7171 echo "strchr() found." >&4
7175 echo "index() found." >&4
7180 echo "index() found." >&4
7183 if set strchr val -f d_strchr; eval $csym; $val; then
7186 echo "strchr() found." >&4
7188 echo "No index() or strchr() found!" >&4
7193 set d_strchr; eval $setvar
7195 set d_index; eval $setvar
7197 : check whether inet_aton exists
7198 set inet_aton d_inetaton
7203 $cat >isascii.c <<'EOCP'
7215 if eval $compile; then
7216 echo "isascii() found." >&4
7219 echo "isascii() NOT found." >&4
7226 : see if killpg exists
7230 : see if lchown exists
7232 $cat > try.c <<'EOCP'
7233 /* System header to define __stub macros and hopefully few prototypes,
7234 which can conflict with char lchown(); below. */
7236 /* Override any gcc2 internal prototype to avoid an error. */
7237 /* We use char because int might match the return type of a gcc2
7238 builtin and then its argument prototype would still apply. */
7241 /* The GNU C library defines this for functions which it implements
7242 to always fail with ENOSYS. Some functions are actually named
7243 something starting with __ and the normal name is an alias. */
7244 #if defined (__stub_lchown) || defined (__stub___lchown)
7252 if eval $compile; then
7253 $echo "lchown() found." >&4
7256 $echo "lchown() NOT found." >&4
7262 : see if link exists
7266 : see if localeconv exists
7267 set localeconv d_locconv
7270 : see if lockf exists
7274 : check for long doubles
7276 echo $n "Checking to see if your system supports long doubles...$c" >&4
7277 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7278 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7280 echo " Yup, it does." >&4
7283 echo " Nope, it doesn't." >&4
7289 : check for length of long double
7290 case "${d_longdbl}${longdblsize}" in
7293 $echo $n "Checking to see how big your long doubles are...$c" >&4
7294 $cat >try.c <<'EOCP'
7298 printf("%d\n", sizeof(long double));
7302 if eval $compile; then
7304 $echo " $longdblsize bytes." >&4
7308 echo "(I can't seem to compile the test program. Guessing...)" >&4
7309 rp="What is the size of a long double (in bytes)?"
7317 : check for long long
7319 echo $n "Checking to see if your system supports long long...$c" >&4
7320 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
7321 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7323 echo " Yup, it does." >&4
7326 echo " Nope, it doesn't." >&4
7332 : check for length of long long
7333 case "${d_longlong}${longlongsize}" in
7336 $echo $n "Checking to see how big your long longs are...$c" >&4
7337 $cat >try.c <<'EOCP'
7341 printf("%d\n", sizeof(long long));
7345 if eval $compile_ok; then
7346 longlongsize=`./try`
7347 $echo " $longlongsize bytes." >&4
7351 echo "(I can't seem to compile the test program. Guessing...)"
7352 rp="What is the size of a long long (in bytes)?"
7360 : see if lstat exists
7364 : see if mblen exists
7368 : see if mbstowcs exists
7369 set mbstowcs d_mbstowcs
7372 : see if mbtowc exists
7376 : see if memcmp exists
7380 : see if memcpy exists
7384 : see if memmove exists
7385 set memmove d_memmove
7388 : see if memset exists
7392 : see if mkdir exists
7396 : see if mkfifo exists
7400 : see if mktime exists
7404 : see if msgctl exists
7408 : see if msgget exists
7412 : see if msgsnd exists
7416 : see if msgrcv exists
7420 : see how much of the 'msg*(2)' library is present.
7423 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
7424 *"$undef"*) h_msg=false;;
7426 : we could also check for sys/ipc.h ...
7427 if $h_msg && $test `./findhdr sys/msg.h`; then
7428 echo "You have the full msg*(2) library." >&4
7431 echo "You don't have the full msg*(2) library." >&4
7437 : see if this is a malloc.h system
7438 set malloc.h i_malloc
7441 : see if stdlib is available
7442 set stdlib.h i_stdlib
7445 : determine which malloc to compile in
7447 case "$usemymalloc" in
7448 ''|y*|true) dflt='y' ;;
7449 n*|false) dflt='n' ;;
7450 *) dflt="$usemymalloc" ;;
7452 rp="Do you wish to attempt to use the malloc that comes with $package?"
7458 mallocsrc='malloc.c'
7459 mallocobj="malloc$_o"
7460 d_mymalloc="$define"
7463 : Remove malloc from list of libraries to use
7464 echo "Removing unneeded -lmalloc from library list" >&4
7465 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7468 echo "libs = $libs" >&4
7480 : compute the return types of malloc and free
7482 $cat >malloc.c <<END
7486 #include <sys/types.h>
7500 case "$malloctype" in
7502 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7509 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7513 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7520 echo "Your system uses $freetype free(), it would seem." >&4
7522 : see if nice exists
7526 : see if pause exists
7530 : see if pipe exists
7534 : see if poll exists
7539 : see whether the various POSIXish _yields exist within given cccmd
7541 #include <pthread.h>
7547 : see if pthread_yield exists within given cccmd,
7548 : if we do not usethreads this may well end up undef.
7549 set try -DYIELD=pthread_yield
7550 if eval $compile; then
7552 echo 'pthread_yield() found.' >&4
7555 echo 'pthread_yield() NOT found.' >&4
7560 : see if sched_yield exists within given cccmd,
7561 : if we do not usethreads this may well end up undef.
7562 set try -DYIELD=sched_yield
7563 if eval $compile; then
7565 echo 'sched_yield() found.' >&4
7568 echo 'sched_yield() NOT found.' >&4
7574 : test whether pthreads are created in joinable -- aka undetached -- state
7575 if test "X$usethreads" = "X$define"; then
7576 echo $n "Checking whether pthreads are created joinable. $c" >&4
7577 $cat >try.c <<'EOCP'
7578 #include <pthread.h>
7581 pthread_attr_t attr;
7584 pthread_attr_init(&attr) == 0 &&
7585 pthread_attr_getdetachstate(&attr, &detachstate) == 0 &&
7586 detachstate == PTHREAD_CREATE_DETACHED ?
7587 "detached" : "joinable");
7592 if eval $compile; then
7595 detached) echo "Nope, they aren't." >&4 ;;
7596 *) echo "Yup, they are." >&4 ;;
7600 echo "(I can't execute the test program--assuming they are.)" >&4
7605 detached) val="$undef" ;;
7608 set d_pthreads_created_joinable
7611 d_pthreads_created_joinable="$undef"
7614 : see if this is a pwd.h system
7620 xxx=`./findhdr pwd.h`
7621 $cppstdin $cppflags $cppminus < $xxx >$$.h
7623 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
7631 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
7639 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
7647 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
7655 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
7663 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
7671 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
7683 set d_pwquota; eval $setvar
7684 set d_pwage; eval $setvar
7685 set d_pwchange; eval $setvar
7686 set d_pwclass; eval $setvar
7687 set d_pwexpire; eval $setvar
7688 set d_pwcomment; eval $setvar
7689 set d_pwgecos; eval $setvar
7693 : see if readdir and friends exist
7694 set readdir d_readdir
7696 set seekdir d_seekdir
7698 set telldir d_telldir
7700 set rewinddir d_rewinddir
7703 : see if readlink exists
7704 set readlink d_readlink
7707 : see if rename exists
7711 : see if rmdir exists
7715 : see if memory.h is available.
7720 : See if it conflicts with string.h
7726 $cppstdin $cppflags $cppminus < $strings > mem.h
7727 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
7729 echo "We won't be including <memory.h>."
7739 : can bcopy handle overlapping blocks?
7744 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
7751 $cat >>try.c <<'EOCP'
7754 # include <memory.h>
7757 # include <stdlib.h>
7760 # include <string.h>
7762 # include <strings.h>
7765 # include <unistd.h> /* Needed for NetBSD */
7769 char buf[128], abc[128];
7775 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
7777 for (align = 7; align >= 0; align--) {
7778 for (len = 36; len; len--) {
7781 for (off = 1; off <= len; off++) {
7782 bcopy(b, b+off, len);
7783 bcopy(b+off, b, len);
7784 if (bcmp(b, abc, len))
7793 if eval $compile_ok; then
7794 if ./try 2>/dev/null; then
7798 echo "It can't, sorry."
7799 case "$d_memmove" in
7800 "$define") echo "But that's Ok since you have memmove()." ;;
7804 echo "(I can't compile the test program, so we'll assume not...)"
7805 case "$d_memmove" in
7806 "$define") echo "But that's Ok since you have memmove()." ;;
7811 $rm -f try.* try core
7815 : can memcpy handle overlapping blocks?
7820 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
7827 $cat >>try.c <<'EOCP'
7830 # include <memory.h>
7833 # include <stdlib.h>
7836 # include <string.h>
7838 # include <strings.h>
7841 # include <unistd.h> /* Needed for NetBSD */
7845 char buf[128], abc[128];
7851 /* Copy "abcde..." string to char abc[] so that gcc doesn't
7852 try to store the string in read-only memory. */
7853 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
7855 for (align = 7; align >= 0; align--) {
7856 for (len = 36; len; len--) {
7858 memcpy(b, abc, len);
7859 for (off = 1; off <= len; off++) {
7860 memcpy(b+off, b, len);
7861 memcpy(b, b+off, len);
7862 if (memcmp(b, abc, len))
7871 if eval $compile_ok; then
7872 if ./try 2>/dev/null; then
7876 echo "It can't, sorry."
7877 case "$d_memmove" in
7878 "$define") echo "But that's Ok since you have memmove()." ;;
7882 echo "(I can't compile the test program, so we'll assume not...)"
7883 case "$d_memmove" in
7884 "$define") echo "But that's Ok since you have memmove()." ;;
7889 $rm -f try.* try core
7893 : can memcmp be trusted to compare relative magnitude?
7898 echo "Checking if your memcmp() can compare relative magnitude..." >&4
7905 $cat >>try.c <<'EOCP'
7908 # include <memory.h>
7911 # include <stdlib.h>
7914 # include <string.h>
7916 # include <strings.h>
7919 # include <unistd.h> /* Needed for NetBSD */
7925 if ((a < b) && memcmp(&a, &b, 1) < 0)
7931 if eval $compile_ok; then
7932 if ./try 2>/dev/null; then
7936 echo "No, it can't (it uses signed chars)."
7939 echo "(I can't compile the test program, so we'll assume not...)"
7943 $rm -f try.* try core
7947 : see if select exists
7951 : see if semctl exists
7955 : see if semget exists
7959 : see if semop exists
7963 : see how much of the 'sem*(2)' library is present.
7966 case "$d_semctl$d_semget$d_semop" in
7967 *"$undef"*) h_sem=false;;
7969 : we could also check for sys/ipc.h ...
7970 if $h_sem && $test `./findhdr sys/sem.h`; then
7971 echo "You have the full sem*(2) library." >&4
7974 echo "You don't have the full sem*(2) library." >&4
7980 : see whether sys/sem.h defines union semun
7982 $cat > try.c <<'END'
7983 #include <sys/types.h>
7984 #include <sys/ipc.h>
7985 #include <sys/sem.h>
7986 int main () { union semun semun; semun.buf = 0; }
7989 if eval $compile; then
7990 echo "You have union semun in <sys/sem.h>." >&4
7993 echo "You do not have union semun in <sys/sem.h>." >&4
8000 : see how to do semctl IPC_STAT
8003 : see whether semctl IPC_STAT can use union semun
8006 #include <sys/types.h>
8007 #include <sys/ipc.h>
8008 #include <sys/sem.h>
8009 #include <sys/stat.h>
8015 #$d_union_semun HAS_UNION_SEMUN
8018 #ifndef HAS_UNION_SEMUN
8021 struct semid_ds *buf;
8022 unsigned short *array;
8028 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8029 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8031 struct semid_ds argbuf;
8034 st = semctl(sem, 0, IPC_STAT, arg);
8038 # endif /* IPC_STAT */
8039 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8041 if (semctl(sem, 0, IPC_RMID, arg) != 0)
8042 # endif /* IPC_RMID */
8043 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8045 #endif /* IPC_PRIVATE && ... */
8046 printf("semget failed: errno = %d\n", errno);
8052 if eval $compile; then
8055 semun) val="$define" ;;
8061 case "$d_semctl_semun" in
8063 echo "You can use union semun for semctl IPC_STAT." >&4
8066 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
8071 : see whether semctl IPC_STAT can use struct semid_ds pointer
8072 $cat > try.c <<'END'
8073 #include <sys/types.h>
8074 #include <sys/ipc.h>
8075 #include <sys/sem.h>
8076 #include <sys/stat.h>
8083 struct semid_ds arg;
8086 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8087 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8090 st = semctl(sem, 0, IPC_STAT, &arg);
8092 printf("semid_ds\n");
8094 # endif /* IPC_STAT */
8095 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8097 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
8098 # endif /* IPC_RMID */
8099 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8101 #endif /* IPC_PRIVATE && ... */
8102 printf("semget failed: errno = %d\n", errno);
8109 if eval $compile; then
8112 semid_ds) val="$define" ;;
8116 set d_semctl_semid_ds
8118 case "$d_semctl_semid_ds" in
8120 echo "You can $also use struct semid_ds * for semctl IPC_STAT." >&4
8122 *) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4
8128 # We do not have the full sem*(2) library, so assume we can not
8134 set d_semctl_semid_ds
8139 : see if setegid exists
8140 set setegid d_setegid
8143 : see if seteuid exists
8144 set seteuid d_seteuid
8147 : see if sethostent exists
8148 set sethostent d_sethent
8151 : see if setlinebuf exists
8152 set setlinebuf d_setlinebuf
8155 : see if setlocale exists
8156 set setlocale d_setlocale
8159 : see if setnetent exists
8160 set setnetent d_setnent
8163 : see if setprotoent exists
8164 set setprotoent d_setpent
8167 : see if setpgid exists
8168 set setpgid d_setpgid
8171 : see if setpgrp2 exists
8172 set setpgrp2 d_setpgrp2
8175 : see if setpriority exists
8176 set setpriority d_setprior
8179 : see if setregid exists
8180 set setregid d_setregid
8182 set setresgid d_setresgid
8185 : see if setreuid exists
8186 set setreuid d_setreuid
8188 set setresuid d_setresuid
8191 : see if setrgid exists
8192 set setrgid d_setrgid
8195 : see if setruid exists
8196 set setruid d_setruid
8199 : see if setservent exists
8200 set setservent d_setsent
8203 : see if setsid exists
8207 : see if setvbuf exists
8208 set setvbuf d_setvbuf
8211 : see if sfio.h is available
8216 : see if sfio library is available
8227 : Ok, but do we want to use it.
8231 true|$define|[yY]*) dflt='y';;
8234 echo "$package can use the sfio library, but it is experimental."
8235 rp="You seem to have sfio available, do you want to try using it?"
8239 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
8241 : Remove sfio from list of libraries to use
8242 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
8245 echo "libs = $libs" >&4
8249 *) case "$usesfio" in
8251 echo "Sorry, cannot find sfio on this machine" >&4
8252 echo "Ignoring your setting of usesfio=$usesfio" >&4
8260 $define) usesfio='true';;
8261 *) usesfio='false';;
8264 : see if shmctl exists
8268 : see if shmget exists
8272 : see if shmat exists
8275 : see what shmat returns
8278 $cat >shmat.c <<'END'
8279 #include <sys/shm.h>
8282 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
8287 echo "and it returns ($shmattype)." >&4
8288 : see if a prototype for shmat is available
8289 xxx=`./findhdr sys/shm.h`
8290 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
8291 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
8302 set d_shmatprototype
8305 : see if shmdt exists
8309 : see how much of the 'shm*(2)' library is present.
8312 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
8313 *"$undef"*) h_shm=false;;
8315 : we could also check for sys/ipc.h ...
8316 if $h_shm && $test `./findhdr sys/shm.h`; then
8317 echo "You have the full shm*(2) library." >&4
8320 echo "You don't have the full shm*(2) library." >&4
8327 : see if we have sigaction
8328 if set sigaction val -f d_sigaction; eval $csym; $val; then
8329 echo 'sigaction() found.' >&4
8330 $cat > try.c <<'EOP'
8332 #include <sys/types.h>
8336 struct sigaction act, oact;
8340 if eval $compile_ok; then
8343 echo "But you don't seem to have a useable struct sigaction." >&4
8347 echo 'sigaction NOT found.' >&4
8350 set d_sigaction; eval $setvar
8351 $rm -f try try$_o try.c
8353 : see if sigsetjmp exists
8355 case "$d_sigsetjmp" in
8363 if (sigsetjmp(env,1))
8371 if eval $compile; then
8372 if ./try >/dev/null 2>&1; then
8373 echo "POSIX sigsetjmp found." >&4
8377 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
8383 echo "sigsetjmp not found." >&4
8387 *) val="$d_sigsetjmp"
8388 case "$d_sigsetjmp" in
8389 $define) echo "POSIX sigsetjmp found." >&4;;
8390 $undef) echo "sigsetjmp not found." >&4;;
8400 : see whether socket exists
8402 $echo $n "Hmm... $c" >&4
8403 if set socket val -f d_socket; eval $csym; $val; then
8404 echo "Looks like you have Berkeley networking support." >&4
8406 if set setsockopt val -f; eval $csym; $val; then
8409 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
8413 if $contains socklib libc.list >/dev/null 2>&1; then
8414 echo "Looks like you have Berkeley networking support." >&4
8416 : we will have to assume that it supports the 4.2 BSD interface
8419 echo "You don't have Berkeley networking in libc$_a..." >&4
8420 if test -f /usr/lib/libnet$_a; then
8421 ( ($nm $nm_opt /usr/lib/libnet$_a | eval $nm_extract) || \
8422 $ar t /usr/lib/libnet$_a) 2>/dev/null >> libc.list
8423 if $contains socket libc.list >/dev/null 2>&1; then
8424 echo "...but the Wollongong group seems to have hacked it in." >&4
8426 sockethdr="-I/usr/netinclude"
8428 if $contains setsockopt libc.list >/dev/null 2>&1; then
8431 echo "...using the old 4.1c interface, rather than 4.2" >&4
8435 echo "or even in libnet$_a, which is peculiar." >&4
8440 echo "or anywhere else I see." >&4
8447 : see if socketpair exists
8448 set socketpair d_sockpair
8451 : see if stat knows about block sizes
8453 xxx=`./findhdr sys/stat.h`
8454 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
8455 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
8456 echo "Your stat() knows about block sizes." >&4
8459 echo "Your stat() doesn't know about block sizes." >&4
8463 echo "Your stat() doesn't know about block sizes." >&4
8469 : see if _ptr and _cnt from stdio act std
8471 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
8472 echo "(Looks like you have stdio.h from Linux.)"
8473 case "$stdio_ptr" in
8474 '') stdio_ptr='((fp)->_IO_read_ptr)'
8477 *) ptr_lval=$d_stdio_ptr_lval;;
8479 case "$stdio_cnt" in
8480 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
8483 *) cnt_lval=$d_stdio_cnt_lval;;
8485 case "$stdio_base" in
8486 '') stdio_base='((fp)->_IO_read_base)';;
8488 case "$stdio_bufsiz" in
8489 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
8492 case "$stdio_ptr" in
8493 '') stdio_ptr='((fp)->_ptr)'
8496 *) ptr_lval=$d_stdio_ptr_lval;;
8498 case "$stdio_cnt" in
8499 '') stdio_cnt='((fp)->_cnt)'
8502 *) cnt_lval=$d_stdio_cnt_lval;;
8504 case "$stdio_base" in
8505 '') stdio_base='((fp)->_base)';;
8507 case "$stdio_bufsiz" in
8508 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
8511 : test whether _ptr and _cnt really work
8512 echo "Checking how std your stdio is..." >&4
8515 #define FILE_ptr(fp) $stdio_ptr
8516 #define FILE_cnt(fp) $stdio_cnt
8518 FILE *fp = fopen("try.c", "r");
8521 18 <= FILE_cnt(fp) &&
8522 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
8530 if eval $compile; then
8532 echo "Your stdio acts pretty std."
8535 echo "Your stdio isn't very std."
8538 echo "Your stdio doesn't appear very std."
8544 : Can _ptr be used as an lvalue?
8545 case "$d_stdstdio$ptr_lval" in
8546 $define$define) val=$define ;;
8549 set d_stdio_ptr_lval
8552 : Can _cnt be used as an lvalue?
8553 case "$d_stdstdio$cnt_lval" in
8554 $define$define) val=$define ;;
8557 set d_stdio_cnt_lval
8560 : see if _base is also standard
8562 case "$d_stdstdio" in
8566 #define FILE_base(fp) $stdio_base
8567 #define FILE_bufsiz(fp) $stdio_bufsiz
8569 FILE *fp = fopen("try.c", "r");
8572 19 <= FILE_bufsiz(fp) &&
8573 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
8580 if eval $compile; then
8582 echo "And its _base field acts std."
8585 echo "But its _base field isn't std."
8588 echo "However, it seems to be lacking the _base field."
8596 : see if strcoll exists
8597 set strcoll d_strcoll
8600 : check for structure copying
8602 echo "Checking to see if your C compiler can copy structs..." >&4
8603 $cat >try.c <<'EOCP'
8613 if $cc -c try.c >/dev/null 2>&1 ; then
8618 echo "Nope, it can't."
8624 : see if strerror and/or sys_errlist[] exist
8626 if set strerror val -f d_strerror; eval $csym; $val; then
8627 echo 'strerror() found.' >&4
8628 d_strerror="$define"
8629 d_strerrm='strerror(e)'
8630 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8631 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
8632 d_syserrlst="$define"
8634 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
8635 d_syserrlst="$undef"
8637 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
8638 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
8639 echo 'strerror() found in string header.' >&4
8640 d_strerror="$define"
8641 d_strerrm='strerror(e)'
8642 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8643 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
8644 d_syserrlst="$define"
8646 echo "(You don't appear to have any sys_errlist[], how can this be?)"
8647 d_syserrlst="$undef"
8649 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8650 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
8652 d_syserrlst="$define"
8653 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
8655 echo 'strerror() and sys_errlist[] NOT found.' >&4
8657 d_syserrlst="$undef"
8658 d_strerrm='"unknown"'
8661 : see if strtod exists
8665 : see if strtol exists
8669 : see if strtoul exists
8670 set strtoul d_strtoul
8673 : see if strxfrm exists
8674 set strxfrm d_strxfrm
8677 : see if symlink exists
8678 set symlink d_symlink
8681 : see if syscall exists
8682 set syscall d_syscall
8685 : see if sysconf exists
8686 set sysconf d_sysconf
8689 : see if system exists
8693 : see if tcgetpgrp exists
8694 set tcgetpgrp d_tcgetpgrp
8697 : see if tcsetpgrp exists
8698 set tcsetpgrp d_tcsetpgrp
8701 : define an is-a-typedef? function
8702 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8704 "") inclist="sys/types.h";;
8706 eval "varval=\$$var";
8710 for inc in $inclist; do
8711 echo "#include <$inc>" >>temp.c;
8713 echo "#ifdef $type" >> temp.c;
8714 echo "printf(\"We have $type\");" >> temp.c;
8715 echo "#endif" >> temp.c;
8716 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8717 if $contains $type temp.E >/dev/null 2>&1; then
8723 *) eval "$var=\$varval";;
8726 : define an is-a-typedef? function that prompts if the type is not available.
8727 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8729 "") inclist="sys/types.h";;
8731 eval "varval=\$$var";
8735 for inc in $inclist; do
8736 echo "#include <$inc>" >>temp.c;
8738 echo "#ifdef $type" >> temp.c;
8739 echo "printf(\"We have $type\");" >> temp.c;
8740 echo "#endif" >> temp.c;
8741 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8743 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8744 if $contains $type temp.E >/dev/null 2>&1; then
8745 echo "$type found." >&4;
8748 echo "$type NOT found." >&4;
8754 *) eval "$var=\$varval";;
8757 : see if this is a sys/times.h system
8758 set sys/times.h i_systimes
8761 : see if times exists
8763 if set times val -f d_times; eval $csym; $val; then
8764 echo 'times() found.' >&4
8767 case "$i_systimes" in
8768 "$define") inc='sys/times.h';;
8770 rp="What is the type returned by times() on this system?"
8771 set clock_t clocktype long stdio.h sys/types.h $inc
8774 echo 'times() NOT found, hope that will do.' >&4
8779 : see if truncate exists
8780 set truncate d_truncate
8783 : see if tzname[] exists
8785 if set tzname val -a d_tzname; eval $csym; $val; then
8787 echo 'tzname[] found.' >&4
8790 echo 'tzname[] NOT found.' >&4
8795 : see if umask exists
8799 : see how we will look up host name
8802 : dummy stub to allow use of elif
8803 elif set uname val -f d_uname; eval $csym; $val; then
8806 uname() was found, but you're running xenix, and older versions of xenix
8807 have a broken uname(). If you don't really know whether your xenix is old
8808 enough to have a broken system call, use the default answer.
8815 rp='Is your uname() broken?'
8818 n*) d_uname="$define"; call=uname;;
8821 echo 'uname() found.' >&4
8826 case "$d_gethname" in
8827 '') d_gethname="$undef";;
8830 '') d_uname="$undef";;
8832 case "$d_phostname" in
8833 '') d_phostname="$undef";;
8836 : backward compatibility for d_hvfork
8837 if test X$d_hvfork != X; then
8841 : see if there is a vfork
8846 : Ok, but do we want to use it. vfork is reportedly unreliable in
8847 : perl on Solaris 2.x, and probably elsewhere.
8855 rp="Some systems have problems with vfork(). Do you want to use it?"
8860 echo "Ok, we won't use vfork()."
8869 $define) usevfork='true';;
8870 *) usevfork='false';;
8873 : see if this is an sysdir system
8874 set sys/dir.h i_sysdir
8877 : see if this is an sysndir system
8878 set sys/ndir.h i_sysndir
8881 : see if closedir exists
8882 set closedir d_closedir
8885 case "$d_closedir" in
8888 echo "Checking whether closedir() returns a status..." >&4
8889 cat > closedir.c <<EOM
8890 #$i_dirent I_DIRENT /**/
8891 #$i_sysdir I_SYS_DIR /**/
8892 #$i_sysndir I_SYS_NDIR /**/
8894 #if defined(I_DIRENT)
8896 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
8897 #include <sys/dir.h>
8901 #include <sys/ndir.h>
8905 #include <ndir.h> /* may be wrong in the future */
8907 #include <sys/dir.h>
8912 int main() { return closedir(opendir(".")); }
8915 if eval $compile_ok; then
8916 if ./closedir > /dev/null 2>&1 ; then
8917 echo "Yes, it does."
8920 echo "No, it doesn't."
8924 echo "(I can't seem to compile the test program--assuming it doesn't)"
8935 : check for volatile keyword
8937 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
8938 $cat >try.c <<'EOCP'
8941 typedef struct _goo_struct goo_struct;
8942 goo_struct * volatile goo = ((goo_struct *)0);
8943 struct _goo_struct {
8948 typedef unsigned short foo_t;
8951 volatile foo_t blech;
8955 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
8957 echo "Yup, it does."
8960 echo "Nope, it doesn't."
8966 : see if there is a wait4
8970 : see if waitpid exists
8971 set waitpid d_waitpid
8974 : see if wcstombs exists
8975 set wcstombs d_wcstombs
8978 : see if wctomb exists
8982 : preserve RCS keywords in files with variable substitution, grrr
8987 Revision='$Revision'
8989 : check for alignment requirements
8991 case "$alignbytes" in
8992 '') echo "Checking alignment constraints..." >&4
8993 $cat >try.c <<'EOCP'
9000 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
9004 if eval $compile_ok; then
9008 echo "(I can't seem to compile the test program...)"
9011 *) dflt="$alignbytes"
9014 rp="Doubles must be aligned on a how-many-byte boundary?"
9019 : check for ordering of bytes in a long
9020 case "$byteorder" in
9024 In the following, larger digits indicate more significance. A big-endian
9025 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
9026 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
9027 machines may have weird orders like 3412. A Cray will report 87654321. If
9028 the test program works the default is probably right.
9029 I'm now running the test program...
9031 $cat >try.c <<'EOCP'
9038 char c[sizeof(long)];
9041 if (sizeof(long) > 4)
9042 u.l = (0x08070605L << 32) | 0x04030201L;
9045 for (i = 0; i < sizeof(long); i++)
9046 printf("%c", u.c[i]+'0');
9053 if eval $compile && ./try > /dev/null; then
9056 [1-4][1-4][1-4][1-4]|12345678|87654321)
9057 echo "(The test program ran ok.)"
9058 echo "byteorder=$dflt"
9061 ????|????????) echo "(The test program ran ok.)" ;;
9062 *) echo "(The test program didn't run right for some reason.)" ;;
9067 (I can't seem to compile the test program. Guessing big-endian...)
9070 case "$xxx_prompt" in
9072 rp="What is the order of bytes in a long?"
9083 : how do we catenate cpp tokens here?
9085 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
9086 $cat >cpp_stuff.c <<'EOCP'
9087 #define RCAT(a,b)a/**/b
9088 #define ACAT(a,b)a ## b
9092 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
9093 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
9094 echo "Oh! Smells like ANSI's been here." >&4
9095 echo "We can catify or stringify, separately or together!"
9097 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
9098 echo "Ah, yes! The good old days!" >&4
9099 echo "However, in the good old days we don't know how to stringify and"
9100 echo "catify at the same time."
9104 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
9105 to have to edit the values of CAT[2-5] in config.h...
9107 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
9111 : see if this is a db.h system
9119 echo "Checking Berkeley DB version ..." >&4
9125 #include <sys/types.h>
9130 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
9131 int Major, Minor, Patch ;
9132 unsigned long Version ;
9133 (void)db_version(&Major, &Minor, &Patch) ;
9134 printf("You have Berkeley DB Version 2 or greater\n");
9136 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
9137 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
9138 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
9139 Major, Minor, Patch) ;
9141 /* check that db.h & libdb are compatible */
9142 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
9143 printf("db.h and libdb are incompatible\n") ;
9147 printf("db.h and libdb are compatible\n") ;
9149 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
9150 + DB_VERSION_PATCH ;
9152 /* needs to be >= 2.3.4 */
9153 if (Version < 2003004) {
9154 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
9155 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
9161 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
9162 printf("You have Berkeley DB Version 1\n");
9163 exit(0); /* DB version < 2: the coast is clear. */
9165 exit(1); /* <db.h> not Berkeley DB? */
9171 if eval $compile && ./try; then
9172 echo 'Looks OK.' >&4
9174 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
9178 : Remove db from list of libraries to use
9179 echo "Removing unusable -ldb from library list" >&4
9180 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
9183 echo "libs = $libs" >&4
9193 : Check the return type needed for hash
9195 echo "Checking return type needed for hash for Berkeley DB ..." >&4
9201 #include <sys/types.h>
9204 #ifndef DB_VERSION_MAJOR
9205 u_int32_t hash_cb (ptr, size)
9213 info.hash = hash_cb;
9217 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9218 if $contains warning try.out >>/dev/null 2>&1 ; then
9221 db_hashtype='u_int32_t'
9224 : XXX Maybe we should just give up here.
9225 db_hashtype=u_int32_t
9227 echo "Help: I can't seem to compile the db test program." >&4
9228 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
9231 echo "Your version of Berkeley DB uses $db_hashtype for hash."
9233 *) db_hashtype=u_int32_t
9238 : Check the return type needed for prefix
9240 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
9246 #include <sys/types.h>
9249 #ifndef DB_VERSION_MAJOR
9250 size_t prefix_cb (key1, key2)
9258 info.prefix = prefix_cb;
9262 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9263 if $contains warning try.out >>/dev/null 2>&1 ; then
9266 db_prefixtype='size_t'
9269 db_prefixtype='size_t'
9270 : XXX Maybe we should just give up here.
9272 echo "Help: I can't seem to compile the db test program." >&4
9273 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
9276 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
9278 *) db_prefixtype='size_t'
9282 : check for void type
9284 echo "Checking to see how well your C compiler groks the void type..." >&4
9287 Support flag bits are:
9288 1: basic void declarations.
9289 2: arrays of pointers to functions returning void.
9290 4: operations between pointers to and addresses of void functions.
9291 8: generic void pointers.
9294 case "$voidflags" in
9296 $cat >try.c <<'EOCP'
9302 extern void moo(); /* function returning void */
9303 void (*goo)(); /* ptr to func returning void */
9305 void *hue; /* generic ptr */
9320 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
9321 voidflags=$defvoidused
9322 echo "It appears to support void to the level $package wants ($defvoidused)."
9323 if $contains warning .out >/dev/null 2>&1; then
9324 echo "However, you might get some warnings that look like this:"
9328 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
9329 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
9330 echo "It supports 1..."
9331 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
9332 echo "It also supports 2..."
9333 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
9335 echo "And it supports 4 but not 8 definitely."
9337 echo "It doesn't support 4..."
9338 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
9340 echo "But it supports 8."
9343 echo "Neither does it support 8."
9347 echo "It does not support 2..."
9348 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
9350 echo "But it supports 4 and 8."
9352 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
9354 echo "And it supports 4 but has not heard about 8."
9356 echo "However it supports 8 but not 4."
9361 echo "There is no support at all for void."
9366 case "$voidflags" in
9370 rp="Your void support flags add up to what?"
9377 : check for length of double
9379 case "$doublesize" in
9381 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
9382 $cat >try.c <<'EOCP'
9386 printf("%d\n", sizeof(double));
9390 if eval $compile_ok; then
9392 $echo " $doublesize bytes." >&4
9395 echo "(I can't seem to compile the test program. Guessing...)"
9396 rp="What is the size of a double precision number (in bytes)?"
9404 : see what type file positions are declared as in the library
9405 rp="What is the type for file position used by fsetpos()?"
9406 set fpos_t fpostype long stdio.h sys/types.h
9409 : get csh whereabouts
9411 'csh') val="$undef" ;;
9416 : Respect a hint or command line value for full_csh.
9418 '') full_csh=$csh ;;
9421 : Store the full pathname to the sed program for use in the C program
9424 : see what type gids are declared as in the kernel
9426 echo "Looking for the type for group ids returned by getgid()."
9427 set gid_t gidtype xxx stdio.h sys/types.h
9431 xxx=`./findhdr sys/user.h`
9432 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
9434 unsigned) dflt="$1 $2" ;;
9438 *) dflt="$gidtype";;
9441 gid_t) echo "gid_t found." ;;
9442 *) rp="What is the type for group ids returned by getgid()?"
9448 : see if getgroups exists
9449 set getgroups d_getgrps
9452 : see if setgroups exists
9453 set setgroups d_setgrps
9457 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
9459 case "$d_getgrps$d_setgrps" in
9461 case "$groupstype" in
9462 '') dflt="$gidtype" ;;
9463 *) dflt="$groupstype" ;;
9466 What type of pointer is the second argument to getgroups() and setgroups()?
9467 Usually this is the same as group ids, $gidtype, but not always.
9470 rp='What type pointer is the second argument to getgroups() and setgroups()?'
9474 *) groupstype="$gidtype";;
9477 : see what type lseek is declared as in the kernel
9478 rp="What is the type used for lseek's offset on this system?"
9479 set off_t lseektype long stdio.h sys/types.h
9483 echo "Checking if your $make program sets \$(MAKE)..." >&4
9484 case "$make_set_make" in
9486 $sed 's/^X //' > testmake.mak << 'EOF'
9488 X @echo 'maketemp="$(MAKE)"'
9490 case "`$make -f testmake.mak 2>/dev/null`" in
9491 *maketemp=*) make_set_make='#' ;;
9492 *) make_set_make="MAKE=$make" ;;
9497 case "$make_set_make" in
9498 '#') echo "Yup, it does.";;
9499 *) echo "Nope, it doesn't.";;
9502 : see what type is used for mode_t
9503 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
9504 set mode_t modetype int stdio.h sys/types.h
9507 : define a fucntion to check prototypes
9508 $cat > protochk <<EOSH
9511 optimize="$optimize"
9513 prototype="$prototype"
9518 $cat >> protochk <<'EOSH'
9523 while test $# -ge 2; do
9525 $define) echo "#include <$2>" >> try.c ;;
9526 literal) echo "$2" >> try.c ;;
9530 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9531 cat >> try.c <<'EOCP'
9532 #ifdef CAN_PROTOTYPE
9533 #define _(args) args
9538 echo "$foo" >> try.c
9539 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9540 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9548 : see what type is used for size_t
9549 rp="What is the type used for the length parameter for string functions?"
9550 set size_t sizetype 'unsigned int' stdio.h sys/types.h
9553 : check for type of arguments to gethostbyaddr.
9554 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
9555 case "$d_gethbyaddr" in
9559 Checking to see what type of arguments are accepted by gethostbyaddr().
9561 hdrs="$define sys/types.h
9562 $d_socket sys/socket.h
9563 $i_niin netinet/in.h
9566 : The first arg can 'char *' or 'void *'
9567 : The second arg is some of integral type
9568 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
9569 for yyy in size_t long int; do
9570 case "$netdb_host_type" in
9571 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
9572 if ./protochk "$try" $hdrs; then
9573 echo "Your system accepts $xxx for the first arg."
9574 echo "...and $yyy for the second arg."
9575 netdb_host_type="$xxx"
9576 netdb_hlen_type="$yyy"
9582 : In case none of those worked, prompt the user.
9583 case "$netdb_host_type" in
9584 '') rp='What is the type for the 1st argument to gethostbyaddr?'
9587 netdb_host_type=$ans
9588 rp='What is the type for the 2nd argument to gethostbyaddr?'
9591 netdb_hlen_type=$ans
9595 *) : no gethostbyaddr, so pick harmless defaults
9596 netdb_host_type='char *'
9597 netdb_hlen_type="$sizetype"
9600 # Remove the "const" if needed. -- but then we'll have a
9602 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
9605 : check for type of argument to gethostbyname.
9606 if test "X$netdb_name_type" = X ; then
9607 case "$d_gethbyname" in
9611 Checking to see what type of argument is accepted by gethostbyname().
9613 hdrs="$define sys/types.h
9614 $d_socket sys/socket.h
9615 $i_niin netinet/in.h
9618 for xxx in "const char *" "char *"; do
9619 case "$netdb_name_type" in
9620 '') try="extern struct hostent *gethostbyname($xxx);"
9621 if ./protochk "$try" $hdrs; then
9622 echo "Your system accepts $xxx."
9623 netdb_name_type="$xxx"
9628 : In case none of those worked, prompt the user.
9629 case "$netdb_name_type" in
9630 '') rp='What is the type for the 1st argument to gethostbyname?'
9633 netdb_name_type=$ans
9637 *) : no gethostbyname, so pick harmless default
9638 netdb_name_type='char *'
9643 : check for type of 1st argument to getnetbyaddr.
9644 if test "X$netdb_net_type" = X ; then
9645 case "$d_getnbyaddr" in
9649 Checking to see what type of 1st argument is accepted by getnetbyaddr().
9651 hdrs="$define sys/types.h
9652 $d_socket sys/socket.h
9653 $i_niin netinet/in.h
9656 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
9657 case "$netdb_net_type" in
9658 '') try="extern struct netent *getnetbyaddr($xxx, int);"
9659 if ./protochk "$try" $hdrs; then
9660 echo "Your system accepts $xxx."
9661 netdb_net_type="$xxx"
9666 : In case none of those worked, prompt the user.
9667 case "$netdb_net_type" in
9668 '') rp='What is the type for the 1st argument to getnetbyaddr?'
9675 *) : no getnetbyaddr, so pick harmless default
9676 netdb_net_type='long'
9680 : locate the preferred pager for this system
9694 '') dflt=/usr/ucb/more;;
9701 rp='What pager is used on your system?'
9705 : see what type pids are declared as in the kernel
9706 rp="What is the type of process ids on this system?"
9707 set pid_t pidtype int stdio.h sys/types.h
9710 : check for length of pointer
9714 $echo $n "Checking to see how big your pointers are...$c" >&4
9715 if test "$voidflags" -gt 7; then
9716 echo '#define VOID_PTR char *' > try.c
9718 echo '#define VOID_PTR void *' > try.c
9720 $cat >>try.c <<'EOCP'
9724 printf("%d\n", sizeof(VOID_PTR));
9729 if eval $compile_ok; then
9731 $echo " $ptrsize bytes." >&4
9734 echo "(I can't seem to compile the test program. Guessing...)" >&4
9735 rp="What is the size of a pointer (in bytes)?"
9743 : check for size of random number generator
9747 echo "Checking to see how many bits your rand function produces..." >&4
9753 # include <unistd.h>
9756 # include <stdlib.h>
9759 $cat >>try.c <<'EOCP'
9763 register unsigned long tmp;
9764 register unsigned long max = 0L;
9766 for (i = 1000; i; i--) {
9767 tmp = (unsigned long)rand();
9768 if (tmp > max) max = tmp;
9770 for (i = 0; max; i++)
9776 if eval $compile_ok; then
9780 echo "(I can't seem to compile the test program...)"
9787 rp='How many bits does your rand() function produce?'
9792 : see if ar generates random libraries by itself
9794 echo "Checking how to generate random libraries on your machine..." >&4
9795 echo 'int bar1() { return bar2(); }' > bar1.c
9796 echo 'int bar2() { return 2; }' > bar2.c
9797 $cat > foo.c <<'EOP'
9798 main() { printf("%d\n", bar1()); exit(0); }
9800 $cc $ccflags -c bar1.c >/dev/null 2>&1
9801 $cc $ccflags -c bar2.c >/dev/null 2>&1
9802 $cc $ccflags -c foo.c >/dev/null 2>&1
9803 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
9804 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
9805 ./foobar >/dev/null 2>&1; then
9806 echo "$ar appears to generate random libraries itself."
9809 elif $ar ts bar$_a >/dev/null 2>&1 &&
9810 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
9811 ./foobar >/dev/null 2>&1; then
9812 echo "a table of contents needs to be added with '$ar ts'."
9819 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
9820 $test -f $ranlib || ranlib=''
9823 if $test -n "$ranlib"; then
9824 echo "your system has '$ranlib'; we'll use that."
9827 echo "your system doesn't seem to support random libraries"
9828 echo "so we'll use lorder and tsort to order the libraries."
9835 : see if sys/select.h has to be included
9836 set sys/select.h i_sysselct
9839 : see if we should include time.h, sys/time.h, or both
9841 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9842 $echo $n "I'm now running the test program...$c"
9843 $cat >try.c <<'EOCP'
9844 #include <sys/types.h>
9849 #ifdef SYSTIMEKERNEL
9852 #include <sys/time.h>
9855 #include <sys/select.h>
9864 struct timezone tzp;
9866 if (foo.tm_sec == foo.tm_sec)
9869 if (bar.tv_sec == bar.tv_sec)
9876 for s_timezone in '-DS_TIMEZONE' ''; do
9878 for s_timeval in '-DS_TIMEVAL' ''; do
9879 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9880 for i_time in '' '-DI_TIME'; do
9881 for i_systime in '-DI_SYSTIME' ''; do
9884 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9885 if eval $compile; then
9886 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9890 $echo $n "Succeeded with $flags$c"
9902 *SYSTIMEKERNEL*) i_systimek="$define"
9903 timeincl=`./findhdr sys/time.h`
9904 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9905 *) i_systimek="$undef";;
9908 *I_TIME*) i_time="$define"
9909 timeincl=`./findhdr time.h`" $timeincl"
9910 echo "We'll include <time.h>." >&4;;
9911 *) i_time="$undef";;
9914 *I_SYSTIME*) i_systime="$define"
9915 timeincl=`./findhdr sys/time.h`" $timeincl"
9916 echo "We'll include <sys/time.h>." >&4;;
9917 *) i_systime="$undef";;
9921 : check for fd_set items
9924 Checking to see how well your C compiler handles fd_set and friends ...
9926 $cat >fd_set.c <<EOCP
9927 #$i_systime I_SYS_TIME
9928 #$i_sysselct I_SYS_SELECT
9929 #$d_socket HAS_SOCKET
9930 #include <sys/types.h>
9932 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9935 #include <sys/time.h>
9938 #include <sys/select.h>
9947 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9954 set fd_set -DTRYBITS
9955 if eval $compile; then
9956 d_fds_bits="$define"
9958 echo "Well, your system knows about the normal fd_set typedef..." >&4
9960 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9961 d_fd_macros="$define"
9964 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9966 d_fd_macros="$undef"
9970 Hmm, your compiler has some difficulty with fd_set. Checking further...
9973 if eval $compile; then
9976 echo "Well, your system has some sort of fd_set available..." >&4
9978 echo "and you have the normal fd_set macros." >&4
9979 d_fd_macros="$define"
9982 but not the normal fd_set macros! Gross! More work for me...
9984 d_fd_macros="$undef"
9987 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9990 d_fd_macros="$undef"
9995 : check for type of arguments to select.
9996 case "$selecttype" in
9997 '') case "$d_select" in
10000 Checking to see what type of arguments are accepted by select().
10002 hdrs="$define sys/types.h
10003 $i_systime sys/time.h
10004 $i_sysselct sys/select.h
10005 $d_socket sys/socket.h"
10006 : The first arg can be int, unsigned, or size_t
10007 : The last arg may or may not be 'const'
10009 for xxx in 'fd_set *' 'int *'; do
10010 for nfd in 'int' 'size_t' 'unsigned' ; do
10011 for tmo in 'struct timeval *' 'const struct timeval *'; do
10013 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
10014 if ./protochk "$try" $hdrs; then
10015 echo "Your system accepts $xxx."
10024 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
10025 case "$d_fd_set" in
10026 $define) dflt="fd_set *" ;;
10035 *) : no select, so pick a harmless default
10042 : Trace out the files included by signal.h, then look for SIGxxx names.
10043 : Remove SIGARRAYSIZE used by HPUX.
10044 : Remove SIGTYP void lines used by OS2.
10045 xxx=`echo '#include <signal.h>' |
10046 $cppstdin $cppminus $cppflags 2>/dev/null |
10047 $grep '^[ ]*#.*include' |
10048 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
10049 : Check this list of files to be sure we have parsed the cpp output ok.
10050 : This will also avoid potentially non-existent files, such
10053 for xx in $xxx /dev/null ; do
10054 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
10056 : If we have found no files, at least try signal.h
10057 case "$xxxfiles" in
10058 '') xxxfiles=`./findhdr signal.h` ;;
10061 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
10062 print substr($2, 4, 20)
10064 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
10065 print substr($3, 4, 20)
10067 : Append some common names just in case the awk scan failed.
10068 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
10069 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
10070 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
10071 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
10072 : generate a few handy files for later
10073 $cat > signal.c <<'EOCP'
10074 #include <sys/types.h>
10075 #include <signal.h>
10079 /* Strange style to avoid deeply-nested #if/#else/#endif */
10082 # define NSIG (_NSIG)
10088 # define NSIG (SIGMAX+1)
10094 # define NSIG (SIG_MAX+1)
10100 # define NSIG (MAXSIG+1)
10106 # define NSIG (MAX_SIG+1)
10111 # ifdef SIGARRAYSIZE
10112 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
10118 # define NSIG (_sys_nsig) /* Solaris 2.5 */
10122 /* Default to some arbitrary number that's big enough to get most
10123 of the common signals.
10129 printf("NSIG %d\n", NSIG);
10135 echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk '
10137 printf "#ifdef SIG"; printf $1; printf "\n"
10138 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
10139 printf $1; printf ");\n"
10143 printf "#endif /* JUST_NSIG */\n";
10147 $cat >signal.awk <<'EOP'
10148 BEGIN { ndups = 0 }
10149 $1 ~ /^NSIG$/ { nsig = $2 }
10150 ($1 !~ /^NSIG$/) && (NF == 2) {
10151 if ($2 > maxsig) { maxsig = $2 }
10152 if (sig_name[$2]) {
10153 dup_name[ndups] = $1
10154 dup_num[ndups] = $2
10164 if (nsig == 0) { nsig = maxsig + 1 }
10165 for (n = 1; n < nsig; n++) {
10167 printf("%s %d\n", sig_name[n], sig_num[n])
10170 printf("NUM%d %d\n", n, n)
10173 for (n = 0; n < ndups; n++) {
10174 printf("%s %d\n", dup_name[n], dup_num[n])
10178 $cat >signal_cmd <<EOS
10180 if $test -s signal.lst; then
10181 echo "Using your existing signal.lst file"
10186 $cat >>signal_cmd <<'EOS'
10189 if eval $compile_ok; then
10190 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10192 echo "(I can't seem be able to compile the whole test program)" >&4
10193 echo "(I'll try it in little pieces.)" >&4
10194 set signal -DJUST_NSIG
10195 if eval $compile_ok; then
10196 ./signal$_exe > signal.nsg
10199 echo "I can't seem to figure out how many signals you have." >&4
10200 echo "Guessing 50." >&4
10201 echo 'NSIG 50' > signal.nsg
10203 : Now look at all the signal names, one at a time.
10204 for xx in `echo $xxx | $tr ' ' '\012' | $sort | $uniq`; do
10205 $cat > signal.c <<EOCP
10206 #include <sys/types.h>
10207 #include <signal.h>
10210 printf("$xx %d\n", SIG${xx});
10215 if eval $compile; then
10216 echo "SIG${xx} found."
10217 ./signal$_exe >> signal.ls1
10219 echo "SIG${xx} NOT found."
10222 if $test -s signal.ls1; then
10223 $cat signal.nsg signal.ls1 |
10224 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10228 if $test -s signal.lst; then
10231 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
10232 echo 'kill -l' >signal
10233 set X `csh -f <signal`
10237 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
10239 echo $@ | $tr ' ' '\012' | \
10240 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
10242 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
10244 chmod a+x signal_cmd
10245 $eunicefix signal_cmd
10247 : generate list of signal names
10249 case "$sig_name_init" in
10251 echo "Generating a list of signal names and numbers..." >&4
10253 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
10254 sig_name="ZERO $sig_name"
10255 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
10256 { printf "\"%s\", ", $1 }
10257 END { printf "0\n" }' signal.lst`
10258 sig_num=`$awk 'BEGIN { printf "0, " }
10259 { printf "%d, ", $2}
10260 END { printf "0\n"}' signal.lst`
10263 echo "The following signals are available:"
10265 echo $sig_name | $awk \
10266 'BEGIN { linelen = 0 }
10268 for (i = 1; i <= NF; i++) {
10269 name = "SIG" $i " "
10270 linelen = linelen + length(name)
10271 if (linelen > 70) {
10273 linelen = length(name)
10279 $rm -f signal signal.c signal.awk signal.lst signal_cmd
10281 : see what type is used for signed size_t
10282 set ssize_t ssizetype int stdio.h sys/types.h
10285 $cat > ssize.c <<EOM
10287 #include <sys/types.h>
10288 #define Size_t $sizetype
10289 #define SSize_t $dflt
10292 if (sizeof(Size_t) == sizeof(SSize_t))
10294 else if (sizeof(Size_t) == sizeof(int))
10303 if eval $compile_ok && ./ssize > /dev/null; then
10304 ssizetype=`./ssize`
10305 echo "I'll be using $ssizetype for functions returning a byte count." >&4
10308 Help! I can't compile and run the ssize_t test program: please enlighten me!
10309 (This is probably a misconfiguration in your system or libraries, and
10310 you really ought to fix it. Still, I'll try anyway.)
10312 I need a type that is the same size as $sizetype, but is guaranteed to
10313 be signed. Common values are ssize_t, int and long.
10316 rp="What signed type is the same size as $sizetype?"
10320 $rm -f ssize ssize.*
10322 : see what type of char stdio uses.
10324 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
10325 echo "Your stdio uses unsigned chars." >&4
10326 stdchar="unsigned char"
10328 echo "Your stdio uses signed chars." >&4
10332 : see if time exists
10334 if set time val -f d_time; eval $csym; $val; then
10335 echo 'time() found.' >&4
10337 rp="What is the type returned by time() on this system?"
10338 set time_t timetype long stdio.h sys/types.h
10341 echo 'time() not found, hope that will do.' >&4
10348 : see what type uids are declared as in the kernel
10350 echo "Looking for the type for user ids returned by getuid()."
10351 set uid_t uidtype xxx stdio.h sys/types.h
10355 xxx=`./findhdr sys/user.h`
10356 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
10358 unsigned) dflt="$1 $2" ;;
10362 *) dflt="$uidtype";;
10365 uid_t) echo "uid_t found." ;;
10366 *) rp="What is the type for user ids returned by getuid()?"
10372 : see if dbm.h is available
10373 : see if dbmclose exists
10374 set dbmclose d_dbmclose
10377 case "$d_dbmclose" in
10387 *) set rpcsvc/dbm.h i_rpcsvcdbm
10392 *) echo "We won't be including <dbm.h>"
10402 : see if this is a sys/file.h system
10407 : do we need to include sys/file.h ?
10411 if $h_sysfile; then
10413 echo "We'll be including <sys/file.h>." >&4
10416 echo "We won't be including <sys/file.h>." >&4
10426 : see if fcntl.h is there
10431 : see if we can include fcntl.h
10437 echo "We'll be including <fcntl.h>." >&4
10440 if $h_sysfile; then
10441 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10443 echo "We won't be including <fcntl.h>." >&4
10455 : see if this is an grp system
10459 : see if locale.h is available
10460 set locale.h i_locale
10463 : see if this is a math.h system
10467 : see if ndbm.h is available
10472 : see if dbm_open exists
10473 set dbm_open d_dbm_open
10475 case "$d_dbm_open" in
10478 echo "We won't be including <ndbm.h>"
10487 : see if net/errno.h is available
10489 set net/errno.h val
10492 : Unfortunately, it causes problems on some systems. Arrgh.
10495 cat > try.c <<'EOM'
10498 #include <net/errno.h>
10504 if $cc $ccflags -c try.c >/dev/null 2>&1; then
10505 echo "We'll be including <net/errno.h>." >&4
10507 echo "We won't be including <net/errno.h>." >&4
10516 : get C preprocessor symbols handy
10518 $echo $n "Hmm... $c"
10519 echo $al | $tr ' ' '\012' >Cppsym.know
10520 $cat <<EOSS >Cppsym
10528 case "\$list\$#" in
10531 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
10533 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
10536 unknown="\$unknown \$sym"
10546 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
10548 exit 0; _ _ _ _\1\\ \1\\
10551 echo "exit 1; _ _ _" >>Cppsym\$\$
10552 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
10554 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
10560 $rm -f Cppsym\$\$ Cppsym2\$\$
10565 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
10567 : now check the C compiler for additional symbols
10573 for i in \`$cc -v -c tmp.c 2>&1\`
10576 -D*) echo "\$i" | $sed 's/^-D//';;
10577 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
10584 ./ccsym | $sort | $uniq >ccsym.raw
10585 $awk '/\=/ { print $0; next }
10586 { print $0"=1" }' ccsym.raw >ccsym.list
10587 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
10588 $comm -13 ccsym.true ccsym.list >ccsym.own
10589 $comm -12 ccsym.true ccsym.list >ccsym.com
10590 $comm -23 ccsym.true ccsym.list >ccsym.cpp
10593 if $test -z ccsym.raw; then
10594 echo "Your C compiler doesn't seem to define any symbol!" >&4
10596 echo "However, your C preprocessor defines the following ones:"
10599 if $test -s ccsym.com; then
10600 echo "Your C compiler and pre-processor define these symbols:"
10601 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
10604 $test "$silent" || sleep 1
10606 if $test -s ccsym.cpp; then
10607 $test "$also" && echo " "
10608 echo "Your C pre-processor ${also}defines the following $symbols:"
10609 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
10611 $test "$silent" || sleep 1
10613 if $test -s ccsym.own; then
10614 $test "$also" && echo " "
10615 echo "Your C compiler ${also}defines the following cpp variables:"
10616 $sed -e 's/\(.*\)=1/\1/' ccsym.own
10617 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
10618 $test "$silent" || sleep 1
10623 : see if this is a termio system
10627 if $test `./findhdr termios.h`; then
10628 set tcsetattr i_termios
10634 "$define") echo "You have POSIX termios.h... good!" >&4;;
10635 *) if ./Cppsym pyr; then
10636 case "`/bin/universe`" in
10637 ucb) if $test `./findhdr sgtty.h`; then
10639 echo "<sgtty.h> found." >&4
10641 echo "System is pyramid with BSD universe."
10642 echo "<sgtty.h> not found--you could have problems." >&4
10644 *) if $test `./findhdr termio.h`; then
10646 echo "<termio.h> found." >&4
10648 echo "System is pyramid with USG universe."
10649 echo "<termio.h> not found--you could have problems." >&4
10653 if $test `./findhdr termio.h`; then
10654 echo "<termio.h> found." >&4
10656 elif $test `./findhdr sgtty.h`; then
10657 echo "<sgtty.h> found." >&4
10660 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
10663 if $test `./findhdr sgtty.h`; then
10664 echo "<sgtty.h> found." >&4
10666 elif $test `./findhdr termio.h`; then
10667 echo "<termio.h> found." >&4
10670 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
10674 set i_termio; eval $setvar
10675 val=$val2; set i_sgtty; eval $setvar
10676 val=$val3; set i_termios; eval $setvar
10678 : see if stdarg is available
10680 if $test `./findhdr stdarg.h`; then
10681 echo "<stdarg.h> found." >&4
10684 echo "<stdarg.h> NOT found." >&4
10688 : see if varags is available
10690 if $test `./findhdr varargs.h`; then
10691 echo "<varargs.h> found." >&4
10693 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10696 : set up the varargs testing programs
10697 $cat > varargs.c <<EOP
10699 #include <stdarg.h>
10702 #include <varargs.h>
10706 int f(char *p, ...)
10720 p = va_arg(ap, char *);
10725 $cat > varargs <<EOP
10727 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10736 : now check which varargs header should be included
10741 if `./varargs I_STDARG`; then
10743 elif `./varargs I_VARARGS`; then
10748 if `./varargs I_VARARGS`; then
10755 echo "I could not find the definition for va_dcl... You have problems..." >&4
10756 val="$undef"; set i_stdarg; eval $setvar
10757 val="$undef"; set i_varargs; eval $setvar
10762 case "$i_varhdr" in
10764 val="$define"; set i_stdarg; eval $setvar
10765 val="$undef"; set i_varargs; eval $setvar
10768 val="$undef"; set i_stdarg; eval $setvar
10769 val="$define"; set i_varargs; eval $setvar
10772 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10776 : see if stddef is available
10777 set stddef.h i_stddef
10780 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
10781 set sys/filio.h i_sysfilio
10784 if $test `./findhdr sys/ioctl.h`; then
10786 echo '<sys/ioctl.h> found.' >&4
10789 if $test $i_sysfilio = "$define"; then
10790 echo '<sys/ioctl.h> NOT found.' >&4
10792 $test $i_sgtty = "$define" && xxx="sgtty.h"
10793 $test $i_termio = "$define" && xxx="termio.h"
10794 $test $i_termios = "$define" && xxx="termios.h"
10795 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
10801 : see if this is a sys/param system
10802 set sys/param.h i_sysparam
10805 : see if sys/resource.h has to be included
10806 set sys/resource.h i_sysresrc
10809 : see if sys/stat.h is available
10810 set sys/stat.h i_sysstat
10813 : see if sys/types.h has to be included
10814 set sys/types.h i_systypes
10817 : see if this is a sys/un.h system
10818 set sys/un.h i_sysun
10821 : see if this is a syswait system
10822 set sys/wait.h i_syswait
10825 : see if this is an utime system
10826 set utime.h i_utime
10829 : see if this is a values.h system
10830 set values.h i_values
10833 : see if this is a vfork system
10836 set vfork.h i_vfork
10844 : see if gdbm.h is available
10849 : see if gdbm_open exists
10850 set gdbm_open d_gdbm_open
10852 case "$d_gdbm_open" in
10855 echo "We won't be including <gdbm.h>"
10865 echo "Looking for extensions..." >&4
10868 : If we are using the old config.sh, known_extensions may contain
10869 : old or inaccurate or duplicate values.
10870 known_extensions=''
10871 nonxs_extensions=''
10872 : We do not use find because it might not be available.
10873 : We do not just use MANIFEST because the user may have dropped
10874 : some additional extensions into the source tree and expect them
10879 *) if $test -f $xxx/$xxx.xs; then
10880 known_extensions="$known_extensions $xxx"
10882 if $test -d $xxx; then
10884 zzz=$known_extensions
10886 if $test -f $yyy/$yyy.xs; then
10887 known_extensions="$known_extensions $xxx/$yyy"
10891 if $test "$zzz" = "$known_extensions"; then
10892 if $test -f $xxx/Makefile.PL; then
10893 known_extensions="$known_extensions $xxx"
10894 nonxs_extensions="$nonxs_extensions $xxx"
10902 set X $nonxs_extensions
10904 nonxs_extensions="$*"
10905 set X $known_extensions
10907 known_extensions="$*"
10910 : Now see which are supported on this system.
10912 for xxx in $known_extensions ; do
10916 $define) avail_ext="$avail_ext $xxx" ;;
10919 GDBM_File|gdbm_fil)
10921 $define) avail_ext="$avail_ext $xxx" ;;
10924 NDBM_File|ndbm_fil)
10926 $define) avail_ext="$avail_ext $xxx" ;;
10929 ODBM_File|odbm_fil)
10930 case "${i_dbm}${i_rpcsvcdbm}" in
10931 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
10935 case "$useposix" in
10936 true|define|y) avail_ext="$avail_ext $xxx" ;;
10940 case "$useopcode" in
10941 true|define|y) avail_ext="$avail_ext $xxx" ;;
10945 case "$d_socket" in
10946 true|$define|y) avail_ext="$avail_ext $xxx" ;;
10950 case "$usethreads" in
10951 true|$define|y) avail_ext="$avail_ext $xxx" ;;
10955 case " $nonxs_extensions " in
10957 *) avail_ext="$avail_ext $xxx" ;;
10967 : Now see which nonxs extensions are supported on this system.
10969 for xxx in $nonxs_extensions ; do
10971 *) nonxs_ext="$nonxs_ext $xxx"
10983 A number of extensions are supplied with $package. You may choose to
10984 compile these extensions for dynamic loading (the default), compile
10985 them into the $package executable (static loading), or not include
10986 them at all. Answer "none" to include no extensions.
10987 Note that DynaLoader is always built and need not be mentioned here.
10990 case "$dynamic_ext" in
10991 '') dflt="$avail_ext" ;;
10992 *) dflt="$dynamic_ext"
10993 # Perhaps we are reusing an old out-of-date config.sh.
10996 if test X"$dynamic_ext" != X"$avail_ext"; then
10998 NOTICE: Your previous config.sh list may be incorrect.
10999 The extensions now available to you are
11001 but the default list from your previous config.sh is
11010 : Exclude those that are not xs extensions
11014 rp="What extensions do you wish to load dynamically?"
11017 none) dynamic_ext=' ' ;;
11018 *) dynamic_ext="$ans" ;;
11021 case "$static_ext" in
11023 : Exclude those already listed in dynamic linking
11025 for xxx in $avail_ext; do
11026 case " $dynamic_ext $nonxs_ext " in
11028 *) dflt="$dflt $xxx" ;;
11035 *) dflt="$static_ext"
11042 rp="What extensions do you wish to load statically?"
11045 none) static_ext=' ' ;;
11046 *) static_ext="$ans" ;;
11051 A number of extensions are supplied with $package. Answer "none"
11052 to include no extensions.
11053 Note that DynaLoader is always built and need not be mentioned here.
11056 case "$static_ext" in
11057 '') dflt="$avail_ext" ;;
11058 *) dflt="$static_ext"
11059 # Perhaps we are reusing an old out-of-date config.sh.
11062 if test X"$static_ext" != X"$avail_ext"; then
11064 NOTICE: Your previous config.sh list may be incorrect.
11065 The extensions now available to you are
11067 but the default list from your previous config.sh is
11079 rp="What extensions do you wish to include?"
11082 none) static_ext=' ' ;;
11083 *) static_ext="$ans" ;;
11088 set X $dynamic_ext $static_ext
11092 : Remove build directory name from cppstdin so it can be used from
11093 : either the present location or the final installed location.
11095 : Get out of the UU directory to get correct path name.
11097 case "$cppstdin" in
11099 echo "Stripping down cppstdin path name"
11105 : end of configuration questions
11107 echo "End of configuration questions."
11110 : back to where it started
11111 if test -d ../UU; then
11115 : configuration may be patched via a 'config.over' file
11116 if $test -f config.over; then
11119 rp='I see a config.over file. Do you wish to load it?'
11122 n*) echo "OK, I'll ignore it.";;
11124 echo "Configuration override changes have been loaded."
11129 : in case they want portability, strip down executable paths
11130 case "$d_portable" in
11133 echo "Stripping down executable paths..." >&4
11134 for file in $loclist $trylist; do
11135 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
11136 eval $file="\$file"
11142 : create config.sh file
11144 echo "Creating config.sh..." >&4
11145 $spitshell <<EOT >config.sh
11148 # This file was produced by running the Configure script. It holds all the
11149 # definitions figured out by Configure. Should you modify one of these values,
11150 # do not forget to propagate your changes by running "Configure -der". You may
11151 # instead choose to run each of the .SH files by yourself, or "Configure -S".
11154 # Package name : $package
11155 # Source directory : $src
11156 # Configuration time: $cf_time
11157 # Configured by : $cf_by
11158 # Target system : $myuname
11168 Revision='$Revision'
11175 alignbytes='$alignbytes'
11176 ansi2knr='$ansi2knr'
11177 aphostname='$aphostname'
11180 archlibexp='$archlibexp'
11181 archname='$archname'
11182 archobjs='$archobjs'
11190 byteorder='$byteorder'
11192 castflags='$castflags'
11195 cccdlflags='$cccdlflags'
11196 ccdlflags='$ccdlflags'
11199 cf_email='$cf_email'
11204 clocktype='$clocktype'
11206 compress='$compress'
11207 contains='$contains'
11211 cpp_stuff='$cpp_stuff'
11212 cppflags='$cppflags'
11214 cppminus='$cppminus'
11216 cppstdin='$cppstdin'
11217 cryptlib='$cryptlib'
11219 d_Gconvert='$d_Gconvert'
11220 d_access='$d_access'
11222 d_archlib='$d_archlib'
11223 d_attribut='$d_attribut'
11227 d_bsdgetpgrp='$d_bsdgetpgrp'
11228 d_bsdsetpgrp='$d_bsdsetpgrp'
11230 d_casti32='$d_casti32'
11231 d_castneg='$d_castneg'
11232 d_charvspr='$d_charvspr'
11234 d_chroot='$d_chroot'
11235 d_chsize='$d_chsize'
11236 d_closedir='$d_closedir'
11240 d_cuserid='$d_cuserid'
11241 d_dbl_dig='$d_dbl_dig'
11242 d_difftime='$d_difftime'
11243 d_dirnamlen='$d_dirnamlen'
11244 d_dlerror='$d_dlerror'
11245 d_dlopen='$d_dlopen'
11246 d_dlsymun='$d_dlsymun'
11247 d_dosuid='$d_dosuid'
11249 d_endhent='$d_endhent'
11250 d_endnent='$d_endnent'
11251 d_endpent='$d_endpent'
11252 d_endsent='$d_endsent'
11253 d_eofnblk='$d_eofnblk'
11254 d_eunice='$d_eunice'
11255 d_fchmod='$d_fchmod'
11256 d_fchown='$d_fchown'
11258 d_fd_macros='$d_fd_macros'
11259 d_fd_set='$d_fd_set'
11260 d_fds_bits='$d_fds_bits'
11261 d_fgetpos='$d_fgetpos'
11262 d_flexfnam='$d_flexfnam'
11265 d_fpathconf='$d_fpathconf'
11266 d_fsetpos='$d_fsetpos'
11268 d_getgrps='$d_getgrps'
11269 d_gethbyaddr='$d_gethbyaddr'
11270 d_gethbyname='$d_gethbyname'
11271 d_gethent='$d_gethent'
11272 d_gethname='$d_gethname'
11273 d_gethostprotos='$d_gethostprotos'
11274 d_getlogin='$d_getlogin'
11275 d_getnbyaddr='$d_getnbyaddr'
11276 d_getnbyname='$d_getnbyname'
11277 d_getnent='$d_getnent'
11278 d_getnetprotos='$d_getnetprotos'
11279 d_getpbyname='$d_getpbyname'
11280 d_getpbynumber='$d_getpbynumber'
11281 d_getpent='$d_getpent'
11282 d_getpgid='$d_getpgid'
11283 d_getpgrp2='$d_getpgrp2'
11284 d_getpgrp='$d_getpgrp'
11285 d_getppid='$d_getppid'
11286 d_getprior='$d_getprior'
11287 d_getprotoprotos='$d_getprotoprotos'
11288 d_getsbyname='$d_getsbyname'
11289 d_getsbyport='$d_getsbyport'
11290 d_getsent='$d_getsent'
11291 d_getservprotos='$d_getservprotos'
11292 d_gettimeod='$d_gettimeod'
11293 d_gnulibc='$d_gnulibc'
11296 d_inetaton='$d_inetaton'
11297 d_isascii='$d_isascii'
11298 d_killpg='$d_killpg'
11299 d_lchown='$d_lchown'
11301 d_locconv='$d_locconv'
11303 d_longdbl='$d_longdbl'
11304 d_longlong='$d_longlong'
11307 d_mbstowcs='$d_mbstowcs'
11308 d_mbtowc='$d_mbtowc'
11309 d_memcmp='$d_memcmp'
11310 d_memcpy='$d_memcpy'
11311 d_memmove='$d_memmove'
11312 d_memset='$d_memset'
11314 d_mkfifo='$d_mkfifo'
11315 d_mktime='$d_mktime'
11317 d_msgctl='$d_msgctl'
11318 d_msgget='$d_msgget'
11319 d_msgrcv='$d_msgrcv'
11320 d_msgsnd='$d_msgsnd'
11321 d_mymalloc='$d_mymalloc'
11323 d_oldpthreads='$d_oldpthreads'
11324 d_oldsock='$d_oldsock'
11326 d_pathconf='$d_pathconf'
11328 d_phostname='$d_phostname'
11331 d_portable='$d_portable'
11332 d_pthread_yield='$d_pthread_yield'
11333 d_pthreads_created_joinable='$d_pthreads_created_joinable'
11335 d_pwchange='$d_pwchange'
11336 d_pwclass='$d_pwclass'
11337 d_pwcomment='$d_pwcomment'
11338 d_pwexpire='$d_pwexpire'
11339 d_pwgecos='$d_pwgecos'
11340 d_pwquota='$d_pwquota'
11341 d_readdir='$d_readdir'
11342 d_readlink='$d_readlink'
11343 d_rename='$d_rename'
11344 d_rewinddir='$d_rewinddir'
11346 d_safebcpy='$d_safebcpy'
11347 d_safemcpy='$d_safemcpy'
11348 d_sanemcmp='$d_sanemcmp'
11349 d_sched_yield='$d_sched_yield'
11350 d_seekdir='$d_seekdir'
11351 d_select='$d_select'
11353 d_semctl='$d_semctl'
11354 d_semctl_semid_ds='$d_semctl_semid_ds'
11355 d_semctl_semun='$d_semctl_semun'
11356 d_semget='$d_semget'
11358 d_setegid='$d_setegid'
11359 d_seteuid='$d_seteuid'
11360 d_setgrps='$d_setgrps'
11361 d_sethent='$d_sethent'
11362 d_setlinebuf='$d_setlinebuf'
11363 d_setlocale='$d_setlocale'
11364 d_setnent='$d_setnent'
11365 d_setpent='$d_setpent'
11366 d_setpgid='$d_setpgid'
11367 d_setpgrp2='$d_setpgrp2'
11368 d_setpgrp='$d_setpgrp'
11369 d_setprior='$d_setprior'
11370 d_setregid='$d_setregid'
11371 d_setresgid='$d_setresgid'
11372 d_setresuid='$d_setresuid'
11373 d_setreuid='$d_setreuid'
11374 d_setrgid='$d_setrgid'
11375 d_setruid='$d_setruid'
11376 d_setsent='$d_setsent'
11377 d_setsid='$d_setsid'
11378 d_setvbuf='$d_setvbuf'
11382 d_shmatprototype='$d_shmatprototype'
11383 d_shmctl='$d_shmctl'
11385 d_shmget='$d_shmget'
11386 d_sigaction='$d_sigaction'
11387 d_sigsetjmp='$d_sigsetjmp'
11388 d_socket='$d_socket'
11389 d_sockpair='$d_sockpair'
11390 d_statblks='$d_statblks'
11391 d_stdio_cnt_lval='$d_stdio_cnt_lval'
11392 d_stdio_ptr_lval='$d_stdio_ptr_lval'
11393 d_stdiobase='$d_stdiobase'
11394 d_stdstdio='$d_stdstdio'
11395 d_strchr='$d_strchr'
11396 d_strcoll='$d_strcoll'
11397 d_strctcpy='$d_strctcpy'
11398 d_strerrm='$d_strerrm'
11399 d_strerror='$d_strerror'
11400 d_strtod='$d_strtod'
11401 d_strtol='$d_strtol'
11402 d_strtoul='$d_strtoul'
11403 d_strxfrm='$d_strxfrm'
11404 d_suidsafe='$d_suidsafe'
11405 d_symlink='$d_symlink'
11406 d_syscall='$d_syscall'
11407 d_sysconf='$d_sysconf'
11408 d_sysernlst='$d_sysernlst'
11409 d_syserrlst='$d_syserrlst'
11410 d_system='$d_system'
11411 d_tcgetpgrp='$d_tcgetpgrp'
11412 d_tcsetpgrp='$d_tcsetpgrp'
11413 d_telldir='$d_telldir'
11416 d_truncate='$d_truncate'
11417 d_tzname='$d_tzname'
11420 d_union_semun='$d_union_semun'
11422 d_void_closedir='$d_void_closedir'
11423 d_voidsig='$d_voidsig'
11424 d_voidtty='$d_voidtty'
11425 d_volatile='$d_volatile'
11426 d_vprintf='$d_vprintf'
11428 d_waitpid='$d_waitpid'
11429 d_wcstombs='$d_wcstombs'
11430 d_wctomb='$d_wctomb'
11433 db_hashtype='$db_hashtype'
11434 db_prefixtype='$db_prefixtype'
11435 defvoidused='$defvoidused'
11436 direntrytype='$direntrytype'
11439 doublesize='$doublesize'
11440 dynamic_ext='$dynamic_ext'
11445 eunicefix='$eunicefix'
11448 extensions='$extensions'
11450 firstmakefile='$firstmakefile'
11452 fpostype='$fpostype'
11453 freetype='$freetype'
11454 full_csh='$full_csh'
11455 full_sed='$full_sed'
11456 gccversion='$gccversion'
11460 groupcat='$groupcat'
11461 groupstype='$groupstype'
11464 h_sysfile='$h_sysfile'
11468 i_bsdioctl='$i_bsdioctl'
11471 i_dirent='$i_dirent'
11478 i_limits='$i_limits'
11479 i_locale='$i_locale'
11480 i_malloc='$i_malloc'
11482 i_memory='$i_memory'
11485 i_neterrno='$i_neterrno'
11488 i_rpcsvcdbm='$i_rpcsvcdbm'
11491 i_stdarg='$i_stdarg'
11492 i_stddef='$i_stddef'
11493 i_stdlib='$i_stdlib'
11494 i_string='$i_string'
11495 i_sysdir='$i_sysdir'
11496 i_sysfile='$i_sysfile'
11497 i_sysfilio='$i_sysfilio'
11499 i_sysioctl='$i_sysioctl'
11500 i_sysndir='$i_sysndir'
11501 i_sysparam='$i_sysparam'
11502 i_sysresrc='$i_sysresrc'
11503 i_sysselct='$i_sysselct'
11504 i_syssockio='$i_syssockio'
11505 i_sysstat='$i_sysstat'
11506 i_systime='$i_systime'
11507 i_systimek='$i_systimek'
11508 i_systimes='$i_systimes'
11509 i_systypes='$i_systypes'
11511 i_syswait='$i_syswait'
11512 i_termio='$i_termio'
11513 i_termios='$i_termios'
11515 i_unistd='$i_unistd'
11517 i_values='$i_values'
11518 i_varargs='$i_varargs'
11519 i_varhdr='$i_varhdr'
11523 installarchlib='$installarchlib'
11524 installbin='$installbin'
11525 installman1dir='$installman1dir'
11526 installman3dir='$installman3dir'
11527 installprivlib='$installprivlib'
11528 installscript='$installscript'
11529 installsitearch='$installsitearch'
11530 installsitelib='$installsitelib'
11532 known_extensions='$known_extensions'
11536 lddlflags='$lddlflags'
11544 libswanted='$libswanted'
11550 locincpth='$locincpth'
11551 loclibpth='$loclibpth'
11552 longdblsize='$longdblsize'
11553 longlongsize='$longlongsize'
11554 longsize='$longsize'
11558 lseektype='$lseektype'
11562 make_set_make='$make_set_make'
11563 mallocobj='$mallocobj'
11564 mallocsrc='$mallocsrc'
11565 malloctype='$malloctype'
11567 man1direxp='$man1direxp'
11570 man3direxp='$man3direxp'
11574 mips_type='$mips_type'
11577 modetype='$modetype'
11580 myarchname='$myarchname'
11581 mydomain='$mydomain'
11582 myhostname='$myhostname'
11585 netdb_hlen_type='$netdb_hlen_type'
11586 netdb_host_type='$netdb_host_type'
11587 netdb_name_type='$netdb_name_type'
11588 netdb_net_type='$netdb_net_type'
11591 nm_so_opt='$nm_so_opt'
11593 o_nonblock='$o_nonblock'
11595 optimize='$optimize'
11596 orderlib='$orderlib'
11602 patchlevel='$patchlevel'
11603 path_sep='$path_sep'
11605 perladmin='$perladmin'
11606 perlpath='$perlpath'
11607 nonxs_ext='$nonxs_ext'
11609 phostname='$phostname'
11615 prefixexp='$prefixexp'
11617 privlibexp='$privlibexp'
11618 prototype='$prototype'
11620 randbits='$randbits'
11622 rd_nodata='$rd_nodata'
11626 scriptdir='$scriptdir'
11627 scriptdirexp='$scriptdirexp'
11629 selecttype='$selecttype'
11630 sendmail='$sendmail'
11633 sharpbang='$sharpbang'
11634 shmattype='$shmattype'
11635 shortsize='$shortsize'
11638 sig_name='$sig_name'
11639 sig_name_init='$sig_name_init'
11641 signal_t='$signal_t'
11642 sitearch='$sitearch'
11643 sitearchexp='$sitearchexp'
11645 sitelibexp='$sitelibexp'
11646 sizetype='$sizetype'
11651 sockethdr='$sockethdr'
11652 socketlib='$socketlib'
11654 spackage='$spackage'
11655 spitshell='$spitshell'
11658 ssizetype='$ssizetype'
11659 startperl='$startperl'
11661 static_ext='$static_ext'
11663 stdio_base='$stdio_base'
11664 stdio_bufsiz='$stdio_bufsiz'
11665 stdio_cnt='$stdio_cnt'
11666 stdio_filbuf='$stdio_filbuf'
11667 stdio_ptr='$stdio_ptr'
11670 subversion='$subversion'
11677 timeincl='$timeincl'
11678 timetype='$timetype'
11686 usemymalloc='$usemymalloc'
11688 useopcode='$useopcode'
11689 useperlio='$useperlio'
11690 useposix='$useposix'
11692 useshrplib='$useshrplib'
11693 usethreads='$usethreads'
11694 usevfork='$usevfork'
11698 voidflags='$voidflags'
11704 : Add in command line options if available
11705 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
11707 : add special variables
11708 $test -f $src/patchlevel.h && \
11709 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
11710 echo "CONFIG=true" >>config.sh
11712 : propagate old symbols
11713 if $test -f UU/config.sh; then
11714 <UU/config.sh sort | uniq >UU/oldconfig.sh
11715 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
11716 sort | uniq -u >UU/oldsyms
11717 set X `cat UU/oldsyms`
11723 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
11725 echo "# Variables propagated from previous config.sh file." >>config.sh
11726 for sym in `cat UU/oldsyms`; do
11727 echo " Propagating $hint variable "'$'"$sym..."
11728 eval 'tmp="$'"${sym}"'"'
11730 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
11736 : Finish up by extracting the .SH files
11750 If you'd like to make any changes to the config.sh file before I begin
11751 to configure things, do it as a shell escape now (e.g. !vi config.sh).
11754 rp="Press return or use a shell escape to edit config.sh:"
11759 *) : in case they cannot read
11760 sh 1>&4 -c "$ans";;
11765 : if this fails, just run all the .SH files by hand
11772 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
11779 Now you need to generate make dependencies by running "make depend".
11780 You might prefer to run it in background: "make depend > makedepend.out &"
11781 It can take a while, so you might not want to run it right now.
11786 rp="Run make depend now?"
11790 make depend && echo "Now you must run a make."
11793 echo "You must run 'make depend' then 'make'."
11796 elif test -f [Mm]akefile; then
11798 echo "Now you must run a make."
11803 if $test -f Policy.sh; then
11806 If you compile $package on a different machine or from a different object
11807 directory, copy the Policy.sh file from this object directory to the
11808 new one before you run Configure -- this will help you with most of
11809 the policy defaults.
11813 if $test -f config.msg; then
11814 echo "Hmm. I also noted the following information while running:"
11816 $cat config.msg >&4
11819 $rm -f kit*isdone ark*isdone