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 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Thu Jan 24 16:12:51 EET 2002 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
68 case "X${MACHTYPE:-nonesuchmach}" in
76 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
77 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
78 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
79 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
80 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
81 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
82 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
83 paths="$paths /sbin /usr/sbin /usr/libexec"
84 paths="$paths /system/gnu_library/bin"
90 *) test -d $p && PATH=$PATH$p_$p ;;
97 : shall we be using ksh?
103 if (PATH=.; alias -x) >/dev/null 2>&1; then
106 if test -f /hp-ux -a -f /bin/ksh; then
107 needksh='to avoid sh bug in "here document" expansion'
109 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
110 if test X`/usr/bin/uname -v` = X4; then
111 avoidksh="to avoid AIX 4's /bin/sh"
115 if test -f /osf_boot -a -f /usr/sbin/setld; then
116 if test X`/usr/bin/uname -s` = XOSF1; then
117 avoidksh="to avoid Digital UNIX' ksh"
119 unset BIN_SH # if this is 'xpg4' sh will start up ksh
122 case "$inksh/$needksh" in
129 case "$inksh/$avoidksh" in
135 case "$inksh/$needksh-$avoidksh-" in
138 (I see you are using the Korn shell. Some ksh's blow up on $me,
139 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
146 echo "(Feeding myself to $newsh $reason.)"
148 Configure|*/Configure) exec $newsh $0 "$@";;
149 *) exec $newsh Configure "$@";;
154 : if needed set CDPATH to a harmless value that is not chatty
155 : avoid bash 2.02 problems with empty CDPATH.
159 *bash*) CDPATH='.' ;;
164 : Configure runs within the UU subdirectory
165 test -d UU || mkdir UU
497 d_old_pthread_create_joinable=''
498 old_pthread_create_joinable=''
586 d_stdio_ptr_lval_nochange_cnt=''
587 d_stdio_ptr_lval_sets_cnt=''
772 inc_version_list_init=''
791 ignore_versioned_solibs=''
850 d_perl_otherlibdirs=''
864 version_patchlevel_string=''
869 d_nv_preserves_uv_bits=''
968 d_stdio_stream_array=''
969 stdio_stream_array=''
979 ccflags_uselargefiles=''
980 ldflags_uselargefiles=''
981 libswanted_uselargefiles=''
1001 installvendorarch=''
1027 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1030 : We must find out about Eunice early
1032 if test -f /etc/unixtovms; then
1033 eunicefix=/etc/unixtovms
1035 if test -f /etc/unixtovms.exe; then
1036 eunicefix=/etc/unixtovms.exe
1039 if test -f "/system/gnu_library/bin/ar.pm"; then
1047 : set useposix=false in your hint file to disable the POSIX extension.
1049 : set useopcode=false in your hint file to disable the Opcode extension.
1051 : Trailing extension. Override this in a hint file, if needed.
1052 : Extra object files, if any, needed on this platform.
1055 : Possible local include directories to search.
1056 : Set locincpth to "" in a hint file to defeat local include searches.
1057 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1058 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1060 : no include file wanted by default
1065 : change the next line if compiling for Xenix/286 on Xenix/386
1066 xlibpth='/usr/lib/386 /lib/386'
1067 : Possible local library directories to search.
1068 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1069 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1071 : general looking path for locating libraries
1072 glibpth="/lib /usr/lib $xlibpth"
1073 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1074 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1075 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1077 : Private path used by Configure to find libraries. Its value
1078 : is prepended to libpth. This variable takes care of special
1079 : machines, like the mips. Usually, it should be empty.
1082 : default library list
1084 : some systems want to use only the non-versioned libso:s
1085 ignore_versioned_solibs=''
1087 ccflags_uselargefiles=''
1088 ldflags_uselargefiles=''
1089 libswanted_uselargefiles=''
1090 : set usemultiplicity on the Configure command line to enable multiplicity.
1091 : set usesocks on the Configure command line to enable socks.
1092 : set usethreads on the Configure command line to enable threads.
1093 usereentrant='undef'
1094 : full support for void wanted by default
1097 : List of libraries we want.
1098 : If anyone needs -lnet, put it in a hint file.
1099 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1100 libswanted="$libswanted dld ld sun m c cposix posix"
1101 libswanted="$libswanted ndir dir crypt sec"
1102 libswanted="$libswanted ucb bsd BSD PW x util"
1103 : We probably want to search /usr/shlib before most other libraries.
1104 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1105 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1106 glibpth="/usr/shlib $glibpth"
1107 : Do not use vfork unless overridden by a hint file.
1110 : Find the basic shell for Bourne shell scripts
1114 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1117 if test -f "$xxx"; then
1120 : Build up a list and do a single loop so we can 'break' out.
1121 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1122 for xxx in sh bash ksh pdksh ash; do
1124 try="$try ${p}/${xxx}"
1128 if test -f "$xxx"; then
1131 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1134 elif test -f "$xxx.exe"; then
1145 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1147 Usually it's in /bin/sh. How did you even get this far?
1148 Please contact me (Perl Maintainers) at perlbug@perl.org and
1149 we'll try to straighten this all out.
1155 : see if sh knows # comments
1156 if `$sh -c '#' >/dev/null 2>&1`; then
1160 test -f $xcat$_exe || xcat=/usr/bin/cat
1161 if test ! -f $xcat$_exe; then
1162 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1163 if test -f $p/cat$_exe; then
1168 if test ! -f $xcat$_exe; then
1169 echo "Can't find cat anywhere!"
1173 echo "#!$xcat" >sharp
1177 if test -s today; then
1180 echo "#! $xcat" > sharp
1184 if test -s today; then
1192 echo "Your $sh doesn't grok # comments--I will strip them later on."
1195 echo "exec grep -v '^[ ]*#'" >spitshell
1197 $eunicefix spitshell
1198 spitshell=`pwd`/spitshell
1200 echo "I presume that if # doesn't work, #! won't work either!"
1205 : figure out how to guarantee sh startup
1207 '') startsh=${sharpbang}${sh} ;;
1219 : echo "Yup, it does."
1221 echo "Hmm... '$startsh' does not guarantee sh startup..."
1222 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1227 : Save command line options in file UU/cmdline.opt for later use in
1228 : generating config.sh.
1229 cat > cmdline.opt <<EOSH
1230 # Configure command line arguments.
1239 cat >>cmdline.opt <<EOSH
1240 config_arg$argn='$arg'
1242 # Extreme backslashitis: replace each ' by '"'"'
1243 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1246 arg_exp=`cat cmdl.opt`
1247 args_exp="$args_exp$args_sep'$arg_exp'"
1248 argn=`expr $argn + 1`
1251 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1252 # used by ./hints/os2.sh
1255 : produce awk script to parse command line options
1256 cat >options.awk <<'EOF'
1258 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1260 len = length(optstr);
1261 for (i = 1; i <= len; i++) {
1262 c = substr(optstr, i, 1);
1263 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1274 if (substr(str, 1, 1) != "-") {
1275 printf("'%s'\n", str);
1279 for (i = 2; i <= len; i++) {
1280 c = substr(str, i, 1);
1282 printf("-%s\n", substr(str, i));
1288 printf("'%s'\n", substr(str, i + 1));
1301 : process the command line options
1302 set X `for arg in "$@"; do echo "X$arg"; done |
1303 sed -e s/X// | awk -f options.awk`
1308 : set up default values
1318 rm -f optdef.sh posthint.sh
1319 cat >optdef.sh <<EOS
1325 while test $# -gt 0; do
1327 -d) shift; fastread=yes;;
1328 -e) shift; alldone=cont;;
1332 if test -r "$1"; then
1335 echo "$me: cannot read config file $1." >&2
1340 -h) shift; error=true;;
1341 -r) shift; reuseval=true;;
1342 -s) shift; silent=true; realsilent=true;;
1343 -E) shift; alldone=exit;;
1344 -K) shift; knowitall=true;;
1345 -O) shift; override=true;;
1346 -S) shift; silent=true; extractsh=true;;
1351 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1352 echo "$me: ignoring -D $1" >&2
1355 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1356 *) echo "$1='define'" >> optdef.sh;;
1363 *=) echo "$1" >> optdef.sh;;
1365 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1366 echo "$me: ignoring -U $1" >&2
1368 *) echo "$1='undef'" >> optdef.sh;;
1379 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1383 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1384 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1390 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1391 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1392 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1393 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1394 *) xxx=`echo $yyy|sed 's!:.*!!'`
1395 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1401 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1403 echo "$yyy=''" >> posthint.sh ;;
1408 echo "$yyy='$zzz'" >> posthint.sh ;;
1410 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1412 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1417 echo "$yyy=$zzz" >> posthint.sh ;;
1418 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1422 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1425 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1433 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1434 [-U symbol] [-U symbol=] [-A command:symbol...]
1435 -d : use defaults for all answers.
1436 -e : go on without questioning past the production of config.sh.
1437 -f : specify an alternate default configuration file.
1438 -h : print this help message and exit (with an error status).
1439 -r : reuse C symbols value if possible (skips costly nm extraction).
1440 -s : silent mode, only echoes questions and essential information.
1441 -D : define symbol to have some value:
1442 -D symbol symbol gets the value 'define'
1443 -D symbol=value symbol gets the value 'value'
1444 -E : stop at the end of questions, after having produced config.sh.
1445 -K : do not use unless you know what you are doing.
1446 -O : let -D and -U override definitions from loaded configuration file.
1447 -S : perform variable substitutions on all .SH files (can mix with -f)
1448 -U : undefine symbol:
1449 -U symbol symbol gets the value 'undef'
1450 -U symbol= symbol gets completely empty
1451 -A : manipulate symbol after the platform specific hints have been applied:
1452 -A symbol=value append " "value to symbol
1453 -A append:symbol=value append value to symbol
1454 -A define:symbol=value define symbol to have value
1455 -A clear:symbol define symbol to be ''
1456 -A define:symbol define symbol to be 'define'
1457 -A eval:symbol=value define symbol to be eval of value
1458 -A prepend:symbol=value prepend value to symbol
1459 -A undef:symbol define symbol to be 'undef'
1460 -A undef:symbol= define symbol to be ''
1461 -V : print version number and exit (with a zero status).
1468 case "$fastread$alldone" in
1471 case "$extractsh" in
1474 if test ! -t 0; then
1475 echo "Say 'sh Configure', not 'sh <Configure'"
1485 true) exec 1>/dev/null;;
1488 : run the defines and the undefines, if any, but leave the file out there...
1491 : create the posthint manipulation script and leave the file out there...
1496 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1497 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1498 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1499 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1500 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1503 : Some greps do not return status, grrr.
1504 echo "grimblepritz" >grimble
1505 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1507 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1513 : the following should work in any shell
1517 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1518 cat >contains <<'EOSS'
1519 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1524 : Find the path to the source tree
1527 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1531 *) src=`cd ../$src && pwd` ;;
1544 if test -f $rsrc/Configure && \
1545 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1547 : found it, so we are ok.
1550 for src in . .. ../.. ../../.. ../../../..; do
1551 if test -f ../$src/Configure && \
1552 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1563 Sorry, I can't seem to locate the source dir for $package. Please start
1564 Configure with an explicit path -- i.e. /some/path/Configure.
1572 echo "Sources for $package found in \"$src\"." >&4
1576 : script used to extract .SH files with variable substitutions
1577 cat >extract <<'EOS'
1579 echo "Doing variable substitutions on .SH files..."
1580 if test -f MANIFEST; then
1581 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1583 echo "(Looking for .SH files under the source directory.)"
1584 set x `(cd "$src"; find . -name "*.SH" -print)`
1588 0) set x `(cd "$src"; echo *.SH)`; shift;;
1590 if test ! -f "$src/$1"; then
1596 while test $name; do
1597 if test ! -d "$name"; then
1598 create="$name $create";
1599 name=`echo $name | sed -e "s|^[^/]*$||"`;
1600 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1605 for file in $create; do
1614 dir=`expr X$file : 'X\(.*\)/'`
1615 file=`expr X$file : 'X.*/\(.*\)'`
1616 (cd "$dir" && . ./$file)
1626 dir=`expr X$file : 'X\(.*\)/'`
1627 file=`expr X$file : 'X.*/\(.*\)'`
1628 (set x $dir; shift; eval $mkdir_p)
1629 sh <"$src/$dir/$file"
1638 if test -f "$src/config_h.SH"; then
1639 if test ! -f config.h; then
1640 : oops, they left it out of MANIFEST, probably, so do it anyway.
1641 . "$src/config_h.SH"
1646 : extract files and exit if asked to do so
1647 case "$extractsh" in
1649 case "$realsilent" in
1653 case "$config_sh" in
1654 '') config_sh='config.sh';;
1657 echo "Fetching answers from $config_sh..."
1660 test "$override" && . ./optdef.sh
1664 echo "Extraction done."
1669 : Eunice requires " " instead of "", can you believe it
1672 echo "Beginning of configuration questions for $package."
1674 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1676 : first determine how to suppress newline on echo command
1678 echo "Checking echo to see how to suppress newlines..."
1679 (echo "hi there\c" ; echo " ") >.echotmp
1680 if $contains c .echotmp >/dev/null 2>&1 ; then
1691 echo $n "The star should be here-->$c"
1695 : Now test for existence of everything in MANIFEST
1697 if test -f "$rsrc/MANIFEST"; then
1698 echo "First let's make sure your kit is complete. Checking..." >&4
1699 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | split -50
1702 for filelist in x??; do
1703 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1705 if test -s missing; then
1709 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1711 You have the option of continuing the configuration process, despite the
1712 distinct possibility that your kit is damaged, by typing 'y'es. If you
1713 do, don't blame me if something goes wrong. I advise you to type 'n'o
1714 and contact the author (perlbug@perl.org).
1717 echo $n "Continue? [n] $c" >&4
1721 echo "Continuing..." >&4
1725 echo "ABORTING..." >&4
1730 echo "Looks good..."
1733 echo "There is no MANIFEST file. I hope your kit is complete !"
1738 : Find the appropriate value for a newline for tr
1739 if test -n "$DJGPP"; then
1742 if test X"$trnl" = X; then
1743 case "`echo foo|tr '\n' x 2>/dev/null`" in
1747 if test X"$trnl" = X; then
1748 case "`echo foo|tr '\012' x 2>/dev/null`" in
1749 foox) trnl='\012' ;;
1752 if test X"$trnl" = X; then
1755 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1761 : compute the number of columns on the terminal for proper question formatting
1766 : set up the echo used in my read
1767 myecho="case \"\$xxxm\" in
1768 '') echo $n \"\$rp $c\" >&4;;
1770 '') echo $n \"[\$xxxm] $c\";;
1772 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1774 echo $n \"[\$xxxm] $c\" >&4
1776 echo $n \"\$rp [\$xxxm] $c\" >&4
1782 : now set up to do reads with possible shell escape and default assignment
1788 case "\$fastread" in
1789 yes) case "\$dflt" in
1792 case "\$silent-\$rp" in
1797 *) case "\$silent" in
1798 true) case "\$rp" in
1803 while expr "X\$ans" : "X!" >/dev/null; do
1807 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1815 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1824 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1829 echo "(OK, I'll run with -d after this question.)" >&4
1832 echo "*** Sorry, \$1 not supported yet." >&4
1842 echo "*** Substitution done -- please confirm."
1844 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1849 echo "*** Error -- try again."
1856 case "\$ans\$xxxm\$nostick" in
1868 : create .config dir to save info across Configure sessions
1869 test -d ../.config || mkdir ../.config
1870 cat >../.config/README <<EOF
1871 This directory created by Configure to save information that should
1872 persist across sessions for $package.
1874 You may safely delete it if you wish.
1877 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1879 $define|true|[yY]*) ;;
1880 *) case "$xversion" in
1883 *** WHOA THERE!!! ***
1885 This is an UNSTABLE DEVELOPMENT release.
1886 The version of this $package distribution is $xversion, that is, odd,
1887 (as opposed to even) and that signifies a development release.
1888 If you want a maintenance release, you want an even-numbered version.
1890 Do ***NOT*** install this into production use.
1891 Data corruption and crashes are possible.
1893 It is most seriously suggested that you do not continue any further
1894 unless you want to help in developing and debugging Perl.
1896 If you *still* want to build perl, you can answer 'y' now,
1897 or pass -Dusedevel to Configure.
1900 rp='Do you really want to continue?'
1904 [yY]) echo >&4 "Okay, continuing."
1905 usedevel="$define" ;;
1906 *) echo >&4 "Okay, bye."
1916 case "$versiononly" in
1917 '') versiononly="$define" ;;
1919 case "$installusrbinperl" in
1920 '') installusrbinperl="$undef" ;;
1925 : general instructions
1928 user=`(logname) 2>/dev/null`
1930 '') user=`whoami 2>&1`;;
1932 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1935 rp='Would you like to see the instructions?'
1946 This installation shell script will examine your system and ask you questions
1947 to determine how the perl5 package should be installed. If you get
1948 stuck on a question, you may use a ! shell escape to start a subshell or
1949 execute a command. Many of the questions will have default answers in square
1950 brackets; typing carriage return will give you the default.
1952 On some of the questions which ask for file or directory names you are allowed
1953 to use the ~name construct to specify the login directory belonging to "name",
1954 even if you don't have a shell which knows about that. Questions where this is
1955 allowed will be marked "(~name ok)".
1959 dflt='Type carriage return to continue'
1963 The prompter used in this script allows you to use shell variables and
1964 backticks in your answers. You may use $1, $2, etc... to refer to the words
1965 in the default answer, as if the default line was a set of arguments given to a
1966 script shell. This means you may also use $* to repeat the whole default line,
1967 so you do not have to re-type everything to add something to the default.
1969 Everytime there is a substitution, you will have to confirm. If there is an
1970 error (e.g. an unmatched backtick), the default answer will remain unchanged
1971 and you will be prompted again.
1973 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1974 the questions and use the computed defaults (or the previous answers if there
1975 was already a config.sh file). Type 'Configure -h' for a list of options.
1976 You may also start interactively and then answer '& -d' at any prompt to turn
1977 on the non-interactive behaviour for the remainder of the execution.
1983 Much effort has been expended to ensure that this shell script will run on any
1984 Unix system. If despite that it blows up on yours, your best bet is to edit
1985 Configure and run it again. If you can't run Configure for some reason,
1986 you'll have to generate a config.sh file by hand. Whatever problems you
1987 have, let me (perlbug@perl.org) know how I blew it.
1989 This installation script affects things in two ways:
1991 1) it may do direct variable substitutions on some of the files included
1993 2) it builds a config.h file for inclusion in C programs. You may edit
1994 any of these files as the need arises after running this script.
1996 If you make a mistake on a question, there is no easy way to back up to it
1997 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1998 files. Configure will offer to let you do this before it runs the SH files.
2001 dflt='Type carriage return to continue'
2003 case "$firsttime" in
2004 true) echo $user >>../.config/instruct;;
2008 : find out where common programs are
2010 echo "Locating common programs..." >&4
2023 if test -d \$dir/\$thing; then
2029 for thisthing in \$dir/\$thing; do
2030 : just loop through to pick last item
2032 if test -f \$thisthing; then
2035 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2038 elif test -f \$dir/\$thing.exe; then
2039 if test -n "$DJGPP"; then
2040 echo \$dir/\$thing.exe
2042 : on Eunice apparently
2095 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2096 pth="$pth /lib /usr/lib"
2097 for file in $loclist; do
2101 if test -f "$xxx"; then
2104 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2105 xxx=`./loc $file $file $pth`
2108 '') xxx=`./loc $file $file $pth`;;
2109 *) xxx=`./loc $xxx $xxx $pth`;;
2111 eval $file=$xxx$_exe
2115 echo $file is in $xxx.
2118 echo $file is in $xxx.
2121 echo "I don't know where '$file' is, and my life depends on it." >&4
2122 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2128 echo "Don't worry if any of the following aren't found..."
2130 for file in $trylist; do
2134 if test -f "$xxx"; then
2137 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2138 xxx=`./loc $file $file $pth`
2141 '') xxx=`./loc $file $file $pth`;;
2142 *) xxx=`./loc $xxx $xxx $pth`;;
2148 echo $file is in $xxx.
2151 echo $file is in $xxx.
2154 echo "I don't see $file out there, $say."
2161 echo "Substituting grep for egrep."
2168 echo "Substituting cp for ln."
2177 echo "I can't find make or gmake, and my life depends on it." >&4
2178 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2186 *) # We can't have osname yet.
2187 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2188 # Assume that gmake, if found, is definitely GNU make
2189 # and prefer it over the system make.
2190 echo "Substituting gmake for make."
2198 echo "Hopefully test is built into your sh."
2201 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2202 echo "Using the test built into your sh."
2210 echo "Hopefully echo is built into your sh."
2215 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2216 $echo $n "hi there$c" >foo1
2217 echo $n "hi there$c" >foo2
2218 if cmp foo1 foo2 >/dev/null 2>&1; then
2219 echo "They are compatible. In fact, they may be identical."
2226 They are not compatible! You are probably running ksh on a non-USG system.
2227 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2228 have echo built in and we may have to run some Bourne shell scripts. That
2229 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2232 $echo $n "The star should be here-->$c"
2242 cat <<'EOSC' >>checkcc
2247 int main(int argc, char *argv[]) {
2251 if $cc -o try $ccflags $ldflags try.c; then
2254 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2260 case "`$cc -v -c try.c 2>&1`" in
2263 if $test X"$trygcc" = Xyes; then
2264 if gcc -o try -c try.c; then
2266 echo "You seem to have a working gcc, though." >&4
2267 rp="Would you like to use it?"
2269 if $test -f myread; then
2272 if $test -f UU/myread; then
2275 echo "Cannot find myread, sorry. Aborting." >&2
2280 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2284 if $test X"$despair" = Xyes; then
2286 You need to find a working C compiler.
2287 Either (purchase and) install the C compiler supplied by your OS vendor,
2288 or for a free C compiler try http://gcc.gnu.org/
2289 I cannot continue any further, aborting.
2299 : determine whether symbolic links are supported
2302 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2303 echo "Symbolic links are supported." >&4
2306 echo "Symbolic links are NOT supported." >&4
2311 : determine whether symbolic links are supported
2315 echo "Checking how to test for symbolic links..." >&4
2317 if $test "X$issymlink" = X; then
2319 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2320 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2322 if test $? = 0; then
2325 echo "Your builtin 'test -h' may be broken." >&4
2328 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2331 if test -f "$p/$test"; then
2340 echo "Trying external '$test -h'." >&4
2341 issymlink="$test -h"
2342 if $test ! -h sym >/dev/null 2>&1; then
2343 echo "External '$test -h' is broken, too." >&4
2351 if $test "X$issymlink" = X; then
2352 if $test -L sym 2>/dev/null; then
2353 issymlink="$test -L"
2354 echo "The builtin '$test -L' worked." >&4
2357 if $test "X$issymlink" != X; then
2358 echo "You can test for symbolic links with '$issymlink'." >&4
2360 echo "I do not know how you can test for symbolic links." >&4
2364 *) echo "No symbolic links, so not testing for their testing..." >&4
2370 case "$mksymlinks" in
2373 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2376 *) case "$lns:$issymlink" in
2377 *"ln -s:"*"test -"?)
2378 echo "Creating the symbolic links..." >&4
2379 echo "(First creating the subdirectories...)" >&4
2381 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2383 test -z "$directory" && break
2387 if test ! -d t/base; then
2388 echo "Failed to create the subdirectories. Aborting." >&4
2391 echo "(Then creating the symlinks...)" >&4
2392 awk '{print $1}' $src/MANIFEST | while true; do
2394 test -z "$filename" && break
2395 if test -f $filename; then
2396 if $issymlink $filename; then
2400 if test -f $filename; then
2401 echo "$filename already exists, not symlinking."
2403 ln -s $src/$filename $filename
2407 if test ! -f t/base/lex.t; then
2408 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2413 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2422 case "$usecrosscompile" in
2424 $echo "Cross-compiling..."
2427 *-*-gcc) # A cross-compiling gcc, probably.
2428 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2430 # leave out ld, choosing it is more complex
2432 ranlib=$targetarch-ranlib
2433 $echo 'extern int foo;' > try.c
2434 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2436 if $test $# -gt 0; then
2438 incpth="`$echo $incpth|$sed 's/^ //'`"
2439 echo "Guessing incpth '$incpth'." >&4
2441 j="`$echo $i|$sed 's,/include$,/lib,'`"
2442 if $test -d $j; then
2446 libpth="`$echo $libpth|$sed 's/^ //'`"
2447 echo "Guessing libpth '$libpth'." >&4
2452 case "$targetarch" in
2453 '') echo "Targetarch not defined." >&4; croak=y ;;
2454 *) echo "Using targetarch $targetarch." >&4 ;;
2457 '') echo "Incpth not defined." >&4; croak=y ;;
2458 *) echo "Using incpth '$incpth'." >&4 ;;
2461 '') echo "Libpth not defined." >&4; croak=y ;;
2462 *) echo "Using libpth '$libpth'." >&4 ;;
2465 '') for i in $incpth; do
2466 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2468 echo "Guessing usrinc $usrinc." >&4
2473 '') echo "Usrinc not defined." >&4; croak=y ;;
2476 *) echo "Using usrinc $usrinc." >&4 ;;
2478 case "$targethost" in
2479 '') echo "Targethost not defined." >&4; croak=y ;;
2480 *) echo "Using targethost $targethost." >&4
2485 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2488 /*) run=$src/Cross/run
2489 targetmkdir=$src/Cross/mkdir
2491 from=$src/Cross/from
2493 *) pwd=`$test -f ../Configure & cd ..; pwd`
2495 targetmkdir=$pwd/Cross/mkdir
2497 from=$pwd/Cross/from
2500 case "$targetrun" in
2501 '') targetrun=ssh ;;
2506 case "$targetfrom" in
2507 '') targetfrom=scp ;;
2511 from=$from-$targetfrom
2512 case "$targetdir" in
2514 echo "Guessing targetdir $targetdir." >&4
2517 case "$targetuser" in
2519 echo "Guessing targetuser $targetuser." >&4
2522 case "$targetfrom" in
2526 case "$targetrun" in
2538 '') cwd=$targetdir ;;
2542 if $test ! -f \$exe.xok; then
2546 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2549 *) echo "Unknown targetrun '$targetrun'" >&4
2553 case "$targetmkdir" in
2555 cat >$targetmkdir <<EOF
2557 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2559 $chmod a+rx $targetmkdir
2561 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2573 $targetmkdir \`dirname \$f\`
2574 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2577 $targetmkdir $targetdir/\`dirname \$f\`
2578 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2591 $mkdir -p $targetdir/\`dirname \$f\`
2592 $cp \$f $targetdir/\$f || exit 1
2595 $targetmkdir $targetdir/\`dirname \$f\`
2596 $cp \$f $targetdir/\$f || exit 1
2603 *) echo "Unknown targetto '$targetto'" >&4
2607 case "$targetfrom" in
2614 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2619 cp) cat >$from <<EOF
2624 cp $targetdir/\$f . || exit 1
2629 *) echo "Unknown targetfrom '$targetfrom'" >&4
2633 if $test ! -f $run; then
2634 echo "Target 'run' script '$run' not found." >&4
2638 if $test ! -f $to; then
2639 echo "Target 'to' script '$to' not found." >&4
2643 if $test ! -f $from; then
2644 echo "Target 'from' script '$from' not found." >&4
2648 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2652 Using '$run' for remote execution,
2653 and '$from' and '$to'
2654 for remote file transfer.
2660 usecrosscompile='undef'
2665 : see whether [:lower:] and [:upper:] are supported character classes
2667 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2669 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2673 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2674 # (0xc9 and 0xd1), therefore that is a nice testing point.
2675 if test "X$up" = X -o "X$low" = X; then
2676 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2682 if test "X$up" = X -o "X$low" = X; then
2683 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2689 if test "X$up" = X -o "X$low" = X; then
2690 case "`echo IJ | od -x 2>/dev/null`" in
2692 echo "Hey, this might be EBCDIC." >&4
2693 if test "X$up" = X -o "X$low" = X; then
2694 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2695 ij) up='[A-IJ-RS-Z]'
2700 if test "X$up" = X -o "X$low" = X; then
2701 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2711 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2713 echo "Using $up and $low to convert case." >&4
2716 echo "I don't know how to translate letters from upper to lower case." >&4
2717 echo "Your tr is not acting any way I know of." >&4
2721 : set up the translation script tr, must be called with ./tr of course
2725 '[A-Z][a-z]') exec $tr '$up' '$low';;
2726 '[a-z][A-Z]') exec $tr '$low' '$up';;
2733 : Try to determine whether config.sh was made on this system
2734 case "$config_sh" in
2736 myuname=`$uname -a 2>/dev/null`
2737 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2738 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2739 # because the A-Z/a-z are not consecutive.
2740 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2741 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2742 newmyuname="$myuname"
2744 case "$knowitall" in
2746 if test -f ../config.sh; then
2747 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2748 eval "`grep myuname= ../config.sh`"
2750 if test "X$myuname" = "X$newmyuname"; then
2758 : Get old answers from old config file if Configure was run on the
2759 : same system, otherwise use the hints.
2762 if test -f config.sh; then
2764 rp="I see a config.sh file. Shall I use it to set the defaults?"
2767 n*|N*) echo "OK, I'll ignore it."
2768 mv config.sh config.sh.old
2769 myuname="$newmyuname"
2771 *) echo "Fetching default answers from your old config.sh file..." >&4
2779 : Older versions did not always set $sh. Catch re-use of such
2789 if test ! -f config.sh; then
2792 First time through, eh? I have some defaults handy for some systems
2793 that need some extra help getting the Configure answers right:
2796 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2798 : Half the following guesses are probably wrong... If you have better
2799 : tests or hints, please send them to perlbug@perl.org
2800 : The metaconfig authors would also appreciate a copy...
2801 $test -f /irix && osname=irix
2802 $test -f /xenix && osname=sco_xenix
2803 $test -f /dynix && osname=dynix
2804 $test -f /dnix && osname=dnix
2805 $test -f /lynx.os && osname=lynxos
2806 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2807 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2808 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2809 $test -f /bin/mips && /bin/mips && osname=mips
2810 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2811 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2812 $test -d /usr/apollo/bin && osname=apollo
2813 $test -f /etc/saf/_sactab && osname=svr4
2814 $test -d /usr/include/minix && osname=minix
2815 $test -f /system/gnu_library/bin/ar.pm && osname=vos
2816 if $test -d /MachTen -o -d /MachTen_Folder; then
2818 if $test -x /sbin/version; then
2819 osvers=`/sbin/version | $awk '{print $2}' |
2820 $sed -e 's/[A-Za-z]$//'`
2821 elif $test -x /usr/etc/version; then
2822 osvers=`/usr/etc/version | $awk '{print $2}' |
2823 $sed -e 's/[A-Za-z]$//'`
2829 $test -f /sys/posix.dll &&
2830 $test -f /usr/bin/what &&
2831 set X `/usr/bin/what /sys/posix.dll` &&
2832 $test "$3" = UWIN &&
2836 if $test -f $uname; then
2844 umips) osname=umips ;;
2847 [23]100) osname=mips ;;
2848 next*) osname=next ;;
2850 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2851 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2854 elif $test -f /etc/kconfig; then
2856 if test "$lns" = "$ln -s"; then
2858 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2860 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2867 if test -n "$DJGPP"; then
2876 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2878 'not found') osvers="$4"."$3" ;;
2879 '<3240'|'<>3240') osvers=3.2.0 ;;
2880 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2881 '=3250'|'>3250') osvers=3.2.5 ;;
2885 bsd386) osname=bsd386
2888 cygwin*) osname=cygwin
2891 *dc.osx) osname=dcosx
2897 domainos) osname=apollo
2903 dynixptx*) osname=dynixptx
2904 osvers=`echo "$4"|sed 's/^v//'`
2906 freebsd) osname=freebsd
2908 genix) osname=genix ;;
2910 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2926 netbsd*) osname=netbsd
2929 news-os) osvers="$3"
2931 4*) osname=newsos4 ;;
2935 next*) osname=next ;;
2936 nonstop-ux) osname=nonstopux ;;
2937 POSIX-BC | posix-bc ) osname=posix-bc
2940 powerux | power_ux | powermax_os | powermaxos | \
2941 powerunix | power_unix) osname=powerux
2947 solaris) osname=solaris
2949 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2956 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2960 titanos) osname=titanos
2969 ultrix) osname=ultrix
2972 osf1|mls+) case "$5" in
2975 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2978 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2981 hp*) osname=hp_osf1 ;;
2982 mips) osname=mips_osf1 ;;
2985 unixware) osname=svr5
2993 $2) case "$osname" in
2997 : svr4.x or possibly later
3007 if test -f /stand/boot ; then
3008 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3009 if test -n "$INITPROG" -a -f "$INITPROG"; then
3010 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3011 if test -n "$isesix"; then
3019 *) if test -f /etc/systemid; then
3021 set `echo $3 | $sed 's/\./ /g'` $4
3022 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3024 elif $test -f $src/hints/sco_$1_$2.sh; then
3026 elif $test -f $src/hints/sco_$1.sh; then
3031 '') : Still unknown. Probably a generic Sys V.
3040 *) case "$osname" in
3041 '') : Still unknown. Probably a generic BSD.
3049 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3050 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3051 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3054 $rm -f UU/kernel.what
3055 elif test -d c:/.; then
3062 case "$targetarch" in
3065 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3070 : Now look for a hint file osname_osvers, unless one has been
3071 : specified already.
3074 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3075 : Also try without trailing minor version numbers.
3076 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3077 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3078 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3079 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3082 *) case "$osvers" in
3085 *) if $test -f $src/hints/$file.sh ; then
3087 elif $test -f $src/hints/$xfile.sh ; then
3089 elif $test -f $src/hints/$xxfile.sh ; then
3091 elif $test -f $src/hints/$xxxfile.sh ; then
3093 elif $test -f $src/hints/$xxxxfile.sh ; then
3095 elif $test -f "$src/hints/${osname}.sh" ; then
3104 if $test -f Policy.sh ; then
3107 none) dflt="Policy" ;;
3108 *) dflt="Policy $dflt" ;;
3113 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3117 if $test -f Policy.sh ; then
3120 There's also a Policy hint file available, which should make the
3121 site-specific (policy) questions easier to answer.
3128 You may give one or more space-separated answers, or "none" if appropriate.
3129 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3130 is a good thing. DO NOT give a wrong version or a wrong OS.
3134 rp="Which of these apply, if any?"
3137 for file in $tans; do
3138 if $test X$file = XPolicy -a -f Policy.sh; then
3140 $cat Policy.sh >> UU/config.sh
3141 elif $test -f $src/hints/$file.sh; then
3142 . $src/hints/$file.sh
3143 $cat $src/hints/$file.sh >> UU/config.sh
3144 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3147 : Give one chance to correct a possible typo.
3148 echo "$file.sh does not exist"
3150 rp="hint to use instead?"
3152 for file in $ans; do
3153 if $test -f "$src/hints/$file.sh"; then
3154 . $src/hints/$file.sh
3155 $cat $src/hints/$file.sh >> UU/config.sh
3156 elif $test X$ans = X -o X$ans = Xnone ; then
3159 echo "$file.sh does not exist -- ignored."
3166 : Remember our hint file for later.
3167 if $test -f "$src/hints/$file.sh" ; then
3177 echo "Fetching default answers from $config_sh..." >&4
3181 cp $config_sh config.sh 2>/dev/null
3191 test "$override" && . ./optdef.sh
3193 : Restore computed paths
3194 for file in $loclist $trylist; do
3195 eval $file="\$_$file"
3200 Configure uses the operating system name and version to set some defaults.
3201 The default value is probably right if the name rings a bell. Otherwise,
3202 since spelling matters for me, either accept the default or answer "none"
3209 ''|' '|none) dflt=none ;;
3210 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3213 *) dflt="$osname" ;;
3215 rp="Operating system name?"
3219 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3225 ''|' '|none) dflt=none ;;
3226 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3227 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3229 ''|' ') dflt=none ;;
3234 *) dflt="$osvers" ;;
3236 rp="Operating system version?"
3246 : who configured the system
3247 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3248 cf_by=`(logname) 2>/dev/null`
3251 cf_by=`(whoami) 2>/dev/null`
3253 "") cf_by=unknown ;;
3257 : set up the script used to warn in case of inconsistency
3264 echo "*** WHOA THERE!!! ***" >&4
3265 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3266 rp=" Keep the $hint value?"
3269 y) td=$was; tu=$was;;
3273 : function used to set $1 to $val
3274 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3276 $define$undef) . ./whoa; eval "$var=\$td";;
3277 $undef$define) . ./whoa; eval "$var=\$tu";;
3278 *) eval "$var=$val";;
3281 case "$usethreads" in
3282 $define|true|[yY]*) dflt='y';;
3287 Perl can be built to take advantage of threads on some systems.
3288 To do so, Configure can be run with -Dusethreads.
3290 Note that threading is a highly experimental feature, and
3291 some known race conditions still remain. If you choose to try
3292 it, be very sure to not actually deploy it for production
3293 purposes. README.threads has more details, and is required
3294 reading if you enable threads.
3296 If this doesn't make any sense to you, just accept the default '$dflt'.
3298 rp='Build a threading Perl?'
3301 y|Y) val="$define" ;;
3307 case "$usethreads" in
3311 As of 5.5.640, Perl has two different internal threading implementations,
3312 the 5.005 version (5005threads) and an interpreter-based version
3313 (ithreads) that has one interpreter per thread. Both are very
3314 experimental. This arrangement exists to help developers work out
3315 which one is better.
3317 If you're a casual user, you probably don't want interpreter-threads
3318 at this time. But if you do, the 'threads' module allows their use,
3319 and the 'Thread' module offers an interface to both 5005threads and
3320 ithreads (whichever has been configured).
3322 : Default to ithreads unless overridden on command line or with
3325 case "$use5005threads" in
3326 $define|true|[yY]*) dflt='n';;
3328 case "$useithreads" in
3329 $undef|false|[nN]*) dflt='n';;
3331 rp='Use interpreter-based ithreads?'
3334 y|Y) val="$define" ;;
3339 : Now set use5005threads to the opposite value.
3340 case "$useithreads" in
3341 $define) val="$undef" ;;
3348 useithreads="$undef"
3349 use5005threads="$undef"
3353 case "$useithreads$use5005threads" in
3357 You cannot have both the ithreads and the 5.005 threads enabled
3358 at the same time. Disabling the 5.005 threads since they are
3359 much less stable than the ithreads.
3362 use5005threads="$undef"
3366 case "$d_oldpthreads" in
3367 '') : Configure tests would be welcome here. For now, assume undef.
3369 *) val="$d_oldpthreads" ;;
3375 case "$usethreads" in
3376 "$define"|true|[yY]*)
3377 : Look for a hint-file generated 'call-back-unit'. If the
3378 : user has specified that a threading perl is to be built,
3379 : we may need to set or change some other defaults.
3380 if $test -f usethreads.cbu; then
3381 echo "Your platform has some specific hints for threaded builds, using them..."
3385 (Your platform doesn't have any specific hints for threaded builds.
3386 Assuming POSIX threads, then.)
3394 Perl can be built so that multiple Perl interpreters can coexist
3395 within the same Perl executable.
3398 case "$useithreads" in
3401 This multiple interpreter support is required for interpreter-based threads.
3405 *) case "$usemultiplicity" in
3406 $define|true|[yY]*) dflt='y';;
3410 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3411 rp='Build Perl for multiplicity?'
3414 y|Y) val="$define" ;;
3423 case "$usemorebits" in
3424 "$define"|true|[yY]*)
3425 use64bitint="$define"
3426 uselongdouble="$define"
3427 usemorebits="$define"
3429 *) usemorebits="$undef"
3433 : make some quick guesses about what we are up against
3435 $echo $n "Hmm... $c"
3445 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3446 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3448 echo "Looks kind of like an OSF/1 system, but we'll see..."
3450 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3451 xxx=`./loc addbib blurfl $pth`
3452 if $test -f $xxx; then
3453 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3457 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3458 echo "Looks kind of like an extended USG system, but we'll see..."
3460 echo "Looks kind of like a USG system, but we'll see..."
3464 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3465 echo "Looks kind of like a BSD system, but we'll see..."
3469 echo "Looks kind of like a Version 7 system, but we'll see..."
3472 case "$eunicefix" in
3475 There is, however, a strange, musty smell in the air that reminds me of
3476 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3480 : it so happens the Eunice I know will not run shell scripts in Unix format
3484 echo "Congratulations. You aren't running Eunice."
3488 : Detect OS2. The p_ variable is set above in the Head.U unit.
3489 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3490 : semicolon as a patch separator
3495 I have the feeling something is not exactly right, however...don't tell me...
3496 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3497 (Or you may be running DOS with DJGPP.)
3502 if test -f /xenix; then
3503 echo "Actually, this looks more like a XENIX system..."
3508 echo "It's not Xenix..."
3513 if test -f /venix; then
3514 echo "Actually, this looks more like a VENIX system..."
3521 echo "Nor is it Venix..."
3524 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3525 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3532 rp="Use which C compiler?"
3535 : Look for a hint-file generated 'call-back-unit'. Now that the
3536 : user has specified the compiler, we may need to set or change some
3538 if $test -f cc.cbu; then
3544 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3550 printf("%s\n", __VERSION__);
3552 printf("%s\n", "1");
3558 if $cc -o try $ccflags $ldflags try.c; then
3559 gccversion=`$run ./try`
3560 case "$gccversion" in
3561 '') echo "You are not using GNU cc." ;;
3562 *) echo "You are using GNU cc $gccversion."
3568 echo "*** WHOA THERE!!! ***" >&4
3569 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3570 case "$knowitall" in
3572 echo " You'd better start hunting for one and let me know about it." >&4
3578 case "$gccversion" in
3579 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3581 case "$gccversion" in
3582 '') gccosandvers='' ;;
3583 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3584 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3586 case "$gccosandvers" in
3587 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3588 $osname$osvers) ;; # looking good
3589 $osname*) cat <<EOM >&4
3591 *** WHOA THERE!!! ***
3593 Your gcc has not been compiled for the exact release of
3594 your operating system ($gccosandvers versus $osname$osvers).
3596 In general it is a good idea to keep gcc synchronized with
3597 the operating system because otherwise serious problems
3598 may ensue when trying to compile software, like Perl.
3600 I'm trying to be optimistic here, though, and will continue.
3601 If later during the configuration and build icky compilation
3602 problems appear (headerfile conflicts being the most common
3603 manifestation), I suggest reinstalling the gcc to match
3604 your operating system release.
3608 *) gccosandvers='' ;; # failed to parse, better be silent
3617 : decide how portable to be. Allow command line overrides.
3618 case "$d_portable" in
3620 *) d_portable="$define" ;;
3623 : set up shell script to do ~ expansion
3629 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3632 if $test -f /bin/csh; then
3633 /bin/csh -f -c "glob \$1"
3638 name=\`$expr x\$1 : '..\([^/]*\)'\`
3639 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3640 if $test ! -d "\$dir"; then
3642 echo "\$me: can't locate home directory for: \$name" >&2
3647 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3663 : now set up to get a file name
3667 cat <<'EOSC' >>getfile
3683 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3684 fn=`echo $fn | sed 's/(.*)//'`
3690 loc_file=`expr $fn : '.*:\(.*\)'`
3691 fn=`expr $fn : '\(.*\):.*'`
3699 */*) fullpath=true;;
3708 *e*) exp_file=true;;
3711 *p*) nopath_ok=true;;
3716 *d*) type='Directory';;
3717 *l*) type='Locate';;
3722 Locate) what='File';;
3727 case "$d_portable" in
3735 while test "$type"; do
3740 true) rp="$rp (~name ok)";;
3743 if test -f UU/getfile.ok && \
3744 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3763 value=`UU/filexp $ans`
3766 if test "$ans" != "$value"; then
3767 echo "(That expands to $value on this system.)"
3781 /*) value="$ansexp" ;;
3782 [a-zA-Z]:/*) value="$ansexp" ;;
3787 echo "I shall only accept a full path name, as in /bin/ls." >&4
3788 echo "Use a ! shell escape if you wish to check pathnames." >&4
3791 echo "Please give a full path name, starting with slash." >&4
3794 echo "Note that using ~name is ok provided it expands well." >&4
3807 for fp in $gfpth; do
3808 if test "X$fp" = X.; then
3813 if test -f "$pf"; then
3815 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3817 echo "($value is not a plain file, but that's ok.)"
3820 if test X"$type" = X; then
3827 for fp in $gfpth; do
3828 if test "X$fp" = X.; then
3833 direxp="$fp/$ansexp"
3835 if test -d "$direxp"; then
3843 if test -d "$ansexp"; then
3844 echo "(Looking for $loc_file in directory $value.)"
3845 value="$value/$loc_file"
3846 ansexp="$ansexp/$loc_file"
3848 if test -f "$ansexp"; then
3851 case "$nopath_ok" in
3852 true) case "$value" in
3854 *) echo "Assuming $value will be in people's path."
3870 if test "$fastread" = yes; then
3875 rp="$what $value doesn't exist. Use that name anyway?"
3894 test "X$gfpthkeep" != Xy && gfpth=""
3897 : What should the include directory be ?
3899 $echo $n "Hmm... $c"
3903 if $test -f /bin/mips && /bin/mips; then
3904 echo "Looks like a MIPS system..."
3905 $cat >usr.c <<'EOCP'
3906 #ifdef SYSTYPE_BSD43
3910 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3911 dflt='/bsd43/usr/include'
3915 mips_type='System V'
3917 $rm -f usr.c usr.out
3918 echo "and you're compiling with the $mips_type compiler and libraries."
3922 echo "Doesn't look like a MIPS system."
3932 case "$xxx_prompt" in
3935 rp='Where are the include files you want to use?'
3943 : see how we invoke the C preprocessor
3945 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3946 cat <<'EOT' >testcpp.c
3952 if test ! -f cppstdin; then
3953 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3954 # AIX cc -E doesn't show the absolute headerfile
3955 # locations but we'll cheat by using the -M flag.
3956 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
3958 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3961 echo "Keeping your $hint cppstdin wrapper."
3964 wrapper=`pwd`/cppstdin
3968 if $test "X$cppstdin" != "X" && \
3969 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3970 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3972 echo "You used to use $cppstdin $cppminus so we'll use that again."
3974 '') echo "But let's see if we can live without a wrapper..." ;;
3976 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3977 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3979 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3982 echo "(However, $cpprun $cpplast does not work, let's see...)"
3990 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3997 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3998 $cc -E <testcpp.c >testcpp.out 2>&1; \
3999 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4000 echo "Yup, it does."
4003 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4004 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4005 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4006 echo "Yup, it does."
4009 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4010 $cc -P <testcpp.c >testcpp.out 2>&1; \
4011 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4012 echo "Yipee, that works!"
4015 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4016 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4017 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4018 echo "At long last!"
4021 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4022 $cpp <testcpp.c >testcpp.out 2>&1; \
4023 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4027 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4028 $cpp - <testcpp.c >testcpp.out 2>&1; \
4029 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4030 echo "Hooray, it works! I was beginning to wonder."
4033 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4034 $wrapper <testcpp.c >testcpp.out 2>&1; \
4035 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4041 rp="No dice. I can't find a C preprocessor. Name one:"
4045 $x_cpp <testcpp.c >testcpp.out 2>&1
4046 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4047 echo "OK, that will do." >&4
4049 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4064 echo "Perhaps can we force $cc -E using a wrapper..."
4065 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4066 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4072 echo "Nope, we'll have to live without it..."
4086 "$wrapper"|'cppstdin') ;;
4087 *) $rm -f $wrapper;;
4089 $rm -f testcpp.c testcpp.out
4091 : Set private lib path
4094 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4099 '') dlist="$loclibpth $plibpth $glibpth";;
4100 *) dlist="$libpth";;
4103 : Now check and see which directories actually exist, avoiding duplicates
4107 if $test -d $xxx; then
4110 *) libpth="$libpth $xxx";;
4116 Some systems have incompatible or broken versions of libraries. Among
4117 the directories listed in the question below, please remove any you
4118 know not to be holding relevant libraries, and add any that are needed.
4119 Say "none" for none.
4130 rp="Directories to use for library searches?"
4137 : compute shared library extension
4140 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4150 On some systems, shared libraries may be available. Answer 'none' if
4151 you want to suppress searching of shared libraries for the remainder
4152 of this configuration.
4155 rp='What is the file extension used for shared libraries?'
4159 : Define several unixisms.
4160 : Hints files or command line option can be used to override them.
4161 : The convoluted testing is in case hints files set either the old
4164 '') case "$exe_ext" in
4166 *) _exe="$exe_ext" ;;
4171 '') case "$lib_ext" in
4178 '') case "$obj_ext" in
4185 '') case "$path_sep" in
4196 : Which makefile gets called first. This is used by make depend.
4197 case "$firstmakefile" in
4198 '') firstmakefile='makefile';;
4202 $define|true|[yY]*) dflt='y';;
4207 Perl can be built to use the SOCKS proxy protocol library. To do so,
4208 Configure must be run with -Dusesocks. If you use SOCKS you also need
4209 to use the PerlIO abstraction layer, this will be implicitly selected.
4211 If this doesn't make any sense to you, just accept the default '$dflt'.
4213 rp='Build Perl for SOCKS?'
4216 y|Y) val="$define" ;;
4223 $define|true|[yY]*) useperlio="$define";;
4226 : Looking for optional libraries
4228 echo "Checking for optional libraries..." >&4
4233 case "$libswanted" in
4234 '') libswanted='c_s';;
4237 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4243 for thisdir in $libpth $xlibpth; do
4244 test -d $thisdir && libspath="$libspath $thisdir"
4246 for thislib in $libswanted; do
4247 for thisdir in $libspath; do
4249 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4250 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
4251 $test -f "$xxx" && eval $libscheck
4252 $test -f "$xxx" && libstyle=shared
4254 if test ! -f "$xxx"; then
4255 xxx=$thisdir/lib$thislib.$so
4256 $test -f "$xxx" && eval $libscheck
4257 $test -f "$xxx" && libstyle=shared
4259 if test ! -f "$xxx"; then
4260 xxx=$thisdir/lib$thislib$_a
4261 $test -f "$xxx" && eval $libscheck
4262 $test -f "$xxx" && libstyle=static
4264 if test ! -f "$xxx"; then
4265 xxx=$thisdir/$thislib$_a
4266 $test -f "$xxx" && eval $libscheck
4267 $test -f "$xxx" && libstyle=static
4269 if test ! -f "$xxx"; then
4270 xxx=$thisdir/lib${thislib}_s$_a
4271 $test -f "$xxx" && eval $libscheck
4272 $test -f "$xxx" && libstyle=static
4273 $test -f "$xxx" && thislib=${thislib}_s
4275 if test ! -f "$xxx"; then
4276 xxx=$thisdir/Slib$thislib$_a
4277 $test -f "$xxx" && eval $libscheck
4278 $test -f "$xxx" && libstyle=static
4280 if $test -f "$xxx"; then
4282 shared) echo "Found -l$thislib (shared)." ;;
4283 static) echo "Found -l$thislib." ;;
4284 *) echo "Found -l$thislib ($libstyle)." ;;
4288 *) dflt="$dflt -l$thislib"
4289 libsfound="$libsfound $xxx"
4291 libsfiles="$libsfiles $yyy"
4292 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4293 case " $libsdirs " in
4295 *) libsdirs="$libsdirs $yyy" ;;
4302 if $test ! -f "$xxx"; then
4303 echo "No -l$thislib."
4314 ' '|'') dflt='none';;
4319 In order to compile $package on your machine, a number of libraries
4320 are usually needed. Include any other special libraries here as well.
4321 Say "none" for none. The default list is almost always right.
4325 rp="What libraries to use?"
4332 : determine optimization, if desired, or use for debug flag also
4334 ' '|$undef) dflt='none';;
4336 *) dflt="$optimize";;
4340 By default, $package compiles with the -O flag to use the optimizer.
4341 Alternately, you might want to use the symbolic debugger, which uses
4342 the -g flag (on traditional Unix systems). Either flag can be
4343 specified here. To use neither flag, specify the word "none".
4346 rp="What optimizer/debugger flag should be used?"
4350 'none') optimize=" ";;
4354 : We will not override a previous value, but we might want to
4355 : augment a hint file
4357 default|recommended)
4358 case "$gccversion" in
4359 1*) dflt='-fpcc-struct-return' ;;
4362 *-g*) dflt="$dflt -DDEBUGGING";;
4364 case "$gccversion" in
4365 2*) if test -d /etc/conf/kconfig.d &&
4366 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4372 case "$gccversion" in
4376 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4377 echo 'int main(void) { return 0; }' > gcctest.c
4378 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4379 echo "Yes, it does." 2>&1
4382 echo "Leaving current flags $ccflags alone." 2>&1
4384 *) dflt="$dflt -fno-strict-aliasing" ;;
4387 echo "Nope, it doesn't, but that's ok." 2>&1
4394 case "$mips_type" in
4395 *BSD*|'') inclwanted="$locincpth $usrinc";;
4396 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4398 for thisincl in $inclwanted; do
4399 if $test -d $thisincl; then
4400 if $test x$thisincl != x$usrinc; then
4402 *" -I$thisincl "*);;
4403 *) dflt="$dflt -I$thisincl ";;
4409 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4411 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4419 *) dflt="$dflt -D$2";;
4423 set signal.h LANGUAGE_C; eval $inctest
4427 ccflags="$ccflags -DSOCKS"
4432 default|recommended) dflt="$ccflags $dflt" ;;
4433 *) dflt="$ccflags";;
4442 Your C compiler may want other flags. For this question you should include
4443 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4444 but you should NOT include libraries or ld flags like -lwhatever. If you
4445 want $package to honor its debug switch, you should include -DDEBUGGING here.
4446 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4448 To use no flags, specify the word "none".
4454 rp="Any additional cc flags?"
4461 : the following weeds options from ccflags that are of no interest to cpp
4463 '') cppflags="$ccflags" ;;
4464 *) cppflags="$cppflags $ccflags" ;;
4466 case "$gccversion" in
4467 1*) cppflags="$cppflags -D__GNUC__"
4469 case "$mips_type" in
4471 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4477 echo "Let me guess what the preprocessor flags are..." >&4
4491 *) ftry="$previous $flag";;
4493 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4494 >cpp1.out 2>/dev/null && \
4495 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4496 >cpp2.out 2>/dev/null && \
4497 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4498 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4500 cppflags="$cppflags $ftry"
4510 *-*) echo "They appear to be: $cppflags";;
4512 $rm -f cpp.c cpp?.out
4516 : flags used in final linking phase
4518 '') if ./venix; then
4524 *-posix*) dflt="$dflt -posix" ;;
4527 *) dflt="$ldflags";;
4530 : Try to guess additional flags to pick up local libraries.
4531 for thislibdir in $libpth; do
4532 case " $loclibpth " in
4535 *"-L$thislibdir "*) ;;
4536 *) dflt="$dflt -L$thislibdir" ;;
4548 Your C linker may need flags. For this question you should
4549 include -L/whatever and any other flags used by the C linker, but you
4550 should NOT include libraries like -lwhatever.
4552 Make sure you include the appropriate -L/path flags if your C linker
4553 does not normally search all of the directories you specified above,
4556 To use no flags, specify the word "none".
4560 rp="Any additional ld flags (NOT including libraries)?"
4566 rmlist="$rmlist pdp11"
4570 echo "Checking your choice of C compiler and flags for coherency..." >&4
4571 $cat > try.c <<'EOF'
4573 int main() { printf("Ok\n"); exit(0); }
4575 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4577 $cat >try.msg <<'EOM'
4578 I've tried to compile and run the following simple program:
4581 $cat try.c >> try.msg
4583 $cat >> try.msg <<EOM
4590 and I got the following output:
4594 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4595 if $sh -c "$run ./try" >>try.msg 2>&1; then
4599 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4602 cat >> try.msg <<'EOQS'
4603 If $libs contains -lsfio, and sfio is mis-configured, then it
4604 sometimes (apparently) runs and exits with a 0 status, but with no
4605 output! It may have to do with sfio's use of _exit vs. exit.
4608 rp="You have a big problem. Shall I abort Configure"
4615 echo "The program compiled OK, but exited with status $?." >>try.msg
4616 rp="You have a problem. Shall I abort Configure"
4620 echo "I can't compile the test program." >>try.msg
4621 rp="You have a BIG problem. Shall I abort Configure"
4627 case "$knowitall" in
4629 echo "(The supplied flags or libraries might be incorrect.)"
4637 *) echo "Ok. Stopping Configure." >&4
4642 n) echo "OK, that should do.";;
4644 $rm -f try try.* core
4646 : define a shorthand compile call
4650 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4651 : define a shorthand compile call for compilations that should be ok.
4655 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4657 : check for lengths of integral types
4661 echo "Checking to see how big your integers are..." >&4
4662 $cat >try.c <<'EOCP'
4666 printf("intsize=%d;\n", (int)sizeof(int));
4667 printf("longsize=%d;\n", (int)sizeof(long));
4668 printf("shortsize=%d;\n", (int)sizeof(short));
4673 if eval $compile_ok && $run ./try > /dev/null; then
4675 echo "Your integers are $intsize bytes long."
4676 echo "Your long integers are $longsize bytes long."
4677 echo "Your short integers are $shortsize bytes long."
4681 Help! I can't compile and run the intsize test program: please enlighten me!
4682 (This is probably a misconfiguration in your system or libraries, and
4683 you really ought to fix it. Still, I'll try anyway.)
4687 rp="What is the size of an integer (in bytes)?"
4691 rp="What is the size of a long integer (in bytes)?"
4695 rp="What is the size of a short integer (in bytes)?"
4703 : check for void type
4705 echo "Checking to see how well your C compiler groks the void type..." >&4
4706 case "$voidflags" in
4708 $cat >try.c <<'EOCP'
4714 extern void moo(); /* function returning void */
4715 void (*goo)(); /* ptr to func returning void */
4717 void *hue; /* generic ptr */
4730 int main() { sub(); }
4732 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4733 voidflags=$defvoidused
4734 echo "Good. It appears to support void to the level $package wants.">&4
4735 if $contains warning .out >/dev/null 2>&1; then
4736 echo "However, you might get some warnings that look like this:"
4740 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4741 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4742 echo "It supports 1..."
4743 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4744 echo "It also supports 2..."
4745 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4747 echo "And it supports 4 but not 8 definitely."
4749 echo "It doesn't support 4..."
4750 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then