3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Fri Sep 13 16:29:01 METDST 2002 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
68 case "X${MACHTYPE:-nonesuchmach}" in
76 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
77 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
78 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
79 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
80 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
81 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
82 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
83 paths="$paths /sbin /usr/sbin /usr/libexec"
84 paths="$paths /system/gnu_library/bin"
90 *) test -d $p && PATH=$PATH$p_$p ;;
97 : shall we be using ksh?
103 if (PATH=.; alias -x) >/dev/null 2>&1; then
106 if test -f /hp-ux -a -f /bin/ksh; then
107 needksh='to avoid sh bug in "here document" expansion'
109 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
110 if test X`/usr/bin/uname -v` = X4; then
111 avoidksh="to avoid AIX 4's /bin/sh"
115 if test -f /osf_boot -a -f /usr/sbin/setld; then
116 if test X`/usr/bin/uname -s` = XOSF1; then
117 avoidksh="to avoid Digital UNIX' ksh"
119 unset BIN_SH # if this is 'xpg4' sh will start up ksh
122 case "$inksh/$needksh" in
129 case "$inksh/$avoidksh" in
135 case "$inksh/$needksh-$avoidksh-" in
138 (I see you are using the Korn shell. Some ksh's blow up on $me,
139 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
146 echo "(Feeding myself to $newsh $reason.)"
148 Configure|*/Configure) exec $newsh $0 "$@";;
149 *) exec $newsh Configure "$@";;
154 : if needed set CDPATH to a harmless value that is not chatty
155 : avoid bash 2.02 problems with empty CDPATH.
159 *bash*) CDPATH='.' ;;
164 : Configure runs within the UU subdirectory
165 test -d UU || mkdir UU
373 endhostent_r_proto=''
379 endprotoent_r_proto=''
385 endservent_r_proto=''
435 gethostbyaddr_r_proto=''
437 gethostbyname_r_proto=''
439 gethostent_r_proto=''
451 getnetbyaddr_r_proto=''
453 getnetbyname_r_proto=''
467 d_getprotobyname_r=''
468 getprotobyname_r_proto=''
469 d_getprotobynumber_r=''
470 getprotobynumber_r_proto=''
472 getprotoent_r_proto=''
484 getservbyname_r_proto=''
486 getservbyport_r_proto=''
488 getservent_r_proto=''
563 d_old_pthread_create_joinable=''
564 old_pthread_create_joinable=''
603 sethostent_r_proto=''
620 setprotoent_r_proto=''
632 setservent_r_proto=''
676 d_stdio_ptr_lval_nochange_cnt=''
677 d_stdio_ptr_lval_sets_cnt=''
871 inc_version_list_init=''
890 ignore_versioned_solibs=''
949 d_perl_otherlibdirs=''
963 version_patchlevel_string=''
978 nv_preserves_uv_bits=''
1067 d_stdio_stream_array=''
1068 stdio_stream_array=''
1078 ccflags_uselargefiles=''
1079 ldflags_uselargefiles=''
1080 libswanted_uselargefiles=''
1100 installvendorarch=''
1126 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1129 : We must find out about Eunice early
1131 if test -f /etc/unixtovms; then
1132 eunicefix=/etc/unixtovms
1134 if test -f /etc/unixtovms.exe; then
1135 eunicefix=/etc/unixtovms.exe
1138 : Set executable suffix now -- needed before hints available
1139 if test -f "/libs/version.library"; then
1142 elif test -f "/system/gnu_library/bin/ar.pm"; then
1145 elif test -n "$DJGPP"; then
1148 elif test -d c:/. ; then
1157 : set useposix=false in your hint file to disable the POSIX extension.
1159 : set useopcode=false in your hint file to disable the Opcode extension.
1161 : Trailing extension. Override this in a hint file, if needed.
1162 : Extra object files, if any, needed on this platform.
1165 : Possible local include directories to search.
1166 : Set locincpth to "" in a hint file to defeat local include searches.
1167 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1168 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1170 : no include file wanted by default
1175 : change the next line if compiling for Xenix/286 on Xenix/386
1176 xlibpth='/usr/lib/386 /lib/386'
1177 : Possible local library directories to search.
1178 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1179 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1181 : general looking path for locating libraries
1182 glibpth="/lib /usr/lib $xlibpth"
1183 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1184 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1185 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1187 : Private path used by Configure to find libraries. Its value
1188 : is prepended to libpth. This variable takes care of special
1189 : machines, like the mips. Usually, it should be empty.
1192 : default library list
1194 : some systems want to use only the non-versioned libso:s
1195 ignore_versioned_solibs=''
1197 ccflags_uselargefiles=''
1198 ldflags_uselargefiles=''
1199 libswanted_uselargefiles=''
1200 : set usemultiplicity on the Configure command line to enable multiplicity.
1201 : set usesocks on the Configure command line to enable socks.
1202 : set usethreads on the Configure command line to enable threads.
1203 usereentrant='undef'
1204 : full support for void wanted by default
1207 : List of libraries we want.
1208 : If anyone needs -lnet, put it in a hint file.
1209 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1210 libswanted="$libswanted dld ld sun m c cposix posix"
1211 libswanted="$libswanted ndir dir crypt sec"
1212 libswanted="$libswanted ucb bsd BSD PW x util"
1213 : We probably want to search /usr/shlib before most other libraries.
1214 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1215 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1216 glibpth="/usr/shlib $glibpth"
1217 : Do not use vfork unless overridden by a hint file.
1220 : Find the basic shell for Bourne shell scripts
1224 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1227 if test -f "$xxx"; then
1230 : Build up a list and do a single loop so we can 'break' out.
1231 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1232 for xxx in sh bash ksh pdksh ash; do
1234 try="$try ${p}/${xxx}"
1238 if test -f "$xxx"; then
1241 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1244 elif test -f "$xxx.exe"; then
1255 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1257 Usually it's in /bin/sh. How did you even get this far?
1258 Please contact me (Perl Maintainers) at perlbug@perl.org and
1259 we'll try to straighten this all out.
1265 : see if sh knows # comments
1266 if `$sh -c '#' >/dev/null 2>&1`; then
1270 test -f $xcat$_exe || xcat=/usr/bin/cat
1271 if test ! -f $xcat$_exe; then
1272 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1273 if test -f $p/cat$_exe; then
1278 if test ! -f $xcat$_exe; then
1279 echo "Can't find cat anywhere!"
1283 echo "#!$xcat" >sharp
1287 if test -s today; then
1290 echo "#! $xcat" > sharp
1294 if test -s today; then
1302 echo "Your $sh doesn't grok # comments--I will strip them later on."
1305 echo "exec grep -v '^[ ]*#'" >spitshell
1307 $eunicefix spitshell
1308 spitshell=`pwd`/spitshell
1310 echo "I presume that if # doesn't work, #! won't work either!"
1315 : figure out how to guarantee sh startup
1317 '') startsh=${sharpbang}${sh} ;;
1329 : echo "Yup, it does."
1331 echo "Hmm... '$startsh' does not guarantee sh startup..."
1332 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1337 : Save command line options in file UU/cmdline.opt for later use in
1338 : generating config.sh.
1339 cat > cmdline.opt <<EOSH
1340 # Configure command line arguments.
1349 cat >>cmdline.opt <<EOSH
1350 config_arg$argn='$arg'
1352 # Extreme backslashitis: replace each ' by '"'"'
1353 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1356 arg_exp=`cat cmdl.opt`
1357 args_exp="$args_exp$args_sep'$arg_exp'"
1358 argn=`expr $argn + 1`
1361 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1362 # used by ./hints/os2.sh
1365 : produce awk script to parse command line options
1366 cat >options.awk <<'EOF'
1368 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1370 len = length(optstr);
1371 for (i = 1; i <= len; i++) {
1372 c = substr(optstr, i, 1);
1373 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1384 if (substr(str, 1, 1) != "-") {
1385 printf("'%s'\n", str);
1389 for (i = 2; i <= len; i++) {
1390 c = substr(str, i, 1);
1392 printf("-%s\n", substr(str, i));
1398 printf("'%s'\n", substr(str, i + 1));
1411 : process the command line options
1412 set X `for arg in "$@"; do echo "X$arg"; done |
1413 sed -e s/X// | awk -f options.awk`
1418 : set up default values
1428 rm -f optdef.sh posthint.sh
1429 cat >optdef.sh <<EOS
1435 while test $# -gt 0; do
1437 -d) shift; fastread=yes;;
1438 -e) shift; alldone=cont;;
1442 if test -r "$1"; then
1445 echo "$me: cannot read config file $1." >&2
1450 -h) shift; error=true;;
1451 -r) shift; reuseval=true;;
1452 -s) shift; silent=true; realsilent=true;;
1453 -E) shift; alldone=exit;;
1454 -K) shift; knowitall=true;;
1455 -O) shift; override=true;;
1456 -S) shift; silent=true; extractsh=true;;
1461 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1462 echo "$me: ignoring -D $1" >&2
1465 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1466 *) echo "$1='define'" >> optdef.sh;;
1473 *=) echo "$1" >> optdef.sh;;
1475 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1476 echo "$me: ignoring -U $1" >&2
1478 *) echo "$1='undef'" >> optdef.sh;;
1489 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1493 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1494 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1500 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1501 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1502 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1503 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1504 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1505 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1511 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1513 echo "$yyy=''" >> posthint.sh ;;
1518 echo "$yyy='$zzz'" >> posthint.sh ;;
1520 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1522 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1527 echo "$yyy=$zzz" >> posthint.sh ;;
1528 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1532 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1535 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1543 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1544 [-U symbol] [-U symbol=] [-A command:symbol...]
1545 -d : use defaults for all answers.
1546 -e : go on without questioning past the production of config.sh.
1547 -f : specify an alternate default configuration file.
1548 -h : print this help message and exit (with an error status).
1549 -r : reuse C symbols value if possible (skips costly nm extraction).
1550 -s : silent mode, only echoes questions and essential information.
1551 -D : define symbol to have some value:
1552 -D symbol symbol gets the value 'define'
1553 -D symbol=value symbol gets the value 'value'
1554 -E : stop at the end of questions, after having produced config.sh.
1555 -K : do not use unless you know what you are doing.
1556 -O : let -D and -U override definitions from loaded configuration file.
1557 -S : perform variable substitutions on all .SH files (can mix with -f)
1558 -U : undefine symbol:
1559 -U symbol symbol gets the value 'undef'
1560 -U symbol= symbol gets completely empty
1561 -A : manipulate symbol after the platform specific hints have been applied:
1562 -A symbol=value append " "value to symbol
1563 -A append:symbol=value append value to symbol
1564 -A define:symbol=value define symbol to have value
1565 -A clear:symbol define symbol to be ''
1566 -A define:symbol define symbol to be 'define'
1567 -A eval:symbol=value define symbol to be eval of value
1568 -A prepend:symbol=value prepend value to symbol
1569 -A undef:symbol define symbol to be 'undef'
1570 -A undef:symbol= define symbol to be ''
1571 -V : print version number and exit (with a zero status).
1578 case "$fastread$alldone" in
1581 case "$extractsh" in
1584 if test ! -t 0; then
1585 echo "Say 'sh Configure', not 'sh <Configure'"
1595 true) exec 1>/dev/null;;
1598 : run the defines and the undefines, if any, but leave the file out there...
1601 : create the posthint manipulation script and leave the file out there...
1606 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1607 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1608 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1609 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1610 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1613 : Some greps do not return status, grrr.
1614 echo "grimblepritz" >grimble
1615 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1617 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1623 : the following should work in any shell
1627 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1628 cat >contains <<'EOSS'
1629 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1634 : Find the path to the source tree
1637 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1641 *) src=`cd ../$src && pwd` ;;
1654 if test -f $rsrc/Configure && \
1655 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1657 : found it, so we are ok.
1660 for src in . .. ../.. ../../.. ../../../..; do
1661 if test -f ../$src/Configure && \
1662 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1673 Sorry, I can't seem to locate the source dir for $package. Please start
1674 Configure with an explicit path -- i.e. /some/path/Configure.
1682 echo "Sources for $package found in \"$src\"." >&4
1686 : script used to extract .SH files with variable substitutions
1687 cat >extract <<'EOS'
1689 echo "Doing variable substitutions on .SH files..."
1690 if test -f MANIFEST; then
1691 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1693 echo "(Looking for .SH files under the source directory.)"
1694 set x `(cd "$src"; find . -name "*.SH" -print)`
1698 0) set x `(cd "$src"; echo *.SH)`; shift;;
1700 if test ! -f "$src/$1"; then
1706 while test $name; do
1707 if test ! -d "$name"; then
1708 create="$name $create";
1709 name=`echo $name | sed -e "s|^[^/]*$||"`;
1710 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1715 for file in $create; do
1724 dir=`expr X$file : 'X\(.*\)/'`
1725 file=`expr X$file : 'X.*/\(.*\)'`
1726 (cd "$dir" && . ./$file)
1736 dir=`expr X$file : 'X\(.*\)/'`
1737 file=`expr X$file : 'X.*/\(.*\)'`
1738 (set x $dir; shift; eval $mkdir_p)
1739 sh <"$src/$dir/$file"
1748 if test -f "$src/config_h.SH"; then
1749 if test ! -f config.h; then
1750 : oops, they left it out of MANIFEST, probably, so do it anyway.
1751 . "$src/config_h.SH"
1756 : extract files and exit if asked to do so
1757 case "$extractsh" in
1759 case "$realsilent" in
1763 case "$config_sh" in
1764 '') config_sh='config.sh';;
1767 echo "Fetching answers from $config_sh..."
1770 test "$override" && . ./optdef.sh
1774 echo "Extraction done."
1779 : Eunice requires " " instead of "", can you believe it
1782 echo "Beginning of configuration questions for $package."
1784 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1786 : first determine how to suppress newline on echo command
1788 echo "Checking echo to see how to suppress newlines..."
1789 (echo "hi there\c" ; echo " ") >.echotmp
1790 if $contains c .echotmp >/dev/null 2>&1 ; then
1801 echo $n "The star should be here-->$c"
1805 : Now test for existence of everything in MANIFEST
1807 if test -f "$rsrc/MANIFEST"; then
1808 echo "First let's make sure your kit is complete. Checking..." >&4
1809 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1812 for filelist in x??; do
1813 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1815 if test -s missing; then
1819 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1821 You have the option of continuing the configuration process, despite the
1822 distinct possibility that your kit is damaged, by typing 'y'es. If you
1823 do, don't blame me if something goes wrong. I advise you to type 'n'o
1824 and contact the author (perlbug@perl.org).
1827 echo $n "Continue? [n] $c" >&4
1831 echo "Continuing..." >&4
1835 echo "ABORTING..." >&4
1840 echo "Looks good..."
1843 echo "There is no MANIFEST file. I hope your kit is complete !"
1848 : Find the appropriate value for a newline for tr
1849 if test -n "$DJGPP"; then
1852 if test X"$trnl" = X; then
1853 case "`echo foo|tr '\n' x 2>/dev/null`" in
1857 if test X"$trnl" = X; then
1858 case "`echo foo|tr '\012' x 2>/dev/null`" in
1859 foox) trnl='\012' ;;
1862 if test X"$trnl" = X; then
1863 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1864 fooxy) trnl='\n\r' ;;
1867 if test X"$trnl" = X; then
1870 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1876 : compute the number of columns on the terminal for proper question formatting
1881 : set up the echo used in my read
1882 myecho="case \"\$xxxm\" in
1883 '') echo $n \"\$rp $c\" >&4;;
1885 '') echo $n \"[\$xxxm] $c\";;
1887 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1889 echo $n \"[\$xxxm] $c\" >&4
1891 echo $n \"\$rp [\$xxxm] $c\" >&4
1897 : now set up to do reads with possible shell escape and default assignment
1903 case "\$fastread" in
1904 yes) case "\$dflt" in
1907 case "\$silent-\$rp" in
1912 *) case "\$silent" in
1913 true) case "\$rp" in
1918 while expr "X\$ans" : "X!" >/dev/null; do
1922 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1930 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1939 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1944 echo "(OK, I'll run with -d after this question.)" >&4
1947 echo "*** Sorry, \$1 not supported yet." >&4
1957 echo "*** Substitution done -- please confirm."
1959 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1964 echo "*** Error -- try again."
1971 case "\$ans\$xxxm\$nostick" in
1983 : create .config dir to save info across Configure sessions
1984 test -d ../.config || mkdir ../.config
1985 cat >../.config/README <<EOF
1986 This directory created by Configure to save information that should
1987 persist across sessions for $package.
1989 You may safely delete it if you wish.
1992 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1994 $define|true|[yY]*) ;;
1995 *) case "$xversion" in
1998 *** WHOA THERE!!! ***
2000 This is an UNSTABLE DEVELOPMENT release.
2001 The version of this $package distribution is $xversion, that is, odd,
2002 (as opposed to even) and that signifies a development release.
2003 If you want a maintenance release, you want an even-numbered version.
2005 Do ***NOT*** install this into production use.
2006 Data corruption and crashes are possible.
2008 It is most seriously suggested that you do not continue any further
2009 unless you want to help in developing and debugging Perl.
2011 If you *still* want to build perl, you can answer 'y' now,
2012 or pass -Dusedevel to Configure.
2015 rp='Do you really want to continue?'
2019 [yY]) echo >&4 "Okay, continuing."
2020 usedevel="$define" ;;
2021 *) echo >&4 "Okay, bye."
2031 case "$versiononly" in
2032 '') versiononly="$define" ;;
2034 case "$installusrbinperl" in
2035 '') installusrbinperl="$undef" ;;
2040 : general instructions
2043 user=`(logname) 2>/dev/null`
2045 '') user=`whoami 2>&1`;;
2047 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2050 rp='Would you like to see the instructions?'
2061 This installation shell script will examine your system and ask you questions
2062 to determine how the perl5 package should be installed. If you get
2063 stuck on a question, you may use a ! shell escape to start a subshell or
2064 execute a command. Many of the questions will have default answers in square
2065 brackets; typing carriage return will give you the default.
2067 On some of the questions which ask for file or directory names you are allowed
2068 to use the ~name construct to specify the login directory belonging to "name",
2069 even if you don't have a shell which knows about that. Questions where this is
2070 allowed will be marked "(~name ok)".
2074 dflt='Type carriage return to continue'
2078 The prompter used in this script allows you to use shell variables and
2079 backticks in your answers. You may use $1, $2, etc... to refer to the words
2080 in the default answer, as if the default line was a set of arguments given to a
2081 script shell. This means you may also use $* to repeat the whole default line,
2082 so you do not have to re-type everything to add something to the default.
2084 Everytime there is a substitution, you will have to confirm. If there is an
2085 error (e.g. an unmatched backtick), the default answer will remain unchanged
2086 and you will be prompted again.
2088 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2089 the questions and use the computed defaults (or the previous answers if there
2090 was already a config.sh file). Type 'Configure -h' for a list of options.
2091 You may also start interactively and then answer '& -d' at any prompt to turn
2092 on the non-interactive behaviour for the remainder of the execution.
2098 Much effort has been expended to ensure that this shell script will run on any
2099 Unix system. If despite that it blows up on yours, your best bet is to edit
2100 Configure and run it again. If you can't run Configure for some reason,
2101 you'll have to generate a config.sh file by hand. Whatever problems you
2102 have, let me (perlbug@perl.org) know how I blew it.
2104 This installation script affects things in two ways:
2106 1) it may do direct variable substitutions on some of the files included
2108 2) it builds a config.h file for inclusion in C programs. You may edit
2109 any of these files as the need arises after running this script.
2111 If you make a mistake on a question, there is no easy way to back up to it
2112 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2113 files. Configure will offer to let you do this before it runs the SH files.
2116 dflt='Type carriage return to continue'
2118 case "$firsttime" in
2119 true) echo $user >>../.config/instruct;;
2123 : find out where common programs are
2125 echo "Locating common programs..." >&4
2138 if test -d \$dir/\$thing; then
2144 for thisthing in \$dir/\$thing; do
2145 : just loop through to pick last item
2147 if test -f \$thisthing; then
2150 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2153 elif test -f \$dir/\$thing.exe; then
2154 if test -n "$DJGPP"; then
2155 echo \$dir/\$thing.exe
2157 : on Eunice apparently
2210 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2211 pth="$pth /lib /usr/lib"
2212 for file in $loclist; do
2216 if test -f "$xxx"; then
2219 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2220 xxx=`./loc $file $file $pth`
2223 '') xxx=`./loc $file $file $pth`;;
2224 *) xxx=`./loc $xxx $xxx $pth`;;
2226 eval $file=$xxx$_exe
2230 echo $file is in $xxx.
2233 echo $file is in $xxx.
2236 echo "I don't know where '$file' is, and my life depends on it." >&4
2237 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2243 echo "Don't worry if any of the following aren't found..."
2245 for file in $trylist; do
2249 if test -f "$xxx"; then
2252 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2253 xxx=`./loc $file $file $pth`
2256 '') xxx=`./loc $file $file $pth`;;
2257 *) xxx=`./loc $xxx $xxx $pth`;;
2259 eval $file=$xxx$_exe
2263 echo $file is in $xxx.
2266 echo $file is in $xxx.
2269 echo "I don't see $file out there, $say."
2276 echo "Substituting grep for egrep."
2283 echo "Substituting cp for ln."
2292 echo "I can't find make or gmake, and my life depends on it." >&4
2293 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2301 *) # We can't have osname yet.
2302 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2303 # Assume that gmake, if found, is definitely GNU make
2304 # and prefer it over the system make.
2305 echo "Substituting gmake for make."
2313 echo "Hopefully test is built into your sh."
2316 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2317 echo "Using the test built into your sh."
2325 echo "Hopefully echo is built into your sh."
2330 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2331 $echo $n "hi there$c" >foo1
2332 echo $n "hi there$c" >foo2
2333 if cmp foo1 foo2 >/dev/null 2>&1; then
2334 echo "They are compatible. In fact, they may be identical."
2341 They are not compatible! You are probably running ksh on a non-USG system.
2342 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2343 have echo built in and we may have to run some Bourne shell scripts. That
2344 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2347 $echo $n "The star should be here-->$c"
2357 cat <<'EOSC' >>trygcc
2362 int main(int argc, char *argv[]) {
2366 if $cc -o try $ccflags $ldflags try.c; then
2369 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2375 case "`$cc -v -c try.c 2>&1`" in
2378 if $test X"$trygcc" = Xyes; then
2379 if gcc -o try -c try.c; then
2381 echo "You seem to have a working gcc, though." >&4
2382 rp="Would you like to use it?"
2384 if $test -f myread; then
2387 if $test -f UU/myread; then
2390 echo "Cannot find myread, sorry. Aborting." >&2
2395 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2396 if $test -f usethreads.cbu; then
2399 *** However, any setting of the C compiler flags (e.g. for thread support)
2400 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2401 *** (together with e.g. -Dusethreads).
2417 cat <<'EOSC' >>checkcc
2422 int main(int argc, char *argv[]) {
2426 if $cc -o try $ccflags $ldflags try.c; then
2429 if $test X"$despair" = Xyes; then
2430 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2433 You need to find a working C compiler.
2434 Either (purchase and) install the C compiler supplied by your OS vendor,
2435 or for a free C compiler try http://gcc.gnu.org/
2436 I cannot continue any further, aborting.
2445 : determine whether symbolic links are supported
2448 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2449 echo "Symbolic links are supported." >&4
2452 echo "Symbolic links are NOT supported." >&4
2457 : determine whether symbolic links are supported
2461 echo "Checking how to test for symbolic links..." >&4
2463 if $test "X$issymlink" = X; then
2465 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2466 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2468 if test $? = 0; then
2471 echo "Your builtin 'test -h' may be broken." >&4
2474 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2477 if test -f "$p/$test"; then
2486 echo "Trying external '$test -h'." >&4
2487 issymlink="$test -h"
2488 if $test ! -h sym >/dev/null 2>&1; then
2489 echo "External '$test -h' is broken, too." >&4
2497 if $test "X$issymlink" = X; then
2498 if $test -L sym 2>/dev/null; then
2499 issymlink="$test -L"
2500 echo "The builtin '$test -L' worked." >&4
2503 if $test "X$issymlink" != X; then
2504 echo "You can test for symbolic links with '$issymlink'." >&4
2506 echo "I do not know how you can test for symbolic links." >&4
2510 *) echo "No symbolic links, so not testing for their testing..." >&4
2516 case "$mksymlinks" in
2519 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2522 *) case "$lns:$issymlink" in
2523 *"ln"*" -s:"*"test -"?)
2524 echo "Creating the symbolic links..." >&4
2525 echo "(First creating the subdirectories...)" >&4
2527 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2529 test -z "$directory" && break
2533 if test ! -d t/base; then
2534 echo "Failed to create the subdirectories. Aborting." >&4
2537 echo "(Then creating the symlinks...)" >&4
2538 awk '{print $1}' $src/MANIFEST | while true; do
2540 test -z "$filename" && break
2541 if test -f $filename; then
2542 if $issymlink $filename; then
2546 if test -f $filename; then
2547 echo "$filename already exists, not symlinking."
2549 ln -s $src/$filename $filename
2553 if test ! -f t/base/lex.t; then
2554 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2559 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2568 case "$usecrosscompile" in
2570 $echo "Cross-compiling..."
2573 *-*-gcc) # A cross-compiling gcc, probably.
2574 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2576 # leave out ld, choosing it is more complex
2578 ranlib=$targetarch-ranlib
2579 $echo 'extern int foo;' > try.c
2580 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2582 if $test $# -gt 0; then
2584 incpth="`$echo $incpth|$sed 's/^ //'`"
2585 echo "Guessing incpth '$incpth'." >&4
2587 j="`$echo $i|$sed 's,/include$,/lib,'`"
2588 if $test -d $j; then
2592 libpth="`$echo $libpth|$sed 's/^ //'`"
2593 echo "Guessing libpth '$libpth'." >&4
2598 case "$targetarch" in
2599 '') echo "Targetarch not defined." >&4; croak=y ;;
2600 *) echo "Using targetarch $targetarch." >&4 ;;
2603 '') echo "Incpth not defined." >&4; croak=y ;;
2604 *) echo "Using incpth '$incpth'." >&4 ;;
2607 '') echo "Libpth not defined." >&4; croak=y ;;
2608 *) echo "Using libpth '$libpth'." >&4 ;;
2611 '') for i in $incpth; do
2612 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2614 echo "Guessing usrinc $usrinc." >&4
2619 '') echo "Usrinc not defined." >&4; croak=y ;;
2622 *) echo "Using usrinc $usrinc." >&4 ;;
2624 case "$targethost" in
2625 '') echo "Targethost not defined." >&4; croak=y ;;
2626 *) echo "Using targethost $targethost." >&4
2631 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2634 /*) run=$src/Cross/run
2635 targetmkdir=$src/Cross/mkdir
2637 from=$src/Cross/from
2639 *) pwd=`$test -f ../Configure & cd ..; pwd`
2641 targetmkdir=$pwd/Cross/mkdir
2643 from=$pwd/Cross/from
2646 case "$targetrun" in
2647 '') targetrun=ssh ;;
2652 case "$targetfrom" in
2653 '') targetfrom=scp ;;
2657 from=$from-$targetfrom
2658 case "$targetdir" in
2660 echo "Guessing targetdir $targetdir." >&4
2663 case "$targetuser" in
2665 echo "Guessing targetuser $targetuser." >&4
2668 case "$targetfrom" in
2672 case "$targetrun" in
2684 '') cwd=$targetdir ;;
2688 if $test ! -f \$exe.xok; then
2692 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2695 *) echo "Unknown targetrun '$targetrun'" >&4
2699 case "$targetmkdir" in
2701 cat >$targetmkdir <<EOF
2703 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2705 $chmod a+rx $targetmkdir
2707 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2719 $targetmkdir \`dirname \$f\`
2720 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2723 $targetmkdir $targetdir/\`dirname \$f\`
2724 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2737 $mkdir -p $targetdir/\`dirname \$f\`
2738 $cp \$f $targetdir/\$f || exit 1
2741 $targetmkdir $targetdir/\`dirname \$f\`
2742 $cp \$f $targetdir/\$f || exit 1
2749 *) echo "Unknown targetto '$targetto'" >&4
2753 case "$targetfrom" in
2760 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2765 cp) cat >$from <<EOF
2770 cp $targetdir/\$f . || exit 1
2775 *) echo "Unknown targetfrom '$targetfrom'" >&4
2779 if $test ! -f $run; then
2780 echo "Target 'run' script '$run' not found." >&4
2784 if $test ! -f $to; then
2785 echo "Target 'to' script '$to' not found." >&4
2789 if $test ! -f $from; then
2790 echo "Target 'from' script '$from' not found." >&4
2794 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2798 Using '$run' for remote execution,
2799 and '$from' and '$to'
2800 for remote file transfer.
2806 usecrosscompile='undef'
2811 : see whether [:lower:] and [:upper:] are supported character classes
2813 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2815 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2819 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2820 # (0xc9 and 0xd1), therefore that is a nice testing point.
2821 if test "X$up" = X -o "X$low" = X; then
2822 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2828 if test "X$up" = X -o "X$low" = X; then
2829 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2835 if test "X$up" = X -o "X$low" = X; then
2836 case "`echo IJ | od -x 2>/dev/null`" in
2838 echo "Hey, this might be EBCDIC." >&4
2839 if test "X$up" = X -o "X$low" = X; then
2840 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2841 ij) up='[A-IJ-RS-Z]'
2846 if test "X$up" = X -o "X$low" = X; then
2847 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2857 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2859 echo "Using $up and $low to convert case." >&4
2862 echo "I don't know how to translate letters from upper to lower case." >&4
2863 echo "Your tr is not acting any way I know of." >&4
2867 : set up the translation script tr, must be called with ./tr of course
2871 '[A-Z][a-z]') exec $tr '$up' '$low';;
2872 '[a-z][A-Z]') exec $tr '$low' '$up';;
2879 : Try to determine whether config.sh was made on this system
2880 case "$config_sh" in
2882 myuname=`$uname -a 2>/dev/null`
2883 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2884 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2885 # because the A-Z/a-z are not consecutive.
2886 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2887 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2888 newmyuname="$myuname"
2890 case "$knowitall" in
2892 if test -f ../config.sh; then
2893 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2894 eval "`grep myuname= ../config.sh`"
2896 if test "X$myuname" = "X$newmyuname"; then
2904 : Get old answers from old config file if Configure was run on the
2905 : same system, otherwise use the hints.
2908 if test -f config.sh; then
2910 rp="I see a config.sh file. Shall I use it to set the defaults?"
2913 n*|N*) echo "OK, I'll ignore it."
2914 mv config.sh config.sh.old
2915 myuname="$newmyuname"
2917 *) echo "Fetching default answers from your old config.sh file..." >&4
2925 : Older versions did not always set $sh. Catch re-use of such
2935 if test ! -f config.sh; then
2938 First time through, eh? I have some defaults handy for some systems
2939 that need some extra help getting the Configure answers right:
2942 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2944 : Half the following guesses are probably wrong... If you have better
2945 : tests or hints, please send them to perlbug@perl.org
2946 : The metaconfig authors would also appreciate a copy...
2947 $test -f /irix && osname=irix
2948 $test -f /xenix && osname=sco_xenix
2949 $test -f /dynix && osname=dynix
2950 $test -f /dnix && osname=dnix
2951 $test -f /lynx.os && osname=lynxos
2952 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2953 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2954 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2955 $test -f /bin/mips && /bin/mips && osname=mips
2956 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2957 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2958 $test -d /usr/apollo/bin && osname=apollo
2959 $test -f /etc/saf/_sactab && osname=svr4
2960 $test -d /usr/include/minix && osname=minix
2961 $test -f /system/gnu_library/bin/ar.pm && osname=vos
2962 if $test -d /MachTen -o -d /MachTen_Folder; then
2964 if $test -x /sbin/version; then
2965 osvers=`/sbin/version | $awk '{print $2}' |
2966 $sed -e 's/[A-Za-z]$//'`
2967 elif $test -x /usr/etc/version; then
2968 osvers=`/usr/etc/version | $awk '{print $2}' |
2969 $sed -e 's/[A-Za-z]$//'`
2975 $test -f /sys/posix.dll &&
2976 $test -f /usr/bin/what &&
2977 set X `/usr/bin/what /sys/posix.dll` &&
2978 $test "$3" = UWIN &&
2982 if $test -f $uname; then
2990 umips) osname=umips ;;
2993 [23]100) osname=mips ;;
2994 next*) osname=next ;;
2996 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2997 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3000 elif $test -f /etc/kconfig; then
3002 if test "$lns" = "$ln -s"; then
3004 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3006 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3013 if test -n "$DJGPP"; then
3022 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3024 'not found') osvers="$4"."$3" ;;
3025 '<3240'|'<>3240') osvers=3.2.0 ;;
3026 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3027 '=3250'|'>3250') osvers=3.2.5 ;;
3031 bsd386) osname=bsd386
3034 cygwin*) osname=cygwin
3037 *dc.osx) osname=dcosx
3043 domainos) osname=apollo
3049 dynixptx*) osname=dynixptx
3050 osvers=`echo "$4"|sed 's/^v//'`
3052 freebsd) osname=freebsd
3054 genix) osname=genix ;;
3056 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3072 netbsd*) osname=netbsd
3075 news-os) osvers="$3"
3077 4*) osname=newsos4 ;;
3081 next*) osname=next ;;
3082 nonstop-ux) osname=nonstopux ;;
3083 openbsd) osname=openbsd
3086 POSIX-BC | posix-bc ) osname=posix-bc
3089 powerux | power_ux | powermax_os | powermaxos | \
3090 powerunix | power_unix) osname=powerux
3096 solaris) osname=solaris
3098 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3105 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3109 titanos) osname=titanos
3118 ultrix) osname=ultrix
3121 osf1|mls+) case "$5" in
3124 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3127 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3130 hp*) osname=hp_osf1 ;;
3131 mips) osname=mips_osf1 ;;
3134 unixware) osname=svr5
3142 $2) case "$osname" in
3146 : svr4.x or possibly later
3156 if test -f /stand/boot ; then
3157 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3158 if test -n "$INITPROG" -a -f "$INITPROG"; then
3159 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3160 if test -n "$isesix"; then
3168 *) if test -f /etc/systemid; then
3170 set `echo $3 | $sed 's/\./ /g'` $4
3171 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3173 elif $test -f $src/hints/sco_$1_$2.sh; then
3175 elif $test -f $src/hints/sco_$1.sh; then
3180 '') : Still unknown. Probably a generic Sys V.
3189 *) case "$osname" in
3190 '') : Still unknown. Probably a generic BSD.
3198 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3199 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3200 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3203 $rm -f UU/kernel.what
3204 elif test -d c:/.; then
3211 case "$targetarch" in
3214 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3219 : Now look for a hint file osname_osvers, unless one has been
3220 : specified already.
3223 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3224 : Also try without trailing minor version numbers.
3225 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3226 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3227 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3228 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3231 *) case "$osvers" in
3234 *) if $test -f $src/hints/$file.sh ; then
3236 elif $test -f $src/hints/$xfile.sh ; then
3238 elif $test -f $src/hints/$xxfile.sh ; then
3240 elif $test -f $src/hints/$xxxfile.sh ; then
3242 elif $test -f $src/hints/$xxxxfile.sh ; then
3244 elif $test -f "$src/hints/${osname}.sh" ; then
3253 if $test -f Policy.sh ; then
3256 none) dflt="Policy" ;;
3257 *) dflt="Policy $dflt" ;;
3262 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3266 if $test -f Policy.sh ; then
3269 There's also a Policy hint file available, which should make the
3270 site-specific (policy) questions easier to answer.
3277 You may give one or more space-separated answers, or "none" if appropriate.
3278 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3279 is a good thing. DO NOT give a wrong version or a wrong OS.
3283 rp="Which of these apply, if any?"
3286 for file in $tans; do
3287 if $test X$file = XPolicy -a -f Policy.sh; then
3289 $cat Policy.sh >> UU/config.sh
3290 elif $test -f $src/hints/$file.sh; then
3291 . $src/hints/$file.sh
3292 $cat $src/hints/$file.sh >> UU/config.sh
3293 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3296 : Give one chance to correct a possible typo.
3297 echo "$file.sh does not exist"
3299 rp="hint to use instead?"
3301 for file in $ans; do
3302 if $test -f "$src/hints/$file.sh"; then
3303 . $src/hints/$file.sh
3304 $cat $src/hints/$file.sh >> UU/config.sh
3305 elif $test X$ans = X -o X$ans = Xnone ; then
3308 echo "$file.sh does not exist -- ignored."
3315 : Remember our hint file for later.
3316 if $test -f "$src/hints/$file.sh" ; then
3326 echo "Fetching default answers from $config_sh..." >&4
3330 cp $config_sh config.sh 2>/dev/null
3340 test "$override" && . ./optdef.sh
3342 : Restore computed paths
3343 for file in $loclist $trylist; do
3344 eval $file="\$_$file"
3349 Configure uses the operating system name and version to set some defaults.
3350 The default value is probably right if the name rings a bell. Otherwise,
3351 since spelling matters for me, either accept the default or answer "none"
3358 ''|' '|none) dflt=none ;;
3359 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3362 *) dflt="$osname" ;;
3364 rp="Operating system name?"
3368 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3374 ''|' '|none) dflt=none ;;
3375 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3376 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3378 ''|' ') dflt=none ;;
3383 *) dflt="$osvers" ;;
3385 rp="Operating system version?"
3395 : who configured the system
3396 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3397 cf_by=`(logname) 2>/dev/null`
3400 cf_by=`(whoami) 2>/dev/null`
3402 "") cf_by=unknown ;;
3406 : set up the script used to warn in case of inconsistency
3413 echo "*** WHOA THERE!!! ***" >&4
3414 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3415 rp=" Keep the $hint value?"
3418 y) td=$was; tu=$was;;
3422 : function used to set $1 to $val
3423 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3425 $define$undef) . ./whoa; eval "$var=\$td";;
3426 $undef$define) . ./whoa; eval "$var=\$tu";;
3427 *) eval "$var=$val";;
3431 $define|true|[yY]*) dflt='y';;
3436 Perl can be built to use the SOCKS proxy protocol library. To do so,
3437 Configure must be run with -Dusesocks. If you use SOCKS you also need
3438 to use the PerlIO abstraction layer, this will be implicitly selected.
3440 If this doesn't make any sense to you, just accept the default '$dflt'.
3442 rp='Build Perl for SOCKS?'
3445 y|Y) val="$define" ;;
3452 $define|true|[yY]*) useperlio="$define";;
3455 case "$useperlio" in
3456 $define|true|[yY]*|'') dflt='y';;
3461 Previous version of $package used the standard IO mechanisms as
3462 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3463 alternate IO mechanisms via the PerlIO abstraction layer, but the
3464 stdio mechanism is still available if needed. The abstraction layer
3465 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3466 Using PerlIO with sfio may cause problems with some extension modules.
3468 If this doesn't make any sense to you, just accept the default '$dflt'.
3470 rp='Use the PerlIO abstraction layer?'
3477 echo "Ok, doing things the stdio way."
3486 case "$useperlio" in
3487 $define|true|[yY]*) ;;
3490 You are using the SOCKS proxy protocol library which means that you
3491 should also use the PerlIO layer. You may be headed for trouble.
3500 case "$usethreads" in
3501 $define|true|[yY]*) dflt='y';;
3502 *) # Catch case where user specified ithreads or 5005threads but
3503 # forgot -Dusethreads (A.D. 4/2002)
3504 case "$useithreads$use5005threads" in
3506 case "$useperlio" in
3507 "$define") dflt='y' ;;
3517 Perl can be built to take advantage of threads on some systems.
3518 To do so, Configure can be run with -Dusethreads.
3520 Note that Perl built with threading support runs slightly slower
3521 and uses more memory than plain Perl. The current implementation
3522 is believed to be stable, but it is fairly new, and so should be
3523 treated with caution.
3525 If this doesn't make any sense to you, just accept the default '$dflt'.
3527 rp='Build a threading Perl?'
3530 y|Y) val="$define" ;;
3536 case "$usethreads" in
3540 Since release 5.6, Perl has had two different threading implementations,
3541 the newer interpreter-based version (ithreads) with one interpreter per
3542 thread, and the older 5.005 version (5005threads).
3543 The 5005threads version is effectively unmaintained and will probably be
3544 removed in Perl 5.10, so there should be no need to build a Perl using it
3545 unless needed for backwards compatibility with some existing 5.005threads
3549 : Default to ithreads unless overridden on command line or with
3552 case "$use5005threads" in
3553 $define|true|[yY]*) dflt='n';;
3555 case "$useithreads" in
3556 $undef|false|[nN]*) dflt='n';;
3558 rp='Use the newer interpreter-based ithreads?'
3561 y|Y) val="$define" ;;
3566 : Now set use5005threads to the opposite value.
3567 case "$useithreads" in
3568 $define) val="$undef" ;;
3575 useithreads="$undef"
3576 use5005threads="$undef"
3580 case "$useithreads$use5005threads" in
3584 You cannot have both the ithreads and the 5.005 threads enabled
3585 at the same time. Disabling the 5.005 threads since they are
3586 much less stable than the ithreads.
3589 use5005threads="$undef"
3593 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3596 *** To build with ithreads you must also use the PerlIO layer.
3597 *** Cannot continue, aborting.
3603 case "$d_oldpthreads" in
3604 '') : Configure tests would be welcome here. For now, assume undef.
3606 *) val="$d_oldpthreads" ;;
3612 case "$usethreads" in
3613 "$define"|true|[yY]*)
3614 : Look for a hint-file generated 'call-back-unit'. If the
3615 : user has specified that a threading perl is to be built,
3616 : we may need to set or change some other defaults.
3617 if $test -f usethreads.cbu; then
3618 echo "Your platform has some specific hints for threaded builds, using them..."
3622 (Your platform doesn't have any specific hints for threaded builds.
3623 Assuming POSIX threads, then.)
3631 Perl can be built so that multiple Perl interpreters can coexist
3632 within the same Perl executable.
3635 case "$useithreads" in
3638 This multiple interpreter support is required for interpreter-based threads.
3642 *) case "$usemultiplicity" in
3643 $define|true|[yY]*) dflt='y';;
3647 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3648 rp='Build Perl for multiplicity?'
3651 y|Y) val="$define" ;;
3660 case "$usemorebits" in
3661 "$define"|true|[yY]*)
3662 use64bitint="$define"
3663 uselongdouble="$define"
3664 usemorebits="$define"
3666 *) usemorebits="$undef"
3670 : make some quick guesses about what we are up against
3672 $echo $n "Hmm... $c"
3682 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3683 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3685 echo "Looks kind of like an OSF/1 system, but we'll see..."
3687 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3688 xxx=`./loc addbib blurfl $pth`
3689 if $test -f $xxx; then
3690 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3694 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3695 echo "Looks kind of like an extended USG system, but we'll see..."
3697 echo "Looks kind of like a USG system, but we'll see..."
3701 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3702 echo "Looks kind of like a BSD system, but we'll see..."
3706 echo "Looks kind of like a Version 7 system, but we'll see..."
3709 case "$eunicefix" in
3712 There is, however, a strange, musty smell in the air that reminds me of
3713 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3717 : it so happens the Eunice I know will not run shell scripts in Unix format
3721 echo "Congratulations. You aren't running Eunice."
3725 : Detect OS2. The p_ variable is set above in the Head.U unit.
3726 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3727 : semicolon as a patch separator
3732 I have the feeling something is not exactly right, however...don't tell me...
3733 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3734 (Or you may be running DOS with DJGPP.)
3739 if test -f /xenix; then
3740 echo "Actually, this looks more like a XENIX system..."
3745 echo "It's not Xenix..."
3750 if test -f /venix; then
3751 echo "Actually, this looks more like a VENIX system..."
3758 echo "Nor is it Venix..."
3761 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3762 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3769 rp="Use which C compiler?"
3773 : See if they have not cc but they do have gcc
3775 : Look for a hint-file generated 'call-back-unit'. Now that the
3776 : user has specified the compiler, we may need to set or change some
3778 if $test -f cc.cbu; then
3784 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3790 printf("%s\n", __VERSION__);
3792 printf("%s\n", "1");
3798 if $cc -o try $ccflags $ldflags try.c; then
3799 gccversion=`$run ./try`
3800 case "$gccversion" in
3801 '') echo "You are not using GNU cc." ;;
3802 *) echo "You are using GNU cc $gccversion."
3808 echo "*** WHOA THERE!!! ***" >&4
3809 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3810 case "$knowitall" in
3812 echo " You'd better start hunting for one and let me know about it." >&4
3818 case "$gccversion" in
3819 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3821 case "$gccversion" in
3822 '') gccosandvers='' ;;
3823 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3824 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3826 case "$gccosandvers" in
3827 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3828 $osname$osvers) ;; # looking good
3829 $osname*) cat <<EOM >&4
3831 *** WHOA THERE!!! ***
3833 Your gcc has not been compiled for the exact release of
3834 your operating system ($gccosandvers versus $osname$osvers).
3836 In general it is a good idea to keep gcc synchronized with
3837 the operating system because otherwise serious problems
3838 may ensue when trying to compile software, like Perl.
3840 I'm trying to be optimistic here, though, and will continue.
3841 If later during the configuration and build icky compilation
3842 problems appear (headerfile conflicts being the most common
3843 manifestation), I suggest reinstalling the gcc to match
3844 your operating system release.
3848 *) gccosandvers='' ;; # failed to parse, better be silent
3856 # gcc 3.* complain about adding -Idirectories that they already know about,
3857 # so we will take those off from locincpth.
3858 case "$gccversion" in
3860 echo "main(){}">try.c
3861 for incdir in $locincpth; do
3862 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3863 grep '^cc1: warning: changing search order '`
3864 if test "X$warn" != X; then
3865 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3871 : decide how portable to be. Allow command line overrides.
3872 case "$d_portable" in
3874 *) d_portable="$define" ;;
3877 : set up shell script to do ~ expansion
3883 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3886 if $test -f /bin/csh; then
3887 /bin/csh -f -c "glob \$1"
3892 name=\`$expr x\$1 : '..\([^/]*\)'\`
3893 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3894 if $test ! -d "\$dir"; then
3896 echo "\$me: can't locate home directory for: \$name" >&2
3901 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3917 : now set up to get a file name
3921 cat <<'EOSC' >>getfile
3937 : getfile will accept an answer from the comma-separated list
3938 : enclosed in parentheses even if it does not meet other criteria.
3939 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3940 fn=`echo $fn | sed 's/(.*)//'`
3946 loc_file=`expr $fn : '.*:\(.*\)'`
3947 fn=`expr $fn : '\(.*\):.*'`
3955 */*) fullpath=true;;
3964 *e*) exp_file=true;;
3967 *p*) nopath_ok=true;;
3972 *d*) type='Directory';;
3973 *l*) type='Locate';;
3978 Locate) what='File';;
3983 case "$d_portable" in
3991 while test "$type"; do
3996 true) rp="$rp (~name ok)";;
3999 if test -f UU/getfile.ok && \
4000 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4019 value=`UU/filexp $ans`
4022 if test "$ans" != "$value"; then
4023 echo "(That expands to $value on this system.)"
4037 /*) value="$ansexp" ;;
4038 [a-zA-Z]:/*) value="$ansexp" ;;
4043 echo "I shall only accept a full path name, as in /bin/ls." >&4
4044 echo "Use a ! shell escape if you wish to check pathnames." >&4
4047 echo "Please give a full path name, starting with slash." >&4
4050 echo "Note that using ~name is ok provided it expands well." >&4
4063 for fp in $gfpth; do
4064 if test "X$fp" = X.; then
4069 if test -f "$pf"; then
4071 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4073 echo "($value is not a plain file, but that's ok.)"
4076 if test X"$type" = X; then
4083 for fp in $gfpth; do
4084 if test "X$fp" = X.; then
4089 direxp="$fp/$ansexp"
4091 if test -d "$direxp"; then
4099 if test -d "$ansexp"; then
4100 echo "(Looking for $loc_file in directory $value.)"
4101 value="$value/$loc_file"
4102 ansexp="$ansexp/$loc_file"
4104 if test -f "$ansexp"; then
4107 case "$nopath_ok" in
4108 true) case "$value" in
4110 *) echo "Assuming $value will be in people's path."
4126 if test "$fastread" = yes; then
4131 rp="$what $value doesn't exist. Use that name anyway?"
4150 test "X$gfpthkeep" != Xy && gfpth=""
4153 : What should the include directory be ?
4155 $echo $n "Hmm... $c"
4159 if $test -f /bin/mips && /bin/mips; then
4160 echo "Looks like a MIPS system..."
4161 $cat >usr.c <<'EOCP'
4162 #ifdef SYSTYPE_BSD43
4166 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4167 dflt='/bsd43/usr/include'
4171 mips_type='System V'
4173 $rm -f usr.c usr.out
4174 echo "and you're compiling with the $mips_type compiler and libraries."
4178 echo "Doesn't look like a MIPS system."
4188 case "$xxx_prompt" in
4191 rp='Where are the include files you want to use?'
4199 : see how we invoke the C preprocessor
4201 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4202 cat <<'EOT' >testcpp.c
4208 if test ! -f cppstdin; then
4209 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4210 # AIX cc -E doesn't show the absolute headerfile
4211 # locations but we'll cheat by using the -M flag.
4212 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
4214 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4217 echo "Keeping your $hint cppstdin wrapper."
4220 wrapper=`pwd`/cppstdin
4224 if $test "X$cppstdin" != "X" && \
4225 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4226 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4228 echo "You used to use $cppstdin $cppminus so we'll use that again."
4230 '') echo "But let's see if we can live without a wrapper..." ;;
4232 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4233 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4235 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4238 echo "(However, $cpprun $cpplast does not work, let's see...)"
4246 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4253 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4254 $cc -E <testcpp.c >testcpp.out 2>&1; \
4255 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4256 echo "Yup, it does."
4259 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4260 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4261 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4262 echo "Yup, it does."
4265 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4266 $cc -P <testcpp.c >testcpp.out 2>&1; \
4267 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4268 echo "Yipee, that works!"
4271 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4272 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4273 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4274 echo "At long last!"
4277 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4278 $cpp <testcpp.c >testcpp.out 2>&1; \
4279 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4283 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4284 $cpp - <testcpp.c >testcpp.out 2>&1; \
4285 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4286 echo "Hooray, it works! I was beginning to wonder."
4289 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4290 $wrapper <testcpp.c >testcpp.out 2>&1; \
4291 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4297 rp="No dice. I can't find a C preprocessor. Name one:"
4301 $x_cpp <testcpp.c >testcpp.out 2>&1
4302 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4303 echo "OK, that will do." >&4
4305 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4320 echo "Perhaps can we force $cc -E using a wrapper..."
4321 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4322 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4328 echo "Nope, we'll have to live without it..."
4342 "$wrapper"|'cppstdin') ;;
4343 *) $rm -f $wrapper;;
4345 $rm -f testcpp.c testcpp.out
4347 : Set private lib path
4350 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4355 '') dlist="$loclibpth $plibpth $glibpth";;
4356 *) dlist="$libpth";;
4359 : Now check and see which directories actually exist, avoiding duplicates
4363 if $test -d $xxx; then
4366 *) libpth="$libpth $xxx";;
4372 Some systems have incompatible or broken versions of libraries. Among
4373 the directories listed in the question below, please remove any you
4374 know not to be holding relevant libraries, and add any that are needed.
4375 Say "none" for none.
4386 rp="Directories to use for library searches?"
4393 : compute shared library extension
4396 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4406 On some systems, shared libraries may be available. Answer 'none' if
4407 you want to suppress searching of shared libraries for the remainder
4408 of this configuration.
4411 rp='What is the file extension used for shared libraries?'
4415 : Define several unixisms.
4416 : Hints files or command line option can be used to override them.
4417 : The convoluted testing is in case hints files set either the old
4420 '') case "$exe_ext" in
4422 *) _exe="$exe_ext" ;;
4427 '') case "$lib_ext" in
4434 '') case "$obj_ext" in
4441 '') case "$path_sep" in
4452 : Which makefile gets called first. This is used by make depend.
4453 case "$firstmakefile" in
4454 '') firstmakefile='makefile';;
4457 : Looking for optional libraries
4459 echo "Checking for optional libraries..." >&4
4464 case "$libswanted" in
4465 '') libswanted='c_s';;
4468 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4474 for thisdir in $libpth $xlibpth; do
4475 test -d $thisdir && libspath="$libspath $thisdir"
4477 for thislib in $libswanted; do
4478 for thisdir in $libspath; do
4480 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4481 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4482 $test -f "$xxx" && eval $libscheck
4483 $test -f "$xxx" && libstyle=shared
4485 if test ! -f "$xxx"; then
4486 xxx=$thisdir/lib$thislib.$so
4487 $test -f "$xxx" && eval $libscheck
4488 $test -f "$xxx" && libstyle=shared
4490 if test ! -f "$xxx"; then
4491 xxx=$thisdir/lib$thislib$_a
4492 $test -f "$xxx" && eval $libscheck
4493 $test -f "$xxx" && libstyle=static
4495 if test ! -f "$xxx"; then
4496 xxx=$thisdir/$thislib$_a
4497 $test -f "$xxx" && eval $libscheck
4498 $test -f "$xxx" && libstyle=static
4500 if test ! -f "$xxx"; then
4501 xxx=$thisdir/lib${thislib}_s$_a
4502 $test -f "$xxx" && eval $libscheck
4503 $test -f "$xxx" && libstyle=static
4504 $test -f "$xxx" && thislib=${thislib}_s
4506 if test ! -f "$xxx"; then
4507 xxx=$thisdir/Slib$thislib$_a
4508 $test -f "$xxx" && eval $libscheck
4509 $test -f "$xxx" && libstyle=static
4511 if $test -f "$xxx"; then
4513 shared) echo "Found -l$thislib (shared)." ;;
4514 static) echo "Found -l$thislib." ;;
4515 *) echo "Found -l$thislib ($libstyle)." ;;
4519 *) dflt="$dflt -l$thislib"
4520 libsfound="$libsfound $xxx"
4522 libsfiles="$libsfiles $yyy"
4523 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4524 case " $libsdirs " in
4526 *) libsdirs="$libsdirs $yyy" ;;
4533 if $test ! -f "$xxx"; then
4534 echo "No -l$thislib."
4545 ' '|'') dflt='none';;
4550 In order to compile $package on your machine, a number of libraries
4551 are usually needed. Include any other special libraries here as well.
4552 Say "none" for none. The default list is almost always right.
4556 rp="What libraries to use?"
4563 : determine optimization, if desired, or use for debug flag also
4565 ' '|$undef) dflt='none';;
4567 *) dflt="$optimize";;
4571 By default, $package compiles with the -O flag to use the optimizer.
4572 Alternately, you might want to use the symbolic debugger, which uses
4573 the -g flag (on traditional Unix systems). Either flag can be
4574 specified here. To use neither flag, specify the word "none".
4577 rp="What optimizer/debugger flag should be used?"
4581 'none') optimize=" ";;
4585 : We will not override a previous value, but we might want to
4586 : augment a hint file
4588 default|recommended)
4589 case "$gccversion" in
4590 1*) dflt='-fpcc-struct-return' ;;
4593 *-g*) dflt="$dflt -DDEBUGGING";;
4595 case "$gccversion" in
4596 2*) if test -d /etc/conf/kconfig.d &&
4597 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4603 case "$gccversion" in
4607 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4608 echo 'int main(void) { return 0; }' > gcctest.c
4609 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4610 echo "Yes, it does." 2>&1
4613 echo "Leaving current flags $ccflags alone." 2>&1
4615 *) dflt="$dflt -fno-strict-aliasing" ;;
4618 echo "Nope, it doesn't, but that's ok." 2>&1
4625 case "$mips_type" in
4626 *BSD*|'') inclwanted="$locincpth $usrinc";;
4627 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4629 for thisincl in $inclwanted; do
4630 if $test -d $thisincl; then
4631 if $test x$thisincl != x$usrinc; then
4633 *" -I$thisincl "*);;
4634 *) dflt="$dflt -I$thisincl ";;
4640 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4642 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4650 *) dflt="$dflt -D$2";;
4654 set signal.h LANGUAGE_C; eval $inctest
4658 ccflags="$ccflags -DSOCKS"
4663 default|recommended) dflt="$ccflags $dflt" ;;
4664 *) dflt="$ccflags";;
4673 Your C compiler may want other flags. For this question you should include
4674 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4675 but you should NOT include libraries or ld flags like -lwhatever. If you
4676 want $package to honor its debug switch, you should include -DDEBUGGING here.
4677 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4679 To use no flags, specify the word "none".
4685 rp="Any additional cc flags?"
4692 : the following weeds options from ccflags that are of no interest to cpp
4694 '') cppflags="$ccflags" ;;
4695 *) cppflags="$cppflags $ccflags" ;;
4697 case "$gccversion" in
4698 1*) cppflags="$cppflags -D__GNUC__"
4700 case "$mips_type" in
4702 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4708 echo "Let me guess what the preprocessor flags are..." >&4
4722 *) ftry="$previous $flag";;
4724 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4725 >cpp1.out 2>/dev/null && \
4726 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4727 >cpp2.out 2>/dev/null && \
4728 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4729 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4731 cppflags="$cppflags $ftry"
4741 *-*) echo "They appear to be: $cppflags";;
4743 $rm -f cpp.c cpp?.out
4747 : flags used in final linking phase
4749 '') if ./venix; then
4755 *-posix*) dflt="$dflt -posix" ;;
4758 *) dflt="$ldflags";;
4761 : Try to guess additional flags to pick up local libraries.
4762 for thislibdir in $libpth; do
4763 case " $loclibpth " in
4766 *"-L$thislibdir "*) ;;
4767 *) dflt="$dflt -L$thislibdir" ;;
4779 Your C linker may need flags. For this question you should
4780 include -L/whatever and any other flags used by the C linker, but you
4781 should NOT include libraries like -lwhatever.
4783 Make sure you include the appropriate -L/path flags if your C linker
4784 does not normally search all of the directories you specified above,
4787 To use no flags, specify the word "none".
4791 rp="Any additional ld flags (NOT including libraries)?"
4797 rmlist="$rmlist pdp11"
4801 echo "Checking your choice of C compiler and flags for coherency..." >&4
4802 $cat > try.c <<'EOF'
4804 int main() { printf("Ok\n"); exit(0); }
4806 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4808 $cat >try.msg <<'EOM'
4809 I've tried to compile and run the following simple program:
4812 $cat try.c >> try.msg
4814 $cat >> try.msg <<EOM