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 Wed May 12 13:00:30 METDST 2004 [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 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
53 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
54 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
55 *** Please read the README.plan9 for further instructions.
56 *** Cannot continue, aborting.
62 : compute my invocation name
66 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
71 : Proper separator for the PATH environment variable
73 : On OS/2 this directory should exist if this is not floppy only system :-]
74 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
75 if test -n "$OS2_SHELL"; then
77 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
78 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
80 elif test -n "$DJGPP"; then
81 case "X${MACHTYPE:-nonesuchmach}" in
89 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
90 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
91 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
92 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
93 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
94 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
95 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
96 paths="$paths /sbin /usr/sbin /usr/libexec"
97 paths="$paths /system/gnu_library/bin"
101 case "$p_$PATH$p_" in
103 *) test -d $p && PATH=$PATH$p_$p ;;
110 : shall we be using ksh?
116 if (PATH=.; alias -x) >/dev/null 2>&1; then
119 if test -f /hp-ux -a -f /bin/ksh; then
120 needksh='to avoid sh bug in "here document" expansion'
122 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
123 if test X`/usr/bin/uname -v` = X4; then
124 avoidksh="to avoid AIX 4's /bin/sh"
128 if test -f /osf_boot -a -f /usr/sbin/setld; then
129 if test X`/usr/bin/uname -s` = XOSF1; then
130 avoidksh="to avoid Digital UNIX' ksh"
132 unset BIN_SH # if this is 'xpg4' sh will start up ksh
135 case "$inksh/$needksh" in
142 case "$inksh/$avoidksh" in
148 case "$inksh/$needksh-$avoidksh-" in
151 (I see you are using the Korn shell. Some ksh's blow up on $me,
152 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
159 echo "(Feeding myself to $newsh $reason.)"
161 Configure|*/Configure) exec $newsh $0 "$@";;
162 *) exec $newsh Configure "$@";;
167 : if needed set CDPATH to a harmless value that is not chatty
168 : avoid bash 2.02 problems with empty CDPATH.
172 *bash*) CDPATH='.' ;;
177 : Configure runs within the UU subdirectory
178 test -d UU || mkdir UU
388 endhostent_r_proto=''
394 endprotoent_r_proto=''
400 endservent_r_proto=''
451 gethostbyaddr_r_proto=''
453 gethostbyname_r_proto=''
455 gethostent_r_proto=''
467 getnetbyaddr_r_proto=''
469 getnetbyname_r_proto=''
483 d_getprotobyname_r=''
484 getprotobyname_r_proto=''
485 d_getprotobynumber_r=''
486 getprotobynumber_r_proto=''
488 getprotoent_r_proto=''
500 getservbyname_r_proto=''
502 getservbyport_r_proto=''
504 getservent_r_proto=''
580 d_old_pthread_create_joinable=''
581 old_pthread_create_joinable=''
583 d_pthread_attr_setscope=''
622 sethostent_r_proto=''
639 setprotoent_r_proto=''
651 setservent_r_proto=''
695 d_stdio_ptr_lval_nochange_cnt=''
696 d_stdio_ptr_lval_sets_cnt=''
897 inc_version_list_init=''
916 ignore_versioned_solibs=''
976 d_perl_otherlibdirs=''
990 version_patchlevel_string=''
1005 nv_preserves_uv_bits=''
1076 installsitehtml1dir=''
1079 installsitehtml3dir=''
1086 installsiteman1dir=''
1089 installsiteman3dir=''
1094 installsitescript=''
1109 d_stdio_stream_array=''
1110 stdio_stream_array=''
1121 ccflags_uselargefiles=''
1122 ldflags_uselargefiles=''
1123 libswanted_uselargefiles=''
1143 installvendorarch=''
1150 installvendorhtml1dir=''
1152 vendorhtml1direxp=''
1153 installvendorhtml3dir=''
1155 vendorhtml3direxp=''
1161 installvendorman1dir=''
1164 installvendorman3dir=''
1171 installvendorscript=''
1183 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1186 : We must find out about Eunice early
1188 if test -f /etc/unixtovms; then
1189 eunicefix=/etc/unixtovms
1191 if test -f /etc/unixtovms.exe; then
1192 eunicefix=/etc/unixtovms.exe
1195 : Set executable suffix now -- needed before hints available
1196 if test -f "/libs/version.library"; then
1199 elif test -f "/system/gnu_library/bin/ar.pm"; then
1202 elif test -n "$DJGPP"; then
1205 elif test -d c:/. -o -n "$is_os2" ; then
1214 : set useposix=false in your hint file to disable the POSIX extension.
1216 : set useopcode=false in your hint file to disable the Opcode extension.
1218 : Trailing extension. Override this in a hint file, if needed.
1219 : Extra object files, if any, needed on this platform.
1222 : Possible local include directories to search.
1223 : Set locincpth to "" in a hint file to defeat local include searches.
1224 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1225 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1227 : no include file wanted by default
1232 : change the next line if compiling for Xenix/286 on Xenix/386
1233 xlibpth='/usr/lib/386 /lib/386'
1234 : Possible local library directories to search.
1235 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1236 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1238 : general looking path for locating libraries
1239 glibpth="/lib /usr/lib $xlibpth"
1240 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1241 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1242 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1244 : Private path used by Configure to find libraries. Its value
1245 : is prepended to libpth. This variable takes care of special
1246 : machines, like the mips. Usually, it should be empty.
1249 : default library list
1251 : some systems want to use only the non-versioned libso:s
1252 ignore_versioned_solibs=''
1257 ccflags_uselargefiles=''
1258 ldflags_uselargefiles=''
1259 libswanted_uselargefiles=''
1260 : set usemultiplicity on the Configure command line to enable multiplicity.
1261 : set usesocks on the Configure command line to enable socks.
1262 : set usethreads on the Configure command line to enable threads.
1263 usereentrant='undef'
1264 : full support for void wanted by default
1267 : List of libraries we want.
1268 : If anyone needs extra -lxxx, put those in a hint file.
1269 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1270 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1271 : We probably want to search /usr/shlib before most other libraries.
1272 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1273 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1274 glibpth="/usr/shlib $glibpth"
1275 : Do not use vfork unless overridden by a hint file.
1278 : Find the basic shell for Bourne shell scripts
1282 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1285 if test -f "$xxx"; then
1288 : Build up a list and do a single loop so we can 'break' out.
1289 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1290 for xxx in sh bash ksh pdksh ash; do
1292 try="$try ${p}/${xxx}"
1296 if test -f "$xxx"; then
1299 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1302 elif test -f "$xxx.exe"; then
1313 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1315 Usually it's in /bin/sh. How did you even get this far?
1316 Please contact me (Perl Maintainers) at perlbug@perl.org and
1317 we'll try to straighten this all out.
1323 : see if sh knows # comments
1324 if `$sh -c '#' >/dev/null 2>&1`; then
1328 test -f $xcat$_exe || xcat=/usr/bin/cat
1329 if test ! -f $xcat$_exe; then
1330 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1331 if test -f $p/cat$_exe; then
1336 if test ! -f $xcat$_exe; then
1337 echo "Can't find cat anywhere!"
1341 echo "#!$xcat" >sharp
1345 if test -s today; then
1348 echo "#! $xcat" > sharp
1352 if test -s today; then
1360 echo "Your $sh doesn't grok # comments--I will strip them later on."
1363 echo "exec grep -v '^[ ]*#'" >spitshell
1365 $eunicefix spitshell
1366 spitshell=`pwd`/spitshell
1368 echo "I presume that if # doesn't work, #! won't work either!"
1373 : figure out how to guarantee sh startup
1375 '') startsh=${sharpbang}${sh} ;;
1387 : echo "Yup, it does."
1389 echo "Hmm... '$startsh' does not guarantee sh startup..."
1390 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1395 : Save command line options in file UU/cmdline.opt for later use in
1396 : generating config.sh.
1397 cat > cmdline.opt <<EOSH
1398 # Configure command line arguments.
1407 cat >>cmdline.opt <<EOSH
1408 config_arg$argn='$arg'
1410 # Extreme backslashitis: replace each ' by '"'"'
1411 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1414 arg_exp=`cat cmdl.opt`
1415 args_exp="$args_exp$args_sep'$arg_exp'"
1416 argn=`expr $argn + 1`
1419 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1420 # used by ./hints/os2.sh
1423 : produce awk script to parse command line options
1424 cat >options.awk <<'EOF'
1426 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1428 len = length(optstr);
1429 for (i = 1; i <= len; i++) {
1430 c = substr(optstr, i, 1);
1431 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1442 if (substr(str, 1, 1) != "-") {
1443 printf("'%s'\n", str);
1447 for (i = 2; i <= len; i++) {
1448 c = substr(str, i, 1);
1450 printf("-%s\n", substr(str, i));
1456 printf("'%s'\n", substr(str, i + 1));
1469 : process the command line options
1470 set X `for arg in "$@"; do echo "X$arg"; done |
1471 sed -e s/X// | awk -f options.awk`
1476 : set up default values
1486 rm -f optdef.sh posthint.sh
1487 cat >optdef.sh <<EOS
1493 while test $# -gt 0; do
1495 -d) shift; fastread=yes;;
1496 -e) shift; alldone=cont;;
1500 if test -r "$1"; then
1503 echo "$me: cannot read config file $1." >&2
1508 -h) shift; error=true;;
1509 -r) shift; reuseval=true;;
1510 -s) shift; silent=true; realsilent=true;;
1511 -E) shift; alldone=exit;;
1512 -K) shift; knowitall=true;;
1513 -O) shift; override=true;;
1514 -S) shift; silent=true; extractsh=true;;
1519 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1520 echo "$me: ignoring -D $1" >&2
1523 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1524 *) echo "$1='define'" >> optdef.sh;;
1531 *=) echo "$1" >> optdef.sh;;
1533 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1534 echo "$me: ignoring -U $1" >&2
1536 *) echo "$1='undef'" >> optdef.sh;;
1547 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1551 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1552 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1558 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1559 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1560 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1561 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1562 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1563 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1569 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1571 echo "$yyy=''" >> posthint.sh ;;
1576 echo "$yyy='$zzz'" >> posthint.sh ;;
1578 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1580 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1585 echo "$yyy=$zzz" >> posthint.sh ;;
1586 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1590 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1593 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1601 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1602 [-U symbol] [-U symbol=] [-A command:symbol...]
1603 -d : use defaults for all answers.
1604 -e : go on without questioning past the production of config.sh.
1605 -f : specify an alternate default configuration file.
1606 -h : print this help message and exit (with an error status).
1607 -r : reuse C symbols value if possible (skips costly nm extraction).
1608 -s : silent mode, only echoes questions and essential information.
1609 -D : define symbol to have some value:
1610 -D symbol symbol gets the value 'define'
1611 -D symbol=value symbol gets the value 'value'
1612 -E : stop at the end of questions, after having produced config.sh.
1613 -K : do not use unless you know what you are doing.
1614 -O : let -D and -U override definitions from loaded configuration file.
1615 -S : perform variable substitutions on all .SH files (can mix with -f)
1616 -U : undefine symbol:
1617 -U symbol symbol gets the value 'undef'
1618 -U symbol= symbol gets completely empty
1619 -A : manipulate symbol after the platform specific hints have been applied:
1620 -A symbol=value append " "value to symbol
1621 -A append:symbol=value append value to symbol
1622 -A define:symbol=value define symbol to have value
1623 -A clear:symbol define symbol to be ''
1624 -A define:symbol define symbol to be 'define'
1625 -A eval:symbol=value define symbol to be eval of value
1626 -A prepend:symbol=value prepend value to symbol
1627 -A undef:symbol define symbol to be 'undef'
1628 -A undef:symbol= define symbol to be ''
1629 -V : print version number and exit (with a zero status).
1636 case "$fastread$alldone" in
1639 case "$extractsh" in
1642 if test ! -t 0; then
1643 echo "Say 'sh Configure', not 'sh <Configure'"
1653 true) exec 1>/dev/null;;
1656 : run the defines and the undefines, if any, but leave the file out there...
1659 : create the posthint manipulation script and leave the file out there...
1664 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1665 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1666 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1667 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1668 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1671 : Some greps do not return status, grrr.
1672 echo "grimblepritz" >grimble
1673 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1675 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1681 : the following should work in any shell
1685 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1686 cat >contains <<'EOSS'
1687 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1692 : Find the path to the source tree
1695 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1699 *) src=`cd ../$src && pwd` ;;
1712 if test -f $rsrc/Configure && \
1713 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1715 : found it, so we are ok.
1718 for src in . .. ../.. ../../.. ../../../..; do
1719 if test -f ../$src/Configure && \
1720 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1731 Sorry, I can't seem to locate the source dir for $package. Please start
1732 Configure with an explicit path -- i.e. /some/path/Configure.
1740 echo "Sources for $package found in \"$src\"." >&4
1744 : script used to extract .SH files with variable substitutions
1745 cat >extract <<'EOS'
1747 echo "Doing variable substitutions on .SH files..."
1748 if test -f MANIFEST; then
1749 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1751 echo "(Looking for .SH files under the source directory.)"
1752 set x `(cd "$src"; find . -name "*.SH" -print)`
1756 0) set x `(cd "$src"; echo *.SH)`; shift;;
1758 if test ! -f "$src/$1"; then
1764 while test $name; do
1765 if test ! -d "$name"; then
1766 create="$name $create";
1767 name=`echo $name | sed -e "s|^[^/]*$||"`;
1768 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1773 for file in $create; do
1782 dir=`expr X$file : 'X\(.*\)/'`
1783 file=`expr X$file : 'X.*/\(.*\)'`
1784 (cd "$dir" && . ./$file)
1794 dir=`expr X$file : 'X\(.*\)/'`
1795 file=`expr X$file : 'X.*/\(.*\)'`
1796 (set x $dir; shift; eval $mkdir_p)
1797 sh <"$src/$dir/$file"
1806 if test -f "$src/config_h.SH"; then
1807 if test ! -f config.h; then
1808 : oops, they left it out of MANIFEST, probably, so do it anyway.
1809 . "$src/config_h.SH"
1814 : extract files and exit if asked to do so
1815 case "$extractsh" in
1817 case "$realsilent" in
1821 case "$config_sh" in
1822 '') config_sh='config.sh';;
1825 echo "Fetching answers from $config_sh..."
1828 test "$override" && . ./optdef.sh
1832 echo "Extraction done."
1837 : Eunice requires " " instead of "", can you believe it
1840 echo "Beginning of configuration questions for $package."
1842 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1844 : first determine how to suppress newline on echo command
1846 echo "Checking echo to see how to suppress newlines..."
1847 (echo "hi there\c" ; echo " ") >.echotmp
1848 if $contains c .echotmp >/dev/null 2>&1 ; then
1859 echo $n "The star should be here-->$c"
1863 : Now test for existence of everything in MANIFEST
1865 if test -f "$rsrc/MANIFEST"; then
1866 echo "First let's make sure your kit is complete. Checking..." >&4
1867 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1870 for filelist in x??; do
1871 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1873 if test -s missing; then
1877 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1879 You have the option of continuing the configuration process, despite the
1880 distinct possibility that your kit is damaged, by typing 'y'es. If you
1881 do, don't blame me if something goes wrong. I advise you to type 'n'o
1882 and contact the author (perlbug@perl.org).
1885 echo $n "Continue? [n] $c" >&4
1889 echo "Continuing..." >&4
1893 echo "ABORTING..." >&4
1898 echo "Looks good..."
1901 echo "There is no MANIFEST file. I hope your kit is complete !"
1906 : Find the appropriate value for a newline for tr
1907 if test -n "$DJGPP"; then
1910 if test X"$trnl" = X; then
1911 case "`echo foo|tr '\n' x 2>/dev/null`" in
1915 if test X"$trnl" = X; then
1916 case "`echo foo|tr '\012' x 2>/dev/null`" in
1917 foox) trnl='\012' ;;
1920 if test X"$trnl" = X; then
1921 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1922 fooxy) trnl='\n\r' ;;
1925 if test X"$trnl" = X; then
1928 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1934 : compute the number of columns on the terminal for proper question formatting
1939 : set up the echo used in my read
1940 myecho="case \"\$xxxm\" in
1941 '') echo $n \"\$rp $c\" >&4;;
1943 '') echo $n \"[\$xxxm] $c\";;
1945 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1947 echo $n \"[\$xxxm] $c\" >&4
1949 echo $n \"\$rp [\$xxxm] $c\" >&4
1955 : now set up to do reads with possible shell escape and default assignment
1961 case "\$fastread" in
1962 yes) case "\$dflt" in
1965 case "\$silent-\$rp" in
1970 *) case "\$silent" in
1971 true) case "\$rp" in
1976 while expr "X\$ans" : "X!" >/dev/null; do
1980 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1988 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1997 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2002 echo "(OK, I'll run with -d after this question.)" >&4
2005 echo "*** Sorry, \$1 not supported yet." >&4
2015 echo "*** Substitution done -- please confirm."
2017 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2022 echo "*** Error -- try again."
2029 case "\$ans\$xxxm\$nostick" in
2041 : create .config dir to save info across Configure sessions
2042 test -d ../.config || mkdir ../.config
2043 cat >../.config/README <<EOF
2044 This directory created by Configure to save information that should
2045 persist across sessions for $package.
2047 You may safely delete it if you wish.
2050 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2052 $define|true|[yY]*) ;;
2053 *) case "$xversion" in
2056 *** WHOA THERE!!! ***
2058 This is an UNSTABLE DEVELOPMENT release.
2059 The version of this $package distribution is $xversion, that is, odd,
2060 (as opposed to even) and that signifies a development release.
2061 If you want a maintenance release, you want an even-numbered version.
2063 Do ***NOT*** install this into production use.
2064 Data corruption and crashes are possible.
2066 It is most seriously suggested that you do not continue any further
2067 unless you want to help in developing and debugging Perl.
2069 If you *still* want to build perl, you can answer 'y' now,
2070 or pass -Dusedevel to Configure.
2073 rp='Do you really want to continue?'
2077 [yY]) echo >&4 "Okay, continuing."
2078 usedevel="$define" ;;
2079 *) echo >&4 "Okay, bye."
2089 case "$versiononly" in
2090 '') versiononly="$define" ;;
2092 case "$installusrbinperl" in
2093 '') installusrbinperl="$undef" ;;
2098 : general instructions
2101 user=`(logname) 2>/dev/null`
2103 '') user=`whoami 2>&1`;;
2105 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2108 rp='Would you like to see the instructions?'
2119 This installation shell script will examine your system and ask you questions
2120 to determine how the perl5 package should be installed. If you get
2121 stuck on a question, you may use a ! shell escape to start a subshell or
2122 execute a command. Many of the questions will have default answers in square
2123 brackets; typing carriage return will give you the default.
2125 On some of the questions which ask for file or directory names you are allowed
2126 to use the ~name construct to specify the login directory belonging to "name",
2127 even if you don't have a shell which knows about that. Questions where this is
2128 allowed will be marked "(~name ok)".
2132 dflt='Type carriage return to continue'
2136 The prompter used in this script allows you to use shell variables and
2137 backticks in your answers. You may use $1, $2, etc... to refer to the words
2138 in the default answer, as if the default line was a set of arguments given to a
2139 script shell. This means you may also use $* to repeat the whole default line,
2140 so you do not have to re-type everything to add something to the default.
2142 Everytime there is a substitution, you will have to confirm. If there is an
2143 error (e.g. an unmatched backtick), the default answer will remain unchanged
2144 and you will be prompted again.
2146 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2147 the questions and use the computed defaults (or the previous answers if there
2148 was already a config.sh file). Type 'Configure -h' for a list of options.
2149 You may also start interactively and then answer '& -d' at any prompt to turn
2150 on the non-interactive behaviour for the remainder of the execution.
2156 Much effort has been expended to ensure that this shell script will run on any
2157 Unix system. If despite that it blows up on yours, your best bet is to edit
2158 Configure and run it again. If you can't run Configure for some reason,
2159 you'll have to generate a config.sh file by hand. Whatever problems you
2160 have, let me (perlbug@perl.org) know how I blew it.
2162 This installation script affects things in two ways:
2164 1) it may do direct variable substitutions on some of the files included
2166 2) it builds a config.h file for inclusion in C programs. You may edit
2167 any of these files as the need arises after running this script.
2169 If you make a mistake on a question, there is no easy way to back up to it
2170 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2171 files. Configure will offer to let you do this before it runs the SH files.
2174 dflt='Type carriage return to continue'
2176 case "$firsttime" in
2177 true) echo $user >>../.config/instruct;;
2181 : find out where common programs are
2183 echo "Locating common programs..." >&4
2196 if test -d \$dir/\$thing; then
2202 for thisthing in \$dir/\$thing; do
2203 : just loop through to pick last item
2205 if test -f \$thisthing; then
2208 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2211 elif test -f \$dir/\$thing.exe; then
2212 if test -n "$DJGPP"; then
2213 echo \$dir/\$thing.exe
2214 elif test "$eunicefix" != ":"; then
2215 : on Eunice apparently
2269 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2270 pth="$pth /lib /usr/lib"
2271 for file in $loclist; do
2275 if test -f "$xxx"; then
2278 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2279 xxx=`./loc $file $file $pth`
2282 '') xxx=`./loc $file $file $pth`;;
2283 *) xxx=`./loc $xxx $xxx $pth`;;
2285 eval $file=$xxx$_exe
2289 echo $file is in $xxx.
2292 echo $file is in $xxx.
2295 echo "I don't know where '$file' is, and my life depends on it." >&4
2296 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2302 echo "Don't worry if any of the following aren't found..."
2304 for file in $trylist; do
2308 if test -f "$xxx"; then
2311 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2312 xxx=`./loc $file $file $pth`
2315 '') xxx=`./loc $file $file $pth`;;
2316 *) xxx=`./loc $xxx $xxx $pth`;;
2318 eval $file=$xxx$_exe
2322 echo $file is in $xxx.
2325 echo $file is in $xxx.
2328 echo "I don't see $file out there, $say."
2335 echo "Substituting grep for egrep."
2342 echo "Substituting cp for ln."
2351 echo "I can't find make or gmake, and my life depends on it." >&4
2352 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2360 *) # We can't have osname yet.
2361 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2362 # Assume that gmake, if found, is definitely GNU make
2363 # and prefer it over the system make.
2364 echo "Substituting gmake for make."
2372 echo "Hopefully test is built into your sh."
2375 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2376 echo "Using the test built into your sh."
2384 echo "Hopefully echo is built into your sh."
2389 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2390 $echo $n "hi there$c" >foo1
2391 echo $n "hi there$c" >foo2
2392 if cmp foo1 foo2 >/dev/null 2>&1; then
2393 echo "They are compatible. In fact, they may be identical."
2400 They are not compatible! You are probably running ksh on a non-USG system.
2401 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2402 have echo built in and we may have to run some Bourne shell scripts. That
2403 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2406 $echo $n "The star should be here-->$c"
2416 cat <<'EOSC' >>trygcc
2421 int main(int argc, char *argv[]) {
2425 if $cc -o try $ccflags $ldflags try.c; then
2428 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2434 case "`$cc -v -c try.c 2>&1`" in
2437 if $test X"$trygcc" = Xyes; then
2438 if gcc -o try -c try.c; then
2440 echo "You seem to have a working gcc, though." >&4
2441 rp="Would you like to use it?"
2443 if $test -f myread; then
2446 if $test -f UU/myread; then
2449 echo "Cannot find myread, sorry. Aborting." >&2
2454 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2455 if $test -f usethreads.cbu; then
2458 *** However, any setting of the C compiler flags (e.g. for thread support)
2459 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2460 *** (together with e.g. -Dusethreads).
2476 cat <<'EOSC' >>checkcc
2481 int main(int argc, char *argv[]) {
2485 if $cc -o try $ccflags $ldflags try.c; then
2488 if $test X"$despair" = Xyes; then
2489 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2492 You need to find a working C compiler.
2493 Either (purchase and) install the C compiler supplied by your OS vendor,
2494 or for a free C compiler try http://gcc.gnu.org/
2495 I cannot continue any further, aborting.
2504 : determine whether symbolic links are supported
2507 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2508 echo "Symbolic links are supported." >&4
2511 echo "Symbolic links are NOT supported." >&4
2516 : determine whether symbolic links are supported
2520 echo "Checking how to test for symbolic links..." >&4
2522 if $test "X$issymlink" = X; then
2524 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2525 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2527 if test $? = 0; then
2530 echo "Your builtin 'test -h' may be broken." >&4
2533 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2536 if test -f "$p/$test"; then
2545 echo "Trying external '$test -h'." >&4
2546 issymlink="$test -h"
2547 if $test ! -h sym >/dev/null 2>&1; then
2548 echo "External '$test -h' is broken, too." >&4
2556 if $test "X$issymlink" = X; then
2557 if $test -L sym 2>/dev/null; then
2558 issymlink="$test -L"
2559 echo "The builtin '$test -L' worked." >&4
2562 if $test "X$issymlink" != X; then
2563 echo "You can test for symbolic links with '$issymlink'." >&4
2565 echo "I do not know how you can test for symbolic links." >&4
2569 *) echo "No symbolic links, so not testing for their testing..." >&4
2575 case "$mksymlinks" in
2578 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2581 *) case "$lns:$issymlink" in
2582 *"ln"*" -s:"*"test -"?)
2583 echo "Creating the symbolic links..." >&4
2584 echo "(First creating the subdirectories...)" >&4
2586 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2588 test -z "$directory" && break
2592 if test ! -d t/base; then
2593 echo "Failed to create the subdirectories. Aborting." >&4
2596 echo "(Then creating the symlinks...)" >&4
2597 awk '{print $1}' $src/MANIFEST | while true; do
2599 test -z "$filename" && break
2600 if test -f $filename; then
2601 if $issymlink $filename; then
2605 if test -f $filename; then
2606 echo "$filename already exists, not symlinking."
2608 ln -s $src/$filename $filename
2612 if test ! -f t/base/lex.t; then
2613 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2618 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2627 case "$usecrosscompile" in
2629 $echo "Cross-compiling..."
2632 *-*-gcc) # A cross-compiling gcc, probably.
2633 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2635 # leave out ld, choosing it is more complex
2637 ranlib=$targetarch-ranlib
2638 $echo 'extern int foo;' > try.c
2639 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2641 if $test $# -gt 0; then
2643 incpth="`$echo $incpth|$sed 's/^ //'`"
2644 echo "Guessing incpth '$incpth'." >&4
2646 j="`$echo $i|$sed 's,/include$,/lib,'`"
2647 if $test -d $j; then
2651 libpth="`$echo $libpth|$sed 's/^ //'`"
2652 echo "Guessing libpth '$libpth'." >&4
2657 case "$targetarch" in
2658 '') echo "Targetarch not defined." >&4; croak=y ;;
2659 *) echo "Using targetarch $targetarch." >&4 ;;
2662 '') echo "Incpth not defined." >&4; croak=y ;;
2663 *) echo "Using incpth '$incpth'." >&4 ;;
2666 '') echo "Libpth not defined." >&4; croak=y ;;
2667 *) echo "Using libpth '$libpth'." >&4 ;;
2670 '') for i in $incpth; do
2671 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2673 echo "Guessing usrinc $usrinc." >&4
2678 '') echo "Usrinc not defined." >&4; croak=y ;;
2681 *) echo "Using usrinc $usrinc." >&4 ;;
2683 case "$targethost" in
2684 '') echo "Targethost not defined." >&4; croak=y ;;
2685 *) echo "Using targethost $targethost." >&4
2690 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2693 /*) run=$src/Cross/run
2694 targetmkdir=$src/Cross/mkdir
2696 from=$src/Cross/from
2698 *) pwd=`$test -f ../Configure & cd ..; pwd`
2700 targetmkdir=$pwd/Cross/mkdir
2702 from=$pwd/Cross/from
2705 case "$targetrun" in
2706 '') targetrun=ssh ;;
2711 case "$targetfrom" in
2712 '') targetfrom=scp ;;
2716 from=$from-$targetfrom
2717 case "$targetdir" in
2719 echo "Guessing targetdir $targetdir." >&4
2722 case "$targetuser" in
2724 echo "Guessing targetuser $targetuser." >&4
2727 case "$targetfrom" in
2731 case "$targetrun" in
2743 '') cwd=$targetdir ;;
2747 if $test ! -f \$exe.xok; then
2751 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2754 *) echo "Unknown targetrun '$targetrun'" >&4
2758 case "$targetmkdir" in
2760 cat >$targetmkdir <<EOF
2762 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2764 $chmod a+rx $targetmkdir
2766 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2778 $targetmkdir \`dirname \$f\`
2779 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2782 $targetmkdir $targetdir/\`dirname \$f\`
2783 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2796 $mkdir -p $targetdir/\`dirname \$f\`
2797 $cp \$f $targetdir/\$f || exit 1
2800 $targetmkdir $targetdir/\`dirname \$f\`
2801 $cp \$f $targetdir/\$f || exit 1
2808 *) echo "Unknown targetto '$targetto'" >&4
2812 case "$targetfrom" in
2819 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2824 cp) cat >$from <<EOF
2829 cp $targetdir/\$f . || exit 1
2834 *) echo "Unknown targetfrom '$targetfrom'" >&4
2838 if $test ! -f $run; then
2839 echo "Target 'run' script '$run' not found." >&4
2843 if $test ! -f $to; then
2844 echo "Target 'to' script '$to' not found." >&4
2848 if $test ! -f $from; then
2849 echo "Target 'from' script '$from' not found." >&4
2853 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2857 Using '$run' for remote execution,
2858 and '$from' and '$to'
2859 for remote file transfer.
2865 usecrosscompile='undef'
2870 : see whether [:lower:] and [:upper:] are supported character classes
2872 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2874 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2878 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2879 # (0xd9 and 0xe2), therefore that is a nice testing point.
2880 if test "X$up" = X -o "X$low" = X; then
2881 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2887 if test "X$up" = X -o "X$low" = X; then
2888 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2894 if test "X$up" = X -o "X$low" = X; then
2895 case "`echo RS | od -x 2>/dev/null`" in
2897 echo "Hey, this might be EBCDIC." >&4
2898 if test "X$up" = X -o "X$low" = X; then
2899 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2900 rs) up='[A-IJ-RS-Z]'
2905 if test "X$up" = X -o "X$low" = X; then
2906 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2916 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2918 echo "Using $up and $low to convert case." >&4
2921 echo "I don't know how to translate letters from upper to lower case." >&4
2922 echo "Your tr is not acting any way I know of." >&4
2926 : set up the translation script tr, must be called with ./tr of course
2930 '[A-Z][a-z]') exec $tr '$up' '$low';;
2931 '[a-z][A-Z]') exec $tr '$low' '$up';;
2938 : Try to determine whether config.sh was made on this system
2939 case "$config_sh" in
2941 myuname=`$uname -a 2>/dev/null`
2942 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2943 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2944 # because the A-Z/a-z are not consecutive.
2945 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2946 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2947 newmyuname="$myuname"
2949 case "$knowitall" in
2951 if test -f ../config.sh; then
2952 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2953 eval "`grep myuname= ../config.sh`"
2955 if test "X$myuname" = "X$newmyuname"; then
2963 : Get old answers from old config file if Configure was run on the
2964 : same system, otherwise use the hints.
2967 if test -f config.sh; then
2969 rp="I see a config.sh file. Shall I use it to set the defaults?"
2972 n*|N*) echo "OK, I'll ignore it."
2973 mv config.sh config.sh.old
2974 myuname="$newmyuname"
2976 *) echo "Fetching default answers from your old config.sh file..." >&4
2984 : Older versions did not always set $sh. Catch re-use of such
2994 if test ! -f config.sh; then
2997 First time through, eh? I have some defaults handy for some systems
2998 that need some extra help getting the Configure answers right:
3001 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3003 : Half the following guesses are probably wrong... If you have better
3004 : tests or hints, please send them to perlbug@perl.org
3005 : The metaconfig authors would also appreciate a copy...
3006 $test -f /irix && osname=irix
3007 $test -f /xenix && osname=sco_xenix
3008 $test -f /dynix && osname=dynix
3009 $test -f /dnix && osname=dnix
3010 $test -f /lynx.os && osname=lynxos
3011 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3012 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3013 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3014 $test -f /bin/mips && /bin/mips && osname=mips
3015 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3016 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3017 $test -d /usr/apollo/bin && osname=apollo
3018 $test -f /etc/saf/_sactab && osname=svr4
3019 $test -d /usr/include/minix && osname=minix
3020 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3021 if $test -d /MachTen -o -d /MachTen_Folder; then
3023 if $test -x /sbin/version; then
3024 osvers=`/sbin/version | $awk '{print $2}' |
3025 $sed -e 's/[A-Za-z]$//'`
3026 elif $test -x /usr/etc/version; then
3027 osvers=`/usr/etc/version | $awk '{print $2}' |
3028 $sed -e 's/[A-Za-z]$//'`
3034 $test -f /sys/posix.dll &&
3035 $test -f /usr/bin/what &&
3036 set X `/usr/bin/what /sys/posix.dll` &&
3037 $test "$3" = UWIN &&
3041 if $test -f $uname; then
3049 umips) osname=umips ;;
3052 [23]100) osname=mips ;;
3053 next*) osname=next ;;
3055 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3056 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3059 elif $test -f /etc/kconfig; then
3061 if test "$lns" = "$ln -s"; then
3063 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3065 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3072 if test -n "$DJGPP"; then
3081 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3083 # oslevel can fail with:
3084 # oslevel: Unable to acquire lock.
3085 *not\ found) osvers="$4"."$3" ;;
3086 '<3240'|'<>3240') osvers=3.2.0 ;;
3087 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3088 '=3250'|'>3250') osvers=3.2.5 ;;
3092 bsd386) osname=bsd386
3095 cygwin*) osname=cygwin
3098 *dc.osx) osname=dcosx
3104 domainos) osname=apollo
3110 dynixptx*) osname=dynixptx
3111 osvers=`echo "$4"|sed 's/^v//'`
3113 freebsd) osname=freebsd
3115 genix) osname=genix ;;
3119 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3135 netbsd*) osname=netbsd
3138 news-os) osvers="$3"
3140 4*) osname=newsos4 ;;
3144 next*) osname=next ;;
3145 nonstop-ux) osname=nonstopux ;;
3146 openbsd) osname=openbsd
3152 POSIX-BC | posix-bc ) osname=posix-bc
3155 powerux | power_ux | powermax_os | powermaxos | \
3156 powerunix | power_unix) osname=powerux
3162 solaris) osname=solaris
3164 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3171 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3175 titanos) osname=titanos
3184 ultrix) osname=ultrix
3187 osf1|mls+) case "$5" in
3190 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3193 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3196 hp*) osname=hp_osf1 ;;
3197 mips) osname=mips_osf1 ;;
3200 # UnixWare 7.1.2 is known as Open UNIX 8
3201 openunix|unixware) osname=svr5
3209 $2) case "$osname" in
3213 : svr4.x or possibly later
3223 if test -f /stand/boot ; then
3224 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3225 if test -n "$INITPROG" -a -f "$INITPROG"; then
3226 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3227 if test -n "$isesix"; then
3235 *) if test -f /etc/systemid; then
3237 set `echo $3 | $sed 's/\./ /g'` $4
3238 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3240 elif $test -f $src/hints/sco_$1_$2.sh; then
3242 elif $test -f $src/hints/sco_$1.sh; then
3247 '') : Still unknown. Probably a generic Sys V.
3256 *) case "$osname" in
3257 '') : Still unknown. Probably a generic BSD.
3265 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3266 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3267 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3270 $rm -f UU/kernel.what
3271 elif test -d c:/. -o -n "$is_os2" ; then
3278 case "$targetarch" in
3281 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3286 : Now look for a hint file osname_osvers, unless one has been
3287 : specified already.
3290 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3291 : Also try without trailing minor version numbers.
3292 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3293 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3294 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3295 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3298 *) case "$osvers" in
3301 *) if $test -f $src/hints/$file.sh ; then
3303 elif $test -f $src/hints/$xfile.sh ; then
3305 elif $test -f $src/hints/$xxfile.sh ; then
3307 elif $test -f $src/hints/$xxxfile.sh ; then
3309 elif $test -f $src/hints/$xxxxfile.sh ; then
3311 elif $test -f "$src/hints/${osname}.sh" ; then
3320 if $test -f Policy.sh ; then
3323 none) dflt="Policy" ;;
3324 *) dflt="Policy $dflt" ;;
3329 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3333 if $test -f Policy.sh ; then
3336 There's also a Policy hint file available, which should make the
3337 site-specific (policy) questions easier to answer.
3344 You may give one or more space-separated answers, or "none" if appropriate.
3345 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3346 is a good thing. DO NOT give a wrong version or a wrong OS.
3350 rp="Which of these apply, if any?"
3353 for file in $tans; do
3354 if $test X$file = XPolicy -a -f Policy.sh; then
3356 $cat Policy.sh >> UU/config.sh
3357 elif $test -f $src/hints/$file.sh; then
3358 . $src/hints/$file.sh
3359 $cat $src/hints/$file.sh >> UU/config.sh
3360 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3363 : Give one chance to correct a possible typo.
3364 echo "$file.sh does not exist"
3366 rp="hint to use instead?"
3368 for file in $ans; do
3369 if $test -f "$src/hints/$file.sh"; then
3370 . $src/hints/$file.sh
3371 $cat $src/hints/$file.sh >> UU/config.sh
3372 elif $test X$ans = X -o X$ans = Xnone ; then
3375 echo "$file.sh does not exist -- ignored."
3382 : Remember our hint file for later.
3383 if $test -f "$src/hints/$file.sh" ; then
3393 echo "Fetching default answers from $config_sh..." >&4
3397 cp $config_sh config.sh 2>/dev/null
3407 test "$override" && . ./optdef.sh
3409 : Restore computed paths
3410 for file in $loclist $trylist; do
3411 eval $file="\$_$file"
3416 Configure uses the operating system name and version to set some defaults.
3417 The default value is probably right if the name rings a bell. Otherwise,
3418 since spelling matters for me, either accept the default or answer "none"
3425 ''|' '|none) dflt=none ;;
3426 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3429 *) dflt="$osname" ;;
3431 rp="Operating system name?"
3435 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3441 ''|' '|none) dflt=none ;;
3442 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3443 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3445 ''|' ') dflt=none ;;
3450 *) dflt="$osvers" ;;
3452 rp="Operating system version?"
3462 : who configured the system
3463 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3466 cf_by=`(logname) 2>/dev/null`
3469 cf_by=`(whoami) 2>/dev/null`
3471 "") cf_by=unknown ;;
3476 : set up the script used to warn in case of inconsistency
3483 echo "*** WHOA THERE!!! ***" >&4
3484 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3485 rp=" Keep the $hint value?"
3488 y) td=$was; tu=$was;;
3492 : function used to set $1 to $val
3493 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3495 $define$undef) . ./whoa; eval "$var=\$td";;
3496 $undef$define) . ./whoa; eval "$var=\$tu";;
3497 *) eval "$var=$val";;
3501 $define|true|[yY]*) dflt='y';;
3506 Perl can be built to use the SOCKS proxy protocol library. To do so,
3507 Configure must be run with -Dusesocks. If you use SOCKS you also need
3508 to use the PerlIO abstraction layer, this will be implicitly selected.
3510 If this doesn't make any sense to you, just accept the default '$dflt'.
3512 rp='Build Perl for SOCKS?'
3515 y|Y) val="$define" ;;
3522 $define|true|[yY]*) useperlio="$define";;
3525 case "$useperlio" in
3526 $define|true|[yY]*|'') dflt='y';;
3531 Previous version of $package used the standard IO mechanisms as
3532 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3533 alternate IO mechanisms via the PerlIO abstraction layer, but the
3534 stdio mechanism is still available if needed. The abstraction layer
3535 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3536 Using PerlIO with sfio may cause problems with some extension modules.
3538 If this doesn't make any sense to you, just accept the default '$dflt'.
3540 rp='Use the PerlIO abstraction layer?'
3547 echo "Ok, doing things the stdio way."
3556 case "$useperlio" in
3557 $define|true|[yY]*) ;;
3560 You are using the SOCKS proxy protocol library which means that you
3561 should also use the PerlIO layer. You may be headed for trouble.
3570 case "$usethreads" in
3571 $define|true|[yY]*) dflt='y';;
3572 *) # Catch case where user specified ithreads or 5005threads but
3573 # forgot -Dusethreads (A.D. 4/2002)
3574 case "$useithreads$use5005threads" in
3576 case "$useperlio" in
3577 "$define") dflt='y' ;;
3587 Perl can be built to take advantage of threads on some systems.
3588 To do so, Configure can be run with -Dusethreads.
3590 Note that Perl built with threading support runs slightly slower
3591 and uses more memory than plain Perl. The current implementation
3592 is believed to be stable, but it is fairly new, and so should be
3593 treated with caution.
3595 If this doesn't make any sense to you, just accept the default '$dflt'.
3597 rp='Build a threading Perl?'
3600 y|Y) val="$define" ;;
3606 case "$usethreads" in
3610 Since release 5.6, Perl has had two different threading implementations,
3611 the newer interpreter-based version (ithreads) with one interpreter per
3612 thread, and the older 5.005 version (5005threads).
3613 The 5005threads version is effectively unmaintained and will probably be
3614 removed in Perl 5.10, so there should be no need to build a Perl using it
3615 unless needed for backwards compatibility with some existing 5.005threads
3619 : Default to ithreads unless overridden on command line or with
3622 case "$use5005threads" in
3623 $define|true|[yY]*) dflt='n';;
3625 case "$useithreads" in
3626 $undef|false|[nN]*) dflt='n';;
3628 rp='Use the newer interpreter-based ithreads?'
3631 y|Y) val="$define" ;;
3636 : Now set use5005threads to the opposite value.
3637 case "$useithreads" in
3638 $define) val="$undef" ;;
3645 useithreads="$undef"
3646 use5005threads="$undef"
3650 case "$useithreads$use5005threads" in
3654 You cannot have both the ithreads and the 5.005 threads enabled
3655 at the same time. Disabling the 5.005 threads since they are
3656 much less stable than the ithreads.
3659 use5005threads="$undef"
3663 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3666 *** To build with ithreads you must also use the PerlIO layer.
3667 *** Cannot continue, aborting.
3673 case "$d_oldpthreads" in
3674 '') : Configure tests would be welcome here. For now, assume undef.
3676 *) val="$d_oldpthreads" ;;
3682 : Look for a hint-file generated 'call-back-unit'. If the
3683 : user has specified that a threading perl is to be built,
3684 : we may need to set or change some other defaults.
3685 if $test -f usethreads.cbu; then
3686 echo "Your platform has some specific hints regarding threaded builds, using them..."
3689 case "$usethreads" in
3690 "$define"|true|[yY]*)
3692 (Your platform does not have any specific hints for threaded builds.
3693 Assuming POSIX threads, then.)
3701 Perl can be built so that multiple Perl interpreters can coexist
3702 within the same Perl executable.
3705 case "$useithreads" in
3708 This multiple interpreter support is required for interpreter-based threads.
3712 *) case "$usemultiplicity" in
3713 $define|true|[yY]*) dflt='y';;
3717 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3718 rp='Build Perl for multiplicity?'
3721 y|Y) val="$define" ;;
3730 case "$usemorebits" in
3731 "$define"|true|[yY]*)
3732 use64bitint="$define"
3733 uselongdouble="$define"
3734 usemorebits="$define"
3736 *) usemorebits="$undef"
3740 : make some quick guesses about what we are up against
3742 $echo $n "Hmm... $c"
3752 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3753 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3755 echo "Looks kind of like an OSF/1 system, but we'll see..."
3757 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3758 xxx=`./loc addbib blurfl $pth`
3759 if $test -f $xxx; then
3760 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3764 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3765 echo "Looks kind of like an extended USG system, but we'll see..."
3767 echo "Looks kind of like a USG system, but we'll see..."
3771 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3772 echo "Looks kind of like a BSD system, but we'll see..."
3776 echo "Looks kind of like a Version 7 system, but we'll see..."
3779 case "$eunicefix" in
3782 There is, however, a strange, musty smell in the air that reminds me of
3783 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3787 : it so happens the Eunice I know will not run shell scripts in Unix format
3791 echo "Congratulations. You aren't running Eunice."
3795 : Detect OS2. The p_ variable is set above in the Head.U unit.
3796 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3797 : semicolon as a patch separator
3802 I have the feeling something is not exactly right, however...don't tell me...
3803 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3804 (Or you may be running DOS with DJGPP.)
3809 if test -f /xenix; then
3810 echo "Actually, this looks more like a XENIX system..."
3815 echo "It's not Xenix..."
3820 if test -f /venix; then
3821 echo "Actually, this looks more like a VENIX system..."
3828 echo "Nor is it Venix..."
3831 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3832 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3839 rp="Use which C compiler?"
3843 : See if they have not cc but they do have gcc
3845 : Look for a hint-file generated 'call-back-unit'. Now that the
3846 : user has specified the compiler, we may need to set or change some
3848 if $test -f cc.cbu; then
3854 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3860 printf("%s\n", __VERSION__);
3862 printf("%s\n", "1");
3868 if $cc -o try $ccflags $ldflags try.c; then
3869 gccversion=`$run ./try`
3870 case "$gccversion" in
3871 '') echo "You are not using GNU cc." ;;
3872 *) echo "You are using GNU cc $gccversion."
3878 echo "*** WHOA THERE!!! ***" >&4
3879 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3880 case "$knowitall" in
3882 echo " You'd better start hunting for one and let me know about it." >&4
3888 case "$gccversion" in
3889 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3891 case "$gccversion" in
3892 '') gccosandvers='' ;;
3893 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3894 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3896 case "$gccosandvers" in
3897 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3898 $osname$osvers) ;; # looking good
3899 $osname*) cat <<EOM >&4
3901 *** WHOA THERE!!! ***
3903 Your gcc has not been compiled for the exact release of
3904 your operating system ($gccosandvers versus $osname$osvers).
3906 In general it is a good idea to keep gcc synchronized with
3907 the operating system because otherwise serious problems
3908 may ensue when trying to compile software, like Perl.
3910 I'm trying to be optimistic here, though, and will continue.
3911 If later during the configuration and build icky compilation
3912 problems appear (headerfile conflicts being the most common
3913 manifestation), I suggest reinstalling the gcc to match
3914 your operating system release.
3918 *) gccosandvers='' ;; # failed to parse, better be silent
3926 # gcc 3.* complain about adding -Idirectories that they already know about,
3927 # so we will take those off from locincpth.
3928 case "$gccversion" in
3930 echo "main(){}">try.c
3931 for incdir in $locincpth; do
3932 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3933 grep '^c[cp]p*[01]: warning: changing search order '`
3934 if test "X$warn" != X; then
3935 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3941 : decide how portable to be. Allow command line overrides.
3942 case "$d_portable" in
3944 *) d_portable="$define" ;;
3947 : set up shell script to do ~ expansion
3953 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3956 if $test -f /bin/csh; then
3957 /bin/csh -f -c "glob \$1"
3962 name=\`$expr x\$1 : '..\([^/]*\)'\`
3963 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3964 if $test ! -d "\$dir"; then
3966 echo "\$me: can't locate home directory for: \$name" >&2
3971 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3987 : now set up to get a file name
3991 cat <<'EOSC' >>getfile
4007 : getfile will accept an answer from the comma-separated list
4008 : enclosed in parentheses even if it does not meet other criteria.
4009 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4010 fn=`echo $fn | sed 's/(.*)//'`
4016 loc_file=`expr $fn : '.*:\(.*\)'`
4017 fn=`expr $fn : '\(.*\):.*'`
4025 */*) fullpath=true;;
4034 *e*) exp_file=true;;
4037 *p*) nopath_ok=true;;
4042 *d*) type='Directory';;
4043 *l*) type='Locate';;
4048 Locate) what='File';;
4053 case "$d_portable" in
4061 while test "$type"; do
4066 true) rp="$rp (~name ok)";;
4069 if test -f UU/getfile.ok && \
4070 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4089 value=`UU/filexp $ans`
4092 if test "$ans" != "$value"; then
4093 echo "(That expands to $value on this system.)"
4107 /*) value="$ansexp" ;;
4108 [a-zA-Z]:/*) value="$ansexp" ;;
4113 echo "I shall only accept a full path name, as in /bin/ls." >&4
4114 echo "Use a ! shell escape if you wish to check pathnames." >&4
4117 echo "Please give a full path name, starting with slash." >&4
4120 echo "Note that using ~name is ok provided it expands well." >&4
4133 for fp in $gfpth; do
4134 if test "X$fp" = X.; then
4139 if test -f "$pf"; then
4141 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4143 echo "($value is not a plain file, but that's ok.)"
4146 if test X"$type" = X; then
4153 for fp in $gfpth; do
4154 if test "X$fp" = X.; then
4159 direxp="$fp/$ansexp"
4161 if test -d "$direxp"; then
4169 if test -d "$ansexp"; then
4170 echo "(Looking for $loc_file in directory $value.)"
4171 value="$value/$loc_file"
4172 ansexp="$ansexp/$loc_file"
4174 if test -f "$ansexp"; then
4177 case "$nopath_ok" in
4178 true) case "$value" in
4180 *) echo "Assuming $value will be in people's path."
4196 if test "$fastread" = yes; then
4201 rp="$what $value doesn't exist. Use that name anyway?"
4220 test "X$gfpthkeep" != Xy && gfpth=""
4223 : What should the include directory be ?
4225 $echo $n "Hmm... $c"
4229 if $test -f /bin/mips && /bin/mips; then
4230 echo "Looks like a MIPS system..."
4231 $cat >usr.c <<'EOCP'
4232 #ifdef SYSTYPE_BSD43
4236 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4237 dflt='/bsd43/usr/include'
4241 mips_type='System V'
4243 $rm -f usr.c usr.out
4244 echo "and you're compiling with the $mips_type compiler and libraries."
4248 echo "Doesn't look like a MIPS system."
4258 case "$xxx_prompt" in
4261 rp='Where are the include files you want to use?'
4269 : see how we invoke the C preprocessor
4271 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4272 cat <<'EOT' >testcpp.c
4278 if test ! -f cppstdin; then
4279 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4280 # AIX cc -E doesn't show the absolute headerfile
4281 # locations but we'll cheat by using the -M flag.
4282 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
4284 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4287 echo "Keeping your $hint cppstdin wrapper."
4290 wrapper=`pwd`/cppstdin
4294 if $test "X$cppstdin" != "X" && \
4295 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4296 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4298 echo "You used to use $cppstdin $cppminus so we'll use that again."
4300 '') echo "But let's see if we can live without a wrapper..." ;;
4302 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4303 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4305 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4308 echo "(However, $cpprun $cpplast does not work, let's see...)"
4316 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4323 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4324 $cc -E <testcpp.c >testcpp.out 2>&1; \
4325 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4326 echo "Yup, it does."
4329 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4330 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4331 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4332 echo "Yup, it does."
4335 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4336 $cc -P <testcpp.c >testcpp.out 2>&1; \
4337 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4338 echo "Yipee, that works!"
4341 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4342 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4343 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4344 echo "At long last!"
4347 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4348 $cpp <testcpp.c >testcpp.out 2>&1; \
4349 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4353 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4354 $cpp - <testcpp.c >testcpp.out 2>&1; \
4355 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4356 echo "Hooray, it works! I was beginning to wonder."
4359 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4360 $wrapper <testcpp.c >testcpp.out 2>&1; \
4361 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4367 rp="No dice. I can't find a C preprocessor. Name one:"
4371 $x_cpp <testcpp.c >testcpp.out 2>&1
4372 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4373 echo "OK, that will do." >&4
4375 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4390 echo "Perhaps can we force $cc -E using a wrapper..."
4391 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4392 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4398 echo "Nope, we'll have to live without it..."
4412 "$wrapper"|'cppstdin') ;;
4413 *) $rm -f $wrapper;;
4415 $rm -f testcpp.c testcpp.out
4417 : Set private lib path
4420 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4425 '') dlist="$loclibpth $plibpth $glibpth";;
4426 *) dlist="$libpth";;
4429 : Now check and see which directories actually exist, avoiding duplicates
4433 if $test -d $xxx; then
4436 *) libpth="$libpth $xxx";;
4442 Some systems have incompatible or broken versions of libraries. Among
4443 the directories listed in the question below, please remove any you
4444 know not to be holding relevant libraries, and add any that are needed.
4445 Say "none" for none.
4456 rp="Directories to use for library searches?"
4463 : compute shared library extension
4466 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4476 On some systems, shared libraries may be available. Answer 'none' if
4477 you want to suppress searching of shared libraries for the remainder
4478 of this configuration.
4481 rp='What is the file extension used for shared libraries?'
4485 : Define several unixisms.
4486 : Hints files or command line option can be used to override them.
4487 : The convoluted testing is in case hints files set either the old
4490 '') case "$exe_ext" in
4492 *) _exe="$exe_ext" ;;
4497 '') case "$lib_ext" in
4504 '') case "$obj_ext" in
4511 '') case "$path_sep" in
4522 : Which makefile gets called first. This is used by make depend.
4523 case "$firstmakefile" in
4524 '') firstmakefile='makefile';;
4528 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4531 case "$uselongdouble" in
4532 $define|true|[yY]*) dflt='y';;
4537 Perl can be built to take advantage of long doubles which
4538 (if available) may give more accuracy and range for floating point numbers.
4540 If this doesn't make any sense to you, just accept the default '$dflt'.
4542 rp='Try to use long doubles if available?'
4545 y|Y) val="$define" ;;
4551 case "$uselongdouble" in
4552 true|[yY]*) uselongdouble="$define" ;;
4555 : Look for a hint-file generated 'call-back-unit'. If the
4556 : user has specified that long doubles should be used,
4557 : we may need to set or change some other defaults.
4558 if $test -f uselongdouble.cbu; then
4559 echo "Your platform has some specific hints regarding long doubles, using them..."
4560 . ./uselongdouble.cbu
4562 case "$uselongdouble" in
4565 (Your platform does not have any specific hints for long doubles.)
4571 : Looking for optional libraries
4573 echo "Checking for optional libraries..." >&4
4578 case "$libswanted" in
4579 '') libswanted='c_s';;
4582 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4588 for thisdir in $libpth $xlibpth; do
4589 test -d $thisdir && libspath="$libspath $thisdir"
4591 for thislib in $libswanted; do
4592 for thisdir in $libspath; do
4594 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4595 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4596 $test -f "$xxx" && eval $libscheck
4597 $test -f "$xxx" && libstyle=shared
4599 if test ! -f "$xxx"; then
4600 xxx=$thisdir/lib$thislib.$so
4601 $test -f "$xxx" && eval $libscheck
4602 $test -f "$xxx" && libstyle=shared
4604 if test ! -f "$xxx"; then
4605 xxx=$thisdir/lib$thislib$_a
4606 $test -f "$xxx" && eval $libscheck
4607 $test -f "$xxx" && libstyle=static
4609 if test ! -f "$xxx"; then
4610 xxx=$thisdir/$thislib$_a
4611 $test -f "$xxx" && eval $libscheck
4612 $test -f "$xxx" && libstyle=static
4614 if test ! -f "$xxx"; then
4615 xxx=$thisdir/lib${thislib}_s$_a
4616 $test -f "$xxx" && eval $libscheck
4617 $test -f "$xxx" && libstyle=static
4618 $test -f "$xxx" && thislib=${thislib}_s
4620 if test ! -f "$xxx"; then
4621 xxx=$thisdir/Slib$thislib$_a
4622 $test -f "$xxx" && eval $libscheck
4623 $test -f "$xxx" && libstyle=static
4625 if $test -f "$xxx"; then
4627 shared) echo "Found -l$thislib (shared)." ;;
4628 static) echo "Found -l$thislib." ;;
4629 *) echo "Found -l$thislib ($libstyle)." ;;
4633 *) dflt="$dflt -l$thislib"
4634 libsfound="$libsfound $xxx"
4636 libsfiles="$libsfiles $yyy"
4637 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4638 case " $libsdirs " in
4640 *) libsdirs="$libsdirs $yyy" ;;
4647 if $test ! -f "$xxx"; then
4648 echo "No -l$thislib."
4659 ' '|'') dflt='none';;
4664 In order to compile $package on your machine, a number of libraries
4665 are usually needed. Include any other special libraries here as well.
4666 Say "none" for none. The default list is almost always right.
4670 rp="What libraries to use?"
4677 : determine optimization, if desired, or use for debug flag also
4679 ' '|$undef) dflt='none';;
4681 *) dflt="$optimize";;
4685 By default, $package compiles with the -O flag to use the optimizer.
4686 Alternately, you might want to use the symbolic debugger, which uses
4687 the -g flag (on traditional Unix systems). Either flag can be
4688 specified here. To use neither flag, specify the word "none".
4691 rp="What optimizer/debugger flag should be used?"
4695 'none') optimize=" ";;
4699 : We will not override a previous value, but we might want to
4700 : augment a hint file
4702 default|recommended)
4703 case "$gccversion" in
4704 1*) dflt='-fpcc-struct-return' ;;
4707 *-g*) dflt="$dflt -DDEBUGGING";;
4709 case "$gccversion" in
4710 2*) if test -d /etc/conf/kconfig.d &&
4711 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4713 # Interactive Systems (ISC) POSIX mode.
4718 case "$gccversion" in
4722 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4723 echo 'int main(void) { return 0; }' > gcctest.c
4724 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4725 echo "Yes, it does." 2>&1
4728 echo "Leaving current flags $ccflags alone." 2>&1
4730 *) dflt="$dflt -fno-strict-aliasing" ;;
4733 echo "Nope, it doesn't, but that's ok." 2>&1
4737 # For gcc, adding -pipe speeds up compilations for some, but apparently
4738 # some assemblers can't read from stdin. (It also slows down compilations
4739 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4740 case "$gccversion" in
4742 echo "Checking if your compiler accepts -pipe" 2>&1
4743 echo 'int main(void) { return 0; }' > gcctest.c
4744 if $cc -O2 -pipe -o gcctest gcctest.c; then
4745 echo "Yes, it does." 2>&1
4748 echo "Leaving current flags $ccflags alone." 2>&1
4750 *) dflt="$dflt -pipe" ;;
4753 echo "Nope, it doesn't, but that's ok." 2>&1
4760 case "$mips_type" in
4761 *BSD*|'') inclwanted="$locincpth $usrinc";;
4762 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4764 for thisincl in $inclwanted; do
4765 if $test -d $thisincl; then
4766 if $test x$thisincl != x$usrinc; then
4768 *" -I$thisincl "*);;
4769 *) dflt="$dflt -I$thisincl ";;
4775 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4777 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4785 *) dflt="$dflt -D$2";;
4789 set signal.h LANGUAGE_C; eval $inctest
4793 ccflags="$ccflags -DSOCKS"
4798 default|recommended) dflt="$ccflags $dflt" ;;
4799 *) dflt="$ccflags";;
4808 Your C compiler may want other flags. For this question you should include
4809 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4810 but you should NOT include libraries or ld flags like -lwhatever. If you