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 Jul 12 07:32:38 EET DST 2001 [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
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
478 d_old_pthread_create_joinable=''
479 old_pthread_create_joinable=''
566 d_stdio_ptr_lval_nochange_cnt=''
567 d_stdio_ptr_lval_sets_cnt=''
750 inc_version_list_init=''
769 ignore_versioned_solibs=''
828 d_perl_otherlibdirs=''
842 version_patchlevel_string=''
847 d_nv_preserves_uv_bits=''
946 d_stdio_stream_array=''
947 stdio_stream_array=''
957 ccflags_uselargefiles=''
958 ldflags_uselargefiles=''
959 libswanted_uselargefiles=''
1005 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1008 : We must find out about Eunice early
1010 if test -f /etc/unixtovms; then
1011 eunicefix=/etc/unixtovms
1013 if test -f /etc/unixtovms.exe; then
1014 eunicefix=/etc/unixtovms.exe
1021 : set useposix=false in your hint file to disable the POSIX extension.
1023 : set useopcode=false in your hint file to disable the Opcode extension.
1025 : Trailing extension. Override this in a hint file, if needed.
1027 : Extra object files, if any, needed on this platform.
1030 : Possible local include directories to search.
1031 : Set locincpth to "" in a hint file to defeat local include searches.
1032 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1033 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1035 : no include file wanted by default
1040 : change the next line if compiling for Xenix/286 on Xenix/386
1041 xlibpth='/usr/lib/386 /lib/386'
1042 : Possible local library directories to search.
1043 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1044 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1046 : general looking path for locating libraries
1047 glibpth="/lib /usr/lib $xlibpth"
1048 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1049 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1050 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1052 : Private path used by Configure to find libraries. Its value
1053 : is prepended to libpth. This variable takes care of special
1054 : machines, like the mips. Usually, it should be empty.
1057 : default library list
1059 : some systems want to use only the non-versioned libso:s
1060 ignore_versioned_solibs=''
1062 ccflags_uselargefiles=''
1063 ldflags_uselargefiles=''
1064 libswanted_uselargefiles=''
1065 : set usemultiplicity on the Configure command line to enable multiplicity.
1066 : set usesocks on the Configure command line to enable socks.
1067 : set usethreads on the Configure command line to enable threads.
1068 usereentrant='undef'
1069 : full support for void wanted by default
1072 : List of libraries we want.
1073 : If anyone needs -lnet, put it in a hint file.
1074 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1075 libswanted="$libswanted dld ld sun m c cposix posix"
1076 libswanted="$libswanted ndir dir crypt sec"
1077 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1078 : We probably want to search /usr/shlib before most other libraries.
1079 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1080 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1081 glibpth="/usr/shlib $glibpth"
1082 : Do not use vfork unless overridden by a hint file.
1085 : Find the basic shell for Bourne shell scripts
1089 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1092 if test -f "$xxx"; then
1095 : Build up a list and do a single loop so we can 'break' out.
1096 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1097 for xxx in sh bash ksh pdksh ash; do
1099 try="$try ${p}/${xxx}"
1103 if test -f "$xxx"; then
1106 elif test -f "$xxx.exe"; then
1117 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1119 Usually it's in /bin/sh. How did you even get this far?
1120 Please contact me (Perl Maintainers) at perlbug@perl.org and
1121 we'll try to straighten this all out.
1127 : see if sh knows # comments
1128 if `$sh -c '#' >/dev/null 2>&1`; then
1132 test -f $xcat || xcat=/usr/bin/cat
1133 echo "#!$xcat" >sharp
1137 if test -s today; then
1140 echo "#! $xcat" > sharp
1144 if test -s today; then
1152 echo "Your $sh doesn't grok # comments--I will strip them later on."
1155 echo "exec grep -v '^[ ]*#'" >spitshell
1157 $eunicefix spitshell
1158 spitshell=`pwd`/spitshell
1160 echo "I presume that if # doesn't work, #! won't work either!"
1165 : figure out how to guarantee sh startup
1167 '') startsh=${sharpbang}${sh} ;;
1179 : echo "Yup, it does."
1181 echo "Hmm... '$startsh' does not guarantee sh startup..."
1182 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1187 : Save command line options in file UU/cmdline.opt for later use in
1188 : generating config.sh.
1189 cat > cmdline.opt <<EOSH
1190 # Configure command line arguments.
1199 cat >>cmdline.opt <<EOSH
1200 config_arg$argn='$arg'
1202 # Extreme backslashitis: replace each ' by '"'"'
1203 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1206 arg_exp=`cat cmdl.opt`
1207 args_exp="$args_exp$args_sep'$arg_exp'"
1208 argn=`expr $argn + 1`
1211 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1212 # used by ./hints/os2.sh
1215 : produce awk script to parse command line options
1216 cat >options.awk <<'EOF'
1218 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1220 len = length(optstr);
1221 for (i = 1; i <= len; i++) {
1222 c = substr(optstr, i, 1);
1223 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1234 if (substr(str, 1, 1) != "-") {
1235 printf("'%s'\n", str);
1239 for (i = 2; i <= len; i++) {
1240 c = substr(str, i, 1);
1242 printf("-%s\n", substr(str, i));
1248 printf("'%s'\n", substr(str, i + 1));
1261 : process the command line options
1262 set X `for arg in "$@"; do echo "X$arg"; done |
1263 sed -e s/X// | awk -f options.awk`
1268 : set up default values
1278 rm -f optdef.sh posthint.sh
1279 cat >optdef.sh <<EOS
1285 while test $# -gt 0; do
1287 -d) shift; fastread=yes;;
1288 -e) shift; alldone=cont;;
1292 if test -r "$1"; then
1295 echo "$me: cannot read config file $1." >&2
1300 -h) shift; error=true;;
1301 -r) shift; reuseval=true;;
1302 -s) shift; silent=true; realsilent=true;;
1303 -E) shift; alldone=exit;;
1304 -K) shift; knowitall=true;;
1305 -O) shift; override=true;;
1306 -S) shift; silent=true; extractsh=true;;
1311 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1312 echo "$me: ignoring -D $1" >&2
1315 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1316 *) echo "$1='define'" >> optdef.sh;;
1323 *=) echo "$1" >> optdef.sh;;
1325 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1326 echo "$me: ignoring -U $1" >&2
1328 *) echo "$1='undef'" >> optdef.sh;;
1339 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1343 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1344 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1350 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1351 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1352 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1353 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1354 *) xxx=`echo $yyy|sed 's!:.*!!'`
1355 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1361 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1363 echo "$yyy=''" >> posthint.sh ;;
1368 echo "$yyy='$zzz'" >> posthint.sh ;;
1370 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1372 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1377 echo "$yyy=$zzz" >> posthint.sh ;;
1378 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1382 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1385 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1393 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1394 [-U symbol] [-U symbol=] [-A command:symbol...]
1395 -d : use defaults for all answers.
1396 -e : go on without questioning past the production of config.sh.
1397 -f : specify an alternate default configuration file.
1398 -h : print this help message and exit (with an error status).
1399 -r : reuse C symbols value if possible (skips costly nm extraction).
1400 -s : silent mode, only echoes questions and essential information.
1401 -D : define symbol to have some value:
1402 -D symbol symbol gets the value 'define'
1403 -D symbol=value symbol gets the value 'value'
1404 -E : stop at the end of questions, after having produced config.sh.
1405 -K : do not use unless you know what you are doing.
1406 -O : let -D and -U override definitions from loaded configuration file.
1407 -S : perform variable substitutions on all .SH files (can mix with -f)
1408 -U : undefine symbol:
1409 -U symbol symbol gets the value 'undef'
1410 -U symbol= symbol gets completely empty
1411 -A : manipulate symbol after the platform specific hints have been applied:
1412 -A symbol=value append " "value to symbol
1413 -A append:symbol=value append value to symbol
1414 -A define:symbol=value define symbol to have value
1415 -A clear:symbol define symbol to be ''
1416 -A define:symbol define symbol to be 'define'
1417 -A eval:symbol=value define symbol to be eval of value
1418 -A prepend:symbol=value prepend value to symbol
1419 -A undef:symbol define symbol to be 'undef'
1420 -A undef:symbol= define symbol to be ''
1421 -V : print version number and exit (with a zero status).
1428 case "$fastread$alldone" in
1431 case "$extractsh" in
1434 if test ! -t 0; then
1435 echo "Say 'sh Configure', not 'sh <Configure'"
1445 true) exec 1>/dev/null;;
1448 : run the defines and the undefines, if any, but leave the file out there...
1451 : create the posthint manipulation script and leave the file out there...
1456 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1457 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1458 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1459 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1460 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1463 : Some greps do not return status, grrr.
1464 echo "grimblepritz" >grimble
1465 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1467 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1473 : the following should work in any shell
1477 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1478 cat >contains <<'EOSS'
1479 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1484 : Find the path to the source tree
1487 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1491 *) src=`cd ../$src && pwd` ;;
1504 if test -f $rsrc/Configure && \
1505 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1507 : found it, so we are ok.
1510 for src in . .. ../.. ../../.. ../../../..; do
1511 if test -f ../$src/Configure && \
1512 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1523 Sorry, I can't seem to locate the source dir for $package. Please start
1524 Configure with an explicit path -- i.e. /some/path/Configure.
1532 echo "Sources for $package found in \"$src\"." >&4
1536 : script used to extract .SH files with variable substitutions
1537 cat >extract <<'EOS'
1539 echo "Doing variable substitutions on .SH files..."
1540 if test -f MANIFEST; then
1541 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1543 echo "(Looking for .SH files under the source directory.)"
1544 set x `(cd $src; find . -name "*.SH" -print)`
1548 0) set x `(cd $src; echo *.SH)`; shift;;
1550 if test ! -f $src/$1; then
1556 while test $name; do
1557 if test ! -d "$name"; then
1558 create="$name $create";
1559 name=`echo $name | sed -e "s|^[^/]*$||"`;
1560 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1565 for file in $create; do
1574 dir=`expr X$file : 'X\(.*\)/'`
1575 file=`expr X$file : 'X.*/\(.*\)'`
1576 (cd $dir && . ./$file)
1586 dir=`expr X$file : 'X\(.*\)/'`
1587 file=`expr X$file : 'X.*/\(.*\)'`
1588 (set x $dir; shift; eval $mkdir_p)
1598 if test -f $src/config_h.SH; then
1599 if test ! -f config.h; then
1600 : oops, they left it out of MANIFEST, probably, so do it anyway.
1606 : extract files and exit if asked to do so
1607 case "$extractsh" in
1609 case "$realsilent" in
1613 case "$config_sh" in
1614 '') config_sh='config.sh';;
1617 echo "Fetching answers from $config_sh..."
1620 test "$override" && . ./optdef.sh
1624 echo "Extraction done."
1629 : Eunice requires " " instead of "", can you believe it
1632 echo "Beginning of configuration questions for $package."
1634 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1636 : first determine how to suppress newline on echo command
1638 echo "Checking echo to see how to suppress newlines..."
1639 (echo "hi there\c" ; echo " ") >.echotmp
1640 if $contains c .echotmp >/dev/null 2>&1 ; then
1651 echo $n "The star should be here-->$c"
1655 : Now test for existence of everything in MANIFEST
1657 if test -f $rsrc/MANIFEST; then
1658 echo "First let's make sure your kit is complete. Checking..." >&4
1659 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1662 for filelist in x??; do
1663 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1665 if test -s missing; then
1669 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1671 You have the option of continuing the configuration process, despite the
1672 distinct possibility that your kit is damaged, by typing 'y'es. If you
1673 do, don't blame me if something goes wrong. I advise you to type 'n'o
1674 and contact the author (perlbug@perl.org).
1677 echo $n "Continue? [n] $c" >&4
1681 echo "Continuing..." >&4
1685 echo "ABORTING..." >&4
1690 echo "Looks good..."
1693 echo "There is no MANIFEST file. I hope your kit is complete !"
1698 : Find the appropriate value for a newline for tr
1699 if test -n "$DJGPP"; then
1702 if test X"$trnl" = X; then
1703 case "`echo foo|tr '\n' x 2>/dev/null`" in
1707 if test X"$trnl" = X; then
1708 case "`echo foo|tr '\012' x 2>/dev/null`" in
1709 foox) trnl='\012' ;;
1712 if test X"$trnl" = X; then
1715 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1721 : compute the number of columns on the terminal for proper question formatting
1726 : set up the echo used in my read
1727 myecho="case \"\$xxxm\" in
1728 '') echo $n \"\$rp $c\" >&4;;
1730 '') echo $n \"[\$xxxm] $c\";;
1732 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1734 echo $n \"[\$xxxm] $c\" >&4
1736 echo $n \"\$rp [\$xxxm] $c\" >&4
1742 : now set up to do reads with possible shell escape and default assignment
1748 case "\$fastread" in
1749 yes) case "\$dflt" in
1752 case "\$silent-\$rp" in
1757 *) case "\$silent" in
1758 true) case "\$rp" in
1763 while expr "X\$ans" : "X!" >/dev/null; do
1767 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1775 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1784 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1789 echo "(OK, I'll run with -d after this question.)" >&4
1792 echo "*** Sorry, \$1 not supported yet." >&4
1802 echo "*** Substitution done -- please confirm."
1804 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1809 echo "*** Error -- try again."
1816 case "\$ans\$xxxm\$nostick" in
1828 : create .config dir to save info across Configure sessions
1829 test -d ../.config || mkdir ../.config
1830 cat >../.config/README <<EOF
1831 This directory created by Configure to save information that should
1832 persist across sessions for $package.
1834 You may safely delete it if you wish.
1837 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1839 $define|true|[yY]*) ;;
1840 *) case "$xversion" in
1843 *** WHOA THERE!!! ***
1845 This is an UNSTABLE DEVELOPMENT release.
1846 The version of this $package distribution is $xversion, that is, odd,
1847 (as opposed to even) and that signifies a development release.
1848 If you want a maintenance release, you want an even-numbered version.
1850 Do ***NOT*** install this into production use.
1851 Data corruption and crashes are possible.
1853 It is most seriously suggested that you do not continue any further
1854 unless you want to help in developing and debugging Perl.
1856 If you *still* want to build perl, you can answer 'y' now,
1857 or pass -Dusedevel to Configure.
1860 rp='Do you really want to continue?'
1864 [yY]) echo >&4 "Okay, continuing."
1865 usedevel="$define" ;;
1866 *) echo >&4 "Okay, bye."
1876 case "$versiononly" in
1877 '') versiononly="$define" ;;
1879 case "$installusrbinperl" in
1880 '') installusrbinperl="$undef" ;;
1885 : general instructions
1888 user=`(logname) 2>/dev/null`
1890 '') user=`whoami 2>&1`;;
1892 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1895 rp='Would you like to see the instructions?'
1906 This installation shell script will examine your system and ask you questions
1907 to determine how the perl5 package should be installed. If you get
1908 stuck on a question, you may use a ! shell escape to start a subshell or
1909 execute a command. Many of the questions will have default answers in square
1910 brackets; typing carriage return will give you the default.
1912 On some of the questions which ask for file or directory names you are allowed
1913 to use the ~name construct to specify the login directory belonging to "name",
1914 even if you don't have a shell which knows about that. Questions where this is
1915 allowed will be marked "(~name ok)".
1919 dflt='Type carriage return to continue'
1923 The prompter used in this script allows you to use shell variables and
1924 backticks in your answers. You may use $1, $2, etc... to refer to the words
1925 in the default answer, as if the default line was a set of arguments given to a
1926 script shell. This means you may also use $* to repeat the whole default line,
1927 so you do not have to re-type everything to add something to the default.
1929 Everytime there is a substitution, you will have to confirm. If there is an
1930 error (e.g. an unmatched backtick), the default answer will remain unchanged
1931 and you will be prompted again.
1933 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1934 the questions and use the computed defaults (or the previous answers if there
1935 was already a config.sh file). Type 'Configure -h' for a list of options.
1936 You may also start interactively and then answer '& -d' at any prompt to turn
1937 on the non-interactive behaviour for the remainder of the execution.
1943 Much effort has been expended to ensure that this shell script will run on any
1944 Unix system. If despite that it blows up on yours, your best bet is to edit
1945 Configure and run it again. If you can't run Configure for some reason,
1946 you'll have to generate a config.sh file by hand. Whatever problems you
1947 have, let me (perlbug@perl.org) know how I blew it.
1949 This installation script affects things in two ways:
1951 1) it may do direct variable substitutions on some of the files included
1953 2) it builds a config.h file for inclusion in C programs. You may edit
1954 any of these files as the need arises after running this script.
1956 If you make a mistake on a question, there is no easy way to back up to it
1957 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1958 files. Configure will offer to let you do this before it runs the SH files.
1961 dflt='Type carriage return to continue'
1963 case "$firsttime" in
1964 true) echo $user >>../.config/instruct;;
1968 : find out where common programs are
1970 echo "Locating common programs..." >&4
1983 if test -d \$dir/\$thing; then
1989 for thisthing in \$dir/\$thing; do
1990 : just loop through to pick last item
1992 if test -f \$thisthing; then
1995 elif test -f \$dir/\$thing.exe; then
1996 if test -n "$DJGPP"; then
1997 echo \$dir/\$thing.exe
1999 : on Eunice apparently
2051 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2052 pth="$pth /lib /usr/lib"
2053 for file in $loclist; do
2057 if test -f "$xxx"; then
2060 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2061 xxx=`./loc $file $file $pth`
2064 '') xxx=`./loc $file $file $pth`;;
2065 *) xxx=`./loc $xxx $xxx $pth`;;
2071 echo $file is in $xxx.
2074 echo $file is in $xxx.
2077 echo "I don't know where '$file' is, and my life depends on it." >&4
2078 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2084 echo "Don't worry if any of the following aren't found..."
2086 for file in $trylist; do
2090 if test -f "$xxx"; then
2093 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2094 xxx=`./loc $file $file $pth`
2097 '') xxx=`./loc $file $file $pth`;;
2098 *) xxx=`./loc $xxx $xxx $pth`;;
2104 echo $file is in $xxx.
2107 echo $file is in $xxx.
2110 echo "I don't see $file out there, $say."
2117 echo "Substituting grep for egrep."
2123 echo "Substituting cp for ln."
2129 echo "Hopefully test is built into your sh."
2132 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2133 echo "Using the test built into your sh."
2141 echo "Hopefully echo is built into your sh."
2146 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2147 $echo $n "hi there$c" >foo1
2148 echo $n "hi there$c" >foo2
2149 if cmp foo1 foo2 >/dev/null 2>&1; then
2150 echo "They are compatible. In fact, they may be identical."
2157 They are not compatible! You are probably running ksh on a non-USG system.
2158 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2159 have echo built in and we may have to run some Bourne shell scripts. That
2160 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2163 $echo $n "The star should be here-->$c"
2173 cat <<'EOSC' >>checkcc
2178 int main(int argc, char *argv[]) {
2182 if $cc -o try $ccflags $ldflags try.c; then
2185 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2191 case "`$cc -v -c try.c 2>&1`" in
2194 if $test X"$trygcc" = Xyes; then
2195 if gcc -o try -c try.c; then
2197 echo "You seem to have a working gcc, though." >&4
2198 rp="Would you like to use it?"
2200 if $test -f myread; then
2203 if $test -f UU/myread; then
2206 echo "Cannot find myread, sorry. Aborting." >&2
2211 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2215 if $test X"$despair" = Xyes; then
2217 You need to find a working C compiler.
2218 Either (purchase and) install the C compiler supplied by your OS vendor,
2219 or for a free C compiler try http://gcc.gnu.org/
2220 I cannot continue any further, aborting.
2230 : determine whether symbolic links are supported
2233 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2234 echo "Symbolic links are supported." >&4
2237 echo "Symbolic links are NOT supported." >&4
2242 : determine whether symbolic links are supported
2246 echo "Checking how to test for symbolic links..." >&4
2248 if $test "X$issymlink" = X; then
2249 sh -c "PATH= test -h sym" >/dev/null 2>&1
2250 if test $? = 0; then
2254 if $test "X$issymlink" = X; then
2255 if $test -h >/dev/null 2>&1; then
2256 issymlink="$test -h"
2257 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2260 if $test "X$issymlink" = X; then
2261 if $test -L sym 2>/dev/null; then
2262 issymlink="$test -L"
2265 if $test "X$issymlink" != X; then
2266 echo "You can test for symbolic links with '$issymlink'." >&4
2268 echo "I do not know how you can test for symbolic links." >&4
2272 *) echo "No symbolic links, so not testing for their testing..." >&4
2278 case "$mksymlinks" in
2281 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2284 *) case "$lns:$issymlink" in
2285 *"ln -s:"*"test -"?)
2286 echo "Creating the symbolic links..." >&4
2287 echo "(First creating the subdirectories...)" >&4
2289 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2291 test -z "$directory" && break
2295 if test ! -d t/base; then
2296 echo "Failed to create the subdirectories. Aborting." >&4
2299 echo "(Then creating the symlinks...)" >&4
2300 awk '{print $1}' $src/MANIFEST | while true; do
2302 test -z "$filename" && break
2303 if test -f $filename; then
2304 if $issymlink $filename; then
2308 if test -f $filename; then
2309 echo "$filename already exists, not symlinking."
2311 ln -s $src/$filename $filename
2315 if test ! -f t/base/commonsense.t; then
2316 echo "Failed to create the symlinks. Aborting." >&4
2321 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2330 case "$usecrosscompile" in
2332 $echo "Cross-compiling..."
2335 *-*-gcc) # A cross-compiling gcc, probably.
2336 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2338 # leave out ld, choosing it is more complex
2340 ranlib=$targetarch-ranlib
2341 $echo 'extern int foo;' > try.c
2342 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2344 if $test $# -gt 0; then
2346 incpth="`$echo $incpth|$sed 's/^ //'`"
2347 echo "Guessing incpth '$incpth'." >&4
2349 j="`$echo $i|$sed 's,/include$,/lib,'`"
2350 if $test -d $j; then
2354 libpth="`$echo $libpth|$sed 's/^ //'`"
2355 echo "Guessing libpth '$libpth'." >&4
2360 case "$targetarch" in
2361 '') echo "Targetarch not defined." >&4; croak=y ;;
2362 *) echo "Using targetarch $targetarch." >&4 ;;
2365 '') echo "Incpth not defined." >&4; croak=y ;;
2366 *) echo "Using incpth '$incpth'." >&4 ;;
2369 '') echo "Libpth not defined." >&4; croak=y ;;
2370 *) echo "Using libpth '$libpth'." >&4 ;;
2373 '') for i in $incpth; do
2374 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2376 echo "Guessing usrinc $usrinc." >&4
2381 '') echo "Usrinc not defined." >&4; croak=y ;;
2384 *) echo "Using usrinc $usrinc." >&4 ;;
2386 case "$targethost" in
2387 '') echo "Targethost not defined." >&4; croak=y ;;
2388 *) echo "Using targethost $targethost." >&4
2393 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2396 /*) run=$src/Cross/run
2397 targetmkdir=$src/Cross/mkdir
2399 from=$src/Cross/from
2401 *) pwd=`$test -f ../Configure & cd ..; pwd`
2403 targetmkdir=$pwd/Cross/mkdir
2405 from=$pwd/Cross/from
2408 case "$targetrun" in
2409 '') targetrun=ssh ;;
2414 case "$targetfrom" in
2415 '') targetfrom=scp ;;
2419 from=$from-$targetfrom
2420 case "$targetdir" in
2422 echo "Guessing targetdir $targetdir." >&4
2425 case "$targetuser" in
2427 echo "Guessing targetuser $targetuser." >&4
2430 case "$targetfrom" in
2434 case "$targetrun" in
2446 '') cwd=$targetdir ;;
2450 if $test ! -f \$exe.xok; then
2454 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2457 *) echo "Unknown targetrun '$targetrun'" >&4
2461 case "$targetmkdir" in
2463 cat >$targetmkdir <<EOF
2465 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2467 $chmod a+rx $targetmkdir
2469 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2481 $targetmkdir \`dirname \$f\`
2482 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2485 $targetmkdir $targetdir/\`dirname \$f\`
2486 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2499 $mkdir -p $targetdir/\`dirname \$f\`
2500 $cp \$f $targetdir/\$f || exit 1
2503 $targetmkdir $targetdir/\`dirname \$f\`
2504 $cp \$f $targetdir/\$f || exit 1
2511 *) echo "Unknown targetto '$targetto'" >&4
2515 case "$targetfrom" in
2522 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2527 cp) cat >$from <<EOF
2532 cp $targetdir/\$f . || exit 1
2537 *) echo "Unknown targetfrom '$targetfrom'" >&4
2541 if $test ! -f $run; then
2542 echo "Target 'run' script '$run' not found." >&4
2546 if $test ! -f $to; then
2547 echo "Target 'to' script '$to' not found." >&4
2551 if $test ! -f $from; then
2552 echo "Target 'from' script '$from' not found." >&4
2556 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2560 Using '$run' for remote execution,
2561 and '$from' and '$to'
2562 for remote file transfer.
2568 usecrosscompile='undef'
2573 : see whether [:lower:] and [:upper:] are supported character classes
2575 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2577 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2581 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2582 # (0xc9 and 0xd1), therefore that is a nice testing point.
2583 if test "X$up" = X -o "X$low" = X; then
2584 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2590 if test "X$up" = X -o "X$low" = X; then
2591 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2597 if test "X$up" = X -o "X$low" = X; then
2598 case "`echo IJ | od -x 2>/dev/null`" in
2600 echo "Hey, this might be EBCDIC." >&4
2601 if test "X$up" = X -o "X$low" = X; then
2602 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2603 ij) up='[A-IJ-RS-Z]'
2608 if test "X$up" = X -o "X$low" = X; then
2609 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2619 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2621 echo "Using $up and $low to convert case." >&4
2624 echo "I don't know how to translate letters from upper to lower case." >&4
2625 echo "Your tr is not acting any way I know of." >&4
2629 : set up the translation script tr, must be called with ./tr of course
2633 '[A-Z][a-z]') exec $tr '$up' '$low';;
2634 '[a-z][A-Z]') exec $tr '$low' '$up';;
2641 : Try to determine whether config.sh was made on this system
2642 case "$config_sh" in
2644 myuname=`$uname -a 2>/dev/null`
2645 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2646 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2647 # because the A-Z/a-z are not consecutive.
2648 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2649 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2650 newmyuname="$myuname"
2652 case "$knowitall" in
2654 if test -f ../config.sh; then
2655 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2656 eval "`grep myuname= ../config.sh`"
2658 if test "X$myuname" = "X$newmyuname"; then
2666 : Get old answers from old config file if Configure was run on the
2667 : same system, otherwise use the hints.
2670 if test -f config.sh; then
2672 rp="I see a config.sh file. Shall I use it to set the defaults?"
2675 n*|N*) echo "OK, I'll ignore it."
2676 mv config.sh config.sh.old
2677 myuname="$newmyuname"
2679 *) echo "Fetching default answers from your old config.sh file..." >&4
2687 : Older versions did not always set $sh. Catch re-use of such
2697 if test ! -f config.sh; then
2700 First time through, eh? I have some defaults handy for some systems
2701 that need some extra help getting the Configure answers right:
2704 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2706 : Half the following guesses are probably wrong... If you have better
2707 : tests or hints, please send them to perlbug@perl.org
2708 : The metaconfig authors would also appreciate a copy...
2709 $test -f /irix && osname=irix
2710 $test -f /xenix && osname=sco_xenix
2711 $test -f /dynix && osname=dynix
2712 $test -f /dnix && osname=dnix
2713 $test -f /lynx.os && osname=lynxos
2714 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2715 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2716 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2717 $test -f /bin/mips && /bin/mips && osname=mips
2718 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2719 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2720 $test -d /usr/apollo/bin && osname=apollo
2721 $test -f /etc/saf/_sactab && osname=svr4
2722 $test -d /usr/include/minix && osname=minix
2723 if $test -d /MachTen -o -d /MachTen_Folder; then
2725 if $test -x /sbin/version; then
2726 osvers=`/sbin/version | $awk '{print $2}' |
2727 $sed -e 's/[A-Za-z]$//'`
2728 elif $test -x /usr/etc/version; then
2729 osvers=`/usr/etc/version | $awk '{print $2}' |
2730 $sed -e 's/[A-Za-z]$//'`
2736 $test -f /sys/posix.dll &&
2737 $test -f /usr/bin/what &&
2738 set X `/usr/bin/what /sys/posix.dll` &&
2739 $test "$3" = UWIN &&
2743 if $test -f $uname; then
2751 umips) osname=umips ;;
2754 [23]100) osname=mips ;;
2755 next*) osname=next ;;
2757 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2758 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2761 elif $test -f /etc/kconfig; then
2763 if test "$lns" = "$ln -s"; then
2765 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2767 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2774 if test -n "$DJGPP"; then
2783 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2785 'not found') osvers="$4"."$3" ;;
2786 '<3240'|'<>3240') osvers=3.2.0 ;;
2787 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2788 '=3250'|'>3250') osvers=3.2.5 ;;
2792 bsd386) osname=bsd386
2795 cygwin*) osname=cygwin
2798 *dc.osx) osname=dcosx
2804 domainos) osname=apollo
2810 dynixptx*) osname=dynixptx
2811 osvers=`echo "$4"|sed 's/^v//'`
2813 freebsd) osname=freebsd
2815 genix) osname=genix ;;
2817 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2833 netbsd*) osname=netbsd
2836 news-os) osvers="$3"
2838 4*) osname=newsos4 ;;
2842 next*) osname=next ;;
2843 nonstop-ux) osname=nonstopux ;;
2844 POSIX-BC | posix-bc ) osname=posix-bc
2847 powerux | power_ux | powermax_os | powermaxos | \
2848 powerunix | power_unix) osname=powerux
2854 solaris) osname=solaris
2856 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2863 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2867 titanos) osname=titanos
2876 ultrix) osname=ultrix
2879 osf1|mls+) case "$5" in
2882 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2885 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2888 hp*) osname=hp_osf1 ;;
2889 mips) osname=mips_osf1 ;;
2892 unixware) osname=svr5
2898 $2) case "$osname" in
2902 : svr4.x or possibly later
2912 if test -f /stand/boot ; then
2913 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2914 if test -n "$INITPROG" -a -f "$INITPROG"; then
2915 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2916 if test -n "$isesix"; then
2924 *) if test -f /etc/systemid; then
2926 set `echo $3 | $sed 's/\./ /g'` $4
2927 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2929 elif $test -f $src/hints/sco_$1_$2.sh; then
2931 elif $test -f $src/hints/sco_$1.sh; then
2936 '') : Still unknown. Probably a generic Sys V.
2945 *) case "$osname" in
2946 '') : Still unknown. Probably a generic BSD.
2954 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2955 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2956 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2959 $rm -f UU/kernel.what
2960 elif test -d c:/.; then
2967 case "$targetarch" in
2970 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
2975 : Now look for a hint file osname_osvers, unless one has been
2976 : specified already.
2979 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2980 : Also try without trailing minor version numbers.
2981 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2982 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2983 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2984 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2987 *) case "$osvers" in
2990 *) if $test -f $src/hints/$file.sh ; then
2992 elif $test -f $src/hints/$xfile.sh ; then
2994 elif $test -f $src/hints/$xxfile.sh ; then
2996 elif $test -f $src/hints/$xxxfile.sh ; then
2998 elif $test -f $src/hints/$xxxxfile.sh ; then
3000 elif $test -f "$src/hints/${osname}.sh" ; then
3009 if $test -f Policy.sh ; then
3012 none) dflt="Policy" ;;
3013 *) dflt="Policy $dflt" ;;
3018 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3022 if $test -f Policy.sh ; then
3025 There's also a Policy hint file available, which should make the
3026 site-specific (policy) questions easier to answer.
3033 You may give one or more space-separated answers, or "none" if appropriate.
3034 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3035 is a good thing. DO NOT give a wrong version or a wrong OS.
3039 rp="Which of these apply, if any?"
3042 for file in $tans; do
3043 if $test X$file = XPolicy -a -f Policy.sh; then
3045 $cat Policy.sh >> UU/config.sh
3046 elif $test -f $src/hints/$file.sh; then
3047 . $src/hints/$file.sh
3048 $cat $src/hints/$file.sh >> UU/config.sh
3049 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3052 : Give one chance to correct a possible typo.
3053 echo "$file.sh does not exist"
3055 rp="hint to use instead?"
3057 for file in $ans; do
3058 if $test -f "$src/hints/$file.sh"; then
3059 . $src/hints/$file.sh
3060 $cat $src/hints/$file.sh >> UU/config.sh
3061 elif $test X$ans = X -o X$ans = Xnone ; then
3064 echo "$file.sh does not exist -- ignored."
3071 : Remember our hint file for later.
3072 if $test -f "$src/hints/$file.sh" ; then
3082 echo "Fetching default answers from $config_sh..." >&4
3086 cp $config_sh config.sh 2>/dev/null
3096 test "$override" && . ./optdef.sh
3098 : Restore computed paths
3099 for file in $loclist $trylist; do
3100 eval $file="\$_$file"
3105 Configure uses the operating system name and version to set some defaults.
3106 The default value is probably right if the name rings a bell. Otherwise,
3107 since spelling matters for me, either accept the default or answer "none"
3114 ''|' '|none) dflt=none ;;
3115 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3118 *) dflt="$osname" ;;
3120 rp="Operating system name?"
3124 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3130 ''|' '|none) dflt=none ;;
3131 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3132 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3134 ''|' ') dflt=none ;;
3139 *) dflt="$osvers" ;;
3141 rp="Operating system version?"
3151 : who configured the system
3152 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3153 cf_by=`(logname) 2>/dev/null`
3156 cf_by=`(whoami) 2>/dev/null`
3158 "") cf_by=unknown ;;
3162 : set up the script used to warn in case of inconsistency
3169 echo "*** WHOA THERE!!! ***" >&4
3170 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3171 rp=" Keep the $hint value?"
3174 y) td=$was; tu=$was;;
3178 : function used to set $1 to $val
3179 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3181 $define$undef) . ./whoa; eval "$var=\$td";;
3182 $undef$define) . ./whoa; eval "$var=\$tu";;
3183 *) eval "$var=$val";;
3186 case "$usethreads" in
3187 $define|true|[yY]*) dflt='y';;
3192 Perl can be built to take advantage of threads on some systems.
3193 To do so, Configure can be run with -Dusethreads.
3195 Note that threading is a highly experimental feature, and
3196 some known race conditions still remain. If you choose to try
3197 it, be very sure to not actually deploy it for production
3198 purposes. README.threads has more details, and is required
3199 reading if you enable threads.
3201 If this doesn't make any sense to you, just accept the default '$dflt'.
3203 rp='Build a threading Perl?'
3206 y|Y) val="$define" ;;
3212 case "$usethreads" in
3216 As of 5.5.640, Perl has two different internal threading implementations,
3217 the 5.005 version (5005threads) and an interpreter-based version
3218 (ithreads) that has one interpreter per thread. Both are very
3219 experimental. This arrangement exists to help developers work out
3220 which one is better.
3222 If you're a casual user, you probably don't want interpreter-threads
3223 at this time. There doesn't yet exist a way to create threads from
3224 within Perl in this model, i.e., "use Thread;" will NOT work.
3226 : Default to ithreads unless overridden on command line or with
3229 case "$use5005threads" in
3230 $define|true|[yY]*) dflt='n';;
3232 case "$useithreads" in
3233 $undef|false|[nN]*) dflt='n';;
3235 rp='Use interpreter-based ithreads?'
3238 y|Y) val="$define" ;;
3243 : Now set use5005threads to the opposite value.
3244 case "$useithreads" in
3245 $define) val="$undef" ;;
3252 useithreads="$undef"
3253 use5005threads="$undef"
3257 case "$useithreads$use5005threads" in
3261 You cannot have both the ithreads and the 5.005 threads enabled
3262 at the same time. Disabling the 5.005 threads since they are
3263 much less stable than the ithreads.
3266 use5005threads="$undef"
3270 case "$d_oldpthreads" in
3271 '') : Configure tests would be welcome here. For now, assume undef.
3273 *) val="$d_oldpthreads" ;;
3279 case "$usethreads" in
3280 "$define"|true|[yY]*)
3281 : Look for a hint-file generated 'call-back-unit'. If the
3282 : user has specified that a threading perl is to be built,
3283 : we may need to set or change some other defaults.
3284 if $test -f usethreads.cbu; then
3285 echo "Your platform has some specific hints for threaded builds, using them..."
3289 (Your platform doesn't have any specific hints for threaded builds.
3290 Assuming POSIX threads, then.)
3298 Perl can be built so that multiple Perl interpreters can coexist
3299 within the same Perl executable.
3302 case "$useithreads" in
3305 This multiple interpreter support is required for interpreter-based threads.
3309 *) case "$usemultiplicity" in
3310 $define|true|[yY]*) dflt='y';;
3314 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3315 rp='Build Perl for multiplicity?'
3318 y|Y) val="$define" ;;
3327 case "$usemorebits" in
3328 "$define"|true|[yY]*)
3329 use64bitint="$define"
3330 uselongdouble="$define"
3331 usemorebits="$define"
3333 *) usemorebits="$undef"
3337 : make some quick guesses about what we are up against
3339 $echo $n "Hmm... $c"
3349 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3350 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3352 echo "Looks kind of like an OSF/1 system, but we'll see..."
3354 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3355 xxx=`./loc addbib blurfl $pth`
3356 if $test -f $xxx; then
3357 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3361 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3362 echo "Looks kind of like an extended USG system, but we'll see..."
3364 echo "Looks kind of like a USG system, but we'll see..."
3368 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3369 echo "Looks kind of like a BSD system, but we'll see..."
3373 echo "Looks kind of like a Version 7 system, but we'll see..."
3376 case "$eunicefix" in
3379 There is, however, a strange, musty smell in the air that reminds me of
3380 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3384 : it so happens the Eunice I know will not run shell scripts in Unix format
3388 echo "Congratulations. You aren't running Eunice."
3392 : Detect OS2. The p_ variable is set above in the Head.U unit.
3393 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3394 : semicolon as a patch separator
3399 I have the feeling something is not exactly right, however...don't tell me...
3400 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3401 (Or you may be running DOS with DJGPP.)
3406 if test -f /xenix; then
3407 echo "Actually, this looks more like a XENIX system..."
3412 echo "It's not Xenix..."
3417 if test -f /venix; then
3418 echo "Actually, this looks more like a VENIX system..."
3425 echo "Nor is it Venix..."
3428 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3429 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3436 rp="Use which C compiler?"
3439 : Look for a hint-file generated 'call-back-unit'. Now that the
3440 : user has specified the compiler, we may need to set or change some
3442 if $test -f cc.cbu; then
3448 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3454 printf("%s\n", __VERSION__);
3456 printf("%s\n", "1");
3462 if $cc -o try $ccflags $ldflags try.c; then
3463 gccversion=`$run ./try`
3464 case "$gccversion" in
3465 '') echo "You are not using GNU cc." ;;
3466 *) echo "You are using GNU cc $gccversion."
3472 echo "*** WHOA THERE!!! ***" >&4
3473 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3474 case "$knowitall" in
3476 echo " You'd better start hunting for one and let me know about it." >&4
3482 case "$gccversion" in
3483 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3485 case "$gccversion" in
3486 '') gccosandvers='' ;;
3487 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3488 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3490 case "$gccosandvers" in
3491 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3492 $osname$osvers) ;; # looking good
3493 $osname*) cat <<EOM >&4
3495 *** WHOA THERE!!! ***
3497 Your gcc has not been compiled for the exact release of
3498 your operating system ($gccosandvers versus $osname$osvers).
3500 In general it is a good idea to keep gcc synchronized with
3501 the operating system because otherwise serious problems
3502 may ensue when trying to compile software, like Perl.
3504 I'm trying to be optimistic here, though, and will continue.
3505 If later during the configuration and build icky compilation
3506 problems appear (headerfile conflicts being the most common
3507 manifestation), I suggest reinstalling the gcc to match
3508 your operating system release.
3512 *) gccosandvers='' ;; # failed to parse, better be silent
3520 case "$gccversion" in
3522 *) case "$ccflags" in
3524 *) ccflags="$ccflags -Wall" ;;
3529 : decide how portable to be. Allow command line overrides.
3530 case "$d_portable" in
3532 *) d_portable="$define" ;;
3535 : set up shell script to do ~ expansion
3541 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3544 if $test -f /bin/csh; then
3545 /bin/csh -f -c "glob \$1"
3550 name=\`$expr x\$1 : '..\([^/]*\)'\`
3551 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3552 if $test ! -d "\$dir"; then
3554 echo "\$me: can't locate home directory for: \$name" >&2
3559 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3575 : now set up to get a file name
3579 cat <<'EOSC' >>getfile
3595 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3596 fn=`echo $fn | sed 's/(.*)//'`
3602 loc_file=`expr $fn : '.*:\(.*\)'`
3603 fn=`expr $fn : '\(.*\):.*'`
3611 */*) fullpath=true;;
3620 *e*) exp_file=true;;
3623 *p*) nopath_ok=true;;
3628 *d*) type='Directory';;
3629 *l*) type='Locate';;
3634 Locate) what='File';;
3639 case "$d_portable" in
3647 while test "$type"; do
3652 true) rp="$rp (~name ok)";;
3655 if test -f UU/getfile.ok && \
3656 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3675 value=`UU/filexp $ans`
3678 if test "$ans" != "$value"; then
3679 echo "(That expands to $value on this system.)"
3693 /*) value="$ansexp" ;;
3694 [a-zA-Z]:/*) value="$ansexp" ;;
3699 echo "I shall only accept a full path name, as in /bin/ls." >&4
3700 echo "Use a ! shell escape if you wish to check pathnames." >&4
3703 echo "Please give a full path name, starting with slash." >&4
3706 echo "Note that using ~name is ok provided it expands well." >&4
3719 for fp in $gfpth; do
3720 if test "X$fp" = X.; then
3725 if test -f "$pf"; then
3727 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3729 echo "($value is not a plain file, but that's ok.)"
3732 if test X"$type" = X; then
3739 for fp in $gfpth; do
3740 if test "X$fp" = X.; then
3745 direxp="$fp/$ansexp"
3747 if test -d "$direxp"; then
3755 if test -d "$ansexp"; then
3756 echo "(Looking for $loc_file in directory $value.)"
3757 value="$value/$loc_file"
3758 ansexp="$ansexp/$loc_file"
3760 if test -f "$ansexp"; then
3763 case "$nopath_ok" in
3764 true) case "$value" in
3766 *) echo "Assuming $value will be in people's path."
3782 if test "$fastread" = yes; then
3787 rp="$what $value doesn't exist. Use that name anyway?"
3806 test "X$gfpthkeep" != Xy && gfpth=""
3809 : What should the include directory be ?
3811 $echo $n "Hmm... $c"
3815 if $test -f /bin/mips && /bin/mips; then
3816 echo "Looks like a MIPS system..."
3817 $cat >usr.c <<'EOCP'
3818 #ifdef SYSTYPE_BSD43
3822 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3823 dflt='/bsd43/usr/include'
3827 mips_type='System V'
3829 $rm -f usr.c usr.out
3830 echo "and you're compiling with the $mips_type compiler and libraries."
3834 echo "Doesn't look like a MIPS system."
3844 case "$xxx_prompt" in
3847 rp='Where are the include files you want to use?'
3855 : see how we invoke the C preprocessor
3857 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3858 cat <<'EOT' >testcpp.c
3864 if test ! -f cppstdin; then
3865 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3866 # AIX cc -E doesn't show the absolute headerfile
3867 # locations but we'll cheat by using the -M flag.
3868 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
3870 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3873 echo "Keeping your $hint cppstdin wrapper."
3876 wrapper=`pwd`/cppstdin
3880 if $test "X$cppstdin" != "X" && \
3881 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3882 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3884 echo "You used to use $cppstdin $cppminus so we'll use that again."
3886 '') echo "But let's see if we can live without a wrapper..." ;;
3888 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3889 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3891 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3894 echo "(However, $cpprun $cpplast does not work, let's see...)"
3902 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3909 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3910 $cc -E <testcpp.c >testcpp.out 2>&1; \
3911 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3912 echo "Yup, it does."
3915 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3916 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3917 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3918 echo "Yup, it does."
3921 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3922 $cc -P <testcpp.c >testcpp.out 2>&1; \
3923 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3924 echo "Yipee, that works!"
3927 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3928 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3929 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3930 echo "At long last!"
3933 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3934 $cpp <testcpp.c >testcpp.out 2>&1; \
3935 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3939 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3940 $cpp - <testcpp.c >testcpp.out 2>&1; \
3941 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3942 echo "Hooray, it works! I was beginning to wonder."
3945 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3946 $wrapper <testcpp.c >testcpp.out 2>&1; \
3947 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3953 rp="No dice. I can't find a C preprocessor. Name one:"
3957 $x_cpp <testcpp.c >testcpp.out 2>&1
3958 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3959 echo "OK, that will do." >&4
3961 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3976 echo "Perhaps can we force $cc -E using a wrapper..."
3977 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3978 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3984 echo "Nope, we'll have to live without it..."
3998 "$wrapper"|'cppstdin') ;;
3999 *) $rm -f $wrapper;;
4001 $rm -f testcpp.c testcpp.out
4003 : Set private lib path
4006 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4011 '') dlist="$loclibpth $plibpth $glibpth";;
4012 *) dlist="$libpth";;
4015 : Now check and see which directories actually exist, avoiding duplicates
4019 if $test -d $xxx; then
4022 *) libpth="$libpth $xxx";;
4028 Some systems have incompatible or broken versions of libraries. Among
4029 the directories listed in the question below, please remove any you
4030 know not to be holding relevant libraries, and add any that are needed.
4031 Say "none" for none.
4042 rp="Directories to use for library searches?"
4049 : compute shared library extension
4052 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4062 On some systems, shared libraries may be available. Answer 'none' if
4063 you want to suppress searching of shared libraries for the remainder
4064 of this configuration.
4067 rp='What is the file extension used for shared libraries?'
4071 : Define several unixisms.
4072 : Hints files or command line option can be used to override them.
4073 : The convoluted testing is in case hints files set either the old
4076 '') case "$exe_ext" in
4078 *) _exe="$exe_ext" ;;
4083 '') case "$lib_ext" in
4090 '') case "$obj_ext" in
4097 '') case "$path_sep" in
4108 : Which makefile gets called first. This is used by make depend.
4109 case "$firstmakefile" in
4110 '') firstmakefile='makefile';;
4114 $define|true|[yY]*) dflt='y';;
4119 Perl can be built to use the SOCKS proxy protocol library. To do so,
4120 Configure must be run with -Dusesocks. If you use SOCKS you also need
4121 to use the PerlIO abstraction layer, this will be implicitly selected.
4123 If this doesn't make any sense to you, just accept the default '$dflt'.
4125 rp='Build Perl for SOCKS?'
4128 y|Y) val="$define" ;;
4135 $define|true|[yY]*) useperlio="$define";;
4138 : Looking for optional libraries
4140 echo "Checking for optional libraries..." >&4
4145 case "$libswanted" in
4146 '') libswanted='c_s';;
4149 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4155 for thisdir in $libpth $xlibpth; do
4156 test -d $thisdir && libspath="$libspath $thisdir"
4158 for thislib in $libswanted; do
4159 for thisdir in $libspath; do
4161 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4162 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
4163 $test -f "$xxx" && eval $libscheck
4164 $test -f "$xxx" && libstyle=shared
4166 if test ! -f "$xxx"; then
4167 xxx=$thisdir/lib$thislib.$so
4168 $test -f "$xxx" && eval $libscheck
4169 $test -f "$xxx" && libstyle=shared
4171 if test ! -f "$xxx"; then
4172 xxx=$thisdir/lib$thislib$_a
4173 $test -f "$xxx" && eval $libscheck
4174 $test -f "$xxx" && libstyle=static
4176 if test ! -f "$xxx"; then
4177 xxx=$thisdir/$thislib$_a
4178 $test -f "$xxx" && eval $libscheck
4179 $test -f "$xxx" && libstyle=static
4181 if test ! -f "$xxx"; then
4182 xxx=$thisdir/lib${thislib}_s$_a
4183 $test -f "$xxx" && eval $libscheck
4184 $test -f "$xxx" && libstyle=static
4185 $test -f "$xxx" && thislib=${thislib}_s
4187 if test ! -f "$xxx"; then
4188 xxx=$thisdir/Slib$thislib$_a
4189 $test -f "$xxx" && eval $libscheck
4190 $test -f "$xxx" && libstyle=static
4192 if $test -f "$xxx"; then
4194 shared) echo "Found -l$thislib (shared)." ;;
4195 static) echo "Found -l$thislib." ;;
4196 *) echo "Found -l$thislib ($libstyle)." ;;
4200 *) dflt="$dflt -l$thislib"
4201 libsfound="$libsfound $xxx"
4203 libsfiles="$libsfiles $yyy"
4204 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4205 case " $libsdirs " in
4207 *) libsdirs="$libsdirs $yyy" ;;
4214 if $test ! -f "$xxx"; then
4215 echo "No -l$thislib."
4226 ' '|'') dflt='none';;
4231 In order to compile $package on your machine, a number of libraries
4232 are usually needed. Include any other special libraries here as well.
4233 Say "none" for none. The default list is almost always right.
4237 rp="What libraries to use?"
4244 : determine optimization, if desired, or use for debug flag also
4246 ' '|$undef) dflt='none';;
4248 *) dflt="$optimize";;
4252 By default, $package compiles with the -O flag to use the optimizer.
4253 Alternately, you might want to use the symbolic debugger, which uses
4254 the -g flag (on traditional Unix systems). Either flag can be
4255 specified here. To use neither flag, specify the word "none".
4258 rp="What optimizer/debugger flag should be used?"
4262 'none') optimize=" ";;
4266 : We will not override a previous value, but we might want to
4267 : augment a hint file
4269 default|recommended)
4270 case "$gccversion" in
4271 1*) dflt='-fpcc-struct-return' ;;
4274 *-g*) dflt="$dflt -DDEBUGGING";;
4276 case "$gccversion" in
4277 2*) if test -d /etc/conf/kconfig.d &&
4278 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4284 case "$gccversion" in
4288 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4289 echo 'int main(void) { return 0; }' > gcctest.c
4290 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4291 echo "Yes, it does." 2>&1
4294 echo "Leaving current flags $ccflags alone." 2>&1
4296 *) dflt="$dflt -fno-strict-aliasing" ;;
4299 echo "Nope, it doesn't, but that's ok." 2>&1
4306 case "$mips_type" in
4307 *BSD*|'') inclwanted="$locincpth $usrinc";;
4308 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4310 for thisincl in $inclwanted; do
4311 if $test -d $thisincl; then
4312 if $test x$thisincl != x$usrinc; then
4314 *" -I$thisincl "*);;
4315 *) dflt="$dflt -I$thisincl ";;
4321 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4323 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4331 *) dflt="$dflt -D$2";;
4335 set signal.h LANGUAGE_C; eval $inctest
4339 ccflags="$ccflags -DSOCKS"
4344 default|recommended) dflt="$ccflags $dflt" ;;
4345 *) dflt="$ccflags";;
4354 Your C compiler may want other flags. For this question you should include
4355 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4356 but you should NOT include libraries or ld flags like -lwhatever. If you
4357 want $package to honor its debug switch, you should include -DDEBUGGING here.
4358 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4360 To use no flags, specify the word "none".
4366 rp="Any additional cc flags?"
4373 : the following weeds options from ccflags that are of no interest to cpp
4375 '') cppflags="$ccflags" ;;
4376 *) cppflags="$cppflags $ccflags" ;;
4378 case "$gccversion" in
4379 1*) cppflags="$cppflags -D__GNUC__"
4381 case "$mips_type" in
4383 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4389 echo "Let me guess what the preprocessor flags are..." >&4
4403 *) ftry="$previous $flag";;
4405 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4406 >cpp1.out 2>/dev/null && \
4407 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4408 >cpp2.out 2>/dev/null && \
4409 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4410 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4412 cppflags="$cppflags $ftry"
4422 *-*) echo "They appear to be: $cppflags";;
4424 $rm -f cpp.c cpp?.out
4428 : flags used in final linking phase
4430 '') if ./venix; then
4436 *-posix*) dflt="$dflt -posix" ;;
4439 *) dflt="$ldflags";;
4442 : Try to guess additional flags to pick up local libraries.
4443 for thislibdir in $libpth; do
4444 case " $loclibpth " in
4447 *"-L$thislibdir "*) ;;
4448 *) dflt="$dflt -L$thislibdir" ;;
4460 Your C linker may need flags. For this question you should
4461 include -L/whatever and any other flags used by the C linker, but you
4462 should NOT include libraries like -lwhatever.
4464 Make sure you include the appropriate -L/path flags if your C linker
4465 does not normally search all of the directories you specified above,
4468 To use no flags, specify the word "none".
4472 rp="Any additional ld flags (NOT including libraries)?"
4478 rmlist="$rmlist pdp11"
4482 echo "Checking your choice of C compiler and flags for coherency..." >&4
4483 $cat > try.c <<'EOF'
4485 int main() { printf("Ok\n"); exit(0); }
4487 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4489 $cat >try.msg <<'EOM'
4490 I've tried to compile and run the following simple program:
4493 $cat try.c >> try.msg
4495 $cat >> try.msg <<EOM
4502 and I got the following output:
4506 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4507 if $sh -c "$run ./try" >>try.msg 2>&1; then
4511 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4514 cat >> try.msg <<'EOQS'
4515 If $libs contains -lsfio, and sfio is mis-configured, then it
4516 sometimes (apparently) runs and exits with a 0 status, but with no
4517 output! It may have to do with sfio's use of _exit vs. exit.
4520 rp="You have a big problem. Shall I abort Configure"
4527 echo "The program compiled OK, but exited with status $?." >>try.msg
4528 rp="You have a problem. Shall I abort Configure"
4532 echo "I can't compile the test program." >>try.msg
4533 rp="You have a BIG problem. Shall I abort Configure"
4539 case "$knowitall" in
4541 echo "(The supplied flags or libraries might be incorrect.)"
4549 *) echo "Ok. Stopping Configure." >&4
4554 n) echo "OK, that should do.";;
4556 $rm -f try try.* core
4558 : define a shorthand compile call
4562 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4563 : define a shorthand compile call for compilations that should be ok.
4567 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4569 : check for lengths of integral types
4573 echo "Checking to see how big your integers are..." >&4
4574 $cat >try.c <<'EOCP'
4578 printf("intsize=%d;\n", (int)sizeof(int));
4579 printf("longsize=%d;\n", (int)sizeof(long));
4580 printf("shortsize=%d;\n", (int)sizeof(short));
4585 if eval $compile_ok && $run ./try > /dev/null; then
4587 echo "Your integers are $intsize bytes long."
4588 echo "Your long integers are $longsize bytes long."
4589 echo "Your short integers are $shortsize bytes long."
4593 Help! I can't compile and run the intsize test program: please enlighten me!
4594 (This is probably a misconfiguration in your system or libraries, and
4595 you really ought to fix it. Still, I'll try anyway.)
4599 rp="What is the size of an integer (in bytes)?"
4603 rp="What is the size of a long integer (in bytes)?"
4607 rp="What is the size of a short integer (in bytes)?"
4615 : check for void type
4617 echo "Checking to see how well your C compiler groks the void type..." >&4
4618 case "$voidflags" in
4620 $cat >try.c <<'EOCP'
4626 extern void moo(); /* function returning void */
4627 void (*goo)(); /* ptr to func returning void */
4629 void *hue; /* generic ptr */
4642 int main() { sub(); }
4644 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4645 voidflags=$defvoidused
4646 echo "Good. It appears to support void to the level $package wants.">&4
4647 if $contains warning .out >/dev/null 2>&1; then
4648 echo "However, you might get some warnings that look like this:"
4652 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4653 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4654 echo "It supports 1..."
4655 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4656 echo "It also supports 2..."
4657 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4659 echo "And it supports 4 but not 8 definitely."
4661 echo "It doesn't support 4..."
4662 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4664 echo "But it supports 8."
4667 echo "Neither does it support 8."
4671 echo "It does not support 2..."
4672 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4674 echo "But it supports 4 and 8."
4676 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4678 echo "And it supports 4 but has not heard about 8."
4680 echo "However it supports 8 but not 4."
4685 echo "There is no support at all for void."
4690 case "$voidflags" in
4693 Support flag bits are:
4694 1: basic void declarations.
4695 2: arrays of pointers to functions returning void.
4696 4: operations between pointers to and addresses of void functions.
4697 8: generic void pointers.
4700 rp="Your void support flags add up to what?"
4707 : check for length of pointer
4711 echo "Checking to see how big your pointers are..." >&4
4712 if test "$voidflags" -gt 7; then
4713 echo '#define VOID_PTR char *' > try.c
4715 echo '#define VOID_PTR void *' > try.c
4717 $cat >>try.c <<'EOCP'
4721 printf("%d\n", (int)sizeof(VOID_PTR));
4726 if eval $compile_ok; then
4727 ptrsize=`$run ./try`
4728 echo "Your pointers are $ptrsize bytes long."
4731 echo "(I can't seem to compile the test program. Guessing...)" >&4
4732 rp="What is the size of a pointer (in bytes)?"
4740 : check for long long
4742 echo "Checking to see if you have long long..." >&4
4743 echo 'int main() { long long x = 7; return 0; }' > try.c
4745 if eval $compile; then
4747 echo "You have long long."
4750 echo "You do not have long long."
4756 : check for length of long long
4757 case "${d_longlong}${longlongsize}" in
4760 echo "Checking to see how big your long longs are..." >&4
4761 $cat >try.c <<'EOCP'
4765 printf("%d\n", (int)sizeof(long long));
4770 if eval $compile_ok; then
4771 longlongsize=`$run ./try`
4772 echo "Your long longs are $longlongsize bytes long."