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 initialinstalllocation=''
1165 userelocatableinc=''
1176 installvendorarch=''
1183 installvendorhtml1dir=''
1185 vendorhtml1direxp=''
1186 installvendorhtml3dir=''
1188 vendorhtml3direxp=''
1194 installvendorman1dir=''
1197 installvendorman3dir=''
1204 installvendorscript=''
1216 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1219 : We must find out about Eunice early
1221 if test -f /etc/unixtovms; then
1222 eunicefix=/etc/unixtovms
1224 if test -f /etc/unixtovms.exe; then
1225 eunicefix=/etc/unixtovms.exe
1228 : Set executable suffix now -- needed before hints available
1229 if test -f "/libs/version.library"; then
1232 elif test -f "/system/gnu_library/bin/ar.pm"; then
1235 elif test -n "$DJGPP"; then
1238 elif test -d c:/. -o -n "$is_os2" ; then
1247 : set useposix=false in your hint file to disable the POSIX extension.
1249 : set useopcode=false in your hint file to disable the Opcode extension.
1251 : Trailing extension. Override this in a hint file, if needed.
1252 : Extra object files, if any, needed on this platform.
1255 : Possible local include directories to search.
1256 : Set locincpth to "" in a hint file to defeat local include searches.
1257 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1258 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1260 : no include file wanted by default
1265 : change the next line if compiling for Xenix/286 on Xenix/386
1266 xlibpth='/usr/lib/386 /lib/386'
1267 : Possible local library directories to search.
1268 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1269 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1271 : general looking path for locating libraries
1272 glibpth="/lib /usr/lib $xlibpth"
1273 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1274 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1275 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1277 : Private path used by Configure to find libraries. Its value
1278 : is prepended to libpth. This variable takes care of special
1279 : machines, like the mips. Usually, it should be empty.
1282 : default library list
1284 : some systems want to use only the non-versioned libso:s
1285 ignore_versioned_solibs=''
1290 ccflags_uselargefiles=''
1291 ldflags_uselargefiles=''
1292 libswanted_uselargefiles=''
1293 : set usemultiplicity on the Configure command line to enable multiplicity.
1294 : set usesocks on the Configure command line to enable socks.
1295 : set usethreads on the Configure command line to enable threads.
1296 usereentrant='undef'
1297 : full support for void wanted by default
1300 : List of libraries we want.
1301 : If anyone needs extra -lxxx, put those in a hint file.
1302 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1303 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1304 : We probably want to search /usr/shlib before most other libraries.
1305 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1306 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1307 glibpth="/usr/shlib $glibpth"
1308 : Do not use vfork unless overridden by a hint file.
1311 : Find the basic shell for Bourne shell scripts
1315 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1318 if test -f "$xxx"; then
1321 : Build up a list and do a single loop so we can 'break' out.
1322 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1323 for xxx in sh bash ksh pdksh ash; do
1325 try="$try ${p}/${xxx}"
1329 if test -f "$xxx"; then
1332 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1335 elif test -f "$xxx.exe"; then
1346 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1348 Usually it's in /bin/sh. How did you even get this far?
1349 Please contact me (Perl Maintainers) at perlbug@perl.org and
1350 we'll try to straighten this all out.
1356 : see if sh knows # comments
1357 if `$sh -c '#' >/dev/null 2>&1`; then
1361 test -f $xcat$_exe || xcat=/usr/bin/cat
1362 if test ! -f $xcat$_exe; then
1363 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1364 if test -f $p/cat$_exe; then
1369 if test ! -f $xcat$_exe; then
1370 echo "Can't find cat anywhere!"
1374 echo "#!$xcat" >sharp
1378 if test -s today; then
1381 echo "#! $xcat" > sharp
1385 if test -s today; then
1393 echo "Your $sh doesn't grok # comments--I will strip them later on."
1396 echo "exec grep -v '^[ ]*#'" >spitshell
1398 $eunicefix spitshell
1399 spitshell=`pwd`/spitshell
1401 echo "I presume that if # doesn't work, #! won't work either!"
1406 : figure out how to guarantee sh startup
1408 '') startsh=${sharpbang}${sh} ;;
1420 : echo "Yup, it does."
1422 echo "Hmm... '$startsh' does not guarantee sh startup..."
1423 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1428 : Save command line options in file UU/cmdline.opt for later use in
1429 : generating config.sh.
1430 cat > cmdline.opt <<EOSH
1431 # Configure command line arguments.
1440 cat >>cmdline.opt <<EOSH
1441 config_arg$argn='$arg'
1443 # Extreme backslashitis: replace each ' by '"'"'
1444 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1447 arg_exp=`cat cmdl.opt`
1448 args_exp="$args_exp$args_sep'$arg_exp'"
1449 argn=`expr $argn + 1`
1452 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1453 # used by ./hints/os2.sh
1456 : produce awk script to parse command line options
1457 cat >options.awk <<'EOF'
1459 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1461 len = length(optstr);
1462 for (i = 1; i <= len; i++) {
1463 c = substr(optstr, i, 1);
1464 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1475 if (substr(str, 1, 1) != "-") {
1476 printf("'%s'\n", str);
1480 for (i = 2; i <= len; i++) {
1481 c = substr(str, i, 1);
1483 printf("-%s\n", substr(str, i));
1489 printf("'%s'\n", substr(str, i + 1));
1502 : process the command line options
1503 set X `for arg in "$@"; do echo "X$arg"; done |
1504 sed -e s/X// | awk -f options.awk`
1509 : set up default values
1519 rm -f optdef.sh posthint.sh
1520 cat >optdef.sh <<EOS
1526 while test $# -gt 0; do
1528 -d) shift; fastread=yes;;
1529 -e) shift; alldone=cont;;
1533 if test -r "$1"; then
1536 echo "$me: cannot read config file $1." >&2
1541 -h) shift; error=true;;
1542 -r) shift; reuseval=true;;
1543 -s) shift; silent=true; realsilent=true;;
1544 -E) shift; alldone=exit;;
1545 -K) shift; knowitall=true;;
1546 -O) shift; override=true;;
1547 -S) shift; silent=true; extractsh=true;;
1552 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1553 echo "$me: ignoring -D $1" >&2
1556 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1557 *) echo "$1='define'" >> optdef.sh;;
1564 *=) echo "$1" >> optdef.sh;;
1566 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1567 echo "$me: ignoring -U $1" >&2
1569 *) echo "$1='undef'" >> optdef.sh;;
1580 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1584 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1585 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1591 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1592 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1593 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1594 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1595 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1596 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1602 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1604 echo "$yyy=''" >> posthint.sh ;;
1609 echo "$yyy='$zzz'" >> posthint.sh ;;
1611 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1613 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1618 echo "$yyy=$zzz" >> posthint.sh ;;
1619 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1623 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1626 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1634 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1635 [-U symbol] [-U symbol=] [-A command:symbol...]
1636 -d : use defaults for all answers.
1637 -e : go on without questioning past the production of config.sh.
1638 -f : specify an alternate default configuration file.
1639 -h : print this help message and exit (with an error status).
1640 -r : reuse C symbols value if possible (skips costly nm extraction).
1641 -s : silent mode, only echoes questions and essential information.
1642 -D : define symbol to have some value:
1643 -D symbol symbol gets the value 'define'
1644 -D symbol=value symbol gets the value 'value'
1645 -E : stop at the end of questions, after having produced config.sh.
1646 -K : do not use unless you know what you are doing.
1647 -O : let -D and -U override definitions from loaded configuration file.
1648 -S : perform variable substitutions on all .SH files (can mix with -f)
1649 -U : undefine symbol:
1650 -U symbol symbol gets the value 'undef'
1651 -U symbol= symbol gets completely empty
1652 -A : manipulate symbol after the platform specific hints have been applied:
1653 -A symbol=value append " "value to symbol
1654 -A append:symbol=value append value to symbol
1655 -A define:symbol=value define symbol to have value
1656 -A clear:symbol define symbol to be ''
1657 -A define:symbol define symbol to be 'define'
1658 -A eval:symbol=value define symbol to be eval of value
1659 -A prepend:symbol=value prepend value to symbol
1660 -A undef:symbol define symbol to be 'undef'
1661 -A undef:symbol= define symbol to be ''
1662 -V : print version number and exit (with a zero status).
1669 case "$fastread$alldone" in
1672 case "$extractsh" in
1675 if test ! -t 0; then
1676 echo "Say 'sh Configure', not 'sh <Configure'"
1686 true) exec 1>/dev/null;;
1689 : run the defines and the undefines, if any, but leave the file out there...
1692 : create the posthint manipulation script and leave the file out there...
1697 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1698 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1699 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1700 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1701 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1704 : Some greps do not return status, grrr.
1705 echo "grimblepritz" >grimble
1706 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1708 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1714 : the following should work in any shell
1718 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1719 cat >contains <<'EOSS'
1720 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1725 : Find the path to the source tree
1728 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1732 *) src=`cd ../$src && pwd` ;;
1745 if test -f $rsrc/Configure && \
1746 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1748 : found it, so we are ok.
1751 for src in . .. ../.. ../../.. ../../../..; do
1752 if test -f ../$src/Configure && \
1753 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1764 Sorry, I can't seem to locate the source dir for $package. Please start
1765 Configure with an explicit path -- i.e. /some/path/Configure.
1773 echo "Sources for $package found in \"$src\"." >&4
1777 : script used to extract .SH files with variable substitutions
1778 cat >extract <<'EOS'
1780 echo "Doing variable substitutions on .SH files..."
1781 if test -f MANIFEST; then
1782 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1784 echo "(Looking for .SH files under the source directory.)"
1785 set x `(cd "$src"; find . -name "*.SH" -print)`
1789 0) set x `(cd "$src"; echo *.SH)`; shift;;
1791 if test ! -f "$src/$1"; then
1797 while test $name; do
1798 if test ! -d "$name"; then
1799 create="$name $create";
1800 name=`echo $name | sed -e "s|^[^/]*$||"`;
1801 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1806 for file in $create; do
1815 dir=`expr X$file : 'X\(.*\)/'`
1816 file=`expr X$file : 'X.*/\(.*\)'`
1817 (cd "$dir" && . ./$file)
1827 dir=`expr X$file : 'X\(.*\)/'`
1828 file=`expr X$file : 'X.*/\(.*\)'`
1829 (set x $dir; shift; eval $mkdir_p)
1830 sh <"$src/$dir/$file"
1839 if test -f "$src/config_h.SH"; then
1840 if test ! -f config.h; then
1841 : oops, they left it out of MANIFEST, probably, so do it anyway.
1842 . "$src/config_h.SH"
1847 : extract files and exit if asked to do so
1848 case "$extractsh" in
1850 case "$realsilent" in
1854 case "$config_sh" in
1855 '') config_sh='config.sh';;
1858 echo "Fetching answers from $config_sh..."
1861 test "$override" && . ./optdef.sh
1865 echo "Extraction done."
1870 : Eunice requires " " instead of "", can you believe it
1873 echo "Beginning of configuration questions for $package."
1875 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1877 : first determine how to suppress newline on echo command
1879 echo "Checking echo to see how to suppress newlines..."
1880 (echo "hi there\c" ; echo " ") >.echotmp
1881 if $contains c .echotmp >/dev/null 2>&1 ; then
1892 echo $n "The star should be here-->$c"
1896 : Now test for existence of everything in MANIFEST
1898 if test -f "$rsrc/MANIFEST"; then
1899 echo "First let's make sure your kit is complete. Checking..." >&4
1900 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1903 for filelist in x??; do
1904 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1906 if test -s missing; then
1910 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1912 You have the option of continuing the configuration process, despite the
1913 distinct possibility that your kit is damaged, by typing 'y'es. If you
1914 do, don't blame me if something goes wrong. I advise you to type 'n'o
1915 and contact the author (perlbug@perl.org).
1918 echo $n "Continue? [n] $c" >&4
1922 echo "Continuing..." >&4
1926 echo "ABORTING..." >&4
1931 echo "Looks good..."
1934 echo "There is no MANIFEST file. I hope your kit is complete !"
1939 : Find the appropriate value for a newline for tr
1940 if test -n "$DJGPP"; then
1943 if test X"$trnl" = X; then
1944 case "`echo foo|tr '\n' x 2>/dev/null`" in
1948 if test X"$trnl" = X; then
1949 case "`echo foo|tr '\012' x 2>/dev/null`" in
1950 foox) trnl='\012' ;;
1953 if test X"$trnl" = X; then
1954 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1955 fooxy) trnl='\n\r' ;;
1958 if test X"$trnl" = X; then
1961 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1967 : compute the number of columns on the terminal for proper question formatting
1972 : set up the echo used in my read
1973 myecho="case \"\$xxxm\" in
1974 '') echo $n \"\$rp $c\" >&4;;
1976 '') echo $n \"[\$xxxm] $c\";;
1978 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1980 echo $n \"[\$xxxm] $c\" >&4
1982 echo $n \"\$rp [\$xxxm] $c\" >&4
1988 : now set up to do reads with possible shell escape and default assignment
1994 case "\$fastread" in
1995 yes) case "\$dflt" in
1998 case "\$silent-\$rp" in
2003 *) case "\$silent" in
2004 true) case "\$rp" in
2009 while expr "X\$ans" : "X!" >/dev/null; do
2013 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2021 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2030 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2035 echo "(OK, I'll run with -d after this question.)" >&4
2038 echo "*** Sorry, \$1 not supported yet." >&4
2048 echo "*** Substitution done -- please confirm."
2050 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2055 echo "*** Error -- try again."
2062 case "\$ans\$xxxm\$nostick" in
2074 : create .config dir to save info across Configure sessions
2075 test -d ../.config || mkdir ../.config
2076 cat >../.config/README <<EOF
2077 This directory created by Configure to save information that should
2078 persist across sessions for $package.
2080 You may safely delete it if you wish.
2083 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2085 $define|true|[yY]*) ;;
2086 *) case "$xversion" in
2089 *** WHOA THERE!!! ***
2091 This is an UNSTABLE DEVELOPMENT release.
2092 The version of this $package distribution is $xversion, that is, odd,
2093 (as opposed to even) and that signifies a development release.
2094 If you want a maintenance release, you want an even-numbered version.
2096 Do ***NOT*** install this into production use.
2097 Data corruption and crashes are possible.
2099 It is most seriously suggested that you do not continue any further
2100 unless you want to help in developing and debugging Perl.
2102 If you *still* want to build perl, you can answer 'y' now,
2103 or pass -Dusedevel to Configure.
2106 rp='Do you really want to continue?'
2110 [yY]) echo >&4 "Okay, continuing."
2111 usedevel="$define" ;;
2112 *) echo >&4 "Okay, bye."
2122 case "$versiononly" in
2123 '') versiononly="$define" ;;
2125 case "$installusrbinperl" in
2126 '') installusrbinperl="$undef" ;;
2131 : general instructions
2134 user=`(logname) 2>/dev/null`
2136 '') user=`whoami 2>&1`;;
2138 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2141 rp='Would you like to see the instructions?'
2152 This installation shell script will examine your system and ask you questions
2153 to determine how the perl5 package should be installed. If you get
2154 stuck on a question, you may use a ! shell escape to start a subshell or
2155 execute a command. Many of the questions will have default answers in square
2156 brackets; typing carriage return will give you the default.
2158 On some of the questions which ask for file or directory names you are allowed
2159 to use the ~name construct to specify the login directory belonging to "name",
2160 even if you don't have a shell which knows about that. Questions where this is
2161 allowed will be marked "(~name ok)".
2165 dflt='Type carriage return to continue'
2169 The prompter used in this script allows you to use shell variables and
2170 backticks in your answers. You may use $1, $2, etc... to refer to the words
2171 in the default answer, as if the default line was a set of arguments given to a
2172 script shell. This means you may also use $* to repeat the whole default line,
2173 so you do not have to re-type everything to add something to the default.
2175 Everytime there is a substitution, you will have to confirm. If there is an
2176 error (e.g. an unmatched backtick), the default answer will remain unchanged
2177 and you will be prompted again.
2179 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2180 the questions and use the computed defaults (or the previous answers if there
2181 was already a config.sh file). Type 'Configure -h' for a list of options.
2182 You may also start interactively and then answer '& -d' at any prompt to turn
2183 on the non-interactive behaviour for the remainder of the execution.
2189 Much effort has been expended to ensure that this shell script will run on any
2190 Unix system. If despite that it blows up on yours, your best bet is to edit
2191 Configure and run it again. If you can't run Configure for some reason,
2192 you'll have to generate a config.sh file by hand. Whatever problems you
2193 have, let me (perlbug@perl.org) know how I blew it.
2195 This installation script affects things in two ways:
2197 1) it may do direct variable substitutions on some of the files included
2199 2) it builds a config.h file for inclusion in C programs. You may edit
2200 any of these files as the need arises after running this script.
2202 If you make a mistake on a question, there is no easy way to back up to it
2203 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2204 files. Configure will offer to let you do this before it runs the SH files.
2207 dflt='Type carriage return to continue'
2209 case "$firsttime" in
2210 true) echo $user >>../.config/instruct;;
2214 : find out where common programs are
2216 echo "Locating common programs..." >&4
2229 if test -d \$dir/\$thing; then
2235 for thisthing in \$dir/\$thing; do
2236 : just loop through to pick last item
2238 if test -f \$thisthing; then
2241 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2244 elif test -f \$dir/\$thing.exe; then
2245 if test -n "$DJGPP"; then
2246 echo \$dir/\$thing.exe
2247 elif test "$eunicefix" != ":"; then
2248 : on Eunice apparently
2302 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2303 pth="$pth /lib /usr/lib"
2304 for file in $loclist; do
2308 if test -f "$xxx"; then
2311 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2312 xxx=`./loc $file $file $pth`
2315 '') xxx=`./loc $file $file $pth`;;
2316 *) xxx=`./loc $xxx $xxx $pth`;;
2318 eval $file=$xxx$_exe
2322 echo $file is in $xxx.
2325 echo $file is in $xxx.
2328 echo "I don't know where '$file' is, and my life depends on it." >&4
2329 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2335 echo "Don't worry if any of the following aren't found..."
2337 for file in $trylist; do
2341 if test -f "$xxx"; then
2344 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2345 xxx=`./loc $file $file $pth`
2348 '') xxx=`./loc $file $file $pth`;;
2349 *) xxx=`./loc $xxx $xxx $pth`;;
2351 eval $file=$xxx$_exe
2355 echo $file is in $xxx.
2358 echo $file is in $xxx.
2361 echo "I don't see $file out there, $say."
2368 echo "Substituting grep for egrep."
2375 echo "Substituting cp for ln."
2384 echo "I can't find make or gmake, and my life depends on it." >&4
2385 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2393 *) # We can't have osname yet.
2394 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2395 # Assume that gmake, if found, is definitely GNU make
2396 # and prefer it over the system make.
2397 echo "Substituting gmake for make."
2405 echo "Hopefully test is built into your sh."
2408 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2409 echo "Using the test built into your sh."
2417 echo "Hopefully echo is built into your sh."
2422 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2423 $echo $n "hi there$c" >foo1
2424 echo $n "hi there$c" >foo2
2425 if cmp foo1 foo2 >/dev/null 2>&1; then
2426 echo "They are compatible. In fact, they may be identical."
2433 They are not compatible! You are probably running ksh on a non-USG system.
2434 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2435 have echo built in and we may have to run some Bourne shell scripts. That
2436 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2439 $echo $n "The star should be here-->$c"
2449 cat <<'EOSC' >>trygcc
2454 int main(int argc, char *argv[]) {
2458 if $cc -o try $ccflags $ldflags try.c; then
2461 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2467 case "`$cc -v -c try.c 2>&1`" in
2470 if $test X"$trygcc" = Xyes; then
2471 if gcc -o try -c try.c; then
2473 echo "You seem to have a working gcc, though." >&4
2474 rp="Would you like to use it?"
2476 if $test -f myread; then
2479 if $test -f UU/myread; then
2482 echo "Cannot find myread, sorry. Aborting." >&2
2487 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2488 if $test -f usethreads.cbu; then
2491 *** However, any setting of the C compiler flags (e.g. for thread support)
2492 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2493 *** (together with e.g. -Dusethreads).
2509 cat <<'EOSC' >>checkcc
2514 int main(int argc, char *argv[]) {
2518 if $cc -o try $ccflags $ldflags try.c; then
2521 if $test X"$despair" = Xyes; then
2522 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2525 You need to find a working C compiler.
2526 Either (purchase and) install the C compiler supplied by your OS vendor,
2527 or for a free C compiler try http://gcc.gnu.org/
2528 I cannot continue any further, aborting.
2537 : determine whether symbolic links are supported
2540 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2541 echo "Symbolic links are supported." >&4
2544 echo "Symbolic links are NOT supported." >&4
2549 : determine whether symbolic links are supported
2553 echo "Checking how to test for symbolic links..." >&4
2555 if $test "X$issymlink" = X; then
2557 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2558 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2560 if test $? = 0; then
2563 echo "Your builtin 'test -h' may be broken." >&4
2566 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2569 if test -f "$p/$test"; then
2578 echo "Trying external '$test -h'." >&4
2579 issymlink="$test -h"
2580 if $test ! -h sym >/dev/null 2>&1; then
2581 echo "External '$test -h' is broken, too." >&4
2589 if $test "X$issymlink" = X; then
2590 if $test -L sym 2>/dev/null; then
2591 issymlink="$test -L"
2592 echo "The builtin '$test -L' worked." >&4
2595 if $test "X$issymlink" != X; then
2596 echo "You can test for symbolic links with '$issymlink'." >&4
2598 echo "I do not know how you can test for symbolic links." >&4
2602 *) echo "No symbolic links, so not testing for their testing..." >&4
2608 case "$mksymlinks" in
2611 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2614 *) case "$lns:$issymlink" in
2615 *"ln"*" -s:"*"test -"?)
2616 echo "Creating the symbolic links..." >&4
2617 echo "(First creating the subdirectories...)" >&4
2619 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2621 test -z "$directory" && break
2625 if test ! -d t/base; then
2626 echo "Failed to create the subdirectories. Aborting." >&4
2629 echo "(Then creating the symlinks...)" >&4
2630 awk '{print $1}' $src/MANIFEST | while true; do
2632 test -z "$filename" && break
2633 if test -f $filename; then
2634 if $issymlink $filename; then
2638 if test -f $filename; then
2639 echo "$filename already exists, not symlinking."
2641 ln -s $src/$filename $filename
2645 if test ! -f t/base/lex.t; then
2646 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2651 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2660 case "$usecrosscompile" in
2662 $echo "Cross-compiling..."
2665 *-*-gcc) # A cross-compiling gcc, probably.
2666 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2668 # leave out ld, choosing it is more complex
2670 ranlib=$targetarch-ranlib
2671 $echo 'extern int foo;' > try.c
2672 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2674 if $test $# -gt 0; then
2676 incpth="`$echo $incpth|$sed 's/^ //'`"
2677 echo "Guessing incpth '$incpth'." >&4
2679 j="`$echo $i|$sed 's,/include$,/lib,'`"
2680 if $test -d $j; then
2684 libpth="`$echo $libpth|$sed 's/^ //'`"
2685 echo "Guessing libpth '$libpth'." >&4
2690 case "$targetarch" in
2691 '') echo "Targetarch not defined." >&4; croak=y ;;
2692 *) echo "Using targetarch $targetarch." >&4 ;;
2695 '') echo "Incpth not defined." >&4; croak=y ;;
2696 *) echo "Using incpth '$incpth'." >&4 ;;
2699 '') echo "Libpth not defined." >&4; croak=y ;;
2700 *) echo "Using libpth '$libpth'." >&4 ;;
2703 '') for i in $incpth; do
2704 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2706 echo "Guessing usrinc $usrinc." >&4
2711 '') echo "Usrinc not defined." >&4; croak=y ;;
2714 *) echo "Using usrinc $usrinc." >&4 ;;
2716 case "$targethost" in
2717 '') echo "Targethost not defined." >&4; croak=y ;;
2718 *) echo "Using targethost $targethost." >&4
2723 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2726 /*) run=$src/Cross/run
2727 targetmkdir=$src/Cross/mkdir
2729 from=$src/Cross/from
2731 *) pwd=`$test -f ../Configure & cd ..; pwd`
2733 targetmkdir=$pwd/Cross/mkdir
2735 from=$pwd/Cross/from
2738 case "$targetrun" in
2739 '') targetrun=ssh ;;
2744 case "$targetfrom" in
2745 '') targetfrom=scp ;;
2749 from=$from-$targetfrom
2750 case "$targetdir" in
2752 echo "Guessing targetdir $targetdir." >&4
2755 case "$targetuser" in
2757 echo "Guessing targetuser $targetuser." >&4
2760 case "$targetfrom" in
2764 case "$targetrun" in
2776 '') cwd=$targetdir ;;
2780 if $test ! -f \$exe.xok; then
2784 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2787 *) echo "Unknown targetrun '$targetrun'" >&4
2791 case "$targetmkdir" in
2793 cat >$targetmkdir <<EOF
2795 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2797 $chmod a+rx $targetmkdir
2799 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2811 $targetmkdir \`dirname \$f\`
2812 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2815 $targetmkdir $targetdir/\`dirname \$f\`
2816 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2829 $mkdir -p $targetdir/\`dirname \$f\`
2830 $cp \$f $targetdir/\$f || exit 1
2833 $targetmkdir $targetdir/\`dirname \$f\`
2834 $cp \$f $targetdir/\$f || exit 1
2841 *) echo "Unknown targetto '$targetto'" >&4
2845 case "$targetfrom" in
2852 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2857 cp) cat >$from <<EOF
2862 cp $targetdir/\$f . || exit 1
2867 *) echo "Unknown targetfrom '$targetfrom'" >&4
2871 if $test ! -f $run; then
2872 echo "Target 'run' script '$run' not found." >&4
2876 if $test ! -f $to; then
2877 echo "Target 'to' script '$to' not found." >&4
2881 if $test ! -f $from; then
2882 echo "Target 'from' script '$from' not found." >&4
2886 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2890 Using '$run' for remote execution,
2891 and '$from' and '$to'
2892 for remote file transfer.
2898 usecrosscompile='undef'
2903 : see whether [:lower:] and [:upper:] are supported character classes
2905 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2907 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2911 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2912 # (0xd9 and 0xe2), therefore that is a nice testing point.
2913 if test "X$up" = X -o "X$low" = X; then
2914 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2920 if test "X$up" = X -o "X$low" = X; then
2921 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2927 if test "X$up" = X -o "X$low" = X; then
2928 case "`echo RS | od -x 2>/dev/null`" in
2930 echo "Hey, this might be EBCDIC." >&4
2931 if test "X$up" = X -o "X$low" = X; then
2932 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2933 rs) up='[A-IJ-RS-Z]'
2938 if test "X$up" = X -o "X$low" = X; then
2939 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2949 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2951 echo "Using $up and $low to convert case." >&4
2954 echo "I don't know how to translate letters from upper to lower case." >&4
2955 echo "Your tr is not acting any way I know of." >&4
2959 : set up the translation script tr, must be called with ./tr of course
2963 '[A-Z][a-z]') exec $tr '$up' '$low';;
2964 '[a-z][A-Z]') exec $tr '$low' '$up';;
2971 : Try to determine whether config.sh was made on this system
2972 case "$config_sh" in
2974 myuname=`$uname -a 2>/dev/null`
2975 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2976 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2977 # because the A-Z/a-z are not consecutive.
2978 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2979 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2980 newmyuname="$myuname"
2982 case "$knowitall" in
2984 if test -f ../config.sh; then
2985 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2986 eval "`grep myuname= ../config.sh`"
2988 if test "X$myuname" = "X$newmyuname"; then
2996 : Get old answers from old config file if Configure was run on the
2997 : same system, otherwise use the hints.
3000 if test -f config.sh; then
3002 rp="I see a config.sh file. Shall I use it to set the defaults?"
3005 n*|N*) echo "OK, I'll ignore it."
3006 mv config.sh config.sh.old
3007 myuname="$newmyuname"
3009 *) echo "Fetching default answers from your old config.sh file..." >&4
3017 : Older versions did not always set $sh. Catch re-use of such
3027 if test ! -f config.sh; then
3030 First time through, eh? I have some defaults handy for some systems
3031 that need some extra help getting the Configure answers right:
3034 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3036 : Half the following guesses are probably wrong... If you have better
3037 : tests or hints, please send them to perlbug@perl.org
3038 : The metaconfig authors would also appreciate a copy...
3039 $test -f /irix && osname=irix
3040 $test -f /xenix && osname=sco_xenix
3041 $test -f /dynix && osname=dynix
3042 $test -f /dnix && osname=dnix
3043 $test -f /lynx.os && osname=lynxos
3044 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3045 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3046 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3047 $test -f /bin/mips && /bin/mips && osname=mips
3048 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3049 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3050 $test -d /usr/apollo/bin && osname=apollo
3051 $test -f /etc/saf/_sactab && osname=svr4
3052 $test -d /usr/include/minix && osname=minix
3053 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3054 if $test -d /MachTen -o -d /MachTen_Folder; then
3056 if $test -x /sbin/version; then
3057 osvers=`/sbin/version | $awk '{print $2}' |
3058 $sed -e 's/[A-Za-z]$//'`
3059 elif $test -x /usr/etc/version; then
3060 osvers=`/usr/etc/version | $awk '{print $2}' |
3061 $sed -e 's/[A-Za-z]$//'`
3067 $test -f /sys/posix.dll &&
3068 $test -f /usr/bin/what &&
3069 set X `/usr/bin/what /sys/posix.dll` &&
3070 $test "$3" = UWIN &&
3074 if $test -f $uname; then
3082 umips) osname=umips ;;
3085 [23]100) osname=mips ;;
3086 next*) osname=next ;;
3088 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3089 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3092 elif $test -f /etc/kconfig; then
3094 if test "$lns" = "$ln -s"; then
3096 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3098 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3105 if test -n "$DJGPP"; then
3114 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3116 # oslevel can fail with:
3117 # oslevel: Unable to acquire lock.
3118 *not\ found) osvers="$4"."$3" ;;
3119 '<3240'|'<>3240') osvers=3.2.0 ;;
3120 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3121 '=3250'|'>3250') osvers=3.2.5 ;;
3125 bsd386) osname=bsd386
3128 cygwin*) osname=cygwin
3131 *dc.osx) osname=dcosx
3137 domainos) osname=apollo
3143 dragonfly) osname=dragonfly
3146 dynixptx*) osname=dynixptx
3147 osvers=`echo "$4"|sed 's/^v//'`
3149 freebsd) osname=freebsd
3151 genix) osname=genix ;;
3155 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3171 netbsd*) osname=netbsd
3174 news-os) osvers="$3"
3176 4*) osname=newsos4 ;;
3180 next*) osname=next ;;
3181 nonstop-ux) osname=nonstopux ;;
3182 openbsd) osname=openbsd
3188 POSIX-BC | posix-bc ) osname=posix-bc
3191 powerux | power_ux | powermax_os | powermaxos | \
3192 powerunix | power_unix) osname=powerux
3198 solaris) osname=solaris
3200 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3207 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3211 titanos) osname=titanos
3220 ultrix) osname=ultrix
3223 osf1|mls+) case "$5" in
3226 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3229 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3232 hp*) osname=hp_osf1 ;;
3233 mips) osname=mips_osf1 ;;
3236 # UnixWare 7.1.2 is known as Open UNIX 8
3237 openunix|unixware) osname=svr5
3245 $2) case "$osname" in
3249 : svr4.x or possibly later
3259 if test -f /stand/boot ; then
3260 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3261 if test -n "$INITPROG" -a -f "$INITPROG"; then
3262 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3263 if test -n "$isesix"; then
3271 *) if test -f /etc/systemid; then
3273 set `echo $3 | $sed 's/\./ /g'` $4
3274 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3276 elif $test -f $src/hints/sco_$1_$2.sh; then
3278 elif $test -f $src/hints/sco_$1.sh; then
3283 '') : Still unknown. Probably a generic Sys V.
3292 *) case "$osname" in
3293 '') : Still unknown. Probably a generic BSD.
3301 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3302 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3303 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3306 $rm -f UU/kernel.what
3307 elif test -d c:/. -o -n "$is_os2" ; then
3314 case "$targetarch" in
3317 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3322 : Now look for a hint file osname_osvers, unless one has been
3323 : specified already.
3326 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3327 : Also try without trailing minor version numbers.
3328 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3329 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3330 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3331 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3334 *) case "$osvers" in
3337 *) if $test -f $src/hints/$file.sh ; then
3339 elif $test -f $src/hints/$xfile.sh ; then
3341 elif $test -f $src/hints/$xxfile.sh ; then
3343 elif $test -f $src/hints/$xxxfile.sh ; then
3345 elif $test -f $src/hints/$xxxxfile.sh ; then
3347 elif $test -f "$src/hints/${osname}.sh" ; then
3356 if $test -f Policy.sh ; then
3359 none) dflt="Policy" ;;
3360 *) dflt="Policy $dflt" ;;
3365 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3369 if $test -f Policy.sh ; then
3372 There's also a Policy hint file available, which should make the
3373 site-specific (policy) questions easier to answer.
3380 You may give one or more space-separated answers, or "none" if appropriate.
3381 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3382 is a good thing. DO NOT give a wrong version or a wrong OS.
3386 rp="Which of these apply, if any?"
3389 for file in $tans; do
3390 if $test X$file = XPolicy -a -f Policy.sh; then
3392 $cat Policy.sh >> UU/config.sh
3393 elif $test -f $src/hints/$file.sh; then
3394 . $src/hints/$file.sh
3395 $cat $src/hints/$file.sh >> UU/config.sh
3396 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3399 : Give one chance to correct a possible typo.
3400 echo "$file.sh does not exist"
3402 rp="hint to use instead?"
3404 for file in $ans; do
3405 if $test -f "$src/hints/$file.sh"; then
3406 . $src/hints/$file.sh
3407 $cat $src/hints/$file.sh >> UU/config.sh
3408 elif $test X$ans = X -o X$ans = Xnone ; then
3411 echo "$file.sh does not exist -- ignored."
3418 : Remember our hint file for later.
3419 if $test -f "$src/hints/$file.sh" ; then
3429 echo "Fetching default answers from $config_sh..." >&4
3433 cp $config_sh config.sh 2>/dev/null
3443 test "$override" && . ./optdef.sh
3445 : Restore computed paths
3446 for file in $loclist $trylist; do
3447 eval $file="\$_$file"
3452 Configure uses the operating system name and version to set some defaults.
3453 The default value is probably right if the name rings a bell. Otherwise,
3454 since spelling matters for me, either accept the default or answer "none"
3461 ''|' '|none) dflt=none ;;
3462 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3465 *) dflt="$osname" ;;
3467 rp="Operating system name?"
3471 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3477 ''|' '|none) dflt=none ;;
3478 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3479 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3481 ''|' ') dflt=none ;;
3486 *) dflt="$osvers" ;;
3488 rp="Operating system version?"
3498 : who configured the system
3499 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3502 cf_by=`(logname) 2>/dev/null`
3505 cf_by=`(whoami) 2>/dev/null`
3507 "") cf_by=unknown ;;
3512 : set up the script used to warn in case of inconsistency
3519 echo "*** WHOA THERE!!! ***" >&4
3520 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3521 rp=" Keep the $hint value?"
3524 y) td=$was; tu=$was;;
3528 : function used to set $1 to $val
3529 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3531 $define$undef) . ./whoa; eval "$var=\$td";;
3532 $undef$define) . ./whoa; eval "$var=\$tu";;
3533 *) eval "$var=$val";;
3537 $define|true|[yY]*) dflt='y';;
3542 Perl can be built to use the SOCKS proxy protocol library. To do so,
3543 Configure must be run with -Dusesocks. If you use SOCKS you also need
3544 to use the PerlIO abstraction layer, this will be implicitly selected.
3546 If this doesn't make any sense to you, just accept the default '$dflt'.
3548 rp='Build Perl for SOCKS?'
3551 y|Y) val="$define" ;;
3558 $define|true|[yY]*) useperlio="$define";;
3561 case "$useperlio" in
3562 $define|true|[yY]*|'') dflt='y';;
3567 Previous version of $package used the standard IO mechanisms as
3568 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3569 alternate IO mechanisms via the PerlIO abstraction layer, but the
3570 stdio mechanism is still available if needed. The abstraction layer
3571 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3572 Using PerlIO with sfio may cause problems with some extension modules.
3574 If this doesn't make any sense to you, just accept the default '$dflt'.
3576 rp='Use the PerlIO abstraction layer?'
3583 echo "Ok, doing things the stdio way."
3592 case "$useperlio" in
3593 $define|true|[yY]*) ;;
3596 You are using the SOCKS proxy protocol library which means that you
3597 should also use the PerlIO layer. You may be headed for trouble.
3606 case "$usethreads" in
3607 $define|true|[yY]*) dflt='y';;
3608 *) # Catch case where user specified ithreads or 5005threads but
3609 # forgot -Dusethreads (A.D. 4/2002)
3610 case "$useithreads$use5005threads" in
3612 case "$useperlio" in
3613 "$define") dflt='y' ;;
3623 Perl can be built to take advantage of threads on some systems.
3624 To do so, Configure can be run with -Dusethreads.
3626 Note that Perl built with threading support runs slightly slower
3627 and uses more memory than plain Perl. The current implementation
3628 is believed to be stable, but it is fairly new, and so should be
3629 treated with caution.
3631 If this doesn't make any sense to you, just accept the default '$dflt'.
3633 rp='Build a threading Perl?'
3636 y|Y) val="$define" ;;
3642 case "$usethreads" in
3646 Since release 5.6, Perl has had two different threading implementations,
3647 the newer interpreter-based version (ithreads) with one interpreter per
3648 thread, and the older 5.005 version (5005threads).
3649 The 5005threads version is effectively unmaintained and will probably be
3650 removed in Perl 5.10, so there should be no need to build a Perl using it
3651 unless needed for backwards compatibility with some existing 5.005threads
3655 : Default to ithreads unless overridden on command line or with
3658 case "$use5005threads" in
3659 $define|true|[yY]*) dflt='n';;
3661 case "$useithreads" in
3662 $undef|false|[nN]*) dflt='n';;
3664 rp='Use the newer interpreter-based ithreads?'
3667 y|Y) val="$define" ;;
3672 : Now set use5005threads to the opposite value.
3673 case "$useithreads" in
3674 $define) val="$undef" ;;
3681 useithreads="$undef"
3682 use5005threads="$undef"
3686 case "$useithreads$use5005threads" in
3690 You cannot have both the ithreads and the 5.005 threads enabled
3691 at the same time. Disabling the 5.005 threads since they are
3692 much less stable than the ithreads.
3695 use5005threads="$undef"
3699 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3702 *** To build with ithreads you must also use the PerlIO layer.
3703 *** Cannot continue, aborting.
3709 case "$d_oldpthreads" in
3710 '') : Configure tests would be welcome here. For now, assume undef.
3712 *) val="$d_oldpthreads" ;;
3718 : Look for a hint-file generated 'call-back-unit'. If the
3719 : user has specified that a threading perl is to be built,
3720 : we may need to set or change some other defaults.
3721 if $test -f usethreads.cbu; then
3722 echo "Your platform has some specific hints regarding threaded builds, using them..."
3725 case "$usethreads" in
3726 "$define"|true|[yY]*)
3728 (Your platform does not have any specific hints for threaded builds.
3729 Assuming POSIX threads, then.)
3737 Perl can be built so that multiple Perl interpreters can coexist
3738 within the same Perl executable.
3741 case "$useithreads" in
3744 This multiple interpreter support is required for interpreter-based threads.
3748 *) case "$usemultiplicity" in
3749 $define|true|[yY]*) dflt='y';;
3753 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3754 rp='Build Perl for multiplicity?'
3757 y|Y) val="$define" ;;
3766 case "$usemorebits" in
3767 "$define"|true|[yY]*)
3768 use64bitint="$define"
3769 uselongdouble="$define"
3770 usemorebits="$define"
3772 *) usemorebits="$undef"
3776 : make some quick guesses about what we are up against
3778 $echo $n "Hmm... $c"
3788 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3789 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3791 echo "Looks kind of like an OSF/1 system, but we'll see..."
3793 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3794 xxx=`./loc addbib blurfl $pth`
3795 if $test -f $xxx; then
3796 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3800 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3801 echo "Looks kind of like an extended USG system, but we'll see..."
3803 echo "Looks kind of like a USG system, but we'll see..."
3807 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3808 echo "Looks kind of like a BSD system, but we'll see..."
3812 echo "Looks kind of like a Version 7 system, but we'll see..."
3815 case "$eunicefix" in
3818 There is, however, a strange, musty smell in the air that reminds me of
3819 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3823 : it so happens the Eunice I know will not run shell scripts in Unix format
3827 echo "Congratulations. You aren't running Eunice."
3831 : Detect OS2. The p_ variable is set above in the Head.U unit.
3832 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3833 : semicolon as a patch separator
3838 I have the feeling something is not exactly right, however...don't tell me...
3839 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3840 (Or you may be running DOS with DJGPP.)
3845 if test -f /xenix; then
3846 echo "Actually, this looks more like a XENIX system..."
3851 echo "It's not Xenix..."
3856 if test -f /venix; then
3857 echo "Actually, this looks more like a VENIX system..."
3864 echo "Nor is it Venix..."
3867 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3868 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3875 rp="Use which C compiler?"
3879 : See if they have not cc but they do have gcc
3881 : Look for a hint-file generated 'call-back-unit'. Now that the
3882 : user has specified the compiler, we may need to set or change some
3884 if $test -f cc.cbu; then
3890 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3896 printf("%s\n", __VERSION__);
3898 printf("%s\n", "1");
3904 if $cc -o try $ccflags $ldflags try.c; then
3905 gccversion=`$run ./try`
3906 case "$gccversion" in
3907 '') echo "You are not using GNU cc." ;;
3908 *) echo "You are using GNU cc $gccversion."
3914 echo "*** WHOA THERE!!! ***" >&4
3915 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3916 case "$knowitall" in
3918 echo " You'd better start hunting for one and let me know about it." >&4
3924 case "$gccversion" in
3925 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3927 case "$gccversion" in
3928 '') gccosandvers='' ;;
3929 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3930 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3932 case "$gccosandvers" in
3933 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3934 $osname$osvers) ;; # looking good
3935 $osname*) cat <<EOM >&4
3937 *** WHOA THERE!!! ***
3939 Your gcc has not been compiled for the exact release of
3940 your operating system ($gccosandvers versus $osname$osvers).
3942 In general it is a good idea to keep gcc synchronized with
3943 the operating system because otherwise serious problems
3944 may ensue when trying to compile software, like Perl.
3946 I'm trying to be optimistic here, though, and will continue.
3947 If later during the configuration and build icky compilation
3948 problems appear (headerfile conflicts being the most common
3949 manifestation), I suggest reinstalling the gcc to match
3950 your operating system release.
3954 *) gccosandvers='' ;; # failed to parse, better be silent
3962 # gcc 3.* complain about adding -Idirectories that they already know about,
3963 # so we will take those off from locincpth.
3964 case "$gccversion" in
3966 echo "main(){}">try.c
3967 for incdir in $locincpth; do
3968 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3969 grep '^c[cp]p*[01]: warning: changing search order '`
3970 if test "X$warn" != X; then
3971 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3977 : decide how portable to be. Allow command line overrides.
3978 case "$d_portable" in
3980 *) d_portable="$define" ;;
3983 : set up shell script to do ~ expansion
3989 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3992 if $test -f /bin/csh; then
3993 /bin/csh -f -c "glob \$1"
3998 name=\`$expr x\$1 : '..\([^/]*\)'\`
3999 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
4000 if $test ! -d "\$dir"; then
4002 echo "\$me: can't locate home directory for: \$name" >&2
4007 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4023 : now set up to get a file name
4027 cat <<'EOSC' >>getfile
4043 : getfile will accept an answer from the comma-separated list
4044 : enclosed in parentheses even if it does not meet other criteria.
4045 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4046 fn=`echo $fn | sed 's/(.*)//'`
4052 loc_file=`expr $fn : '.*:\(.*\)'`
4053 fn=`expr $fn : '\(.*\):.*'`
4061 */*) fullpath=true;;
4070 *e*) exp_file=true;;
4073 *p*) nopath_ok=true;;
4078 *d*) type='Directory';;
4079 *l*) type='Locate';;
4084 Locate) what='File';;
4089 case "$d_portable" in
4097 while test "$type"; do
4102 true) rp="$rp (~name ok)";;
4105 if test -f UU/getfile.ok && \
4106 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4125 value=`UU/filexp $ans`
4128 if test "$ans" != "$value"; then
4129 echo "(That expands to $value on this system.)"
4143 /*) value="$ansexp" ;;
4144 [a-zA-Z]:/*) value="$ansexp" ;;
4149 echo "I shall only accept a full path name, as in /bin/ls." >&4
4150 echo "Use a ! shell escape if you wish to check pathnames." >&4
4153 echo "Please give a full path name, starting with slash." >&4
4156 echo "Note that using ~name is ok provided it expands well." >&4
4169 for fp in $gfpth; do
4170 if test "X$fp" = X.; then
4175 if test -f "$pf"; then
4177 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4179 echo "($value is not a plain file, but that's ok.)"
4182 if test X"$type" = X; then
4189 for fp in $gfpth; do
4190 if test "X$fp" = X.; then
4195 direxp="$fp/$ansexp"
4197 if test -d "$direxp"; then
4205 if test -d "$ansexp"; then
4206 echo "(Looking for $loc_file in directory $value.)"
4207 value="$value/$loc_file"
4208 ansexp="$ansexp/$loc_file"
4210 if test -f "$ansexp"; then
4213 case "$nopath_ok" in
4214 true) case "$value" in
4216 *) echo "Assuming $value will be in people's path."
4232 if test "$fastread" = yes; then
4237 rp="$what $value doesn't exist. Use that name anyway?"
4256 test "X$gfpthkeep" != Xy && gfpth=""
4259 : What should the include directory be ?
4261 $echo $n "Hmm... $c"
4265 if $test -f /bin/mips && /bin/mips; then
4266 echo "Looks like a MIPS system..."
4267 $cat >usr.c <<'EOCP'
4268 #ifdef SYSTYPE_BSD43
4272 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4273 dflt='/bsd43/usr/include'
4277 mips_type='System V'
4279 $rm -f usr.c usr.out
4280 echo "and you're compiling with the $mips_type compiler and libraries."
4284 echo "Doesn't look like a MIPS system."
4294 case "$xxx_prompt" in
4297 rp='Where are the include files you want to use?'
4305 : see how we invoke the C preprocessor
4307 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4308 cat <<'EOT' >testcpp.c
4314 if test ! -f cppstdin; then
4315 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4316 # AIX cc -E doesn't show the absolute headerfile
4317 # locations but we'll cheat by using the -M flag.
4318 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
4320 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4323 echo "Keeping your $hint cppstdin wrapper."
4326 wrapper=`pwd`/cppstdin
4330 if $test "X$cppstdin" != "X" && \
4331 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4332 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4334 echo "You used to use $cppstdin $cppminus so we'll use that again."
4336 '') echo "But let's see if we can live without a wrapper..." ;;
4338 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4339 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4341 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4344 echo "(However, $cpprun $cpplast does not work, let's see...)"
4352 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4359 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4360 $cc -E <testcpp.c >testcpp.out 2>&1; \
4361 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4362 echo "Yup, it does."
4365 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4366 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4367 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4368 echo "Yup, it does."
4371 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4372 $cc -P <testcpp.c >testcpp.out 2>&1; \
4373 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4374 echo "Yipee, that works!"
4377 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4378 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4379 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4380 echo "At long last!"
4383 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4384 $cpp <testcpp.c >testcpp.out 2>&1; \
4385 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4389 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4390 $cpp - <testcpp.c >testcpp.out 2>&1; \
4391 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4392 echo "Hooray, it works! I was beginning to wonder."
4395 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4396 $wrapper <testcpp.c >testcpp.out 2>&1; \
4397 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4403 rp="No dice. I can't find a C preprocessor. Name one:"
4407 $x_cpp <testcpp.c >testcpp.out 2>&1
4408 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4409 echo "OK, that will do." >&4
4411 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4426 echo "Perhaps can we force $cc -E using a wrapper..."
4427 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4428 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4434 echo "Nope, we'll have to live without it..."
4448 "$wrapper"|'cppstdin') ;;
4449 *) $rm -f $wrapper;;
4451 $rm -f testcpp.c testcpp.out
4453 : Set private lib path
4456 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4461 '') dlist="$loclibpth $plibpth $glibpth";;
4462 *) dlist="$libpth";;
4465 : Now check and see which directories actually exist, avoiding duplicates
4469 if $test -d $xxx; then
4472 *) libpth="$libpth $xxx";;
4478 Some systems have incompatible or broken versions of libraries. Among
4479 the directories listed in the question below, please remove any you
4480 know not to be holding relevant libraries, and add any that are needed.
4481 Say "none" for none.
4492 rp="Directories to use for library searches?"
4499 : compute shared library extension
4502 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4512 On some systems, shared libraries may be available. Answer 'none' if
4513 you want to suppress searching of shared libraries for the remainder
4514 of this configuration.
4517 rp='What is the file extension used for shared libraries?'
4521 : Define several unixisms.
4522 : Hints files or command line option can be used to override them.
4523 : The convoluted testing is in case hints files set either the old
4526 '') case "$exe_ext" in
4528 *) _exe="$exe_ext" ;;
4533 '') case "$lib_ext" in
4540 '') case "$obj_ext" in
4547 '') case "$path_sep" in
4558 : Which makefile gets called first. This is used by make depend.
4559 case "$firstmakefile" in
4560 '') firstmakefile='makefile';;
4564 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4567 case "$uselongdouble" in
4568 $define|true|[yY]*) dflt='y';;
4573 Perl can be built to take advantage of long doubles which
4574 (if available) may give more accuracy and range for floating point numbers.
4576 If this doesn't make any sense to you, just accept the default '$dflt'.
4578 rp='Try to use long doubles if available?'
4581 y|Y) val="$define" ;;
4587 case "$uselongdouble" in
4588 true|[yY]*) uselongdouble="$define" ;;
4591 : Look for a hint-file generated 'call-back-unit'. If the
4592 : user has specified that long doubles should be used,
4593 : we may need to set or change some other defaults.
4594 if $test -f uselongdouble.cbu; then
4595 echo "Your platform has some specific hints regarding long doubles, using them..."
4596 . ./uselongdouble.cbu
4598 case "$uselongdouble" in
4601 (Your platform does not have any specific hints for long doubles.)
4607 : Looking for optional libraries
4609 echo "Checking for optional libraries..." >&4
4614 case "$libswanted" in
4615 '') libswanted='c_s';;
4618 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4624 for thisdir in $libpth $xlibpth; do
4625 test -d $thisdir && libspath="$libspath $thisdir"
4627 for thislib in $libswanted; do
4628 for thisdir in $libspath; do
4630 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4631 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4632 $test -f "$xxx" && eval $libscheck
4633 $test -f "$xxx" && libstyle=shared
4635 if test ! -f "$xxx"; then
4636 xxx=$thisdir/lib$thislib.$so
4637 $test -f "$xxx" && eval $libscheck
4638 $test -f "$xxx" && libstyle=shared
4640 if test ! -f "$xxx"; then
4641 xxx=$thisdir/lib$thislib$_a
4642 $test -f "$xxx" && eval $libscheck
4643 $test -f "$xxx" && libstyle=static
4645 if test ! -f "$xxx"; then
4646 xxx=$thisdir/$thislib$_a
4647 $test -f "$xxx" && eval $libscheck
4648 $test -f "$xxx" && libstyle=static
4650 if test ! -f "$xxx"; then
4651 xxx=$thisdir/lib${thislib}_s$_a
4652 $test -f "$xxx" && eval $libscheck
4653 $test -f "$xxx" && libstyle=static
4654 $test -f "$xxx" && thislib=${thislib}_s
4656 if test ! -f "$xxx"; then
4657 xxx=$thisdir/Slib$thislib$_a
4658 $test -f "$xxx" && eval $libscheck
4659 $test -f "$xxx" && libstyle=static
4661 if $test -f "$xxx"; then
4663 shared) echo "Found -l$thislib (shared)." ;;
4664 static) echo "Found -l$thislib." ;;
4665 *) echo "Found -l$thislib ($libstyle)." ;;
4669 *) dflt="$dflt -l$thislib"
4670 libsfound="$libsfound $xxx"
4672 libsfiles="$libsfiles $yyy"
4673 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4674 case " $libsdirs " in
4676 *) libsdirs="$libsdirs $yyy" ;;
4683 if $test ! -f "$xxx"; then
4684 echo "No -l$thislib."
4695 ' '|'') dflt='none';;
4700 In order to compile $package on your machine, a number of libraries
4701 are usually needed. Include any other special libraries here as well.
4702 Say "none" for none. The default list is almost always right.
4706 rp="What libraries to use?"
4713 : determine optimization, if desired, or use for debug flag also
4715 ' '|$undef) dflt='none';;
4717 *) dflt="$optimize";;
4721 By default, $package compiles with the -O flag to use the optimizer.
4722 Alternately, you might want to use the symbolic debugger, which uses
4723 the -g flag (on traditional Unix systems). Either flag can be
4724 specified here. To use neither flag, specify the word "none".
4727 rp="What optimizer/debugger flag should be used?"
4731 'none') optimize=" ";;
4735 : We will not override a previous value, but we might want to
4736 : augment a hint file
4738 default|recommended)
4739 case "$gccversion" in
4740 1*) dflt='-fpcc-struct-return' ;;
4743 *-g*) dflt="$dflt -DDEBUGGING";;
4745 case "$gccversion" in
4746 2*) if test -d /etc/conf/kconfig.d &&
4747 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4749 # Interactive Systems (ISC) POSIX mode.
4754 case "$gccversion" in
4758 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4759 echo 'int main(void) { return 0; }' > gcctest.c
4760 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4761 echo "Yes, it does." 2>&1
4764 echo "Leaving current flags $ccflags alone." 2>&1
4766 *) dflt="$dflt -fno-strict-aliasing" ;;
4769 echo "Nope, it doesn't, but that's ok." 2>&1
4773 # For gcc, adding -pipe speeds up compilations for some, but apparently
4774 # some assemblers can't read from stdin. (It also slows down compilations
4775 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4776 case "$gccversion" in
4778 echo "Checking if your compiler accepts -pipe" 2>&1
4779 echo 'int main(void) { return 0; }' > gcctest.c
4780 if $cc -pipe -o gcctest gcctest.c; then
4781 echo "Yes, it does." 2>&1
4784 echo "Leaving current flags $ccflags alone." 2>&1
4786 *) dflt="$dflt -pipe" ;;
4789 echo "Nope, it doesn't, but that's ok." 2>&1
4792 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4793 echo 'int main(void) { return 0; }' > gcctest.c
4794 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4795 echo "Yes, it does." 2>&1
4797 *-Wdeclaration-after-statement*)
4798 echo "Leaving current flags $ccflags alone." 2>&1
4800 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4803 echo "Nope, it doesn't, but that's ok." 2>&1