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 Mon Sep 12 15:44:06 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=''
400 endhostent_r_proto=''
406 endprotoent_r_proto=''
412 endservent_r_proto=''
463 gethostbyaddr_r_proto=''
465 gethostbyname_r_proto=''
467 gethostent_r_proto=''
479 getnetbyaddr_r_proto=''
481 getnetbyname_r_proto=''
495 d_getprotobyname_r=''
496 getprotobyname_r_proto=''
497 d_getprotobynumber_r=''
498 getprotobynumber_r_proto=''
500 getprotoent_r_proto=''
512 getservbyname_r_proto=''
514 getservbyport_r_proto=''
516 getservent_r_proto=''
540 d_libm_lib_version=''
553 d_malloc_good_size=''
595 d_old_pthread_create_joinable=''
596 old_pthread_create_joinable=''
598 d_pthread_attr_setscope=''
637 sethostent_r_proto=''
654 setprotoent_r_proto=''
666 setservent_r_proto=''
711 d_stdio_ptr_lval_nochange_cnt=''
712 d_stdio_ptr_lval_sets_cnt=''
915 inc_version_list_init=''
934 ignore_versioned_solibs=''
994 d_perl_otherlibdirs=''
1002 api_versionstring=''
1008 version_patchlevel_string=''
1012 d_nv_preserves_uv=''
1013 d_nv_zero_is_allbits_zero=''
1024 nv_preserves_uv_bits=''
1095 installsitehtml1dir=''
1098 installsitehtml3dir=''
1105 installsiteman1dir=''
1108 installsiteman3dir=''
1113 installsitescript=''
1128 d_stdio_stream_array=''
1129 stdio_stream_array=''
1140 ccflags_uselargefiles=''
1141 ldflags_uselargefiles=''
1142 libswanted_uselargefiles=''
1152 userelocatableinc=''
1163 installvendorarch=''
1170 installvendorhtml1dir=''
1172 vendorhtml1direxp=''
1173 installvendorhtml3dir=''
1175 vendorhtml3direxp=''
1181 installvendorman1dir=''
1184 installvendorman3dir=''
1191 installvendorscript=''
1203 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1206 : We must find out about Eunice early
1208 if test -f /etc/unixtovms; then
1209 eunicefix=/etc/unixtovms
1211 if test -f /etc/unixtovms.exe; then
1212 eunicefix=/etc/unixtovms.exe
1215 : Set executable suffix now -- needed before hints available
1216 if test -f "/libs/version.library"; then
1219 elif test -f "/system/gnu_library/bin/ar.pm"; then
1222 elif test -n "$DJGPP"; then
1225 elif test -d c:/. -o -n "$is_os2" ; then
1234 : set useposix=false in your hint file to disable the POSIX extension.
1236 : set useopcode=false in your hint file to disable the Opcode extension.
1238 : Trailing extension. Override this in a hint file, if needed.
1239 : Extra object files, if any, needed on this platform.
1242 : Possible local include directories to search.
1243 : Set locincpth to "" in a hint file to defeat local include searches.
1244 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1245 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1247 : no include file wanted by default
1252 : change the next line if compiling for Xenix/286 on Xenix/386
1253 xlibpth='/usr/lib/386 /lib/386'
1254 : Possible local library directories to search.
1255 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1256 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1258 : general looking path for locating libraries
1259 glibpth="/lib /usr/lib $xlibpth"
1260 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1261 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1262 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1264 : Private path used by Configure to find libraries. Its value
1265 : is prepended to libpth. This variable takes care of special
1266 : machines, like the mips. Usually, it should be empty.
1269 : default library list
1271 : some systems want to use only the non-versioned libso:s
1272 ignore_versioned_solibs=''
1277 ccflags_uselargefiles=''
1278 ldflags_uselargefiles=''
1279 libswanted_uselargefiles=''
1280 : set usemultiplicity on the Configure command line to enable multiplicity.
1281 : set usesocks on the Configure command line to enable socks.
1282 : set usethreads on the Configure command line to enable threads.
1283 usereentrant='undef'
1284 : full support for void wanted by default
1287 : List of libraries we want.
1288 : If anyone needs extra -lxxx, put those in a hint file.
1289 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1290 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1291 : We probably want to search /usr/shlib before most other libraries.
1292 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1293 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1294 glibpth="/usr/shlib $glibpth"
1295 : Do not use vfork unless overridden by a hint file.
1298 : Find the basic shell for Bourne shell scripts
1302 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1305 if test -f "$xxx"; then
1308 : Build up a list and do a single loop so we can 'break' out.
1309 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1310 for xxx in sh bash ksh pdksh ash; do
1312 try="$try ${p}/${xxx}"
1316 if test -f "$xxx"; then
1319 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1322 elif test -f "$xxx.exe"; then
1333 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1335 Usually it's in /bin/sh. How did you even get this far?
1336 Please contact me (Perl Maintainers) at perlbug@perl.org and
1337 we'll try to straighten this all out.
1343 : see if sh knows # comments
1344 if `$sh -c '#' >/dev/null 2>&1`; then
1348 test -f $xcat$_exe || xcat=/usr/bin/cat
1349 if test ! -f $xcat$_exe; then
1350 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1351 if test -f $p/cat$_exe; then
1356 if test ! -f $xcat$_exe; then
1357 echo "Can't find cat anywhere!"
1361 echo "#!$xcat" >sharp
1365 if test -s today; then
1368 echo "#! $xcat" > sharp
1372 if test -s today; then
1380 echo "Your $sh doesn't grok # comments--I will strip them later on."
1383 echo "exec grep -v '^[ ]*#'" >spitshell
1385 $eunicefix spitshell
1386 spitshell=`pwd`/spitshell
1388 echo "I presume that if # doesn't work, #! won't work either!"
1393 : figure out how to guarantee sh startup
1395 '') startsh=${sharpbang}${sh} ;;
1407 : echo "Yup, it does."
1409 echo "Hmm... '$startsh' does not guarantee sh startup..."
1410 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1415 : Save command line options in file UU/cmdline.opt for later use in
1416 : generating config.sh.
1417 cat > cmdline.opt <<EOSH
1418 # Configure command line arguments.
1427 cat >>cmdline.opt <<EOSH
1428 config_arg$argn='$arg'
1430 # Extreme backslashitis: replace each ' by '"'"'
1431 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1434 arg_exp=`cat cmdl.opt`
1435 args_exp="$args_exp$args_sep'$arg_exp'"
1436 argn=`expr $argn + 1`
1439 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1440 # used by ./hints/os2.sh
1443 : produce awk script to parse command line options
1444 cat >options.awk <<'EOF'
1446 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1448 len = length(optstr);
1449 for (i = 1; i <= len; i++) {
1450 c = substr(optstr, i, 1);
1451 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1462 if (substr(str, 1, 1) != "-") {
1463 printf("'%s'\n", str);
1467 for (i = 2; i <= len; i++) {
1468 c = substr(str, i, 1);
1470 printf("-%s\n", substr(str, i));
1476 printf("'%s'\n", substr(str, i + 1));
1489 : process the command line options
1490 set X `for arg in "$@"; do echo "X$arg"; done |
1491 sed -e s/X// | awk -f options.awk`
1496 : set up default values
1506 rm -f optdef.sh posthint.sh
1507 cat >optdef.sh <<EOS
1513 while test $# -gt 0; do
1515 -d) shift; fastread=yes;;
1516 -e) shift; alldone=cont;;
1520 if test -r "$1"; then
1523 echo "$me: cannot read config file $1." >&2
1528 -h) shift; error=true;;
1529 -r) shift; reuseval=true;;
1530 -s) shift; silent=true; realsilent=true;;
1531 -E) shift; alldone=exit;;
1532 -K) shift; knowitall=true;;
1533 -O) shift; override=true;;
1534 -S) shift; silent=true; extractsh=true;;
1539 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1540 echo "$me: ignoring -D $1" >&2
1543 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1544 *) echo "$1='define'" >> optdef.sh;;
1551 *=) echo "$1" >> optdef.sh;;
1553 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1554 echo "$me: ignoring -U $1" >&2
1556 *) echo "$1='undef'" >> optdef.sh;;
1567 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1571 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1572 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1578 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1579 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1580 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1581 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1582 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1583 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1589 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1591 echo "$yyy=''" >> posthint.sh ;;
1596 echo "$yyy='$zzz'" >> posthint.sh ;;
1598 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1600 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1605 echo "$yyy=$zzz" >> posthint.sh ;;
1606 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1610 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1613 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1621 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1622 [-U symbol] [-U symbol=] [-A command:symbol...]
1623 -d : use defaults for all answers.
1624 -e : go on without questioning past the production of config.sh.
1625 -f : specify an alternate default configuration file.
1626 -h : print this help message and exit (with an error status).
1627 -r : reuse C symbols value if possible (skips costly nm extraction).
1628 -s : silent mode, only echoes questions and essential information.
1629 -D : define symbol to have some value:
1630 -D symbol symbol gets the value 'define'
1631 -D symbol=value symbol gets the value 'value'
1632 -E : stop at the end of questions, after having produced config.sh.
1633 -K : do not use unless you know what you are doing.
1634 -O : let -D and -U override definitions from loaded configuration file.
1635 -S : perform variable substitutions on all .SH files (can mix with -f)
1636 -U : undefine symbol:
1637 -U symbol symbol gets the value 'undef'
1638 -U symbol= symbol gets completely empty
1639 -A : manipulate symbol after the platform specific hints have been applied:
1640 -A symbol=value append " "value to symbol
1641 -A append:symbol=value append value to symbol
1642 -A define:symbol=value define symbol to have value
1643 -A clear:symbol define symbol to be ''
1644 -A define:symbol define symbol to be 'define'
1645 -A eval:symbol=value define symbol to be eval of value
1646 -A prepend:symbol=value prepend value to symbol
1647 -A undef:symbol define symbol to be 'undef'
1648 -A undef:symbol= define symbol to be ''
1649 -V : print version number and exit (with a zero status).
1656 case "$fastread$alldone" in
1659 case "$extractsh" in
1662 if test ! -t 0; then
1663 echo "Say 'sh Configure', not 'sh <Configure'"
1673 true) exec 1>/dev/null;;
1676 : run the defines and the undefines, if any, but leave the file out there...
1679 : create the posthint manipulation script and leave the file out there...
1684 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1685 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1686 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1687 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1688 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1691 : Some greps do not return status, grrr.
1692 echo "grimblepritz" >grimble
1693 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1695 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1701 : the following should work in any shell
1705 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1706 cat >contains <<'EOSS'
1707 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1712 : Find the path to the source tree
1715 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1719 *) src=`cd ../$src && pwd` ;;
1732 if test -f $rsrc/Configure && \
1733 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1735 : found it, so we are ok.
1738 for src in . .. ../.. ../../.. ../../../..; do
1739 if test -f ../$src/Configure && \
1740 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1751 Sorry, I can't seem to locate the source dir for $package. Please start
1752 Configure with an explicit path -- i.e. /some/path/Configure.
1760 echo "Sources for $package found in \"$src\"." >&4
1764 : script used to extract .SH files with variable substitutions
1765 cat >extract <<'EOS'
1767 echo "Doing variable substitutions on .SH files..."
1768 if test -f MANIFEST; then
1769 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1771 echo "(Looking for .SH files under the source directory.)"
1772 set x `(cd "$src"; find . -name "*.SH" -print)`
1776 0) set x `(cd "$src"; echo *.SH)`; shift;;
1778 if test ! -f "$src/$1"; then
1784 while test $name; do
1785 if test ! -d "$name"; then
1786 create="$name $create";
1787 name=`echo $name | sed -e "s|^[^/]*$||"`;
1788 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1793 for file in $create; do
1802 dir=`expr X$file : 'X\(.*\)/'`
1803 file=`expr X$file : 'X.*/\(.*\)'`
1804 (cd "$dir" && . ./$file)
1814 dir=`expr X$file : 'X\(.*\)/'`
1815 file=`expr X$file : 'X.*/\(.*\)'`
1816 (set x $dir; shift; eval $mkdir_p)
1817 sh <"$src/$dir/$file"
1826 if test -f "$src/config_h.SH"; then
1827 if test ! -f config.h; then
1828 : oops, they left it out of MANIFEST, probably, so do it anyway.
1829 . "$src/config_h.SH"
1834 : extract files and exit if asked to do so
1835 case "$extractsh" in
1837 case "$realsilent" in
1841 case "$config_sh" in
1842 '') config_sh='config.sh';;
1845 echo "Fetching answers from $config_sh..."
1848 test "$override" && . ./optdef.sh
1852 echo "Extraction done."
1857 : Eunice requires " " instead of "", can you believe it
1860 echo "Beginning of configuration questions for $package."
1862 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1864 : first determine how to suppress newline on echo command
1866 echo "Checking echo to see how to suppress newlines..."
1867 (echo "hi there\c" ; echo " ") >.echotmp
1868 if $contains c .echotmp >/dev/null 2>&1 ; then
1879 echo $n "The star should be here-->$c"
1883 : Now test for existence of everything in MANIFEST
1885 if test -f "$rsrc/MANIFEST"; then
1886 echo "First let's make sure your kit is complete. Checking..." >&4
1887 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1890 for filelist in x??; do
1891 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1893 if test -s missing; then
1897 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1899 You have the option of continuing the configuration process, despite the
1900 distinct possibility that your kit is damaged, by typing 'y'es. If you
1901 do, don't blame me if something goes wrong. I advise you to type 'n'o
1902 and contact the author (perlbug@perl.org).
1905 echo $n "Continue? [n] $c" >&4
1909 echo "Continuing..." >&4
1913 echo "ABORTING..." >&4
1918 echo "Looks good..."
1921 echo "There is no MANIFEST file. I hope your kit is complete !"
1926 : Find the appropriate value for a newline for tr
1927 if test -n "$DJGPP"; then
1930 if test X"$trnl" = X; then
1931 case "`echo foo|tr '\n' x 2>/dev/null`" in
1935 if test X"$trnl" = X; then
1936 case "`echo foo|tr '\012' x 2>/dev/null`" in
1937 foox) trnl='\012' ;;
1940 if test X"$trnl" = X; then
1941 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1942 fooxy) trnl='\n\r' ;;
1945 if test X"$trnl" = X; then
1948 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1954 : compute the number of columns on the terminal for proper question formatting
1959 : set up the echo used in my read
1960 myecho="case \"\$xxxm\" in
1961 '') echo $n \"\$rp $c\" >&4;;
1963 '') echo $n \"[\$xxxm] $c\";;
1965 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1967 echo $n \"[\$xxxm] $c\" >&4
1969 echo $n \"\$rp [\$xxxm] $c\" >&4
1975 : now set up to do reads with possible shell escape and default assignment
1981 case "\$fastread" in
1982 yes) case "\$dflt" in
1985 case "\$silent-\$rp" in
1990 *) case "\$silent" in
1991 true) case "\$rp" in
1996 while expr "X\$ans" : "X!" >/dev/null; do
2000 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2008 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2017 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2022 echo "(OK, I'll run with -d after this question.)" >&4
2025 echo "*** Sorry, \$1 not supported yet." >&4
2035 echo "*** Substitution done -- please confirm."
2037 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2042 echo "*** Error -- try again."
2049 case "\$ans\$xxxm\$nostick" in
2061 : create .config dir to save info across Configure sessions
2062 test -d ../.config || mkdir ../.config
2063 cat >../.config/README <<EOF
2064 This directory created by Configure to save information that should
2065 persist across sessions for $package.
2067 You may safely delete it if you wish.
2070 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2072 $define|true|[yY]*) ;;
2073 *) case "$xversion" in
2076 *** WHOA THERE!!! ***
2078 This is an UNSTABLE DEVELOPMENT release.
2079 The version of this $package distribution is $xversion, that is, odd,
2080 (as opposed to even) and that signifies a development release.
2081 If you want a maintenance release, you want an even-numbered version.
2083 Do ***NOT*** install this into production use.
2084 Data corruption and crashes are possible.
2086 It is most seriously suggested that you do not continue any further
2087 unless you want to help in developing and debugging Perl.
2089 If you *still* want to build perl, you can answer 'y' now,
2090 or pass -Dusedevel to Configure.
2093 rp='Do you really want to continue?'
2097 [yY]) echo >&4 "Okay, continuing."
2098 usedevel="$define" ;;
2099 *) echo >&4 "Okay, bye."
2109 case "$versiononly" in
2110 '') versiononly="$define" ;;
2112 case "$installusrbinperl" in
2113 '') installusrbinperl="$undef" ;;
2118 : general instructions
2121 user=`(logname) 2>/dev/null`
2123 '') user=`whoami 2>&1`;;
2125 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2128 rp='Would you like to see the instructions?'
2139 This installation shell script will examine your system and ask you questions
2140 to determine how the perl5 package should be installed. If you get
2141 stuck on a question, you may use a ! shell escape to start a subshell or
2142 execute a command. Many of the questions will have default answers in square
2143 brackets; typing carriage return will give you the default.
2145 On some of the questions which ask for file or directory names you are allowed
2146 to use the ~name construct to specify the login directory belonging to "name",
2147 even if you don't have a shell which knows about that. Questions where this is
2148 allowed will be marked "(~name ok)".
2152 dflt='Type carriage return to continue'
2156 The prompter used in this script allows you to use shell variables and
2157 backticks in your answers. You may use $1, $2, etc... to refer to the words
2158 in the default answer, as if the default line was a set of arguments given to a
2159 script shell. This means you may also use $* to repeat the whole default line,
2160 so you do not have to re-type everything to add something to the default.
2162 Everytime there is a substitution, you will have to confirm. If there is an
2163 error (e.g. an unmatched backtick), the default answer will remain unchanged
2164 and you will be prompted again.
2166 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2167 the questions and use the computed defaults (or the previous answers if there
2168 was already a config.sh file). Type 'Configure -h' for a list of options.
2169 You may also start interactively and then answer '& -d' at any prompt to turn
2170 on the non-interactive behaviour for the remainder of the execution.
2176 Much effort has been expended to ensure that this shell script will run on any
2177 Unix system. If despite that it blows up on yours, your best bet is to edit
2178 Configure and run it again. If you can't run Configure for some reason,
2179 you'll have to generate a config.sh file by hand. Whatever problems you
2180 have, let me (perlbug@perl.org) know how I blew it.
2182 This installation script affects things in two ways:
2184 1) it may do direct variable substitutions on some of the files included
2186 2) it builds a config.h file for inclusion in C programs. You may edit
2187 any of these files as the need arises after running this script.
2189 If you make a mistake on a question, there is no easy way to back up to it
2190 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2191 files. Configure will offer to let you do this before it runs the SH files.
2194 dflt='Type carriage return to continue'
2196 case "$firsttime" in
2197 true) echo $user >>../.config/instruct;;
2201 : find out where common programs are
2203 echo "Locating common programs..." >&4
2216 if test -d \$dir/\$thing; then
2222 for thisthing in \$dir/\$thing; do
2223 : just loop through to pick last item
2225 if test -f \$thisthing; then
2228 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2231 elif test -f \$dir/\$thing.exe; then
2232 if test -n "$DJGPP"; then
2233 echo \$dir/\$thing.exe
2234 elif test "$eunicefix" != ":"; then
2235 : on Eunice apparently
2289 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2290 pth="$pth /lib /usr/lib"
2291 for file in $loclist; do
2295 if test -f "$xxx"; then
2298 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2299 xxx=`./loc $file $file $pth`
2302 '') xxx=`./loc $file $file $pth`;;
2303 *) xxx=`./loc $xxx $xxx $pth`;;
2305 eval $file=$xxx$_exe
2309 echo $file is in $xxx.
2312 echo $file is in $xxx.
2315 echo "I don't know where '$file' is, and my life depends on it." >&4
2316 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2322 echo "Don't worry if any of the following aren't found..."
2324 for file in $trylist; do
2328 if test -f "$xxx"; then
2331 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2332 xxx=`./loc $file $file $pth`
2335 '') xxx=`./loc $file $file $pth`;;
2336 *) xxx=`./loc $xxx $xxx $pth`;;
2338 eval $file=$xxx$_exe
2342 echo $file is in $xxx.
2345 echo $file is in $xxx.
2348 echo "I don't see $file out there, $say."
2355 echo "Substituting grep for egrep."
2362 echo "Substituting cp for ln."
2371 echo "I can't find make or gmake, and my life depends on it." >&4
2372 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2380 *) # We can't have osname yet.
2381 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2382 # Assume that gmake, if found, is definitely GNU make
2383 # and prefer it over the system make.
2384 echo "Substituting gmake for make."
2392 echo "Hopefully test is built into your sh."
2395 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2396 echo "Using the test built into your sh."
2404 echo "Hopefully echo is built into your sh."
2409 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2410 $echo $n "hi there$c" >foo1
2411 echo $n "hi there$c" >foo2
2412 if cmp foo1 foo2 >/dev/null 2>&1; then
2413 echo "They are compatible. In fact, they may be identical."
2420 They are not compatible! You are probably running ksh on a non-USG system.
2421 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2422 have echo built in and we may have to run some Bourne shell scripts. That
2423 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2426 $echo $n "The star should be here-->$c"
2436 cat <<'EOSC' >>trygcc
2441 int main(int argc, char *argv[]) {
2445 if $cc -o try $ccflags $ldflags try.c; then
2448 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2454 case "`$cc -v -c try.c 2>&1`" in
2457 if $test X"$trygcc" = Xyes; then
2458 if gcc -o try -c try.c; then
2460 echo "You seem to have a working gcc, though." >&4
2461 rp="Would you like to use it?"
2463 if $test -f myread; then
2466 if $test -f UU/myread; then
2469 echo "Cannot find myread, sorry. Aborting." >&2
2474 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2475 if $test -f usethreads.cbu; then
2478 *** However, any setting of the C compiler flags (e.g. for thread support)
2479 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2480 *** (together with e.g. -Dusethreads).
2496 cat <<'EOSC' >>checkcc
2501 int main(int argc, char *argv[]) {
2505 if $cc -o try $ccflags $ldflags try.c; then
2508 if $test X"$despair" = Xyes; then
2509 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2512 You need to find a working C compiler.
2513 Either (purchase and) install the C compiler supplied by your OS vendor,
2514 or for a free C compiler try http://gcc.gnu.org/
2515 I cannot continue any further, aborting.
2524 : determine whether symbolic links are supported
2527 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2528 echo "Symbolic links are supported." >&4
2531 echo "Symbolic links are NOT supported." >&4
2536 : determine whether symbolic links are supported
2540 echo "Checking how to test for symbolic links..." >&4
2542 if $test "X$issymlink" = X; then
2544 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2545 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2547 if test $? = 0; then
2550 echo "Your builtin 'test -h' may be broken." >&4
2553 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2556 if test -f "$p/$test"; then
2565 echo "Trying external '$test -h'." >&4
2566 issymlink="$test -h"
2567 if $test ! -h sym >/dev/null 2>&1; then
2568 echo "External '$test -h' is broken, too." >&4
2576 if $test "X$issymlink" = X; then
2577 if $test -L sym 2>/dev/null; then
2578 issymlink="$test -L"
2579 echo "The builtin '$test -L' worked." >&4
2582 if $test "X$issymlink" != X; then
2583 echo "You can test for symbolic links with '$issymlink'." >&4
2585 echo "I do not know how you can test for symbolic links." >&4
2589 *) echo "No symbolic links, so not testing for their testing..." >&4
2595 case "$mksymlinks" in
2598 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2601 *) case "$lns:$issymlink" in
2602 *"ln"*" -s:"*"test -"?)
2603 echo "Creating the symbolic links..." >&4
2604 echo "(First creating the subdirectories...)" >&4
2606 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2608 test -z "$directory" && break
2612 if test ! -d t/base; then
2613 echo "Failed to create the subdirectories. Aborting." >&4
2616 echo "(Then creating the symlinks...)" >&4
2617 awk '{print $1}' $src/MANIFEST | while true; do
2619 test -z "$filename" && break
2620 if test -f $filename; then
2621 if $issymlink $filename; then
2625 if test -f $filename; then
2626 echo "$filename already exists, not symlinking."
2628 ln -s $src/$filename $filename
2632 if test ! -f t/base/lex.t; then
2633 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2638 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2647 case "$usecrosscompile" in
2649 $echo "Cross-compiling..."
2652 *-*-gcc) # A cross-compiling gcc, probably.
2653 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2655 # leave out ld, choosing it is more complex
2657 ranlib=$targetarch-ranlib
2658 $echo 'extern int foo;' > try.c
2659 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2661 if $test $# -gt 0; then
2663 incpth="`$echo $incpth|$sed 's/^ //'`"
2664 echo "Guessing incpth '$incpth'." >&4
2666 j="`$echo $i|$sed 's,/include$,/lib,'`"
2667 if $test -d $j; then
2671 libpth="`$echo $libpth|$sed 's/^ //'`"
2672 echo "Guessing libpth '$libpth'." >&4
2677 case "$targetarch" in
2678 '') echo "Targetarch not defined." >&4; croak=y ;;
2679 *) echo "Using targetarch $targetarch." >&4 ;;
2682 '') echo "Incpth not defined." >&4; croak=y ;;
2683 *) echo "Using incpth '$incpth'." >&4 ;;
2686 '') echo "Libpth not defined." >&4; croak=y ;;
2687 *) echo "Using libpth '$libpth'." >&4 ;;
2690 '') for i in $incpth; do
2691 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2693 echo "Guessing usrinc $usrinc." >&4
2698 '') echo "Usrinc not defined." >&4; croak=y ;;
2701 *) echo "Using usrinc $usrinc." >&4 ;;
2703 case "$targethost" in
2704 '') echo "Targethost not defined." >&4; croak=y ;;
2705 *) echo "Using targethost $targethost." >&4
2710 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2713 /*) run=$src/Cross/run
2714 targetmkdir=$src/Cross/mkdir
2716 from=$src/Cross/from
2718 *) pwd=`$test -f ../Configure & cd ..; pwd`
2720 targetmkdir=$pwd/Cross/mkdir
2722 from=$pwd/Cross/from
2725 case "$targetrun" in
2726 '') targetrun=ssh ;;
2731 case "$targetfrom" in
2732 '') targetfrom=scp ;;
2736 from=$from-$targetfrom
2737 case "$targetdir" in
2739 echo "Guessing targetdir $targetdir." >&4
2742 case "$targetuser" in
2744 echo "Guessing targetuser $targetuser." >&4
2747 case "$targetfrom" in
2751 case "$targetrun" in
2763 '') cwd=$targetdir ;;
2767 if $test ! -f \$exe.xok; then
2771 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2774 *) echo "Unknown targetrun '$targetrun'" >&4
2778 case "$targetmkdir" in
2780 cat >$targetmkdir <<EOF
2782 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2784 $chmod a+rx $targetmkdir
2786 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2798 $targetmkdir \`dirname \$f\`
2799 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2802 $targetmkdir $targetdir/\`dirname \$f\`
2803 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2816 $mkdir -p $targetdir/\`dirname \$f\`
2817 $cp \$f $targetdir/\$f || exit 1
2820 $targetmkdir $targetdir/\`dirname \$f\`
2821 $cp \$f $targetdir/\$f || exit 1
2828 *) echo "Unknown targetto '$targetto'" >&4
2832 case "$targetfrom" in
2839 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2844 cp) cat >$from <<EOF
2849 cp $targetdir/\$f . || exit 1
2854 *) echo "Unknown targetfrom '$targetfrom'" >&4
2858 if $test ! -f $run; then
2859 echo "Target 'run' script '$run' not found." >&4
2863 if $test ! -f $to; then
2864 echo "Target 'to' script '$to' not found." >&4
2868 if $test ! -f $from; then
2869 echo "Target 'from' script '$from' not found." >&4
2873 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2877 Using '$run' for remote execution,
2878 and '$from' and '$to'
2879 for remote file transfer.
2885 usecrosscompile='undef'
2890 : see whether [:lower:] and [:upper:] are supported character classes
2892 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2894 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2898 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2899 # (0xd9 and 0xe2), therefore that is a nice testing point.
2900 if test "X$up" = X -o "X$low" = X; then
2901 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2907 if test "X$up" = X -o "X$low" = X; then
2908 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2914 if test "X$up" = X -o "X$low" = X; then
2915 case "`echo RS | od -x 2>/dev/null`" in
2917 echo "Hey, this might be EBCDIC." >&4
2918 if test "X$up" = X -o "X$low" = X; then
2919 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2920 rs) up='[A-IJ-RS-Z]'
2925 if test "X$up" = X -o "X$low" = X; then
2926 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2936 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2938 echo "Using $up and $low to convert case." >&4
2941 echo "I don't know how to translate letters from upper to lower case." >&4
2942 echo "Your tr is not acting any way I know of." >&4
2946 : set up the translation script tr, must be called with ./tr of course
2950 '[A-Z][a-z]') exec $tr '$up' '$low';;
2951 '[a-z][A-Z]') exec $tr '$low' '$up';;
2958 : Try to determine whether config.sh was made on this system
2959 case "$config_sh" in
2961 myuname=`$uname -a 2>/dev/null`
2962 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2963 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2964 # because the A-Z/a-z are not consecutive.
2965 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2966 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2967 newmyuname="$myuname"
2969 case "$knowitall" in
2971 if test -f ../config.sh; then
2972 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2973 eval "`grep myuname= ../config.sh`"
2975 if test "X$myuname" = "X$newmyuname"; then
2983 : Get old answers from old config file if Configure was run on the
2984 : same system, otherwise use the hints.
2987 if test -f config.sh; then
2989 rp="I see a config.sh file. Shall I use it to set the defaults?"
2992 n*|N*) echo "OK, I'll ignore it."
2993 mv config.sh config.sh.old
2994 myuname="$newmyuname"
2996 *) echo "Fetching default answers from your old config.sh file..." >&4
3004 : Older versions did not always set $sh. Catch re-use of such
3014 if test ! -f config.sh; then
3017 First time through, eh? I have some defaults handy for some systems
3018 that need some extra help getting the Configure answers right:
3021 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3023 : Half the following guesses are probably wrong... If you have better
3024 : tests or hints, please send them to perlbug@perl.org
3025 : The metaconfig authors would also appreciate a copy...
3026 $test -f /irix && osname=irix
3027 $test -f /xenix && osname=sco_xenix
3028 $test -f /dynix && osname=dynix
3029 $test -f /dnix && osname=dnix
3030 $test -f /lynx.os && osname=lynxos
3031 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3032 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3033 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3034 $test -f /bin/mips && /bin/mips && osname=mips
3035 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3036 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3037 $test -d /usr/apollo/bin && osname=apollo
3038 $test -f /etc/saf/_sactab && osname=svr4
3039 $test -d /usr/include/minix && osname=minix
3040 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3041 if $test -d /MachTen -o -d /MachTen_Folder; then
3043 if $test -x /sbin/version; then
3044 osvers=`/sbin/version | $awk '{print $2}' |
3045 $sed -e 's/[A-Za-z]$//'`
3046 elif $test -x /usr/etc/version; then
3047 osvers=`/usr/etc/version | $awk '{print $2}' |
3048 $sed -e 's/[A-Za-z]$//'`
3054 $test -f /sys/posix.dll &&
3055 $test -f /usr/bin/what &&
3056 set X `/usr/bin/what /sys/posix.dll` &&
3057 $test "$3" = UWIN &&
3061 if $test -f $uname; then
3069 umips) osname=umips ;;
3072 [23]100) osname=mips ;;
3073 next*) osname=next ;;
3075 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3076 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3079 elif $test -f /etc/kconfig; then
3081 if test "$lns" = "$ln -s"; then
3083 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3085 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3092 if test -n "$DJGPP"; then
3101 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3103 # oslevel can fail with:
3104 # oslevel: Unable to acquire lock.
3105 *not\ found) osvers="$4"."$3" ;;
3106 '<3240'|'<>3240') osvers=3.2.0 ;;
3107 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3108 '=3250'|'>3250') osvers=3.2.5 ;;
3112 bsd386) osname=bsd386
3115 cygwin*) osname=cygwin
3118 *dc.osx) osname=dcosx
3124 domainos) osname=apollo
3130 dynixptx*) osname=dynixptx
3131 osvers=`echo "$4"|sed 's/^v//'`
3133 freebsd) osname=freebsd
3135 genix) osname=genix ;;
3139 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3155 netbsd*) osname=netbsd
3158 news-os) osvers="$3"
3160 4*) osname=newsos4 ;;
3164 next*) osname=next ;;
3165 nonstop-ux) osname=nonstopux ;;
3166 openbsd) osname=openbsd
3172 POSIX-BC | posix-bc ) osname=posix-bc
3175 powerux | power_ux | powermax_os | powermaxos | \
3176 powerunix | power_unix) osname=powerux
3182 solaris) osname=solaris
3184 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3191 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3195 titanos) osname=titanos
3204 ultrix) osname=ultrix
3207 osf1|mls+) case "$5" in
3210 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3213 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3216 hp*) osname=hp_osf1 ;;
3217 mips) osname=mips_osf1 ;;
3220 # UnixWare 7.1.2 is known as Open UNIX 8
3221 openunix|unixware) osname=svr5
3229 $2) case "$osname" in
3233 : svr4.x or possibly later
3243 if test -f /stand/boot ; then
3244 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3245 if test -n "$INITPROG" -a -f "$INITPROG"; then
3246 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3247 if test -n "$isesix"; then
3255 *) if test -f /etc/systemid; then
3257 set `echo $3 | $sed 's/\./ /g'` $4
3258 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3260 elif $test -f $src/hints/sco_$1_$2.sh; then
3262 elif $test -f $src/hints/sco_$1.sh; then
3267 '') : Still unknown. Probably a generic Sys V.
3276 *) case "$osname" in
3277 '') : Still unknown. Probably a generic BSD.
3285 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3286 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3287 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3290 $rm -f UU/kernel.what
3291 elif test -d c:/. -o -n "$is_os2" ; then
3298 case "$targetarch" in
3301 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3306 : Now look for a hint file osname_osvers, unless one has been
3307 : specified already.
3310 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3311 : Also try without trailing minor version numbers.
3312 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3313 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3314 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3315 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3318 *) case "$osvers" in
3321 *) if $test -f $src/hints/$file.sh ; then
3323 elif $test -f $src/hints/$xfile.sh ; then
3325 elif $test -f $src/hints/$xxfile.sh ; then
3327 elif $test -f $src/hints/$xxxfile.sh ; then
3329 elif $test -f $src/hints/$xxxxfile.sh ; then
3331 elif $test -f "$src/hints/${osname}.sh" ; then
3340 if $test -f Policy.sh ; then
3343 none) dflt="Policy" ;;
3344 *) dflt="Policy $dflt" ;;
3349 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3353 if $test -f Policy.sh ; then
3356 There's also a Policy hint file available, which should make the
3357 site-specific (policy) questions easier to answer.
3364 You may give one or more space-separated answers, or "none" if appropriate.
3365 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3366 is a good thing. DO NOT give a wrong version or a wrong OS.
3370 rp="Which of these apply, if any?"
3373 for file in $tans; do
3374 if $test X$file = XPolicy -a -f Policy.sh; then
3376 $cat Policy.sh >> UU/config.sh
3377 elif $test -f $src/hints/$file.sh; then
3378 . $src/hints/$file.sh
3379 $cat $src/hints/$file.sh >> UU/config.sh
3380 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3383 : Give one chance to correct a possible typo.
3384 echo "$file.sh does not exist"
3386 rp="hint to use instead?"
3388 for file in $ans; do
3389 if $test -f "$src/hints/$file.sh"; then
3390 . $src/hints/$file.sh
3391 $cat $src/hints/$file.sh >> UU/config.sh
3392 elif $test X$ans = X -o X$ans = Xnone ; then
3395 echo "$file.sh does not exist -- ignored."
3402 : Remember our hint file for later.
3403 if $test -f "$src/hints/$file.sh" ; then
3413 echo "Fetching default answers from $config_sh..." >&4
3417 cp $config_sh config.sh 2>/dev/null
3427 test "$override" && . ./optdef.sh
3429 : Restore computed paths
3430 for file in $loclist $trylist; do
3431 eval $file="\$_$file"
3436 Configure uses the operating system name and version to set some defaults.
3437 The default value is probably right if the name rings a bell. Otherwise,
3438 since spelling matters for me, either accept the default or answer "none"
3445 ''|' '|none) dflt=none ;;
3446 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3449 *) dflt="$osname" ;;
3451 rp="Operating system name?"
3455 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3461 ''|' '|none) dflt=none ;;
3462 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3463 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3465 ''|' ') dflt=none ;;
3470 *) dflt="$osvers" ;;
3472 rp="Operating system version?"
3482 : who configured the system
3483 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3486 cf_by=`(logname) 2>/dev/null`
3489 cf_by=`(whoami) 2>/dev/null`
3491 "") cf_by=unknown ;;
3496 : set up the script used to warn in case of inconsistency
3503 echo "*** WHOA THERE!!! ***" >&4
3504 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3505 rp=" Keep the $hint value?"
3508 y) td=$was; tu=$was;;
3512 : function used to set $1 to $val
3513 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3515 $define$undef) . ./whoa; eval "$var=\$td";;
3516 $undef$define) . ./whoa; eval "$var=\$tu";;
3517 *) eval "$var=$val";;
3521 $define|true|[yY]*) dflt='y';;
3526 Perl can be built to use the SOCKS proxy protocol library. To do so,
3527 Configure must be run with -Dusesocks. If you use SOCKS you also need
3528 to use the PerlIO abstraction layer, this will be implicitly selected.
3530 If this doesn't make any sense to you, just accept the default '$dflt'.
3532 rp='Build Perl for SOCKS?'
3535 y|Y) val="$define" ;;
3542 $define|true|[yY]*) useperlio="$define";;
3545 case "$useperlio" in
3546 $define|true|[yY]*|'') dflt='y';;
3551 Previous version of $package used the standard IO mechanisms as
3552 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3553 alternate IO mechanisms via the PerlIO abstraction layer, but the
3554 stdio mechanism is still available if needed. The abstraction layer
3555 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3556 Using PerlIO with sfio may cause problems with some extension modules.
3558 If this doesn't make any sense to you, just accept the default '$dflt'.
3560 rp='Use the PerlIO abstraction layer?'
3567 echo "Ok, doing things the stdio way."
3576 case "$useperlio" in
3577 $define|true|[yY]*) ;;
3580 You are using the SOCKS proxy protocol library which means that you
3581 should also use the PerlIO layer. You may be headed for trouble.
3590 case "$usethreads" in
3591 $define|true|[yY]*) dflt='y';;
3592 *) # Catch case where user specified ithreads or 5005threads but
3593 # forgot -Dusethreads (A.D. 4/2002)
3594 case "$useithreads$use5005threads" in
3596 case "$useperlio" in
3597 "$define") dflt='y' ;;
3607 Perl can be built to take advantage of threads on some systems.
3608 To do so, Configure can be run with -Dusethreads.
3610 Note that Perl built with threading support runs slightly slower
3611 and uses more memory than plain Perl. The current implementation
3612 is believed to be stable, but it is fairly new, and so should be
3613 treated with caution.
3615 If this doesn't make any sense to you, just accept the default '$dflt'.
3617 rp='Build a threading Perl?'
3620 y|Y) val="$define" ;;
3626 case "$usethreads" in
3630 Since release 5.6, Perl has had two different threading implementations,
3631 the newer interpreter-based version (ithreads) with one interpreter per
3632 thread, and the older 5.005 version (5005threads).
3633 The 5005threads version is effectively unmaintained and will probably be
3634 removed in Perl 5.10, so there should be no need to build a Perl using it
3635 unless needed for backwards compatibility with some existing 5.005threads
3639 : Default to ithreads unless overridden on command line or with
3642 case "$use5005threads" in
3643 $define|true|[yY]*) dflt='n';;
3645 case "$useithreads" in
3646 $undef|false|[nN]*) dflt='n';;
3648 rp='Use the newer interpreter-based ithreads?'
3651 y|Y) val="$define" ;;
3656 : Now set use5005threads to the opposite value.
3657 case "$useithreads" in
3658 $define) val="$undef" ;;
3665 useithreads="$undef"
3666 use5005threads="$undef"
3670 case "$useithreads$use5005threads" in
3674 You cannot have both the ithreads and the 5.005 threads enabled
3675 at the same time. Disabling the 5.005 threads since they are
3676 much less stable than the ithreads.
3679 use5005threads="$undef"
3683 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3686 *** To build with ithreads you must also use the PerlIO layer.
3687 *** Cannot continue, aborting.
3693 case "$d_oldpthreads" in
3694 '') : Configure tests would be welcome here. For now, assume undef.
3696 *) val="$d_oldpthreads" ;;
3702 : Look for a hint-file generated 'call-back-unit'. If the
3703 : user has specified that a threading perl is to be built,
3704 : we may need to set or change some other defaults.
3705 if $test -f usethreads.cbu; then
3706 echo "Your platform has some specific hints regarding threaded builds, using them..."
3709 case "$usethreads" in
3710 "$define"|true|[yY]*)
3712 (Your platform does not have any specific hints for threaded builds.
3713 Assuming POSIX threads, then.)
3721 Perl can be built so that multiple Perl interpreters can coexist
3722 within the same Perl executable.
3725 case "$useithreads" in
3728 This multiple interpreter support is required for interpreter-based threads.
3732 *) case "$usemultiplicity" in
3733 $define|true|[yY]*) dflt='y';;
3737 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3738 rp='Build Perl for multiplicity?'
3741 y|Y) val="$define" ;;
3750 case "$usemorebits" in
3751 "$define"|true|[yY]*)
3752 use64bitint="$define"
3753 uselongdouble="$define"
3754 usemorebits="$define"
3756 *) usemorebits="$undef"
3760 : make some quick guesses about what we are up against
3762 $echo $n "Hmm... $c"
3772 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3773 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3775 echo "Looks kind of like an OSF/1 system, but we'll see..."
3777 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3778 xxx=`./loc addbib blurfl $pth`
3779 if $test -f $xxx; then
3780 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3784 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3785 echo "Looks kind of like an extended USG system, but we'll see..."
3787 echo "Looks kind of like a USG system, but we'll see..."
3791 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3792 echo "Looks kind of like a BSD system, but we'll see..."
3796 echo "Looks kind of like a Version 7 system, but we'll see..."
3799 case "$eunicefix" in
3802 There is, however, a strange, musty smell in the air that reminds me of
3803 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3807 : it so happens the Eunice I know will not run shell scripts in Unix format
3811 echo "Congratulations. You aren't running Eunice."
3815 : Detect OS2. The p_ variable is set above in the Head.U unit.
3816 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3817 : semicolon as a patch separator
3822 I have the feeling something is not exactly right, however...don't tell me...
3823 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3824 (Or you may be running DOS with DJGPP.)
3829 if test -f /xenix; then
3830 echo "Actually, this looks more like a XENIX system..."
3835 echo "It's not Xenix..."
3840 if test -f /venix; then
3841 echo "Actually, this looks more like a VENIX system..."
3848 echo "Nor is it Venix..."
3851 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3852 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3859 rp="Use which C compiler?"
3863 : See if they have not cc but they do have gcc
3865 : Look for a hint-file generated 'call-back-unit'. Now that the
3866 : user has specified the compiler, we may need to set or change some
3868 if $test -f cc.cbu; then
3874 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3880 printf("%s\n", __VERSION__);
3882 printf("%s\n", "1");
3888 if $cc -o try $ccflags $ldflags try.c; then
3889 gccversion=`$run ./try`
3890 case "$gccversion" in
3891 '') echo "You are not using GNU cc." ;;
3892 *) echo "You are using GNU cc $gccversion."
3898 echo "*** WHOA THERE!!! ***" >&4
3899 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3900 case "$knowitall" in
3902 echo " You'd better start hunting for one and let me know about it." >&4
3908 case "$gccversion" in
3909 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3911 case "$gccversion" in
3912 '') gccosandvers='' ;;
3913 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3914 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3916 case "$gccosandvers" in
3917 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3918 $osname$osvers) ;; # looking good
3919 $osname*) cat <<EOM >&4
3921 *** WHOA THERE!!! ***
3923 Your gcc has not been compiled for the exact release of
3924 your operating system ($gccosandvers versus $osname$osvers).
3926 In general it is a good idea to keep gcc synchronized with
3927 the operating system because otherwise serious problems
3928 may ensue when trying to compile software, like Perl.
3930 I'm trying to be optimistic here, though, and will continue.
3931 If later during the configuration and build icky compilation
3932 problems appear (headerfile conflicts being the most common
3933 manifestation), I suggest reinstalling the gcc to match
3934 your operating system release.
3938 *) gccosandvers='' ;; # failed to parse, better be silent
3946 # gcc 3.* complain about adding -Idirectories that they already know about,
3947 # so we will take those off from locincpth.
3948 case "$gccversion" in
3950 echo "main(){}">try.c
3951 for incdir in $locincpth; do
3952 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3953 grep '^c[cp]p*[01]: warning: changing search order '`
3954 if test "X$warn" != X; then
3955 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3961 : decide how portable to be. Allow command line overrides.
3962 case "$d_portable" in
3964 *) d_portable="$define" ;;
3967 : set up shell script to do ~ expansion
3973 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3976 if $test -f /bin/csh; then
3977 /bin/csh -f -c "glob \$1"
3982 name=\`$expr x\$1 : '..\([^/]*\)'\`
3983 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3984 if $test ! -d "\$dir"; then
3986 echo "\$me: can't locate home directory for: \$name" >&2
3991 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4007 : now set up to get a file name
4011 cat <<'EOSC' >>getfile
4027 : getfile will accept an answer from the comma-separated list
4028 : enclosed in parentheses even if it does not meet other criteria.
4029 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4030 fn=`echo $fn | sed 's/(.*)//'`
4036 loc_file=`expr $fn : '.*:\(.*\)'`
4037 fn=`expr $fn : '\(.*\):.*'`
4045 */*) fullpath=true;;
4054 *e*) exp_file=true;;
4057 *p*) nopath_ok=true;;
4062 *d*) type='Directory';;
4063 *l*) type='Locate';;
4068 Locate) what='File';;
4073 case "$d_portable" in
4081 while test "$type"; do
4086 true) rp="$rp (~name ok)";;
4089 if test -f UU/getfile.ok && \
4090 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4109 value=`UU/filexp $ans`
4112 if test "$ans" != "$value"; then
4113 echo "(That expands to $value on this system.)"
4127 /*) value="$ansexp" ;;
4128 [a-zA-Z]:/*) value="$ansexp" ;;
4133 echo "I shall only accept a full path name, as in /bin/ls." >&4
4134 echo "Use a ! shell escape if you wish to check pathnames." >&4
4137 echo "Please give a full path name, starting with slash." >&4
4140 echo "Note that using ~name is ok provided it expands well." >&4
4153 for fp in $gfpth; do
4154 if test "X$fp" = X.; then
4159 if test -f "$pf"; then
4161 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4163 echo "($value is not a plain file, but that's ok.)"
4166 if test X"$type" = X; then
4173 for fp in $gfpth; do
4174 if test "X$fp" = X.; then
4179 direxp="$fp/$ansexp"
4181 if test -d "$direxp"; then
4189 if test -d "$ansexp"; then
4190 echo "(Looking for $loc_file in directory $value.)"
4191 value="$value/$loc_file"
4192 ansexp="$ansexp/$loc_file"
4194 if test -f "$ansexp"; then
4197 case "$nopath_ok" in
4198 true) case "$value" in
4200 *) echo "Assuming $value will be in people's path."
4216 if test "$fastread" = yes; then
4221 rp="$what $value doesn't exist. Use that name anyway?"
4240 test "X$gfpthkeep" != Xy && gfpth=""
4243 : What should the include directory be ?
4245 $echo $n "Hmm... $c"
4249 if $test -f /bin/mips && /bin/mips; then
4250 echo "Looks like a MIPS system..."
4251 $cat >usr.c <<'EOCP'
4252 #ifdef SYSTYPE_BSD43
4256 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4257 dflt='/bsd43/usr/include'
4261 mips_type='System V'
4263 $rm -f usr.c usr.out
4264 echo "and you're compiling with the $mips_type compiler and libraries."
4268 echo "Doesn't look like a MIPS system."
4278 case "$xxx_prompt" in
4281 rp='Where are the include files you want to use?'
4289 : see how we invoke the C preprocessor
4291 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4292 cat <<'EOT' >testcpp.c
4298 if test ! -f cppstdin; then
4299 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4300 # AIX cc -E doesn't show the absolute headerfile
4301 # locations but we'll cheat by using the -M flag.
4302 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
4304 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4307 echo "Keeping your $hint cppstdin wrapper."
4310 wrapper=`pwd`/cppstdin
4314 if $test "X$cppstdin" != "X" && \
4315 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4316 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4318 echo "You used to use $cppstdin $cppminus so we'll use that again."
4320 '') echo "But let's see if we can live without a wrapper..." ;;
4322 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4323 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4325 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4328 echo "(However, $cpprun $cpplast does not work, let's see...)"
4336 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4343 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4344 $cc -E <testcpp.c >testcpp.out 2>&1; \
4345 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4346 echo "Yup, it does."
4349 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4350 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4351 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4352 echo "Yup, it does."
4355 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4356 $cc -P <testcpp.c >testcpp.out 2>&1; \
4357 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4358 echo "Yipee, that works!"
4361 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4362 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4363 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4364 echo "At long last!"
4367 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4368 $cpp <testcpp.c >testcpp.out 2>&1; \
4369 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4373 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4374 $cpp - <testcpp.c >testcpp.out 2>&1; \
4375 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4376 echo "Hooray, it works! I was beginning to wonder."
4379 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4380 $wrapper <testcpp.c >testcpp.out 2>&1; \
4381 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4387 rp="No dice. I can't find a C preprocessor. Name one:"
4391 $x_cpp <testcpp.c >testcpp.out 2>&1
4392 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4393 echo "OK, that will do." >&4
4395 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4410 echo "Perhaps can we force $cc -E using a wrapper..."
4411 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4412 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4418 echo "Nope, we'll have to live without it..."
4432 "$wrapper"|'cppstdin') ;;
4433 *) $rm -f $wrapper;;
4435 $rm -f testcpp.c testcpp.out
4437 : Set private lib path
4440 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4445 '') dlist="$loclibpth $plibpth $glibpth";;
4446 *) dlist="$libpth";;
4449 : Now check and see which directories actually exist, avoiding duplicates
4453 if $test -d $xxx; then
4456 *) libpth="$libpth $xxx";;
4462 Some systems have incompatible or broken versions of libraries. Among
4463 the directories listed in the question below, please remove any you
4464 know not to be holding relevant libraries, and add any that are needed.
4465 Say "none" for none.
4476 rp="Directories to use for library searches?"
4483 : compute shared library extension
4486 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4496 On some systems, shared libraries may be available. Answer 'none' if
4497 you want to suppress searching of shared libraries for the remainder
4498 of this configuration.
4501 rp='What is the file extension used for shared libraries?'
4505 : Define several unixisms.
4506 : Hints files or command line option can be used to override them.
4507 : The convoluted testing is in case hints files set either the old
4510 '') case "$exe_ext" in
4512 *) _exe="$exe_ext" ;;
4517 '') case "$lib_ext" in
4524 '') case "$obj_ext" in
4531 '') case "$path_sep" in
4542 : Which makefile gets called first. This is used by make depend.
4543 case "$firstmakefile" in
4544 '') firstmakefile='makefile';;
4548 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4551 case "$uselongdouble" in
4552 $define|true|[yY]*) dflt='y';;
4557 Perl can be built to take advantage of long doubles which
4558 (if available) may give more accuracy and range for floating point numbers.
4560 If this doesn't make any sense to you, just accept the default '$dflt'.
4562 rp='Try to use long doubles if available?'
4565 y|Y) val="$define" ;;
4571 case "$uselongdouble" in
4572 true|[yY]*) uselongdouble="$define" ;;
4575 : Look for a hint-file generated 'call-back-unit'. If the
4576 : user has specified that long doubles should be used,
4577 : we may need to set or change some other defaults.
4578 if $test -f uselongdouble.cbu; then
4579 echo "Your platform has some specific hints regarding long doubles, using them..."
4580 . ./uselongdouble.cbu
4582 case "$uselongdouble" in
4585 (Your platform does not have any specific hints for long doubles.)
4591 : Looking for optional libraries
4593 echo "Checking for optional libraries..." >&4
4598 case "$libswanted" in
4599 '') libswanted='c_s';;
4602 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4608 for thisdir in $libpth $xlibpth; do
4609 test -d $thisdir && libspath="$libspath $thisdir"
4611 for thislib in $libswanted; do
4612 for thisdir in $libspath; do
4614 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4615 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4616 $test -f "$xxx" && eval $libscheck
4617 $test -f "$xxx" && libstyle=shared
4619 if test ! -f "$xxx"; then
4620 xxx=$thisdir/lib$thislib.$so
4621 $test -f "$xxx" && eval $libscheck
4622 $test -f "$xxx" && libstyle=shared
4624 if test ! -f "$xxx"; then
4625 xxx=$thisdir/lib$thislib$_a
4626 $test -f "$xxx" && eval $libscheck
4627 $test -f "$xxx" && libstyle=static
4629 if test ! -f "$xxx"; then
4630 xxx=$thisdir/$thislib$_a
4631 $test -f "$xxx" && eval $libscheck
4632 $test -f "$xxx" && libstyle=static
4634 if test ! -f "$xxx"; then
4635 xxx=$thisdir/lib${thislib}_s$_a
4636 $test -f "$xxx" && eval $libscheck
4637 $test -f "$xxx" && libstyle=static
4638 $test -f "$xxx" && thislib=${thislib}_s
4640 if test ! -f "$xxx"; then
4641 xxx=$thisdir/Slib$thislib$_a
4642 $test -f "$xxx" && eval $libscheck
4643 $test -f "$xxx" && libstyle=static
4645 if $test -f "$xxx"; then
4647 shared) echo "Found -l$thislib (shared)." ;;
4648 static) echo "Found -l$thislib." ;;
4649 *) echo "Found -l$thislib ($libstyle)." ;;
4653 *) dflt="$dflt -l$thislib"
4654 libsfound="$libsfound $xxx"
4656 libsfiles="$libsfiles $yyy"
4657 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4658 case " $libsdirs " in
4660 *) libsdirs="$libsdirs $yyy" ;;
4667 if $test ! -f "$xxx"; then
4668 echo "No -l$thislib."
4679 ' '|'') dflt='none';;
4684 In order to compile $package on your machine, a number of libraries
4685 are usually needed. Include any other special libraries here as well.
4686 Say "none" for none. The default list is almost always right.
4690 rp="What libraries to use?"
4697 : determine optimization, if desired, or use for debug flag also
4699 ' '|$undef) dflt='none';;
4701 *) dflt="$optimize";;
4705 By default, $package compiles with the -O flag to use the optimizer.
4706 Alternately, you might want to use the symbolic debugger, which uses
4707 the -g flag (on traditional Unix systems). Either flag can be
4708 specified here. To use neither flag, specify the word "none".
4711 rp="What optimizer/debugger flag should be used?"
4715 'none') optimize=" ";;
4719 : We will not override a previous value, but we might want to
4720 : augment a hint file
4722 default|recommended)
4723 case "$gccversion" in
4724 1*) dflt='-fpcc-struct-return' ;;
4727 *-g*) dflt="$dflt -DDEBUGGING";;
4729 case "$gccversion" in
4730 2*) if test -d /etc/conf/kconfig.d &&
4731 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4733 # Interactive Systems (ISC) POSIX mode.
4738 case "$gccversion" in
4742 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4743 echo 'int main(void) { return 0; }' > gcctest.c
4744 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4745 echo "Yes, it does." 2>&1
4748 echo "Leaving current flags $ccflags alone." 2>&1
4750 *) dflt="$dflt -fno-strict-aliasing" ;;
4753 echo "Nope, it doesn't, but that's ok." 2>&1
4757 # For gcc, adding -pipe speeds up compilations for some, but apparently
4758 # some assemblers can't read from stdin. (It also slows down compilations
4759 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4760 case "$gccversion" in
4762 echo "Checking if your compiler accepts -pipe" 2>&1
4763 echo 'int main(void) { return 0; }' > gcctest.c
4764 if $cc -pipe -o gcctest gcctest.c; then
4765 echo "Yes, it does." 2>&1
4768 echo "Leaving current flags $ccflags alone." 2>&1
4770 *) dflt="$dflt -pipe" ;;
4773 echo "Nope, it doesn't, but that's ok." 2>&1
4776 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4777 echo 'int main(void) { return 0; }' > gcctest.c
4778 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4779 echo "Yes, it does." 2>&1
4781 *-Wdeclaration-after-statement*)
4782 echo "Leaving current flags $ccflags alone." 2>&1
4784 *) dflt="$dflt -Wdeclaration-after-statement" ;;