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 May 9 18:53:25 CEST 2007 [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 if test ! -c /dev/null ; then
71 *** I'm sorry, but /dev/null appears to be a file rather than a device.
72 *** Please consult your operating sytem's notes for making a device
74 *** Cannot continue, aborting.
80 : compute my invocation name
84 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
89 : Proper separator for the PATH environment variable
91 : On OS/2 this directory should exist if this is not floppy only system :-]
92 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
93 if test -n "$OS2_SHELL"; then
95 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
96 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
98 elif test -n "$DJGPP"; then
99 case "X${MACHTYPE:-nonesuchmach}" in
106 : Proper PATH setting
107 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
108 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
109 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
110 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
111 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
112 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
113 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
114 paths="$paths /sbin /usr/sbin /usr/libexec"
115 paths="$paths /system/gnu_library/bin"
119 case "$p_$PATH$p_" in
121 *) test -d $p && PATH=$PATH$p_$p ;;
128 : shall we be using ksh?
134 if (PATH=.; alias -x) >/dev/null 2>&1; then
137 if test -f /hp-ux -a -f /bin/ksh; then
138 needksh='to avoid sh bug in "here document" expansion'
140 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
141 if test X`/usr/bin/uname -v` = X4; then
142 avoidksh="to avoid AIX 4's /bin/sh"
146 if test -f /osf_boot -a -f /usr/sbin/setld; then
147 if test X`/usr/bin/uname -s` = XOSF1; then
148 avoidksh="to avoid Digital UNIX' ksh"
150 unset BIN_SH # if this is 'xpg4' sh will start up ksh
153 case "$inksh/$needksh" in
160 case "$inksh/$avoidksh" in
166 case "$inksh/$needksh-$avoidksh-" in
169 (I see you are using the Korn shell. Some ksh's blow up on $me,
170 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
177 echo "(Feeding myself to $newsh $reason.)"
179 Configure|*/Configure) exec $newsh $0 "$@";;
180 *) exec $newsh Configure "$@";;
185 : if needed set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
195 : Configure runs within the UU subdirectory
196 test -d UU || mkdir UU
335 initialinstalllocation=''
363 d_attribute_format=''
364 d_attribute_malloc=''
365 d_attribute_nonnull=''
366 d_attribute_noreturn=''
368 d_attribute_unused=''
369 d_attribute_warn_unused_result=''
370 d_printf_format_null=''
373 d_builtin_choose_expr=''
376 d_c99_variadic_macros=''
423 endhostent_r_proto=''
429 endprotoent_r_proto=''
435 endservent_r_proto=''
487 gethostbyaddr_r_proto=''
489 gethostbyname_r_proto=''
491 gethostent_r_proto=''
503 getnetbyaddr_r_proto=''
505 getnetbyname_r_proto=''
519 d_getprotobyname_r=''
520 getprotobyname_r_proto=''
521 d_getprotobynumber_r=''
522 getprotobynumber_r_proto=''
524 getprotoent_r_proto=''
536 getservbyname_r_proto=''
538 getservbyport_r_proto=''
540 getservent_r_proto=''
564 d_libm_lib_version=''
567 d_localtime_r_needs_tzset=''
578 d_malloc_good_size=''
620 d_old_pthread_create_joinable=''
621 old_pthread_create_joinable=''
623 d_pthread_attr_setscope=''
662 sethostent_r_proto=''
679 setprotoent_r_proto=''
691 setservent_r_proto=''
725 d_sprintf_returns_strlen=''
740 d_stdio_ptr_lval_nochange_cnt=''
741 d_stdio_ptr_lval_sets_cnt=''
945 d_inc_version_list=''
947 inc_version_list_init=''
966 ignore_versioned_solibs=''
1030 d_perl_otherlibdirs=''
1038 api_versionstring=''
1044 version_patchlevel_string=''
1048 d_nv_preserves_uv=''
1049 d_nv_zero_is_allbits_zero=''
1060 nv_preserves_uv_bits=''
1132 installsitehtml1dir=''
1135 installsitehtml3dir=''
1142 installsiteman1dir=''
1145 installsiteman3dir=''
1150 installsitescript=''
1165 d_stdio_stream_array=''
1166 stdio_stream_array=''
1177 ccflags_uselargefiles=''
1178 ldflags_uselargefiles=''
1179 libswanted_uselargefiles=''
1199 installvendorarch=''
1206 installvendorhtml1dir=''
1208 vendorhtml1direxp=''
1209 installvendorhtml3dir=''
1211 vendorhtml3direxp=''
1217 installvendorman1dir=''
1220 installvendorman3dir=''
1227 installvendorscript=''
1239 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1242 : We must find out about Eunice early
1244 if test -f /etc/unixtovms; then
1245 eunicefix=/etc/unixtovms
1247 if test -f /etc/unixtovms.exe; then
1248 eunicefix=/etc/unixtovms.exe
1251 : Set executable suffix now -- needed before hints available
1252 if test -f "/libs/version.library"; then
1255 elif test -f "/system/gnu_library/bin/ar.pm"; then
1258 elif test -n "$DJGPP"; then
1261 elif test -d c:/. -o -n "$is_os2" ; then
1267 : Trailing extension. Override this in a hint file, if needed.
1268 : Extra object files, if any, needed on this platform.
1273 : change the next line if compiling for Xenix/286 on Xenix/386
1274 xlibpth='/usr/lib/386 /lib/386'
1275 : Possible local library directories to search.
1276 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1277 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1279 : general looking path for locating libraries
1280 glibpth="/lib /usr/lib $xlibpth"
1281 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1282 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1283 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1284 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1286 : Private path used by Configure to find libraries. Its value
1287 : is prepended to libpth. This variable takes care of special
1288 : machines, like the mips. Usually, it should be empty.
1291 : default library list
1293 : some systems want to use only the non-versioned libso:s
1294 ignore_versioned_solibs=''
1298 : set usethreads on the Configure command line to enable threads.
1299 usereentrant='undef'
1300 : full support for void wanted by default
1303 : Possible local include directories to search.
1304 : Set locincpth to "" in a hint file to defeat local include searches.
1305 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1306 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1308 : no include file wanted by default
1311 : Enable -DEBUGGING and -DDEBUGGING from the command line
1318 : set useposix=false in your hint file to disable the POSIX extension.
1320 : set useopcode=false in your hint file to disable the Opcode extension.
1323 ccflags_uselargefiles=''
1324 ldflags_uselargefiles=''
1325 libswanted_uselargefiles=''
1326 : set usemultiplicity on the Configure command line to enable multiplicity.
1327 : set usesocks on the Configure command line to enable socks.
1328 : List of libraries we want.
1329 : If anyone needs extra -lxxx, put those in a hint file.
1330 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1331 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1332 : We probably want to search /usr/shlib before most other libraries.
1333 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1334 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1335 glibpth="/usr/shlib $glibpth"
1336 : Do not use vfork unless overridden by a hint file.
1339 : Find the basic shell for Bourne shell scripts
1343 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1346 if test -f "$xxx"; then
1349 : Build up a list and do a single loop so we can 'break' out.
1350 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1351 for xxx in sh bash ksh pdksh ash; do
1353 try="$try ${p}/${xxx}"
1357 if test -f "$xxx"; then
1360 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1363 elif test -f "$xxx.exe"; then
1374 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1376 Usually it's in /bin/sh. How did you even get this far?
1377 Please contact me (Perl Maintainers) at perlbug@perl.org and
1378 we'll try to straighten this all out.
1384 : see if sh knows # comments
1385 if `$sh -c '#' >/dev/null 2>&1`; then
1389 test -f $xcat$_exe || xcat=/usr/bin/cat
1390 if test ! -f $xcat$_exe; then
1391 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1392 if test -f $p/cat$_exe; then
1397 if test ! -f $xcat$_exe; then
1398 echo "Can't find cat anywhere!"
1402 echo "#!$xcat" >sharp
1406 if test -s today; then
1409 echo "#! $xcat" > sharp
1413 if test -s today; then
1421 echo "Your $sh doesn't grok # comments--I will strip them later on."
1424 echo "exec grep -v '^[ ]*#'" >spitshell
1426 $eunicefix spitshell
1427 spitshell=`pwd`/spitshell
1429 echo "I presume that if # doesn't work, #! won't work either!"
1434 : figure out how to guarantee sh startup
1436 '') startsh=${sharpbang}${sh} ;;
1448 : echo "Yup, it does."
1450 echo "Hmm... '$startsh' does not guarantee sh startup..."
1451 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1456 : Save command line options in file UU/cmdline.opt for later use in
1457 : generating config.sh.
1458 cat > cmdline.opt <<EOSH
1459 # Configure command line arguments.
1468 cat >>cmdline.opt <<EOSH
1469 config_arg$argn='$arg'
1471 # Extreme backslashitis: replace each ' by '"'"'
1472 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1475 arg_exp=`cat cmdl.opt`
1476 args_exp="$args_exp$args_sep'$arg_exp'"
1477 argn=`expr $argn + 1`
1480 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1481 # used by ./hints/os2.sh
1484 : produce awk script to parse command line options
1485 cat >options.awk <<'EOF'
1487 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1489 len = length(optstr);
1490 for (i = 1; i <= len; i++) {
1491 c = substr(optstr, i, 1);
1492 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1503 if (substr(str, 1, 1) != "-") {
1504 printf("'%s'\n", str);
1508 for (i = 2; i <= len; i++) {
1509 c = substr(str, i, 1);
1511 printf("-%s\n", substr(str, i));
1517 printf("'%s'\n", substr(str, i + 1));
1530 : process the command line options
1531 set X `for arg in "$@"; do echo "X$arg"; done |
1532 sed -e s/X// | awk -f options.awk`
1537 : set up default values
1547 rm -f optdef.sh posthint.sh
1548 cat >optdef.sh <<EOS
1554 while test $# -gt 0; do
1556 -d) shift; fastread=yes;;
1557 -e) shift; alldone=cont;;
1561 if test -r "$1"; then
1564 echo "$me: cannot read config file $1." >&2
1570 -h) shift; error=true;;
1571 -r) shift; reuseval=true;;
1572 -s) shift; silent=true; realsilent=true;;
1573 -E) shift; alldone=exit;;
1574 -K) shift; knowitall=true;;
1575 -O) shift; override=true;;
1576 -S) shift; silent=true; extractsh=true;;
1581 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1582 echo "$me: ignoring -D $1" >&2
1585 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1586 *) echo "$1='define'" >> optdef.sh;;
1593 *=) echo "$1" >> optdef.sh;;
1595 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1596 echo "$me: ignoring -U $1" >&2
1598 *) echo "$1='undef'" >> optdef.sh;;
1609 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1613 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1614 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1620 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1621 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1622 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1623 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1624 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1625 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1631 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1633 echo "$yyy=''" >> posthint.sh ;;
1638 echo "$yyy='$zzz'" >> posthint.sh ;;
1640 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1642 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1647 echo "$yyy=$zzz" >> posthint.sh ;;
1648 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1652 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1655 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1663 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1664 [-U symbol] [-U symbol=] [-A command:symbol...]
1665 -d : use defaults for all answers.
1666 -e : go on without questioning past the production of config.sh.
1667 -f : specify an alternate default configuration file.
1668 -h : print this help message and exit (with an error status).
1669 -r : reuse C symbols value if possible (skips costly nm extraction).
1670 -s : silent mode, only echoes questions and essential information.
1671 -D : define symbol to have some value:
1672 -D symbol symbol gets the value 'define'
1673 -D symbol=value symbol gets the value 'value'
1674 common used examples (see INSTALL for more info):
1675 -Duse64bitint use 64bit integers
1676 -Duse64bitall use 64bit integers and pointers
1677 -Dusethreads use thread support
1678 -Dinc_version_list=none do not include older perl trees in @INC
1679 -DEBUGGING=none DEBUGGING options
1680 -Dcc=gcc choose your compiler
1681 -Dprefix=/opt/perl5 choose your destination
1682 -E : stop at the end of questions, after having produced config.sh.
1683 -K : do not use unless you know what you are doing.
1684 -O : let -D and -U override definitions from loaded configuration file.
1685 -S : perform variable substitutions on all .SH files (can mix with -f)
1686 -U : undefine symbol:
1687 -U symbol symbol gets the value 'undef'
1688 -U symbol= symbol gets completely empty
1690 -A : manipulate symbol after the platform specific hints have been applied:
1691 -A symbol=value append " "value to symbol
1692 -A append:symbol=value append value to symbol
1693 -A define:symbol=value define symbol to have value
1694 -A clear:symbol define symbol to be ''
1695 -A define:symbol define symbol to be 'define'
1696 -A eval:symbol=value define symbol to be eval of value
1697 -A prepend:symbol=value prepend value to symbol
1698 -A undef:symbol define symbol to be 'undef'
1699 -A undef:symbol= define symbol to be ''
1700 e.g.: -A prepend:libswanted='cl pthread '
1701 -V : print version number and exit (with a zero status).
1708 case "$fastread$alldone" in
1711 case "$extractsh" in
1714 if test ! -t 0; then
1715 echo "Say 'sh Configure', not 'sh <Configure'"
1725 true) exec 1>/dev/null;;
1728 : run the defines and the undefines, if any, but leave the file out there...
1731 : create the posthint manipulation script and leave the file out there...
1736 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1737 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1738 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1739 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1740 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1743 : Some greps do not return status, grrr.
1744 echo "grimblepritz" >grimble
1745 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1747 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1753 : the following should work in any shell
1757 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1758 cat >contains <<'EOSS'
1759 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1764 : Find the path to the source tree
1767 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1771 *) src=`cd ../$src && pwd` ;;
1784 if test -f $rsrc/Configure && \
1785 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1787 : found it, so we are ok.
1790 for src in . .. ../.. ../../.. ../../../..; do
1791 if test -f ../$src/Configure && \
1792 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1803 Sorry, I can't seem to locate the source dir for $package. Please start
1804 Configure with an explicit path -- i.e. /some/path/Configure.
1812 echo "Sources for $package found in \"$src\"." >&4
1816 : script used to extract .SH files with variable substitutions
1817 cat >extract <<'EOS'
1819 echo "Doing variable substitutions on .SH files..."
1820 if test -f MANIFEST; then
1821 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1823 echo "(Looking for .SH files under the source directory.)"
1824 set x `(cd "$src"; find . -name "*.SH" -print)`
1828 0) set x `(cd "$src"; echo *.SH)`; shift;;
1830 if test ! -f "$src/$1"; then
1836 while test $name; do
1837 if test ! -d "$name"; then
1838 create="$name $create";
1839 name=`echo $name | sed -e "s|^[^/]*$||"`;
1840 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1845 for file in $create; do
1854 dir=`expr X$file : 'X\(.*\)/'`
1855 file=`expr X$file : 'X.*/\(.*\)'`
1856 (cd "$dir" && . ./$file)
1866 dir=`expr X$file : 'X\(.*\)/'`
1867 file=`expr X$file : 'X.*/\(.*\)'`
1868 (set x $dir; shift; eval $mkdir_p)
1869 sh <"$src/$dir/$file"
1878 if test -f "$src/config_h.SH"; then
1879 if test ! -f config.h; then
1880 : oops, they left it out of MANIFEST, probably, so do it anyway.
1881 . "$src/config_h.SH"
1886 : extract files and exit if asked to do so
1887 case "$extractsh" in
1889 case "$realsilent" in
1893 case "$config_sh" in
1894 '') config_sh='config.sh';;
1897 echo "Fetching answers from $config_sh..."
1900 test "$override" && . ./optdef.sh
1904 echo "Extraction done."
1909 : Eunice requires " " instead of "", can you believe it
1912 echo "Beginning of configuration questions for $package."
1914 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1916 : first determine how to suppress newline on echo command
1918 echo "Checking echo to see how to suppress newlines..."
1919 (echo "hi there\c" ; echo " ") >.echotmp
1920 if $contains c .echotmp >/dev/null 2>&1 ; then
1931 echo $n "The star should be here-->$c"
1935 : Now test for existence of everything in MANIFEST
1937 if test -f "$rsrc/MANIFEST"; then
1938 echo "First let's make sure your kit is complete. Checking..." >&4
1939 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1942 for filelist in x??; do
1943 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1945 if test -s missing; then
1949 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1951 You have the option of continuing the configuration process, despite the
1952 distinct possibility that your kit is damaged, by typing 'y'es. If you
1953 do, don't blame me if something goes wrong. I advise you to type 'n'o
1954 and contact the author (perlbug@perl.org).
1957 echo $n "Continue? [n] $c" >&4
1961 echo "Continuing..." >&4
1965 echo "ABORTING..." >&4
1970 echo "Looks good..."
1973 echo "There is no MANIFEST file. I hope your kit is complete !"
1978 : Find the appropriate value for a newline for tr
1979 if test -n "$DJGPP"; then
1982 if test X"$trnl" = X; then
1983 case "`echo foo|tr '\n' x 2>/dev/null`" in
1987 if test X"$trnl" = X; then
1988 case "`echo foo|tr '\012' x 2>/dev/null`" in
1989 foox) trnl='\012' ;;
1992 if test X"$trnl" = X; then
1993 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1994 fooxy) trnl='\n\r' ;;
1997 if test X"$trnl" = X; then
2000 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2006 : compute the number of columns on the terminal for proper question formatting
2011 : set up the echo used in my read
2012 myecho="case \"\$xxxm\" in
2013 '') echo $n \"\$rp $c\" >&4;;
2015 '') echo $n \"[\$xxxm] $c\";;
2017 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2019 echo $n \"[\$xxxm] $c\" >&4
2021 echo $n \"\$rp [\$xxxm] $c\" >&4
2027 : now set up to do reads with possible shell escape and default assignment
2033 case "\$fastread" in
2034 yes) case "\$dflt" in
2037 case "\$silent-\$rp" in
2042 *) case "\$silent" in
2043 true) case "\$rp" in
2048 while expr "X\$ans" : "X!" >/dev/null; do
2052 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2060 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2069 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2074 echo "(OK, I'll run with -d after this question.)" >&4
2077 echo "*** Sorry, \$1 not supported yet." >&4
2087 echo "*** Substitution done -- please confirm."
2089 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2094 echo "*** Error -- try again."
2101 case "\$ans\$xxxm\$nostick" in
2113 : create .config dir to save info across Configure sessions
2114 test -d ../.config || mkdir ../.config
2115 cat >../.config/README <<EOF
2116 This directory created by Configure to save information that should
2117 persist across sessions for $package.
2119 You may safely delete it if you wish.
2122 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2124 $define|true|[yY]*) ;;
2125 *) case "$xversion" in
2128 *** WHOA THERE!!! ***
2130 This is an UNSTABLE DEVELOPMENT release.
2131 The version of this $package distribution is $xversion, that is, odd,
2132 (as opposed to even) and that signifies a development release.
2133 If you want a maintenance release, you want an even-numbered version.
2135 Do ***NOT*** install this into production use.
2136 Data corruption and crashes are possible.
2138 It is most seriously suggested that you do not continue any further
2139 unless you want to help in developing and debugging Perl.
2141 If you *still* want to build perl, you can answer 'y' now,
2142 or pass -Dusedevel to Configure.
2145 rp='Do you really want to continue?'
2149 [yY]) echo >&4 "Okay, continuing."
2150 usedevel="$define" ;;
2151 *) echo >&4 "Okay, bye."
2161 case "$versiononly" in
2162 '') versiononly="$define" ;;
2164 case "$installusrbinperl" in
2165 '') installusrbinperl="$undef" ;;
2170 : general instructions
2173 user=`(logname) 2>/dev/null`
2175 '') user=`whoami 2>&1`;;
2177 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2180 rp='Would you like to see the instructions?'
2191 This installation shell script will examine your system and ask you questions
2192 to determine how the perl5 package should be installed. If you get
2193 stuck on a question, you may use a ! shell escape to start a subshell or
2194 execute a command. Many of the questions will have default answers in square
2195 brackets; typing carriage return will give you the default.
2197 On some of the questions which ask for file or directory names you are allowed
2198 to use the ~name construct to specify the login directory belonging to "name",
2199 even if you don't have a shell which knows about that. Questions where this is
2200 allowed will be marked "(~name ok)".
2204 dflt='Type carriage return to continue'
2208 The prompter used in this script allows you to use shell variables and
2209 backticks in your answers. You may use $1, $2, etc... to refer to the words
2210 in the default answer, as if the default line was a set of arguments given to a
2211 script shell. This means you may also use $* to repeat the whole default line,
2212 so you do not have to re-type everything to add something to the default.
2214 Everytime there is a substitution, you will have to confirm. If there is an
2215 error (e.g. an unmatched backtick), the default answer will remain unchanged
2216 and you will be prompted again.
2218 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2219 the questions and use the computed defaults (or the previous answers if there
2220 was already a config.sh file). Type 'Configure -h' for a list of options.
2221 You may also start interactively and then answer '& -d' at any prompt to turn
2222 on the non-interactive behaviour for the remainder of the execution.
2228 Much effort has been expended to ensure that this shell script will run on any
2229 Unix system. If despite that it blows up on yours, your best bet is to edit
2230 Configure and run it again. If you can't run Configure for some reason,
2231 you'll have to generate a config.sh file by hand. Whatever problems you
2232 have, let me (perlbug@perl.org) know how I blew it.
2234 This installation script affects things in two ways:
2236 1) it may do direct variable substitutions on some of the files included
2238 2) it builds a config.h file for inclusion in C programs. You may edit
2239 any of these files as the need arises after running this script.
2241 If you make a mistake on a question, there is no easy way to back up to it
2242 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2243 files. Configure will offer to let you do this before it runs the SH files.
2246 dflt='Type carriage return to continue'
2248 case "$firsttime" in
2249 true) echo $user >>../.config/instruct;;
2253 : find out where common programs are
2255 echo "Locating common programs..." >&4
2268 if test -d \$dir/\$thing; then
2274 for thisthing in \$dir/\$thing; do
2275 : just loop through to pick last item
2277 if test -f \$thisthing; then
2280 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2283 elif test -f \$dir/\$thing.exe; then
2284 if test -n "$DJGPP"; then
2285 echo \$dir/\$thing.exe
2286 elif test "$eunicefix" != ":"; then
2287 : on Eunice apparently
2341 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2342 pth="$pth /lib /usr/lib"
2343 for file in $loclist; 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 know where '$file' is, and my life depends on it." >&4
2368 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2374 echo "Don't worry if any of the following aren't found..."
2376 for file in $trylist; do
2380 if test -f "$xxx"; then
2383 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2384 xxx=`./loc $file $file $pth`
2387 '') xxx=`./loc $file $file $pth`;;
2388 *) xxx=`./loc $xxx $xxx $pth`;;
2390 eval $file=$xxx$_exe
2394 echo $file is in $xxx.
2397 echo $file is in $xxx.
2400 echo "I don't see $file out there, $say."
2407 echo "Substituting grep for egrep."
2414 echo "Substituting cp for ln."
2423 echo "I can't find make or gmake, and my life depends on it." >&4
2424 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2432 *) # We can't have osname yet.
2433 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2434 # Assume that gmake, if found, is definitely GNU make
2435 # and prefer it over the system make.
2436 echo "Substituting gmake for make."
2444 echo "Hopefully test is built into your sh."
2447 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2448 echo "Using the test built into your sh."
2456 echo "Hopefully echo is built into your sh."
2461 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2462 $echo $n "hi there$c" >foo1
2463 echo $n "hi there$c" >foo2
2464 if cmp foo1 foo2 >/dev/null 2>&1; then
2465 echo "They are compatible. In fact, they may be identical."
2472 They are not compatible! You are probably running ksh on a non-USG system.
2473 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2474 have echo built in and we may have to run some Bourne shell scripts. That
2475 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2478 $echo $n "The star should be here-->$c"
2488 cat <<'EOSC' >>trygcc
2493 int main(int argc, char *argv[]) {
2497 if $cc -o try $ccflags $ldflags try.c; then
2500 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2506 case "`$cc -v -c try.c 2>&1`" in
2509 if $test X"$trygcc" = Xyes; then
2510 if gcc -o try -c try.c; then
2512 echo "You seem to have a working gcc, though." >&4
2513 rp="Would you like to use it?"
2515 if $test -f myread; then
2518 if $test -f UU/myread; then
2521 echo "Cannot find myread, sorry. Aborting." >&2
2526 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2527 if $test -f usethreads.cbu; then
2530 *** However, any setting of the C compiler flags (e.g. for thread support)
2531 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2532 *** (together with e.g. -Dusethreads).
2548 cat <<'EOSC' >>checkcc
2553 int main(int argc, char *argv[]) {
2557 if $cc -o try $ccflags $ldflags try.c; then
2560 if $test X"$despair" = Xyes; then
2561 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2564 You need to find a working C compiler.
2565 Either (purchase and) install the C compiler supplied by your OS vendor,
2566 or for a free C compiler try http://gcc.gnu.org/
2567 I cannot continue any further, aborting.
2576 : determine whether symbolic links are supported
2579 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2580 echo "Symbolic links are supported." >&4
2583 echo "Symbolic links are NOT supported." >&4
2588 : determine whether symbolic links are supported
2592 echo "Checking how to test for symbolic links..." >&4
2594 if $test "X$issymlink" = X; then
2596 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2597 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2599 if test $? = 0; then
2602 echo "Your builtin 'test -h' may be broken." >&4
2605 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2608 if test -f "$p/$test"; then
2617 echo "Trying external '$test -h'." >&4
2618 issymlink="$test -h"
2619 if $test ! -h sym >/dev/null 2>&1; then
2620 echo "External '$test -h' is broken, too." >&4
2628 if $test "X$issymlink" = X; then
2629 if $test -L sym 2>/dev/null; then
2630 issymlink="$test -L"
2631 echo "The builtin '$test -L' worked." >&4
2634 if $test "X$issymlink" != X; then
2635 echo "You can test for symbolic links with '$issymlink'." >&4
2637 echo "I do not know how you can test for symbolic links." >&4
2641 *) echo "No symbolic links, so not testing for their testing..." >&4
2647 case "$mksymlinks" in
2650 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2653 *) case "$lns:$issymlink" in
2654 *"ln"*" -s:"*"test -"?)
2655 echo "Creating the symbolic links..." >&4
2656 echo "(First creating the subdirectories...)" >&4
2658 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2660 test -z "$directory" && break
2664 if test ! -d t/base; then
2665 echo "Failed to create the subdirectories. Aborting." >&4
2668 echo "(Then creating the symlinks...)" >&4
2669 awk '{print $1}' $src/MANIFEST | while true; do
2671 test -z "$filename" && break
2672 if test -f $filename; then
2673 if $issymlink $filename; then
2677 if test -f $filename; then
2678 echo "$filename already exists, not symlinking."
2680 ln -s $src/$filename $filename
2684 if test ! -f t/base/lex.t; then
2685 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2690 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2699 case "$usecrosscompile" in
2701 $echo "Cross-compiling..."
2704 *-*-gcc) # A cross-compiling gcc, probably.
2705 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2707 # leave out ld, choosing it is more complex
2709 ranlib=$targetarch-ranlib
2710 $echo 'extern int foo;' > try.c
2711 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2713 if $test $# -gt 0; then
2715 incpth="`$echo $incpth|$sed 's/^ //'`"
2716 echo "Guessing incpth '$incpth'." >&4
2718 j="`$echo $i|$sed 's,/include$,/lib,'`"
2719 if $test -d $j; then
2723 libpth="`$echo $libpth|$sed 's/^ //'`"
2724 echo "Guessing libpth '$libpth'." >&4
2729 case "$targetarch" in
2730 '') echo "Targetarch not defined." >&4; croak=y ;;
2731 *) echo "Using targetarch $targetarch." >&4 ;;
2734 '') echo "Incpth not defined." >&4; croak=y ;;
2735 *) echo "Using incpth '$incpth'." >&4 ;;
2738 '') echo "Libpth not defined." >&4; croak=y ;;
2739 *) echo "Using libpth '$libpth'." >&4 ;;
2742 '') for i in $incpth; do
2743 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2745 echo "Guessing usrinc $usrinc." >&4
2750 '') echo "Usrinc not defined." >&4; croak=y ;;
2753 *) echo "Using usrinc $usrinc." >&4 ;;
2755 case "$targethost" in
2756 '') echo "Targethost not defined." >&4; croak=y ;;
2757 *) echo "Using targethost $targethost." >&4
2762 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2765 /*) run=$src/Cross/run
2766 targetmkdir=$src/Cross/mkdir
2768 from=$src/Cross/from
2770 *) pwd=`$test -f ../Configure & cd ..; pwd`
2772 targetmkdir=$pwd/Cross/mkdir
2774 from=$pwd/Cross/from
2777 case "$targetrun" in
2778 '') targetrun=ssh ;;
2783 case "$targetfrom" in
2784 '') targetfrom=scp ;;
2788 from=$from-$targetfrom
2789 case "$targetdir" in
2791 echo "Guessing targetdir $targetdir." >&4
2794 case "$targetuser" in
2796 echo "Guessing targetuser $targetuser." >&4
2799 case "$targetfrom" in
2803 case "$targetrun" in
2815 '') cwd=$targetdir ;;
2819 if $test ! -f \$exe.xok; then
2823 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2826 *) echo "Unknown targetrun '$targetrun'" >&4
2830 case "$targetmkdir" in
2832 cat >$targetmkdir <<EOF
2834 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2836 $chmod a+rx $targetmkdir
2838 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2850 $targetmkdir \`dirname \$f\`
2851 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2854 $targetmkdir $targetdir/\`dirname \$f\`
2855 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2868 $mkdir -p $targetdir/\`dirname \$f\`
2869 $cp \$f $targetdir/\$f || exit 1
2872 $targetmkdir $targetdir/\`dirname \$f\`
2873 $cp \$f $targetdir/\$f || exit 1
2880 *) echo "Unknown targetto '$targetto'" >&4
2884 case "$targetfrom" in
2891 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2896 cp) cat >$from <<EOF
2901 cp $targetdir/\$f . || exit 1
2906 *) echo "Unknown targetfrom '$targetfrom'" >&4
2910 if $test ! -f $run; then
2911 echo "Target 'run' script '$run' not found." >&4
2915 if $test ! -f $to; then
2916 echo "Target 'to' script '$to' not found." >&4
2920 if $test ! -f $from; then
2921 echo "Target 'from' script '$from' not found." >&4
2925 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2929 Using '$run' for remote execution,
2930 and '$from' and '$to'
2931 for remote file transfer.
2937 usecrosscompile='undef'
2942 : see whether [:lower:] and [:upper:] are supported character classes
2944 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2946 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2950 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2951 # (0xd9 and 0xe2), therefore that is a nice testing point.
2952 if test "X$up" = X -o "X$low" = X; then
2953 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2959 if test "X$up" = X -o "X$low" = X; then
2960 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2966 if test "X$up" = X -o "X$low" = X; then
2967 case "`echo RS | od -x 2>/dev/null`" in
2969 echo "Hey, this might be EBCDIC." >&4
2970 if test "X$up" = X -o "X$low" = X; then
2971 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2972 rs) up='[A-IJ-RS-Z]'
2977 if test "X$up" = X -o "X$low" = X; then
2978 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2988 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2990 echo "Using $up and $low to convert case." >&4
2993 echo "I don't know how to translate letters from upper to lower case." >&4
2994 echo "Your tr is not acting any way I know of." >&4
2998 : set up the translation script tr, must be called with ./tr of course
3002 '[A-Z][a-z]') exec $tr '$up' '$low';;
3003 '[a-z][A-Z]') exec $tr '$low' '$up';;
3010 : Try to determine whether config.sh was made on this system
3011 case "$config_sh" in
3013 myuname=`$uname -a 2>/dev/null`
3014 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3015 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3016 # because the A-Z/a-z are not consecutive.
3017 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's,['/],,g' | \
3018 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3019 newmyuname="$myuname"
3021 case "$knowitall" in
3023 if test -f ../config.sh; then
3024 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3025 eval "`grep myuname= ../config.sh`"
3027 if test "X$myuname" = "X$newmyuname"; then
3035 : Get old answers from old config file if Configure was run on the
3036 : same system, otherwise use the hints.
3039 if test -f config.sh; then
3041 rp="I see a config.sh file. Shall I use it to set the defaults?"
3044 n*|N*) echo "OK, I'll ignore it."
3045 mv config.sh config.sh.old
3046 myuname="$newmyuname"
3048 *) echo "Fetching default answers from your old config.sh file..." >&4
3056 : Older versions did not always set $sh. Catch re-use of such
3066 if test ! -f config.sh; then
3069 First time through, eh? I have some defaults handy for some systems
3070 that need some extra help getting the Configure answers right:
3073 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3075 : Half the following guesses are probably wrong... If you have better
3076 : tests or hints, please send them to perlbug@perl.org
3077 : The metaconfig authors would also appreciate a copy...
3078 $test -f /irix && osname=irix
3079 $test -f /xenix && osname=sco_xenix
3080 $test -f /dynix && osname=dynix
3081 $test -f /dnix && osname=dnix
3082 $test -f /lynx.os && osname=lynxos
3083 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3084 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3085 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3086 $test -f /bin/mips && /bin/mips && osname=mips
3087 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3088 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3089 $test -d /usr/apollo/bin && osname=apollo
3090 $test -f /etc/saf/_sactab && osname=svr4
3091 $test -d /usr/include/minix && osname=minix
3092 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3093 if $test -d /MachTen -o -d /MachTen_Folder; then
3095 if $test -x /sbin/version; then
3096 osvers=`/sbin/version | $awk '{print $2}' |
3097 $sed -e 's/[A-Za-z]$//'`
3098 elif $test -x /usr/etc/version; then
3099 osvers=`/usr/etc/version | $awk '{print $2}' |
3100 $sed -e 's/[A-Za-z]$//'`
3106 $test -f /sys/posix.dll &&
3107 $test -f /usr/bin/what &&
3108 set X `/usr/bin/what /sys/posix.dll` &&
3109 $test "$3" = UWIN &&
3113 if $test -f $uname; then
3121 umips) osname=umips ;;
3124 [23]100) osname=mips ;;
3125 next*) osname=next ;;
3127 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3128 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3131 elif $test -f /etc/kconfig; then
3133 if test "$lns" = "$ln -s"; then
3135 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3137 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3144 if test -n "$DJGPP"; then
3153 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3155 # oslevel can fail with:
3156 # oslevel: Unable to acquire lock.
3157 *not\ found) osvers="$4"."$3" ;;
3158 '<3240'|'<>3240') osvers=3.2.0 ;;
3159 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3160 '=3250'|'>3250') osvers=3.2.5 ;;
3164 bsd386) osname=bsd386
3167 cygwin*) osname=cygwin
3170 *dc.osx) osname=dcosx
3176 domainos) osname=apollo
3182 dragonfly) osname=dragonfly
3185 dynixptx*) osname=dynixptx
3186 osvers=`echo "$4"|sed 's/^v//'`
3188 freebsd) osname=freebsd
3190 genix) osname=genix ;;
3194 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3210 netbsd*) osname=netbsd
3213 news-os) osvers="$3"
3215 4*) osname=newsos4 ;;
3219 next*) osname=next ;;
3220 nonstop-ux) osname=nonstopux ;;
3221 openbsd) osname=openbsd
3227 POSIX-BC | posix-bc ) osname=posix-bc
3230 powerux | power_ux | powermax_os | powermaxos | \
3231 powerunix | power_unix) osname=powerux
3237 solaris) osname=solaris
3239 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3246 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3250 titanos) osname=titanos
3259 ultrix) osname=ultrix
3262 osf1|mls+) case "$5" in
3265 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3268 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3271 hp*) osname=hp_osf1 ;;
3272 mips) osname=mips_osf1 ;;
3275 # UnixWare 7.1.2 is known as Open UNIX 8
3276 openunix|unixware) osname=svr5
3284 $2) case "$osname" in
3288 : svr4.x or possibly later
3298 if test -f /stand/boot ; then
3299 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3300 if test -n "$INITPROG" -a -f "$INITPROG"; then
3301 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3302 if test -n "$isesix"; then
3310 *) if test -f /etc/systemid; then
3312 set `echo $3 | $sed 's/\./ /g'` $4
3313 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3315 elif $test -f $src/hints/sco_$1_$2.sh; then
3317 elif $test -f $src/hints/sco_$1.sh; then
3322 '') : Still unknown. Probably a generic Sys V.
3331 *) case "$osname" in
3332 '') : Still unknown. Probably a generic BSD.
3340 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3341 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3342 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3345 $rm -f UU/kernel.what
3346 elif test -d c:/. -o -n "$is_os2" ; then
3353 case "$targetarch" in
3356 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3361 : Now look for a hint file osname_osvers, unless one has been
3362 : specified already.
3365 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3366 : Also try without trailing minor version numbers.
3367 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3368 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3369 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3370 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3373 *) case "$osvers" in
3376 *) if $test -f $src/hints/$file.sh ; then
3378 elif $test -f $src/hints/$xfile.sh ; then
3380 elif $test -f $src/hints/$xxfile.sh ; then
3382 elif $test -f $src/hints/$xxxfile.sh ; then
3384 elif $test -f $src/hints/$xxxxfile.sh ; then
3386 elif $test -f "$src/hints/${osname}.sh" ; then
3395 if $test -f Policy.sh ; then
3398 none) dflt="Policy" ;;
3399 *) dflt="Policy $dflt" ;;
3404 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3408 if $test -f Policy.sh ; then
3411 There's also a Policy hint file available, which should make the
3412 site-specific (policy) questions easier to answer.
3419 You may give one or more space-separated answers, or "none" if appropriate.
3420 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3421 previous run of Configure, you may specify it as well as or instead of
3422 OS-specific hints. If hints are provided for your OS, you should use them:
3423 although Perl can probably be built without hints on many platforms, using
3424 hints often improve performance and may enable features that Configure can't
3425 set up on its own. If there are no hints that match your OS, specify "none";
3426 DO NOT give a wrong version or a wrong OS.
3430 rp="Which of these apply, if any?"
3433 for file in $tans; do
3434 if $test X$file = XPolicy -a -f Policy.sh; then
3436 $cat Policy.sh >> UU/config.sh
3437 elif $test -f $src/hints/$file.sh; then
3438 . $src/hints/$file.sh
3439 $cat $src/hints/$file.sh >> UU/config.sh
3440 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3443 : Give one chance to correct a possible typo.
3444 echo "$file.sh does not exist"
3446 rp="hint to use instead?"
3448 for file in $ans; do
3449 if $test -f "$src/hints/$file.sh"; then
3450 . $src/hints/$file.sh
3451 $cat $src/hints/$file.sh >> UU/config.sh
3452 elif $test X$ans = X -o X$ans = Xnone ; then
3455 echo "$file.sh does not exist -- ignored."
3462 : Remember our hint file for later.
3463 if $test -f "$src/hints/$file.sh" ; then
3473 echo "Fetching default answers from $config_sh..." >&4
3477 cp $config_sh config.sh 2>/dev/null
3487 test "$override" && . ./optdef.sh
3489 : Restore computed paths
3490 for file in $loclist $trylist; do
3491 eval $file="\$_$file"
3496 Configure uses the operating system name and version to set some defaults.
3497 The default value is probably right if the name rings a bell. Otherwise,
3498 since spelling matters for me, either accept the default or answer "none"
3505 ''|' '|none) dflt=none ;;
3506 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3509 *) dflt="$osname" ;;
3511 rp="Operating system name?"
3515 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3521 ''|' '|none) dflt=none ;;
3522 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3523 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3525 ''|' ') dflt=none ;;
3530 *) dflt="$osvers" ;;
3532 rp="Operating system version?"
3542 : who configured the system
3543 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3546 cf_by=`(logname) 2>/dev/null`
3549 cf_by=`(whoami) 2>/dev/null`
3551 "") cf_by=unknown ;;
3556 : decide how portable to be. Allow command line overrides.
3557 case "$d_portable" in
3559 *) d_portable="$define" ;;
3562 : set up shell script to do ~ expansion
3568 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3571 if $test -f /bin/csh; then
3572 /bin/csh -f -c "glob \$1"
3577 name=\`$expr x\$1 : '..\([^/]*\)'\`
3578 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3579 if $test ! -d "\$dir"; then
3581 echo "\$me: can't locate home directory for: \$name" >&2
3586 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3602 : now set up to get a file name
3606 cat <<'EOSC' >>getfile
3622 : getfile will accept an answer from the comma-separated list
3623 : enclosed in parentheses even if it does not meet other criteria.
3624 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3625 fn=`echo $fn | sed 's/(.*)//'`
3631 loc_file=`expr $fn : '.*:\(.*\)'`
3632 fn=`expr $fn : '\(.*\):.*'`
3640 */*) fullpath=true;;
3649 *e*) exp_file=true;;
3652 *p*) nopath_ok=true;;
3657 *d*) type='Directory';;
3658 *l*) type='Locate';;
3663 Locate) what='File';;
3668 case "$d_portable" in
3676 while test "$type"; do
3681 true) rp="$rp (~name ok)";;
3684 if test -f UU/getfile.ok && \
3685 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3704 value=`UU/filexp $ans`
3707 if test "$ans" != "$value"; then
3708 echo "(That expands to $value on this system.)"
3722 /*) value="$ansexp" ;;
3723 [a-zA-Z]:/*) value="$ansexp" ;;
3728 echo "I shall only accept a full path name, as in /bin/ls." >&4
3729 echo "Use a ! shell escape if you wish to check pathnames." >&4
3732 echo "Please give a full path name, starting with slash." >&4
3735 echo "Note that using ~name is ok provided it expands well." >&4
3748 for fp in $gfpth; do
3749 if test "X$fp" = X.; then
3754 if test -f "$pf"; then
3756 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3758 echo "($value is not a plain file, but that's ok.)"
3761 if test X"$type" = X; then
3768 for fp in $gfpth; do
3769 if test "X$fp" = X.; then
3774 direxp="$fp/$ansexp"
3776 if test -d "$direxp"; then
3784 if test -d "$ansexp"; then
3785 echo "(Looking for $loc_file in directory $value.)"
3786 value="$value/$loc_file"
3787 ansexp="$ansexp/$loc_file"
3789 if test -f "$ansexp"; then
3792 case "$nopath_ok" in
3793 true) case "$value" in
3795 *) echo "Assuming $value will be in people's path."
3811 if test "$fastread" = yes; then
3816 rp="$what $value doesn't exist. Use that name anyway?"
3835 test "X$gfpthkeep" != Xy && gfpth=""
3838 : determine root of directory hierarchy where package will be installed.
3841 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3844 dflt=`echo "$prefix" | sed 's/.$//'`
3852 By default, $package will be installed in $dflt/bin, manual pages
3853 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3854 installation directories. Typically this is something like /usr/local.
3855 If you wish to have binaries under /usr/bin but other parts of the
3856 installation under /usr/local, that's ok: you will be prompted
3857 separately for each of the installation directories, the prefix being
3858 only used to set the defaults.
3862 rp='Installation prefix to use?'
3870 *) oldprefix="$prefix";;
3879 *) afsroot=$afsroot ;;
3885 $define|true) afs=true ;;
3886 $undef|false) afs=false ;;
3887 *) if test -d $afsroot; then
3895 echo "AFS may be running... I'll be extra cautious then..." >&4
3897 echo "AFS does not seem to be running..." >&4
3900 : determine installation prefix for where package is to be installed.
3904 Since you are running AFS, I need to distinguish the directory in which
3905 files will reside from the directory in which they are installed (and from
3906 which they are presumably copied to the former directory by occult means).
3909 case "$installprefix" in
3910 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3911 *) dflt="$installprefix";;
3916 In some special cases, particularly when building $package for distribution,
3917 it is convenient to distinguish the directory in which files should be
3918 installed from the directory ($prefix) in which they will
3919 eventually reside. For most users, these two directories are the same.
3922 case "$installprefix" in
3924 *) dflt=$installprefix;;
3928 rp='What installation prefix should I use for installing files?'
3930 installprefix="$ans"
3931 installprefixexp="$ansexp"
3933 : Perform the prefixexp/installprefixexp correction if necessary
3934 cat <<EOS >installprefix
3937 cat <<'EOSC' >>installprefix
3938 : Change installation prefix, if necessary.
3939 if $test X"$prefix" != X"$installprefix"; then
3940 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3942 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3945 chmod +x installprefix
3946 $eunicefix installprefix
3948 : Set variables such as privlib and privlibexp from the output of ./getfile
3949 : performing the prefixexp/installprefixexp correction if necessary.
3950 cat <<EOS >setprefixvar
3953 cat <<'EOSC' >>setprefixvar
3954 eval "${prefixvar}=\"\$ans\""
3955 eval "${prefixvar}exp=\"\$ansexp\""
3958 chmod +x setprefixvar
3959 $eunicefix setprefixvar
3961 : set up the script used to warn in case of inconsistency
3970 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3972 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3973 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
3978 echo "*** WHOA THERE!!! ***" >&4
3979 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3982 rp=" Keep the $hint value?"
3985 y) td=$was; tu=$was;;
3989 : function used to set $1 to $val
3990 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3992 $define$undef) . ./whoa; eval "$var=\$td";;
3993 $undef$define) . ./whoa; eval "$var=\$tu";;
3994 *) eval "$var=$val";;
3998 $define|true|[yY]*) dflt='y';;
4003 Perl can be built to use the SOCKS proxy protocol library. To do so,
4004 Configure must be run with -Dusesocks. If you use SOCKS you also need
4005 to use the PerlIO abstraction layer, this will be implicitly selected.
4007 If this doesn't make any sense to you, just accept the default '$dflt'.
4009 rp='Build Perl for SOCKS?'
4012 y|Y) val="$define" ;;
4019 $define|true|[yY]*) useperlio="$define";;
4022 case "$useperlio" in
4023 $define|true|[yY]*|'') dflt='y';;
4028 Previous version of $package used the standard IO mechanisms as
4029 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4030 alternate IO mechanisms via the PerlIO abstraction layer, but the
4031 stdio mechanism is still available if needed. The abstraction layer
4032 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4033 Using PerlIO with sfio may cause problems with some extension modules.
4035 If this doesn't make any sense to you, just accept the default '$dflt'.
4037 rp='Use the PerlIO abstraction layer?'
4044 echo "Ok, doing things the stdio way."
4053 case "$useperlio" in
4054 $define|true|[yY]*) ;;
4057 You are using the SOCKS proxy protocol library which means that you
4058 should also use the PerlIO layer. You may be headed for trouble.
4067 : get the patchlevel
4069 echo "Getting the current patchlevel..." >&4
4070 if $test -r $rsrc/patchlevel.h;then
4071 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4072 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4073 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4074 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4075 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4076 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4077 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
4086 $echo "(You do not have patchlevel.h. Eek.)"
4088 if $test -r $rsrc/.patch ; then
4089 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4090 perl_patchlevel=`cat $rsrc/.patch`
4093 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4094 version_patchlevel_string="version $patchlevel subversion $subversion"
4095 case "$perl_patchlevel" in
4097 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4100 $echo "(You have $package $version_patchlevel_string.)"
4104 : XXX Should be a Configure test for double-dots in filenames.
4105 version=`echo $revision $patchlevel $subversion | \
4106 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4107 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4108 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4111 version=`echo $revision $patchlevel $subversion | \
4112 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4113 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4114 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4117 : Special case the 5.005_xx maintenance series, which used 5.005
4118 : without any subversion label as a subdirectory in $sitelib
4119 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4120 api_versionstring='5.005'
4123 case "$usethreads" in
4124 $define|true|[yY]*) dflt='y';;
4125 *) # Catch case where user specified ithreads or 5005threads but
4126 # forgot -Dusethreads (A.D. 4/2002)
4127 case "$useithreads$use5005threads" in
4129 case "$useperlio" in
4130 "$define") dflt='y' ;;
4140 Perl can be built to take advantage of threads on some systems.
4141 To do so, Configure can be run with -Dusethreads.
4143 Note that Perl built with threading support runs slightly slower
4144 and uses more memory than plain Perl. The current implementation
4145 is believed to be stable, but it is fairly new, and so should be
4146 treated with caution.
4148 If this doesn't make any sense to you, just accept the default '$dflt'.
4150 rp='Build a threading Perl?'
4153 y|Y) val="$define" ;;
4159 if $test $patchlevel -lt 9; then
4160 case "$usethreads" in
4164 Since release 5.6, Perl has had two different threading implementations,
4165 the newer interpreter-based version (ithreads) with one interpreter per
4166 thread, and the older 5.005 version (5005threads).
4167 The 5005threads version is effectively unmaintained and will probably be
4168 removed in Perl 5.10, so there should be no need to build a Perl using it
4169 unless needed for backwards compatibility with some existing 5.005threads
4173 : Default to ithreads unless overridden on command line or with
4176 case "$use5005threads" in
4177 $define|true|[yY]*) dflt='n';;
4179 case "$useithreads" in
4180 $undef|false|[nN]*) dflt='n';;
4182 rp='Use the newer interpreter-based ithreads?'
4185 y|Y) val="$define" ;;
4190 : Now set use5005threads to the opposite value.
4191 case "$useithreads" in
4192 $define) val="$undef" ;;
4199 useithreads="$undef"
4200 use5005threads="$undef"
4204 case "$useithreads$use5005threads" in
4208 You cannot have both the ithreads and the 5.005 threads enabled
4209 at the same time. Disabling the 5.005 threads since they are
4210 much less stable than the ithreads.
4213 use5005threads="$undef"
4218 : perl-5.9.x and later
4220 if test X"$usethreads" = "X$define"; then
4221 case "$use5005threads" in
4225 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4232 use5005threads="$undef"
4233 useithreads="$usethreads"
4236 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4239 *** To build with ithreads you must also use the PerlIO layer.
4240 *** Cannot continue, aborting.
4246 case "$d_oldpthreads" in
4247 '') : Configure tests would be welcome here. For now, assume undef.
4249 *) val="$d_oldpthreads" ;;
4255 : Look for a hint-file generated 'call-back-unit'. If the
4256 : user has specified that a threading perl is to be built,
4257 : we may need to set or change some other defaults.
4258 if $test -f usethreads.cbu; then
4259 echo "Your platform has some specific hints regarding threaded builds, using them..."
4262 case "$usethreads" in
4263 "$define"|true|[yY]*)
4265 (Your platform does not have any specific hints for threaded builds.
4266 Assuming POSIX threads, then.)
4274 Perl can be built so that multiple Perl interpreters can coexist
4275 within the same Perl executable.
4278 case "$useithreads" in
4281 This multiple interpreter support is required for interpreter-based threads.
4285 *) case "$usemultiplicity" in
4286 $define|true|[yY]*) dflt='y';;
4290 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4291 rp='Build Perl for multiplicity?'
4294 y|Y) val="$define" ;;
4303 case "$usemorebits" in
4304 "$define"|true|[yY]*)
4305 use64bitint="$define"
4306 uselongdouble="$define"
4307 usemorebits="$define"
4309 *) usemorebits="$undef"
4313 : make some quick guesses about what we are up against
4315 $echo $n "Hmm... $c"
4325 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4326 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4328 echo "Looks kind of like an OSF/1 system, but we'll see..."
4330 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4331 xxx=`./loc addbib blurfl $pth`
4332 if $test -f $xxx; then
4333 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4337 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4338 echo "Looks kind of like an extended USG system, but we'll see..."
4340 echo "Looks kind of like a USG system, but we'll see..."
4344 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4345 echo "Looks kind of like a BSD system, but we'll see..."
4349 echo "Looks kind of like a Version 7 system, but we'll see..."
4352 case "$eunicefix" in
4355 There is, however, a strange, musty smell in the air that reminds me of
4356 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4360 : it so happens the Eunice I know will not run shell scripts in Unix format
4364 echo "Congratulations. You aren't running Eunice."
4368 : Detect OS2. The p_ variable is set above in the Head.U unit.
4369 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4370 : semicolon as a patch separator
4375 I have the feeling something is not exactly right, however...don't tell me...
4376 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4377 (Or you may be running DOS with DJGPP.)
4382 if test -f /xenix; then
4383 echo "Actually, this looks more like a XENIX system..."
4388 echo "It's not Xenix..."
4393 if test -f /venix; then
4394 echo "Actually, this looks more like a VENIX system..."
4401 echo "Nor is it Venix..."
4404 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4405 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4412 rp="Use which C compiler?"
4416 : See if they have not cc but they do have gcc
4418 : Look for a hint-file generated 'call-back-unit'. Now that the
4419 : user has specified the compiler, we may need to set or change some
4421 if $test -f cc.cbu; then
4427 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4431 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4433 printf("%s\n", __VERSION__);
4435 printf("%s\n", "1");
4441 if $cc -o try $ccflags $ldflags try.c; then
4442 gccversion=`$run ./try`
4443 case "$gccversion" in
4444 '') echo "You are not using GNU cc." ;;
4445 *) echo "You are using GNU cc $gccversion."
4451 echo "*** WHOA THERE!!! ***" >&4
4452 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4453 case "$knowitall" in
4455 echo " You'd better start hunting for one and let me know about it." >&4
4461 case "$gccversion" in
4462 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4464 case "$gccversion" in
4465 '') gccosandvers='' ;;
4466 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4467 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4469 case "$gccosandvers" in
4470 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4471 $osname$osvers) ;; # looking good
4472 $osname*) cat <<EOM >&4
4474 *** WHOA THERE!!! ***
4476 Your gcc has not been compiled for the exact release of
4477 your operating system ($gccosandvers versus $osname$osvers).
4479 In general it is a good idea to keep gcc synchronized with
4480 the operating system because otherwise serious problems
4481 may ensue when trying to compile software, like Perl.
4483 I'm trying to be optimistic here, though, and will continue.
4484 If later during the configuration and build icky compilation
4485 problems appear (headerfile conflicts being the most common
4486 manifestation), I suggest reinstalling the gcc to match
4487 your operating system release.
4491 *) gccosandvers='' ;; # failed to parse, better be silent
4499 # gcc 3.* complain about adding -Idirectories that they already know about,
4500 # so we will take those off from locincpth.
4501 case "$gccversion" in
4503 echo "main(){}">try.c
4504 for incdir in $locincpth; do
4505 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4506 grep '^c[cp]p*[01]: warning: changing search order '`
4507 if test "X$warn" != X; then
4508 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4514 : What should the include directory be ?
4516 $echo $n "Hmm... $c"
4520 if $test -f /bin/mips && /bin/mips; then
4521 echo "Looks like a MIPS system..."
4522 $cat >usr.c <<'EOCP'
4523 #ifdef SYSTYPE_BSD43
4527 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4528 dflt='/bsd43/usr/include'
4532 mips_type='System V'
4534 $rm -f usr.c usr.out
4535 echo "and you're compiling with the $mips_type compiler and libraries."
4539 echo "Doesn't look like a MIPS system."
4549 case "$xxx_prompt" in
4552 rp='Where are the include files you want to use?'
4560 : see how we invoke the C preprocessor
4562 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4563 cat <<'EOT' >testcpp.c
4569 if test ! -f cppstdin; then
4570 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4571 # AIX cc -E doesn't show the absolute headerfile
4572 # locations but we'll cheat by using the -M flag.
4573 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
4575 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4578 echo "Keeping your $hint cppstdin wrapper."
4581 wrapper=`pwd`/cppstdin
4585 if $test "X$cppstdin" != "X" && \
4586 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4587 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4589 echo "You used to use $cppstdin $cppminus so we'll use that again."
4591 '') echo "But let's see if we can live without a wrapper..." ;;
4593 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4594 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4596 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4599 echo "(However, $cpprun $cpplast does not work, let's see...)"
4607 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4614 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4615 $cc -E <testcpp.c >testcpp.out 2>&1; \
4616 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4617 echo "Yup, it does."
4620 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4621 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4622 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4623 echo "Yup, it does."
4626 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4627 $cc -P <testcpp.c >testcpp.out 2>&1; \
4628 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4629 echo "Yipee, that works!"
4632 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4633 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4634 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4635 echo "At long last!"
4638 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4639 $cpp <testcpp.c >testcpp.out 2>&1; \
4640 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4644 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4645 $cpp - <testcpp.c >testcpp.out 2>&1; \
4646 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4647 echo "Hooray, it works! I was beginning to wonder."
4650 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4651 $wrapper <testcpp.c >testcpp.out 2>&1; \
4652 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4658 rp="No dice. I can't find a C preprocessor. Name one:"
4662 $x_cpp <testcpp.c >testcpp.out 2>&1
4663 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4664 echo "OK, that will do." >&4
4666 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4681 echo "Perhaps can we force $cc -E using a wrapper..."
4682 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4683 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4689 echo "Nope, we'll have to live without it..."
4703 "$wrapper"|'cppstdin') ;;
4704 *) $rm -f $wrapper;;
4706 $rm -f testcpp.c testcpp.out
4708 : Set private lib path
4711 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4716 '') dlist="$loclibpth $plibpth $glibpth";;
4717 *) dlist="$libpth";;
4720 : Now check and see which directories actually exist, avoiding duplicates
4724 if $test -d $xxx; then
4727 *) libpth="$libpth $xxx";;
4733 Some systems have incompatible or broken versions of libraries. Among
4734 the directories listed in the question below, please remove any you
4735 know not to be holding relevant libraries, and add any that are needed.
4736 Say "none" for none.
4747 rp="Directories to use for library searches?"
4754 : compute shared library extension
4757 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4767 On some systems, shared libraries may be available. Answer 'none' if
4768 you want to suppress searching of shared libraries for the remainder
4769 of this configuration.
4772 rp='What is the file extension used for shared libraries?'
4776 : Define several unixisms.
4777 : Hints files or command line option can be used to override them.
4778 : The convoluted testing is in case hints files set either the old
4781 '') case "$exe_ext" in
4783 *) _exe="$exe_ext" ;;
4788 '') case "$lib_ext" in
4795 '') case "$obj_ext" in
4802 '') case "$path_sep" in
4813 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4815 : Which makefile gets called first. This is used by make depend.
4816 case "$firstmakefile" in
4817 '') firstmakefile='makefile';;
4821 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4824 case "$uselongdouble" in
4825 $define|true|[yY]*) dflt='y';;
4830 Perl can be built to take advantage of long doubles which
4831 (if available) may give more accuracy and range for floating point numbers.
4833 If this doesn't make any sense to you, just accept the default '$dflt'.
4835 rp='Try to use long doubles if available?'
4838 y|Y) val="$define" ;;