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 package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # The metaunits are also available from the public git repository:
23 # http://perl5.git.perl.org/metaconfig.git/ or
24 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
26 # See Porting/pumpkin.pod for more information on metaconfig.
29 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
31 # Generated on Thu Nov 5 21:01:50 CET 2009 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
340 initialinstalllocation=''
367 d_attribute_deprecated=''
368 d_attribute_format=''
369 d_attribute_malloc=''
370 d_attribute_nonnull=''
371 d_attribute_noreturn=''
373 d_attribute_unused=''
374 d_attribute_warn_unused_result=''
375 d_printf_format_null=''
378 d_builtin_choose_expr=''
381 d_c99_variadic_macros=''
428 endhostent_r_proto=''
434 endprotoent_r_proto=''
440 endservent_r_proto=''
493 gethostbyaddr_r_proto=''
495 gethostbyname_r_proto=''
497 gethostent_r_proto=''
510 getnetbyaddr_r_proto=''
512 getnetbyname_r_proto=''
526 d_getprotobyname_r=''
527 getprotobyname_r_proto=''
528 d_getprotobynumber_r=''
529 getprotobynumber_r_proto=''
531 getprotoent_r_proto=''
543 getservbyname_r_proto=''
545 getservbyport_r_proto=''
547 getservent_r_proto=''
573 d_libm_lib_version=''
576 d_localtime_r_needs_tzset=''
587 d_malloc_good_size=''
629 d_old_pthread_create_joinable=''
630 old_pthread_create_joinable=''
632 d_pthread_attr_setscope=''
671 sethostent_r_proto=''
688 setprotoent_r_proto=''
700 setservent_r_proto=''
734 d_sprintf_returns_strlen=''
749 d_stdio_ptr_lval_nochange_cnt=''
750 d_stdio_ptr_lval_sets_cnt=''
894 d_gdbm_ndbm_h_uses_prototypes=''
895 d_gdbmndbm_h_uses_prototypes=''
897 d_ndbm_h_uses_prototypes=''
971 d_inc_version_list=''
973 inc_version_list_init=''
992 ignore_versioned_solibs=''
1056 d_perl_otherlibdirs=''
1064 api_versionstring=''
1070 version_patchlevel_string=''
1074 d_nv_preserves_uv=''
1075 d_nv_zero_is_allbits_zero=''
1086 nv_overflows_integers_at=''
1087 nv_preserves_uv_bits=''
1159 installsitehtml1dir=''
1162 installsitehtml3dir=''
1169 installsiteman1dir=''
1172 installsiteman3dir=''
1177 installsitescript=''
1192 d_stdio_stream_array=''
1193 stdio_stream_array=''
1210 ccflags_uselargefiles=''
1211 ldflags_uselargefiles=''
1212 libswanted_uselargefiles=''
1232 installvendorarch=''
1239 installvendorhtml1dir=''
1241 vendorhtml1direxp=''
1242 installvendorhtml3dir=''
1244 vendorhtml3direxp=''
1250 installvendorman1dir=''
1253 installvendorman3dir=''
1260 installvendorscript=''
1273 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1276 : We must find out about Eunice early
1278 if test -f /etc/unixtovms; then
1279 eunicefix=/etc/unixtovms
1281 if test -f /etc/unixtovms.exe; then
1282 eunicefix=/etc/unixtovms.exe
1285 : Set executable suffix now -- needed before hints available
1286 if test -f "/libs/version.library"; then
1289 elif test -f "/system/gnu_library/bin/ar.pm"; then
1292 elif test -n "$DJGPP"; then
1295 elif test -d c:/. -o -n "$is_os2" ; then
1302 : Trailing extension. Override this in a hint file, if needed.
1303 : Extra object files, if any, needed on this platform.
1307 : change the next line if compiling for Xenix/286 on Xenix/386
1308 xlibpth='/usr/lib/386 /lib/386'
1309 : Possible local library directories to search.
1310 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1311 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1313 : general looking path for locating libraries
1314 glibpth="/lib /usr/lib $xlibpth"
1315 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1316 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1317 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1318 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1320 : Private path used by Configure to find libraries. Its value
1321 : is prepended to libpth. This variable takes care of special
1322 : machines, like the mips. Usually, it should be empty.
1325 : default library list
1327 : some systems want to use only the non-versioned libso:s
1328 ignore_versioned_solibs=''
1329 : set usethreads on the Configure command line to enable threads.
1330 usereentrant='undef'
1331 : full support for void wanted by default
1334 : Possible local include directories to search.
1335 : Set locincpth to "" in a hint file to defeat local include searches.
1336 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1337 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1339 : no include file wanted by default
1342 : Enable -DEBUGGING and -DDEBUGGING from the command line
1349 : set useposix=false in your hint file to disable the POSIX extension.
1351 : set useopcode=false in your hint file to disable the Opcode extension.
1354 ccflags_uselargefiles=''
1355 ldflags_uselargefiles=''
1356 libswanted_uselargefiles=''
1357 : set usemultiplicity on the Configure command line to enable multiplicity.
1358 : set usesocks on the Configure command line to enable socks.
1359 : List of libraries we want.
1360 : If anyone needs extra -lxxx, put those in a hint file.
1361 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1362 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1363 : We probably want to search /usr/shlib before most other libraries.
1364 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1365 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1366 glibpth="/usr/shlib $glibpth"
1367 : Do not use vfork unless overridden by a hint file.
1370 : Find the basic shell for Bourne shell scripts
1374 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1377 if test -f "$xxx"; then
1380 : Build up a list and do a single loop so we can 'break' out.
1381 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1382 for xxx in sh bash ksh pdksh ash; do
1384 try="$try ${p}/${xxx}"
1388 if test -f "$xxx"; then
1391 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1394 elif test -f "$xxx.exe"; then
1405 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1407 Usually it's in /bin/sh. How did you even get this far?
1408 Please contact me (Perl Maintainers) at perlbug@perl.org and
1409 we'll try to straighten this all out.
1415 : see if sh knows # comments
1416 if `$sh -c '#' >/dev/null 2>&1`; then
1420 test -f $xcat$_exe || xcat=/usr/bin/cat
1421 if test ! -f $xcat$_exe; then
1422 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1423 if test -f $p/cat$_exe; then
1428 if test ! -f $xcat$_exe; then
1429 echo "Can't find cat anywhere!"
1433 echo "#!$xcat" >sharp
1436 ./sharp > today 2>/dev/null
1437 if test -s today; then
1440 echo "#! $xcat" > sharp
1443 ./sharp > today 2>/dev/null
1444 if test -s today; then
1452 echo "Your $sh doesn't grok # comments--I will strip them later on."
1455 echo "exec grep -v '^[ ]*#'" >spitshell
1457 $eunicefix spitshell
1458 spitshell=`pwd`/spitshell
1460 echo "I presume that if # doesn't work, #! won't work either!"
1465 : figure out how to guarantee sh startup
1467 '') startsh=${sharpbang}${sh} ;;
1479 : echo "Yup, it does."
1481 echo "Hmm... '$startsh' does not guarantee sh startup..."
1482 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1486 : Save command line options in file UU/cmdline.opt for later use in
1487 : generating config.sh.
1488 cat > cmdline.opt <<EOSH
1489 : Configure command line arguments.
1498 cat >>cmdline.opt <<EOSH
1499 config_arg$argn='$arg'
1501 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1504 arg_exp=`cat cmdl.opt`
1505 args_exp="$args_exp$args_sep'$arg_exp'"
1506 argn=`expr $argn + 1`
1511 : produce awk script to parse command line options
1512 cat >options.awk <<'EOF'
1514 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1516 len = length(optstr);
1517 for (i = 1; i <= len; i++) {
1518 c = substr(optstr, i, 1);
1519 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1530 if (substr(str, 1, 1) != "-") {
1531 printf("'%s'\n", str);
1535 for (i = 2; i <= len; i++) {
1536 c = substr(str, i, 1);
1538 printf("-%s\n", substr(str, i));
1544 printf("'%s'\n", substr(str, i + 1));
1557 : process the command line options
1558 set X `for arg in "$@"; do echo "X$arg"; done |
1559 sed -e s/X// | awk -f options.awk`
1564 : set up default values
1574 rm -f optdef.sh posthint.sh
1575 cat >optdef.sh <<EOS
1581 while test $# -gt 0; do
1583 -d) shift; fastread=yes;;
1584 -e) shift; alldone=cont;;
1588 if test -r "$1"; then
1591 echo "$me: cannot read config file $1." >&2
1597 -h) shift; error=true;;
1598 -r) shift; reuseval=true;;
1599 -s) shift; silent=true; realsilent=true;;
1600 -E) shift; alldone=exit;;
1601 -K) shift; knowitall=true;;
1602 -O) shift; override=true;;
1603 -S) shift; silent=true; extractsh=true;;
1608 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1609 echo "$me: ignoring -D $1" >&2
1612 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1613 *) echo "$1='define'" >> optdef.sh;;
1620 *=) echo "$1" >> optdef.sh;;
1622 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1623 echo "$me: ignoring -U $1" >&2
1625 *) echo "$1='undef'" >> optdef.sh;;
1636 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1640 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1641 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1647 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1648 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1649 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1650 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1651 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1652 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1658 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1660 echo "$yyy=''" >> posthint.sh ;;
1665 echo "$yyy='$zzz'" >> posthint.sh ;;
1667 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1669 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1674 echo "$yyy=$zzz" >> posthint.sh ;;
1675 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1679 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1682 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1690 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1691 [-U symbol] [-U symbol=] [-A command:symbol...]
1692 -d : use defaults for all answers.
1693 -e : go on without questioning past the production of config.sh.
1694 -f : specify an alternate default configuration file.
1695 -h : print this help message and exit (with an error status).
1696 -r : reuse C symbols value if possible (skips costly nm extraction).
1697 -s : silent mode, only echoes questions and essential information.
1698 -D : define symbol to have some value:
1699 -D symbol symbol gets the value 'define'
1700 -D symbol=value symbol gets the value 'value'
1701 common used examples (see INSTALL for more info):
1702 -Duse64bitint use 64bit integers
1703 -Duse64bitall use 64bit integers and pointers
1704 -Dusethreads use thread support
1705 -Dinc_version_list=none do not include older perl trees in @INC
1706 -DEBUGGING=none DEBUGGING options
1707 -Dcc=gcc choose your compiler
1708 -Dprefix=/opt/perl5 choose your destination
1709 -E : stop at the end of questions, after having produced config.sh.
1710 -K : do not use unless you know what you are doing.
1711 -O : let -D and -U override definitions from loaded configuration file.
1712 -S : perform variable substitutions on all .SH files (can mix with -f)
1713 -U : undefine symbol:
1714 -U symbol symbol gets the value 'undef'
1715 -U symbol= symbol gets completely empty
1717 -A : manipulate symbol after the platform specific hints have been applied:
1718 -A append:symbol=value append value to symbol
1719 -A symbol=value like append:, but with a separating space
1720 -A define:symbol=value define symbol to have value
1721 -A clear:symbol define symbol to be ''
1722 -A define:symbol define symbol to be 'define'
1723 -A eval:symbol=value define symbol to be eval of value
1724 -A prepend:symbol=value prepend value to symbol
1725 -A undef:symbol define symbol to be 'undef'
1726 -A undef:symbol= define symbol to be ''
1727 e.g.: -A prepend:libswanted='cl pthread '
1728 -A ccflags=-DSOME_MACRO
1729 -V : print version number and exit (with a zero status).
1736 case "$fastread$alldone" in
1739 case "$extractsh" in
1742 if test ! -t 0; then
1743 echo "Say 'sh Configure', not 'sh <Configure'"
1753 true) exec 1>/dev/null;;
1756 : run the defines and the undefines, if any, but leave the file out there...
1759 : create the posthint manipulation script and leave the file out there...
1764 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1765 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1766 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1767 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1768 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1771 : Some greps do not return status, grrr.
1772 echo "grimblepritz" >grimble
1773 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1775 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1781 : the following should work in any shell
1785 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1786 cat >contains <<'EOSS'
1787 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1792 : Find the path to the source tree
1795 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1799 *) src=`cd ../$src && pwd` ;;
1812 if test -f $rsrc/Configure && \
1813 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1815 : found it, so we are ok.
1818 for src in . .. ../.. ../../.. ../../../..; do
1819 if test -f ../$src/Configure && \
1820 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1831 Sorry, I can't seem to locate the source dir for $package. Please start
1832 Configure with an explicit path -- i.e. /some/path/Configure.
1840 echo "Sources for $package found in \"$src\"." >&4
1844 : script used to extract .SH files with variable substitutions
1845 cat >extract <<'EOS'
1847 echo "Doing variable substitutions on .SH files..."
1848 if test -f MANIFEST; then
1849 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1851 echo "(Looking for .SH files under the source directory.)"
1852 set x `(cd "$src"; find . -name "*.SH" -print)`
1856 0) set x `(cd "$src"; echo *.SH)`; shift;;
1858 if test ! -f "$src/$1"; then
1864 while test $name; do
1865 if test ! -d "$name"; then
1866 create="$name $create";
1867 name=`echo $name | sed -e "s|^[^/]*$||"`;
1868 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1873 for file in $create; do
1882 dir=`expr X$file : 'X\(.*\)/'`
1883 file=`expr X$file : 'X.*/\(.*\)'`
1884 (cd "$dir" && . ./$file)
1894 dir=`expr X$file : 'X\(.*\)/'`
1895 file=`expr X$file : 'X.*/\(.*\)'`
1896 (set x $dir; shift; eval $mkdir_p)
1897 sh <"$src/$dir/$file"
1906 if test -f "$src/config_h.SH"; then
1907 if test ! -f config.h; then
1908 : oops, they left it out of MANIFEST, probably, so do it anyway.
1909 . "$src/config_h.SH"
1914 : extract files and exit if asked to do so
1915 case "$extractsh" in
1917 case "$realsilent" in
1921 case "$config_sh" in
1922 '') config_sh='config.sh';;
1925 echo "Fetching answers from $config_sh..."
1928 test "$override" && . ./optdef.sh
1932 echo "Extraction done."
1937 : Eunice requires " " instead of "", can you believe it
1940 echo "Beginning of configuration questions for $package."
1942 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1944 : first determine how to suppress newline on echo command
1946 echo "Checking echo to see how to suppress newlines..."
1947 (echo "hi there\c" ; echo " ") >.echotmp
1948 if $contains c .echotmp >/dev/null 2>&1 ; then
1959 echo $n "The star should be here-->$c"
1963 : Now test for existence of everything in MANIFEST
1965 if test -f "$rsrc/MANIFEST"; then
1966 echo "First let's make sure your kit is complete. Checking..." >&4
1967 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1968 (split -l 50 2>/dev/null || split -50)
1971 for filelist in x??; do
1972 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1973 >/dev/null 2>>"$tmppwd/missing")
1975 if test -s missing; then
1979 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1981 You have the option of continuing the configuration process, despite the
1982 distinct possibility that your kit is damaged, by typing 'y'es. If you
1983 do, don't blame me if something goes wrong. I advise you to type 'n'o
1984 and contact the author (perlbug@perl.org).
1987 echo $n "Continue? [n] $c" >&4
1991 echo "Continuing..." >&4
1995 echo "ABORTING..." >&4
2000 echo "Looks good..."
2003 echo "There is no MANIFEST file. I hope your kit is complete !"
2007 : Find the appropriate value for a newline for tr
2009 if test -n "$DJGPP"; then
2012 if test X"$trnl" = X; then
2013 case "`echo foo|tr '\n' x 2>/dev/null`" in
2017 if test X"$trnl" = X; then
2018 case "`echo foo|tr '\012' x 2>/dev/null`" in
2019 foox) trnl='\012' ;;
2022 if test X"$trnl" = X; then
2023 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2024 fooxy) trnl='\n\r' ;;
2027 if test X"$trnl" = X; then
2030 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2036 : compute the number of columns on the terminal for proper question formatting
2041 : set up the echo used in my read
2042 myecho="case \"\$xxxm\" in
2043 '') echo $n \"\$rp $c\" >&4;;
2045 '') echo $n \"[\$xxxm] $c\";;
2047 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2049 echo $n \"[\$xxxm] $c\" >&4
2051 echo $n \"\$rp [\$xxxm] $c\" >&4
2057 : now set up to do reads with possible shell escape and default assignment
2063 case "\$fastread" in
2064 yes) case "\$dflt" in
2067 case "\$silent-\$rp" in
2072 *) case "\$silent" in
2073 true) case "\$rp" in
2078 while expr "X\$ans" : "X!" >/dev/null; do
2082 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2090 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2099 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2104 echo "(OK, I'll run with -d after this question.)" >&4
2107 echo "*** Sorry, \$1 not supported yet." >&4
2117 echo "*** Substitution done -- please confirm."
2119 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2124 echo "*** Error -- try again."
2131 case "\$ans\$xxxm\$nostick" in
2143 : create .config dir to save info across Configure sessions
2144 test -d ../.config || mkdir ../.config
2145 cat >../.config/README <<EOF
2146 This directory created by Configure to save information that should
2147 persist across sessions for $package.
2149 You may safely delete it if you wish.
2152 : See if we are using a devel version and want that
2153 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2156 usedevel="$define" ;;
2157 *) case "$xversion" in
2160 *** WHOA THERE!!! ***
2162 This is an UNSTABLE DEVELOPMENT release.
2163 The version of this $package distribution is $xversion, that is, odd,
2164 (as opposed to even) and that signifies a development release.
2165 If you want a maintenance release, you want an even-numbered version.
2167 Do ***NOT*** install this into production use.
2168 Data corruption and crashes are possible.
2170 It is most seriously suggested that you do not continue any further
2171 unless you want to help in developing and debugging Perl.
2173 If you *still* want to build perl, you can answer 'y' now,
2174 or pass -Dusedevel to Configure.
2177 rp='Do you really want to continue?'
2181 [yY]) echo >&4 "Okay, continuing."
2182 usedevel="$define" ;;
2183 *) echo >&4 "Okay, bye."
2194 case "$versiononly" in
2195 '') versiononly="$define" ;;
2197 case "$installusrbinperl" in
2198 '') installusrbinperl="$undef" ;;
2203 : general instructions
2206 user=`(logname) 2>/dev/null`
2208 '') user=`whoami 2>&1`;;
2210 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2213 rp='Would you like to see the instructions?'
2224 This installation shell script will examine your system and ask you questions
2225 to determine how the perl5 package should be installed. If you get
2226 stuck on a question, you may use a ! shell escape to start a subshell or
2227 execute a command. Many of the questions will have default answers in square
2228 brackets; typing carriage return will give you the default.
2230 On some of the questions which ask for file or directory names you are allowed
2231 to use the ~name construct to specify the login directory belonging to "name",
2232 even if you don't have a shell which knows about that. Questions where this is
2233 allowed will be marked "(~name ok)".
2237 dflt='Type carriage return to continue'
2241 The prompter used in this script allows you to use shell variables and
2242 backticks in your answers. You may use $1, $2, etc... to refer to the words
2243 in the default answer, as if the default line was a set of arguments given to a
2244 script shell. This means you may also use $* to repeat the whole default line,
2245 so you do not have to re-type everything to add something to the default.
2247 Everytime there is a substitution, you will have to confirm. If there is an
2248 error (e.g. an unmatched backtick), the default answer will remain unchanged
2249 and you will be prompted again.
2251 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2252 the questions and use the computed defaults (or the previous answers if there
2253 was already a config.sh file). Type 'Configure -h' for a list of options.
2254 You may also start interactively and then answer '& -d' at any prompt to turn
2255 on the non-interactive behaviour for the remainder of the execution.
2261 Much effort has been expended to ensure that this shell script will run on any
2262 Unix system. If despite that it blows up on yours, your best bet is to edit
2263 Configure and run it again. If you can't run Configure for some reason,
2264 you'll have to generate a config.sh file by hand. Whatever problems you
2265 have, let me (perlbug@perl.org) know how I blew it.
2267 This installation script affects things in two ways:
2269 1) it may do direct variable substitutions on some of the files included
2271 2) it builds a config.h file for inclusion in C programs. You may edit
2272 any of these files as the need arises after running this script.
2274 If you make a mistake on a question, there is no easy way to back up to it
2275 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2276 files. Configure will offer to let you do this before it runs the SH files.
2279 dflt='Type carriage return to continue'
2281 case "$firsttime" in
2282 true) echo $user >>../.config/instruct;;
2286 : find out where common programs are
2288 echo "Locating common programs..." >&4
2301 if test -d \$dir/\$thing; then
2307 for thisthing in \$dir/\$thing; do
2308 : just loop through to pick last item
2310 if test -f \$thisthing; then
2313 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2316 elif test -f \$dir/\$thing.exe; then
2317 if test -n "$DJGPP"; then
2318 echo \$dir/\$thing.exe
2319 elif test "$eunicefix" != ":"; then
2320 : on Eunice apparently
2372 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2373 pth="$pth /lib /usr/lib"
2374 for file in $loclist; do
2378 if test -f "$xxx"; then
2381 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2382 xxx=`./loc $file $file $pth`
2385 '') xxx=`./loc $file $file $pth`;;
2386 *) xxx=`./loc $xxx $xxx $pth`;;
2388 eval $file=$xxx$_exe
2392 echo $file is in $xxx.
2395 echo $file is in $xxx.
2398 echo "I don't know where '$file' is, and my life depends on it." >&4
2399 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2405 echo "Don't worry if any of the following aren't found..."
2407 for file in $trylist; do
2411 if test -f "$xxx"; then
2414 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2415 xxx=`./loc $file $file $pth`
2418 '') xxx=`./loc $file $file $pth`;;
2419 *) xxx=`./loc $xxx $xxx $pth`;;
2421 eval $file=$xxx$_exe
2425 echo $file is in $xxx.
2428 echo $file is in $xxx.
2431 echo "I don't see $file out there, $say."
2438 echo "Substituting grep for egrep."
2445 echo "Substituting cp for ln."
2454 echo "I can't find make or gmake, and my life depends on it." >&4
2455 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2463 *) # We can't have osname yet.
2464 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2465 # Assume that gmake, if found, is definitely GNU make
2466 # and prefer it over the system make.
2467 echo "Substituting gmake for make."
2475 echo "Hopefully test is built into your sh."
2478 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2479 echo "Using the test built into your sh."
2487 echo "Hopefully echo is built into your sh."
2492 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2493 $echo $n "hi there$c" >foo1
2494 echo $n "hi there$c" >foo2
2495 if cmp foo1 foo2 >/dev/null 2>&1; then
2496 echo "They are compatible. In fact, they may be identical."
2503 They are not compatible! You are probably running ksh on a non-USG system.
2504 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2505 have echo built in and we may have to run some Bourne shell scripts. That
2506 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2509 $echo $n "The star should be here-->$c"
2516 # This question was auctioned at YAPC::Europe-2007 in Vienna
2517 # I never promised you could answer it. I only auctioned the question.
2519 The following message is sponsored by
2521 Dresden.pm<--The stars should be here.
2523 Dear Perl user, system administrator or package
2524 maintainer, the Perl community sends greetings to
2525 you. Do you (emblematical) greet back [Y/n]? n
2529 : Check what type of C compiler we use
2533 cat <<'EOSC' >>trygcc
2538 int main(int argc, char *argv[]) {
2542 if $cc -o try $ccflags $ldflags try.c; then
2545 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2551 # Skip this test because it gives a false match on output like:
2552 # ./trygcc: line 23: cc: command not found
2553 # case "`$cc -v -c try.c 2>&1`" in
2554 # *gcc*) trygcc=no ;;
2556 if $test X"$trygcc" = Xyes; then
2557 if gcc -o try -c try.c; then
2559 echo "You seem to have a working gcc, though." >&4
2560 # Switching compilers may undo the work of hints files.
2561 # The most common problem is -D_REENTRANT for threads.
2562 # This heuristic catches that case, but gets false positives
2563 # if -Dusethreads was not actually specified. Better to
2564 # bail out here with a useful message than fail
2565 # mysteriously later. Should we perhaps just try to
2566 # re-invoke Configure -Dcc=gcc config_args ?
2567 if $test -f usethreads.cbu; then
2570 *** However, any setting of the C compiler flags (e.g. for thread support)
2571 *** will be lost. It may be necessary for you to restart Configure and
2572 *** add -Dcc=gcc to your Configure command line.
2575 rp="Would you like to go ahead and try gcc anyway?"
2578 rp="Would you like to use it?"
2581 if $test -f myread; then
2584 if $test -f UU/myread; then
2587 echo "Cannot find myread, sorry. Aborting." >&2
2592 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2605 cat <<'EOSC' >>checkcc
2610 int main(int argc, char *argv[]) {
2614 if $cc -o try $ccflags $ldflags try.c; then
2617 if $test X"$despair" = Xyes; then
2618 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2621 You need to find a working C compiler.
2622 Either (purchase and) install the C compiler supplied by your OS vendor,
2623 or for a free C compiler try http://gcc.gnu.org/
2624 I cannot continue any further, aborting.
2633 : determine whether symbolic links are supported
2636 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2637 echo "Symbolic links are supported." >&4
2640 echo "Symbolic links are NOT supported." >&4
2645 : determine whether symbolic links are supported
2649 echo "Checking how to test for symbolic links..." >&4
2651 if $test "X$issymlink" = X; then
2653 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2654 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2656 if test $? = 0; then
2659 echo "Your builtin 'test -h' may be broken." >&4
2662 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2665 if test -f "$p/$test"; then
2674 echo "Trying external '$test -h'." >&4
2675 issymlink="$test -h"
2676 if $test ! -h sym >/dev/null 2>&1; then
2677 echo "External '$test -h' is broken, too." >&4
2685 if $test "X$issymlink" = X; then
2686 if $test -L sym 2>/dev/null; then
2687 issymlink="$test -L"
2688 echo "The builtin '$test -L' worked." >&4
2691 if $test "X$issymlink" != X; then
2692 echo "You can test for symbolic links with '$issymlink'." >&4
2694 echo "I do not know how you can test for symbolic links." >&4
2698 *) echo "No symbolic links, so not testing for their testing..." >&4
2703 : Make symlinks util
2704 case "$mksymlinks" in
2707 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2710 *) case "$lns:$issymlink" in
2711 *"ln"*" -s:"*"test -"?)
2712 echo "Creating the symbolic links..." >&4
2713 echo "(First creating the subdirectories...)" >&4
2715 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2717 test -z "$directory" && break
2721 if test ! -d t/base; then
2722 echo "Failed to create the subdirectories. Aborting." >&4
2725 echo "(Then creating the symlinks...)" >&4
2726 awk '{print $1}' $src/MANIFEST | while true; do
2728 test -z "$filename" && break
2729 if test -f $filename; then
2730 if $issymlink $filename; then
2734 if test -f $filename; then
2735 echo "$filename already exists, not symlinking."
2737 ln -s $src/$filename $filename
2741 if test ! -f t/base/lex.t; then
2742 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2747 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2755 : Check for Cross-Compilation
2756 case "$usecrosscompile" in
2758 $echo "Cross-compiling..."
2761 *-*-gcc) # A cross-compiling gcc, probably.
2762 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2764 # leave out ld, choosing it is more complex
2766 ranlib=$targetarch-ranlib
2767 $echo 'extern int foo;' > try.c
2768 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2770 if $test $# -gt 0; then
2772 incpth="`$echo $incpth|$sed 's/^ //'`"
2773 echo "Guessing incpth '$incpth'." >&4
2775 j="`$echo $i|$sed 's,/include$,/lib,'`"
2776 if $test -d $j; then
2780 libpth="`$echo $libpth|$sed 's/^ //'`"
2781 echo "Guessing libpth '$libpth'." >&4
2786 case "$targetarch" in
2787 '') echo "Targetarch not defined." >&4; croak=y ;;
2788 *) echo "Using targetarch $targetarch." >&4 ;;
2791 '') echo "Incpth not defined." >&4; croak=y ;;
2792 *) echo "Using incpth '$incpth'." >&4 ;;
2795 '') echo "Libpth not defined." >&4; croak=y ;;
2796 *) echo "Using libpth '$libpth'." >&4 ;;
2799 '') for i in $incpth; do
2800 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2802 echo "Guessing usrinc $usrinc." >&4
2807 '') echo "Usrinc not defined." >&4; croak=y ;;
2810 *) echo "Using usrinc $usrinc." >&4 ;;
2812 case "$targethost" in
2813 '') echo "Targethost not defined." >&4; croak=y ;;
2814 *) echo "Using targethost $targethost." >&4
2819 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2822 /*) run=$src/Cross/run
2823 targetmkdir=$src/Cross/mkdir
2825 from=$src/Cross/from
2827 *) pwd=`$test -f ../Configure & cd ..; pwd`
2829 targetmkdir=$pwd/Cross/mkdir
2831 from=$pwd/Cross/from
2834 case "$targetrun" in
2835 '') targetrun=ssh ;;
2840 case "$targetfrom" in
2841 '') targetfrom=scp ;;
2845 from=$from-$targetfrom
2846 case "$targetdir" in
2848 echo "Guessing targetdir $targetdir." >&4
2851 case "$targetuser" in
2853 echo "Guessing targetuser $targetuser." >&4
2856 case "$targetfrom" in
2860 case "$targetrun" in
2872 '') cwd=$targetdir ;;
2876 if $test ! -f \$exe.xok; then
2880 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2883 *) echo "Unknown targetrun '$targetrun'" >&4
2887 case "$targetmkdir" in
2889 cat >$targetmkdir <<EOF
2891 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2893 $chmod a+rx $targetmkdir
2895 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2907 $targetmkdir \`dirname \$f\`
2908 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2911 $targetmkdir $targetdir/\`dirname \$f\`
2912 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2925 $mkdir -p $targetdir/\`dirname \$f\`
2926 $cp \$f $targetdir/\$f || exit 1
2929 $targetmkdir $targetdir/\`dirname \$f\`
2930 $cp \$f $targetdir/\$f || exit 1
2937 *) echo "Unknown targetto '$targetto'" >&4
2941 case "$targetfrom" in
2948 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2953 cp) cat >$from <<EOF
2958 cp $targetdir/\$f . || exit 1
2963 *) echo "Unknown targetfrom '$targetfrom'" >&4
2967 if $test ! -f $run; then
2968 echo "Target 'run' script '$run' not found." >&4
2972 if $test ! -f $to; then
2973 echo "Target 'to' script '$to' not found." >&4
2977 if $test ! -f $from; then
2978 echo "Target 'from' script '$from' not found." >&4
2982 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2986 Using '$run' for remote execution,
2987 and '$from' and '$to'
2988 for remote file transfer.
2994 usecrosscompile='undef'
2999 : see whether [:lower:] and [:upper:] are supported character classes
3001 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3003 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3007 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3008 # (0xd9 and 0xe2), therefore that is a nice testing point.
3009 if test "X$up" = X -o "X$low" = X; then
3010 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3016 if test "X$up" = X -o "X$low" = X; then
3017 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3023 if test "X$up" = X -o "X$low" = X; then
3024 case "`echo RS | od -x 2>/dev/null`" in
3026 echo "Hey, this might be EBCDIC." >&4
3027 if test "X$up" = X -o "X$low" = X; then
3028 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3029 rs) up='[A-IJ-RS-Z]'
3034 if test "X$up" = X -o "X$low" = X; then
3035 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3045 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3047 echo "Using $up and $low to convert case." >&4
3050 echo "I don't know how to translate letters from upper to lower case." >&4
3051 echo "Your tr is not acting any way I know of." >&4
3055 : set up the translation script tr, must be called with ./tr of course
3059 '[A-Z][a-z]') exec $tr '$up' '$low';;
3060 '[a-z][A-Z]') exec $tr '$low' '$up';;
3067 : Try to determine whether config.sh was made on this system
3068 case "$config_sh" in
3070 myuname=`$uname -a 2>/dev/null`
3071 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3072 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3073 # because the A-Z/a-z are not consecutive.
3074 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3075 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3076 newmyuname="$myuname"
3078 case "$knowitall" in
3080 if test -f ../config.sh; then
3081 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3082 eval "`grep myuname= ../config.sh`"
3084 if test "X$myuname" = "X$newmyuname"; then
3092 : Get old answers from old config file if Configure was run on the
3093 : same system, otherwise use the hints.
3096 if test -f config.sh; then
3098 rp="I see a config.sh file. Shall I use it to set the defaults?"
3101 n*|N*) echo "OK, I'll ignore it."
3102 mv config.sh config.sh.old
3103 myuname="$newmyuname"
3105 *) echo "Fetching default answers from your old config.sh file..." >&4
3113 : Older versions did not always set $sh. Catch re-use of such
3123 if test ! -f config.sh; then
3126 First time through, eh? I have some defaults handy for some systems
3127 that need some extra help getting the Configure answers right:
3130 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3132 : Half the following guesses are probably wrong... If you have better
3133 : tests or hints, please send them to perlbug@perl.org
3134 : The metaconfig authors would also appreciate a copy...
3135 $test -f /irix && osname=irix
3136 $test -f /xenix && osname=sco_xenix
3137 $test -f /dynix && osname=dynix
3138 $test -f /dnix && osname=dnix
3139 $test -f /lynx.os && osname=lynxos
3140 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3141 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3142 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3143 $test -f /bin/mips && /bin/mips && osname=mips
3144 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3145 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3146 $test -d /usr/apollo/bin && osname=apollo
3147 $test -f /etc/saf/_sactab && osname=svr4
3148 $test -d /usr/include/minix && osname=minix
3149 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3150 if $test -d /MachTen -o -d /MachTen_Folder; then
3152 if $test -x /sbin/version; then
3153 osvers=`/sbin/version | $awk '{print $2}' |
3154 $sed -e 's/[A-Za-z]$//'`
3155 elif $test -x /usr/etc/version; then
3156 osvers=`/usr/etc/version | $awk '{print $2}' |
3157 $sed -e 's/[A-Za-z]$//'`
3163 $test -f /sys/posix.dll &&
3164 $test -f /usr/bin/what &&
3165 set X `/usr/bin/what /sys/posix.dll` &&
3166 $test "$3" = UWIN &&
3170 if $test -f $uname; then
3178 umips) osname=umips ;;
3181 [23]100) osname=mips ;;
3182 next*) osname=next ;;
3184 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3185 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3188 elif $test -f /etc/kconfig; then
3190 if test "$lns" = "$ln -s"; then
3192 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3194 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3201 if test -n "$DJGPP"; then
3210 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3212 # oslevel can fail with:
3213 # oslevel: Unable to acquire lock.
3214 *not\ found) osvers="$4"."$3" ;;
3215 '<3240'|'<>3240') osvers=3.2.0 ;;
3216 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3217 '=3250'|'>3250') osvers=3.2.5 ;;
3221 bsd386) osname=bsd386
3224 cygwin*) osname=cygwin
3227 *dc.osx) osname=dcosx
3233 domainos) osname=apollo
3239 dragonfly) osname=dragonfly
3242 dynixptx*) osname=dynixptx
3243 osvers=`echo "$4"|sed 's/^v//'`
3245 freebsd) osname=freebsd
3247 genix) osname=genix ;;
3251 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3267 netbsd*) osname=netbsd
3270 news-os) osvers="$3"
3272 4*) osname=newsos4 ;;
3276 next*) osname=next ;;
3277 nonstop-ux) osname=nonstopux ;;
3278 openbsd) osname=openbsd
3284 POSIX-BC | posix-bc ) osname=posix-bc
3287 powerux | power_ux | powermax_os | powermaxos | \
3288 powerunix | power_unix) osname=powerux
3294 solaris) osname=solaris
3296 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3303 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3307 titanos) osname=titanos
3316 ultrix) osname=ultrix
3319 osf1|mls+) case "$5" in
3322 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3325 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3328 hp*) osname=hp_osf1 ;;
3329 mips) osname=mips_osf1 ;;
3332 # UnixWare 7.1.2 is known as Open UNIX 8
3333 openunix|unixware) osname=svr5
3341 $2) case "$osname" in
3345 : svr4.x or possibly later
3355 if test -f /stand/boot ; then
3356 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3357 if test -n "$INITPROG" -a -f "$INITPROG"; then
3358 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3359 if test -n "$isesix"; then
3367 *) if test -f /etc/systemid; then
3369 set `echo $3 | $sed 's/\./ /g'` $4
3370 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3372 elif $test -f $src/hints/sco_$1_$2.sh; then
3374 elif $test -f $src/hints/sco_$1.sh; then
3379 '') : Still unknown. Probably a generic Sys V.
3388 *) case "$osname" in
3389 '') : Still unknown. Probably a generic BSD.
3397 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3398 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3399 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3402 $rm -f UU/kernel.what
3403 elif test -d c:/. -o -n "$is_os2" ; then
3410 case "$targetarch" in
3413 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3418 : Now look for a hint file osname_osvers, unless one has been
3419 : specified already.
3422 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3423 : Also try without trailing minor version numbers.
3424 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3425 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3426 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3427 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3430 *) case "$osvers" in
3433 *) if $test -f $src/hints/$file.sh ; then
3435 elif $test -f $src/hints/$xfile.sh ; then
3437 elif $test -f $src/hints/$xxfile.sh ; then
3439 elif $test -f $src/hints/$xxxfile.sh ; then
3441 elif $test -f $src/hints/$xxxxfile.sh ; then
3443 elif $test -f "$src/hints/${osname}.sh" ; then
3452 if $test -f Policy.sh ; then
3455 none) dflt="Policy" ;;
3456 *) dflt="Policy $dflt" ;;
3461 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3465 if $test -f Policy.sh ; then
3468 There's also a Policy hint file available, which should make the
3469 site-specific (policy) questions easier to answer.
3476 You may give one or more space-separated answers, or "none" if appropriate.
3477 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3478 previous run of Configure, you may specify it as well as or instead of
3479 OS-specific hints. If hints are provided for your OS, you should use them:
3480 although Perl can probably be built without hints on many platforms, using
3481 hints often improve performance and may enable features that Configure can't
3482 set up on its own. If there are no hints that match your OS, specify "none";
3483 DO NOT give a wrong version or a wrong OS.
3487 rp="Which of these apply, if any?"
3490 for file in $tans; do
3491 if $test X$file = XPolicy -a -f Policy.sh; then
3493 $cat Policy.sh >> UU/config.sh
3494 elif $test -f $src/hints/$file.sh; then
3495 . $src/hints/$file.sh
3496 $cat $src/hints/$file.sh >> UU/config.sh
3497 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3500 : Give one chance to correct a possible typo.
3501 echo "$file.sh does not exist"
3503 rp="hint to use instead?"
3505 for file in $ans; do
3506 if $test -f "$src/hints/$file.sh"; then
3507 . $src/hints/$file.sh
3508 $cat $src/hints/$file.sh >> UU/config.sh
3509 elif $test X$ans = X -o X$ans = Xnone ; then
3512 echo "$file.sh does not exist -- ignored."
3519 : Remember our hint file for later.
3520 if $test -f "$src/hints/$file.sh" ; then
3530 echo "Fetching default answers from $config_sh..." >&4
3534 cp $config_sh config.sh 2>/dev/null
3544 test "$override" && . ./optdef.sh
3546 : Restore computed paths
3547 for file in $loclist $trylist; do
3548 eval $file="\$_$file"
3553 Configure uses the operating system name and version to set some defaults.
3554 The default value is probably right if the name rings a bell. Otherwise,
3555 since spelling matters for me, either accept the default or answer "none"
3562 ''|' '|none) dflt=none ;;
3563 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3566 *) dflt="$osname" ;;
3568 rp="Operating system name?"
3572 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3578 ''|' '|none) dflt=none ;;
3579 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3580 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3582 ''|' ') dflt=none ;;
3587 *) dflt="$osvers" ;;
3589 rp="Operating system version?"
3599 : who configured the system
3600 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3603 cf_by=`(logname) 2>/dev/null`
3606 cf_by=`(whoami) 2>/dev/null`
3608 "") cf_by=unknown ;;
3613 : decide how portable to be. Allow command line overrides.
3614 case "$d_portable" in
3616 *) d_portable="$define" ;;
3619 : set up shell script to do ~ expansion
3625 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3628 if $test -f /bin/csh; then
3629 /bin/csh -f -c "glob \$1"
3634 name=\`$expr x\$1 : '..\([^/]*\)'\`
3635 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3636 if $test ! -d "\$dir"; then
3638 echo "\$me: can't locate home directory for: \$name" >&2
3643 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3659 : now set up to get a file name
3663 cat <<'EOSC' >>getfile
3679 : getfile will accept an answer from the comma-separated list
3680 : enclosed in parentheses even if it does not meet other criteria.
3681 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3682 fn=`echo $fn | sed 's/(.*)//'`
3688 loc_file=`expr $fn : '.*:\(.*\)'`
3689 fn=`expr $fn : '\(.*\):.*'`
3697 */*) fullpath=true;;
3706 *e*) exp_file=true;;
3709 *p*) nopath_ok=true;;
3714 *d*) type='Directory';;
3715 *l*) type='Locate';;
3720 Locate) what='File';;
3725 case "$d_portable" in
3733 while test "$type"; do
3738 true) rp="$rp (~name ok)";;
3741 if test -f UU/getfile.ok && \
3742 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3761 value=`UU/filexp $ans`
3764 if test "$ans" != "$value"; then
3765 echo "(That expands to $value on this system.)"
3779 /*) value="$ansexp" ;;
3780 [a-zA-Z]:/*) value="$ansexp" ;;
3785 echo "I shall only accept a full path name, as in /bin/ls." >&4
3786 echo "Use a ! shell escape if you wish to check pathnames." >&4
3789 echo "Please give a full path name, starting with slash." >&4
3792 echo "Note that using ~name is ok provided it expands well." >&4
3805 for fp in $gfpth; do
3806 if test "X$fp" = X.; then
3811 if test -f "$pf"; then
3813 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3815 echo "($value is not a plain file, but that's ok.)"
3818 if test X"$type" = X; then
3825 for fp in $gfpth; do
3826 if test "X$fp" = X.; then
3831 direxp="$fp/$ansexp"
3833 if test -d "$direxp"; then
3841 if test -d "$ansexp"; then
3842 echo "(Looking for $loc_file in directory $value.)"
3843 value="$value/$loc_file"
3844 ansexp="$ansexp/$loc_file"
3846 if test -f "$ansexp"; then
3849 case "$nopath_ok" in
3850 true) case "$value" in
3852 *) echo "Assuming $value will be in people's path."
3868 if test "$fastread" = yes; then
3873 rp="$what $value doesn't exist. Use that name anyway?"
3892 test "X$gfpthkeep" != Xy && gfpth=""
3895 : determine root of directory hierarchy where package will be installed.
3898 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3901 dflt=`echo "$prefix" | sed 's/.$//'`
3909 By default, $package will be installed in $dflt/bin, manual pages
3910 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3911 installation directories. Typically this is something like /usr/local.
3912 If you wish to have binaries under /usr/bin but other parts of the
3913 installation under /usr/local, that's ok: you will be prompted
3914 separately for each of the installation directories, the prefix being
3915 only used to set the defaults.
3919 rp='Installation prefix to use?'
3927 *) oldprefix="$prefix";;
3934 : allow them to override the AFS root
3937 *) afsroot=$afsroot ;;
3943 $define|true) afs=true ;;
3944 $undef|false) afs=false ;;
3945 *) if $test -d $afsroot; then
3953 echo "AFS may be running... I'll be extra cautious then..." >&4
3955 echo "AFS does not seem to be running..." >&4
3958 : determine installation prefix for where package is to be installed.
3962 Since you are running AFS, I need to distinguish the directory in which
3963 files will reside from the directory in which they are installed (and from
3964 which they are presumably copied to the former directory by occult means).
3967 case "$installprefix" in
3968 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3969 *) dflt="$installprefix";;
3974 In some special cases, particularly when building $package for distribution,
3975 it is convenient to distinguish the directory in which files should be
3976 installed from the directory ($prefix) in which they will
3977 eventually reside. For most users, these two directories are the same.
3980 case "$installprefix" in
3982 *) dflt=$installprefix;;
3986 rp='What installation prefix should I use for installing files?'
3988 installprefix="$ans"
3989 installprefixexp="$ansexp"
3991 : Perform the prefixexp/installprefixexp correction if necessary
3992 cat <<EOS >installprefix
3995 cat <<'EOSC' >>installprefix
3996 : Change installation prefix, if necessary.
3997 if $test X"$prefix" != X"$installprefix"; then
3998 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4000 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4003 chmod +x installprefix
4004 $eunicefix installprefix
4006 : Set variables such as privlib and privlibexp from the output of ./getfile
4007 : performing the prefixexp/installprefixexp correction if necessary.
4008 cat <<EOS >setprefixvar
4011 cat <<'EOSC' >>setprefixvar
4012 eval "${prefixvar}=\"\$ans\""
4013 eval "${prefixvar}exp=\"\$ansexp\""
4016 chmod +x setprefixvar
4017 $eunicefix setprefixvar
4019 : set up the script used to warn in case of inconsistency
4028 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4030 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4031 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4036 echo "*** WHOA THERE!!! ***" >&4
4037 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4040 rp=" Keep the $hint value?"
4043 y) td=$was; tu=$was;;
4047 : function used to set '$1' to '$val'
4048 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4050 $define$undef) . ./whoa; eval "$var=\$td";;
4051 $undef$define) . ./whoa; eval "$var=\$tu";;
4052 *) eval "$var=$val";;
4055 : Check is we will use socks
4057 $define|true|[yY]*) dflt='y';;
4062 Perl can be built to use the SOCKS proxy protocol library. To do so,
4063 Configure must be run with -Dusesocks. If you use SOCKS you also need
4064 to use the PerlIO abstraction layer, this will be implicitly selected.
4066 If this doesn't make any sense to you, just accept the default '$dflt'.
4068 rp='Build Perl for SOCKS?'
4071 y|Y) val="$define" ;;
4078 $define|true|[yY]*) useperlio="$define";;
4081 : Check if we want perlio
4082 case "$useperlio" in
4083 $define|true|[yY]*|'') dflt='y';;
4088 Previous version of $package used the standard IO mechanisms as
4089 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4090 alternate IO mechanisms via the PerlIO abstraction layer, but the
4091 stdio mechanism is still available if needed. The abstraction layer
4092 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4093 Using PerlIO with sfio may cause problems with some extension modules.
4095 If this doesn't make any sense to you, just accept the default '$dflt'.
4097 rp='Use the PerlIO abstraction layer?'
4104 echo "Ok, doing things the stdio way."
4113 case "$useperlio" in
4114 $define|true|[yY]*) ;;
4117 You are using the SOCKS proxy protocol library which means that you
4118 should also use the PerlIO layer. You may be headed for trouble.
4126 : get the patchlevel
4128 echo "Getting the current patchlevel..." >&4
4129 if $test -r $rsrc/patchlevel.h;then
4130 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4131 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4132 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4133 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4134 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4135 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4136 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4145 $echo "(You do not have patchlevel.h. Eek.)"
4147 if $test -r $rsrc/.patch ; then
4148 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4149 perl_patchlevel=`cat $rsrc/.patch`
4152 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4153 version_patchlevel_string="version $patchlevel subversion $subversion"
4154 case "$perl_patchlevel" in
4156 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4157 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4161 $echo "(You have $package $version_patchlevel_string.)"
4165 : XXX Should be a Configure test for double-dots in filenames.
4166 version=`echo $revision $patchlevel $subversion | \
4167 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4168 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4169 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4172 version=`echo $revision $patchlevel $subversion | \
4173 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4174 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4175 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4178 : Special case the 5.005_xx maintenance series, which used 5.005
4179 : without any subversion label as a subdirectory in $sitelib
4180 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4181 api_versionstring='5.005'
4184 : Do we want threads support and if so, what type
4185 case "$usethreads" in
4186 $define|true|[yY]*) dflt='y';;
4187 *) # Catch case where user specified ithreads or 5005threads but
4188 # forgot -Dusethreads (A.D. 4/2002)
4189 case "$useithreads$use5005threads" in
4191 case "$useperlio" in
4192 "$define") dflt='y' ;;
4202 Perl can be built to take advantage of threads on some systems.
4203 To do so, Configure can be run with -Dusethreads.
4205 Note that Perl built with threading support runs slightly slower
4206 and uses more memory than plain Perl. The current implementation
4207 is believed to be stable, but it is fairly new, and so should be
4208 treated with caution.
4210 If this doesn't make any sense to you, just accept the default '$dflt'.
4212 rp='Build a threading Perl?'
4215 y|Y) val="$define" ;;
4221 if $test $patchlevel -lt 9; then
4222 case "$usethreads" in
4226 Since release 5.6, Perl has had two different threading implementations,
4227 the newer interpreter-based version (ithreads) with one interpreter per
4228 thread, and the older 5.005 version (5005threads).
4229 The 5005threads version is effectively unmaintained and will probably be
4230 removed in Perl 5.10, so there should be no need to build a Perl using it
4231 unless needed for backwards compatibility with some existing 5.005threads
4235 : Default to ithreads unless overridden on command line or with
4238 case "$use5005threads" in
4239 $define|true|[yY]*) dflt='n';;
4241 case "$useithreads" in
4242 $undef|false|[nN]*) dflt='n';;
4244 rp='Use the newer interpreter-based ithreads?'
4247 y|Y) val="$define" ;;
4252 : Now set use5005threads to the opposite value.
4253 case "$useithreads" in
4254 $define) val="$undef" ;;
4261 useithreads="$undef"
4262 use5005threads="$undef"
4266 case "$useithreads$use5005threads" in
4270 You cannot have both the ithreads and the 5.005 threads enabled
4271 at the same time. Disabling the 5.005 threads since they are
4272 much less stable than the ithreads.
4275 use5005threads="$undef"
4280 : perl-5.9.x and later
4282 if test X"$usethreads" = "X$define"; then
4283 case "$use5005threads" in
4287 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4294 use5005threads="$undef"
4295 useithreads="$usethreads"
4298 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4301 *** To build with ithreads you must also use the PerlIO layer.
4302 *** Cannot continue, aborting.
4308 case "$d_oldpthreads" in
4309 '') : Configure tests would be welcome here. For now, assume undef.
4311 *) val="$d_oldpthreads" ;;
4317 : Look for a hint-file generated 'call-back-unit'. If the
4318 : user has specified that a threading perl is to be built,
4319 : we may need to set or change some other defaults.
4320 if $test -f usethreads.cbu; then
4321 echo "Your platform has some specific hints regarding threaded builds, using them..."
4324 case "$usethreads" in
4325 "$define"|true|[yY]*)
4327 (Your platform does not have any specific hints for threaded builds.
4328 Assuming POSIX threads, then.)
4334 : Check if multiplicity is required
4337 Perl can be built so that multiple Perl interpreters can coexist
4338 within the same Perl executable.
4341 case "$useithreads" in
4344 This multiple interpreter support is required for interpreter-based threads.
4348 *) case "$usemultiplicity" in
4349 $define|true|[yY]*) dflt='y';;
4353 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4354 rp='Build Perl for multiplicity?'
4357 y|Y) val="$define" ;;
4365 : Check if morebits is requested
4366 case "$usemorebits" in
4367 "$define"|true|[yY]*)
4368 use64bitint="$define"
4369 uselongdouble="$define"
4370 usemorebits="$define"
4372 *) usemorebits="$undef"
4376 : Determine the C compiler to be used
4382 rp="Use which C compiler?"
4386 : See whether they have no cc but they do have gcc
4388 if $test -f cc.cbu; then
4393 : make some quick guesses about what we are up against
4395 $echo $n "Hmm... $c"
4405 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4406 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4408 echo "Looks kind of like an OSF/1 system, but we'll see..."
4410 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4411 xxx=`./loc addbib blurfl $pth`
4412 if $test -f $xxx; then
4413 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4417 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4418 echo "Looks kind of like an extended USG system, but we'll see..."
4420 echo "Looks kind of like a USG system, but we'll see..."
4424 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4425 echo "Looks kind of like a BSD system, but we'll see..."
4429 echo "Looks kind of like a Version 7 system, but we'll see..."
4432 case "$eunicefix" in
4435 There is, however, a strange, musty smell in the air that reminds me of
4436 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4440 : it so happens the Eunice I know will not run shell scripts in Unix format
4444 echo "Congratulations. You aren't running Eunice."
4448 : Detect OS2. The p_ variable is set above in the Head.U unit.
4449 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4450 : semicolon as a patch separator
4455 I have the feeling something is not exactly right, however...don't tell me...
4456 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4457 (Or you may be running DOS with DJGPP.)
4462 if test -f /xenix; then
4463 echo "Actually, this looks more like a XENIX system..."
4468 echo "It's not Xenix..."
4473 if test -f /venix; then
4474 echo "Actually, this looks more like a VENIX system..."
4481 echo "Nor is it Venix..."
4484 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4485 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4488 : Check if we are using GNU gcc and what its version is
4490 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4494 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4496 printf("%s\n", __VERSION__);
4498 printf("%s\n", "1");
4504 if $cc -o try $ccflags $ldflags try.c; then
4505 gccversion=`$run ./try`
4506 case "$gccversion" in
4507 '') echo "You are not using GNU cc." ;;
4508 *) echo "You are using GNU cc $gccversion."
4514 echo "*** WHOA THERE!!! ***" >&4
4515 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4516 case "$knowitall" in
4518 echo " You'd better start hunting for one and let me know about it." >&4
4524 case "$gccversion" in
4525 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4527 case "$gccversion" in
4528 '') gccosandvers='' ;;
4529 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4530 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4532 case "$gccosandvers" in
4533 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4534 $osname$osvers) ;; # looking good
4535 $osname*) cat <<EOM >&4
4537 *** WHOA THERE!!! ***
4539 Your gcc has not been compiled for the exact release of
4540 your operating system ($gccosandvers versus $osname$osvers).
4542 In general it is a good idea to keep gcc synchronized with
4543 the operating system because otherwise serious problems
4544 may ensue when trying to compile software, like Perl.
4546 I'm trying to be optimistic here, though, and will continue.
4547 If later during the configuration and build icky compilation
4548 problems appear (headerfile conflicts being the most common
4549 manifestation), I suggest reinstalling the gcc to match
4550 your operating system release.
4554 *) gccosandvers='' ;; # failed to parse, better be silent
4562 # gcc 3.* complain about adding -Idirectories that they already know about,
4563 # so we will take those off from locincpth.
4564 case "$gccversion" in
4566 echo "main(){}">try.c
4567 for incdir in $locincpth; do
4568 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4569 grep '^c[cp]p*[01]: warning: changing search order '`
4570 if test "X$warn" != X; then
4571 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4577 : What should the include directory be ?
4579 $echo $n "Hmm... $c"
4583 if $test -f /bin/mips && /bin/mips; then
4584 echo "Looks like a MIPS system..."
4585 $cat >usr.c <<'EOCP'
4586 #ifdef SYSTYPE_BSD43
4590 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4591 dflt='/bsd43/usr/include'
4595 mips_type='System V'
4597 $rm -f usr.c usr.out
4598 echo "and you're compiling with the $mips_type compiler and libraries."
4602 echo "Doesn't look like a MIPS system."
4612 case "$xxx_prompt" in
4615 rp='Where are the include files you want to use?'
4623 : see how we invoke the C preprocessor
4625 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4626 cat <<'EOT' >testcpp.c
4632 if test ! -f cppstdin; then
4633 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4634 # AIX cc -E doesn't show the absolute headerfile
4635 # locations but we'll cheat by using the -M flag.
4636 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
4638 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4641 echo "Keeping your $hint cppstdin wrapper."
4644 wrapper=`pwd`/cppstdin
4648 if $test "X$cppstdin" != "X" && \
4649 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4650 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4652 echo "You used to use $cppstdin $cppminus so we'll use that again."
4654 '') echo "But let's see if we can live without a wrapper..." ;;
4656 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4657 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4659 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4662 echo "(However, $cpprun $cpplast does not work, let's see...)"
4670 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4677 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4678 $cc -E <testcpp.c >testcpp.out 2>&1; \
4679 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4680 echo "Yup, it does."
4683 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4684 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4685 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4686 echo "Yup, it does."
4689 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4690 $cc -P <testcpp.c >testcpp.out 2>&1; \
4691 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4692 echo "Yipee, that works!"
4695 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4696 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4697 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4698 echo "At long last!"
4701 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4702 $cpp <testcpp.c >testcpp.out 2>&1; \
4703 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4707 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4708 $cpp - <testcpp.c >testcpp.out 2>&1; \
4709 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4710 echo "Hooray, it works! I was beginning to wonder."
4713 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4714 $wrapper <testcpp.c >testcpp.out 2>&1; \
4715 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4721 rp="No dice. I can't find a C preprocessor. Name one:"
4725 $x_cpp <testcpp.c >testcpp.out 2>&1
4726 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4727 echo "OK, that will do." >&4
4729 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4744 echo "Perhaps can we force $cc -E using a wrapper..."
4745 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4746 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4752 echo "Nope, we'll have to live without it..."
4766 "$wrapper"|'cppstdin') ;;
4767 *) $rm -f $wrapper;;
4769 $rm -f testcpp.c testcpp.out
4771 : Set private lib path
4774 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4779 '') dlist="$loclibpth $plibpth $glibpth";;
4780 *) dlist="$libpth";;
4783 : Now check and see which directories actually exist, avoiding duplicates
4787 if $test -d $xxx; then
4790 *) libpth="$libpth $xxx";;
4796 Some systems have incompatible or broken versions of libraries. Among
4797 the directories listed in the question below, please remove any you
4798 know not to be holding relevant libraries, and add any that are needed.
4799 Say "none" for none.
4810 rp="Directories to use for library searches?"
4817 : compute shared library extension
4820 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4830 On some systems, shared libraries may be available. Answer 'none' if
4831 you want to suppress searching of shared libraries for the remainder
4832 of this configuration.
4835 rp='What is the file extension used for shared libraries?'