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 Apr 17 14:14:39 CEST 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
322 initialinstalllocation=''
350 d_attribute_format=''
351 d_attribute_malloc=''
352 d_attribute_nonnull=''
353 d_attribute_noreturn=''
355 d_attribute_unused=''
356 d_attribute_warn_unused_result=''
359 d_builtin_choose_expr=''
405 endhostent_r_proto=''
411 endprotoent_r_proto=''
417 endservent_r_proto=''
469 gethostbyaddr_r_proto=''
471 gethostbyname_r_proto=''
473 gethostent_r_proto=''
485 getnetbyaddr_r_proto=''
487 getnetbyname_r_proto=''
501 d_getprotobyname_r=''
502 getprotobyname_r_proto=''
503 d_getprotobynumber_r=''
504 getprotobynumber_r_proto=''
506 getprotoent_r_proto=''
518 getservbyname_r_proto=''
520 getservbyport_r_proto=''
522 getservent_r_proto=''
546 d_libm_lib_version=''
559 d_malloc_good_size=''
601 d_old_pthread_create_joinable=''
602 old_pthread_create_joinable=''
604 d_pthread_attr_setscope=''
643 sethostent_r_proto=''
660 setprotoent_r_proto=''
672 setservent_r_proto=''
705 d_sprintf_returns_strlen=''
720 d_stdio_ptr_lval_nochange_cnt=''
721 d_stdio_ptr_lval_sets_cnt=''
924 d_inc_version_list=''
926 inc_version_list_init=''
945 ignore_versioned_solibs=''
1009 d_perl_otherlibdirs=''
1017 api_versionstring=''
1023 version_patchlevel_string=''
1027 d_nv_preserves_uv=''
1028 d_nv_zero_is_allbits_zero=''
1039 nv_preserves_uv_bits=''
1111 installsitehtml1dir=''
1114 installsitehtml3dir=''
1121 installsiteman1dir=''
1124 installsiteman3dir=''
1129 installsitescript=''
1144 d_stdio_stream_array=''
1145 stdio_stream_array=''
1156 ccflags_uselargefiles=''
1157 ldflags_uselargefiles=''
1158 libswanted_uselargefiles=''
1178 installvendorarch=''
1185 installvendorhtml1dir=''
1187 vendorhtml1direxp=''
1188 installvendorhtml3dir=''
1190 vendorhtml3direxp=''
1196 installvendorman1dir=''
1199 installvendorman3dir=''
1206 installvendorscript=''
1218 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1221 : We must find out about Eunice early
1223 if test -f /etc/unixtovms; then
1224 eunicefix=/etc/unixtovms
1226 if test -f /etc/unixtovms.exe; then
1227 eunicefix=/etc/unixtovms.exe
1230 : Set executable suffix now -- needed before hints available
1231 if test -f "/libs/version.library"; then
1234 elif test -f "/system/gnu_library/bin/ar.pm"; then
1237 elif test -n "$DJGPP"; then
1240 elif test -d c:/. -o -n "$is_os2" ; then
1249 : set useposix=false in your hint file to disable the POSIX extension.
1251 : set useopcode=false in your hint file to disable the Opcode extension.
1253 : Trailing extension. Override this in a hint file, if needed.
1254 : Extra object files, if any, needed on this platform.
1257 : Possible local include directories to search.
1258 : Set locincpth to "" in a hint file to defeat local include searches.
1259 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1260 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1262 : no include file wanted by default
1265 : Enable -DEBUGGING and -DDEBUGGING from the command line
1271 : change the next line if compiling for Xenix/286 on Xenix/386
1272 xlibpth='/usr/lib/386 /lib/386'
1273 : Possible local library directories to search.
1274 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1275 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1277 : general looking path for locating libraries
1278 glibpth="/lib /usr/lib $xlibpth"
1279 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1280 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1281 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1283 : Private path used by Configure to find libraries. Its value
1284 : is prepended to libpth. This variable takes care of special
1285 : machines, like the mips. Usually, it should be empty.
1288 : default library list
1290 : some systems want to use only the non-versioned libso:s
1291 ignore_versioned_solibs=''
1296 ccflags_uselargefiles=''
1297 ldflags_uselargefiles=''
1298 libswanted_uselargefiles=''
1299 : set usemultiplicity on the Configure command line to enable multiplicity.
1300 : set usesocks on the Configure command line to enable socks.
1301 : set usethreads on the Configure command line to enable threads.
1302 usereentrant='undef'
1303 : full support for void wanted by default
1306 : List of libraries we want.
1307 : If anyone needs extra -lxxx, put those in a hint file.
1308 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1309 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1310 : We probably want to search /usr/shlib before most other libraries.
1311 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1312 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1313 glibpth="/usr/shlib $glibpth"
1314 : Do not use vfork unless overridden by a hint file.
1317 : Find the basic shell for Bourne shell scripts
1321 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1324 if test -f "$xxx"; then
1327 : Build up a list and do a single loop so we can 'break' out.
1328 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1329 for xxx in sh bash ksh pdksh ash; do
1331 try="$try ${p}/${xxx}"
1335 if test -f "$xxx"; then
1338 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1341 elif test -f "$xxx.exe"; then
1352 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1354 Usually it's in /bin/sh. How did you even get this far?
1355 Please contact me (Perl Maintainers) at perlbug@perl.org and
1356 we'll try to straighten this all out.
1362 : see if sh knows # comments
1363 if `$sh -c '#' >/dev/null 2>&1`; then
1367 test -f $xcat$_exe || xcat=/usr/bin/cat
1368 if test ! -f $xcat$_exe; then
1369 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1370 if test -f $p/cat$_exe; then
1375 if test ! -f $xcat$_exe; then
1376 echo "Can't find cat anywhere!"
1380 echo "#!$xcat" >sharp
1384 if test -s today; then
1387 echo "#! $xcat" > sharp
1391 if test -s today; then
1399 echo "Your $sh doesn't grok # comments--I will strip them later on."
1402 echo "exec grep -v '^[ ]*#'" >spitshell
1404 $eunicefix spitshell
1405 spitshell=`pwd`/spitshell
1407 echo "I presume that if # doesn't work, #! won't work either!"
1412 : figure out how to guarantee sh startup
1414 '') startsh=${sharpbang}${sh} ;;
1426 : echo "Yup, it does."
1428 echo "Hmm... '$startsh' does not guarantee sh startup..."
1429 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1434 : Save command line options in file UU/cmdline.opt for later use in
1435 : generating config.sh.
1436 cat > cmdline.opt <<EOSH
1437 # Configure command line arguments.
1446 cat >>cmdline.opt <<EOSH
1447 config_arg$argn='$arg'
1449 # Extreme backslashitis: replace each ' by '"'"'
1450 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1453 arg_exp=`cat cmdl.opt`
1454 args_exp="$args_exp$args_sep'$arg_exp'"
1455 argn=`expr $argn + 1`
1458 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1459 # used by ./hints/os2.sh
1462 : produce awk script to parse command line options
1463 cat >options.awk <<'EOF'
1465 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1467 len = length(optstr);
1468 for (i = 1; i <= len; i++) {
1469 c = substr(optstr, i, 1);
1470 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1481 if (substr(str, 1, 1) != "-") {
1482 printf("'%s'\n", str);
1486 for (i = 2; i <= len; i++) {
1487 c = substr(str, i, 1);
1489 printf("-%s\n", substr(str, i));
1495 printf("'%s'\n", substr(str, i + 1));
1508 : process the command line options
1509 set X `for arg in "$@"; do echo "X$arg"; done |
1510 sed -e s/X// | awk -f options.awk`
1515 : set up default values
1525 rm -f optdef.sh posthint.sh
1526 cat >optdef.sh <<EOS
1532 while test $# -gt 0; do
1534 -d) shift; fastread=yes;;
1535 -e) shift; alldone=cont;;
1539 if test -r "$1"; then
1542 echo "$me: cannot read config file $1." >&2
1547 -h) shift; error=true;;
1548 -r) shift; reuseval=true;;
1549 -s) shift; silent=true; realsilent=true;;
1550 -E) shift; alldone=exit;;
1551 -K) shift; knowitall=true;;
1552 -O) shift; override=true;;
1553 -S) shift; silent=true; extractsh=true;;
1558 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1559 echo "$me: ignoring -D $1" >&2
1562 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1563 *) echo "$1='define'" >> optdef.sh;;
1570 *=) echo "$1" >> optdef.sh;;
1572 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1573 echo "$me: ignoring -U $1" >&2
1575 *) echo "$1='undef'" >> optdef.sh;;
1586 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1590 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1591 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1597 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1598 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1599 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1600 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1601 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1602 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1608 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1610 echo "$yyy=''" >> posthint.sh ;;
1615 echo "$yyy='$zzz'" >> posthint.sh ;;
1617 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1619 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1624 echo "$yyy=$zzz" >> posthint.sh ;;
1625 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1629 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1632 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1640 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1641 [-U symbol] [-U symbol=] [-A command:symbol...]
1642 -d : use defaults for all answers.
1643 -e : go on without questioning past the production of config.sh.
1644 -f : specify an alternate default configuration file.
1645 -h : print this help message and exit (with an error status).
1646 -r : reuse C symbols value if possible (skips costly nm extraction).
1647 -s : silent mode, only echoes questions and essential information.
1648 -D : define symbol to have some value:
1649 -D symbol symbol gets the value 'define'
1650 -D symbol=value symbol gets the value 'value'
1651 -E : stop at the end of questions, after having produced config.sh.
1652 -K : do not use unless you know what you are doing.
1653 -O : let -D and -U override definitions from loaded configuration file.
1654 -S : perform variable substitutions on all .SH files (can mix with -f)
1655 -U : undefine symbol:
1656 -U symbol symbol gets the value 'undef'
1657 -U symbol= symbol gets completely empty
1658 -A : manipulate symbol after the platform specific hints have been applied:
1659 -A symbol=value append " "value to symbol
1660 -A append:symbol=value append value to symbol
1661 -A define:symbol=value define symbol to have value
1662 -A clear:symbol define symbol to be ''
1663 -A define:symbol define symbol to be 'define'
1664 -A eval:symbol=value define symbol to be eval of value
1665 -A prepend:symbol=value prepend value to symbol
1666 -A undef:symbol define symbol to be 'undef'
1667 -A undef:symbol= define symbol to be ''
1668 -V : print version number and exit (with a zero status).
1675 case "$fastread$alldone" in
1678 case "$extractsh" in
1681 if test ! -t 0; then
1682 echo "Say 'sh Configure', not 'sh <Configure'"
1692 true) exec 1>/dev/null;;
1695 : run the defines and the undefines, if any, but leave the file out there...
1698 : create the posthint manipulation script and leave the file out there...
1703 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1704 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1705 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1706 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1707 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1710 : Some greps do not return status, grrr.
1711 echo "grimblepritz" >grimble
1712 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1714 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1720 : the following should work in any shell
1724 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1725 cat >contains <<'EOSS'
1726 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1731 : Find the path to the source tree
1734 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1738 *) src=`cd ../$src && pwd` ;;
1751 if test -f $rsrc/Configure && \
1752 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1754 : found it, so we are ok.
1757 for src in . .. ../.. ../../.. ../../../..; do
1758 if test -f ../$src/Configure && \
1759 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1770 Sorry, I can't seem to locate the source dir for $package. Please start
1771 Configure with an explicit path -- i.e. /some/path/Configure.
1779 echo "Sources for $package found in \"$src\"." >&4
1783 : script used to extract .SH files with variable substitutions
1784 cat >extract <<'EOS'
1786 echo "Doing variable substitutions on .SH files..."
1787 if test -f MANIFEST; then
1788 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1790 echo "(Looking for .SH files under the source directory.)"
1791 set x `(cd "$src"; find . -name "*.SH" -print)`
1795 0) set x `(cd "$src"; echo *.SH)`; shift;;
1797 if test ! -f "$src/$1"; then
1803 while test $name; do
1804 if test ! -d "$name"; then
1805 create="$name $create";
1806 name=`echo $name | sed -e "s|^[^/]*$||"`;
1807 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1812 for file in $create; do
1821 dir=`expr X$file : 'X\(.*\)/'`
1822 file=`expr X$file : 'X.*/\(.*\)'`
1823 (cd "$dir" && . ./$file)
1833 dir=`expr X$file : 'X\(.*\)/'`
1834 file=`expr X$file : 'X.*/\(.*\)'`
1835 (set x $dir; shift; eval $mkdir_p)
1836 sh <"$src/$dir/$file"
1845 if test -f "$src/config_h.SH"; then
1846 if test ! -f config.h; then
1847 : oops, they left it out of MANIFEST, probably, so do it anyway.
1848 . "$src/config_h.SH"
1853 : extract files and exit if asked to do so
1854 case "$extractsh" in
1856 case "$realsilent" in
1860 case "$config_sh" in
1861 '') config_sh='config.sh';;
1864 echo "Fetching answers from $config_sh..."
1867 test "$override" && . ./optdef.sh
1871 echo "Extraction done."
1876 : Eunice requires " " instead of "", can you believe it
1879 echo "Beginning of configuration questions for $package."
1881 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1883 : first determine how to suppress newline on echo command
1885 echo "Checking echo to see how to suppress newlines..."
1886 (echo "hi there\c" ; echo " ") >.echotmp
1887 if $contains c .echotmp >/dev/null 2>&1 ; then
1898 echo $n "The star should be here-->$c"
1902 : Now test for existence of everything in MANIFEST
1904 if test -f "$rsrc/MANIFEST"; then
1905 echo "First let's make sure your kit is complete. Checking..." >&4
1906 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1909 for filelist in x??; do
1910 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1912 if test -s missing; then
1916 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1918 You have the option of continuing the configuration process, despite the
1919 distinct possibility that your kit is damaged, by typing 'y'es. If you
1920 do, don't blame me if something goes wrong. I advise you to type 'n'o
1921 and contact the author (perlbug@perl.org).
1924 echo $n "Continue? [n] $c" >&4
1928 echo "Continuing..." >&4
1932 echo "ABORTING..." >&4
1937 echo "Looks good..."
1940 echo "There is no MANIFEST file. I hope your kit is complete !"
1945 : Find the appropriate value for a newline for tr
1946 if test -n "$DJGPP"; then
1949 if test X"$trnl" = X; then
1950 case "`echo foo|tr '\n' x 2>/dev/null`" in
1954 if test X"$trnl" = X; then
1955 case "`echo foo|tr '\012' x 2>/dev/null`" in
1956 foox) trnl='\012' ;;
1959 if test X"$trnl" = X; then
1960 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1961 fooxy) trnl='\n\r' ;;
1964 if test X"$trnl" = X; then
1967 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1973 : compute the number of columns on the terminal for proper question formatting
1978 : set up the echo used in my read
1979 myecho="case \"\$xxxm\" in
1980 '') echo $n \"\$rp $c\" >&4;;
1982 '') echo $n \"[\$xxxm] $c\";;
1984 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1986 echo $n \"[\$xxxm] $c\" >&4
1988 echo $n \"\$rp [\$xxxm] $c\" >&4
1994 : now set up to do reads with possible shell escape and default assignment
2000 case "\$fastread" in
2001 yes) case "\$dflt" in
2004 case "\$silent-\$rp" in
2009 *) case "\$silent" in
2010 true) case "\$rp" in
2015 while expr "X\$ans" : "X!" >/dev/null; do
2019 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2027 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2036 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2041 echo "(OK, I'll run with -d after this question.)" >&4
2044 echo "*** Sorry, \$1 not supported yet." >&4
2054 echo "*** Substitution done -- please confirm."
2056 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2061 echo "*** Error -- try again."
2068 case "\$ans\$xxxm\$nostick" in
2080 : create .config dir to save info across Configure sessions
2081 test -d ../.config || mkdir ../.config
2082 cat >../.config/README <<EOF
2083 This directory created by Configure to save information that should
2084 persist across sessions for $package.
2086 You may safely delete it if you wish.
2089 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2091 $define|true|[yY]*) ;;
2092 *) case "$xversion" in
2095 *** WHOA THERE!!! ***
2097 This is an UNSTABLE DEVELOPMENT release.
2098 The version of this $package distribution is $xversion, that is, odd,
2099 (as opposed to even) and that signifies a development release.
2100 If you want a maintenance release, you want an even-numbered version.
2102 Do ***NOT*** install this into production use.
2103 Data corruption and crashes are possible.
2105 It is most seriously suggested that you do not continue any further
2106 unless you want to help in developing and debugging Perl.
2108 If you *still* want to build perl, you can answer 'y' now,
2109 or pass -Dusedevel to Configure.
2112 rp='Do you really want to continue?'
2116 [yY]) echo >&4 "Okay, continuing."
2117 usedevel="$define" ;;
2118 *) echo >&4 "Okay, bye."
2128 case "$versiononly" in
2129 '') versiononly="$define" ;;
2131 case "$installusrbinperl" in
2132 '') installusrbinperl="$undef" ;;
2137 : general instructions
2140 user=`(logname) 2>/dev/null`
2142 '') user=`whoami 2>&1`;;
2144 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2147 rp='Would you like to see the instructions?'
2158 This installation shell script will examine your system and ask you questions
2159 to determine how the perl5 package should be installed. If you get
2160 stuck on a question, you may use a ! shell escape to start a subshell or
2161 execute a command. Many of the questions will have default answers in square
2162 brackets; typing carriage return will give you the default.
2164 On some of the questions which ask for file or directory names you are allowed
2165 to use the ~name construct to specify the login directory belonging to "name",
2166 even if you don't have a shell which knows about that. Questions where this is
2167 allowed will be marked "(~name ok)".
2171 dflt='Type carriage return to continue'
2175 The prompter used in this script allows you to use shell variables and
2176 backticks in your answers. You may use $1, $2, etc... to refer to the words
2177 in the default answer, as if the default line was a set of arguments given to a
2178 script shell. This means you may also use $* to repeat the whole default line,
2179 so you do not have to re-type everything to add something to the default.
2181 Everytime there is a substitution, you will have to confirm. If there is an
2182 error (e.g. an unmatched backtick), the default answer will remain unchanged
2183 and you will be prompted again.
2185 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2186 the questions and use the computed defaults (or the previous answers if there
2187 was already a config.sh file). Type 'Configure -h' for a list of options.
2188 You may also start interactively and then answer '& -d' at any prompt to turn
2189 on the non-interactive behaviour for the remainder of the execution.
2195 Much effort has been expended to ensure that this shell script will run on any
2196 Unix system. If despite that it blows up on yours, your best bet is to edit
2197 Configure and run it again. If you can't run Configure for some reason,
2198 you'll have to generate a config.sh file by hand. Whatever problems you
2199 have, let me (perlbug@perl.org) know how I blew it.
2201 This installation script affects things in two ways:
2203 1) it may do direct variable substitutions on some of the files included
2205 2) it builds a config.h file for inclusion in C programs. You may edit
2206 any of these files as the need arises after running this script.
2208 If you make a mistake on a question, there is no easy way to back up to it
2209 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2210 files. Configure will offer to let you do this before it runs the SH files.
2213 dflt='Type carriage return to continue'
2215 case "$firsttime" in
2216 true) echo $user >>../.config/instruct;;
2220 : find out where common programs are
2222 echo "Locating common programs..." >&4
2235 if test -d \$dir/\$thing; then
2241 for thisthing in \$dir/\$thing; do
2242 : just loop through to pick last item
2244 if test -f \$thisthing; then
2247 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2250 elif test -f \$dir/\$thing.exe; then
2251 if test -n "$DJGPP"; then
2252 echo \$dir/\$thing.exe
2253 elif test "$eunicefix" != ":"; then
2254 : on Eunice apparently
2308 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2309 pth="$pth /lib /usr/lib"
2310 for file in $loclist; do
2314 if test -f "$xxx"; then
2317 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2318 xxx=`./loc $file $file $pth`
2321 '') xxx=`./loc $file $file $pth`;;
2322 *) xxx=`./loc $xxx $xxx $pth`;;
2324 eval $file=$xxx$_exe
2328 echo $file is in $xxx.
2331 echo $file is in $xxx.
2334 echo "I don't know where '$file' is, and my life depends on it." >&4
2335 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2341 echo "Don't worry if any of the following aren't found..."
2343 for file in $trylist; do
2347 if test -f "$xxx"; then
2350 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2351 xxx=`./loc $file $file $pth`
2354 '') xxx=`./loc $file $file $pth`;;
2355 *) xxx=`./loc $xxx $xxx $pth`;;
2357 eval $file=$xxx$_exe
2361 echo $file is in $xxx.
2364 echo $file is in $xxx.
2367 echo "I don't see $file out there, $say."
2374 echo "Substituting grep for egrep."
2381 echo "Substituting cp for ln."
2390 echo "I can't find make or gmake, and my life depends on it." >&4
2391 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2399 *) # We can't have osname yet.
2400 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2401 # Assume that gmake, if found, is definitely GNU make
2402 # and prefer it over the system make.
2403 echo "Substituting gmake for make."
2411 echo "Hopefully test is built into your sh."
2414 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2415 echo "Using the test built into your sh."
2423 echo "Hopefully echo is built into your sh."
2428 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2429 $echo $n "hi there$c" >foo1
2430 echo $n "hi there$c" >foo2
2431 if cmp foo1 foo2 >/dev/null 2>&1; then
2432 echo "They are compatible. In fact, they may be identical."
2439 They are not compatible! You are probably running ksh on a non-USG system.
2440 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2441 have echo built in and we may have to run some Bourne shell scripts. That
2442 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2445 $echo $n "The star should be here-->$c"
2455 cat <<'EOSC' >>trygcc
2460 int main(int argc, char *argv[]) {
2464 if $cc -o try $ccflags $ldflags try.c; then
2467 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2473 case "`$cc -v -c try.c 2>&1`" in
2476 if $test X"$trygcc" = Xyes; then
2477 if gcc -o try -c try.c; then
2479 echo "You seem to have a working gcc, though." >&4
2480 rp="Would you like to use it?"
2482 if $test -f myread; then
2485 if $test -f UU/myread; then
2488 echo "Cannot find myread, sorry. Aborting." >&2
2493 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2494 if $test -f usethreads.cbu; then
2497 *** However, any setting of the C compiler flags (e.g. for thread support)
2498 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2499 *** (together with e.g. -Dusethreads).
2515 cat <<'EOSC' >>checkcc
2520 int main(int argc, char *argv[]) {
2524 if $cc -o try $ccflags $ldflags try.c; then
2527 if $test X"$despair" = Xyes; then
2528 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2531 You need to find a working C compiler.
2532 Either (purchase and) install the C compiler supplied by your OS vendor,
2533 or for a free C compiler try http://gcc.gnu.org/
2534 I cannot continue any further, aborting.
2543 : determine whether symbolic links are supported
2546 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2547 echo "Symbolic links are supported." >&4
2550 echo "Symbolic links are NOT supported." >&4
2555 : determine whether symbolic links are supported
2559 echo "Checking how to test for symbolic links..." >&4
2561 if $test "X$issymlink" = X; then
2563 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2564 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2566 if test $? = 0; then
2569 echo "Your builtin 'test -h' may be broken." >&4
2572 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2575 if test -f "$p/$test"; then
2584 echo "Trying external '$test -h'." >&4
2585 issymlink="$test -h"
2586 if $test ! -h sym >/dev/null 2>&1; then
2587 echo "External '$test -h' is broken, too." >&4
2595 if $test "X$issymlink" = X; then
2596 if $test -L sym 2>/dev/null; then
2597 issymlink="$test -L"
2598 echo "The builtin '$test -L' worked." >&4
2601 if $test "X$issymlink" != X; then
2602 echo "You can test for symbolic links with '$issymlink'." >&4
2604 echo "I do not know how you can test for symbolic links." >&4
2608 *) echo "No symbolic links, so not testing for their testing..." >&4
2614 case "$mksymlinks" in
2617 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2620 *) case "$lns:$issymlink" in
2621 *"ln"*" -s:"*"test -"?)
2622 echo "Creating the symbolic links..." >&4
2623 echo "(First creating the subdirectories...)" >&4
2625 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2627 test -z "$directory" && break
2631 if test ! -d t/base; then
2632 echo "Failed to create the subdirectories. Aborting." >&4
2635 echo "(Then creating the symlinks...)" >&4
2636 awk '{print $1}' $src/MANIFEST | while true; do
2638 test -z "$filename" && break
2639 if test -f $filename; then
2640 if $issymlink $filename; then
2644 if test -f $filename; then
2645 echo "$filename already exists, not symlinking."
2647 ln -s $src/$filename $filename
2651 if test ! -f t/base/lex.t; then
2652 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2657 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2666 case "$usecrosscompile" in
2668 $echo "Cross-compiling..."
2671 *-*-gcc) # A cross-compiling gcc, probably.
2672 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2674 # leave out ld, choosing it is more complex
2676 ranlib=$targetarch-ranlib
2677 $echo 'extern int foo;' > try.c
2678 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2680 if $test $# -gt 0; then
2682 incpth="`$echo $incpth|$sed 's/^ //'`"
2683 echo "Guessing incpth '$incpth'." >&4
2685 j="`$echo $i|$sed 's,/include$,/lib,'`"
2686 if $test -d $j; then
2690 libpth="`$echo $libpth|$sed 's/^ //'`"
2691 echo "Guessing libpth '$libpth'." >&4
2696 case "$targetarch" in
2697 '') echo "Targetarch not defined." >&4; croak=y ;;
2698 *) echo "Using targetarch $targetarch." >&4 ;;
2701 '') echo "Incpth not defined." >&4; croak=y ;;
2702 *) echo "Using incpth '$incpth'." >&4 ;;
2705 '') echo "Libpth not defined." >&4; croak=y ;;
2706 *) echo "Using libpth '$libpth'." >&4 ;;
2709 '') for i in $incpth; do
2710 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2712 echo "Guessing usrinc $usrinc." >&4
2717 '') echo "Usrinc not defined." >&4; croak=y ;;
2720 *) echo "Using usrinc $usrinc." >&4 ;;
2722 case "$targethost" in
2723 '') echo "Targethost not defined." >&4; croak=y ;;
2724 *) echo "Using targethost $targethost." >&4
2729 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2732 /*) run=$src/Cross/run
2733 targetmkdir=$src/Cross/mkdir
2735 from=$src/Cross/from
2737 *) pwd=`$test -f ../Configure & cd ..; pwd`
2739 targetmkdir=$pwd/Cross/mkdir
2741 from=$pwd/Cross/from
2744 case "$targetrun" in
2745 '') targetrun=ssh ;;
2750 case "$targetfrom" in
2751 '') targetfrom=scp ;;
2755 from=$from-$targetfrom
2756 case "$targetdir" in
2758 echo "Guessing targetdir $targetdir." >&4
2761 case "$targetuser" in
2763 echo "Guessing targetuser $targetuser." >&4
2766 case "$targetfrom" in
2770 case "$targetrun" in
2782 '') cwd=$targetdir ;;
2786 if $test ! -f \$exe.xok; then
2790 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2793 *) echo "Unknown targetrun '$targetrun'" >&4
2797 case "$targetmkdir" in
2799 cat >$targetmkdir <<EOF
2801 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2803 $chmod a+rx $targetmkdir
2805 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2817 $targetmkdir \`dirname \$f\`
2818 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2821 $targetmkdir $targetdir/\`dirname \$f\`
2822 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2835 $mkdir -p $targetdir/\`dirname \$f\`
2836 $cp \$f $targetdir/\$f || exit 1
2839 $targetmkdir $targetdir/\`dirname \$f\`
2840 $cp \$f $targetdir/\$f || exit 1
2847 *) echo "Unknown targetto '$targetto'" >&4
2851 case "$targetfrom" in
2858 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2863 cp) cat >$from <<EOF
2868 cp $targetdir/\$f . || exit 1
2873 *) echo "Unknown targetfrom '$targetfrom'" >&4
2877 if $test ! -f $run; then
2878 echo "Target 'run' script '$run' not found." >&4
2882 if $test ! -f $to; then
2883 echo "Target 'to' script '$to' not found." >&4
2887 if $test ! -f $from; then
2888 echo "Target 'from' script '$from' not found." >&4
2892 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2896 Using '$run' for remote execution,
2897 and '$from' and '$to'
2898 for remote file transfer.
2904 usecrosscompile='undef'
2909 : see whether [:lower:] and [:upper:] are supported character classes
2911 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2913 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2917 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2918 # (0xd9 and 0xe2), therefore that is a nice testing point.
2919 if test "X$up" = X -o "X$low" = X; then
2920 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2926 if test "X$up" = X -o "X$low" = X; then
2927 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2933 if test "X$up" = X -o "X$low" = X; then
2934 case "`echo RS | od -x 2>/dev/null`" in
2936 echo "Hey, this might be EBCDIC." >&4
2937 if test "X$up" = X -o "X$low" = X; then
2938 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2939 rs) up='[A-IJ-RS-Z]'
2944 if test "X$up" = X -o "X$low" = X; then
2945 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2955 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2957 echo "Using $up and $low to convert case." >&4
2960 echo "I don't know how to translate letters from upper to lower case." >&4
2961 echo "Your tr is not acting any way I know of." >&4
2965 : set up the translation script tr, must be called with ./tr of course
2969 '[A-Z][a-z]') exec $tr '$up' '$low';;
2970 '[a-z][A-Z]') exec $tr '$low' '$up';;
2977 : Try to determine whether config.sh was made on this system
2978 case "$config_sh" in
2980 myuname=`$uname -a 2>/dev/null`
2981 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2982 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2983 # because the A-Z/a-z are not consecutive.
2984 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2985 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2986 newmyuname="$myuname"
2988 case "$knowitall" in
2990 if test -f ../config.sh; then
2991 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2992 eval "`grep myuname= ../config.sh`"
2994 if test "X$myuname" = "X$newmyuname"; then
3002 : Get old answers from old config file if Configure was run on the
3003 : same system, otherwise use the hints.
3006 if test -f config.sh; then
3008 rp="I see a config.sh file. Shall I use it to set the defaults?"
3011 n*|N*) echo "OK, I'll ignore it."
3012 mv config.sh config.sh.old
3013 myuname="$newmyuname"
3015 *) echo "Fetching default answers from your old config.sh file..." >&4
3023 : Older versions did not always set $sh. Catch re-use of such
3033 if test ! -f config.sh; then
3036 First time through, eh? I have some defaults handy for some systems
3037 that need some extra help getting the Configure answers right:
3040 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3042 : Half the following guesses are probably wrong... If you have better
3043 : tests or hints, please send them to perlbug@perl.org
3044 : The metaconfig authors would also appreciate a copy...
3045 $test -f /irix && osname=irix
3046 $test -f /xenix && osname=sco_xenix
3047 $test -f /dynix && osname=dynix
3048 $test -f /dnix && osname=dnix
3049 $test -f /lynx.os && osname=lynxos
3050 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3051 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3052 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3053 $test -f /bin/mips && /bin/mips && osname=mips
3054 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3055 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3056 $test -d /usr/apollo/bin && osname=apollo
3057 $test -f /etc/saf/_sactab && osname=svr4
3058 $test -d /usr/include/minix && osname=minix
3059 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3060 if $test -d /MachTen -o -d /MachTen_Folder; then
3062 if $test -x /sbin/version; then
3063 osvers=`/sbin/version | $awk '{print $2}' |
3064 $sed -e 's/[A-Za-z]$//'`
3065 elif $test -x /usr/etc/version; then
3066 osvers=`/usr/etc/version | $awk '{print $2}' |
3067 $sed -e 's/[A-Za-z]$//'`
3073 $test -f /sys/posix.dll &&
3074 $test -f /usr/bin/what &&
3075 set X `/usr/bin/what /sys/posix.dll` &&
3076 $test "$3" = UWIN &&
3080 if $test -f $uname; then
3088 umips) osname=umips ;;
3091 [23]100) osname=mips ;;
3092 next*) osname=next ;;
3094 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3095 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3098 elif $test -f /etc/kconfig; then
3100 if test "$lns" = "$ln -s"; then
3102 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3104 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3111 if test -n "$DJGPP"; then
3120 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3122 # oslevel can fail with:
3123 # oslevel: Unable to acquire lock.
3124 *not\ found) osvers="$4"."$3" ;;
3125 '<3240'|'<>3240') osvers=3.2.0 ;;
3126 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3127 '=3250'|'>3250') osvers=3.2.5 ;;
3131 bsd386) osname=bsd386
3134 cygwin*) osname=cygwin
3137 *dc.osx) osname=dcosx
3143 domainos) osname=apollo
3149 dragonfly) osname=dragonfly
3152 dynixptx*) osname=dynixptx
3153 osvers=`echo "$4"|sed 's/^v//'`
3155 freebsd) osname=freebsd
3157 genix) osname=genix ;;
3161 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3177 netbsd*) osname=netbsd
3180 news-os) osvers="$3"
3182 4*) osname=newsos4 ;;
3186 next*) osname=next ;;
3187 nonstop-ux) osname=nonstopux ;;
3188 openbsd) osname=openbsd
3194 POSIX-BC | posix-bc ) osname=posix-bc
3197 powerux | power_ux | powermax_os | powermaxos | \
3198 powerunix | power_unix) osname=powerux
3204 solaris) osname=solaris
3206 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3213 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3217 titanos) osname=titanos
3226 ultrix) osname=ultrix
3229 osf1|mls+) case "$5" in
3232 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3235 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3238 hp*) osname=hp_osf1 ;;
3239 mips) osname=mips_osf1 ;;
3242 # UnixWare 7.1.2 is known as Open UNIX 8
3243 openunix|unixware) osname=svr5
3251 $2) case "$osname" in
3255 : svr4.x or possibly later
3265 if test -f /stand/boot ; then
3266 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3267 if test -n "$INITPROG" -a -f "$INITPROG"; then
3268 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3269 if test -n "$isesix"; then
3277 *) if test -f /etc/systemid; then
3279 set `echo $3 | $sed 's/\./ /g'` $4
3280 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3282 elif $test -f $src/hints/sco_$1_$2.sh; then
3284 elif $test -f $src/hints/sco_$1.sh; then
3289 '') : Still unknown. Probably a generic Sys V.
3298 *) case "$osname" in
3299 '') : Still unknown. Probably a generic BSD.
3307 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3308 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3309 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3312 $rm -f UU/kernel.what
3313 elif test -d c:/. -o -n "$is_os2" ; then
3320 case "$targetarch" in
3323 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3328 : Now look for a hint file osname_osvers, unless one has been
3329 : specified already.
3332 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3333 : Also try without trailing minor version numbers.
3334 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3335 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3336 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3337 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3340 *) case "$osvers" in
3343 *) if $test -f $src/hints/$file.sh ; then
3345 elif $test -f $src/hints/$xfile.sh ; then
3347 elif $test -f $src/hints/$xxfile.sh ; then
3349 elif $test -f $src/hints/$xxxfile.sh ; then
3351 elif $test -f $src/hints/$xxxxfile.sh ; then
3353 elif $test -f "$src/hints/${osname}.sh" ; then
3362 if $test -f Policy.sh ; then
3365 none) dflt="Policy" ;;
3366 *) dflt="Policy $dflt" ;;
3371 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3375 if $test -f Policy.sh ; then
3378 There's also a Policy hint file available, which should make the
3379 site-specific (policy) questions easier to answer.
3386 You may give one or more space-separated answers, or "none" if appropriate.
3387 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3388 is a good thing. DO NOT give a wrong version or a wrong OS.
3392 rp="Which of these apply, if any?"
3395 for file in $tans; do
3396 if $test X$file = XPolicy -a -f Policy.sh; then
3398 $cat Policy.sh >> UU/config.sh
3399 elif $test -f $src/hints/$file.sh; then
3400 . $src/hints/$file.sh
3401 $cat $src/hints/$file.sh >> UU/config.sh
3402 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3405 : Give one chance to correct a possible typo.
3406 echo "$file.sh does not exist"
3408 rp="hint to use instead?"
3410 for file in $ans; do
3411 if $test -f "$src/hints/$file.sh"; then
3412 . $src/hints/$file.sh
3413 $cat $src/hints/$file.sh >> UU/config.sh
3414 elif $test X$ans = X -o X$ans = Xnone ; then
3417 echo "$file.sh does not exist -- ignored."
3424 : Remember our hint file for later.
3425 if $test -f "$src/hints/$file.sh" ; then
3435 echo "Fetching default answers from $config_sh..." >&4
3439 cp $config_sh config.sh 2>/dev/null
3449 test "$override" && . ./optdef.sh
3451 : Restore computed paths
3452 for file in $loclist $trylist; do
3453 eval $file="\$_$file"
3458 Configure uses the operating system name and version to set some defaults.
3459 The default value is probably right if the name rings a bell. Otherwise,
3460 since spelling matters for me, either accept the default or answer "none"
3467 ''|' '|none) dflt=none ;;
3468 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3471 *) dflt="$osname" ;;
3473 rp="Operating system name?"
3477 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3483 ''|' '|none) dflt=none ;;
3484 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3485 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3487 ''|' ') dflt=none ;;
3492 *) dflt="$osvers" ;;
3494 rp="Operating system version?"
3504 : who configured the system
3505 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3508 cf_by=`(logname) 2>/dev/null`
3511 cf_by=`(whoami) 2>/dev/null`
3513 "") cf_by=unknown ;;
3518 : decide how portable to be. Allow command line overrides.
3519 case "$d_portable" in
3521 *) d_portable="$define" ;;
3524 : set up shell script to do ~ expansion
3530 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3533 if $test -f /bin/csh; then
3534 /bin/csh -f -c "glob \$1"
3539 name=\`$expr x\$1 : '..\([^/]*\)'\`
3540 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3541 if $test ! -d "\$dir"; then
3543 echo "\$me: can't locate home directory for: \$name" >&2
3548 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3564 : now set up to get a file name
3568 cat <<'EOSC' >>getfile
3584 : getfile will accept an answer from the comma-separated list
3585 : enclosed in parentheses even if it does not meet other criteria.
3586 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3587 fn=`echo $fn | sed 's/(.*)//'`
3593 loc_file=`expr $fn : '.*:\(.*\)'`
3594 fn=`expr $fn : '\(.*\):.*'`
3602 */*) fullpath=true;;
3611 *e*) exp_file=true;;
3614 *p*) nopath_ok=true;;
3619 *d*) type='Directory';;
3620 *l*) type='Locate';;
3625 Locate) what='File';;
3630 case "$d_portable" in
3638 while test "$type"; do
3643 true) rp="$rp (~name ok)";;
3646 if test -f UU/getfile.ok && \
3647 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3666 value=`UU/filexp $ans`
3669 if test "$ans" != "$value"; then
3670 echo "(That expands to $value on this system.)"
3684 /*) value="$ansexp" ;;
3685 [a-zA-Z]:/*) value="$ansexp" ;;
3690 echo "I shall only accept a full path name, as in /bin/ls." >&4
3691 echo "Use a ! shell escape if you wish to check pathnames." >&4
3694 echo "Please give a full path name, starting with slash." >&4
3697 echo "Note that using ~name is ok provided it expands well." >&4
3710 for fp in $gfpth; do
3711 if test "X$fp" = X.; then
3716 if test -f "$pf"; then
3718 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3720 echo "($value is not a plain file, but that's ok.)"
3723 if test X"$type" = X; then
3730 for fp in $gfpth; do
3731 if test "X$fp" = X.; then
3736 direxp="$fp/$ansexp"
3738 if test -d "$direxp"; then
3746 if test -d "$ansexp"; then
3747 echo "(Looking for $loc_file in directory $value.)"
3748 value="$value/$loc_file"
3749 ansexp="$ansexp/$loc_file"
3751 if test -f "$ansexp"; then
3754 case "$nopath_ok" in
3755 true) case "$value" in
3757 *) echo "Assuming $value will be in people's path."
3773 if test "$fastread" = yes; then
3778 rp="$what $value doesn't exist. Use that name anyway?"
3797 test "X$gfpthkeep" != Xy && gfpth=""
3800 : determine root of directory hierarchy where package will be installed.
3803 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3806 dflt=`echo "$prefix" | sed 's/.$//'`
3814 By default, $package will be installed in $dflt/bin, manual pages
3815 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3816 installation directories. Typically this is something like /usr/local.
3817 If you wish to have binaries under /usr/bin but other parts of the
3818 installation under /usr/local, that's ok: you will be prompted
3819 separately for each of the installation directories, the prefix being
3820 only used to set the defaults.
3824 rp='Installation prefix to use?'
3832 *) oldprefix="$prefix";;
3841 *) afsroot=$afsroot ;;
3847 $define|true) afs=true ;;
3848 $undef|false) afs=false ;;
3849 *) if test -d $afsroot; then
3857 echo "AFS may be running... I'll be extra cautious then..." >&4
3859 echo "AFS does not seem to be running..." >&4
3862 : determine installation prefix for where package is to be installed.
3866 Since you are running AFS, I need to distinguish the directory in which
3867 files will reside from the directory in which they are installed (and from
3868 which they are presumably copied to the former directory by occult means).
3871 case "$installprefix" in
3872 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3873 *) dflt="$installprefix";;
3878 In some special cases, particularly when building $package for distribution,
3879 it is convenient to distinguish the directory in which files should be
3880 installed from the directory ($prefix) in which they will
3881 eventually reside. For most users, these two directories are the same.
3884 case "$installprefix" in
3886 *) dflt=$installprefix;;
3890 rp='What installation prefix should I use for installing files?'
3892 installprefix="$ans"
3893 installprefixexp="$ansexp"
3895 : Perform the prefixexp/installprefixexp correction if necessary
3896 cat <<EOS >installprefix
3899 cat <<'EOSC' >>installprefix
3900 : Change installation prefix, if necessary.
3901 if $test X"$prefix" != X"$installprefix"; then
3902 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3904 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3907 chmod +x installprefix
3908 $eunicefix installprefix
3910 : Set variables such as privlib and privlibexp from the output of ./getfile
3911 : performing the prefixexp/installprefixexp correction if necessary.
3912 cat <<EOS >setprefixvar
3915 cat <<'EOSC' >>setprefixvar
3916 eval "${prefixvar}=\"\$ans\""
3917 eval "${prefixvar}exp=\"\$ansexp\""
3920 chmod +x setprefixvar
3921 $eunicefix setprefixvar
3923 : set up the script used to warn in case of inconsistency
3930 echo "*** WHOA THERE!!! ***" >&4
3931 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3932 rp=" Keep the $hint value?"
3935 y) td=$was; tu=$was;;
3939 : function used to set $1 to $val
3940 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3942 $define$undef) . ./whoa; eval "$var=\$td";;
3943 $undef$define) . ./whoa; eval "$var=\$tu";;
3944 *) eval "$var=$val";;
3948 $define|true|[yY]*) dflt='y';;
3953 Perl can be built to use the SOCKS proxy protocol library. To do so,
3954 Configure must be run with -Dusesocks. If you use SOCKS you also need
3955 to use the PerlIO abstraction layer, this will be implicitly selected.
3957 If this doesn't make any sense to you, just accept the default '$dflt'.
3959 rp='Build Perl for SOCKS?'
3962 y|Y) val="$define" ;;
3969 $define|true|[yY]*) useperlio="$define";;
3972 case "$useperlio" in
3973 $define|true|[yY]*|'') dflt='y';;
3978 Previous version of $package used the standard IO mechanisms as
3979 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3980 alternate IO mechanisms via the PerlIO abstraction layer, but the
3981 stdio mechanism is still available if needed. The abstraction layer
3982 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3983 Using PerlIO with sfio may cause problems with some extension modules.
3985 If this doesn't make any sense to you, just accept the default '$dflt'.
3987 rp='Use the PerlIO abstraction layer?'
3994 echo "Ok, doing things the stdio way."
4003 case "$useperlio" in
4004 $define|true|[yY]*) ;;
4007 You are using the SOCKS proxy protocol library which means that you
4008 should also use the PerlIO layer. You may be headed for trouble.
4017 case "$usethreads" in
4018 $define|true|[yY]*) dflt='y';;
4019 *) # Catch case where user specified ithreads or 5005threads but
4020 # forgot -Dusethreads (A.D. 4/2002)
4021 case "$useithreads$use5005threads" in
4023 case "$useperlio" in
4024 "$define") dflt='y' ;;
4034 Perl can be built to take advantage of threads on some systems.
4035 To do so, Configure can be run with -Dusethreads.
4037 Note that Perl built with threading support runs slightly slower
4038 and uses more memory than plain Perl. The current implementation
4039 is believed to be stable, but it is fairly new, and so should be
4040 treated with caution.
4042 If this doesn't make any sense to you, just accept the default '$dflt'.
4044 rp='Build a threading Perl?'
4047 y|Y) val="$define" ;;
4053 case "$usethreads" in
4057 Since release 5.6, Perl has had two different threading implementations,
4058 the newer interpreter-based version (ithreads) with one interpreter per
4059 thread, and the older 5.005 version (5005threads).
4060 The 5005threads version is effectively unmaintained and will probably be
4061 removed in Perl 5.10, so there should be no need to build a Perl using it
4062 unless needed for backwards compatibility with some existing 5.005threads
4066 : Default to ithreads unless overridden on command line or with
4069 case "$use5005threads" in
4070 $define|true|[yY]*) dflt='n';;
4072 case "$useithreads" in
4073 $undef|false|[nN]*) dflt='n';;
4075 rp='Use the newer interpreter-based ithreads?'
4078 y|Y) val="$define" ;;
4083 : Now set use5005threads to the opposite value.
4084 case "$useithreads" in
4085 $define) val="$undef" ;;
4092 useithreads="$undef"
4093 use5005threads="$undef"
4097 case "$useithreads$use5005threads" in
4101 You cannot have both the ithreads and the 5.005 threads enabled
4102 at the same time. Disabling the 5.005 threads since they are
4103 much less stable than the ithreads.
4106 use5005threads="$undef"
4110 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4113 *** To build with ithreads you must also use the PerlIO layer.
4114 *** Cannot continue, aborting.
4120 case "$d_oldpthreads" in
4121 '') : Configure tests would be welcome here. For now, assume undef.
4123 *) val="$d_oldpthreads" ;;
4129 : Look for a hint-file generated 'call-back-unit'. If the
4130 : user has specified that a threading perl is to be built,
4131 : we may need to set or change some other defaults.
4132 if $test -f usethreads.cbu; then
4133 echo "Your platform has some specific hints regarding threaded builds, using them..."
4136 case "$usethreads" in
4137 "$define"|true|[yY]*)
4139 (Your platform does not have any specific hints for threaded builds.
4140 Assuming POSIX threads, then.)
4148 Perl can be built so that multiple Perl interpreters can coexist
4149 within the same Perl executable.
4152 case "$useithreads" in
4155 This multiple interpreter support is required for interpreter-based threads.
4159 *) case "$usemultiplicity" in
4160 $define|true|[yY]*) dflt='y';;
4164 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4165 rp='Build Perl for multiplicity?'
4168 y|Y) val="$define" ;;
4177 case "$usemorebits" in
4178 "$define"|true|[yY]*)
4179 use64bitint="$define"
4180 uselongdouble="$define"
4181 usemorebits="$define"
4183 *) usemorebits="$undef"
4187 : make some quick guesses about what we are up against
4189 $echo $n "Hmm... $c"
4199 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4200 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4202 echo "Looks kind of like an OSF/1 system, but we'll see..."
4204 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4205 xxx=`./loc addbib blurfl $pth`
4206 if $test -f $xxx; then
4207 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4211 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4212 echo "Looks kind of like an extended USG system, but we'll see..."
4214 echo "Looks kind of like a USG system, but we'll see..."
4218 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4219 echo "Looks kind of like a BSD system, but we'll see..."
4223 echo "Looks kind of like a Version 7 system, but we'll see..."
4226 case "$eunicefix" in
4229 There is, however, a strange, musty smell in the air that reminds me of
4230 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4234 : it so happens the Eunice I know will not run shell scripts in Unix format
4238 echo "Congratulations. You aren't running Eunice."
4242 : Detect OS2. The p_ variable is set above in the Head.U unit.
4243 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4244 : semicolon as a patch separator
4249 I have the feeling something is not exactly right, however...don't tell me...
4250 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4251 (Or you may be running DOS with DJGPP.)
4256 if test -f /xenix; then
4257 echo "Actually, this looks more like a XENIX system..."
4262 echo "It's not Xenix..."
4267 if test -f /venix; then
4268 echo "Actually, this looks more like a VENIX system..."
4275 echo "Nor is it Venix..."
4278 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4279 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4286 rp="Use which C compiler?"
4290 : See if they have not cc but they do have gcc
4292 : Look for a hint-file generated 'call-back-unit'. Now that the
4293 : user has specified the compiler, we may need to set or change some
4295 if $test -f cc.cbu; then
4301 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4307 printf("%s\n", __VERSION__);
4309 printf("%s\n", "1");
4315 if $cc -o try $ccflags $ldflags try.c; then
4316 gccversion=`$run ./try`
4317 case "$gccversion" in
4318 '') echo "You are not using GNU cc." ;;
4319 *) echo "You are using GNU cc $gccversion."
4325 echo "*** WHOA THERE!!! ***" >&4
4326 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4327 case "$knowitall" in
4329 echo " You'd better start hunting for one and let me know about it." >&4
4335 case "$gccversion" in
4336 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4338 case "$gccversion" in
4339 '') gccosandvers='' ;;
4340 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4341 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4343 case "$gccosandvers" in
4344 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4345 $osname$osvers) ;; # looking good
4346 $osname*) cat <<EOM >&4
4348 *** WHOA THERE!!! ***
4350 Your gcc has not been compiled for the exact release of
4351 your operating system ($gccosandvers versus $osname$osvers).
4353 In general it is a good idea to keep gcc synchronized with
4354 the operating system because otherwise serious problems
4355 may ensue when trying to compile software, like Perl.
4357 I'm trying to be optimistic here, though, and will continue.
4358 If later during the configuration and build icky compilation
4359 problems appear (headerfile conflicts being the most common
4360 manifestation), I suggest reinstalling the gcc to match
4361 your operating system release.
4365 *) gccosandvers='' ;; # failed to parse, better be silent
4373 # gcc 3.* complain about adding -Idirectories that they already know about,
4374 # so we will take those off from locincpth.
4375 case "$gccversion" in
4377 echo "main(){}">try.c
4378 for incdir in $locincpth; do
4379 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4380 grep '^c[cp]p*[01]: warning: changing search order '`
4381 if test "X$warn" != X; then
4382 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4388 : What should the include directory be ?
4390 $echo $n "Hmm... $c"
4394 if $test -f /bin/mips && /bin/mips; then
4395 echo "Looks like a MIPS system..."
4396 $cat >usr.c <<'EOCP'
4397 #ifdef SYSTYPE_BSD43
4401 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4402 dflt='/bsd43/usr/include'
4406 mips_type='System V'
4408 $rm -f usr.c usr.out
4409 echo "and you're compiling with the $mips_type compiler and libraries."
4413 echo "Doesn't look like a MIPS system."
4423 case "$xxx_prompt" in
4426 rp='Where are the include files you want to use?'
4434 : see how we invoke the C preprocessor
4436 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4437 cat <<'EOT' >testcpp.c
4443 if test ! -f cppstdin; then
4444 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4445 # AIX cc -E doesn't show the absolute headerfile
4446 # locations but we'll cheat by using the -M flag.
4447 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
4449 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4452 echo "Keeping your $hint cppstdin wrapper."
4455 wrapper=`pwd`/cppstdin
4459 if $test "X$cppstdin" != "X" && \
4460 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4461 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4463 echo "You used to use $cppstdin $cppminus so we'll use that again."
4465 '') echo "But let's see if we can live without a wrapper..." ;;
4467 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4468 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4470 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4473 echo "(However, $cpprun $cpplast does not work, let's see...)"
4481 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4488 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4489 $cc -E <testcpp.c >testcpp.out 2>&1; \
4490 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4491 echo "Yup, it does."
4494 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4495 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4496 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4497 echo "Yup, it does."
4500 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4501 $cc -P <testcpp.c >testcpp.out 2>&1; \
4502 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4503 echo "Yipee, that works!"
4506 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4507 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4508 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4509 echo "At long last!"
4512 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4513 $cpp <testcpp.c >testcpp.out 2>&1; \
4514 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4518 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4519 $cpp - <testcpp.c >testcpp.out 2>&1; \
4520 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4521 echo "Hooray, it works! I was beginning to wonder."
4524 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4525 $wrapper <testcpp.c >testcpp.out 2>&1; \
4526 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4532 rp="No dice. I can't find a C preprocessor. Name one:"
4536 $x_cpp <testcpp.c >testcpp.out 2>&1
4537 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4538 echo "OK, that will do." >&4
4540 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4555 echo "Perhaps can we force $cc -E using a wrapper..."
4556 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4557 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4563 echo "Nope, we'll have to live without it..."
4577 "$wrapper"|'cppstdin') ;;
4578 *) $rm -f $wrapper;;
4580 $rm -f testcpp.c testcpp.out
4582 : Set private lib path
4585 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4590 '') dlist="$loclibpth $plibpth $glibpth";;
4591 *) dlist="$libpth";;
4594 : Now check and see which directories actually exist, avoiding duplicates
4598 if $test -d $xxx; then
4601 *) libpth="$libpth $xxx";;
4607 Some systems have incompatible or broken versions of libraries. Among
4608 the directories listed in the question below, please remove any you
4609 know not to be holding relevant libraries, and add any that are needed.
4610 Say "none" for none.
4621 rp="Directories to use for library searches?"
4628 : compute shared library extension
4631 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4641 On some systems, shared libraries may be available. Answer 'none' if
4642 you want to suppress searching of shared libraries for the remainder
4643 of this configuration.
4646 rp='What is the file extension used for shared libraries?'
4650 : Define several unixisms.
4651 : Hints files or command line option can be used to override them.
4652 : The convoluted testing is in case hints files set either the old
4655 '') case "$exe_ext" in
4657 *) _exe="$exe_ext" ;;
4662 '') case "$lib_ext" in
4669 '') case "$obj_ext" in
4676 '') case "$path_sep" in
4687 : Which makefile gets called first. This is used by make depend.
4688 case "$firstmakefile" in
4689 '') firstmakefile='makefile';;
4693 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4696 case "$uselongdouble" in
4697 $define|true|[yY]*) dflt='y';;
4702 Perl can be built to take advantage of long doubles which
4703 (if available) may give more accuracy and range for floating point numbers.
4705 If this doesn't make any sense to you, just accept the default '$dflt'.
4707 rp='Try to use long doubles if available?'
4710 y|Y) val="$define" ;;
4716 case "$uselongdouble" in
4717 true|[yY]*) uselongdouble="$define" ;;
4720 : Look for a hint-file generated 'call-back-unit'. If the
4721 : user has specified that long doubles should be used,
4722 : we may need to set or change some other defaults.
4723 if $test -f uselongdouble.cbu; then
4724 echo "Your platform has some specific hints regarding long doubles, using them..."
4725 . ./uselongdouble.cbu
4727 case "$uselongdouble" in
4730 (Your platform does not have any specific hints for long doubles.)
4736 : Looking for optional libraries
4738 echo "Checking for optional libraries..." >&4
4743 case "$libswanted" in
4744 '') libswanted='c_s';;
4747 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4753 for thisdir in $libpth $xlibpth; do
4754 test -d $thisdir && libspath="$libspath $thisdir"
4756 for thislib in $libswanted; do
4757 for thisdir in $libspath; do
4759 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4760 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4761 $test -f "$xxx" && eval $libscheck
4762 $test -f "$xxx" && libstyle=shared
4764 if test ! -f "$xxx"; then
4765 xxx=$thisdir/lib$thislib.$so
4766 $test -f "$xxx" && eval $libscheck
4767 $test -f "$xxx" && libstyle=shared
4769 if test ! -f "$xxx"; then
4770 xxx=$thisdir/lib$thislib$_a
4771 $test -f "$xxx" && eval $libscheck
4772 $test -f "$xxx" && libstyle=static
4774 if test ! -f "$xxx"; then
4775 xxx=$thisdir/$thislib$_a
4776 $test -f "$xxx" && eval $libscheck
4777 $test -f "$xxx" && libstyle=static
4779 if test ! -f "$xxx"; then
4780 xxx=$thisdir/lib${thislib}_s$_a
4781 $test -f "$xxx" && eval $libscheck
4782 $test -f "$xxx" && libstyle=static
4783 $test -f "$xxx" && thislib=${thislib}_s
4785 if test ! -f "$xxx"; then
4786 xxx=$thisdir/Slib$thislib$_a
4787 $test -f "$xxx" && eval $libscheck
4788 $test -f "$xxx" && libstyle=static
4790 if $test -f "$xxx"; then
4792 shared) echo "Found -l$thislib (shared)." ;;
4793 static) echo "Found -l$thislib." ;;
4794 *) echo "Found -l$thislib ($libstyle)." ;;
4798 *) dflt="$dflt -l$thislib"
4799 libsfound="$libsfound $xxx"
4801 libsfiles="$libsfiles $yyy"
4802 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4803 case " $libsdirs " in
4805 *) libsdirs="$libsdirs $yyy" ;;
4812 if $test ! -f "$xxx"; then
4813 echo "No -l$thislib."