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 Sun Apr 24 14:17:04 CEST 2005 [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 /opt/ansic/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=''
528 d_libm_lib_version=''
581 d_old_pthread_create_joinable=''
582 old_pthread_create_joinable=''
584 d_pthread_attr_setscope=''
623 sethostent_r_proto=''
640 setprotoent_r_proto=''
652 setservent_r_proto=''
697 d_stdio_ptr_lval_nochange_cnt=''
698 d_stdio_ptr_lval_sets_cnt=''
901 inc_version_list_init=''
920 ignore_versioned_solibs=''
980 d_perl_otherlibdirs=''
994 version_patchlevel_string=''
1009 nv_preserves_uv_bits=''
1080 installsitehtml1dir=''
1083 installsitehtml3dir=''
1090 installsiteman1dir=''
1093 installsiteman3dir=''
1098 installsitescript=''
1113 d_stdio_stream_array=''
1114 stdio_stream_array=''
1125 ccflags_uselargefiles=''
1126 ldflags_uselargefiles=''
1127 libswanted_uselargefiles=''
1137 userelocatableinc=''
1148 installvendorarch=''
1155 installvendorhtml1dir=''
1157 vendorhtml1direxp=''
1158 installvendorhtml3dir=''
1160 vendorhtml3direxp=''
1166 installvendorman1dir=''
1169 installvendorman3dir=''
1176 installvendorscript=''
1188 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1191 : We must find out about Eunice early
1193 if test -f /etc/unixtovms; then
1194 eunicefix=/etc/unixtovms
1196 if test -f /etc/unixtovms.exe; then
1197 eunicefix=/etc/unixtovms.exe
1200 : Set executable suffix now -- needed before hints available
1201 if test -f "/libs/version.library"; then
1204 elif test -f "/system/gnu_library/bin/ar.pm"; then
1207 elif test -n "$DJGPP"; then
1210 elif test -d c:/. -o -n "$is_os2" ; then
1219 : set useposix=false in your hint file to disable the POSIX extension.
1221 : set useopcode=false in your hint file to disable the Opcode extension.
1223 : Trailing extension. Override this in a hint file, if needed.
1224 : Extra object files, if any, needed on this platform.
1227 : Possible local include directories to search.
1228 : Set locincpth to "" in a hint file to defeat local include searches.
1229 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1230 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1232 : no include file wanted by default
1237 : change the next line if compiling for Xenix/286 on Xenix/386
1238 xlibpth='/usr/lib/386 /lib/386'
1239 : Possible local library directories to search.
1240 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1241 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1243 : general looking path for locating libraries
1244 glibpth="/lib /usr/lib $xlibpth"
1245 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1246 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1247 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1249 : Private path used by Configure to find libraries. Its value
1250 : is prepended to libpth. This variable takes care of special
1251 : machines, like the mips. Usually, it should be empty.
1254 : default library list
1256 : some systems want to use only the non-versioned libso:s
1257 ignore_versioned_solibs=''
1262 ccflags_uselargefiles=''
1263 ldflags_uselargefiles=''
1264 libswanted_uselargefiles=''
1265 : set usemultiplicity on the Configure command line to enable multiplicity.
1266 : set usesocks on the Configure command line to enable socks.
1267 : set usethreads on the Configure command line to enable threads.
1268 usereentrant='undef'
1269 : full support for void wanted by default
1272 : List of libraries we want.
1273 : If anyone needs extra -lxxx, put those in a hint file.
1274 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1275 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1276 : We probably want to search /usr/shlib before most other libraries.
1277 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1278 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1279 glibpth="/usr/shlib $glibpth"
1280 : Do not use vfork unless overridden by a hint file.
1283 : Find the basic shell for Bourne shell scripts
1287 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1290 if test -f "$xxx"; then
1293 : Build up a list and do a single loop so we can 'break' out.
1294 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1295 for xxx in sh bash ksh pdksh ash; do
1297 try="$try ${p}/${xxx}"
1301 if test -f "$xxx"; then
1304 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1307 elif test -f "$xxx.exe"; then
1318 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1320 Usually it's in /bin/sh. How did you even get this far?
1321 Please contact me (Perl Maintainers) at perlbug@perl.org and
1322 we'll try to straighten this all out.
1328 : see if sh knows # comments
1329 if `$sh -c '#' >/dev/null 2>&1`; then
1333 test -f $xcat$_exe || xcat=/usr/bin/cat
1334 if test ! -f $xcat$_exe; then
1335 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1336 if test -f $p/cat$_exe; then
1341 if test ! -f $xcat$_exe; then
1342 echo "Can't find cat anywhere!"
1346 echo "#!$xcat" >sharp
1350 if test -s today; then
1353 echo "#! $xcat" > sharp
1357 if test -s today; then
1365 echo "Your $sh doesn't grok # comments--I will strip them later on."
1368 echo "exec grep -v '^[ ]*#'" >spitshell
1370 $eunicefix spitshell
1371 spitshell=`pwd`/spitshell
1373 echo "I presume that if # doesn't work, #! won't work either!"
1378 : figure out how to guarantee sh startup
1380 '') startsh=${sharpbang}${sh} ;;
1392 : echo "Yup, it does."
1394 echo "Hmm... '$startsh' does not guarantee sh startup..."
1395 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1400 : Save command line options in file UU/cmdline.opt for later use in
1401 : generating config.sh.
1402 cat > cmdline.opt <<EOSH
1403 # Configure command line arguments.
1412 cat >>cmdline.opt <<EOSH
1413 config_arg$argn='$arg'
1415 # Extreme backslashitis: replace each ' by '"'"'
1416 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1419 arg_exp=`cat cmdl.opt`
1420 args_exp="$args_exp$args_sep'$arg_exp'"
1421 argn=`expr $argn + 1`
1424 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1425 # used by ./hints/os2.sh
1428 : produce awk script to parse command line options
1429 cat >options.awk <<'EOF'
1431 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1433 len = length(optstr);
1434 for (i = 1; i <= len; i++) {
1435 c = substr(optstr, i, 1);
1436 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1447 if (substr(str, 1, 1) != "-") {
1448 printf("'%s'\n", str);
1452 for (i = 2; i <= len; i++) {
1453 c = substr(str, i, 1);
1455 printf("-%s\n", substr(str, i));
1461 printf("'%s'\n", substr(str, i + 1));
1474 : process the command line options
1475 set X `for arg in "$@"; do echo "X$arg"; done |
1476 sed -e s/X// | awk -f options.awk`
1481 : set up default values
1491 rm -f optdef.sh posthint.sh
1492 cat >optdef.sh <<EOS
1498 while test $# -gt 0; do
1500 -d) shift; fastread=yes;;
1501 -e) shift; alldone=cont;;
1505 if test -r "$1"; then
1508 echo "$me: cannot read config file $1." >&2
1513 -h) shift; error=true;;
1514 -r) shift; reuseval=true;;
1515 -s) shift; silent=true; realsilent=true;;
1516 -E) shift; alldone=exit;;
1517 -K) shift; knowitall=true;;
1518 -O) shift; override=true;;
1519 -S) shift; silent=true; extractsh=true;;
1524 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1525 echo "$me: ignoring -D $1" >&2
1528 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1529 *) echo "$1='define'" >> optdef.sh;;
1536 *=) echo "$1" >> optdef.sh;;
1538 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1539 echo "$me: ignoring -U $1" >&2
1541 *) echo "$1='undef'" >> optdef.sh;;
1552 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1556 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1557 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1563 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1564 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1565 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1566 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1567 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1568 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1574 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1576 echo "$yyy=''" >> posthint.sh ;;
1581 echo "$yyy='$zzz'" >> posthint.sh ;;
1583 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1585 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1590 echo "$yyy=$zzz" >> posthint.sh ;;
1591 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1595 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1598 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1606 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1607 [-U symbol] [-U symbol=] [-A command:symbol...]
1608 -d : use defaults for all answers.
1609 -e : go on without questioning past the production of config.sh.
1610 -f : specify an alternate default configuration file.
1611 -h : print this help message and exit (with an error status).
1612 -r : reuse C symbols value if possible (skips costly nm extraction).
1613 -s : silent mode, only echoes questions and essential information.
1614 -D : define symbol to have some value:
1615 -D symbol symbol gets the value 'define'
1616 -D symbol=value symbol gets the value 'value'
1617 -E : stop at the end of questions, after having produced config.sh.
1618 -K : do not use unless you know what you are doing.
1619 -O : let -D and -U override definitions from loaded configuration file.
1620 -S : perform variable substitutions on all .SH files (can mix with -f)
1621 -U : undefine symbol:
1622 -U symbol symbol gets the value 'undef'
1623 -U symbol= symbol gets completely empty
1624 -A : manipulate symbol after the platform specific hints have been applied:
1625 -A symbol=value append " "value to symbol
1626 -A append:symbol=value append value to symbol
1627 -A define:symbol=value define symbol to have value
1628 -A clear:symbol define symbol to be ''
1629 -A define:symbol define symbol to be 'define'
1630 -A eval:symbol=value define symbol to be eval of value
1631 -A prepend:symbol=value prepend value to symbol
1632 -A undef:symbol define symbol to be 'undef'
1633 -A undef:symbol= define symbol to be ''
1634 -V : print version number and exit (with a zero status).
1641 case "$fastread$alldone" in
1644 case "$extractsh" in
1647 if test ! -t 0; then
1648 echo "Say 'sh Configure', not 'sh <Configure'"
1658 true) exec 1>/dev/null;;
1661 : run the defines and the undefines, if any, but leave the file out there...
1664 : create the posthint manipulation script and leave the file out there...
1669 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1670 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1671 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1672 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1673 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1676 : Some greps do not return status, grrr.
1677 echo "grimblepritz" >grimble
1678 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1680 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1686 : the following should work in any shell
1690 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1691 cat >contains <<'EOSS'
1692 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1697 : Find the path to the source tree
1700 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1704 *) src=`cd ../$src && pwd` ;;
1717 if test -f $rsrc/Configure && \
1718 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1720 : found it, so we are ok.
1723 for src in . .. ../.. ../../.. ../../../..; do
1724 if test -f ../$src/Configure && \
1725 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1736 Sorry, I can't seem to locate the source dir for $package. Please start
1737 Configure with an explicit path -- i.e. /some/path/Configure.
1745 echo "Sources for $package found in \"$src\"." >&4
1749 : script used to extract .SH files with variable substitutions
1750 cat >extract <<'EOS'
1752 echo "Doing variable substitutions on .SH files..."
1753 if test -f MANIFEST; then
1754 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1756 echo "(Looking for .SH files under the source directory.)"
1757 set x `(cd "$src"; find . -name "*.SH" -print)`
1761 0) set x `(cd "$src"; echo *.SH)`; shift;;
1763 if test ! -f "$src/$1"; then
1769 while test $name; do
1770 if test ! -d "$name"; then
1771 create="$name $create";
1772 name=`echo $name | sed -e "s|^[^/]*$||"`;
1773 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1778 for file in $create; do
1787 dir=`expr X$file : 'X\(.*\)/'`
1788 file=`expr X$file : 'X.*/\(.*\)'`
1789 (cd "$dir" && . ./$file)
1799 dir=`expr X$file : 'X\(.*\)/'`
1800 file=`expr X$file : 'X.*/\(.*\)'`
1801 (set x $dir; shift; eval $mkdir_p)
1802 sh <"$src/$dir/$file"
1811 if test -f "$src/config_h.SH"; then
1812 if test ! -f config.h; then
1813 : oops, they left it out of MANIFEST, probably, so do it anyway.
1814 . "$src/config_h.SH"
1819 : extract files and exit if asked to do so
1820 case "$extractsh" in
1822 case "$realsilent" in
1826 case "$config_sh" in
1827 '') config_sh='config.sh';;
1830 echo "Fetching answers from $config_sh..."
1833 test "$override" && . ./optdef.sh
1837 echo "Extraction done."
1842 : Eunice requires " " instead of "", can you believe it
1845 echo "Beginning of configuration questions for $package."
1847 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1849 : first determine how to suppress newline on echo command
1851 echo "Checking echo to see how to suppress newlines..."
1852 (echo "hi there\c" ; echo " ") >.echotmp
1853 if $contains c .echotmp >/dev/null 2>&1 ; then
1864 echo $n "The star should be here-->$c"
1868 : Now test for existence of everything in MANIFEST
1870 if test -f "$rsrc/MANIFEST"; then
1871 echo "First let's make sure your kit is complete. Checking..." >&4
1872 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1875 for filelist in x??; do
1876 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1878 if test -s missing; then
1882 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1884 You have the option of continuing the configuration process, despite the
1885 distinct possibility that your kit is damaged, by typing 'y'es. If you
1886 do, don't blame me if something goes wrong. I advise you to type 'n'o
1887 and contact the author (perlbug@perl.org).
1890 echo $n "Continue? [n] $c" >&4
1894 echo "Continuing..." >&4
1898 echo "ABORTING..." >&4
1903 echo "Looks good..."
1906 echo "There is no MANIFEST file. I hope your kit is complete !"
1911 : Find the appropriate value for a newline for tr
1912 if test -n "$DJGPP"; then
1915 if test X"$trnl" = X; then
1916 case "`echo foo|tr '\n' x 2>/dev/null`" in
1920 if test X"$trnl" = X; then
1921 case "`echo foo|tr '\012' x 2>/dev/null`" in
1922 foox) trnl='\012' ;;
1925 if test X"$trnl" = X; then
1926 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1927 fooxy) trnl='\n\r' ;;
1930 if test X"$trnl" = X; then
1933 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1939 : compute the number of columns on the terminal for proper question formatting
1944 : set up the echo used in my read
1945 myecho="case \"\$xxxm\" in
1946 '') echo $n \"\$rp $c\" >&4;;
1948 '') echo $n \"[\$xxxm] $c\";;
1950 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1952 echo $n \"[\$xxxm] $c\" >&4
1954 echo $n \"\$rp [\$xxxm] $c\" >&4
1960 : now set up to do reads with possible shell escape and default assignment
1966 case "\$fastread" in
1967 yes) case "\$dflt" in
1970 case "\$silent-\$rp" in
1975 *) case "\$silent" in
1976 true) case "\$rp" in
1981 while expr "X\$ans" : "X!" >/dev/null; do
1985 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1993 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2002 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2007 echo "(OK, I'll run with -d after this question.)" >&4
2010 echo "*** Sorry, \$1 not supported yet." >&4
2020 echo "*** Substitution done -- please confirm."
2022 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2027 echo "*** Error -- try again."
2034 case "\$ans\$xxxm\$nostick" in
2046 : create .config dir to save info across Configure sessions
2047 test -d ../.config || mkdir ../.config
2048 cat >../.config/README <<EOF
2049 This directory created by Configure to save information that should
2050 persist across sessions for $package.
2052 You may safely delete it if you wish.
2055 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2057 $define|true|[yY]*) ;;
2058 *) case "$xversion" in
2061 *** WHOA THERE!!! ***
2063 This is an UNSTABLE DEVELOPMENT release.
2064 The version of this $package distribution is $xversion, that is, odd,
2065 (as opposed to even) and that signifies a development release.
2066 If you want a maintenance release, you want an even-numbered version.
2068 Do ***NOT*** install this into production use.
2069 Data corruption and crashes are possible.
2071 It is most seriously suggested that you do not continue any further
2072 unless you want to help in developing and debugging Perl.
2074 If you *still* want to build perl, you can answer 'y' now,
2075 or pass -Dusedevel to Configure.
2078 rp='Do you really want to continue?'
2082 [yY]) echo >&4 "Okay, continuing."
2083 usedevel="$define" ;;
2084 *) echo >&4 "Okay, bye."
2094 case "$versiononly" in
2095 '') versiononly="$define" ;;
2097 case "$installusrbinperl" in
2098 '') installusrbinperl="$undef" ;;
2103 : general instructions
2106 user=`(logname) 2>/dev/null`
2108 '') user=`whoami 2>&1`;;
2110 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2113 rp='Would you like to see the instructions?'
2124 This installation shell script will examine your system and ask you questions
2125 to determine how the perl5 package should be installed. If you get
2126 stuck on a question, you may use a ! shell escape to start a subshell or
2127 execute a command. Many of the questions will have default answers in square
2128 brackets; typing carriage return will give you the default.
2130 On some of the questions which ask for file or directory names you are allowed
2131 to use the ~name construct to specify the login directory belonging to "name",
2132 even if you don't have a shell which knows about that. Questions where this is
2133 allowed will be marked "(~name ok)".
2137 dflt='Type carriage return to continue'
2141 The prompter used in this script allows you to use shell variables and
2142 backticks in your answers. You may use $1, $2, etc... to refer to the words
2143 in the default answer, as if the default line was a set of arguments given to a
2144 script shell. This means you may also use $* to repeat the whole default line,
2145 so you do not have to re-type everything to add something to the default.
2147 Everytime there is a substitution, you will have to confirm. If there is an
2148 error (e.g. an unmatched backtick), the default answer will remain unchanged
2149 and you will be prompted again.
2151 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2152 the questions and use the computed defaults (or the previous answers if there
2153 was already a config.sh file). Type 'Configure -h' for a list of options.
2154 You may also start interactively and then answer '& -d' at any prompt to turn
2155 on the non-interactive behaviour for the remainder of the execution.
2161 Much effort has been expended to ensure that this shell script will run on any
2162 Unix system. If despite that it blows up on yours, your best bet is to edit
2163 Configure and run it again. If you can't run Configure for some reason,
2164 you'll have to generate a config.sh file by hand. Whatever problems you
2165 have, let me (perlbug@perl.org) know how I blew it.
2167 This installation script affects things in two ways:
2169 1) it may do direct variable substitutions on some of the files included
2171 2) it builds a config.h file for inclusion in C programs. You may edit
2172 any of these files as the need arises after running this script.
2174 If you make a mistake on a question, there is no easy way to back up to it
2175 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2176 files. Configure will offer to let you do this before it runs the SH files.
2179 dflt='Type carriage return to continue'
2181 case "$firsttime" in
2182 true) echo $user >>../.config/instruct;;
2186 : find out where common programs are
2188 echo "Locating common programs..." >&4
2201 if test -d \$dir/\$thing; then
2207 for thisthing in \$dir/\$thing; do
2208 : just loop through to pick last item
2210 if test -f \$thisthing; then
2213 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2216 elif test -f \$dir/\$thing.exe; then
2217 if test -n "$DJGPP"; then
2218 echo \$dir/\$thing.exe
2219 elif test "$eunicefix" != ":"; then
2220 : on Eunice apparently
2274 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2275 pth="$pth /lib /usr/lib"
2276 for file in $loclist; do
2280 if test -f "$xxx"; then
2283 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2284 xxx=`./loc $file $file $pth`
2287 '') xxx=`./loc $file $file $pth`;;
2288 *) xxx=`./loc $xxx $xxx $pth`;;
2290 eval $file=$xxx$_exe
2294 echo $file is in $xxx.
2297 echo $file is in $xxx.
2300 echo "I don't know where '$file' is, and my life depends on it." >&4
2301 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2307 echo "Don't worry if any of the following aren't found..."
2309 for file in $trylist; do
2313 if test -f "$xxx"; then
2316 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2317 xxx=`./loc $file $file $pth`
2320 '') xxx=`./loc $file $file $pth`;;
2321 *) xxx=`./loc $xxx $xxx $pth`;;
2323 eval $file=$xxx$_exe
2327 echo $file is in $xxx.
2330 echo $file is in $xxx.
2333 echo "I don't see $file out there, $say."
2340 echo "Substituting grep for egrep."
2347 echo "Substituting cp for ln."
2356 echo "I can't find make or gmake, and my life depends on it." >&4
2357 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2365 *) # We can't have osname yet.
2366 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2367 # Assume that gmake, if found, is definitely GNU make
2368 # and prefer it over the system make.
2369 echo "Substituting gmake for make."
2377 echo "Hopefully test is built into your sh."
2380 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2381 echo "Using the test built into your sh."
2389 echo "Hopefully echo is built into your sh."
2394 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2395 $echo $n "hi there$c" >foo1
2396 echo $n "hi there$c" >foo2
2397 if cmp foo1 foo2 >/dev/null 2>&1; then
2398 echo "They are compatible. In fact, they may be identical."
2405 They are not compatible! You are probably running ksh on a non-USG system.
2406 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2407 have echo built in and we may have to run some Bourne shell scripts. That
2408 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2411 $echo $n "The star should be here-->$c"
2421 cat <<'EOSC' >>trygcc
2426 int main(int argc, char *argv[]) {
2430 if $cc -o try $ccflags $ldflags try.c; then
2433 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2439 case "`$cc -v -c try.c 2>&1`" in
2442 if $test X"$trygcc" = Xyes; then
2443 if gcc -o try -c try.c; then
2445 echo "You seem to have a working gcc, though." >&4
2446 rp="Would you like to use it?"
2448 if $test -f myread; then
2451 if $test -f UU/myread; then
2454 echo "Cannot find myread, sorry. Aborting." >&2
2459 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2460 if $test -f usethreads.cbu; then
2463 *** However, any setting of the C compiler flags (e.g. for thread support)
2464 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2465 *** (together with e.g. -Dusethreads).
2481 cat <<'EOSC' >>checkcc
2486 int main(int argc, char *argv[]) {
2490 if $cc -o try $ccflags $ldflags try.c; then
2493 if $test X"$despair" = Xyes; then
2494 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2497 You need to find a working C compiler.
2498 Either (purchase and) install the C compiler supplied by your OS vendor,
2499 or for a free C compiler try http://gcc.gnu.org/
2500 I cannot continue any further, aborting.
2509 : determine whether symbolic links are supported
2512 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2513 echo "Symbolic links are supported." >&4
2516 echo "Symbolic links are NOT supported." >&4
2521 : determine whether symbolic links are supported
2525 echo "Checking how to test for symbolic links..." >&4
2527 if $test "X$issymlink" = X; then
2529 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2530 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2532 if test $? = 0; then
2535 echo "Your builtin 'test -h' may be broken." >&4
2538 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2541 if test -f "$p/$test"; then
2550 echo "Trying external '$test -h'." >&4
2551 issymlink="$test -h"
2552 if $test ! -h sym >/dev/null 2>&1; then
2553 echo "External '$test -h' is broken, too." >&4
2561 if $test "X$issymlink" = X; then
2562 if $test -L sym 2>/dev/null; then
2563 issymlink="$test -L"
2564 echo "The builtin '$test -L' worked." >&4
2567 if $test "X$issymlink" != X; then
2568 echo "You can test for symbolic links with '$issymlink'." >&4
2570 echo "I do not know how you can test for symbolic links." >&4
2574 *) echo "No symbolic links, so not testing for their testing..." >&4
2580 case "$mksymlinks" in
2583 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2586 *) case "$lns:$issymlink" in
2587 *"ln"*" -s:"*"test -"?)
2588 echo "Creating the symbolic links..." >&4
2589 echo "(First creating the subdirectories...)" >&4
2591 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2593 test -z "$directory" && break
2597 if test ! -d t/base; then
2598 echo "Failed to create the subdirectories. Aborting." >&4
2601 echo "(Then creating the symlinks...)" >&4
2602 awk '{print $1}' $src/MANIFEST | while true; do
2604 test -z "$filename" && break
2605 if test -f $filename; then
2606 if $issymlink $filename; then
2610 if test -f $filename; then
2611 echo "$filename already exists, not symlinking."
2613 ln -s $src/$filename $filename
2617 if test ! -f t/base/lex.t; then
2618 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2623 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2632 case "$usecrosscompile" in
2634 $echo "Cross-compiling..."
2637 *-*-gcc) # A cross-compiling gcc, probably.
2638 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2640 # leave out ld, choosing it is more complex
2642 ranlib=$targetarch-ranlib
2643 $echo 'extern int foo;' > try.c
2644 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2646 if $test $# -gt 0; then
2648 incpth="`$echo $incpth|$sed 's/^ //'`"
2649 echo "Guessing incpth '$incpth'." >&4
2651 j="`$echo $i|$sed 's,/include$,/lib,'`"
2652 if $test -d $j; then
2656 libpth="`$echo $libpth|$sed 's/^ //'`"
2657 echo "Guessing libpth '$libpth'." >&4
2662 case "$targetarch" in
2663 '') echo "Targetarch not defined." >&4; croak=y ;;
2664 *) echo "Using targetarch $targetarch." >&4 ;;
2667 '') echo "Incpth not defined." >&4; croak=y ;;
2668 *) echo "Using incpth '$incpth'." >&4 ;;
2671 '') echo "Libpth not defined." >&4; croak=y ;;
2672 *) echo "Using libpth '$libpth'." >&4 ;;
2675 '') for i in $incpth; do
2676 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2678 echo "Guessing usrinc $usrinc." >&4
2683 '') echo "Usrinc not defined." >&4; croak=y ;;
2686 *) echo "Using usrinc $usrinc." >&4 ;;
2688 case "$targethost" in
2689 '') echo "Targethost not defined." >&4; croak=y ;;
2690 *) echo "Using targethost $targethost." >&4
2695 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2698 /*) run=$src/Cross/run
2699 targetmkdir=$src/Cross/mkdir
2701 from=$src/Cross/from
2703 *) pwd=`$test -f ../Configure & cd ..; pwd`
2705 targetmkdir=$pwd/Cross/mkdir
2707 from=$pwd/Cross/from
2710 case "$targetrun" in
2711 '') targetrun=ssh ;;
2716 case "$targetfrom" in
2717 '') targetfrom=scp ;;
2721 from=$from-$targetfrom
2722 case "$targetdir" in
2724 echo "Guessing targetdir $targetdir." >&4
2727 case "$targetuser" in
2729 echo "Guessing targetuser $targetuser." >&4
2732 case "$targetfrom" in
2736 case "$targetrun" in
2748 '') cwd=$targetdir ;;
2752 if $test ! -f \$exe.xok; then
2756 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2759 *) echo "Unknown targetrun '$targetrun'" >&4
2763 case "$targetmkdir" in
2765 cat >$targetmkdir <<EOF
2767 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2769 $chmod a+rx $targetmkdir
2771 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2783 $targetmkdir \`dirname \$f\`
2784 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2787 $targetmkdir $targetdir/\`dirname \$f\`
2788 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2801 $mkdir -p $targetdir/\`dirname \$f\`
2802 $cp \$f $targetdir/\$f || exit 1
2805 $targetmkdir $targetdir/\`dirname \$f\`
2806 $cp \$f $targetdir/\$f || exit 1
2813 *) echo "Unknown targetto '$targetto'" >&4
2817 case "$targetfrom" in
2824 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2829 cp) cat >$from <<EOF
2834 cp $targetdir/\$f . || exit 1
2839 *) echo "Unknown targetfrom '$targetfrom'" >&4
2843 if $test ! -f $run; then
2844 echo "Target 'run' script '$run' not found." >&4
2848 if $test ! -f $to; then
2849 echo "Target 'to' script '$to' not found." >&4
2853 if $test ! -f $from; then
2854 echo "Target 'from' script '$from' not found." >&4
2858 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2862 Using '$run' for remote execution,
2863 and '$from' and '$to'
2864 for remote file transfer.
2870 usecrosscompile='undef'
2875 : see whether [:lower:] and [:upper:] are supported character classes
2877 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2879 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2883 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2884 # (0xd9 and 0xe2), therefore that is a nice testing point.
2885 if test "X$up" = X -o "X$low" = X; then
2886 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2892 if test "X$up" = X -o "X$low" = X; then
2893 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2899 if test "X$up" = X -o "X$low" = X; then
2900 case "`echo RS | od -x 2>/dev/null`" in
2902 echo "Hey, this might be EBCDIC." >&4
2903 if test "X$up" = X -o "X$low" = X; then
2904 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2905 rs) up='[A-IJ-RS-Z]'
2910 if test "X$up" = X -o "X$low" = X; then
2911 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2921 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2923 echo "Using $up and $low to convert case." >&4
2926 echo "I don't know how to translate letters from upper to lower case." >&4
2927 echo "Your tr is not acting any way I know of." >&4
2931 : set up the translation script tr, must be called with ./tr of course
2935 '[A-Z][a-z]') exec $tr '$up' '$low';;
2936 '[a-z][A-Z]') exec $tr '$low' '$up';;
2943 : Try to determine whether config.sh was made on this system
2944 case "$config_sh" in
2946 myuname=`$uname -a 2>/dev/null`
2947 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2948 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2949 # because the A-Z/a-z are not consecutive.
2950 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2951 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2952 newmyuname="$myuname"
2954 case "$knowitall" in
2956 if test -f ../config.sh; then
2957 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2958 eval "`grep myuname= ../config.sh`"
2960 if test "X$myuname" = "X$newmyuname"; then
2968 : Get old answers from old config file if Configure was run on the
2969 : same system, otherwise use the hints.
2972 if test -f config.sh; then
2974 rp="I see a config.sh file. Shall I use it to set the defaults?"
2977 n*|N*) echo "OK, I'll ignore it."
2978 mv config.sh config.sh.old
2979 myuname="$newmyuname"
2981 *) echo "Fetching default answers from your old config.sh file..." >&4
2989 : Older versions did not always set $sh. Catch re-use of such
2999 if test ! -f config.sh; then
3002 First time through, eh? I have some defaults handy for some systems
3003 that need some extra help getting the Configure answers right:
3006 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3008 : Half the following guesses are probably wrong... If you have better
3009 : tests or hints, please send them to perlbug@perl.org
3010 : The metaconfig authors would also appreciate a copy...
3011 $test -f /irix && osname=irix
3012 $test -f /xenix && osname=sco_xenix
3013 $test -f /dynix && osname=dynix
3014 $test -f /dnix && osname=dnix
3015 $test -f /lynx.os && osname=lynxos
3016 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3017 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3018 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3019 $test -f /bin/mips && /bin/mips && osname=mips
3020 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3021 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3022 $test -d /usr/apollo/bin && osname=apollo
3023 $test -f /etc/saf/_sactab && osname=svr4
3024 $test -d /usr/include/minix && osname=minix
3025 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3026 if $test -d /MachTen -o -d /MachTen_Folder; then
3028 if $test -x /sbin/version; then
3029 osvers=`/sbin/version | $awk '{print $2}' |
3030 $sed -e 's/[A-Za-z]$//'`
3031 elif $test -x /usr/etc/version; then
3032 osvers=`/usr/etc/version | $awk '{print $2}' |
3033 $sed -e 's/[A-Za-z]$//'`
3039 $test -f /sys/posix.dll &&
3040 $test -f /usr/bin/what &&
3041 set X `/usr/bin/what /sys/posix.dll` &&
3042 $test "$3" = UWIN &&
3046 if $test -f $uname; then
3054 umips) osname=umips ;;
3057 [23]100) osname=mips ;;
3058 next*) osname=next ;;
3060 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3061 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3064 elif $test -f /etc/kconfig; then
3066 if test "$lns" = "$ln -s"; then
3068 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3070 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3077 if test -n "$DJGPP"; then
3086 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3088 # oslevel can fail with:
3089 # oslevel: Unable to acquire lock.
3090 *not\ found) osvers="$4"."$3" ;;
3091 '<3240'|'<>3240') osvers=3.2.0 ;;
3092 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3093 '=3250'|'>3250') osvers=3.2.5 ;;
3097 bsd386) osname=bsd386
3100 cygwin*) osname=cygwin
3103 *dc.osx) osname=dcosx
3109 domainos) osname=apollo
3115 dynixptx*) osname=dynixptx
3116 osvers=`echo "$4"|sed 's/^v//'`
3118 freebsd) osname=freebsd
3120 genix) osname=genix ;;
3124 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3140 netbsd*) osname=netbsd
3143 news-os) osvers="$3"
3145 4*) osname=newsos4 ;;
3149 next*) osname=next ;;
3150 nonstop-ux) osname=nonstopux ;;
3151 openbsd) osname=openbsd
3157 POSIX-BC | posix-bc ) osname=posix-bc
3160 powerux | power_ux | powermax_os | powermaxos | \
3161 powerunix | power_unix) osname=powerux
3167 solaris) osname=solaris
3169 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3176 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3180 titanos) osname=titanos
3189 ultrix) osname=ultrix
3192 osf1|mls+) case "$5" in
3195 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3198 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3201 hp*) osname=hp_osf1 ;;
3202 mips) osname=mips_osf1 ;;
3205 # UnixWare 7.1.2 is known as Open UNIX 8
3206 openunix|unixware) osname=svr5
3214 $2) case "$osname" in
3218 : svr4.x or possibly later
3228 if test -f /stand/boot ; then
3229 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3230 if test -n "$INITPROG" -a -f "$INITPROG"; then
3231 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3232 if test -n "$isesix"; then
3240 *) if test -f /etc/systemid; then
3242 set `echo $3 | $sed 's/\./ /g'` $4
3243 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3245 elif $test -f $src/hints/sco_$1_$2.sh; then
3247 elif $test -f $src/hints/sco_$1.sh; then
3252 '') : Still unknown. Probably a generic Sys V.
3261 *) case "$osname" in
3262 '') : Still unknown. Probably a generic BSD.
3270 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3271 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3272 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3275 $rm -f UU/kernel.what
3276 elif test -d c:/. -o -n "$is_os2" ; then
3283 case "$targetarch" in
3286 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3291 : Now look for a hint file osname_osvers, unless one has been
3292 : specified already.
3295 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3296 : Also try without trailing minor version numbers.
3297 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3298 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3299 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3300 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3303 *) case "$osvers" in
3306 *) if $test -f $src/hints/$file.sh ; then
3308 elif $test -f $src/hints/$xfile.sh ; then
3310 elif $test -f $src/hints/$xxfile.sh ; then
3312 elif $test -f $src/hints/$xxxfile.sh ; then
3314 elif $test -f $src/hints/$xxxxfile.sh ; then
3316 elif $test -f "$src/hints/${osname}.sh" ; then
3325 if $test -f Policy.sh ; then
3328 none) dflt="Policy" ;;
3329 *) dflt="Policy $dflt" ;;
3334 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3338 if $test -f Policy.sh ; then
3341 There's also a Policy hint file available, which should make the
3342 site-specific (policy) questions easier to answer.
3349 You may give one or more space-separated answers, or "none" if appropriate.
3350 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3351 is a good thing. DO NOT give a wrong version or a wrong OS.
3355 rp="Which of these apply, if any?"
3358 for file in $tans; do
3359 if $test X$file = XPolicy -a -f Policy.sh; then
3361 $cat Policy.sh >> UU/config.sh
3362 elif $test -f $src/hints/$file.sh; then
3363 . $src/hints/$file.sh
3364 $cat $src/hints/$file.sh >> UU/config.sh
3365 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3368 : Give one chance to correct a possible typo.
3369 echo "$file.sh does not exist"
3371 rp="hint to use instead?"
3373 for file in $ans; do
3374 if $test -f "$src/hints/$file.sh"; then
3375 . $src/hints/$file.sh
3376 $cat $src/hints/$file.sh >> UU/config.sh
3377 elif $test X$ans = X -o X$ans = Xnone ; then
3380 echo "$file.sh does not exist -- ignored."
3387 : Remember our hint file for later.
3388 if $test -f "$src/hints/$file.sh" ; then
3398 echo "Fetching default answers from $config_sh..." >&4
3402 cp $config_sh config.sh 2>/dev/null
3412 test "$override" && . ./optdef.sh
3414 : Restore computed paths
3415 for file in $loclist $trylist; do
3416 eval $file="\$_$file"
3421 Configure uses the operating system name and version to set some defaults.
3422 The default value is probably right if the name rings a bell. Otherwise,
3423 since spelling matters for me, either accept the default or answer "none"
3430 ''|' '|none) dflt=none ;;
3431 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3434 *) dflt="$osname" ;;
3436 rp="Operating system name?"
3440 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3446 ''|' '|none) dflt=none ;;
3447 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3448 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3450 ''|' ') dflt=none ;;
3455 *) dflt="$osvers" ;;
3457 rp="Operating system version?"
3467 : who configured the system
3468 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3471 cf_by=`(logname) 2>/dev/null`
3474 cf_by=`(whoami) 2>/dev/null`
3476 "") cf_by=unknown ;;
3481 : set up the script used to warn in case of inconsistency
3488 echo "*** WHOA THERE!!! ***" >&4
3489 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3490 rp=" Keep the $hint value?"
3493 y) td=$was; tu=$was;;
3497 : function used to set $1 to $val
3498 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3500 $define$undef) . ./whoa; eval "$var=\$td";;
3501 $undef$define) . ./whoa; eval "$var=\$tu";;
3502 *) eval "$var=$val";;
3506 $define|true|[yY]*) dflt='y';;
3511 Perl can be built to use the SOCKS proxy protocol library. To do so,
3512 Configure must be run with -Dusesocks. If you use SOCKS you also need
3513 to use the PerlIO abstraction layer, this will be implicitly selected.
3515 If this doesn't make any sense to you, just accept the default '$dflt'.
3517 rp='Build Perl for SOCKS?'
3520 y|Y) val="$define" ;;
3527 $define|true|[yY]*) useperlio="$define";;
3530 case "$useperlio" in
3531 $define|true|[yY]*|'') dflt='y';;
3536 Previous version of $package used the standard IO mechanisms as
3537 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3538 alternate IO mechanisms via the PerlIO abstraction layer, but the
3539 stdio mechanism is still available if needed. The abstraction layer
3540 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3541 Using PerlIO with sfio may cause problems with some extension modules.
3543 If this doesn't make any sense to you, just accept the default '$dflt'.
3545 rp='Use the PerlIO abstraction layer?'
3552 echo "Ok, doing things the stdio way."
3561 case "$useperlio" in
3562 $define|true|[yY]*) ;;
3565 You are using the SOCKS proxy protocol library which means that you
3566 should also use the PerlIO layer. You may be headed for trouble.
3575 case "$usethreads" in
3576 $define|true|[yY]*) dflt='y';;
3577 *) # Catch case where user specified ithreads or 5005threads but
3578 # forgot -Dusethreads (A.D. 4/2002)
3579 case "$useithreads$use5005threads" in
3581 case "$useperlio" in
3582 "$define") dflt='y' ;;
3592 Perl can be built to take advantage of threads on some systems.
3593 To do so, Configure can be run with -Dusethreads.
3595 Note that Perl built with threading support runs slightly slower
3596 and uses more memory than plain Perl. The current implementation
3597 is believed to be stable, but it is fairly new, and so should be
3598 treated with caution.
3600 If this doesn't make any sense to you, just accept the default '$dflt'.
3602 rp='Build a threading Perl?'
3605 y|Y) val="$define" ;;
3611 case "$usethreads" in
3615 Since release 5.6, Perl has had two different threading implementations,
3616 the newer interpreter-based version (ithreads) with one interpreter per
3617 thread, and the older 5.005 version (5005threads).
3618 The 5005threads version is effectively unmaintained and will probably be
3619 removed in Perl 5.10, so there should be no need to build a Perl using it
3620 unless needed for backwards compatibility with some existing 5.005threads
3624 : Default to ithreads unless overridden on command line or with
3627 case "$use5005threads" in
3628 $define|true|[yY]*) dflt='n';;
3630 case "$useithreads" in
3631 $undef|false|[nN]*) dflt='n';;
3633 rp='Use the newer interpreter-based ithreads?'
3636 y|Y) val="$define" ;;
3641 : Now set use5005threads to the opposite value.
3642 case "$useithreads" in
3643 $define) val="$undef" ;;
3650 useithreads="$undef"
3651 use5005threads="$undef"
3655 case "$useithreads$use5005threads" in
3659 You cannot have both the ithreads and the 5.005 threads enabled
3660 at the same time. Disabling the 5.005 threads since they are
3661 much less stable than the ithreads.
3664 use5005threads="$undef"
3668 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3671 *** To build with ithreads you must also use the PerlIO layer.
3672 *** Cannot continue, aborting.
3678 case "$d_oldpthreads" in
3679 '') : Configure tests would be welcome here. For now, assume undef.
3681 *) val="$d_oldpthreads" ;;
3687 : Look for a hint-file generated 'call-back-unit'. If the
3688 : user has specified that a threading perl is to be built,
3689 : we may need to set or change some other defaults.
3690 if $test -f usethreads.cbu; then
3691 echo "Your platform has some specific hints regarding threaded builds, using them..."
3694 case "$usethreads" in
3695 "$define"|true|[yY]*)
3697 (Your platform does not have any specific hints for threaded builds.
3698 Assuming POSIX threads, then.)
3706 Perl can be built so that multiple Perl interpreters can coexist
3707 within the same Perl executable.
3710 case "$useithreads" in
3713 This multiple interpreter support is required for interpreter-based threads.
3717 *) case "$usemultiplicity" in
3718 $define|true|[yY]*) dflt='y';;
3722 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3723 rp='Build Perl for multiplicity?'
3726 y|Y) val="$define" ;;
3735 case "$usemorebits" in
3736 "$define"|true|[yY]*)
3737 use64bitint="$define"
3738 uselongdouble="$define"
3739 usemorebits="$define"
3741 *) usemorebits="$undef"
3745 : make some quick guesses about what we are up against
3747 $echo $n "Hmm... $c"
3757 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3758 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3760 echo "Looks kind of like an OSF/1 system, but we'll see..."
3762 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3763 xxx=`./loc addbib blurfl $pth`
3764 if $test -f $xxx; then
3765 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3769 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3770 echo "Looks kind of like an extended USG system, but we'll see..."
3772 echo "Looks kind of like a USG system, but we'll see..."
3776 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3777 echo "Looks kind of like a BSD system, but we'll see..."
3781 echo "Looks kind of like a Version 7 system, but we'll see..."
3784 case "$eunicefix" in
3787 There is, however, a strange, musty smell in the air that reminds me of
3788 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3792 : it so happens the Eunice I know will not run shell scripts in Unix format
3796 echo "Congratulations. You aren't running Eunice."
3800 : Detect OS2. The p_ variable is set above in the Head.U unit.
3801 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3802 : semicolon as a patch separator
3807 I have the feeling something is not exactly right, however...don't tell me...
3808 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3809 (Or you may be running DOS with DJGPP.)
3814 if test -f /xenix; then
3815 echo "Actually, this looks more like a XENIX system..."
3820 echo "It's not Xenix..."
3825 if test -f /venix; then
3826 echo "Actually, this looks more like a VENIX system..."
3833 echo "Nor is it Venix..."
3836 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3837 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3844 rp="Use which C compiler?"
3848 : See if they have not cc but they do have gcc
3850 : Look for a hint-file generated 'call-back-unit'. Now that the
3851 : user has specified the compiler, we may need to set or change some
3853 if $test -f cc.cbu; then
3859 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3865 printf("%s\n", __VERSION__);
3867 printf("%s\n", "1");
3873 if $cc -o try $ccflags $ldflags try.c; then
3874 gccversion=`$run ./try`
3875 case "$gccversion" in
3876 '') echo "You are not using GNU cc." ;;
3877 *) echo "You are using GNU cc $gccversion."
3883 echo "*** WHOA THERE!!! ***" >&4
3884 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3885 case "$knowitall" in
3887 echo " You'd better start hunting for one and let me know about it." >&4
3893 case "$gccversion" in
3894 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3896 case "$gccversion" in
3897 '') gccosandvers='' ;;
3898 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3899 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3901 case "$gccosandvers" in
3902 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3903 $osname$osvers) ;; # looking good
3904 $osname*) cat <<EOM >&4
3906 *** WHOA THERE!!! ***
3908 Your gcc has not been compiled for the exact release of
3909 your operating system ($gccosandvers versus $osname$osvers).
3911 In general it is a good idea to keep gcc synchronized with
3912 the operating system because otherwise serious problems
3913 may ensue when trying to compile software, like Perl.
3915 I'm trying to be optimistic here, though, and will continue.
3916 If later during the configuration and build icky compilation
3917 problems appear (headerfile conflicts being the most common
3918 manifestation), I suggest reinstalling the gcc to match
3919 your operating system release.
3923 *) gccosandvers='' ;; # failed to parse, better be silent
3931 # gcc 3.* complain about adding -Idirectories that they already know about,
3932 # so we will take those off from locincpth.
3933 case "$gccversion" in
3935 echo "main(){}">try.c
3936 for incdir in $locincpth; do
3937 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3938 grep '^c[cp]p*[01]: warning: changing search order '`
3939 if test "X$warn" != X; then
3940 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3946 : decide how portable to be. Allow command line overrides.
3947 case "$d_portable" in
3949 *) d_portable="$define" ;;
3952 : set up shell script to do ~ expansion
3958 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3961 if $test -f /bin/csh; then
3962 /bin/csh -f -c "glob \$1"
3967 name=\`$expr x\$1 : '..\([^/]*\)'\`
3968 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3969 if $test ! -d "\$dir"; then
3971 echo "\$me: can't locate home directory for: \$name" >&2
3976 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3992 : now set up to get a file name
3996 cat <<'EOSC' >>getfile
4012 : getfile will accept an answer from the comma-separated list
4013 : enclosed in parentheses even if it does not meet other criteria.
4014 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4015 fn=`echo $fn | sed 's/(.*)//'`
4021 loc_file=`expr $fn : '.*:\(.*\)'`
4022 fn=`expr $fn : '\(.*\):.*'`
4030 */*) fullpath=true;;
4039 *e*) exp_file=true;;
4042 *p*) nopath_ok=true;;
4047 *d*) type='Directory';;
4048 *l*) type='Locate';;
4053 Locate) what='File';;
4058 case "$d_portable" in
4066 while test "$type"; do
4071 true) rp="$rp (~name ok)";;
4074 if test -f UU/getfile.ok && \
4075 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4094 value=`UU/filexp $ans`
4097 if test "$ans" != "$value"; then
4098 echo "(That expands to $value on this system.)"
4112 /*) value="$ansexp" ;;
4113 [a-zA-Z]:/*) value="$ansexp" ;;
4118 echo "I shall only accept a full path name, as in /bin/ls." >&4
4119 echo "Use a ! shell escape if you wish to check pathnames." >&4
4122 echo "Please give a full path name, starting with slash." >&4
4125 echo "Note that using ~name is ok provided it expands well." >&4
4138 for fp in $gfpth; do
4139 if test "X$fp" = X.; then
4144 if test -f "$pf"; then
4146 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4148 echo "($value is not a plain file, but that's ok.)"
4151 if test X"$type" = X; then
4158 for fp in $gfpth; do
4159 if test "X$fp" = X.; then
4164 direxp="$fp/$ansexp"
4166 if test -d "$direxp"; then
4174 if test -d "$ansexp"; then
4175 echo "(Looking for $loc_file in directory $value.)"
4176 value="$value/$loc_file"
4177 ansexp="$ansexp/$loc_file"
4179 if test -f "$ansexp"; then
4182 case "$nopath_ok" in
4183 true) case "$value" in
4185 *) echo "Assuming $value will be in people's path."
4201 if test "$fastread" = yes; then
4206 rp="$what $value doesn't exist. Use that name anyway?"
4225 test "X$gfpthkeep" != Xy && gfpth=""
4228 : What should the include directory be ?
4230 $echo $n "Hmm... $c"
4234 if $test -f /bin/mips && /bin/mips; then
4235 echo "Looks like a MIPS system..."
4236 $cat >usr.c <<'EOCP'
4237 #ifdef SYSTYPE_BSD43
4241 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4242 dflt='/bsd43/usr/include'
4246 mips_type='System V'
4248 $rm -f usr.c usr.out
4249 echo "and you're compiling with the $mips_type compiler and libraries."
4253 echo "Doesn't look like a MIPS system."
4263 case "$xxx_prompt" in
4266 rp='Where are the include files you want to use?'
4274 : see how we invoke the C preprocessor
4276 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4277 cat <<'EOT' >testcpp.c
4283 if test ! -f cppstdin; then
4284 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4285 # AIX cc -E doesn't show the absolute headerfile
4286 # locations but we'll cheat by using the -M flag.
4287 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
4289 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4292 echo "Keeping your $hint cppstdin wrapper."
4295 wrapper=`pwd`/cppstdin
4299 if $test "X$cppstdin" != "X" && \
4300 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4301 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4303 echo "You used to use $cppstdin $cppminus so we'll use that again."
4305 '') echo "But let's see if we can live without a wrapper..." ;;
4307 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4308 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4310 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4313 echo "(However, $cpprun $cpplast does not work, let's see...)"
4321 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4328 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4329 $cc -E <testcpp.c >testcpp.out 2>&1; \
4330 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4331 echo "Yup, it does."
4334 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4335 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4336 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4337 echo "Yup, it does."
4340 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4341 $cc -P <testcpp.c >testcpp.out 2>&1; \
4342 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4343 echo "Yipee, that works!"
4346 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4347 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4348 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4349 echo "At long last!"
4352 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4353 $cpp <testcpp.c >testcpp.out 2>&1; \
4354 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4358 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4359 $cpp - <testcpp.c >testcpp.out 2>&1; \
4360 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4361 echo "Hooray, it works! I was beginning to wonder."
4364 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4365 $wrapper <testcpp.c >testcpp.out 2>&1; \
4366 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4372 rp="No dice. I can't find a C preprocessor. Name one:"
4376 $x_cpp <testcpp.c >testcpp.out 2>&1
4377 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4378 echo "OK, that will do." >&4
4380 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4395 echo "Perhaps can we force $cc -E using a wrapper..."
4396 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4397 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4403 echo "Nope, we'll have to live without it..."
4417 "$wrapper"|'cppstdin') ;;
4418 *) $rm -f $wrapper;;
4420 $rm -f testcpp.c testcpp.out
4422 : Set private lib path
4425 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4430 '') dlist="$loclibpth $plibpth $glibpth";;
4431 *) dlist="$libpth";;
4434 : Now check and see which directories actually exist, avoiding duplicates
4438 if $test -d $xxx; then
4441 *) libpth="$libpth $xxx";;
4447 Some systems have incompatible or broken versions of libraries. Among
4448 the directories listed in the question below, please remove any you
4449 know not to be holding relevant libraries, and add any that are needed.
4450 Say "none" for none.
4461 rp="Directories to use for library searches?"
4468 : compute shared library extension
4471 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4481 On some systems, shared libraries may be available. Answer 'none' if
4482 you want to suppress searching of shared libraries for the remainder
4483 of this configuration.
4486 rp='What is the file extension used for shared libraries?'
4490 : Define several unixisms.
4491 : Hints files or command line option can be used to override them.
4492 : The convoluted testing is in case hints files set either the old
4495 '') case "$exe_ext" in
4497 *) _exe="$exe_ext" ;;
4502 '') case "$lib_ext" in
4509 '') case "$obj_ext" in
4516 '') case "$path_sep" in
4527 : Which makefile gets called first. This is used by make depend.
4528 case "$firstmakefile" in
4529 '') firstmakefile='makefile';;
4533 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4536 case "$uselongdouble" in
4537 $define|true|[yY]*) dflt='y';;
4542 Perl can be built to take advantage of long doubles which
4543 (if available) may give more accuracy and range for floating point numbers.
4545 If this doesn't make any sense to you, just accept the default '$dflt'.
4547 rp='Try to use long doubles if available?'
4550 y|Y) val="$define" ;;
4556 case "$uselongdouble" in
4557 true|[yY]*) uselongdouble="$define" ;;
4560 : Look for a hint-file generated 'call-back-unit'. If the
4561 : user has specified that long doubles should be used,
4562 : we may need to set or change some other defaults.
4563 if $test -f uselongdouble.cbu; then
4564 echo "Your platform has some specific hints regarding long doubles, using them..."
4565 . ./uselongdouble.cbu
4567 case "$uselongdouble" in
4570 (Your platform does not have any specific hints for long doubles.)
4576 : Looking for optional libraries
4578 echo "Checking for optional libraries..." >&4
4583 case "$libswanted" in
4584 '') libswanted='c_s';;
4587 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4593 for thisdir in $libpth $xlibpth; do
4594 test -d $thisdir && libspath="$libspath $thisdir"
4596 for thislib in $libswanted; do
4597 for thisdir in $libspath; do
4599 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4600 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4601 $test -f "$xxx" && eval $libscheck
4602 $test -f "$xxx" && libstyle=shared
4604 if test ! -f "$xxx"; then
4605 xxx=$thisdir/lib$thislib.$so
4606 $test -f "$xxx" && eval $libscheck
4607 $test -f "$xxx" && libstyle=shared
4609 if test ! -f "$xxx"; then
4610 xxx=$thisdir/lib$thislib$_a
4611 $test -f "$xxx" && eval $libscheck
4612 $test -f "$xxx" && libstyle=static
4614 if test ! -f "$xxx"; then
4615 xxx=$thisdir/$thislib$_a
4616 $test -f "$xxx" && eval $libscheck
4617 $test -f "$xxx" && libstyle=static
4619 if test ! -f "$xxx"; then
4620 xxx=$thisdir/lib${thislib}_s$_a
4621 $test -f "$xxx" && eval $libscheck
4622 $test -f "$xxx" && libstyle=static
4623 $test -f "$xxx" && thislib=${thislib}_s
4625 if test ! -f "$xxx"; then
4626 xxx=$thisdir/Slib$thislib$_a
4627 $test -f "$xxx" && eval $libscheck
4628 $test -f "$xxx" && libstyle=static
4630 if $test -f "$xxx"; then
4632 shared) echo "Found -l$thislib (shared)." ;;
4633 static) echo "Found -l$thislib." ;;
4634 *) echo "Found -l$thislib ($libstyle)." ;;
4638 *) dflt="$dflt -l$thislib"
4639 libsfound="$libsfound $xxx"
4641 libsfiles="$libsfiles $yyy"
4642 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4643 case " $libsdirs " in
4645 *) libsdirs="$libsdirs $yyy" ;;
4652 if $test ! -f "$xxx"; then
4653 echo "No -l$thislib."
4664 ' '|'') dflt='none';;
4669 In order to compile $package on your machine, a number of libraries
4670 are usually needed. Include any other special libraries here as well.
4671 Say "none" for none. The default list is almost always right.
4675 rp="What libraries to use?"
4682 : determine optimization, if desired, or use for debug flag also
4684 ' '|$undef) dflt='none';;
4686 *) dflt="$optimize";;
4690 By default, $package compiles with the -O flag to use the optimizer.
4691 Alternately, you might want to use the symbolic debugger, which uses
4692 the -g flag (on traditional Unix systems). Either flag can be
4693 specified here. To use neither flag, specify the word "none".
4696 rp="What optimizer/debugger flag should be used?"
4700 'none') optimize=" ";;
4704 : We will not override a previous value, but we might want to
4705 : augment a hint file
4707 default|recommended)
4708 case "$gccversion" in
4709 1*) dflt='-fpcc-struct-return' ;;
4712 *-g*) dflt="$dflt -DDEBUGGING";;
4714 case "$gccversion" in
4715 2*) if test -d /etc/conf/kconfig.d &&
4716 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4718 # Interactive Systems (ISC) POSIX mode.
4723 case "$gccversion" in
4727 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4728 echo 'int main(void) { return 0; }' > gcctest.c
4729 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4730 echo "Yes, it does." 2>&1
4733 echo "Leaving current flags $ccflags alone." 2>&1
4735 *) dflt="$dflt -fno-strict-aliasing" ;;
4738 echo "Nope, it doesn't, but that's ok." 2>&1
4742 # For gcc, adding -pipe speeds up compilations for some, but apparently
4743 # some assemblers can't read from stdin. (It also slows down compilations
4744 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4745 case "$gccversion" in
4747 echo "Checking if your compiler accepts -pipe" 2>&1
4748 echo 'int main(void) { return 0; }' > gcctest.c
4749 if $cc -pipe -o gcctest gcctest.c; then
4750 echo "Yes, it does." 2>&1
4753 echo "Leaving current flags $ccflags alone." 2>&1
4755 *) dflt="$dflt -pipe" ;;
4758 echo "Nope, it doesn't, but that's ok." 2>&1
4761 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4762 echo 'int main(void) { return 0; }' > gcctest.c
4763 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4764 echo "Yes, it does." 2>&1
4766 *-Wdeclaration-after-statement*)
4767 echo "Leaving current flags $ccflags alone." 2>&1
4769 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4772 echo "Nope, it doesn't, but that's ok." 2>&1
4779 case "$mips_type" in
4780 *BSD*|'') inclwanted="$locincpth $usrinc";;
4781 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4783 for thisincl in $inclwanted; do
4784 if $test -d $thisincl; then
4785 if $test x$thisincl != x$usrinc; then
4787 *" -I$thisincl "*);;
4788 *) dflt="$dflt -I$thisincl ";;
4794 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4796 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then