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 Feb 22 15:19:20 EET 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
465 d_old_pthread_create_joinable=''
466 old_pthread_create_joinable=''
545 d_stdio_ptr_lval_nochange_cnt=''
546 d_stdio_ptr_lval_sets_cnt=''
718 inc_version_list_init=''
737 ignore_versioned_solibs=''
796 d_perl_otherlibdirs=''
813 d_nv_preserves_uv_bits=''
912 d_stdio_stream_array=''
913 stdio_stream_array=''
923 ccflags_uselargefiles=''
924 ldflags_uselargefiles=''
925 libswanted_uselargefiles=''
970 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
973 : We must find out about Eunice early
975 if test -f /etc/unixtovms; then
976 eunicefix=/etc/unixtovms
978 if test -f /etc/unixtovms.exe; then
979 eunicefix=/etc/unixtovms.exe
986 : set useposix=false in your hint file to disable the POSIX extension.
988 : set useopcode=false in your hint file to disable the Opcode extension.
990 : Trailing extension. Override this in a hint file, if needed.
992 : Extra object files, if any, needed on this platform.
995 : Possible local include directories to search.
996 : Set locincpth to "" in a hint file to defeat local include searches.
997 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
998 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1000 : no include file wanted by default
1004 : change the next line if compiling for Xenix/286 on Xenix/386
1005 xlibpth='/usr/lib/386 /lib/386'
1006 : Possible local library directories to search.
1007 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1008 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1010 : general looking path for locating libraries
1011 glibpth="/lib /usr/lib $xlibpth"
1012 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1013 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1014 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1016 : Private path used by Configure to find libraries. Its value
1017 : is prepended to libpth. This variable takes care of special
1018 : machines, like the mips. Usually, it should be empty.
1021 : default library list
1023 : some systems want to use only the non-versioned libso:s
1024 ignore_versioned_solibs=''
1026 ccflags_uselargefiles=''
1027 ldflags_uselargefiles=''
1028 libswanted_uselargefiles=''
1029 : set usemultiplicity on the Configure command line to enable multiplicity.
1030 : set usesocks on the Configure command line to enable socks.
1031 : set usethreads on the Configure command line to enable threads.
1032 : full support for void wanted by default
1035 : List of libraries we want.
1036 : If anyone needs -lnet, put it in a hint file.
1037 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1038 libswanted="$libswanted dld ld sun m c cposix posix"
1039 libswanted="$libswanted ndir dir crypt sec"
1040 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1041 : We probably want to search /usr/shlib before most other libraries.
1042 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1043 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1044 glibpth="/usr/shlib $glibpth"
1045 : Do not use vfork unless overridden by a hint file.
1048 : Find the basic shell for Bourne shell scripts
1052 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1055 if test -f "$xxx"; then
1058 : Build up a list and do a single loop so we can 'break' out.
1059 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1060 for xxx in sh bash ksh pdksh ash; do
1062 try="$try ${p}/${xxx}"
1066 if test -f "$xxx"; then
1069 elif test -f "$xxx.exe"; then
1080 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1082 Usually it's in /bin/sh. How did you even get this far?
1083 Please contact me (Perl Maintainers) at perlbug@perl.org and
1084 we'll try to straighten this all out.
1090 : see if sh knows # comments
1091 if `$sh -c '#' >/dev/null 2>&1`; then
1095 test -f $xcat || xcat=/usr/bin/cat
1100 if test -s today; then
1103 echo "#! $xcat" > try
1107 if test -s today; then
1115 echo "Your $sh doesn't grok # comments--I will strip them later on."
1118 echo "exec grep -v '^[ ]*#'" >spitshell
1120 $eunicefix spitshell
1121 spitshell=`pwd`/spitshell
1123 echo "I presume that if # doesn't work, #! won't work either!"
1128 : figure out how to guarantee sh startup
1130 '') startsh=${sharpbang}${sh} ;;
1142 : echo "Yup, it does."
1144 echo "Hmm... '$startsh' does not guarantee sh startup..."
1145 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1150 : Save command line options in file UU/cmdline.opt for later use in
1151 : generating config.sh.
1152 cat > cmdline.opt <<EOSH
1153 # Configure command line arguments.
1160 cat >>cmdline.opt <<EOSH
1161 config_arg$argn='$arg'
1163 argn=`expr $argn + 1`
1166 : produce awk script to parse command line options
1167 cat >options.awk <<'EOF'
1169 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1171 len = length(optstr);
1172 for (i = 1; i <= len; i++) {
1173 c = substr(optstr, i, 1);
1174 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1185 if (substr(str, 1, 1) != "-") {
1186 printf("'%s'\n", str);
1190 for (i = 2; i <= len; i++) {
1191 c = substr(str, i, 1);
1193 printf("-%s\n", substr(str, i));
1199 printf("'%s'\n", substr(str, i + 1));
1212 : process the command line options
1213 set X `for arg in "$@"; do echo "X$arg"; done |
1214 sed -e s/X// | awk -f options.awk`
1219 : set up default values
1229 rm -f optdef.sh posthint.sh
1230 cat >optdef.sh <<EOS
1236 while test $# -gt 0; do
1238 -d) shift; fastread=yes;;
1239 -e) shift; alldone=cont;;
1243 if test -r "$1"; then
1246 echo "$me: cannot read config file $1." >&2
1251 -h) shift; error=true;;
1252 -r) shift; reuseval=true;;
1253 -s) shift; silent=true; realsilent=true;;
1254 -E) shift; alldone=exit;;
1255 -K) shift; knowitall=true;;
1256 -O) shift; override=true;;
1257 -S) shift; silent=true; extractsh=true;;
1262 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1263 echo "$me: ignoring -D $1" >&2
1266 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1267 *) echo "$1='define'" >> optdef.sh;;
1274 *=) echo "$1" >> optdef.sh;;
1276 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1277 echo "$me: ignoring -U $1" >&2
1279 *) echo "$1='undef'" >> optdef.sh;;
1290 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1294 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1295 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1301 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1302 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1303 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1304 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1305 *) xxx=`echo $yyy|sed 's!:.*!!'`
1306 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1312 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1314 echo "$yyy=''" >> posthint.sh ;;
1319 echo "$yyy='$zzz'" >> posthint.sh ;;
1321 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1323 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1328 echo "$yyy=$zzz" >> posthint.sh ;;
1329 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1333 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1336 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1344 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1345 [-U symbol] [-U symbol=] [-A command:symbol...]
1346 -d : use defaults for all answers.
1347 -e : go on without questioning past the production of config.sh.
1348 -f : specify an alternate default configuration file.
1349 -h : print this help message and exit (with an error status).
1350 -r : reuse C symbols value if possible (skips costly nm extraction).
1351 -s : silent mode, only echoes questions and essential information.
1352 -D : define symbol to have some value:
1353 -D symbol symbol gets the value 'define'
1354 -D symbol=value symbol gets the value 'value'
1355 -E : stop at the end of questions, after having produced config.sh.
1356 -K : do not use unless you know what you are doing.
1357 -O : let -D and -U override definitions from loaded configuration file.
1358 -S : perform variable substitutions on all .SH files (can mix with -f)
1359 -U : undefine symbol:
1360 -U symbol symbol gets the value 'undef'
1361 -U symbol= symbol gets completely empty
1362 -A : manipulate symbol after the platform specific hints have been applied:
1363 -A symbol=value append " "value to symbol
1364 -A append:symbol=value append value to symbol
1365 -A define:symbol=value define symbol to have value
1366 -A clear:symbol define symbol to be ''
1367 -A define:symbol define symbol to be 'define'
1368 -A eval:symbol=value define symbol to be eval of value
1369 -A prepend:symbol=value prepend value to symbol
1370 -A undef:symbol define symbol to be 'undef'
1371 -A undef:symbol= define symbol to be ''
1372 -V : print version number and exit (with a zero status).
1379 case "$fastread$alldone" in
1382 case "$extractsh" in
1385 if test ! -t 0; then
1386 echo "Say 'sh Configure', not 'sh <Configure'"
1396 true) exec 1>/dev/null;;
1399 : run the defines and the undefines, if any, but leave the file out there...
1402 : create the posthint manipulation script and leave the file out there...
1407 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1408 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1409 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1410 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1411 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1414 : Some greps do not return status, grrr.
1415 echo "grimblepritz" >grimble
1416 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1418 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1424 : the following should work in any shell
1428 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1429 cat >contains <<'EOSS'
1430 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1435 : Find the path to the source tree
1438 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1442 *) src=`cd ../$src && pwd` ;;
1455 if test -f $rsrc/Configure && \
1456 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1458 : found it, so we are ok.
1461 for src in . .. ../.. ../../.. ../../../..; do
1462 if test -f ../$src/Configure && \
1463 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1474 Sorry, I can't seem to locate the source dir for $package. Please start
1475 Configure with an explicit path -- i.e. /some/path/Configure.
1483 echo "Sources for $package found in \"$src\"." >&4
1487 : script used to extract .SH files with variable substitutions
1488 cat >extract <<'EOS'
1490 echo "Doing variable substitutions on .SH files..."
1491 if test -f $src/MANIFEST; then
1492 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1494 echo "(Looking for .SH files under the source directory.)"
1495 set x `(cd $src; find . -name "*.SH" -print)`
1499 0) set x `(cd $src; echo *.SH)`; shift;;
1501 if test ! -f $src/$1; then
1507 while test $name; do
1508 if test ! -d "$name"; then
1509 create="$name $create";
1510 name=`echo $name | sed -e "s|^[^/]*$||"`;
1511 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1516 for file in $create; do
1525 dir=`expr X$file : 'X\(.*\)/'`
1526 file=`expr X$file : 'X.*/\(.*\)'`
1527 (cd $dir && . ./$file)
1537 dir=`expr X$file : 'X\(.*\)/'`
1538 file=`expr X$file : 'X.*/\(.*\)'`
1539 (set x $dir; shift; eval $mkdir_p)
1549 if test -f $src/config_h.SH; then
1550 if test ! -f config.h; then
1551 : oops, they left it out of MANIFEST, probably, so do it anyway.
1557 : extract files and exit if asked to do so
1558 case "$extractsh" in
1560 case "$realsilent" in
1564 case "$config_sh" in
1565 '') config_sh='config.sh';;
1568 echo "Fetching answers from $config_sh..."
1571 test "$override" && . ./optdef.sh
1580 : Eunice requires " " instead of "", can you believe it
1583 echo "Beginning of configuration questions for $package."
1585 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1587 : first determine how to suppress newline on echo command
1589 echo "Checking echo to see how to suppress newlines..."
1590 (echo "hi there\c" ; echo " ") >.echotmp
1591 if $contains c .echotmp >/dev/null 2>&1 ; then
1602 echo $n "The star should be here-->$c"
1606 : Now test for existence of everything in MANIFEST
1608 if test -f $rsrc/MANIFEST; then
1609 echo "First let's make sure your kit is complete. Checking..." >&4
1610 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1613 for filelist in x??; do
1614 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1616 if test -s missing; then
1620 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1622 You have the option of continuing the configuration process, despite the
1623 distinct possibility that your kit is damaged, by typing 'y'es. If you
1624 do, don't blame me if something goes wrong. I advise you to type 'n'o
1625 and contact the author (perlbug@perl.org).
1628 echo $n "Continue? [n] $c" >&4
1632 echo "Continuing..." >&4
1636 echo "ABORTING..." >&4
1641 echo "Looks good..."
1644 echo "There is no MANIFEST file. I hope your kit is complete !"
1649 : Find the appropriate value for a newline for tr
1650 if test -n "$DJGPP"; then
1653 if test X"$trnl" = X; then
1654 case "`echo foo|tr '\n' x 2>/dev/null`" in
1658 if test X"$trnl" = X; then
1659 case "`echo foo|tr '\012' x 2>/dev/null`" in
1660 foox) trnl='\012' ;;
1663 if test X"$trnl" = X; then
1666 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1672 : compute the number of columns on the terminal for proper question formatting
1677 : set up the echo used in my read
1678 myecho="case \"\$xxxm\" in
1679 '') echo $n \"\$rp $c\" >&4;;
1681 '') echo $n \"[\$xxxm] $c\";;
1683 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1685 echo $n \"[\$xxxm] $c\" >&4
1687 echo $n \"\$rp [\$xxxm] $c\" >&4
1693 : now set up to do reads with possible shell escape and default assignment
1699 case "\$fastread" in
1700 yes) case "\$dflt" in
1703 case "\$silent-\$rp" in
1708 *) case "\$silent" in
1709 true) case "\$rp" in
1714 while expr "X\$ans" : "X!" >/dev/null; do
1718 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1726 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1735 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1740 echo "(OK, I'll run with -d after this question.)" >&4
1743 echo "*** Sorry, \$1 not supported yet." >&4
1753 echo "*** Substitution done -- please confirm."
1755 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1760 echo "*** Error -- try again."
1767 case "\$ans\$xxxm\$nostick" in
1779 : create .config dir to save info across Configure sessions
1780 test -d ../.config || mkdir ../.config
1781 cat >../.config/README <<EOF
1782 This directory created by Configure to save information that should
1783 persist across sessions for $package.
1785 You may safely delete it if you wish.
1788 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1790 $define|true|[yY]*) ;;
1791 *) case "$xversion" in
1794 *** WHOA THERE!!! ***
1796 This is an UNSTABLE DEVELOPMENT release.
1797 The version of this $package distribution is $xversion, that is, odd,
1798 (as opposed to even) and that signifies a development release.
1799 If you want a maintenance release, you want an even-numbered version.
1801 Do ***NOT*** install this into production use.
1802 Data corruption and crashes are possible.
1804 It is most seriously suggested that you do not continue any further
1805 unless you want to help in developing and debugging Perl.
1808 rp='Do you really want to continue?'
1812 [yY]) echo >&4 "Okay, continuing."
1813 usedevel="$define" ;;
1814 *) echo >&4 "Okay, bye."
1824 case "$versiononly" in
1825 '') versiononly="$define" ;;
1827 case "$installusrbinperl" in
1828 '') installusrbinperl="$undef" ;;
1833 : general instructions
1836 user=`(logname) 2>/dev/null`
1838 '') user=`whoami 2>&1`;;
1840 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1843 rp='Would you like to see the instructions?'
1854 This installation shell script will examine your system and ask you questions
1855 to determine how the perl5 package should be installed. If you get
1856 stuck on a question, you may use a ! shell escape to start a subshell or
1857 execute a command. Many of the questions will have default answers in square
1858 brackets; typing carriage return will give you the default.
1860 On some of the questions which ask for file or directory names you are allowed
1861 to use the ~name construct to specify the login directory belonging to "name",
1862 even if you don't have a shell which knows about that. Questions where this is
1863 allowed will be marked "(~name ok)".
1867 dflt='Type carriage return to continue'
1871 The prompter used in this script allows you to use shell variables and
1872 backticks in your answers. You may use $1, $2, etc... to refer to the words
1873 in the default answer, as if the default line was a set of arguments given to a
1874 script shell. This means you may also use $* to repeat the whole default line,
1875 so you do not have to re-type everything to add something to the default.
1877 Everytime there is a substitution, you will have to confirm. If there is an
1878 error (e.g. an unmatched backtick), the default answer will remain unchanged
1879 and you will be prompted again.
1881 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1882 the questions and use the computed defaults (or the previous answers if there
1883 was already a config.sh file). Type 'Configure -h' for a list of options.
1884 You may also start interactively and then answer '& -d' at any prompt to turn
1885 on the non-interactive behaviour for the remainder of the execution.
1891 Much effort has been expended to ensure that this shell script will run on any
1892 Unix system. If despite that it blows up on yours, your best bet is to edit
1893 Configure and run it again. If you can't run Configure for some reason,
1894 you'll have to generate a config.sh file by hand. Whatever problems you
1895 have, let me (perlbug@perl.org) know how I blew it.
1897 This installation script affects things in two ways:
1899 1) it may do direct variable substitutions on some of the files included
1901 2) it builds a config.h file for inclusion in C programs. You may edit
1902 any of these files as the need arises after running this script.
1904 If you make a mistake on a question, there is no easy way to back up to it
1905 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1906 files. Configure will offer to let you do this before it runs the SH files.
1909 dflt='Type carriage return to continue'
1911 case "$firsttime" in
1912 true) echo $user >>../.config/instruct;;
1916 : find out where common programs are
1918 echo "Locating common programs..." >&4
1931 if test -d \$dir/\$thing; then
1937 for thisthing in \$dir/\$thing; do
1938 : just loop through to pick last item
1940 if test -f \$thisthing; then
1943 elif test -f \$dir/\$thing.exe; then
1944 if test -n "$DJGPP"; then
1945 echo \$dir/\$thing.exe
1947 : on Eunice apparently
1998 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1999 pth="$pth /lib /usr/lib"
2000 for file in $loclist; do
2004 if test -f "$xxx"; then
2007 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2008 xxx=`./loc $file $file $pth`
2011 '') xxx=`./loc $file $file $pth`;;
2012 *) xxx=`./loc $xxx $xxx $pth`;;
2018 echo $file is in $xxx.
2021 echo $file is in $xxx.
2024 echo "I don't know where '$file' is, and my life depends on it." >&4
2025 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2031 echo "Don't worry if any of the following aren't found..."
2033 for file in $trylist; do
2037 if test -f "$xxx"; then
2040 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2041 xxx=`./loc $file $file $pth`
2044 '') xxx=`./loc $file $file $pth`;;
2045 *) xxx=`./loc $xxx $xxx $pth`;;
2051 echo $file is in $xxx.
2054 echo $file is in $xxx.
2057 echo "I don't see $file out there, $say."
2064 echo "Substituting grep for egrep."
2070 echo "Substituting cp for ln."
2076 echo "Hopefully test is built into your sh."
2079 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2080 echo "Using the test built into your sh."
2088 echo "Hopefully echo is built into your sh."
2093 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2094 $echo $n "hi there$c" >foo1
2095 echo $n "hi there$c" >foo2
2096 if cmp foo1 foo2 >/dev/null 2>&1; then
2097 echo "They are compatible. In fact, they may be identical."
2104 They are not compatible! You are probably running ksh on a non-USG system.
2105 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2106 have echo built in and we may have to run some Bourne shell scripts. That
2107 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2110 $echo $n "The star should be here-->$c"
2120 cat <<'EOSC' >>checkcc
2125 int main(int argc, char *argv[]) {
2129 if $cc -o try $ccflags try.c; then
2132 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2138 case "`$cc -v -c try.c 2>&1`" in
2141 if $test X"$trygcc" = Xyes; then
2142 if gcc -o try -c try.c; then
2144 echo "You seem to have a working gcc, though." >&4
2145 rp="Would you like to use it?"
2147 if $test -f myread; then
2150 if $test -f UU/myread; then
2153 echo "Cannot find myread, sorry. Aborting." >&2
2158 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2162 if $test X"$despair" = Xyes; then
2164 You need to find a working C compiler.
2165 Either (purchase and) install the C compiler supplied by your OS vendor,
2166 or for a free C compiler try http://gcc.gnu.org/
2167 I cannot continue any further, aborting.
2177 : determine whether symbolic links are supported
2180 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2181 echo "Symbolic links are supported." >&4
2184 echo "Symbolic links are NOT supported." >&4
2189 : determine whether symbolic links are supported
2193 echo "Checking how to test for symbolic links..." >&4
2195 if $test "X$issymlink" = X; then
2196 sh -c "PATH= test -h sym" >/dev/null 2>&1
2197 if test $? = 0; then
2201 if $test "X$issymlink" = X; then
2202 if $test -h >/dev/null 2>&1; then
2203 issymlink="$test -h"
2204 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2207 if $test "X$issymlink" = X; then
2208 if $test -L sym 2>/dev/null; then
2209 issymlink="$test -L"
2212 if $test "X$issymlink" != X; then
2213 echo "You can test for symbolic links with '$issymlink'." >&4
2215 echo "I do not know how you can test for symbolic links." >&4
2219 *) echo "No symbolic links, so not testing for their testing..." >&4
2225 case "$mksymlinks" in
2228 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2231 *) case "$lns:$issymlink" in
2232 *"ln -s:"*"test -"?)
2233 echo "Creating the symbolic links..." >&4
2234 echo "(First creating the subdirectories...)" >&4
2236 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2238 test -z "$directory" && break
2242 if test ! -d t/base; then
2243 echo "Failed to create the subdirectories. Aborting." >&4
2246 echo "(Then creating the symlinks...)" >&4
2247 awk '{print $1}' $src/MANIFEST | while true; do
2249 test -z "$filename" && break
2250 if test -f $filename; then
2251 if $issymlink $filename; then
2255 if test -f $filename; then
2256 echo "$filename already exists, not symlinking."
2258 ln -s $src/$filename $filename
2262 if test ! -f t/base/commonsense.t; then
2263 echo "Failed to create the symlinks. Aborting." >&4
2268 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2276 : see whether [:lower:] and [:upper:] are supported character classes
2278 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2280 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2284 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2285 # (0xc9 and 0xd1), therefore that is a nice testing point.
2286 if test "X$up" = X -o "X$low" = X; then
2287 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2293 if test "X$up" = X -o "X$low" = X; then
2294 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2300 if test "X$up" = X -o "X$low" = X; then
2301 case "`echo IJ | od -x 2>/dev/null`" in
2303 echo "Hey, this might be EBCDIC." >&4
2304 if test "X$up" = X -o "X$low" = X; then
2305 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2306 ij) up='[A-IJ-RS-Z]'
2311 if test "X$up" = X -o "X$low" = X; then
2312 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2322 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2324 echo "Using $up and $low to convert case." >&4
2327 echo "I don't know how to translate letters from upper to lower case." >&4
2328 echo "Your tr is not acting any way I know of." >&4
2332 : set up the translation script tr, must be called with ./tr of course
2336 '[A-Z][a-z]') exec $tr '$up' '$low';;
2337 '[a-z][A-Z]') exec $tr '$low' '$up';;
2344 : Try to determine whether config.sh was made on this system
2345 case "$config_sh" in
2347 myuname=`$uname -a 2>/dev/null`
2348 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2349 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2350 # because the A-Z/a-z are not consecutive.
2351 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2352 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2353 newmyuname="$myuname"
2355 case "$knowitall" in
2357 if test -f ../config.sh; then
2358 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2359 eval "`grep myuname= ../config.sh`"
2361 if test "X$myuname" = "X$newmyuname"; then
2369 : Get old answers from old config file if Configure was run on the
2370 : same system, otherwise use the hints.
2373 if test -f config.sh; then
2375 rp="I see a config.sh file. Shall I use it to set the defaults?"
2378 n*|N*) echo "OK, I'll ignore it."
2379 mv config.sh config.sh.old
2380 myuname="$newmyuname"
2382 *) echo "Fetching default answers from your old config.sh file..." >&4
2390 : Older versions did not always set $sh. Catch re-use of such
2400 if test ! -f config.sh; then
2403 First time through, eh? I have some defaults handy for some systems
2404 that need some extra help getting the Configure answers right:
2407 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2409 : Half the following guesses are probably wrong... If you have better
2410 : tests or hints, please send them to perlbug@perl.org
2411 : The metaconfig authors would also appreciate a copy...
2412 $test -f /irix && osname=irix
2413 $test -f /xenix && osname=sco_xenix
2414 $test -f /dynix && osname=dynix
2415 $test -f /dnix && osname=dnix
2416 $test -f /lynx.os && osname=lynxos
2417 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2418 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2419 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2420 $test -f /bin/mips && /bin/mips && osname=mips
2421 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2422 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2423 $test -d /usr/apollo/bin && osname=apollo
2424 $test -f /etc/saf/_sactab && osname=svr4
2425 $test -d /usr/include/minix && osname=minix
2426 if $test -d /MachTen -o -d /MachTen_Folder; then
2428 if $test -x /sbin/version; then
2429 osvers=`/sbin/version | $awk '{print $2}' |
2430 $sed -e 's/[A-Za-z]$//'`
2431 elif $test -x /usr/etc/version; then
2432 osvers=`/usr/etc/version | $awk '{print $2}' |
2433 $sed -e 's/[A-Za-z]$//'`
2439 $test -f /sys/posix.dll &&
2440 $test -f /usr/bin/what &&
2441 set X `/usr/bin/what /sys/posix.dll` &&
2442 $test "$3" = UWIN &&
2446 if $test -f $uname; then
2454 umips) osname=umips ;;
2457 [23]100) osname=mips ;;
2458 next*) osname=next ;;
2460 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2461 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2464 elif $test -f /etc/kconfig; then
2466 if test "$lns" = "$ln -s"; then
2468 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2470 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2477 if test -n "$DJGPP"; then
2486 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2488 'not found') osvers="$4"."$3" ;;
2489 '<3240'|'<>3240') osvers=3.2.0 ;;
2490 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2491 '=3250'|'>3250') osvers=3.2.5 ;;
2495 bsd386) osname=bsd386
2498 cygwin*) osname=cygwin
2501 *dc.osx) osname=dcosx
2507 domainos) osname=apollo
2513 dynixptx*) osname=dynixptx
2514 osvers=`echo "$4"|sed 's/^v//'`
2516 freebsd) osname=freebsd
2518 genix) osname=genix ;;
2520 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2536 netbsd*) osname=netbsd
2539 news-os) osvers="$3"
2541 4*) osname=newsos4 ;;
2545 next*) osname=next ;;
2546 nonstop-ux) osname=nonstopux ;;
2547 POSIX-BC | posix-bc ) osname=posix-bc
2550 powerux | power_ux | powermax_os | powermaxos | \
2551 powerunix | power_unix) osname=powerux
2557 solaris) osname=solaris
2559 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2566 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2570 titanos) osname=titanos
2579 ultrix) osname=ultrix
2582 osf1|mls+) case "$5" in
2585 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2588 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2591 hp*) osname=hp_osf1 ;;
2592 mips) osname=mips_osf1 ;;
2595 unixware) osname=svr5
2601 $2) case "$osname" in
2605 : svr4.x or possibly later
2615 if test -f /stand/boot ; then
2616 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2617 if test -n "$INITPROG" -a -f "$INITPROG"; then
2618 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2619 if test -n "$isesix"; then
2627 *) if test -f /etc/systemid; then
2629 set `echo $3 | $sed 's/\./ /g'` $4
2630 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2632 elif $test -f $src/hints/sco_$1_$2.sh; then
2634 elif $test -f $src/hints/sco_$1.sh; then
2639 '') : Still unknown. Probably a generic Sys V.
2648 *) case "$osname" in
2649 '') : Still unknown. Probably a generic BSD.
2657 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2658 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2659 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2662 $rm -f UU/kernel.what
2663 elif test -d c:/.; then
2670 : Now look for a hint file osname_osvers, unless one has been
2671 : specified already.
2674 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2675 : Also try without trailing minor version numbers.
2676 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2677 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2678 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2679 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2682 *) case "$osvers" in
2685 *) if $test -f $src/hints/$file.sh ; then
2687 elif $test -f $src/hints/$xfile.sh ; then
2689 elif $test -f $src/hints/$xxfile.sh ; then
2691 elif $test -f $src/hints/$xxxfile.sh ; then
2693 elif $test -f $src/hints/$xxxxfile.sh ; then
2695 elif $test -f "$src/hints/${osname}.sh" ; then
2704 if $test -f Policy.sh ; then
2707 none) dflt="Policy" ;;
2708 *) dflt="Policy $dflt" ;;
2713 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2717 if $test -f Policy.sh ; then
2720 There's also a Policy hint file available, which should make the
2721 site-specific (policy) questions easier to answer.
2728 You may give one or more space-separated answers, or "none" if appropriate.
2729 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2730 is a good thing. DO NOT give a wrong version or a wrong OS.
2734 rp="Which of these apply, if any?"
2737 for file in $tans; do
2738 if $test X$file = XPolicy -a -f Policy.sh; then
2740 $cat Policy.sh >> UU/config.sh
2741 elif $test -f $src/hints/$file.sh; then
2742 . $src/hints/$file.sh
2743 $cat $src/hints/$file.sh >> UU/config.sh
2744 elif $test X$tans = X -o X$tans = Xnone ; then
2747 : Give one chance to correct a possible typo.
2748 echo "$file.sh does not exist"
2750 rp="hint to use instead?"
2752 for file in $ans; do
2753 if $test -f "$src/hints/$file.sh"; then
2754 . $src/hints/$file.sh
2755 $cat $src/hints/$file.sh >> UU/config.sh
2756 elif $test X$ans = X -o X$ans = Xnone ; then
2759 echo "$file.sh does not exist -- ignored."
2766 : Remember our hint file for later.
2767 if $test -f "$src/hints/$file.sh" ; then
2777 echo "Fetching default answers from $config_sh..." >&4
2781 cp $config_sh config.sh 2>/dev/null
2791 test "$override" && . ./optdef.sh
2793 : Restore computed paths
2794 for file in $loclist $trylist; do
2795 eval $file="\$_$file"
2800 Configure uses the operating system name and version to set some defaults.
2801 The default value is probably right if the name rings a bell. Otherwise,
2802 since spelling matters for me, either accept the default or answer "none"
2809 ''|' '|none) dflt=none ;;
2810 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2813 *) dflt="$osname" ;;
2815 rp="Operating system name?"
2819 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2825 ''|' '|none) dflt=none ;;
2826 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2827 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2829 ''|' ') dflt=none ;;
2834 *) dflt="$osvers" ;;
2836 rp="Operating system version?"
2846 : who configured the system
2847 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2848 cf_by=`(logname) 2>/dev/null`
2851 cf_by=`(whoami) 2>/dev/null`
2853 "") cf_by=unknown ;;
2857 : set up the script used to warn in case of inconsistency
2864 echo "*** WHOA THERE!!! ***" >&4
2865 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2866 rp=" Keep the $hint value?"
2869 y) td=$was; tu=$was;;
2873 : function used to set $1 to $val
2874 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2876 $define$undef) . ./whoa; eval "$var=\$td";;
2877 $undef$define) . ./whoa; eval "$var=\$tu";;
2878 *) eval "$var=$val";;
2881 case "$usethreads" in
2882 $define|true|[yY]*) dflt='y';;
2887 Perl can be built to take advantage of threads on some systems.
2888 To do so, Configure can be run with -Dusethreads.
2890 Note that threading is a highly experimental feature, and
2891 some known race conditions still remain. If you choose to try
2892 it, be very sure to not actually deploy it for production
2893 purposes. README.threads has more details, and is required
2894 reading if you enable threads.
2896 If this doesn't make any sense to you, just accept the default '$dflt'.
2898 rp='Build a threading Perl?'
2901 y|Y) val="$define" ;;
2907 case "$usethreads" in
2911 As of 5.5.640, Perl has two different internal threading implementations,
2912 the 5.005 version (5005threads) and an interpreter-based version
2913 (ithreads) that has one interpreter per thread. Both are very
2914 experimental. This arrangement exists to help developers work out
2915 which one is better.
2917 If you're a casual user, you probably don't want interpreter-threads
2918 at this time. There doesn't yet exist a way to create threads from
2919 within Perl in this model, i.e., "use Thread;" will NOT work.
2921 : Default to ithreads unless overridden on command line or with
2924 case "$use5005threads" in
2925 $define|true|[yY]*) dflt='n';;
2927 case "$useithreads" in
2928 $undef|false|[nN]*) dflt='n';;
2930 rp='Use interpreter-based ithreads?'
2933 y|Y) val="$define" ;;
2938 : Now set use5005threads to the opposite value.
2939 case "$useithreads" in
2940 $define) val="$undef" ;;
2947 useithreads="$undef"
2948 use5005threads="$undef"
2952 case "$useithreads$use5005threads" in
2956 You cannot have both the ithreads and the 5.005 threads enabled
2957 at the same time. Disabling the 5.005 threads since they are
2958 much less stable than the ithreads.
2961 use5005threads="$undef"
2965 case "$d_oldpthreads" in
2966 '') : Configure tests would be welcome here. For now, assume undef.
2968 *) val="$d_oldpthreads" ;;
2974 case "$usethreads" in
2975 "$define"|true|[yY]*)
2976 : Look for a hint-file generated 'call-back-unit'. If the
2977 : user has specified that a threading perl is to be built,
2978 : we may need to set or change some other defaults.
2979 if $test -f usethreads.cbu; then
2980 echo "Your platform has some specific hints for threaded builds, using them..."
2984 (Your platform doesn't have any specific hints for threaded builds.
2985 Assuming POSIX threads, then.)
2993 Perl can be built so that multiple Perl interpreters can coexist
2994 within the same Perl executable.
2997 case "$useithreads" in
3000 This multiple interpreter support is required for interpreter-based threads.
3004 *) case "$usemultiplicity" in
3005 $define|true|[yY]*) dflt='y';;
3009 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3010 rp='Build Perl for multiplicity?'
3013 y|Y) val="$define" ;;
3021 : make some quick guesses about what we are up against
3023 $echo $n "Hmm... $c"
3033 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3034 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3036 echo "Looks kind of like an OSF/1 system, but we'll see..."
3038 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3039 xxx=`./loc addbib blurfl $pth`
3040 if $test -f $xxx; then
3041 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3045 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3046 echo "Looks kind of like an extended USG system, but we'll see..."
3048 echo "Looks kind of like a USG system, but we'll see..."
3052 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3053 echo "Looks kind of like a BSD system, but we'll see..."
3057 echo "Looks kind of like a Version 7 system, but we'll see..."
3060 case "$eunicefix" in
3063 There is, however, a strange, musty smell in the air that reminds me of
3064 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3068 : it so happens the Eunice I know will not run shell scripts in Unix format
3072 echo "Congratulations. You aren't running Eunice."
3076 : Detect OS2. The p_ variable is set above in the Head.U unit.
3077 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3078 : semicolon as a patch separator
3083 I have the feeling something is not exactly right, however...don't tell me...
3084 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3085 (Or you may be running DOS with DJGPP.)
3090 if test -f /xenix; then
3091 echo "Actually, this looks more like a XENIX system..."
3096 echo "It's not Xenix..."
3101 if test -f /venix; then
3102 echo "Actually, this looks more like a VENIX system..."
3109 echo "Nor is it Venix..."
3112 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3113 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3120 rp="Use which C compiler?"
3123 : Look for a hint-file generated 'call-back-unit'. Now that the
3124 : user has specified the compiler, we may need to set or change some
3126 if $test -f cc.cbu; then
3132 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3133 $cat >gccvers.c <<EOM
3138 printf("%s\n", __VERSION__);
3140 printf("%s\n", "1");
3146 if $cc -o gccvers $ldflags gccvers.c; then
3147 gccversion=`./gccvers`
3148 case "$gccversion" in
3149 '') echo "You are not using GNU cc." ;;
3150 *) echo "You are using GNU cc $gccversion."
3156 echo "*** WHOA THERE!!! ***" >&4
3157 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3158 case "$knowitall" in
3160 echo " You'd better start hunting for one and let me know about it." >&4
3166 case "$gccversion" in
3167 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3169 case "$gccversion" in
3170 '') gccosandvers='' ;;
3171 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3172 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3174 case "$gccosandvers" in
3175 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3176 $osname$osvers) ;; # looking good
3177 $osname*) cat <<EOM >&4
3179 *** WHOA THERE!!! ***
3181 Your gcc has not been compiled for the exact release of
3182 your operating system ($gccosandvers versus $osname$osvers).
3184 In general it is a good idea to keep gcc synchronized with
3185 the operating system because otherwise serious problems
3186 may ensue when trying to compile software, like Perl.
3188 I'm trying to be optimistic here, though, and will continue.
3189 If later during the configuration and build icky compilation
3190 problems appear (headerfile conflicts being the most common
3191 manifestation), I suggest reinstalling the gcc to match
3192 your operating system release.
3196 *) gccosandvers='' ;; # failed to parse, better be silent
3204 : see how we invoke the C preprocessor
3206 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3207 cat <<'EOT' >testcpp.c
3213 if test ! -f cppstdin; then
3214 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3215 # AIX cc -E doesn't show the absolute headerfile
3216 # locations but we'll cheat by using the -M flag.
3217 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
3219 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3222 echo "Keeping your $hint cppstdin wrapper."
3225 wrapper=`pwd`/cppstdin
3229 if $test "X$cppstdin" != "X" && \
3230 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3231 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3233 echo "You used to use $cppstdin $cppminus so we'll use that again."
3235 '') echo "But let's see if we can live without a wrapper..." ;;
3237 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3238 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3240 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3243 echo "(However, $cpprun $cpplast does not work, let's see...)"
3251 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3258 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3259 $cc -E <testcpp.c >testcpp.out 2>&1; \
3260 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3261 echo "Yup, it does."
3264 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3265 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3266 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3267 echo "Yup, it does."
3270 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3271 $cc -P <testcpp.c >testcpp.out 2>&1; \
3272 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3273 echo "Yipee, that works!"
3276 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3277 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3278 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3279 echo "At long last!"
3282 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3283 $cpp <testcpp.c >testcpp.out 2>&1; \
3284 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3288 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3289 $cpp - <testcpp.c >testcpp.out 2>&1; \
3290 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3291 echo "Hooray, it works! I was beginning to wonder."
3294 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3295 $wrapper <testcpp.c >testcpp.out 2>&1; \
3296 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3302 rp="No dice. I can't find a C preprocessor. Name one:"
3306 $x_cpp <testcpp.c >testcpp.out 2>&1
3307 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3308 echo "OK, that will do." >&4
3310 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3325 echo "Perhaps can we force $cc -E using a wrapper..."
3326 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3327 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3333 echo "Nope, we'll have to live without it..."
3347 "$wrapper"|'cppstdin') ;;
3348 *) $rm -f $wrapper;;
3350 $rm -f testcpp.c testcpp.out
3352 : decide how portable to be. Allow command line overrides.
3353 case "$d_portable" in
3355 *) d_portable="$define" ;;
3358 : set up shell script to do ~ expansion
3364 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3367 if $test -f /bin/csh; then
3368 /bin/csh -f -c "glob \$1"
3373 name=\`$expr x\$1 : '..\([^/]*\)'\`
3374 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3375 if $test ! -d "\$dir"; then
3377 echo "\$me: can't locate home directory for: \$name" >&2
3382 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3398 : now set up to get a file name
3402 cat <<'EOSC' >>getfile
3418 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3419 fn=`echo $fn | sed 's/(.*)//'`
3425 loc_file=`expr $fn : '.*:\(.*\)'`
3426 fn=`expr $fn : '\(.*\):.*'`
3434 */*) fullpath=true;;
3443 *e*) exp_file=true;;
3446 *p*) nopath_ok=true;;
3451 *d*) type='Directory';;
3452 *l*) type='Locate';;
3457 Locate) what='File';;
3462 case "$d_portable" in
3470 while test "$type"; do
3475 true) rp="$rp (~name ok)";;
3478 if test -f UU/getfile.ok && \
3479 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3498 value=`UU/filexp $ans`
3501 if test "$ans" != "$value"; then
3502 echo "(That expands to $value on this system.)"
3516 /*) value="$ansexp" ;;
3517 [a-zA-Z]:/*) value="$ansexp" ;;
3522 echo "I shall only accept a full path name, as in /bin/ls." >&4
3523 echo "Use a ! shell escape if you wish to check pathnames." >&4
3526 echo "Please give a full path name, starting with slash." >&4
3529 echo "Note that using ~name is ok provided it expands well." >&4
3542 for fp in $gfpth; do
3543 if test "X$fp" = X.; then
3548 if test -f "$pf"; then
3550 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3552 echo "($value is not a plain file, but that's ok.)"
3555 if test X"$type" = X; then
3562 for fp in $gfpth; do
3563 if test "X$fp" = X.; then
3568 direxp="$fp/$ansexp"
3570 if test -d "$direxp"; then
3578 if test -d "$ansexp"; then
3579 echo "(Looking for $loc_file in directory $value.)"
3580 value="$value/$loc_file"
3581 ansexp="$ansexp/$loc_file"
3583 if test -f "$ansexp"; then
3586 case "$nopath_ok" in
3587 true) case "$value" in
3589 *) echo "Assuming $value will be in people's path."
3605 if test "$fastread" = yes; then
3610 rp="$what $value doesn't exist. Use that name anyway?"
3629 test "X$gfpthkeep" != Xy && gfpth=""
3632 : What should the include directory be ?
3634 $echo $n "Hmm... $c"
3638 if $test -f /bin/mips && /bin/mips; then
3639 echo "Looks like a MIPS system..."
3640 $cat >usr.c <<'EOCP'
3641 #ifdef SYSTYPE_BSD43
3645 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3646 dflt='/bsd43/usr/include'
3650 mips_type='System V'
3652 $rm -f usr.c usr.out
3653 echo "and you're compiling with the $mips_type compiler and libraries."
3657 echo "Doesn't look like a MIPS system."
3667 case "$xxx_prompt" in
3670 rp='Where are the include files you want to use?'
3678 : Set private lib path
3681 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3686 '') dlist="$loclibpth $plibpth $glibpth";;
3687 *) dlist="$libpth";;
3690 : Now check and see which directories actually exist, avoiding duplicates
3694 if $test -d $xxx; then
3697 *) libpth="$libpth $xxx";;
3703 Some systems have incompatible or broken versions of libraries. Among
3704 the directories listed in the question below, please remove any you
3705 know not to be holding relevant libraries, and add any that are needed.
3706 Say "none" for none.
3717 rp="Directories to use for library searches?"
3724 : compute shared library extension
3727 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3737 On some systems, shared libraries may be available. Answer 'none' if
3738 you want to suppress searching of shared libraries for the remainder
3739 of this configuration.
3742 rp='What is the file extension used for shared libraries?'
3746 : Define several unixisms.
3747 : Hints files or command line option can be used to override them.
3748 : The convoluted testing is in case hints files set either the old
3751 '') case "$exe_ext" in
3753 *) _exe="$exe_ext" ;;
3758 '') case "$lib_ext" in
3765 '') case "$obj_ext" in
3772 '') case "$path_sep" in
3783 : Which makefile gets called first. This is used by make depend.
3784 case "$firstmakefile" in
3785 '') firstmakefile='makefile';;
3789 $define|true|[yY]*) dflt='y';;
3794 Perl can be built to use the SOCKS proxy protocol library. To do so,
3795 Configure must be run with -Dusesocks. If you use SOCKS you also need
3796 to use the PerlIO abstraction layer, this will be implicitly selected.
3798 If this doesn't make any sense to you, just accept the default '$dflt'.
3800 rp='Build Perl for SOCKS?'
3803 y|Y) val="$define" ;;
3810 $define|true|[yY]*) useperlio="$define";;
3813 : Looking for optional libraries
3815 echo "Checking for optional libraries..." >&4
3820 case "$libswanted" in
3821 '') libswanted='c_s';;
3824 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3830 for thisdir in $libpth $xlibpth; do
3831 test -d $thisdir && libspath="$libspath $thisdir"
3833 for thislib in $libswanted; do
3834 for thisdir in $libspath; do
3836 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3837 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3838 $test -f "$xxx" && eval $libscheck
3839 $test -f "$xxx" && libstyle=shared
3841 if test ! -f "$xxx"; then
3842 xxx=$thisdir/lib$thislib.$so
3843 $test -f "$xxx" && eval $libscheck
3844 $test -f "$xxx" && libstyle=shared
3846 if test ! -f "$xxx"; then
3847 xxx=$thisdir/lib$thislib$_a
3848 $test -f "$xxx" && eval $libscheck
3849 $test -f "$xxx" && libstyle=static
3851 if test ! -f "$xxx"; then
3852 xxx=$thisdir/$thislib$_a
3853 $test -f "$xxx" && eval $libscheck
3854 $test -f "$xxx" && libstyle=static
3856 if test ! -f "$xxx"; then
3857 xxx=$thisdir/lib${thislib}_s$_a
3858 $test -f "$xxx" && eval $libscheck
3859 $test -f "$xxx" && libstyle=static
3860 $test -f "$xxx" && thislib=${thislib}_s
3862 if test ! -f "$xxx"; then
3863 xxx=$thisdir/Slib$thislib$_a
3864 $test -f "$xxx" && eval $libscheck
3865 $test -f "$xxx" && libstyle=static
3867 if $test -f "$xxx"; then
3869 shared) echo "Found -l$thislib (shared)." ;;
3870 static) echo "Found -l$thislib." ;;
3871 *) echo "Found -l$thislib ($libstyle)." ;;
3875 *) dflt="$dflt -l$thislib"
3876 libsfound="$libsfound $xxx"
3878 libsfiles="$libsfiles $yyy"
3879 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3880 case " $libsdirs " in
3882 *) libsdirs="$libsdirs $yyy" ;;
3889 if $test ! -f "$xxx"; then
3890 echo "No -l$thislib."
3901 ' '|'') dflt='none';;
3906 In order to compile $package on your machine, a number of libraries
3907 are usually needed. Include any other special libraries here as well.
3908 Say "none" for none. The default list is almost always right.
3912 rp="What libraries to use?"
3919 : determine optimization, if desired, or use for debug flag also
3921 ' '|$undef) dflt='none';;
3923 *) dflt="$optimize";;
3927 By default, $package compiles with the -O flag to use the optimizer.
3928 Alternately, you might want to use the symbolic debugger, which uses
3929 the -g flag (on traditional Unix systems). Either flag can be
3930 specified here. To use neither flag, specify the word "none".
3933 rp="What optimizer/debugger flag should be used?"
3937 'none') optimize=" ";;
3941 : We will not override a previous value, but we might want to
3942 : augment a hint file
3944 default|recommended)
3945 case "$gccversion" in
3946 1*) dflt='-fpcc-struct-return' ;;
3949 *-g*) dflt="$dflt -DDEBUGGING";;
3951 case "$gccversion" in
3952 2*) if test -d /etc/conf/kconfig.d &&
3953 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3959 case "$gccversion" in
3963 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3964 echo 'int main(void) { return 0; }' > gcctest.c
3965 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3966 echo "Yes, it does." 2>&1
3969 echo "Leaving current flags $ccflags alone." 2>&1
3971 *) dflt="$dflt -fno-strict-aliasing" ;;
3974 echo "Nope, it doesn't, but that's ok." 2>&1
3981 case "$mips_type" in
3982 *BSD*|'') inclwanted="$locincpth $usrinc";;
3983 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3985 for thisincl in $inclwanted; do
3986 if $test -d $thisincl; then
3987 if $test x$thisincl != x$usrinc; then
3989 *" -I$thisincl "*);;
3990 *) dflt="$dflt -I$thisincl ";;
3996 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3998 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4006 *) dflt="$dflt -D$2";;
4010 set signal.h LANGUAGE_C; eval $inctest
4014 ccflags="$ccflags -DSOCKS"
4019 default|recommended) dflt="$ccflags $dflt" ;;
4020 *) dflt="$ccflags";;
4029 Your C compiler may want other flags. For this question you should include
4030 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4031 but you should NOT include libraries or ld flags like -lwhatever. If you
4032 want $package to honor its debug switch, you should include -DDEBUGGING here.
4033 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4035 To use no flags, specify the word "none".
4041 rp="Any additional cc flags?"
4048 : the following weeds options from ccflags that are of no interest to cpp
4050 case "$gccversion" in
4051 1*) cppflags="$cppflags -D__GNUC__"
4053 case "$mips_type" in
4055 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4061 echo "Let me guess what the preprocessor flags are..." >&4
4075 *) ftry="$previous $flag";;
4077 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4078 >cpp1.out 2>/dev/null && \
4079 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4080 >cpp2.out 2>/dev/null && \
4081 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4082 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4084 cppflags="$cppflags $ftry"
4094 *-*) echo "They appear to be: $cppflags";;
4096 $rm -f cpp.c cpp?.out
4100 : flags used in final linking phase
4102 '') if ./venix; then
4108 *-posix*) dflt="$dflt -posix" ;;
4111 *) dflt="$ldflags";;
4114 : Try to guess additional flags to pick up local libraries.
4115 for thislibdir in $libpth; do
4116 case " $loclibpth " in
4119 *"-L$thislibdir "*) ;;
4120 *) dflt="$dflt -L$thislibdir" ;;
4132 Your C linker may need flags. For this question you should
4133 include -L/whatever and any other flags used by the C linker, but you
4134 should NOT include libraries like -lwhatever.
4136 Make sure you include the appropriate -L/path flags if your C linker
4137 does not normally search all of the directories you specified above,
4140 To use no flags, specify the word "none".
4144 rp="Any additional ld flags (NOT including libraries)?"
4150 rmlist="$rmlist pdp11"
4154 echo "Checking your choice of C compiler and flags for coherency..." >&4
4155 $cat > try.c <<'EOF'
4157 int main() { printf("Ok\n"); exit(0); }
4159 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4161 $cat >try.msg <<'EOM'
4162 I've tried to compile and run the following simple program:
4165 $cat try.c >> try.msg
4167 $cat >> try.msg <<EOM
4174 and I got the following output:
4178 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4179 if $sh -c './try' >>try.msg 2>&1; then
4183 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4186 cat >> try.msg <<'EOQS'
4187 If $libs contains -lsfio, and sfio is mis-configured, then it
4188 sometimes (apparently) runs and exits with a 0 status, but with no
4189 output! It may have to do with sfio's use of _exit vs. exit.
4192 rp="You have a big problem. Shall I abort Configure"
4199 echo "The program compiled OK, but exited with status $?." >>try.msg
4200 rp="You have a problem. Shall I abort Configure"
4204 echo "I can't compile the test program." >>try.msg
4205 rp="You have a BIG problem. Shall I abort Configure"
4211 case "$knowitall" in
4213 echo "(The supplied flags or libraries might be incorrect.)"
4221 *) echo "Ok. Stopping Configure." >&4
4226 n) echo "OK, that should do.";;
4228 $rm -f try try.* core
4230 : define an is-a-typedef? function
4231 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4233 "") inclist="sys/types.h";;
4235 eval "varval=\$$var";
4239 for inc in $inclist; do
4240 echo "#include <$inc>" >>temp.c;
4242 echo "#ifdef $type" >> temp.c;
4243 echo "printf(\"We have $type\");" >> temp.c;
4244 echo "#endif" >> temp.c;
4245 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4246 if $contains $type temp.E >/dev/null 2>&1; then
4252 *) eval "$var=\$varval";;
4255 : define an is-a-typedef? function that prompts if the type is not available.
4256 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4258 "") inclist="sys/types.h";;
4260 eval "varval=\$$var";
4264 for inc in $inclist; do
4265 echo "#include <$inc>" >>temp.c;
4267 echo "#ifdef $type" >> temp.c;
4268 echo "printf(\"We have $type\");" >> temp.c;
4269 echo "#endif" >> temp.c;
4270 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4272 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4273 if $contains $type temp.E >/dev/null 2>&1; then
4274 echo "$type found." >&4;
4277 echo "$type NOT found." >&4;
4283 *) eval "$var=\$varval";;
4286 : define a shorthand compile call
4290 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4291 : define a shorthand compile call for compilations that should be ok.
4295 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4297 : check for lengths of integral types
4301 echo "Checking to see how big your integers are..." >&4
4302 $cat >intsize.c <<'EOCP'
4306 printf("intsize=%d;\n", (int)sizeof(int));
4307 printf("longsize=%d;\n", (int)sizeof(long));
4308 printf("shortsize=%d;\n", (int)sizeof(short));
4313 if eval $compile_ok && ./intsize > /dev/null; then
4315 echo "Your integers are $intsize bytes long."
4316 echo "Your long integers are $longsize bytes long."
4317 echo "Your short integers are $shortsize bytes long."
4321 Help! I can't compile and run the intsize test program: please enlighten me!
4322 (This is probably a misconfiguration in your system or libraries, and
4323 you really ought to fix it. Still, I'll try anyway.)
4327 rp="What is the size of an integer (in bytes)?"
4331 rp="What is the size of a long integer (in bytes)?"
4335 rp="What is the size of a short integer (in bytes)?"
4341 $rm -f intsize intsize.*
4343 : see what type lseek is declared as in the kernel
4344 rp="What is the type used for lseek's offset on this system?"
4345 set off_t lseektype long stdio.h sys/types.h
4349 echo "Checking to see how big your file offsets are..." >&4
4351 #include <sys/types.h>
4355 printf("%d\n", (int)sizeof($lseektype));
4360 if eval $compile_ok; then
4362 echo "Your file offsets are $lseeksize bytes long."
4366 echo "(I can't seem to compile the test program. Guessing...)"
4367 rp="What is the size of your file offsets (in bytes)?"
4373 : see what type file positions are declared as in the library
4374 rp="What is the type for file position used by fsetpos()?"
4375 set fpos_t fpostype long stdio.h sys/types.h
4380 *_t) zzz="$fpostype" ;;
4383 echo "Checking the size of $zzz..." >&4
4385 #include <sys/types.h>
4388 printf("%d\n", (int)sizeof($fpostype));
4393 if eval $compile_ok; then
4397 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4400 echo "Your $zzz is $fpossize bytes long."
4406 echo "(I can't compile the test program. Guessing...)" >&4
4407 rp="What is the size of your file positions (in bytes)?"
4414 # Backward compatibility (uselfs is deprecated).
4416 "$define"|true|[yY]*)
4419 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4421 uselargefiles="$define"
4425 case "$lseeksize:$fpossize" in
4428 You can have files larger than 2 gigabytes.
4431 *) case "$uselargefiles" in
4432 "$undef"|false|[nN]*) dflt='n' ;;
4437 Perl can be built to understand large files (files larger than 2 gigabytes)
4438 on some systems. To do so, Configure can be run with -Duselargefiles.
4440 If this doesn't make any sense to you, just accept the default '$dflt'.
4442 rp='Try to understand large files, if available?'
4445 y|Y) val="$define" ;;
4452 case "$uselargefiles" in
4454 : Look for a hint-file generated 'call-back-unit'. If the
4455 : user has specified that a large files perl is to be built,
4456 : we may need to set or change some other defaults.
4457 if $test -f uselargefiles.cbu; then
4458 echo "Your platform has some specific hints for large file builds, using them..."
4459 . ./uselargefiles.cbu
4461 echo "Rechecking to see how big your file offsets are..." >&4
4463 #include <sys/types.h>
4467 printf("%d\n", (int)sizeof($lseektype));
4472 if eval $compile_ok; then
4474 $echo "Your file offsets are now $lseeksize bytes long."
4478 echo "(I can't seem to compile the test program. Guessing...)"
4479 rp="What is the size of your file offsets (in bytes)?"
4484 *_t) zzz="$fpostype" ;;
4487 $echo $n "Rechecking the size of $zzz...$c" >&4
4489 #include <sys/types.h>
4492 printf("%d\n", (int)sizeof($fpostype));
4497 if eval $compile_ok; then
4502 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4505 echo " $fpossize bytes." >&4
4511 echo "(I can't compile the test program. Guessing...)" >&4
4512 rp="What is the size of your file positions (in bytes)?"
4522 case "$usemorebits" in
4523 "$define"|true|[yY]*)
4524 use64bitint="$define"
4525 uselongdouble="$define"
4526 usemorebits="$define"
4528 *) usemorebits="$undef"
4533 case "$uselonglong" in
4534 "$define"|true|[yY]*)
4537 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4539 use64bitint="$define"
4542 case "$use64bits" in
4543 "$define"|true|[yY]*)
4546 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4548 use64bitint="$define"
4551 case "$use64bitints" in
4552 "$define"|true|[yY]*)
4555 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4557 use64bitint="$define"
4560 case "$use64bitsint" in
4561 "$define"|true|[yY]*)
4564 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4566 use64bitint="$define"
4569 case "$uselonglongs" in
4570 "$define"|true|[yY]*)
4573 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4575 use64bitint="$define"
4578 case "$use64bitsall" in
4579 "$define"|true|[yY]*)
4582 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4584 use64bitall="$define"
4589 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4591 case "$use64bitall" in
4592 "$define"|true|[yY]*) use64bitint="$define" ;;
4598 You have natively 64-bit long integers.
4602 *) case "$use64bitint" in
4603 "$define"|true|[yY]*) dflt='y';;
4608 Perl can be built to take advantage of 64-bit integer types
4609 on some systems. To do so, Configure can be run with -Duse64bitint.
4610 Choosing this option will most probably introduce binary incompatibilities.
4612 If this doesn't make any sense to you, just accept the default '$dflt'.
4614 rp='Try to use 64-bit integers, if available?'
4617 [yY]*) val="$define" ;;
4625 case "$use64bitall" in
4626 "$define"|true|[yY]*) dflt='y' ;;
4627 *) case "$longsize" in
4635 You may also choose to try maximal 64-bitness. It means using as much
4636 64-bitness as possible on the platform. This in turn means even more
4637 binary incompatibilities. On the other hand, your platform may not
4638 have any more 64-bitness available than what you already have chosen.
4640 If this doesn't make any sense to you, just accept the default '$dflt'.
4642 rp='Try to use maximal 64-bit support, if available?'
4645 [yY]*) val="$define" ;;
4650 case "$use64bitall" in
4652 case "$use64bitint" in
4656 Since you have chosen a maximally 64-bit build, I'm also turning on
4657 the use of 64-bit integers.
4659 use64bitint="$define" ;;
4664 case "$use64bitint" in
4665 "$define"|true|[yY]*)
4666 : Look for a hint-file generated 'call-back-unit'. If the
4667 : user has specified that a 64-bit perl is to be built,
4668 : we may need to set or change some other defaults.
4669 if $test -f use64bitint.cbu; then
4670 echo "Your platform has some specific hints for 64-bit integers, using them..."
4674 4) case "$archname64" in
4675 '') archname64=64int ;;
4682 case "$use64bitall" in
4683 "$define"|true|[yY]*)
4684 : Look for a hint-file generated 'call-back-unit'. If the
4685 : user has specified that a maximally 64-bit perl is to be built,
4686 : we may need to set or change some other defaults.
4687 if $test -f use64bitall.cbu; then
4688 echo "Your platform has some specific hints for 64-bit builds, using them..."
4692 4) case "$archname64" in
4693 ''|64int) archname64=64all ;;
4701 echo "Checking for GNU C Library..." >&4
4702 cat >gnulibc.c <<EOM
4714 if eval $compile_ok && ./gnulibc; then
4716 echo "You are using the GNU C Library"
4719 echo "You are not using the GNU C Library"
4725 : see if nm is to be used to determine whether a symbol is defined or not
4729 case "$d_gnulibc" in
4732 echo "nm probably won't work on the GNU C Library." >&4
4738 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4740 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4741 echo "'nm' won't be sufficient on this sytem." >&4
4747 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4748 if $test $dflt -gt 20; then
4758 true|$define) dflt=y;;
4765 I can use $nm to extract the symbols from your C libraries. This
4766 is a time consuming task which may generate huge output on the disk (up
4767 to 3 megabytes) but that should make the symbols extraction faster. The
4768 alternative is to skip the 'nm' extraction part and to compile a small
4769 test program instead to determine whether each symbol is present. If
4770 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4771 this may be the best solution.
4773 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4776 rp="Shall I use $nm to extract C symbols from the libraries?"
4779 [Nn]*) usenm=false;;
4788 : nm options which may be necessary
4790 '') if $test -f /mach_boot; then