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 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Tue Oct 18 16:11:43 CEST 2005 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
348 d_attribute_format=''
349 d_attribute_malloc=''
350 d_attribute_nonnull=''
351 d_attribute_noreturn=''
353 d_attribute_unused=''
354 d_attribute_warn_unused_result=''
401 endhostent_r_proto=''
407 endprotoent_r_proto=''
413 endservent_r_proto=''
464 gethostbyaddr_r_proto=''
466 gethostbyname_r_proto=''
468 gethostent_r_proto=''
480 getnetbyaddr_r_proto=''
482 getnetbyname_r_proto=''
496 d_getprotobyname_r=''
497 getprotobyname_r_proto=''
498 d_getprotobynumber_r=''
499 getprotobynumber_r_proto=''
501 getprotoent_r_proto=''
513 getservbyname_r_proto=''
515 getservbyport_r_proto=''
517 getservent_r_proto=''
541 d_libm_lib_version=''
554 d_malloc_good_size=''
596 d_old_pthread_create_joinable=''
597 old_pthread_create_joinable=''
599 d_pthread_attr_setscope=''
638 sethostent_r_proto=''
655 setprotoent_r_proto=''
667 setservent_r_proto=''
712 d_stdio_ptr_lval_nochange_cnt=''
713 d_stdio_ptr_lval_sets_cnt=''
917 inc_version_list_init=''
936 ignore_versioned_solibs=''
996 d_perl_otherlibdirs=''
1004 api_versionstring=''
1010 version_patchlevel_string=''
1014 d_nv_preserves_uv=''
1015 d_nv_zero_is_allbits_zero=''
1026 nv_preserves_uv_bits=''
1097 installsitehtml1dir=''
1100 installsitehtml3dir=''
1107 installsiteman1dir=''
1110 installsiteman3dir=''
1115 installsitescript=''
1130 d_stdio_stream_array=''
1131 stdio_stream_array=''
1142 ccflags_uselargefiles=''
1143 ldflags_uselargefiles=''
1144 libswanted_uselargefiles=''
1154 userelocatableinc=''
1165 installvendorarch=''
1172 installvendorhtml1dir=''
1174 vendorhtml1direxp=''
1175 installvendorhtml3dir=''
1177 vendorhtml3direxp=''
1183 installvendorman1dir=''
1186 installvendorman3dir=''
1193 installvendorscript=''
1205 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1208 : We must find out about Eunice early
1210 if test -f /etc/unixtovms; then
1211 eunicefix=/etc/unixtovms
1213 if test -f /etc/unixtovms.exe; then
1214 eunicefix=/etc/unixtovms.exe
1217 : Set executable suffix now -- needed before hints available
1218 if test -f "/libs/version.library"; then
1221 elif test -f "/system/gnu_library/bin/ar.pm"; then
1224 elif test -n "$DJGPP"; then
1227 elif test -d c:/. -o -n "$is_os2" ; then
1236 : set useposix=false in your hint file to disable the POSIX extension.
1238 : set useopcode=false in your hint file to disable the Opcode extension.
1240 : Trailing extension. Override this in a hint file, if needed.
1241 : Extra object files, if any, needed on this platform.
1244 : Possible local include directories to search.
1245 : Set locincpth to "" in a hint file to defeat local include searches.
1246 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1247 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1249 : no include file wanted by default
1254 : change the next line if compiling for Xenix/286 on Xenix/386
1255 xlibpth='/usr/lib/386 /lib/386'
1256 : Possible local library directories to search.
1257 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1258 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1260 : general looking path for locating libraries
1261 glibpth="/lib /usr/lib $xlibpth"
1262 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1263 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1264 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1266 : Private path used by Configure to find libraries. Its value
1267 : is prepended to libpth. This variable takes care of special
1268 : machines, like the mips. Usually, it should be empty.
1271 : default library list
1273 : some systems want to use only the non-versioned libso:s
1274 ignore_versioned_solibs=''
1279 ccflags_uselargefiles=''
1280 ldflags_uselargefiles=''
1281 libswanted_uselargefiles=''
1282 : set usemultiplicity on the Configure command line to enable multiplicity.
1283 : set usesocks on the Configure command line to enable socks.
1284 : set usethreads on the Configure command line to enable threads.
1285 usereentrant='undef'
1286 : full support for void wanted by default
1289 : List of libraries we want.
1290 : If anyone needs extra -lxxx, put those in a hint file.
1291 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1292 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1293 : We probably want to search /usr/shlib before most other libraries.
1294 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1295 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1296 glibpth="/usr/shlib $glibpth"
1297 : Do not use vfork unless overridden by a hint file.
1300 : Find the basic shell for Bourne shell scripts
1304 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1307 if test -f "$xxx"; then
1310 : Build up a list and do a single loop so we can 'break' out.
1311 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1312 for xxx in sh bash ksh pdksh ash; do
1314 try="$try ${p}/${xxx}"
1318 if test -f "$xxx"; then
1321 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1324 elif test -f "$xxx.exe"; then
1335 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1337 Usually it's in /bin/sh. How did you even get this far?
1338 Please contact me (Perl Maintainers) at perlbug@perl.org and
1339 we'll try to straighten this all out.
1345 : see if sh knows # comments
1346 if `$sh -c '#' >/dev/null 2>&1`; then
1350 test -f $xcat$_exe || xcat=/usr/bin/cat
1351 if test ! -f $xcat$_exe; then
1352 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1353 if test -f $p/cat$_exe; then
1358 if test ! -f $xcat$_exe; then
1359 echo "Can't find cat anywhere!"
1363 echo "#!$xcat" >sharp
1367 if test -s today; then
1370 echo "#! $xcat" > sharp
1374 if test -s today; then
1382 echo "Your $sh doesn't grok # comments--I will strip them later on."
1385 echo "exec grep -v '^[ ]*#'" >spitshell
1387 $eunicefix spitshell
1388 spitshell=`pwd`/spitshell
1390 echo "I presume that if # doesn't work, #! won't work either!"
1395 : figure out how to guarantee sh startup
1397 '') startsh=${sharpbang}${sh} ;;
1409 : echo "Yup, it does."
1411 echo "Hmm... '$startsh' does not guarantee sh startup..."
1412 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1417 : Save command line options in file UU/cmdline.opt for later use in
1418 : generating config.sh.
1419 cat > cmdline.opt <<EOSH
1420 # Configure command line arguments.
1429 cat >>cmdline.opt <<EOSH
1430 config_arg$argn='$arg'
1432 # Extreme backslashitis: replace each ' by '"'"'
1433 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1436 arg_exp=`cat cmdl.opt`
1437 args_exp="$args_exp$args_sep'$arg_exp'"
1438 argn=`expr $argn + 1`
1441 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1442 # used by ./hints/os2.sh
1445 : produce awk script to parse command line options
1446 cat >options.awk <<'EOF'
1448 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1450 len = length(optstr);
1451 for (i = 1; i <= len; i++) {
1452 c = substr(optstr, i, 1);
1453 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1464 if (substr(str, 1, 1) != "-") {
1465 printf("'%s'\n", str);
1469 for (i = 2; i <= len; i++) {
1470 c = substr(str, i, 1);
1472 printf("-%s\n", substr(str, i));
1478 printf("'%s'\n", substr(str, i + 1));
1491 : process the command line options
1492 set X `for arg in "$@"; do echo "X$arg"; done |
1493 sed -e s/X// | awk -f options.awk`
1498 : set up default values
1508 rm -f optdef.sh posthint.sh
1509 cat >optdef.sh <<EOS
1515 while test $# -gt 0; do
1517 -d) shift; fastread=yes;;
1518 -e) shift; alldone=cont;;
1522 if test -r "$1"; then
1525 echo "$me: cannot read config file $1." >&2
1530 -h) shift; error=true;;
1531 -r) shift; reuseval=true;;
1532 -s) shift; silent=true; realsilent=true;;
1533 -E) shift; alldone=exit;;
1534 -K) shift; knowitall=true;;
1535 -O) shift; override=true;;
1536 -S) shift; silent=true; extractsh=true;;
1541 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1542 echo "$me: ignoring -D $1" >&2
1545 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1546 *) echo "$1='define'" >> optdef.sh;;
1553 *=) echo "$1" >> optdef.sh;;
1555 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1556 echo "$me: ignoring -U $1" >&2
1558 *) echo "$1='undef'" >> optdef.sh;;
1569 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1573 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1574 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1580 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1581 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1582 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1583 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1584 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1585 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1591 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1593 echo "$yyy=''" >> posthint.sh ;;
1598 echo "$yyy='$zzz'" >> posthint.sh ;;
1600 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1602 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1607 echo "$yyy=$zzz" >> posthint.sh ;;
1608 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1612 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1615 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1623 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1624 [-U symbol] [-U symbol=] [-A command:symbol...]
1625 -d : use defaults for all answers.
1626 -e : go on without questioning past the production of config.sh.
1627 -f : specify an alternate default configuration file.
1628 -h : print this help message and exit (with an error status).
1629 -r : reuse C symbols value if possible (skips costly nm extraction).
1630 -s : silent mode, only echoes questions and essential information.
1631 -D : define symbol to have some value:
1632 -D symbol symbol gets the value 'define'
1633 -D symbol=value symbol gets the value 'value'
1634 -E : stop at the end of questions, after having produced config.sh.
1635 -K : do not use unless you know what you are doing.
1636 -O : let -D and -U override definitions from loaded configuration file.
1637 -S : perform variable substitutions on all .SH files (can mix with -f)
1638 -U : undefine symbol:
1639 -U symbol symbol gets the value 'undef'
1640 -U symbol= symbol gets completely empty
1641 -A : manipulate symbol after the platform specific hints have been applied:
1642 -A symbol=value append " "value to symbol
1643 -A append:symbol=value append value to symbol
1644 -A define:symbol=value define symbol to have value
1645 -A clear:symbol define symbol to be ''
1646 -A define:symbol define symbol to be 'define'
1647 -A eval:symbol=value define symbol to be eval of value
1648 -A prepend:symbol=value prepend value to symbol
1649 -A undef:symbol define symbol to be 'undef'
1650 -A undef:symbol= define symbol to be ''
1651 -V : print version number and exit (with a zero status).
1658 case "$fastread$alldone" in
1661 case "$extractsh" in
1664 if test ! -t 0; then
1665 echo "Say 'sh Configure', not 'sh <Configure'"
1675 true) exec 1>/dev/null;;
1678 : run the defines and the undefines, if any, but leave the file out there...
1681 : create the posthint manipulation script and leave the file out there...
1686 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1687 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1688 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1689 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1690 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1693 : Some greps do not return status, grrr.
1694 echo "grimblepritz" >grimble
1695 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1697 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1703 : the following should work in any shell
1707 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1708 cat >contains <<'EOSS'
1709 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1714 : Find the path to the source tree
1717 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1721 *) src=`cd ../$src && pwd` ;;
1734 if test -f $rsrc/Configure && \
1735 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1737 : found it, so we are ok.
1740 for src in . .. ../.. ../../.. ../../../..; do
1741 if test -f ../$src/Configure && \
1742 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1753 Sorry, I can't seem to locate the source dir for $package. Please start
1754 Configure with an explicit path -- i.e. /some/path/Configure.
1762 echo "Sources for $package found in \"$src\"." >&4
1766 : script used to extract .SH files with variable substitutions
1767 cat >extract <<'EOS'
1769 echo "Doing variable substitutions on .SH files..."
1770 if test -f MANIFEST; then
1771 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1773 echo "(Looking for .SH files under the source directory.)"
1774 set x `(cd "$src"; find . -name "*.SH" -print)`
1778 0) set x `(cd "$src"; echo *.SH)`; shift;;
1780 if test ! -f "$src/$1"; then
1786 while test $name; do
1787 if test ! -d "$name"; then
1788 create="$name $create";
1789 name=`echo $name | sed -e "s|^[^/]*$||"`;
1790 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1795 for file in $create; do
1804 dir=`expr X$file : 'X\(.*\)/'`
1805 file=`expr X$file : 'X.*/\(.*\)'`
1806 (cd "$dir" && . ./$file)
1816 dir=`expr X$file : 'X\(.*\)/'`
1817 file=`expr X$file : 'X.*/\(.*\)'`
1818 (set x $dir; shift; eval $mkdir_p)
1819 sh <"$src/$dir/$file"
1828 if test -f "$src/config_h.SH"; then
1829 if test ! -f config.h; then
1830 : oops, they left it out of MANIFEST, probably, so do it anyway.
1831 . "$src/config_h.SH"
1836 : extract files and exit if asked to do so
1837 case "$extractsh" in
1839 case "$realsilent" in
1843 case "$config_sh" in
1844 '') config_sh='config.sh';;
1847 echo "Fetching answers from $config_sh..."
1850 test "$override" && . ./optdef.sh
1854 echo "Extraction done."
1859 : Eunice requires " " instead of "", can you believe it
1862 echo "Beginning of configuration questions for $package."
1864 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1866 : first determine how to suppress newline on echo command
1868 echo "Checking echo to see how to suppress newlines..."
1869 (echo "hi there\c" ; echo " ") >.echotmp
1870 if $contains c .echotmp >/dev/null 2>&1 ; then
1881 echo $n "The star should be here-->$c"
1885 : Now test for existence of everything in MANIFEST
1887 if test -f "$rsrc/MANIFEST"; then
1888 echo "First let's make sure your kit is complete. Checking..." >&4
1889 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1892 for filelist in x??; do
1893 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1895 if test -s missing; then
1899 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1901 You have the option of continuing the configuration process, despite the
1902 distinct possibility that your kit is damaged, by typing 'y'es. If you
1903 do, don't blame me if something goes wrong. I advise you to type 'n'o
1904 and contact the author (perlbug@perl.org).
1907 echo $n "Continue? [n] $c" >&4
1911 echo "Continuing..." >&4
1915 echo "ABORTING..." >&4
1920 echo "Looks good..."
1923 echo "There is no MANIFEST file. I hope your kit is complete !"
1928 : Find the appropriate value for a newline for tr
1929 if test -n "$DJGPP"; then
1932 if test X"$trnl" = X; then
1933 case "`echo foo|tr '\n' x 2>/dev/null`" in
1937 if test X"$trnl" = X; then
1938 case "`echo foo|tr '\012' x 2>/dev/null`" in
1939 foox) trnl='\012' ;;
1942 if test X"$trnl" = X; then
1943 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1944 fooxy) trnl='\n\r' ;;
1947 if test X"$trnl" = X; then
1950 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1956 : compute the number of columns on the terminal for proper question formatting
1961 : set up the echo used in my read
1962 myecho="case \"\$xxxm\" in
1963 '') echo $n \"\$rp $c\" >&4;;
1965 '') echo $n \"[\$xxxm] $c\";;
1967 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1969 echo $n \"[\$xxxm] $c\" >&4
1971 echo $n \"\$rp [\$xxxm] $c\" >&4
1977 : now set up to do reads with possible shell escape and default assignment
1983 case "\$fastread" in
1984 yes) case "\$dflt" in
1987 case "\$silent-\$rp" in
1992 *) case "\$silent" in
1993 true) case "\$rp" in
1998 while expr "X\$ans" : "X!" >/dev/null; do
2002 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2010 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2019 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2024 echo "(OK, I'll run with -d after this question.)" >&4
2027 echo "*** Sorry, \$1 not supported yet." >&4
2037 echo "*** Substitution done -- please confirm."
2039 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2044 echo "*** Error -- try again."
2051 case "\$ans\$xxxm\$nostick" in
2063 : create .config dir to save info across Configure sessions
2064 test -d ../.config || mkdir ../.config
2065 cat >../.config/README <<EOF
2066 This directory created by Configure to save information that should
2067 persist across sessions for $package.
2069 You may safely delete it if you wish.
2072 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2074 $define|true|[yY]*) ;;
2075 *) case "$xversion" in
2078 *** WHOA THERE!!! ***
2080 This is an UNSTABLE DEVELOPMENT release.
2081 The version of this $package distribution is $xversion, that is, odd,
2082 (as opposed to even) and that signifies a development release.
2083 If you want a maintenance release, you want an even-numbered version.
2085 Do ***NOT*** install this into production use.
2086 Data corruption and crashes are possible.
2088 It is most seriously suggested that you do not continue any further
2089 unless you want to help in developing and debugging Perl.
2091 If you *still* want to build perl, you can answer 'y' now,
2092 or pass -Dusedevel to Configure.
2095 rp='Do you really want to continue?'
2099 [yY]) echo >&4 "Okay, continuing."
2100 usedevel="$define" ;;
2101 *) echo >&4 "Okay, bye."
2111 case "$versiononly" in
2112 '') versiononly="$define" ;;
2114 case "$installusrbinperl" in
2115 '') installusrbinperl="$undef" ;;
2120 : general instructions
2123 user=`(logname) 2>/dev/null`
2125 '') user=`whoami 2>&1`;;
2127 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2130 rp='Would you like to see the instructions?'
2141 This installation shell script will examine your system and ask you questions
2142 to determine how the perl5 package should be installed. If you get
2143 stuck on a question, you may use a ! shell escape to start a subshell or
2144 execute a command. Many of the questions will have default answers in square
2145 brackets; typing carriage return will give you the default.
2147 On some of the questions which ask for file or directory names you are allowed
2148 to use the ~name construct to specify the login directory belonging to "name",
2149 even if you don't have a shell which knows about that. Questions where this is
2150 allowed will be marked "(~name ok)".
2154 dflt='Type carriage return to continue'
2158 The prompter used in this script allows you to use shell variables and
2159 backticks in your answers. You may use $1, $2, etc... to refer to the words
2160 in the default answer, as if the default line was a set of arguments given to a
2161 script shell. This means you may also use $* to repeat the whole default line,
2162 so you do not have to re-type everything to add something to the default.
2164 Everytime there is a substitution, you will have to confirm. If there is an
2165 error (e.g. an unmatched backtick), the default answer will remain unchanged
2166 and you will be prompted again.
2168 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2169 the questions and use the computed defaults (or the previous answers if there
2170 was already a config.sh file). Type 'Configure -h' for a list of options.
2171 You may also start interactively and then answer '& -d' at any prompt to turn
2172 on the non-interactive behaviour for the remainder of the execution.
2178 Much effort has been expended to ensure that this shell script will run on any
2179 Unix system. If despite that it blows up on yours, your best bet is to edit
2180 Configure and run it again. If you can't run Configure for some reason,
2181 you'll have to generate a config.sh file by hand. Whatever problems you
2182 have, let me (perlbug@perl.org) know how I blew it.
2184 This installation script affects things in two ways:
2186 1) it may do direct variable substitutions on some of the files included
2188 2) it builds a config.h file for inclusion in C programs. You may edit
2189 any of these files as the need arises after running this script.
2191 If you make a mistake on a question, there is no easy way to back up to it
2192 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2193 files. Configure will offer to let you do this before it runs the SH files.
2196 dflt='Type carriage return to continue'
2198 case "$firsttime" in
2199 true) echo $user >>../.config/instruct;;
2203 : find out where common programs are
2205 echo "Locating common programs..." >&4
2218 if test -d \$dir/\$thing; then
2224 for thisthing in \$dir/\$thing; do
2225 : just loop through to pick last item
2227 if test -f \$thisthing; then
2230 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2233 elif test -f \$dir/\$thing.exe; then
2234 if test -n "$DJGPP"; then
2235 echo \$dir/\$thing.exe
2236 elif test "$eunicefix" != ":"; then
2237 : on Eunice apparently
2291 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2292 pth="$pth /lib /usr/lib"
2293 for file in $loclist; do
2297 if test -f "$xxx"; then
2300 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2301 xxx=`./loc $file $file $pth`
2304 '') xxx=`./loc $file $file $pth`;;
2305 *) xxx=`./loc $xxx $xxx $pth`;;
2307 eval $file=$xxx$_exe
2311 echo $file is in $xxx.
2314 echo $file is in $xxx.
2317 echo "I don't know where '$file' is, and my life depends on it." >&4
2318 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2324 echo "Don't worry if any of the following aren't found..."
2326 for file in $trylist; do
2330 if test -f "$xxx"; then
2333 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2334 xxx=`./loc $file $file $pth`
2337 '') xxx=`./loc $file $file $pth`;;
2338 *) xxx=`./loc $xxx $xxx $pth`;;
2340 eval $file=$xxx$_exe
2344 echo $file is in $xxx.
2347 echo $file is in $xxx.
2350 echo "I don't see $file out there, $say."
2357 echo "Substituting grep for egrep."
2364 echo "Substituting cp for ln."
2373 echo "I can't find make or gmake, and my life depends on it." >&4
2374 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2382 *) # We can't have osname yet.
2383 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2384 # Assume that gmake, if found, is definitely GNU make
2385 # and prefer it over the system make.
2386 echo "Substituting gmake for make."
2394 echo "Hopefully test is built into your sh."
2397 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2398 echo "Using the test built into your sh."
2406 echo "Hopefully echo is built into your sh."
2411 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2412 $echo $n "hi there$c" >foo1
2413 echo $n "hi there$c" >foo2
2414 if cmp foo1 foo2 >/dev/null 2>&1; then
2415 echo "They are compatible. In fact, they may be identical."
2422 They are not compatible! You are probably running ksh on a non-USG system.
2423 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2424 have echo built in and we may have to run some Bourne shell scripts. That
2425 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2428 $echo $n "The star should be here-->$c"
2438 cat <<'EOSC' >>trygcc
2443 int main(int argc, char *argv[]) {
2447 if $cc -o try $ccflags $ldflags try.c; then
2450 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2456 case "`$cc -v -c try.c 2>&1`" in
2459 if $test X"$trygcc" = Xyes; then
2460 if gcc -o try -c try.c; then
2462 echo "You seem to have a working gcc, though." >&4
2463 rp="Would you like to use it?"
2465 if $test -f myread; then
2468 if $test -f UU/myread; then
2471 echo "Cannot find myread, sorry. Aborting." >&2
2476 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2477 if $test -f usethreads.cbu; then
2480 *** However, any setting of the C compiler flags (e.g. for thread support)
2481 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2482 *** (together with e.g. -Dusethreads).
2498 cat <<'EOSC' >>checkcc
2503 int main(int argc, char *argv[]) {
2507 if $cc -o try $ccflags $ldflags try.c; then
2510 if $test X"$despair" = Xyes; then
2511 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2514 You need to find a working C compiler.
2515 Either (purchase and) install the C compiler supplied by your OS vendor,
2516 or for a free C compiler try http://gcc.gnu.org/
2517 I cannot continue any further, aborting.
2526 : determine whether symbolic links are supported
2529 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2530 echo "Symbolic links are supported." >&4
2533 echo "Symbolic links are NOT supported." >&4
2538 : determine whether symbolic links are supported
2542 echo "Checking how to test for symbolic links..." >&4
2544 if $test "X$issymlink" = X; then
2546 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2547 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2549 if test $? = 0; then
2552 echo "Your builtin 'test -h' may be broken." >&4
2555 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2558 if test -f "$p/$test"; then
2567 echo "Trying external '$test -h'." >&4
2568 issymlink="$test -h"
2569 if $test ! -h sym >/dev/null 2>&1; then
2570 echo "External '$test -h' is broken, too." >&4
2578 if $test "X$issymlink" = X; then
2579 if $test -L sym 2>/dev/null; then
2580 issymlink="$test -L"
2581 echo "The builtin '$test -L' worked." >&4
2584 if $test "X$issymlink" != X; then
2585 echo "You can test for symbolic links with '$issymlink'." >&4
2587 echo "I do not know how you can test for symbolic links." >&4
2591 *) echo "No symbolic links, so not testing for their testing..." >&4
2597 case "$mksymlinks" in
2600 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2603 *) case "$lns:$issymlink" in
2604 *"ln"*" -s:"*"test -"?)
2605 echo "Creating the symbolic links..." >&4
2606 echo "(First creating the subdirectories...)" >&4
2608 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2610 test -z "$directory" && break
2614 if test ! -d t/base; then
2615 echo "Failed to create the subdirectories. Aborting." >&4
2618 echo "(Then creating the symlinks...)" >&4
2619 awk '{print $1}' $src/MANIFEST | while true; do
2621 test -z "$filename" && break
2622 if test -f $filename; then
2623 if $issymlink $filename; then
2627 if test -f $filename; then
2628 echo "$filename already exists, not symlinking."
2630 ln -s $src/$filename $filename
2634 if test ! -f t/base/lex.t; then
2635 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2640 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2649 case "$usecrosscompile" in
2651 $echo "Cross-compiling..."
2654 *-*-gcc) # A cross-compiling gcc, probably.
2655 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2657 # leave out ld, choosing it is more complex
2659 ranlib=$targetarch-ranlib
2660 $echo 'extern int foo;' > try.c
2661 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2663 if $test $# -gt 0; then
2665 incpth="`$echo $incpth|$sed 's/^ //'`"
2666 echo "Guessing incpth '$incpth'." >&4
2668 j="`$echo $i|$sed 's,/include$,/lib,'`"
2669 if $test -d $j; then
2673 libpth="`$echo $libpth|$sed 's/^ //'`"
2674 echo "Guessing libpth '$libpth'." >&4
2679 case "$targetarch" in
2680 '') echo "Targetarch not defined." >&4; croak=y ;;
2681 *) echo "Using targetarch $targetarch." >&4 ;;
2684 '') echo "Incpth not defined." >&4; croak=y ;;
2685 *) echo "Using incpth '$incpth'." >&4 ;;
2688 '') echo "Libpth not defined." >&4; croak=y ;;
2689 *) echo "Using libpth '$libpth'." >&4 ;;
2692 '') for i in $incpth; do
2693 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2695 echo "Guessing usrinc $usrinc." >&4
2700 '') echo "Usrinc not defined." >&4; croak=y ;;
2703 *) echo "Using usrinc $usrinc." >&4 ;;
2705 case "$targethost" in
2706 '') echo "Targethost not defined." >&4; croak=y ;;
2707 *) echo "Using targethost $targethost." >&4
2712 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2715 /*) run=$src/Cross/run
2716 targetmkdir=$src/Cross/mkdir
2718 from=$src/Cross/from
2720 *) pwd=`$test -f ../Configure & cd ..; pwd`
2722 targetmkdir=$pwd/Cross/mkdir
2724 from=$pwd/Cross/from
2727 case "$targetrun" in
2728 '') targetrun=ssh ;;
2733 case "$targetfrom" in
2734 '') targetfrom=scp ;;
2738 from=$from-$targetfrom
2739 case "$targetdir" in
2741 echo "Guessing targetdir $targetdir." >&4
2744 case "$targetuser" in
2746 echo "Guessing targetuser $targetuser." >&4
2749 case "$targetfrom" in
2753 case "$targetrun" in
2765 '') cwd=$targetdir ;;
2769 if $test ! -f \$exe.xok; then
2773 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2776 *) echo "Unknown targetrun '$targetrun'" >&4
2780 case "$targetmkdir" in
2782 cat >$targetmkdir <<EOF
2784 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2786 $chmod a+rx $targetmkdir
2788 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2800 $targetmkdir \`dirname \$f\`
2801 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2804 $targetmkdir $targetdir/\`dirname \$f\`
2805 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2818 $mkdir -p $targetdir/\`dirname \$f\`
2819 $cp \$f $targetdir/\$f || exit 1
2822 $targetmkdir $targetdir/\`dirname \$f\`
2823 $cp \$f $targetdir/\$f || exit 1
2830 *) echo "Unknown targetto '$targetto'" >&4
2834 case "$targetfrom" in
2841 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2846 cp) cat >$from <<EOF
2851 cp $targetdir/\$f . || exit 1
2856 *) echo "Unknown targetfrom '$targetfrom'" >&4
2860 if $test ! -f $run; then
2861 echo "Target 'run' script '$run' not found." >&4
2865 if $test ! -f $to; then
2866 echo "Target 'to' script '$to' not found." >&4
2870 if $test ! -f $from; then
2871 echo "Target 'from' script '$from' not found." >&4
2875 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2879 Using '$run' for remote execution,
2880 and '$from' and '$to'
2881 for remote file transfer.
2887 usecrosscompile='undef'
2892 : see whether [:lower:] and [:upper:] are supported character classes
2894 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2896 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2900 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2901 # (0xd9 and 0xe2), therefore that is a nice testing point.
2902 if test "X$up" = X -o "X$low" = X; then
2903 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2909 if test "X$up" = X -o "X$low" = X; then
2910 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2916 if test "X$up" = X -o "X$low" = X; then
2917 case "`echo RS | od -x 2>/dev/null`" in
2919 echo "Hey, this might be EBCDIC." >&4
2920 if test "X$up" = X -o "X$low" = X; then
2921 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2922 rs) up='[A-IJ-RS-Z]'
2927 if test "X$up" = X -o "X$low" = X; then
2928 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2938 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2940 echo "Using $up and $low to convert case." >&4
2943 echo "I don't know how to translate letters from upper to lower case." >&4
2944 echo "Your tr is not acting any way I know of." >&4
2948 : set up the translation script tr, must be called with ./tr of course
2952 '[A-Z][a-z]') exec $tr '$up' '$low';;
2953 '[a-z][A-Z]') exec $tr '$low' '$up';;
2960 : Try to determine whether config.sh was made on this system
2961 case "$config_sh" in
2963 myuname=`$uname -a 2>/dev/null`
2964 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2965 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2966 # because the A-Z/a-z are not consecutive.
2967 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2968 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2969 newmyuname="$myuname"
2971 case "$knowitall" in
2973 if test -f ../config.sh; then
2974 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2975 eval "`grep myuname= ../config.sh`"
2977 if test "X$myuname" = "X$newmyuname"; then
2985 : Get old answers from old config file if Configure was run on the
2986 : same system, otherwise use the hints.
2989 if test -f config.sh; then
2991 rp="I see a config.sh file. Shall I use it to set the defaults?"
2994 n*|N*) echo "OK, I'll ignore it."
2995 mv config.sh config.sh.old
2996 myuname="$newmyuname"
2998 *) echo "Fetching default answers from your old config.sh file..." >&4
3006 : Older versions did not always set $sh. Catch re-use of such
3016 if test ! -f config.sh; then
3019 First time through, eh? I have some defaults handy for some systems
3020 that need some extra help getting the Configure answers right:
3023 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3025 : Half the following guesses are probably wrong... If you have better
3026 : tests or hints, please send them to perlbug@perl.org
3027 : The metaconfig authors would also appreciate a copy...
3028 $test -f /irix && osname=irix
3029 $test -f /xenix && osname=sco_xenix
3030 $test -f /dynix && osname=dynix
3031 $test -f /dnix && osname=dnix
3032 $test -f /lynx.os && osname=lynxos
3033 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3034 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3035 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3036 $test -f /bin/mips && /bin/mips && osname=mips
3037 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3038 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3039 $test -d /usr/apollo/bin && osname=apollo
3040 $test -f /etc/saf/_sactab && osname=svr4
3041 $test -d /usr/include/minix && osname=minix
3042 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3043 if $test -d /MachTen -o -d /MachTen_Folder; then
3045 if $test -x /sbin/version; then
3046 osvers=`/sbin/version | $awk '{print $2}' |
3047 $sed -e 's/[A-Za-z]$//'`
3048 elif $test -x /usr/etc/version; then
3049 osvers=`/usr/etc/version | $awk '{print $2}' |
3050 $sed -e 's/[A-Za-z]$//'`
3056 $test -f /sys/posix.dll &&
3057 $test -f /usr/bin/what &&
3058 set X `/usr/bin/what /sys/posix.dll` &&
3059 $test "$3" = UWIN &&
3063 if $test -f $uname; then
3071 umips) osname=umips ;;
3074 [23]100) osname=mips ;;
3075 next*) osname=next ;;
3077 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3078 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3081 elif $test -f /etc/kconfig; then
3083 if test "$lns" = "$ln -s"; then
3085 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3087 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3094 if test -n "$DJGPP"; then
3103 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3105 # oslevel can fail with:
3106 # oslevel: Unable to acquire lock.
3107 *not\ found) osvers="$4"."$3" ;;
3108 '<3240'|'<>3240') osvers=3.2.0 ;;
3109 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3110 '=3250'|'>3250') osvers=3.2.5 ;;
3114 bsd386) osname=bsd386
3117 cygwin*) osname=cygwin
3120 *dc.osx) osname=dcosx
3126 domainos) osname=apollo
3132 dynixptx*) osname=dynixptx
3133 osvers=`echo "$4"|sed 's/^v//'`
3135 freebsd) osname=freebsd
3137 genix) osname=genix ;;
3141 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3157 netbsd*) osname=netbsd
3160 news-os) osvers="$3"
3162 4*) osname=newsos4 ;;
3166 next*) osname=next ;;
3167 nonstop-ux) osname=nonstopux ;;
3168 openbsd) osname=openbsd
3174 POSIX-BC | posix-bc ) osname=posix-bc
3177 powerux | power_ux | powermax_os | powermaxos | \
3178 powerunix | power_unix) osname=powerux
3184 solaris) osname=solaris
3186 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3193 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3197 titanos) osname=titanos
3206 ultrix) osname=ultrix
3209 osf1|mls+) case "$5" in
3212 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3215 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3218 hp*) osname=hp_osf1 ;;
3219 mips) osname=mips_osf1 ;;
3222 # UnixWare 7.1.2 is known as Open UNIX 8
3223 openunix|unixware) osname=svr5
3231 $2) case "$osname" in
3235 : svr4.x or possibly later
3245 if test -f /stand/boot ; then
3246 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3247 if test -n "$INITPROG" -a -f "$INITPROG"; then
3248 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3249 if test -n "$isesix"; then
3257 *) if test -f /etc/systemid; then
3259 set `echo $3 | $sed 's/\./ /g'` $4
3260 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3262 elif $test -f $src/hints/sco_$1_$2.sh; then
3264 elif $test -f $src/hints/sco_$1.sh; then
3269 '') : Still unknown. Probably a generic Sys V.
3278 *) case "$osname" in
3279 '') : Still unknown. Probably a generic BSD.
3287 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3288 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3289 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3292 $rm -f UU/kernel.what
3293 elif test -d c:/. -o -n "$is_os2" ; then
3300 case "$targetarch" in
3303 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3308 : Now look for a hint file osname_osvers, unless one has been
3309 : specified already.
3312 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3313 : Also try without trailing minor version numbers.
3314 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3315 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3316 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3317 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3320 *) case "$osvers" in
3323 *) if $test -f $src/hints/$file.sh ; then
3325 elif $test -f $src/hints/$xfile.sh ; then
3327 elif $test -f $src/hints/$xxfile.sh ; then
3329 elif $test -f $src/hints/$xxxfile.sh ; then
3331 elif $test -f $src/hints/$xxxxfile.sh ; then
3333 elif $test -f "$src/hints/${osname}.sh" ; then
3342 if $test -f Policy.sh ; then
3345 none) dflt="Policy" ;;
3346 *) dflt="Policy $dflt" ;;
3351 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3355 if $test -f Policy.sh ; then
3358 There's also a Policy hint file available, which should make the
3359 site-specific (policy) questions easier to answer.
3366 You may give one or more space-separated answers, or "none" if appropriate.
3367 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3368 is a good thing. DO NOT give a wrong version or a wrong OS.
3372 rp="Which of these apply, if any?"
3375 for file in $tans; do
3376 if $test X$file = XPolicy -a -f Policy.sh; then
3378 $cat Policy.sh >> UU/config.sh
3379 elif $test -f $src/hints/$file.sh; then
3380 . $src/hints/$file.sh
3381 $cat $src/hints/$file.sh >> UU/config.sh
3382 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3385 : Give one chance to correct a possible typo.
3386 echo "$file.sh does not exist"
3388 rp="hint to use instead?"
3390 for file in $ans; do
3391 if $test -f "$src/hints/$file.sh"; then
3392 . $src/hints/$file.sh
3393 $cat $src/hints/$file.sh >> UU/config.sh
3394 elif $test X$ans = X -o X$ans = Xnone ; then
3397 echo "$file.sh does not exist -- ignored."
3404 : Remember our hint file for later.
3405 if $test -f "$src/hints/$file.sh" ; then
3415 echo "Fetching default answers from $config_sh..." >&4
3419 cp $config_sh config.sh 2>/dev/null
3429 test "$override" && . ./optdef.sh
3431 : Restore computed paths
3432 for file in $loclist $trylist; do
3433 eval $file="\$_$file"
3438 Configure uses the operating system name and version to set some defaults.
3439 The default value is probably right if the name rings a bell. Otherwise,
3440 since spelling matters for me, either accept the default or answer "none"
3447 ''|' '|none) dflt=none ;;
3448 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3451 *) dflt="$osname" ;;
3453 rp="Operating system name?"
3457 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3463 ''|' '|none) dflt=none ;;
3464 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3465 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3467 ''|' ') dflt=none ;;
3472 *) dflt="$osvers" ;;
3474 rp="Operating system version?"
3484 : who configured the system
3485 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3488 cf_by=`(logname) 2>/dev/null`
3491 cf_by=`(whoami) 2>/dev/null`
3493 "") cf_by=unknown ;;
3498 : set up the script used to warn in case of inconsistency
3505 echo "*** WHOA THERE!!! ***" >&4
3506 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3507 rp=" Keep the $hint value?"
3510 y) td=$was; tu=$was;;
3514 : function used to set $1 to $val
3515 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3517 $define$undef) . ./whoa; eval "$var=\$td";;
3518 $undef$define) . ./whoa; eval "$var=\$tu";;
3519 *) eval "$var=$val";;
3523 $define|true|[yY]*) dflt='y';;
3528 Perl can be built to use the SOCKS proxy protocol library. To do so,
3529 Configure must be run with -Dusesocks. If you use SOCKS you also need
3530 to use the PerlIO abstraction layer, this will be implicitly selected.
3532 If this doesn't make any sense to you, just accept the default '$dflt'.
3534 rp='Build Perl for SOCKS?'
3537 y|Y) val="$define" ;;
3544 $define|true|[yY]*) useperlio="$define";;
3547 case "$useperlio" in
3548 $define|true|[yY]*|'') dflt='y';;
3553 Previous version of $package used the standard IO mechanisms as
3554 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3555 alternate IO mechanisms via the PerlIO abstraction layer, but the
3556 stdio mechanism is still available if needed. The abstraction layer
3557 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3558 Using PerlIO with sfio may cause problems with some extension modules.
3560 If this doesn't make any sense to you, just accept the default '$dflt'.
3562 rp='Use the PerlIO abstraction layer?'
3569 echo "Ok, doing things the stdio way."
3578 case "$useperlio" in
3579 $define|true|[yY]*) ;;
3582 You are using the SOCKS proxy protocol library which means that you
3583 should also use the PerlIO layer. You may be headed for trouble.
3592 case "$usethreads" in
3593 $define|true|[yY]*) dflt='y';;
3594 *) # Catch case where user specified ithreads or 5005threads but
3595 # forgot -Dusethreads (A.D. 4/2002)
3596 case "$useithreads$use5005threads" in
3598 case "$useperlio" in
3599 "$define") dflt='y' ;;
3609 Perl can be built to take advantage of threads on some systems.
3610 To do so, Configure can be run with -Dusethreads.
3612 Note that Perl built with threading support runs slightly slower
3613 and uses more memory than plain Perl. The current implementation
3614 is believed to be stable, but it is fairly new, and so should be
3615 treated with caution.
3617 If this doesn't make any sense to you, just accept the default '$dflt'.
3619 rp='Build a threading Perl?'
3622 y|Y) val="$define" ;;
3628 case "$usethreads" in
3632 Since release 5.6, Perl has had two different threading implementations,
3633 the newer interpreter-based version (ithreads) with one interpreter per
3634 thread, and the older 5.005 version (5005threads).
3635 The 5005threads version is effectively unmaintained and will probably be
3636 removed in Perl 5.10, so there should be no need to build a Perl using it
3637 unless needed for backwards compatibility with some existing 5.005threads
3641 : Default to ithreads unless overridden on command line or with
3644 case "$use5005threads" in
3645 $define|true|[yY]*) dflt='n';;
3647 case "$useithreads" in
3648 $undef|false|[nN]*) dflt='n';;
3650 rp='Use the newer interpreter-based ithreads?'
3653 y|Y) val="$define" ;;
3658 : Now set use5005threads to the opposite value.
3659 case "$useithreads" in
3660 $define) val="$undef" ;;
3667 useithreads="$undef"
3668 use5005threads="$undef"
3672 case "$useithreads$use5005threads" in
3676 You cannot have both the ithreads and the 5.005 threads enabled
3677 at the same time. Disabling the 5.005 threads since they are
3678 much less stable than the ithreads.
3681 use5005threads="$undef"
3685 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3688 *** To build with ithreads you must also use the PerlIO layer.
3689 *** Cannot continue, aborting.
3695 case "$d_oldpthreads" in
3696 '') : Configure tests would be welcome here. For now, assume undef.
3698 *) val="$d_oldpthreads" ;;
3704 : Look for a hint-file generated 'call-back-unit'. If the
3705 : user has specified that a threading perl is to be built,
3706 : we may need to set or change some other defaults.
3707 if $test -f usethreads.cbu; then
3708 echo "Your platform has some specific hints regarding threaded builds, using them..."
3711 case "$usethreads" in
3712 "$define"|true|[yY]*)
3714 (Your platform does not have any specific hints for threaded builds.
3715 Assuming POSIX threads, then.)
3723 Perl can be built so that multiple Perl interpreters can coexist
3724 within the same Perl executable.
3727 case "$useithreads" in
3730 This multiple interpreter support is required for interpreter-based threads.
3734 *) case "$usemultiplicity" in
3735 $define|true|[yY]*) dflt='y';;
3739 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3740 rp='Build Perl for multiplicity?'
3743 y|Y) val="$define" ;;
3752 case "$usemorebits" in
3753 "$define"|true|[yY]*)
3754 use64bitint="$define"
3755 uselongdouble="$define"
3756 usemorebits="$define"
3758 *) usemorebits="$undef"
3762 : make some quick guesses about what we are up against
3764 $echo $n "Hmm... $c"
3774 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3775 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3777 echo "Looks kind of like an OSF/1 system, but we'll see..."
3779 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3780 xxx=`./loc addbib blurfl $pth`
3781 if $test -f $xxx; then
3782 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3786 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3787 echo "Looks kind of like an extended USG system, but we'll see..."
3789 echo "Looks kind of like a USG system, but we'll see..."
3793 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3794 echo "Looks kind of like a BSD system, but we'll see..."
3798 echo "Looks kind of like a Version 7 system, but we'll see..."
3801 case "$eunicefix" in
3804 There is, however, a strange, musty smell in the air that reminds me of
3805 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3809 : it so happens the Eunice I know will not run shell scripts in Unix format
3813 echo "Congratulations. You aren't running Eunice."
3817 : Detect OS2. The p_ variable is set above in the Head.U unit.
3818 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3819 : semicolon as a patch separator
3824 I have the feeling something is not exactly right, however...don't tell me...
3825 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3826 (Or you may be running DOS with DJGPP.)
3831 if test -f /xenix; then
3832 echo "Actually, this looks more like a XENIX system..."
3837 echo "It's not Xenix..."
3842 if test -f /venix; then
3843 echo "Actually, this looks more like a VENIX system..."
3850 echo "Nor is it Venix..."
3853 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3854 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3861 rp="Use which C compiler?"
3865 : See if they have not cc but they do have gcc
3867 : Look for a hint-file generated 'call-back-unit'. Now that the
3868 : user has specified the compiler, we may need to set or change some
3870 if $test -f cc.cbu; then
3876 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3882 printf("%s\n", __VERSION__);
3884 printf("%s\n", "1");
3890 if $cc -o try $ccflags $ldflags try.c; then
3891 gccversion=`$run ./try`
3892 case "$gccversion" in
3893 '') echo "You are not using GNU cc." ;;
3894 *) echo "You are using GNU cc $gccversion."
3900 echo "*** WHOA THERE!!! ***" >&4
3901 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3902 case "$knowitall" in
3904 echo " You'd better start hunting for one and let me know about it." >&4
3910 case "$gccversion" in
3911 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3913 case "$gccversion" in
3914 '') gccosandvers='' ;;
3915 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3916 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3918 case "$gccosandvers" in
3919 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3920 $osname$osvers) ;; # looking good
3921 $osname*) cat <<EOM >&4
3923 *** WHOA THERE!!! ***
3925 Your gcc has not been compiled for the exact release of
3926 your operating system ($gccosandvers versus $osname$osvers).
3928 In general it is a good idea to keep gcc synchronized with
3929 the operating system because otherwise serious problems
3930 may ensue when trying to compile software, like Perl.
3932 I'm trying to be optimistic here, though, and will continue.
3933 If later during the configuration and build icky compilation
3934 problems appear (headerfile conflicts being the most common
3935 manifestation), I suggest reinstalling the gcc to match
3936 your operating system release.
3940 *) gccosandvers='' ;; # failed to parse, better be silent
3948 # gcc 3.* complain about adding -Idirectories that they already know about,
3949 # so we will take those off from locincpth.
3950 case "$gccversion" in
3952 echo "main(){}">try.c
3953 for incdir in $locincpth; do
3954 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3955 grep '^c[cp]p*[01]: warning: changing search order '`
3956 if test "X$warn" != X; then
3957 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3963 : decide how portable to be. Allow command line overrides.
3964 case "$d_portable" in
3966 *) d_portable="$define" ;;
3969 : set up shell script to do ~ expansion
3975 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3978 if $test -f /bin/csh; then
3979 /bin/csh -f -c "glob \$1"
3984 name=\`$expr x\$1 : '..\([^/]*\)'\`
3985 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3986 if $test ! -d "\$dir"; then
3988 echo "\$me: can't locate home directory for: \$name" >&2
3993 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4009 : now set up to get a file name
4013 cat <<'EOSC' >>getfile
4029 : getfile will accept an answer from the comma-separated list
4030 : enclosed in parentheses even if it does not meet other criteria.
4031 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4032 fn=`echo $fn | sed 's/(.*)//'`
4038 loc_file=`expr $fn : '.*:\(.*\)'`
4039 fn=`expr $fn : '\(.*\):.*'`
4047 */*) fullpath=true;;
4056 *e*) exp_file=true;;
4059 *p*) nopath_ok=true;;
4064 *d*) type='Directory';;
4065 *l*) type='Locate';;
4070 Locate) what='File';;
4075 case "$d_portable" in
4083 while test "$type"; do
4088 true) rp="$rp (~name ok)";;
4091 if test -f UU/getfile.ok && \
4092 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4111 value=`UU/filexp $ans`
4114 if test "$ans" != "$value"; then
4115 echo "(That expands to $value on this system.)"
4129 /*) value="$ansexp" ;;
4130 [a-zA-Z]:/*) value="$ansexp" ;;
4135 echo "I shall only accept a full path name, as in /bin/ls." >&4
4136 echo "Use a ! shell escape if you wish to check pathnames." >&4
4139 echo "Please give a full path name, starting with slash." >&4
4142 echo "Note that using ~name is ok provided it expands well." >&4
4155 for fp in $gfpth; do
4156 if test "X$fp" = X.; then
4161 if test -f "$pf"; then
4163 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4165 echo "($value is not a plain file, but that's ok.)"
4168 if test X"$type" = X; then
4175 for fp in $gfpth; do
4176 if test "X$fp" = X.; then
4181 direxp="$fp/$ansexp"
4183 if test -d "$direxp"; then
4191 if test -d "$ansexp"; then
4192 echo "(Looking for $loc_file in directory $value.)"
4193 value="$value/$loc_file"
4194 ansexp="$ansexp/$loc_file"
4196 if test -f "$ansexp"; then
4199 case "$nopath_ok" in
4200 true) case "$value" in
4202 *) echo "Assuming $value will be in people's path."
4218 if test "$fastread" = yes; then
4223 rp="$what $value doesn't exist. Use that name anyway?"
4242 test "X$gfpthkeep" != Xy && gfpth=""
4245 : What should the include directory be ?
4247 $echo $n "Hmm... $c"
4251 if $test -f /bin/mips && /bin/mips; then
4252 echo "Looks like a MIPS system..."
4253 $cat >usr.c <<'EOCP'
4254 #ifdef SYSTYPE_BSD43
4258 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4259 dflt='/bsd43/usr/include'
4263 mips_type='System V'
4265 $rm -f usr.c usr.out
4266 echo "and you're compiling with the $mips_type compiler and libraries."
4270 echo "Doesn't look like a MIPS system."
4280 case "$xxx_prompt" in
4283 rp='Where are the include files you want to use?'
4291 : see how we invoke the C preprocessor
4293 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4294 cat <<'EOT' >testcpp.c
4300 if test ! -f cppstdin; then
4301 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4302 # AIX cc -E doesn't show the absolute headerfile
4303 # locations but we'll cheat by using the -M flag.
4304 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
4306 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4309 echo "Keeping your $hint cppstdin wrapper."
4312 wrapper=`pwd`/cppstdin
4316 if $test "X$cppstdin" != "X" && \
4317 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4318 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4320 echo "You used to use $cppstdin $cppminus so we'll use that again."
4322 '') echo "But let's see if we can live without a wrapper..." ;;
4324 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4325 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4327 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4330 echo "(However, $cpprun $cpplast does not work, let's see...)"
4338 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4345 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4346 $cc -E <testcpp.c >testcpp.out 2>&1; \
4347 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4348 echo "Yup, it does."
4351 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4352 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4353 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4354 echo "Yup, it does."
4357 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4358 $cc -P <testcpp.c >testcpp.out 2>&1; \
4359 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4360 echo "Yipee, that works!"
4363 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4364 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4365 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4366 echo "At long last!"
4369 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4370 $cpp <testcpp.c >testcpp.out 2>&1; \
4371 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4375 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4376 $cpp - <testcpp.c >testcpp.out 2>&1; \
4377 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4378 echo "Hooray, it works! I was beginning to wonder."
4381 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4382 $wrapper <testcpp.c >testcpp.out 2>&1; \
4383 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4389 rp="No dice. I can't find a C preprocessor. Name one:"
4393 $x_cpp <testcpp.c >testcpp.out 2>&1
4394 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4395 echo "OK, that will do." >&4
4397 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4412 echo "Perhaps can we force $cc -E using a wrapper..."
4413 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4414 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4420 echo "Nope, we'll have to live without it..."
4434 "$wrapper"|'cppstdin') ;;
4435 *) $rm -f $wrapper;;
4437 $rm -f testcpp.c testcpp.out
4439 : Set private lib path
4442 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4447 '') dlist="$loclibpth $plibpth $glibpth";;
4448 *) dlist="$libpth";;
4451 : Now check and see which directories actually exist, avoiding duplicates
4455 if $test -d $xxx; then
4458 *) libpth="$libpth $xxx";;
4464 Some systems have incompatible or broken versions of libraries. Among
4465 the directories listed in the question below, please remove any you
4466 know not to be holding relevant libraries, and add any that are needed.
4467 Say "none" for none.
4478 rp="Directories to use for library searches?"
4485 : compute shared library extension
4488 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4498 On some systems, shared libraries may be available. Answer 'none' if
4499 you want to suppress searching of shared libraries for the remainder
4500 of this configuration.
4503 rp='What is the file extension used for shared libraries?'
4507 : Define several unixisms.
4508 : Hints files or command line option can be used to override them.
4509 : The convoluted testing is in case hints files set either the old
4512 '') case "$exe_ext" in
4514 *) _exe="$exe_ext" ;;
4519 '') case "$lib_ext" in
4526 '') case "$obj_ext" in
4533 '') case "$path_sep" in
4544 : Which makefile gets called first. This is used by make depend.
4545 case "$firstmakefile" in
4546 '') firstmakefile='makefile';;
4550 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4553 case "$uselongdouble" in
4554 $define|true|[yY]*) dflt='y';;
4559 Perl can be built to take advantage of long doubles which
4560 (if available) may give more accuracy and range for floating point numbers.
4562 If this doesn't make any sense to you, just accept the default '$dflt'.
4564 rp='Try to use long doubles if available?'
4567 y|Y) val="$define" ;;
4573 case "$uselongdouble" in
4574 true|[yY]*) uselongdouble="$define" ;;
4577 : Look for a hint-file generated 'call-back-unit'. If the
4578 : user has specified that long doubles should be used,
4579 : we may need to set or change some other defaults.
4580 if $test -f uselongdouble.cbu; then
4581 echo "Your platform has some specific hints regarding long doubles, using them..."
4582 . ./uselongdouble.cbu
4584 case "$uselongdouble" in
4587 (Your platform does not have any specific hints for long doubles.)
4593 : Looking for optional libraries
4595 echo "Checking for optional libraries..." >&4
4600 case "$libswanted" in
4601 '') libswanted='c_s';;
4604 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4610 for thisdir in $libpth $xlibpth; do
4611 test -d $thisdir && libspath="$libspath $thisdir"
4613 for thislib in $libswanted; do
4614 for thisdir in $libspath; do
4616 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4617 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4618 $test -f "$xxx" && eval $libscheck
4619 $test -f "$xxx" && libstyle=shared
4621 if test ! -f "$xxx"; then
4622 xxx=$thisdir/lib$thislib.$so
4623 $test -f "$xxx" && eval $libscheck
4624 $test -f "$xxx" && libstyle=shared
4626 if test ! -f "$xxx"; then
4627 xxx=$thisdir/lib$thislib$_a
4628 $test -f "$xxx" && eval $libscheck
4629 $test -f "$xxx" && libstyle=static
4631 if test ! -f "$xxx"; then
4632 xxx=$thisdir/$thislib$_a
4633 $test -f "$xxx" && eval $libscheck
4634 $test -f "$xxx" && libstyle=static
4636 if test ! -f "$xxx"; then
4637 xxx=$thisdir/lib${thislib}_s$_a
4638 $test -f "$xxx" && eval $libscheck
4639 $test -f "$xxx" && libstyle=static
4640 $test -f "$xxx" && thislib=${thislib}_s
4642 if test ! -f "$xxx"; then
4643 xxx=$thisdir/Slib$thislib$_a
4644 $test -f "$xxx" && eval $libscheck
4645 $test -f "$xxx" && libstyle=static
4647 if $test -f "$xxx"; then
4649 shared) echo "Found -l$thislib (shared)." ;;
4650 static) echo "Found -l$thislib." ;;
4651 *) echo "Found -l$thislib ($libstyle)." ;;
4655 *) dflt="$dflt -l$thislib"
4656 libsfound="$libsfound $xxx"
4658 libsfiles="$libsfiles $yyy"
4659 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4660 case " $libsdirs " in
4662 *) libsdirs="$libsdirs $yyy" ;;
4669 if $test ! -f "$xxx"; then
4670 echo "No -l$thislib."
4681 ' '|'') dflt='none';;
4686 In order to compile $package on your machine, a number of libraries
4687 are usually needed. Include any other special libraries here as well.
4688 Say "none" for none. The default list is almost always right.
4692 rp="What libraries to use?"
4699 : determine optimization, if desired, or use for debug flag also
4701 ' '|$undef) dflt='none';;
4703 *) dflt="$optimize";;
4707 By default, $package compiles with the -O flag to use the optimizer.
4708 Alternately, you might want to use the symbolic debugger, which uses
4709 the -g flag (on traditional Unix systems). Either flag can be
4710 specified here. To use neither flag, specify the word "none".
4713 rp="What optimizer/debugger flag should be used?"
4717 'none') optimize=" ";;
4721 : We will not override a previous value, but we might want to
4722 : augment a hint file
4724 default|recommended)
4725 case "$gccversion" in
4726 1*) dflt='-fpcc-struct-return' ;;
4729 *-g*) dflt="$dflt -DDEBUGGING";;
4731 case "$gccversion" in
4732 2*) if test -d /etc/conf/kconfig.d &&
4733 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4735 # Interactive Systems (ISC) POSIX mode.
4740 case "$gccversion" in
4744 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4745 echo 'int main(void) { return 0; }' > gcctest.c
4746 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4747 echo "Yes, it does." 2>&1
4750 echo "Leaving current flags $ccflags alone." 2>&1
4752 *) dflt="$dflt -fno-strict-aliasing" ;;
4755 echo "Nope, it doesn't, but that's ok." 2>&1
4759 # For gcc, adding -pipe speeds up compilations for some, but apparently
4760 # some assemblers can't read from stdin. (It also slows down compilations
4761 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4762 case "$gccversion" in
4764 echo "Checking if your compiler accepts -pipe" 2>&1
4765 echo 'int main(void) { return 0; }' > gcctest.c
4766 if $cc -pipe -o gcctest gcctest.c; then
4767 echo "Yes, it does." 2>&1
4770 echo "Leaving current flags $ccflags alone." 2>&1
4772 *) dflt="$dflt -pipe" ;;
4775 echo "Nope, it doesn't, but that's ok." 2>&1
4778 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4779 echo 'int main(void) { return 0; }' > gcctest.c
4780 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4781 echo "Yes, it does." 2>&1
4783 *-Wdeclaration-after-statement*)
4784 echo "Leaving current flags $ccflags alone." 2>&1
4786 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4789 echo "Nope, it doesn't, but that's ok." 2>&1
4796 case "$mips_type" in
4797 *BSD*|'') inclwanted="$locincpth $usrinc";;
4798 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4800 for thisincl in $inclwanted; do
4801 if $test -d $thisincl; then
4802 if $test x$thisincl != x$usrinc; then