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 Wed Mar 8 09:08:03 CET 2006 [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=''
357 d_builtin_choose_expr=''
403 endhostent_r_proto=''
409 endprotoent_r_proto=''
415 endservent_r_proto=''
467 gethostbyaddr_r_proto=''
469 gethostbyname_r_proto=''
471 gethostent_r_proto=''
483 getnetbyaddr_r_proto=''
485 getnetbyname_r_proto=''
499 d_getprotobyname_r=''
500 getprotobyname_r_proto=''
501 d_getprotobynumber_r=''
502 getprotobynumber_r_proto=''
504 getprotoent_r_proto=''
516 getservbyname_r_proto=''
518 getservbyport_r_proto=''
520 getservent_r_proto=''
544 d_libm_lib_version=''
557 d_malloc_good_size=''
599 d_old_pthread_create_joinable=''
600 old_pthread_create_joinable=''
602 d_pthread_attr_setscope=''
641 sethostent_r_proto=''
658 setprotoent_r_proto=''
670 setservent_r_proto=''
703 d_sprintf_returns_strlen=''
718 d_stdio_ptr_lval_nochange_cnt=''
719 d_stdio_ptr_lval_sets_cnt=''
923 inc_version_list_init=''
942 ignore_versioned_solibs=''
1006 d_perl_otherlibdirs=''
1014 api_versionstring=''
1020 version_patchlevel_string=''
1024 d_nv_preserves_uv=''
1025 d_nv_zero_is_allbits_zero=''
1036 nv_preserves_uv_bits=''
1107 installsitehtml1dir=''
1110 installsitehtml3dir=''
1117 installsiteman1dir=''
1120 installsiteman3dir=''
1125 installsitescript=''
1140 d_stdio_stream_array=''
1141 stdio_stream_array=''
1152 ccflags_uselargefiles=''
1153 ldflags_uselargefiles=''
1154 libswanted_uselargefiles=''
1164 userelocatableinc=''
1175 installvendorarch=''
1182 installvendorhtml1dir=''
1184 vendorhtml1direxp=''
1185 installvendorhtml3dir=''
1187 vendorhtml3direxp=''
1193 installvendorman1dir=''
1196 installvendorman3dir=''
1203 installvendorscript=''
1215 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1218 : We must find out about Eunice early
1220 if test -f /etc/unixtovms; then
1221 eunicefix=/etc/unixtovms
1223 if test -f /etc/unixtovms.exe; then
1224 eunicefix=/etc/unixtovms.exe
1227 : Set executable suffix now -- needed before hints available
1228 if test -f "/libs/version.library"; then
1231 elif test -f "/system/gnu_library/bin/ar.pm"; then
1234 elif test -n "$DJGPP"; then
1237 elif test -d c:/. -o -n "$is_os2" ; then
1246 : set useposix=false in your hint file to disable the POSIX extension.
1248 : set useopcode=false in your hint file to disable the Opcode extension.
1250 : Trailing extension. Override this in a hint file, if needed.
1251 : Extra object files, if any, needed on this platform.
1254 : Possible local include directories to search.
1255 : Set locincpth to "" in a hint file to defeat local include searches.
1256 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1257 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1259 : no include file wanted by default
1264 : change the next line if compiling for Xenix/286 on Xenix/386
1265 xlibpth='/usr/lib/386 /lib/386'
1266 : Possible local library directories to search.
1267 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1268 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1270 : general looking path for locating libraries
1271 glibpth="/lib /usr/lib $xlibpth"
1272 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1273 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1274 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1276 : Private path used by Configure to find libraries. Its value
1277 : is prepended to libpth. This variable takes care of special
1278 : machines, like the mips. Usually, it should be empty.
1281 : default library list
1283 : some systems want to use only the non-versioned libso:s
1284 ignore_versioned_solibs=''
1289 ccflags_uselargefiles=''
1290 ldflags_uselargefiles=''
1291 libswanted_uselargefiles=''
1292 : set usemultiplicity on the Configure command line to enable multiplicity.
1293 : set usesocks on the Configure command line to enable socks.
1294 : set usethreads on the Configure command line to enable threads.
1295 usereentrant='undef'
1296 : full support for void wanted by default
1299 : List of libraries we want.
1300 : If anyone needs extra -lxxx, put those in a hint file.
1301 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1302 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1303 : We probably want to search /usr/shlib before most other libraries.
1304 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1305 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1306 glibpth="/usr/shlib $glibpth"
1307 : Do not use vfork unless overridden by a hint file.
1310 : Find the basic shell for Bourne shell scripts
1314 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1317 if test -f "$xxx"; then
1320 : Build up a list and do a single loop so we can 'break' out.
1321 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1322 for xxx in sh bash ksh pdksh ash; do
1324 try="$try ${p}/${xxx}"
1328 if test -f "$xxx"; then
1331 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1334 elif test -f "$xxx.exe"; then
1345 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1347 Usually it's in /bin/sh. How did you even get this far?
1348 Please contact me (Perl Maintainers) at perlbug@perl.org and
1349 we'll try to straighten this all out.
1355 : see if sh knows # comments
1356 if `$sh -c '#' >/dev/null 2>&1`; then
1360 test -f $xcat$_exe || xcat=/usr/bin/cat
1361 if test ! -f $xcat$_exe; then
1362 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1363 if test -f $p/cat$_exe; then
1368 if test ! -f $xcat$_exe; then
1369 echo "Can't find cat anywhere!"
1373 echo "#!$xcat" >sharp
1377 if test -s today; then
1380 echo "#! $xcat" > sharp
1384 if test -s today; then
1392 echo "Your $sh doesn't grok # comments--I will strip them later on."
1395 echo "exec grep -v '^[ ]*#'" >spitshell
1397 $eunicefix spitshell
1398 spitshell=`pwd`/spitshell
1400 echo "I presume that if # doesn't work, #! won't work either!"
1405 : figure out how to guarantee sh startup
1407 '') startsh=${sharpbang}${sh} ;;
1419 : echo "Yup, it does."
1421 echo "Hmm... '$startsh' does not guarantee sh startup..."
1422 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1427 : Save command line options in file UU/cmdline.opt for later use in
1428 : generating config.sh.
1429 cat > cmdline.opt <<EOSH
1430 # Configure command line arguments.
1439 cat >>cmdline.opt <<EOSH
1440 config_arg$argn='$arg'
1442 # Extreme backslashitis: replace each ' by '"'"'
1443 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1446 arg_exp=`cat cmdl.opt`
1447 args_exp="$args_exp$args_sep'$arg_exp'"
1448 argn=`expr $argn + 1`
1451 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1452 # used by ./hints/os2.sh
1455 : produce awk script to parse command line options
1456 cat >options.awk <<'EOF'
1458 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1460 len = length(optstr);
1461 for (i = 1; i <= len; i++) {
1462 c = substr(optstr, i, 1);
1463 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1474 if (substr(str, 1, 1) != "-") {
1475 printf("'%s'\n", str);
1479 for (i = 2; i <= len; i++) {
1480 c = substr(str, i, 1);
1482 printf("-%s\n", substr(str, i));
1488 printf("'%s'\n", substr(str, i + 1));
1501 : process the command line options
1502 set X `for arg in "$@"; do echo "X$arg"; done |
1503 sed -e s/X// | awk -f options.awk`
1508 : set up default values
1518 rm -f optdef.sh posthint.sh
1519 cat >optdef.sh <<EOS
1525 while test $# -gt 0; do
1527 -d) shift; fastread=yes;;
1528 -e) shift; alldone=cont;;
1532 if test -r "$1"; then
1535 echo "$me: cannot read config file $1." >&2
1540 -h) shift; error=true;;
1541 -r) shift; reuseval=true;;
1542 -s) shift; silent=true; realsilent=true;;
1543 -E) shift; alldone=exit;;
1544 -K) shift; knowitall=true;;
1545 -O) shift; override=true;;
1546 -S) shift; silent=true; extractsh=true;;
1551 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1552 echo "$me: ignoring -D $1" >&2
1555 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1556 *) echo "$1='define'" >> optdef.sh;;
1563 *=) echo "$1" >> optdef.sh;;
1565 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1566 echo "$me: ignoring -U $1" >&2
1568 *) echo "$1='undef'" >> optdef.sh;;
1579 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1583 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1584 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1590 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1591 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1592 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1593 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1594 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1595 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1601 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1603 echo "$yyy=''" >> posthint.sh ;;
1608 echo "$yyy='$zzz'" >> posthint.sh ;;
1610 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1612 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1617 echo "$yyy=$zzz" >> posthint.sh ;;
1618 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1622 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1625 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1633 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1634 [-U symbol] [-U symbol=] [-A command:symbol...]
1635 -d : use defaults for all answers.
1636 -e : go on without questioning past the production of config.sh.
1637 -f : specify an alternate default configuration file.
1638 -h : print this help message and exit (with an error status).
1639 -r : reuse C symbols value if possible (skips costly nm extraction).
1640 -s : silent mode, only echoes questions and essential information.
1641 -D : define symbol to have some value:
1642 -D symbol symbol gets the value 'define'
1643 -D symbol=value symbol gets the value 'value'
1644 -E : stop at the end of questions, after having produced config.sh.
1645 -K : do not use unless you know what you are doing.
1646 -O : let -D and -U override definitions from loaded configuration file.
1647 -S : perform variable substitutions on all .SH files (can mix with -f)
1648 -U : undefine symbol:
1649 -U symbol symbol gets the value 'undef'
1650 -U symbol= symbol gets completely empty
1651 -A : manipulate symbol after the platform specific hints have been applied:
1652 -A symbol=value append " "value to symbol
1653 -A append:symbol=value append value to symbol
1654 -A define:symbol=value define symbol to have value
1655 -A clear:symbol define symbol to be ''
1656 -A define:symbol define symbol to be 'define'
1657 -A eval:symbol=value define symbol to be eval of value
1658 -A prepend:symbol=value prepend value to symbol
1659 -A undef:symbol define symbol to be 'undef'
1660 -A undef:symbol= define symbol to be ''
1661 -V : print version number and exit (with a zero status).
1668 case "$fastread$alldone" in
1671 case "$extractsh" in
1674 if test ! -t 0; then
1675 echo "Say 'sh Configure', not 'sh <Configure'"
1685 true) exec 1>/dev/null;;
1688 : run the defines and the undefines, if any, but leave the file out there...
1691 : create the posthint manipulation script and leave the file out there...
1696 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1697 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1698 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1699 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1700 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1703 : Some greps do not return status, grrr.
1704 echo "grimblepritz" >grimble
1705 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1707 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1713 : the following should work in any shell
1717 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1718 cat >contains <<'EOSS'
1719 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1724 : Find the path to the source tree
1727 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1731 *) src=`cd ../$src && pwd` ;;
1744 if test -f $rsrc/Configure && \
1745 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1747 : found it, so we are ok.
1750 for src in . .. ../.. ../../.. ../../../..; do
1751 if test -f ../$src/Configure && \
1752 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1763 Sorry, I can't seem to locate the source dir for $package. Please start
1764 Configure with an explicit path -- i.e. /some/path/Configure.
1772 echo "Sources for $package found in \"$src\"." >&4
1776 : script used to extract .SH files with variable substitutions
1777 cat >extract <<'EOS'
1779 echo "Doing variable substitutions on .SH files..."
1780 if test -f MANIFEST; then
1781 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1783 echo "(Looking for .SH files under the source directory.)"
1784 set x `(cd "$src"; find . -name "*.SH" -print)`
1788 0) set x `(cd "$src"; echo *.SH)`; shift;;
1790 if test ! -f "$src/$1"; then
1796 while test $name; do
1797 if test ! -d "$name"; then
1798 create="$name $create";
1799 name=`echo $name | sed -e "s|^[^/]*$||"`;
1800 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1805 for file in $create; do
1814 dir=`expr X$file : 'X\(.*\)/'`
1815 file=`expr X$file : 'X.*/\(.*\)'`
1816 (cd "$dir" && . ./$file)
1826 dir=`expr X$file : 'X\(.*\)/'`
1827 file=`expr X$file : 'X.*/\(.*\)'`
1828 (set x $dir; shift; eval $mkdir_p)
1829 sh <"$src/$dir/$file"
1838 if test -f "$src/config_h.SH"; then
1839 if test ! -f config.h; then
1840 : oops, they left it out of MANIFEST, probably, so do it anyway.
1841 . "$src/config_h.SH"
1846 : extract files and exit if asked to do so
1847 case "$extractsh" in
1849 case "$realsilent" in
1853 case "$config_sh" in
1854 '') config_sh='config.sh';;
1857 echo "Fetching answers from $config_sh..."
1860 test "$override" && . ./optdef.sh
1864 echo "Extraction done."
1869 : Eunice requires " " instead of "", can you believe it
1872 echo "Beginning of configuration questions for $package."
1874 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1876 : first determine how to suppress newline on echo command
1878 echo "Checking echo to see how to suppress newlines..."
1879 (echo "hi there\c" ; echo " ") >.echotmp
1880 if $contains c .echotmp >/dev/null 2>&1 ; then
1891 echo $n "The star should be here-->$c"
1895 : Now test for existence of everything in MANIFEST
1897 if test -f "$rsrc/MANIFEST"; then
1898 echo "First let's make sure your kit is complete. Checking..." >&4
1899 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1902 for filelist in x??; do
1903 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1905 if test -s missing; then
1909 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1911 You have the option of continuing the configuration process, despite the
1912 distinct possibility that your kit is damaged, by typing 'y'es. If you
1913 do, don't blame me if something goes wrong. I advise you to type 'n'o
1914 and contact the author (perlbug@perl.org).
1917 echo $n "Continue? [n] $c" >&4
1921 echo "Continuing..." >&4
1925 echo "ABORTING..." >&4
1930 echo "Looks good..."
1933 echo "There is no MANIFEST file. I hope your kit is complete !"
1938 : Find the appropriate value for a newline for tr
1939 if test -n "$DJGPP"; then
1942 if test X"$trnl" = X; then
1943 case "`echo foo|tr '\n' x 2>/dev/null`" in
1947 if test X"$trnl" = X; then
1948 case "`echo foo|tr '\012' x 2>/dev/null`" in
1949 foox) trnl='\012' ;;
1952 if test X"$trnl" = X; then
1953 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1954 fooxy) trnl='\n\r' ;;
1957 if test X"$trnl" = X; then
1960 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1966 : compute the number of columns on the terminal for proper question formatting
1971 : set up the echo used in my read
1972 myecho="case \"\$xxxm\" in
1973 '') echo $n \"\$rp $c\" >&4;;
1975 '') echo $n \"[\$xxxm] $c\";;
1977 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1979 echo $n \"[\$xxxm] $c\" >&4
1981 echo $n \"\$rp [\$xxxm] $c\" >&4
1987 : now set up to do reads with possible shell escape and default assignment
1993 case "\$fastread" in
1994 yes) case "\$dflt" in
1997 case "\$silent-\$rp" in
2002 *) case "\$silent" in
2003 true) case "\$rp" in
2008 while expr "X\$ans" : "X!" >/dev/null; do
2012 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2020 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2029 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2034 echo "(OK, I'll run with -d after this question.)" >&4
2037 echo "*** Sorry, \$1 not supported yet." >&4
2047 echo "*** Substitution done -- please confirm."
2049 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2054 echo "*** Error -- try again."
2061 case "\$ans\$xxxm\$nostick" in
2073 : create .config dir to save info across Configure sessions
2074 test -d ../.config || mkdir ../.config
2075 cat >../.config/README <<EOF
2076 This directory created by Configure to save information that should
2077 persist across sessions for $package.
2079 You may safely delete it if you wish.
2082 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2084 $define|true|[yY]*) ;;
2085 *) case "$xversion" in
2088 *** WHOA THERE!!! ***
2090 This is an UNSTABLE DEVELOPMENT release.
2091 The version of this $package distribution is $xversion, that is, odd,
2092 (as opposed to even) and that signifies a development release.
2093 If you want a maintenance release, you want an even-numbered version.
2095 Do ***NOT*** install this into production use.
2096 Data corruption and crashes are possible.
2098 It is most seriously suggested that you do not continue any further
2099 unless you want to help in developing and debugging Perl.
2101 If you *still* want to build perl, you can answer 'y' now,
2102 or pass -Dusedevel to Configure.
2105 rp='Do you really want to continue?'
2109 [yY]) echo >&4 "Okay, continuing."
2110 usedevel="$define" ;;
2111 *) echo >&4 "Okay, bye."
2121 case "$versiononly" in
2122 '') versiononly="$define" ;;
2124 case "$installusrbinperl" in
2125 '') installusrbinperl="$undef" ;;
2130 : general instructions
2133 user=`(logname) 2>/dev/null`
2135 '') user=`whoami 2>&1`;;
2137 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2140 rp='Would you like to see the instructions?'
2151 This installation shell script will examine your system and ask you questions
2152 to determine how the perl5 package should be installed. If you get
2153 stuck on a question, you may use a ! shell escape to start a subshell or
2154 execute a command. Many of the questions will have default answers in square
2155 brackets; typing carriage return will give you the default.
2157 On some of the questions which ask for file or directory names you are allowed
2158 to use the ~name construct to specify the login directory belonging to "name",
2159 even if you don't have a shell which knows about that. Questions where this is
2160 allowed will be marked "(~name ok)".
2164 dflt='Type carriage return to continue'
2168 The prompter used in this script allows you to use shell variables and
2169 backticks in your answers. You may use $1, $2, etc... to refer to the words
2170 in the default answer, as if the default line was a set of arguments given to a
2171 script shell. This means you may also use $* to repeat the whole default line,
2172 so you do not have to re-type everything to add something to the default.
2174 Everytime there is a substitution, you will have to confirm. If there is an
2175 error (e.g. an unmatched backtick), the default answer will remain unchanged
2176 and you will be prompted again.
2178 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2179 the questions and use the computed defaults (or the previous answers if there
2180 was already a config.sh file). Type 'Configure -h' for a list of options.
2181 You may also start interactively and then answer '& -d' at any prompt to turn
2182 on the non-interactive behaviour for the remainder of the execution.
2188 Much effort has been expended to ensure that this shell script will run on any
2189 Unix system. If despite that it blows up on yours, your best bet is to edit
2190 Configure and run it again. If you can't run Configure for some reason,
2191 you'll have to generate a config.sh file by hand. Whatever problems you
2192 have, let me (perlbug@perl.org) know how I blew it.
2194 This installation script affects things in two ways:
2196 1) it may do direct variable substitutions on some of the files included
2198 2) it builds a config.h file for inclusion in C programs. You may edit
2199 any of these files as the need arises after running this script.
2201 If you make a mistake on a question, there is no easy way to back up to it
2202 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2203 files. Configure will offer to let you do this before it runs the SH files.
2206 dflt='Type carriage return to continue'
2208 case "$firsttime" in
2209 true) echo $user >>../.config/instruct;;
2213 : find out where common programs are
2215 echo "Locating common programs..." >&4
2228 if test -d \$dir/\$thing; then
2234 for thisthing in \$dir/\$thing; do
2235 : just loop through to pick last item
2237 if test -f \$thisthing; then
2240 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2243 elif test -f \$dir/\$thing.exe; then
2244 if test -n "$DJGPP"; then
2245 echo \$dir/\$thing.exe
2246 elif test "$eunicefix" != ":"; then
2247 : on Eunice apparently
2301 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2302 pth="$pth /lib /usr/lib"
2303 for file in $loclist; do
2307 if test -f "$xxx"; then
2310 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2311 xxx=`./loc $file $file $pth`
2314 '') xxx=`./loc $file $file $pth`;;
2315 *) xxx=`./loc $xxx $xxx $pth`;;
2317 eval $file=$xxx$_exe
2321 echo $file is in $xxx.
2324 echo $file is in $xxx.
2327 echo "I don't know where '$file' is, and my life depends on it." >&4
2328 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2334 echo "Don't worry if any of the following aren't found..."
2336 for file in $trylist; do
2340 if test -f "$xxx"; then
2343 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2344 xxx=`./loc $file $file $pth`
2347 '') xxx=`./loc $file $file $pth`;;
2348 *) xxx=`./loc $xxx $xxx $pth`;;
2350 eval $file=$xxx$_exe
2354 echo $file is in $xxx.
2357 echo $file is in $xxx.
2360 echo "I don't see $file out there, $say."
2367 echo "Substituting grep for egrep."
2374 echo "Substituting cp for ln."
2383 echo "I can't find make or gmake, and my life depends on it." >&4
2384 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2392 *) # We can't have osname yet.
2393 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2394 # Assume that gmake, if found, is definitely GNU make
2395 # and prefer it over the system make.
2396 echo "Substituting gmake for make."
2404 echo "Hopefully test is built into your sh."
2407 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2408 echo "Using the test built into your sh."
2416 echo "Hopefully echo is built into your sh."
2421 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2422 $echo $n "hi there$c" >foo1
2423 echo $n "hi there$c" >foo2
2424 if cmp foo1 foo2 >/dev/null 2>&1; then
2425 echo "They are compatible. In fact, they may be identical."
2432 They are not compatible! You are probably running ksh on a non-USG system.
2433 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2434 have echo built in and we may have to run some Bourne shell scripts. That
2435 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2438 $echo $n "The star should be here-->$c"
2448 cat <<'EOSC' >>trygcc
2453 int main(int argc, char *argv[]) {
2457 if $cc -o try $ccflags $ldflags try.c; then
2460 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2466 case "`$cc -v -c try.c 2>&1`" in
2469 if $test X"$trygcc" = Xyes; then
2470 if gcc -o try -c try.c; then
2472 echo "You seem to have a working gcc, though." >&4
2473 rp="Would you like to use it?"
2475 if $test -f myread; then
2478 if $test -f UU/myread; then
2481 echo "Cannot find myread, sorry. Aborting." >&2
2486 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2487 if $test -f usethreads.cbu; then
2490 *** However, any setting of the C compiler flags (e.g. for thread support)
2491 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2492 *** (together with e.g. -Dusethreads).
2508 cat <<'EOSC' >>checkcc
2513 int main(int argc, char *argv[]) {
2517 if $cc -o try $ccflags $ldflags try.c; then
2520 if $test X"$despair" = Xyes; then
2521 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2524 You need to find a working C compiler.
2525 Either (purchase and) install the C compiler supplied by your OS vendor,
2526 or for a free C compiler try http://gcc.gnu.org/
2527 I cannot continue any further, aborting.
2536 : determine whether symbolic links are supported
2539 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2540 echo "Symbolic links are supported." >&4
2543 echo "Symbolic links are NOT supported." >&4
2548 : determine whether symbolic links are supported
2552 echo "Checking how to test for symbolic links..." >&4
2554 if $test "X$issymlink" = X; then
2556 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2557 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2559 if test $? = 0; then
2562 echo "Your builtin 'test -h' may be broken." >&4
2565 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2568 if test -f "$p/$test"; then
2577 echo "Trying external '$test -h'." >&4
2578 issymlink="$test -h"
2579 if $test ! -h sym >/dev/null 2>&1; then
2580 echo "External '$test -h' is broken, too." >&4
2588 if $test "X$issymlink" = X; then
2589 if $test -L sym 2>/dev/null; then
2590 issymlink="$test -L"
2591 echo "The builtin '$test -L' worked." >&4
2594 if $test "X$issymlink" != X; then
2595 echo "You can test for symbolic links with '$issymlink'." >&4
2597 echo "I do not know how you can test for symbolic links." >&4
2601 *) echo "No symbolic links, so not testing for their testing..." >&4
2607 case "$mksymlinks" in
2610 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2613 *) case "$lns:$issymlink" in
2614 *"ln"*" -s:"*"test -"?)
2615 echo "Creating the symbolic links..." >&4
2616 echo "(First creating the subdirectories...)" >&4
2618 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2620 test -z "$directory" && break
2624 if test ! -d t/base; then
2625 echo "Failed to create the subdirectories. Aborting." >&4
2628 echo "(Then creating the symlinks...)" >&4
2629 awk '{print $1}' $src/MANIFEST | while true; do
2631 test -z "$filename" && break
2632 if test -f $filename; then
2633 if $issymlink $filename; then
2637 if test -f $filename; then
2638 echo "$filename already exists, not symlinking."
2640 ln -s $src/$filename $filename
2644 if test ! -f t/base/lex.t; then
2645 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2650 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2659 case "$usecrosscompile" in
2661 $echo "Cross-compiling..."
2664 *-*-gcc) # A cross-compiling gcc, probably.
2665 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2667 # leave out ld, choosing it is more complex
2669 ranlib=$targetarch-ranlib
2670 $echo 'extern int foo;' > try.c
2671 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2673 if $test $# -gt 0; then
2675 incpth="`$echo $incpth|$sed 's/^ //'`"
2676 echo "Guessing incpth '$incpth'." >&4
2678 j="`$echo $i|$sed 's,/include$,/lib,'`"
2679 if $test -d $j; then
2683 libpth="`$echo $libpth|$sed 's/^ //'`"
2684 echo "Guessing libpth '$libpth'." >&4
2689 case "$targetarch" in
2690 '') echo "Targetarch not defined." >&4; croak=y ;;
2691 *) echo "Using targetarch $targetarch." >&4 ;;
2694 '') echo "Incpth not defined." >&4; croak=y ;;
2695 *) echo "Using incpth '$incpth'." >&4 ;;
2698 '') echo "Libpth not defined." >&4; croak=y ;;
2699 *) echo "Using libpth '$libpth'." >&4 ;;
2702 '') for i in $incpth; do
2703 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2705 echo "Guessing usrinc $usrinc." >&4
2710 '') echo "Usrinc not defined." >&4; croak=y ;;
2713 *) echo "Using usrinc $usrinc." >&4 ;;
2715 case "$targethost" in
2716 '') echo "Targethost not defined." >&4; croak=y ;;
2717 *) echo "Using targethost $targethost." >&4
2722 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2725 /*) run=$src/Cross/run
2726 targetmkdir=$src/Cross/mkdir
2728 from=$src/Cross/from
2730 *) pwd=`$test -f ../Configure & cd ..; pwd`
2732 targetmkdir=$pwd/Cross/mkdir
2734 from=$pwd/Cross/from
2737 case "$targetrun" in
2738 '') targetrun=ssh ;;
2743 case "$targetfrom" in
2744 '') targetfrom=scp ;;
2748 from=$from-$targetfrom
2749 case "$targetdir" in
2751 echo "Guessing targetdir $targetdir." >&4
2754 case "$targetuser" in
2756 echo "Guessing targetuser $targetuser." >&4
2759 case "$targetfrom" in
2763 case "$targetrun" in
2775 '') cwd=$targetdir ;;
2779 if $test ! -f \$exe.xok; then
2783 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2786 *) echo "Unknown targetrun '$targetrun'" >&4
2790 case "$targetmkdir" in
2792 cat >$targetmkdir <<EOF
2794 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2796 $chmod a+rx $targetmkdir
2798 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2810 $targetmkdir \`dirname \$f\`
2811 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2814 $targetmkdir $targetdir/\`dirname \$f\`
2815 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2828 $mkdir -p $targetdir/\`dirname \$f\`
2829 $cp \$f $targetdir/\$f || exit 1
2832 $targetmkdir $targetdir/\`dirname \$f\`
2833 $cp \$f $targetdir/\$f || exit 1
2840 *) echo "Unknown targetto '$targetto'" >&4
2844 case "$targetfrom" in
2851 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2856 cp) cat >$from <<EOF
2861 cp $targetdir/\$f . || exit 1
2866 *) echo "Unknown targetfrom '$targetfrom'" >&4
2870 if $test ! -f $run; then
2871 echo "Target 'run' script '$run' not found." >&4
2875 if $test ! -f $to; then
2876 echo "Target 'to' script '$to' not found." >&4
2880 if $test ! -f $from; then
2881 echo "Target 'from' script '$from' not found." >&4
2885 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2889 Using '$run' for remote execution,
2890 and '$from' and '$to'
2891 for remote file transfer.
2897 usecrosscompile='undef'
2902 : see whether [:lower:] and [:upper:] are supported character classes
2904 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2906 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2910 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2911 # (0xd9 and 0xe2), therefore that is a nice testing point.
2912 if test "X$up" = X -o "X$low" = X; then
2913 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2919 if test "X$up" = X -o "X$low" = X; then
2920 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2926 if test "X$up" = X -o "X$low" = X; then
2927 case "`echo RS | od -x 2>/dev/null`" in
2929 echo "Hey, this might be EBCDIC." >&4
2930 if test "X$up" = X -o "X$low" = X; then
2931 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2932 rs) up='[A-IJ-RS-Z]'
2937 if test "X$up" = X -o "X$low" = X; then
2938 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2948 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2950 echo "Using $up and $low to convert case." >&4
2953 echo "I don't know how to translate letters from upper to lower case." >&4
2954 echo "Your tr is not acting any way I know of." >&4
2958 : set up the translation script tr, must be called with ./tr of course
2962 '[A-Z][a-z]') exec $tr '$up' '$low';;
2963 '[a-z][A-Z]') exec $tr '$low' '$up';;
2970 : Try to determine whether config.sh was made on this system
2971 case "$config_sh" in
2973 myuname=`$uname -a 2>/dev/null`
2974 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2975 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2976 # because the A-Z/a-z are not consecutive.
2977 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2978 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2979 newmyuname="$myuname"
2981 case "$knowitall" in
2983 if test -f ../config.sh; then
2984 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2985 eval "`grep myuname= ../config.sh`"
2987 if test "X$myuname" = "X$newmyuname"; then
2995 : Get old answers from old config file if Configure was run on the
2996 : same system, otherwise use the hints.
2999 if test -f config.sh; then
3001 rp="I see a config.sh file. Shall I use it to set the defaults?"
3004 n*|N*) echo "OK, I'll ignore it."
3005 mv config.sh config.sh.old
3006 myuname="$newmyuname"
3008 *) echo "Fetching default answers from your old config.sh file..." >&4
3016 : Older versions did not always set $sh. Catch re-use of such
3026 if test ! -f config.sh; then
3029 First time through, eh? I have some defaults handy for some systems
3030 that need some extra help getting the Configure answers right:
3033 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3035 : Half the following guesses are probably wrong... If you have better
3036 : tests or hints, please send them to perlbug@perl.org
3037 : The metaconfig authors would also appreciate a copy...
3038 $test -f /irix && osname=irix
3039 $test -f /xenix && osname=sco_xenix
3040 $test -f /dynix && osname=dynix
3041 $test -f /dnix && osname=dnix
3042 $test -f /lynx.os && osname=lynxos
3043 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3044 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3045 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3046 $test -f /bin/mips && /bin/mips && osname=mips
3047 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3048 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3049 $test -d /usr/apollo/bin && osname=apollo
3050 $test -f /etc/saf/_sactab && osname=svr4
3051 $test -d /usr/include/minix && osname=minix
3052 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3053 if $test -d /MachTen -o -d /MachTen_Folder; then
3055 if $test -x /sbin/version; then
3056 osvers=`/sbin/version | $awk '{print $2}' |
3057 $sed -e 's/[A-Za-z]$//'`
3058 elif $test -x /usr/etc/version; then
3059 osvers=`/usr/etc/version | $awk '{print $2}' |
3060 $sed -e 's/[A-Za-z]$//'`
3066 $test -f /sys/posix.dll &&
3067 $test -f /usr/bin/what &&
3068 set X `/usr/bin/what /sys/posix.dll` &&
3069 $test "$3" = UWIN &&
3073 if $test -f $uname; then
3081 umips) osname=umips ;;
3084 [23]100) osname=mips ;;
3085 next*) osname=next ;;
3087 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3088 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3091 elif $test -f /etc/kconfig; then
3093 if test "$lns" = "$ln -s"; then
3095 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3097 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3104 if test -n "$DJGPP"; then
3113 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3115 # oslevel can fail with:
3116 # oslevel: Unable to acquire lock.
3117 *not\ found) osvers="$4"."$3" ;;
3118 '<3240'|'<>3240') osvers=3.2.0 ;;
3119 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3120 '=3250'|'>3250') osvers=3.2.5 ;;
3124 bsd386) osname=bsd386
3127 cygwin*) osname=cygwin
3130 *dc.osx) osname=dcosx
3136 domainos) osname=apollo
3142 dragonfly) osname=dragonfly
3145 dynixptx*) osname=dynixptx
3146 osvers=`echo "$4"|sed 's/^v//'`
3148 freebsd) osname=freebsd
3150 genix) osname=genix ;;
3154 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3170 netbsd*) osname=netbsd
3173 news-os) osvers="$3"
3175 4*) osname=newsos4 ;;
3179 next*) osname=next ;;
3180 nonstop-ux) osname=nonstopux ;;
3181 openbsd) osname=openbsd
3187 POSIX-BC | posix-bc ) osname=posix-bc
3190 powerux | power_ux | powermax_os | powermaxos | \
3191 powerunix | power_unix) osname=powerux
3197 solaris) osname=solaris
3199 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3206 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3210 titanos) osname=titanos
3219 ultrix) osname=ultrix
3222 osf1|mls+) case "$5" in
3225 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3228 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3231 hp*) osname=hp_osf1 ;;
3232 mips) osname=mips_osf1 ;;
3235 # UnixWare 7.1.2 is known as Open UNIX 8
3236 openunix|unixware) osname=svr5
3244 $2) case "$osname" in
3248 : svr4.x or possibly later
3258 if test -f /stand/boot ; then
3259 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3260 if test -n "$INITPROG" -a -f "$INITPROG"; then
3261 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3262 if test -n "$isesix"; then
3270 *) if test -f /etc/systemid; then
3272 set `echo $3 | $sed 's/\./ /g'` $4
3273 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3275 elif $test -f $src/hints/sco_$1_$2.sh; then
3277 elif $test -f $src/hints/sco_$1.sh; then
3282 '') : Still unknown. Probably a generic Sys V.
3291 *) case "$osname" in
3292 '') : Still unknown. Probably a generic BSD.
3300 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3301 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3302 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3305 $rm -f UU/kernel.what
3306 elif test -d c:/. -o -n "$is_os2" ; then
3313 case "$targetarch" in
3316 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3321 : Now look for a hint file osname_osvers, unless one has been
3322 : specified already.
3325 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3326 : Also try without trailing minor version numbers.
3327 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3328 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3329 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3330 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3333 *) case "$osvers" in
3336 *) if $test -f $src/hints/$file.sh ; then
3338 elif $test -f $src/hints/$xfile.sh ; then
3340 elif $test -f $src/hints/$xxfile.sh ; then
3342 elif $test -f $src/hints/$xxxfile.sh ; then
3344 elif $test -f $src/hints/$xxxxfile.sh ; then
3346 elif $test -f "$src/hints/${osname}.sh" ; then
3355 if $test -f Policy.sh ; then
3358 none) dflt="Policy" ;;
3359 *) dflt="Policy $dflt" ;;
3364 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3368 if $test -f Policy.sh ; then
3371 There's also a Policy hint file available, which should make the
3372 site-specific (policy) questions easier to answer.
3379 You may give one or more space-separated answers, or "none" if appropriate.
3380 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3381 is a good thing. DO NOT give a wrong version or a wrong OS.
3385 rp="Which of these apply, if any?"
3388 for file in $tans; do
3389 if $test X$file = XPolicy -a -f Policy.sh; then
3391 $cat Policy.sh >> UU/config.sh
3392 elif $test -f $src/hints/$file.sh; then
3393 . $src/hints/$file.sh
3394 $cat $src/hints/$file.sh >> UU/config.sh
3395 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3398 : Give one chance to correct a possible typo.
3399 echo "$file.sh does not exist"
3401 rp="hint to use instead?"
3403 for file in $ans; do
3404 if $test -f "$src/hints/$file.sh"; then
3405 . $src/hints/$file.sh
3406 $cat $src/hints/$file.sh >> UU/config.sh
3407 elif $test X$ans = X -o X$ans = Xnone ; then
3410 echo "$file.sh does not exist -- ignored."
3417 : Remember our hint file for later.
3418 if $test -f "$src/hints/$file.sh" ; then
3428 echo "Fetching default answers from $config_sh..." >&4
3432 cp $config_sh config.sh 2>/dev/null
3442 test "$override" && . ./optdef.sh
3444 : Restore computed paths
3445 for file in $loclist $trylist; do
3446 eval $file="\$_$file"
3451 Configure uses the operating system name and version to set some defaults.
3452 The default value is probably right if the name rings a bell. Otherwise,
3453 since spelling matters for me, either accept the default or answer "none"
3460 ''|' '|none) dflt=none ;;
3461 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3464 *) dflt="$osname" ;;
3466 rp="Operating system name?"
3470 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3476 ''|' '|none) dflt=none ;;
3477 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3478 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3480 ''|' ') dflt=none ;;
3485 *) dflt="$osvers" ;;
3487 rp="Operating system version?"
3497 : who configured the system
3498 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3501 cf_by=`(logname) 2>/dev/null`
3504 cf_by=`(whoami) 2>/dev/null`
3506 "") cf_by=unknown ;;
3511 : set up the script used to warn in case of inconsistency
3518 echo "*** WHOA THERE!!! ***" >&4
3519 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3520 rp=" Keep the $hint value?"
3523 y) td=$was; tu=$was;;
3527 : function used to set $1 to $val
3528 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3530 $define$undef) . ./whoa; eval "$var=\$td";;
3531 $undef$define) . ./whoa; eval "$var=\$tu";;
3532 *) eval "$var=$val";;
3536 $define|true|[yY]*) dflt='y';;
3541 Perl can be built to use the SOCKS proxy protocol library. To do so,
3542 Configure must be run with -Dusesocks. If you use SOCKS you also need
3543 to use the PerlIO abstraction layer, this will be implicitly selected.
3545 If this doesn't make any sense to you, just accept the default '$dflt'.
3547 rp='Build Perl for SOCKS?'
3550 y|Y) val="$define" ;;
3557 $define|true|[yY]*) useperlio="$define";;
3560 case "$useperlio" in
3561 $define|true|[yY]*|'') dflt='y';;
3566 Previous version of $package used the standard IO mechanisms as
3567 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3568 alternate IO mechanisms via the PerlIO abstraction layer, but the
3569 stdio mechanism is still available if needed. The abstraction layer
3570 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3571 Using PerlIO with sfio may cause problems with some extension modules.
3573 If this doesn't make any sense to you, just accept the default '$dflt'.
3575 rp='Use the PerlIO abstraction layer?'
3582 echo "Ok, doing things the stdio way."
3591 case "$useperlio" in
3592 $define|true|[yY]*) ;;
3595 You are using the SOCKS proxy protocol library which means that you
3596 should also use the PerlIO layer. You may be headed for trouble.
3605 case "$usethreads" in
3606 $define|true|[yY]*) dflt='y';;
3607 *) # Catch case where user specified ithreads or 5005threads but
3608 # forgot -Dusethreads (A.D. 4/2002)
3609 case "$useithreads$use5005threads" in
3611 case "$useperlio" in
3612 "$define") dflt='y' ;;
3622 Perl can be built to take advantage of threads on some systems.
3623 To do so, Configure can be run with -Dusethreads.
3625 Note that Perl built with threading support runs slightly slower
3626 and uses more memory than plain Perl. The current implementation
3627 is believed to be stable, but it is fairly new, and so should be
3628 treated with caution.
3630 If this doesn't make any sense to you, just accept the default '$dflt'.
3632 rp='Build a threading Perl?'
3635 y|Y) val="$define" ;;
3641 case "$usethreads" in
3645 Since release 5.6, Perl has had two different threading implementations,
3646 the newer interpreter-based version (ithreads) with one interpreter per
3647 thread, and the older 5.005 version (5005threads).
3648 The 5005threads version is effectively unmaintained and will probably be
3649 removed in Perl 5.10, so there should be no need to build a Perl using it
3650 unless needed for backwards compatibility with some existing 5.005threads
3654 : Default to ithreads unless overridden on command line or with
3657 case "$use5005threads" in
3658 $define|true|[yY]*) dflt='n';;
3660 case "$useithreads" in
3661 $undef|false|[nN]*) dflt='n';;
3663 rp='Use the newer interpreter-based ithreads?'
3666 y|Y) val="$define" ;;
3671 : Now set use5005threads to the opposite value.
3672 case "$useithreads" in
3673 $define) val="$undef" ;;
3680 useithreads="$undef"
3681 use5005threads="$undef"
3685 case "$useithreads$use5005threads" in
3689 You cannot have both the ithreads and the 5.005 threads enabled
3690 at the same time. Disabling the 5.005 threads since they are
3691 much less stable than the ithreads.
3694 use5005threads="$undef"
3698 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3701 *** To build with ithreads you must also use the PerlIO layer.
3702 *** Cannot continue, aborting.
3708 case "$d_oldpthreads" in
3709 '') : Configure tests would be welcome here. For now, assume undef.
3711 *) val="$d_oldpthreads" ;;
3717 : Look for a hint-file generated 'call-back-unit'. If the
3718 : user has specified that a threading perl is to be built,
3719 : we may need to set or change some other defaults.
3720 if $test -f usethreads.cbu; then
3721 echo "Your platform has some specific hints regarding threaded builds, using them..."
3724 case "$usethreads" in
3725 "$define"|true|[yY]*)
3727 (Your platform does not have any specific hints for threaded builds.
3728 Assuming POSIX threads, then.)
3736 Perl can be built so that multiple Perl interpreters can coexist
3737 within the same Perl executable.
3740 case "$useithreads" in
3743 This multiple interpreter support is required for interpreter-based threads.
3747 *) case "$usemultiplicity" in
3748 $define|true|[yY]*) dflt='y';;
3752 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3753 rp='Build Perl for multiplicity?'
3756 y|Y) val="$define" ;;
3765 case "$usemorebits" in
3766 "$define"|true|[yY]*)
3767 use64bitint="$define"
3768 uselongdouble="$define"
3769 usemorebits="$define"
3771 *) usemorebits="$undef"
3775 : make some quick guesses about what we are up against
3777 $echo $n "Hmm... $c"
3787 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3788 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3790 echo "Looks kind of like an OSF/1 system, but we'll see..."
3792 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3793 xxx=`./loc addbib blurfl $pth`
3794 if $test -f $xxx; then
3795 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3799 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3800 echo "Looks kind of like an extended USG system, but we'll see..."
3802 echo "Looks kind of like a USG system, but we'll see..."
3806 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3807 echo "Looks kind of like a BSD system, but we'll see..."
3811 echo "Looks kind of like a Version 7 system, but we'll see..."
3814 case "$eunicefix" in
3817 There is, however, a strange, musty smell in the air that reminds me of
3818 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3822 : it so happens the Eunice I know will not run shell scripts in Unix format
3826 echo "Congratulations. You aren't running Eunice."
3830 : Detect OS2. The p_ variable is set above in the Head.U unit.
3831 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3832 : semicolon as a patch separator
3837 I have the feeling something is not exactly right, however...don't tell me...
3838 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3839 (Or you may be running DOS with DJGPP.)
3844 if test -f /xenix; then
3845 echo "Actually, this looks more like a XENIX system..."
3850 echo "It's not Xenix..."
3855 if test -f /venix; then
3856 echo "Actually, this looks more like a VENIX system..."
3863 echo "Nor is it Venix..."
3866 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3867 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3874 rp="Use which C compiler?"
3878 : See if they have not cc but they do have gcc
3880 : Look for a hint-file generated 'call-back-unit'. Now that the
3881 : user has specified the compiler, we may need to set or change some
3883 if $test -f cc.cbu; then
3889 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3895 printf("%s\n", __VERSION__);
3897 printf("%s\n", "1");
3903 if $cc -o try $ccflags $ldflags try.c; then
3904 gccversion=`$run ./try`
3905 case "$gccversion" in
3906 '') echo "You are not using GNU cc." ;;
3907 *) echo "You are using GNU cc $gccversion."
3913 echo "*** WHOA THERE!!! ***" >&4
3914 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3915 case "$knowitall" in
3917 echo " You'd better start hunting for one and let me know about it." >&4
3923 case "$gccversion" in
3924 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3926 case "$gccversion" in
3927 '') gccosandvers='' ;;
3928 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3929 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3931 case "$gccosandvers" in
3932 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3933 $osname$osvers) ;; # looking good
3934 $osname*) cat <<EOM >&4
3936 *** WHOA THERE!!! ***
3938 Your gcc has not been compiled for the exact release of
3939 your operating system ($gccosandvers versus $osname$osvers).
3941 In general it is a good idea to keep gcc synchronized with
3942 the operating system because otherwise serious problems
3943 may ensue when trying to compile software, like Perl.
3945 I'm trying to be optimistic here, though, and will continue.
3946 If later during the configuration and build icky compilation
3947 problems appear (headerfile conflicts being the most common
3948 manifestation), I suggest reinstalling the gcc to match
3949 your operating system release.
3953 *) gccosandvers='' ;; # failed to parse, better be silent
3961 # gcc 3.* complain about adding -Idirectories that they already know about,
3962 # so we will take those off from locincpth.
3963 case "$gccversion" in
3965 echo "main(){}">try.c
3966 for incdir in $locincpth; do
3967 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3968 grep '^c[cp]p*[01]: warning: changing search order '`
3969 if test "X$warn" != X; then
3970 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3976 : decide how portable to be. Allow command line overrides.
3977 case "$d_portable" in
3979 *) d_portable="$define" ;;
3982 : set up shell script to do ~ expansion
3988 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3991 if $test -f /bin/csh; then
3992 /bin/csh -f -c "glob \$1"
3997 name=\`$expr x\$1 : '..\([^/]*\)'\`
3998 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3999 if $test ! -d "\$dir"; then
4001 echo "\$me: can't locate home directory for: \$name" >&2
4006 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4022 : now set up to get a file name
4026 cat <<'EOSC' >>getfile
4042 : getfile will accept an answer from the comma-separated list
4043 : enclosed in parentheses even if it does not meet other criteria.
4044 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4045 fn=`echo $fn | sed 's/(.*)//'`
4051 loc_file=`expr $fn : '.*:\(.*\)'`
4052 fn=`expr $fn : '\(.*\):.*'`
4060 */*) fullpath=true;;
4069 *e*) exp_file=true;;
4072 *p*) nopath_ok=true;;
4077 *d*) type='Directory';;
4078 *l*) type='Locate';;
4083 Locate) what='File';;
4088 case "$d_portable" in
4096 while test "$type"; do
4101 true) rp="$rp (~name ok)";;
4104 if test -f UU/getfile.ok && \
4105 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4124 value=`UU/filexp $ans`
4127 if test "$ans" != "$value"; then
4128 echo "(That expands to $value on this system.)"
4142 /*) value="$ansexp" ;;
4143 [a-zA-Z]:/*) value="$ansexp" ;;
4148 echo "I shall only accept a full path name, as in /bin/ls." >&4
4149 echo "Use a ! shell escape if you wish to check pathnames." >&4
4152 echo "Please give a full path name, starting with slash." >&4
4155 echo "Note that using ~name is ok provided it expands well." >&4
4168 for fp in $gfpth; do
4169 if test "X$fp" = X.; then
4174 if test -f "$pf"; then
4176 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4178 echo "($value is not a plain file, but that's ok.)"
4181 if test X"$type" = X; then
4188 for fp in $gfpth; do
4189 if test "X$fp" = X.; then
4194 direxp="$fp/$ansexp"
4196 if test -d "$direxp"; then
4204 if test -d "$ansexp"; then
4205 echo "(Looking for $loc_file in directory $value.)"
4206 value="$value/$loc_file"
4207 ansexp="$ansexp/$loc_file"
4209 if test -f "$ansexp"; then
4212 case "$nopath_ok" in
4213 true) case "$value" in
4215 *) echo "Assuming $value will be in people's path."
4231 if test "$fastread" = yes; then
4236 rp="$what $value doesn't exist. Use that name anyway?"
4255 test "X$gfpthkeep" != Xy && gfpth=""
4258 : What should the include directory be ?
4260 $echo $n "Hmm... $c"
4264 if $test -f /bin/mips && /bin/mips; then
4265 echo "Looks like a MIPS system..."
4266 $cat >usr.c <<'EOCP'
4267 #ifdef SYSTYPE_BSD43
4271 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4272 dflt='/bsd43/usr/include'
4276 mips_type='System V'
4278 $rm -f usr.c usr.out
4279 echo "and you're compiling with the $mips_type compiler and libraries."
4283 echo "Doesn't look like a MIPS system."
4293 case "$xxx_prompt" in
4296 rp='Where are the include files you want to use?'
4304 : see how we invoke the C preprocessor
4306 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4307 cat <<'EOT' >testcpp.c
4313 if test ! -f cppstdin; then
4314 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4315 # AIX cc -E doesn't show the absolute headerfile
4316 # locations but we'll cheat by using the -M flag.
4317 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
4319 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4322 echo "Keeping your $hint cppstdin wrapper."
4325 wrapper=`pwd`/cppstdin
4329 if $test "X$cppstdin" != "X" && \
4330 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4331 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4333 echo "You used to use $cppstdin $cppminus so we'll use that again."
4335 '') echo "But let's see if we can live without a wrapper..." ;;
4337 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4338 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4340 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4343 echo "(However, $cpprun $cpplast does not work, let's see...)"
4351 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4358 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4359 $cc -E <testcpp.c >testcpp.out 2>&1; \
4360 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4361 echo "Yup, it does."
4364 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4365 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4366 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4367 echo "Yup, it does."
4370 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4371 $cc -P <testcpp.c >testcpp.out 2>&1; \
4372 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4373 echo "Yipee, that works!"
4376 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4377 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4378 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4379 echo "At long last!"
4382 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4383 $cpp <testcpp.c >testcpp.out 2>&1; \
4384 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4388 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4389 $cpp - <testcpp.c >testcpp.out 2>&1; \
4390 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4391 echo "Hooray, it works! I was beginning to wonder."
4394 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4395 $wrapper <testcpp.c >testcpp.out 2>&1; \
4396 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4402 rp="No dice. I can't find a C preprocessor. Name one:"
4406 $x_cpp <testcpp.c >testcpp.out 2>&1
4407 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4408 echo "OK, that will do." >&4
4410 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4425 echo "Perhaps can we force $cc -E using a wrapper..."
4426 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4427 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4433 echo "Nope, we'll have to live without it..."
4447 "$wrapper"|'cppstdin') ;;
4448 *) $rm -f $wrapper;;
4450 $rm -f testcpp.c testcpp.out
4452 : Set private lib path
4455 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4460 '') dlist="$loclibpth $plibpth $glibpth";;
4461 *) dlist="$libpth";;
4464 : Now check and see which directories actually exist, avoiding duplicates
4468 if $test -d $xxx; then
4471 *) libpth="$libpth $xxx";;
4477 Some systems have incompatible or broken versions of libraries. Among
4478 the directories listed in the question below, please remove any you
4479 know not to be holding relevant libraries, and add any that are needed.
4480 Say "none" for none.
4491 rp="Directories to use for library searches?"
4498 : compute shared library extension
4501 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4511 On some systems, shared libraries may be available. Answer 'none' if
4512 you want to suppress searching of shared libraries for the remainder
4513 of this configuration.
4516 rp='What is the file extension used for shared libraries?'
4520 : Define several unixisms.
4521 : Hints files or command line option can be used to override them.
4522 : The convoluted testing is in case hints files set either the old
4525 '') case "$exe_ext" in
4527 *) _exe="$exe_ext" ;;
4532 '') case "$lib_ext" in
4539 '') case "$obj_ext" in
4546 '') case "$path_sep" in
4557 : Which makefile gets called first. This is used by make depend.
4558 case "$firstmakefile" in
4559 '') firstmakefile='makefile';;
4563 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4566 case "$uselongdouble" in
4567 $define|true|[yY]*) dflt='y';;
4572 Perl can be built to take advantage of long doubles which
4573 (if available) may give more accuracy and range for floating point numbers.
4575 If this doesn't make any sense to you, just accept the default '$dflt'.
4577 rp='Try to use long doubles if available?'
4580 y|Y) val="$define" ;;
4586 case "$uselongdouble" in
4587 true|[yY]*) uselongdouble="$define" ;;
4590 : Look for a hint-file generated 'call-back-unit'. If the
4591 : user has specified that long doubles should be used,
4592 : we may need to set or change some other defaults.
4593 if $test -f uselongdouble.cbu; then
4594 echo "Your platform has some specific hints regarding long doubles, using them..."
4595 . ./uselongdouble.cbu
4597 case "$uselongdouble" in
4600 (Your platform does not have any specific hints for long doubles.)
4606 : Looking for optional libraries
4608 echo "Checking for optional libraries..." >&4
4613 case "$libswanted" in
4614 '') libswanted='c_s';;
4617 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4623 for thisdir in $libpth $xlibpth; do
4624 test -d $thisdir && libspath="$libspath $thisdir"
4626 for thislib in $libswanted; do
4627 for thisdir in $libspath; do
4629 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4630 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4631 $test -f "$xxx" && eval $libscheck
4632 $test -f "$xxx" && libstyle=shared
4634 if test ! -f "$xxx"; then
4635 xxx=$thisdir/lib$thislib.$so
4636 $test -f "$xxx" && eval $libscheck
4637 $test -f "$xxx" && libstyle=shared
4639 if test ! -f "$xxx"; then
4640 xxx=$thisdir/lib$thislib$_a
4641 $test -f "$xxx" && eval $libscheck
4642 $test -f "$xxx" && libstyle=static
4644 if test ! -f "$xxx"; then
4645 xxx=$thisdir/$thislib$_a
4646 $test -f "$xxx" && eval $libscheck
4647 $test -f "$xxx" && libstyle=static
4649 if test ! -f "$xxx"; then
4650 xxx=$thisdir/lib${thislib}_s$_a
4651 $test -f "$xxx" && eval $libscheck
4652 $test -f "$xxx" && libstyle=static
4653 $test -f "$xxx" && thislib=${thislib}_s
4655 if test ! -f "$xxx"; then
4656 xxx=$thisdir/Slib$thislib$_a
4657 $test -f "$xxx" && eval $libscheck
4658 $test -f "$xxx" && libstyle=static
4660 if $test -f "$xxx"; then
4662 shared) echo "Found -l$thislib (shared)." ;;
4663 static) echo "Found -l$thislib." ;;
4664 *) echo "Found -l$thislib ($libstyle)." ;;
4668 *) dflt="$dflt -l$thislib"
4669 libsfound="$libsfound $xxx"
4671 libsfiles="$libsfiles $yyy"
4672 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4673 case " $libsdirs " in
4675 *) libsdirs="$libsdirs $yyy" ;;
4682 if $test ! -f "$xxx"; then
4683 echo "No -l$thislib."
4694 ' '|'') dflt='none';;
4699 In order to compile $package on your machine, a number of libraries
4700 are usually needed. Include any other special libraries here as well.
4701 Say "none" for none. The default list is almost always right.
4705 rp="What libraries to use?"
4712 : determine optimization, if desired, or use for debug flag also
4714 ' '|$undef) dflt='none';;
4716 *) dflt="$optimize";;
4720 By default, $package compiles with the -O flag to use the optimizer.
4721 Alternately, you might want to use the symbolic debugger, which uses
4722 the -g flag (on traditional Unix systems). Either flag can be
4723 specified here. To use neither flag, specify the word "none".
4726 rp="What optimizer/debugger flag should be used?"
4730 'none') optimize=" ";;
4734 : We will not override a previous value, but we might want to
4735 : augment a hint file
4737 default|recommended)
4738 case "$gccversion" in
4739 1*) dflt='-fpcc-struct-return' ;;
4742 *-g*) dflt="$dflt -DDEBUGGING";;
4744 case "$gccversion" in
4745 2*) if test -d /etc/conf/kconfig.d &&
4746 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4748 # Interactive Systems (ISC) POSIX mode.
4753 case "$gccversion" in
4757 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4758 echo 'int main(void) { return 0; }' > gcctest.c
4759 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4760 echo "Yes, it does." 2>&1
4763 echo "Leaving current flags $ccflags alone." 2>&1
4765 *) dflt="$dflt -fno-strict-aliasing" ;;
4768 echo "Nope, it doesn't, but that's ok." 2>&1
4772 # For gcc, adding -pipe speeds up compilations for some, but apparently
4773 # some assemblers can't read from stdin. (It also slows down compilations
4774 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4775 case "$gccversion" in
4777 echo "Checking if your compiler accepts -pipe" 2>&1
4778 echo 'int main(void) { return 0; }' > gcctest.c
4779 if $cc -pipe -o gcctest gcctest.c; then
4780 echo "Yes, it does." 2>&1
4783 echo "Leaving current flags $ccflags alone." 2>&1
4785 *) dflt="$dflt -pipe" ;;
4788 echo "Nope, it doesn't, but that's ok." 2>&1
4791 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4792 echo 'int main(void) { return 0; }' > gcctest.c
4793 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4794 echo "Yes, it does." 2>&1
4796 *-Wdeclaration-after-statement*)
4797 echo "Leaving current flags $ccflags alone." 2>&1
4799 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4802 echo "Nope, it doesn't, but that's ok." 2>&1