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 Tue Nov 26 10:51:37 MET 2002 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
68 case "X${MACHTYPE:-nonesuchmach}" in
76 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
77 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
78 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
79 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
80 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
81 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
82 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
83 paths="$paths /sbin /usr/sbin /usr/libexec"
84 paths="$paths /system/gnu_library/bin"
90 *) test -d $p && PATH=$PATH$p_$p ;;
97 : shall we be using ksh?
103 if (PATH=.; alias -x) >/dev/null 2>&1; then
106 if test -f /hp-ux -a -f /bin/ksh; then
107 needksh='to avoid sh bug in "here document" expansion'
109 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
110 if test X`/usr/bin/uname -v` = X4; then
111 avoidksh="to avoid AIX 4's /bin/sh"
115 if test -f /osf_boot -a -f /usr/sbin/setld; then
116 if test X`/usr/bin/uname -s` = XOSF1; then
117 avoidksh="to avoid Digital UNIX' ksh"
119 unset BIN_SH # if this is 'xpg4' sh will start up ksh
122 case "$inksh/$needksh" in
129 case "$inksh/$avoidksh" in
135 case "$inksh/$needksh-$avoidksh-" in
138 (I see you are using the Korn shell. Some ksh's blow up on $me,
139 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
146 echo "(Feeding myself to $newsh $reason.)"
148 Configure|*/Configure) exec $newsh $0 "$@";;
149 *) exec $newsh Configure "$@";;
154 : if needed set CDPATH to a harmless value that is not chatty
155 : avoid bash 2.02 problems with empty CDPATH.
159 *bash*) CDPATH='.' ;;
164 : Configure runs within the UU subdirectory
165 test -d UU || mkdir UU
373 endhostent_r_proto=''
379 endprotoent_r_proto=''
385 endservent_r_proto=''
435 gethostbyaddr_r_proto=''
437 gethostbyname_r_proto=''
439 gethostent_r_proto=''
451 getnetbyaddr_r_proto=''
453 getnetbyname_r_proto=''
467 d_getprotobyname_r=''
468 getprotobyname_r_proto=''
469 d_getprotobynumber_r=''
470 getprotobynumber_r_proto=''
472 getprotoent_r_proto=''
484 getservbyname_r_proto=''
486 getservbyport_r_proto=''
488 getservent_r_proto=''
564 d_old_pthread_create_joinable=''
565 old_pthread_create_joinable=''
604 sethostent_r_proto=''
621 setprotoent_r_proto=''
633 setservent_r_proto=''
677 d_stdio_ptr_lval_nochange_cnt=''
678 d_stdio_ptr_lval_sets_cnt=''
879 inc_version_list_init=''
898 ignore_versioned_solibs=''
957 d_perl_otherlibdirs=''
971 version_patchlevel_string=''
986 nv_preserves_uv_bits=''
1075 installsitescript=''
1090 d_stdio_stream_array=''
1091 stdio_stream_array=''
1101 ccflags_uselargefiles=''
1102 ldflags_uselargefiles=''
1103 libswanted_uselargefiles=''
1123 installvendorarch=''
1130 installvendorhtml1=''
1133 installvendorhtml3=''
1141 installvendorman1=''
1144 installvendorman3=''
1151 installvendorscript=''
1165 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1168 : We must find out about Eunice early
1170 if test -f /etc/unixtovms; then
1171 eunicefix=/etc/unixtovms
1173 if test -f /etc/unixtovms.exe; then
1174 eunicefix=/etc/unixtovms.exe
1177 : Set executable suffix now -- needed before hints available
1178 if test -f "/libs/version.library"; then
1181 elif test -f "/system/gnu_library/bin/ar.pm"; then
1184 elif test -n "$DJGPP"; then
1187 elif test -d c:/. ; then
1196 : set useposix=false in your hint file to disable the POSIX extension.
1198 : set useopcode=false in your hint file to disable the Opcode extension.
1200 : Trailing extension. Override this in a hint file, if needed.
1201 : Extra object files, if any, needed on this platform.
1204 : Possible local include directories to search.
1205 : Set locincpth to "" in a hint file to defeat local include searches.
1206 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1207 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1209 : no include file wanted by default
1214 : change the next line if compiling for Xenix/286 on Xenix/386
1215 xlibpth='/usr/lib/386 /lib/386'
1216 : Possible local library directories to search.
1217 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1218 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1220 : general looking path for locating libraries
1221 glibpth="/lib /usr/lib $xlibpth"
1222 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1223 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1224 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1226 : Private path used by Configure to find libraries. Its value
1227 : is prepended to libpth. This variable takes care of special
1228 : machines, like the mips. Usually, it should be empty.
1231 : default library list
1233 : some systems want to use only the non-versioned libso:s
1234 ignore_versioned_solibs=''
1239 ccflags_uselargefiles=''
1240 ldflags_uselargefiles=''
1241 libswanted_uselargefiles=''
1242 : set usemultiplicity on the Configure command line to enable multiplicity.
1243 : set usesocks on the Configure command line to enable socks.
1244 : set usethreads on the Configure command line to enable threads.
1245 usereentrant='undef'
1246 : full support for void wanted by default
1249 : List of libraries we want.
1250 : If anyone needs -lnet, put it in a hint file.
1251 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1252 libswanted="$libswanted dld ld sun m c cposix posix"
1253 libswanted="$libswanted ndir dir crypt sec"
1254 libswanted="$libswanted ucb bsd BSD PW x util rt posix4"
1255 : We probably want to search /usr/shlib before most other libraries.
1256 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1257 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1258 glibpth="/usr/shlib $glibpth"
1259 : Do not use vfork unless overridden by a hint file.
1262 : Find the basic shell for Bourne shell scripts
1266 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1269 if test -f "$xxx"; then
1272 : Build up a list and do a single loop so we can 'break' out.
1273 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1274 for xxx in sh bash ksh pdksh ash; do
1276 try="$try ${p}/${xxx}"
1280 if test -f "$xxx"; then
1283 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1286 elif test -f "$xxx.exe"; then
1297 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1299 Usually it's in /bin/sh. How did you even get this far?
1300 Please contact me (Perl Maintainers) at perlbug@perl.org and
1301 we'll try to straighten this all out.
1307 : see if sh knows # comments
1308 if `$sh -c '#' >/dev/null 2>&1`; then
1312 test -f $xcat$_exe || xcat=/usr/bin/cat
1313 if test ! -f $xcat$_exe; then
1314 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1315 if test -f $p/cat$_exe; then
1320 if test ! -f $xcat$_exe; then
1321 echo "Can't find cat anywhere!"
1325 echo "#!$xcat" >sharp
1329 if test -s today; then
1332 echo "#! $xcat" > sharp
1336 if test -s today; then
1344 echo "Your $sh doesn't grok # comments--I will strip them later on."
1347 echo "exec grep -v '^[ ]*#'" >spitshell
1349 $eunicefix spitshell
1350 spitshell=`pwd`/spitshell
1352 echo "I presume that if # doesn't work, #! won't work either!"
1357 : figure out how to guarantee sh startup
1359 '') startsh=${sharpbang}${sh} ;;
1371 : echo "Yup, it does."
1373 echo "Hmm... '$startsh' does not guarantee sh startup..."
1374 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1379 : Save command line options in file UU/cmdline.opt for later use in
1380 : generating config.sh.
1381 cat > cmdline.opt <<EOSH
1382 # Configure command line arguments.
1391 cat >>cmdline.opt <<EOSH
1392 config_arg$argn='$arg'
1394 # Extreme backslashitis: replace each ' by '"'"'
1395 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1398 arg_exp=`cat cmdl.opt`
1399 args_exp="$args_exp$args_sep'$arg_exp'"
1400 argn=`expr $argn + 1`
1403 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1404 # used by ./hints/os2.sh
1407 : produce awk script to parse command line options
1408 cat >options.awk <<'EOF'
1410 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1412 len = length(optstr);
1413 for (i = 1; i <= len; i++) {
1414 c = substr(optstr, i, 1);
1415 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1426 if (substr(str, 1, 1) != "-") {
1427 printf("'%s'\n", str);
1431 for (i = 2; i <= len; i++) {
1432 c = substr(str, i, 1);
1434 printf("-%s\n", substr(str, i));
1440 printf("'%s'\n", substr(str, i + 1));
1453 : process the command line options
1454 set X `for arg in "$@"; do echo "X$arg"; done |
1455 sed -e s/X// | awk -f options.awk`
1460 : set up default values
1470 rm -f optdef.sh posthint.sh
1471 cat >optdef.sh <<EOS
1477 while test $# -gt 0; do
1479 -d) shift; fastread=yes;;
1480 -e) shift; alldone=cont;;
1484 if test -r "$1"; then
1487 echo "$me: cannot read config file $1." >&2
1492 -h) shift; error=true;;
1493 -r) shift; reuseval=true;;
1494 -s) shift; silent=true; realsilent=true;;
1495 -E) shift; alldone=exit;;
1496 -K) shift; knowitall=true;;
1497 -O) shift; override=true;;
1498 -S) shift; silent=true; extractsh=true;;
1503 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1504 echo "$me: ignoring -D $1" >&2
1507 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1508 *) echo "$1='define'" >> optdef.sh;;
1515 *=) echo "$1" >> optdef.sh;;
1517 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1518 echo "$me: ignoring -U $1" >&2
1520 *) echo "$1='undef'" >> optdef.sh;;
1531 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1535 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1536 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1542 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1543 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1544 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1545 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1546 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1547 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1553 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1555 echo "$yyy=''" >> posthint.sh ;;
1560 echo "$yyy='$zzz'" >> posthint.sh ;;
1562 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1564 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1569 echo "$yyy=$zzz" >> posthint.sh ;;
1570 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1574 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1577 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1585 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1586 [-U symbol] [-U symbol=] [-A command:symbol...]
1587 -d : use defaults for all answers.
1588 -e : go on without questioning past the production of config.sh.
1589 -f : specify an alternate default configuration file.
1590 -h : print this help message and exit (with an error status).
1591 -r : reuse C symbols value if possible (skips costly nm extraction).
1592 -s : silent mode, only echoes questions and essential information.
1593 -D : define symbol to have some value:
1594 -D symbol symbol gets the value 'define'
1595 -D symbol=value symbol gets the value 'value'
1596 -E : stop at the end of questions, after having produced config.sh.
1597 -K : do not use unless you know what you are doing.
1598 -O : let -D and -U override definitions from loaded configuration file.
1599 -S : perform variable substitutions on all .SH files (can mix with -f)
1600 -U : undefine symbol:
1601 -U symbol symbol gets the value 'undef'
1602 -U symbol= symbol gets completely empty
1603 -A : manipulate symbol after the platform specific hints have been applied:
1604 -A symbol=value append " "value to symbol
1605 -A append:symbol=value append value to symbol
1606 -A define:symbol=value define symbol to have value
1607 -A clear:symbol define symbol to be ''
1608 -A define:symbol define symbol to be 'define'
1609 -A eval:symbol=value define symbol to be eval of value
1610 -A prepend:symbol=value prepend value to symbol
1611 -A undef:symbol define symbol to be 'undef'
1612 -A undef:symbol= define symbol to be ''
1613 -V : print version number and exit (with a zero status).
1620 case "$fastread$alldone" in
1623 case "$extractsh" in
1626 if test ! -t 0; then
1627 echo "Say 'sh Configure', not 'sh <Configure'"
1637 true) exec 1>/dev/null;;
1640 : run the defines and the undefines, if any, but leave the file out there...
1643 : create the posthint manipulation script and leave the file out there...
1648 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1649 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1650 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1651 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1652 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1655 : Some greps do not return status, grrr.
1656 echo "grimblepritz" >grimble
1657 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1659 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1665 : the following should work in any shell
1669 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1670 cat >contains <<'EOSS'
1671 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1676 : Find the path to the source tree
1679 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1683 *) src=`cd ../$src && pwd` ;;
1696 if test -f $rsrc/Configure && \
1697 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1699 : found it, so we are ok.
1702 for src in . .. ../.. ../../.. ../../../..; do
1703 if test -f ../$src/Configure && \
1704 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1715 Sorry, I can't seem to locate the source dir for $package. Please start
1716 Configure with an explicit path -- i.e. /some/path/Configure.
1724 echo "Sources for $package found in \"$src\"." >&4
1728 : script used to extract .SH files with variable substitutions
1729 cat >extract <<'EOS'
1731 echo "Doing variable substitutions on .SH files..."
1732 if test -f MANIFEST; then
1733 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1735 echo "(Looking for .SH files under the source directory.)"
1736 set x `(cd "$src"; find . -name "*.SH" -print)`
1740 0) set x `(cd "$src"; echo *.SH)`; shift;;
1742 if test ! -f "$src/$1"; then
1748 while test $name; do
1749 if test ! -d "$name"; then
1750 create="$name $create";
1751 name=`echo $name | sed -e "s|^[^/]*$||"`;
1752 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1757 for file in $create; do
1766 dir=`expr X$file : 'X\(.*\)/'`
1767 file=`expr X$file : 'X.*/\(.*\)'`
1768 (cd "$dir" && . ./$file)
1778 dir=`expr X$file : 'X\(.*\)/'`
1779 file=`expr X$file : 'X.*/\(.*\)'`
1780 (set x $dir; shift; eval $mkdir_p)
1781 sh <"$src/$dir/$file"
1790 if test -f "$src/config_h.SH"; then
1791 if test ! -f config.h; then
1792 : oops, they left it out of MANIFEST, probably, so do it anyway.
1793 . "$src/config_h.SH"
1798 : extract files and exit if asked to do so
1799 case "$extractsh" in
1801 case "$realsilent" in
1805 case "$config_sh" in
1806 '') config_sh='config.sh';;
1809 echo "Fetching answers from $config_sh..."
1812 test "$override" && . ./optdef.sh
1816 echo "Extraction done."
1821 : Eunice requires " " instead of "", can you believe it
1824 echo "Beginning of configuration questions for $package."
1826 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1828 : first determine how to suppress newline on echo command
1830 echo "Checking echo to see how to suppress newlines..."
1831 (echo "hi there\c" ; echo " ") >.echotmp
1832 if $contains c .echotmp >/dev/null 2>&1 ; then
1843 echo $n "The star should be here-->$c"
1847 : Now test for existence of everything in MANIFEST
1849 if test -f "$rsrc/MANIFEST"; then
1850 echo "First let's make sure your kit is complete. Checking..." >&4
1851 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1854 for filelist in x??; do
1855 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1857 if test -s missing; then
1861 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1863 You have the option of continuing the configuration process, despite the
1864 distinct possibility that your kit is damaged, by typing 'y'es. If you
1865 do, don't blame me if something goes wrong. I advise you to type 'n'o
1866 and contact the author (perlbug@perl.org).
1869 echo $n "Continue? [n] $c" >&4
1873 echo "Continuing..." >&4
1877 echo "ABORTING..." >&4
1882 echo "Looks good..."
1885 echo "There is no MANIFEST file. I hope your kit is complete !"
1890 : Find the appropriate value for a newline for tr
1891 if test -n "$DJGPP"; then
1894 if test X"$trnl" = X; then
1895 case "`echo foo|tr '\n' x 2>/dev/null`" in
1899 if test X"$trnl" = X; then
1900 case "`echo foo|tr '\012' x 2>/dev/null`" in
1901 foox) trnl='\012' ;;
1904 if test X"$trnl" = X; then
1905 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1906 fooxy) trnl='\n\r' ;;
1909 if test X"$trnl" = X; then
1912 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1918 : compute the number of columns on the terminal for proper question formatting
1923 : set up the echo used in my read
1924 myecho="case \"\$xxxm\" in
1925 '') echo $n \"\$rp $c\" >&4;;
1927 '') echo $n \"[\$xxxm] $c\";;
1929 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1931 echo $n \"[\$xxxm] $c\" >&4
1933 echo $n \"\$rp [\$xxxm] $c\" >&4
1939 : now set up to do reads with possible shell escape and default assignment
1945 case "\$fastread" in
1946 yes) case "\$dflt" in
1949 case "\$silent-\$rp" in
1954 *) case "\$silent" in
1955 true) case "\$rp" in
1960 while expr "X\$ans" : "X!" >/dev/null; do
1964 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1972 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1981 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1986 echo "(OK, I'll run with -d after this question.)" >&4
1989 echo "*** Sorry, \$1 not supported yet." >&4
1999 echo "*** Substitution done -- please confirm."
2001 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2006 echo "*** Error -- try again."
2013 case "\$ans\$xxxm\$nostick" in
2025 : create .config dir to save info across Configure sessions
2026 test -d ../.config || mkdir ../.config
2027 cat >../.config/README <<EOF
2028 This directory created by Configure to save information that should
2029 persist across sessions for $package.
2031 You may safely delete it if you wish.
2034 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2036 $define|true|[yY]*) ;;
2037 *) case "$xversion" in
2040 *** WHOA THERE!!! ***
2042 This is an UNSTABLE DEVELOPMENT release.
2043 The version of this $package distribution is $xversion, that is, odd,
2044 (as opposed to even) and that signifies a development release.
2045 If you want a maintenance release, you want an even-numbered version.
2047 Do ***NOT*** install this into production use.
2048 Data corruption and crashes are possible.
2050 It is most seriously suggested that you do not continue any further
2051 unless you want to help in developing and debugging Perl.
2053 If you *still* want to build perl, you can answer 'y' now,
2054 or pass -Dusedevel to Configure.
2057 rp='Do you really want to continue?'
2061 [yY]) echo >&4 "Okay, continuing."
2062 usedevel="$define" ;;
2063 *) echo >&4 "Okay, bye."
2073 case "$versiononly" in
2074 '') versiononly="$define" ;;
2076 case "$installusrbinperl" in
2077 '') installusrbinperl="$undef" ;;
2082 : general instructions
2085 user=`(logname) 2>/dev/null`
2087 '') user=`whoami 2>&1`;;
2089 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2092 rp='Would you like to see the instructions?'
2103 This installation shell script will examine your system and ask you questions
2104 to determine how the perl5 package should be installed. If you get
2105 stuck on a question, you may use a ! shell escape to start a subshell or
2106 execute a command. Many of the questions will have default answers in square
2107 brackets; typing carriage return will give you the default.
2109 On some of the questions which ask for file or directory names you are allowed
2110 to use the ~name construct to specify the login directory belonging to "name",
2111 even if you don't have a shell which knows about that. Questions where this is
2112 allowed will be marked "(~name ok)".
2116 dflt='Type carriage return to continue'
2120 The prompter used in this script allows you to use shell variables and
2121 backticks in your answers. You may use $1, $2, etc... to refer to the words
2122 in the default answer, as if the default line was a set of arguments given to a
2123 script shell. This means you may also use $* to repeat the whole default line,
2124 so you do not have to re-type everything to add something to the default.
2126 Everytime there is a substitution, you will have to confirm. If there is an
2127 error (e.g. an unmatched backtick), the default answer will remain unchanged
2128 and you will be prompted again.
2130 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2131 the questions and use the computed defaults (or the previous answers if there
2132 was already a config.sh file). Type 'Configure -h' for a list of options.
2133 You may also start interactively and then answer '& -d' at any prompt to turn
2134 on the non-interactive behaviour for the remainder of the execution.
2140 Much effort has been expended to ensure that this shell script will run on any
2141 Unix system. If despite that it blows up on yours, your best bet is to edit
2142 Configure and run it again. If you can't run Configure for some reason,
2143 you'll have to generate a config.sh file by hand. Whatever problems you
2144 have, let me (perlbug@perl.org) know how I blew it.
2146 This installation script affects things in two ways:
2148 1) it may do direct variable substitutions on some of the files included
2150 2) it builds a config.h file for inclusion in C programs. You may edit
2151 any of these files as the need arises after running this script.
2153 If you make a mistake on a question, there is no easy way to back up to it
2154 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2155 files. Configure will offer to let you do this before it runs the SH files.
2158 dflt='Type carriage return to continue'
2160 case "$firsttime" in
2161 true) echo $user >>../.config/instruct;;
2165 : find out where common programs are
2167 echo "Locating common programs..." >&4
2180 if test -d \$dir/\$thing; then
2186 for thisthing in \$dir/\$thing; do
2187 : just loop through to pick last item
2189 if test -f \$thisthing; then
2192 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2195 elif test -f \$dir/\$thing.exe; then
2196 if test -n "$DJGPP"; then
2197 echo \$dir/\$thing.exe
2198 elif test "$eunicefix" != ":"; then
2199 : on Eunice apparently
2253 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2254 pth="$pth /lib /usr/lib"
2255 for file in $loclist; do
2259 if test -f "$xxx"; then
2262 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2263 xxx=`./loc $file $file $pth`
2266 '') xxx=`./loc $file $file $pth`;;
2267 *) xxx=`./loc $xxx $xxx $pth`;;
2269 eval $file=$xxx$_exe
2273 echo $file is in $xxx.
2276 echo $file is in $xxx.
2279 echo "I don't know where '$file' is, and my life depends on it." >&4
2280 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2286 echo "Don't worry if any of the following aren't found..."
2288 for file in $trylist; do
2292 if test -f "$xxx"; then
2295 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2296 xxx=`./loc $file $file $pth`
2299 '') xxx=`./loc $file $file $pth`;;
2300 *) xxx=`./loc $xxx $xxx $pth`;;
2302 eval $file=$xxx$_exe
2306 echo $file is in $xxx.
2309 echo $file is in $xxx.
2312 echo "I don't see $file out there, $say."
2319 echo "Substituting grep for egrep."
2326 echo "Substituting cp for ln."
2335 echo "I can't find make or gmake, and my life depends on it." >&4
2336 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2344 *) # We can't have osname yet.
2345 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2346 # Assume that gmake, if found, is definitely GNU make
2347 # and prefer it over the system make.
2348 echo "Substituting gmake for make."
2356 echo "Hopefully test is built into your sh."
2359 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2360 echo "Using the test built into your sh."
2368 echo "Hopefully echo is built into your sh."
2373 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2374 $echo $n "hi there$c" >foo1
2375 echo $n "hi there$c" >foo2
2376 if cmp foo1 foo2 >/dev/null 2>&1; then
2377 echo "They are compatible. In fact, they may be identical."
2384 They are not compatible! You are probably running ksh on a non-USG system.
2385 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2386 have echo built in and we may have to run some Bourne shell scripts. That
2387 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2390 $echo $n "The star should be here-->$c"
2400 cat <<'EOSC' >>trygcc
2405 int main(int argc, char *argv[]) {
2409 if $cc -o try $ccflags $ldflags try.c; then
2412 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2418 case "`$cc -v -c try.c 2>&1`" in
2421 if $test X"$trygcc" = Xyes; then
2422 if gcc -o try -c try.c; then
2424 echo "You seem to have a working gcc, though." >&4
2425 rp="Would you like to use it?"
2427 if $test -f myread; then
2430 if $test -f UU/myread; then
2433 echo "Cannot find myread, sorry. Aborting." >&2
2438 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2439 if $test -f usethreads.cbu; then
2442 *** However, any setting of the C compiler flags (e.g. for thread support)
2443 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2444 *** (together with e.g. -Dusethreads).
2460 cat <<'EOSC' >>checkcc
2465 int main(int argc, char *argv[]) {
2469 if $cc -o try $ccflags $ldflags try.c; then
2472 if $test X"$despair" = Xyes; then
2473 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2476 You need to find a working C compiler.
2477 Either (purchase and) install the C compiler supplied by your OS vendor,
2478 or for a free C compiler try http://gcc.gnu.org/
2479 I cannot continue any further, aborting.
2488 : determine whether symbolic links are supported
2491 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2492 echo "Symbolic links are supported." >&4
2495 echo "Symbolic links are NOT supported." >&4
2500 : determine whether symbolic links are supported
2504 echo "Checking how to test for symbolic links..." >&4
2506 if $test "X$issymlink" = X; then
2508 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2509 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2511 if test $? = 0; then
2514 echo "Your builtin 'test -h' may be broken." >&4
2517 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2520 if test -f "$p/$test"; then
2529 echo "Trying external '$test -h'." >&4
2530 issymlink="$test -h"
2531 if $test ! -h sym >/dev/null 2>&1; then
2532 echo "External '$test -h' is broken, too." >&4
2540 if $test "X$issymlink" = X; then
2541 if $test -L sym 2>/dev/null; then
2542 issymlink="$test -L"
2543 echo "The builtin '$test -L' worked." >&4
2546 if $test "X$issymlink" != X; then
2547 echo "You can test for symbolic links with '$issymlink'." >&4
2549 echo "I do not know how you can test for symbolic links." >&4
2553 *) echo "No symbolic links, so not testing for their testing..." >&4
2559 case "$mksymlinks" in
2562 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2565 *) case "$lns:$issymlink" in
2566 *"ln"*" -s:"*"test -"?)
2567 echo "Creating the symbolic links..." >&4
2568 echo "(First creating the subdirectories...)" >&4
2570 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2572 test -z "$directory" && break
2576 if test ! -d t/base; then
2577 echo "Failed to create the subdirectories. Aborting." >&4
2580 echo "(Then creating the symlinks...)" >&4
2581 awk '{print $1}' $src/MANIFEST | while true; do
2583 test -z "$filename" && break
2584 if test -f $filename; then
2585 if $issymlink $filename; then
2589 if test -f $filename; then
2590 echo "$filename already exists, not symlinking."
2592 ln -s $src/$filename $filename
2596 if test ! -f t/base/lex.t; then
2597 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2602 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2611 case "$usecrosscompile" in
2613 $echo "Cross-compiling..."
2616 *-*-gcc) # A cross-compiling gcc, probably.
2617 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2619 # leave out ld, choosing it is more complex
2621 ranlib=$targetarch-ranlib
2622 $echo 'extern int foo;' > try.c
2623 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2625 if $test $# -gt 0; then
2627 incpth="`$echo $incpth|$sed 's/^ //'`"
2628 echo "Guessing incpth '$incpth'." >&4
2630 j="`$echo $i|$sed 's,/include$,/lib,'`"
2631 if $test -d $j; then
2635 libpth="`$echo $libpth|$sed 's/^ //'`"
2636 echo "Guessing libpth '$libpth'." >&4
2641 case "$targetarch" in
2642 '') echo "Targetarch not defined." >&4; croak=y ;;
2643 *) echo "Using targetarch $targetarch." >&4 ;;
2646 '') echo "Incpth not defined." >&4; croak=y ;;
2647 *) echo "Using incpth '$incpth'." >&4 ;;
2650 '') echo "Libpth not defined." >&4; croak=y ;;
2651 *) echo "Using libpth '$libpth'." >&4 ;;
2654 '') for i in $incpth; do
2655 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2657 echo "Guessing usrinc $usrinc." >&4
2662 '') echo "Usrinc not defined." >&4; croak=y ;;
2665 *) echo "Using usrinc $usrinc." >&4 ;;
2667 case "$targethost" in
2668 '') echo "Targethost not defined." >&4; croak=y ;;
2669 *) echo "Using targethost $targethost." >&4
2674 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2677 /*) run=$src/Cross/run
2678 targetmkdir=$src/Cross/mkdir
2680 from=$src/Cross/from
2682 *) pwd=`$test -f ../Configure & cd ..; pwd`
2684 targetmkdir=$pwd/Cross/mkdir
2686 from=$pwd/Cross/from
2689 case "$targetrun" in
2690 '') targetrun=ssh ;;
2695 case "$targetfrom" in
2696 '') targetfrom=scp ;;
2700 from=$from-$targetfrom
2701 case "$targetdir" in
2703 echo "Guessing targetdir $targetdir." >&4
2706 case "$targetuser" in
2708 echo "Guessing targetuser $targetuser." >&4
2711 case "$targetfrom" in
2715 case "$targetrun" in
2727 '') cwd=$targetdir ;;
2731 if $test ! -f \$exe.xok; then
2735 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2738 *) echo "Unknown targetrun '$targetrun'" >&4
2742 case "$targetmkdir" in
2744 cat >$targetmkdir <<EOF
2746 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2748 $chmod a+rx $targetmkdir
2750 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2762 $targetmkdir \`dirname \$f\`
2763 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2766 $targetmkdir $targetdir/\`dirname \$f\`
2767 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2780 $mkdir -p $targetdir/\`dirname \$f\`
2781 $cp \$f $targetdir/\$f || exit 1
2784 $targetmkdir $targetdir/\`dirname \$f\`
2785 $cp \$f $targetdir/\$f || exit 1
2792 *) echo "Unknown targetto '$targetto'" >&4
2796 case "$targetfrom" in
2803 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2808 cp) cat >$from <<EOF
2813 cp $targetdir/\$f . || exit 1
2818 *) echo "Unknown targetfrom '$targetfrom'" >&4
2822 if $test ! -f $run; then
2823 echo "Target 'run' script '$run' not found." >&4
2827 if $test ! -f $to; then
2828 echo "Target 'to' script '$to' not found." >&4
2832 if $test ! -f $from; then
2833 echo "Target 'from' script '$from' not found." >&4
2837 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2841 Using '$run' for remote execution,
2842 and '$from' and '$to'
2843 for remote file transfer.
2849 usecrosscompile='undef'
2854 : see whether [:lower:] and [:upper:] are supported character classes
2856 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2858 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2862 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2863 # (0xc9 and 0xd1), therefore that is a nice testing point.
2864 if test "X$up" = X -o "X$low" = X; then
2865 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2871 if test "X$up" = X -o "X$low" = X; then
2872 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2878 if test "X$up" = X -o "X$low" = X; then
2879 case "`echo IJ | od -x 2>/dev/null`" in
2881 echo "Hey, this might be EBCDIC." >&4
2882 if test "X$up" = X -o "X$low" = X; then
2883 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2884 ij) up='[A-IJ-RS-Z]'
2889 if test "X$up" = X -o "X$low" = X; then
2890 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2900 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2902 echo "Using $up and $low to convert case." >&4
2905 echo "I don't know how to translate letters from upper to lower case." >&4
2906 echo "Your tr is not acting any way I know of." >&4
2910 : set up the translation script tr, must be called with ./tr of course
2914 '[A-Z][a-z]') exec $tr '$up' '$low';;
2915 '[a-z][A-Z]') exec $tr '$low' '$up';;
2922 : Try to determine whether config.sh was made on this system
2923 case "$config_sh" in
2925 myuname=`$uname -a 2>/dev/null`
2926 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2927 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2928 # because the A-Z/a-z are not consecutive.
2929 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2930 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2931 newmyuname="$myuname"
2933 case "$knowitall" in
2935 if test -f ../config.sh; then
2936 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2937 eval "`grep myuname= ../config.sh`"
2939 if test "X$myuname" = "X$newmyuname"; then
2947 : Get old answers from old config file if Configure was run on the
2948 : same system, otherwise use the hints.
2951 if test -f config.sh; then
2953 rp="I see a config.sh file. Shall I use it to set the defaults?"
2956 n*|N*) echo "OK, I'll ignore it."
2957 mv config.sh config.sh.old
2958 myuname="$newmyuname"
2960 *) echo "Fetching default answers from your old config.sh file..." >&4
2968 : Older versions did not always set $sh. Catch re-use of such
2978 if test ! -f config.sh; then
2981 First time through, eh? I have some defaults handy for some systems
2982 that need some extra help getting the Configure answers right:
2985 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2987 : Half the following guesses are probably wrong... If you have better
2988 : tests or hints, please send them to perlbug@perl.org
2989 : The metaconfig authors would also appreciate a copy...
2990 $test -f /irix && osname=irix
2991 $test -f /xenix && osname=sco_xenix
2992 $test -f /dynix && osname=dynix
2993 $test -f /dnix && osname=dnix
2994 $test -f /lynx.os && osname=lynxos
2995 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2996 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2997 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2998 $test -f /bin/mips && /bin/mips && osname=mips
2999 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3000 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3001 $test -d /usr/apollo/bin && osname=apollo
3002 $test -f /etc/saf/_sactab && osname=svr4
3003 $test -d /usr/include/minix && osname=minix
3004 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3005 if $test -d /MachTen -o -d /MachTen_Folder; then
3007 if $test -x /sbin/version; then
3008 osvers=`/sbin/version | $awk '{print $2}' |
3009 $sed -e 's/[A-Za-z]$//'`
3010 elif $test -x /usr/etc/version; then
3011 osvers=`/usr/etc/version | $awk '{print $2}' |
3012 $sed -e 's/[A-Za-z]$//'`
3018 $test -f /sys/posix.dll &&
3019 $test -f /usr/bin/what &&
3020 set X `/usr/bin/what /sys/posix.dll` &&
3021 $test "$3" = UWIN &&
3025 if $test -f $uname; then
3033 umips) osname=umips ;;
3036 [23]100) osname=mips ;;
3037 next*) osname=next ;;
3039 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3040 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3043 elif $test -f /etc/kconfig; then
3045 if test "$lns" = "$ln -s"; then
3047 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3049 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3056 if test -n "$DJGPP"; then
3065 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3067 'not found') osvers="$4"."$3" ;;
3068 '<3240'|'<>3240') osvers=3.2.0 ;;
3069 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3070 '=3250'|'>3250') osvers=3.2.5 ;;
3074 bsd386) osname=bsd386
3077 cygwin*) osname=cygwin
3080 *dc.osx) osname=dcosx
3086 domainos) osname=apollo
3092 dynixptx*) osname=dynixptx
3093 osvers=`echo "$4"|sed 's/^v//'`
3095 freebsd) osname=freebsd
3097 genix) osname=genix ;;
3099 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3115 netbsd*) osname=netbsd
3118 news-os) osvers="$3"
3120 4*) osname=newsos4 ;;
3124 next*) osname=next ;;
3125 nonstop-ux) osname=nonstopux ;;
3126 openbsd) osname=openbsd
3129 POSIX-BC | posix-bc ) osname=posix-bc
3132 powerux | power_ux | powermax_os | powermaxos | \
3133 powerunix | power_unix) osname=powerux
3139 solaris) osname=solaris
3141 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3148 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3152 titanos) osname=titanos
3161 ultrix) osname=ultrix
3164 osf1|mls+) case "$5" in
3167 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3170 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3173 hp*) osname=hp_osf1 ;;
3174 mips) osname=mips_osf1 ;;
3177 unixware) osname=svr5
3185 $2) case "$osname" in
3189 : svr4.x or possibly later
3199 if test -f /stand/boot ; then
3200 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3201 if test -n "$INITPROG" -a -f "$INITPROG"; then
3202 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3203 if test -n "$isesix"; then
3211 *) if test -f /etc/systemid; then
3213 set `echo $3 | $sed 's/\./ /g'` $4
3214 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3216 elif $test -f $src/hints/sco_$1_$2.sh; then
3218 elif $test -f $src/hints/sco_$1.sh; then
3223 '') : Still unknown. Probably a generic Sys V.
3232 *) case "$osname" in
3233 '') : Still unknown. Probably a generic BSD.
3241 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3242 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3243 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3246 $rm -f UU/kernel.what
3247 elif test -d c:/.; then
3254 case "$targetarch" in
3257 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3262 : Now look for a hint file osname_osvers, unless one has been
3263 : specified already.
3266 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3267 : Also try without trailing minor version numbers.
3268 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3269 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3270 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3271 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3274 *) case "$osvers" in
3277 *) if $test -f $src/hints/$file.sh ; then
3279 elif $test -f $src/hints/$xfile.sh ; then
3281 elif $test -f $src/hints/$xxfile.sh ; then
3283 elif $test -f $src/hints/$xxxfile.sh ; then
3285 elif $test -f $src/hints/$xxxxfile.sh ; then
3287 elif $test -f "$src/hints/${osname}.sh" ; then
3296 if $test -f Policy.sh ; then
3299 none) dflt="Policy" ;;
3300 *) dflt="Policy $dflt" ;;
3305 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3309 if $test -f Policy.sh ; then
3312 There's also a Policy hint file available, which should make the
3313 site-specific (policy) questions easier to answer.
3320 You may give one or more space-separated answers, or "none" if appropriate.
3321 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3322 is a good thing. DO NOT give a wrong version or a wrong OS.
3326 rp="Which of these apply, if any?"
3329 for file in $tans; do
3330 if $test X$file = XPolicy -a -f Policy.sh; then
3332 $cat Policy.sh >> UU/config.sh
3333 elif $test -f $src/hints/$file.sh; then
3334 . $src/hints/$file.sh
3335 $cat $src/hints/$file.sh >> UU/config.sh
3336 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3339 : Give one chance to correct a possible typo.
3340 echo "$file.sh does not exist"
3342 rp="hint to use instead?"
3344 for file in $ans; do
3345 if $test -f "$src/hints/$file.sh"; then
3346 . $src/hints/$file.sh
3347 $cat $src/hints/$file.sh >> UU/config.sh
3348 elif $test X$ans = X -o X$ans = Xnone ; then
3351 echo "$file.sh does not exist -- ignored."
3358 : Remember our hint file for later.
3359 if $test -f "$src/hints/$file.sh" ; then
3369 echo "Fetching default answers from $config_sh..." >&4
3373 cp $config_sh config.sh 2>/dev/null
3383 test "$override" && . ./optdef.sh
3385 : Restore computed paths
3386 for file in $loclist $trylist; do
3387 eval $file="\$_$file"
3392 Configure uses the operating system name and version to set some defaults.
3393 The default value is probably right if the name rings a bell. Otherwise,
3394 since spelling matters for me, either accept the default or answer "none"
3401 ''|' '|none) dflt=none ;;
3402 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3405 *) dflt="$osname" ;;
3407 rp="Operating system name?"
3411 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3417 ''|' '|none) dflt=none ;;
3418 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3419 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3421 ''|' ') dflt=none ;;
3426 *) dflt="$osvers" ;;
3428 rp="Operating system version?"
3438 : who configured the system
3439 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3440 cf_by=`(logname) 2>/dev/null`
3443 cf_by=`(whoami) 2>/dev/null`
3445 "") cf_by=unknown ;;
3449 : set up the script used to warn in case of inconsistency
3456 echo "*** WHOA THERE!!! ***" >&4
3457 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3458 rp=" Keep the $hint value?"
3461 y) td=$was; tu=$was;;
3465 : function used to set $1 to $val
3466 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3468 $define$undef) . ./whoa; eval "$var=\$td";;
3469 $undef$define) . ./whoa; eval "$var=\$tu";;
3470 *) eval "$var=$val";;
3474 $define|true|[yY]*) dflt='y';;
3479 Perl can be built to use the SOCKS proxy protocol library. To do so,
3480 Configure must be run with -Dusesocks. If you use SOCKS you also need
3481 to use the PerlIO abstraction layer, this will be implicitly selected.
3483 If this doesn't make any sense to you, just accept the default '$dflt'.
3485 rp='Build Perl for SOCKS?'
3488 y|Y) val="$define" ;;
3495 $define|true|[yY]*) useperlio="$define";;
3498 case "$useperlio" in
3499 $define|true|[yY]*|'') dflt='y';;
3504 Previous version of $package used the standard IO mechanisms as
3505 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3506 alternate IO mechanisms via the PerlIO abstraction layer, but the
3507 stdio mechanism is still available if needed. The abstraction layer
3508 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3509 Using PerlIO with sfio may cause problems with some extension modules.
3511 If this doesn't make any sense to you, just accept the default '$dflt'.
3513 rp='Use the PerlIO abstraction layer?'
3520 echo "Ok, doing things the stdio way."
3529 case "$useperlio" in
3530 $define|true|[yY]*) ;;
3533 You are using the SOCKS proxy protocol library which means that you
3534 should also use the PerlIO layer. You may be headed for trouble.
3543 case "$usethreads" in
3544 $define|true|[yY]*) dflt='y';;
3545 *) # Catch case where user specified ithreads or 5005threads but
3546 # forgot -Dusethreads (A.D. 4/2002)
3547 case "$useithreads$use5005threads" in
3549 case "$useperlio" in
3550 "$define") dflt='y' ;;
3560 Perl can be built to take advantage of threads on some systems.
3561 To do so, Configure can be run with -Dusethreads.
3563 Note that Perl built with threading support runs slightly slower
3564 and uses more memory than plain Perl. The current implementation
3565 is believed to be stable, but it is fairly new, and so should be
3566 treated with caution.
3568 If this doesn't make any sense to you, just accept the default '$dflt'.
3570 rp='Build a threading Perl?'
3573 y|Y) val="$define" ;;
3579 case "$usethreads" in
3583 Since release 5.6, Perl has had two different threading implementations,
3584 the newer interpreter-based version (ithreads) with one interpreter per
3585 thread, and the older 5.005 version (5005threads).
3586 The 5005threads version is effectively unmaintained and will probably be
3587 removed in Perl 5.10, so there should be no need to build a Perl using it
3588 unless needed for backwards compatibility with some existing 5.005threads
3592 : Default to ithreads unless overridden on command line or with
3595 case "$use5005threads" in
3596 $define|true|[yY]*) dflt='n';;
3598 case "$useithreads" in
3599 $undef|false|[nN]*) dflt='n';;
3601 rp='Use the newer interpreter-based ithreads?'
3604 y|Y) val="$define" ;;
3609 : Now set use5005threads to the opposite value.
3610 case "$useithreads" in
3611 $define) val="$undef" ;;
3618 useithreads="$undef"
3619 use5005threads="$undef"
3623 case "$useithreads$use5005threads" in
3627 You cannot have both the ithreads and the 5.005 threads enabled
3628 at the same time. Disabling the 5.005 threads since they are
3629 much less stable than the ithreads.
3632 use5005threads="$undef"
3636 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3639 *** To build with ithreads you must also use the PerlIO layer.
3640 *** Cannot continue, aborting.
3646 case "$d_oldpthreads" in
3647 '') : Configure tests would be welcome here. For now, assume undef.
3649 *) val="$d_oldpthreads" ;;
3655 case "$usethreads" in
3656 "$define"|true|[yY]*)
3657 : Look for a hint-file generated 'call-back-unit'. If the
3658 : user has specified that a threading perl is to be built,
3659 : we may need to set or change some other defaults.
3660 if $test -f usethreads.cbu; then
3661 echo "Your platform has some specific hints for threaded builds, using them..."
3665 (Your platform doesn't have any specific hints for threaded builds.
3666 Assuming POSIX threads, then.)
3674 Perl can be built so that multiple Perl interpreters can coexist
3675 within the same Perl executable.
3678 case "$useithreads" in
3681 This multiple interpreter support is required for interpreter-based threads.
3685 *) case "$usemultiplicity" in
3686 $define|true|[yY]*) dflt='y';;
3690 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3691 rp='Build Perl for multiplicity?'
3694 y|Y) val="$define" ;;
3703 case "$usemorebits" in
3704 "$define"|true|[yY]*)
3705 use64bitint="$define"
3706 uselongdouble="$define"
3707 usemorebits="$define"
3709 *) usemorebits="$undef"
3713 : make some quick guesses about what we are up against
3715 $echo $n "Hmm... $c"
3725 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3726 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3728 echo "Looks kind of like an OSF/1 system, but we'll see..."
3730 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3731 xxx=`./loc addbib blurfl $pth`
3732 if $test -f $xxx; then
3733 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3737 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3738 echo "Looks kind of like an extended USG system, but we'll see..."
3740 echo "Looks kind of like a USG system, but we'll see..."
3744 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3745 echo "Looks kind of like a BSD system, but we'll see..."
3749 echo "Looks kind of like a Version 7 system, but we'll see..."
3752 case "$eunicefix" in
3755 There is, however, a strange, musty smell in the air that reminds me of
3756 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3760 : it so happens the Eunice I know will not run shell scripts in Unix format
3764 echo "Congratulations. You aren't running Eunice."
3768 : Detect OS2. The p_ variable is set above in the Head.U unit.
3769 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3770 : semicolon as a patch separator
3775 I have the feeling something is not exactly right, however...don't tell me...
3776 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3777 (Or you may be running DOS with DJGPP.)
3782 if test -f /xenix; then
3783 echo "Actually, this looks more like a XENIX system..."
3788 echo "It's not Xenix..."
3793 if test -f /venix; then
3794 echo "Actually, this looks more like a VENIX system..."
3801 echo "Nor is it Venix..."
3804 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3805 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3812 rp="Use which C compiler?"
3816 : See if they have not cc but they do have gcc
3818 : Look for a hint-file generated 'call-back-unit'. Now that the
3819 : user has specified the compiler, we may need to set or change some
3821 if $test -f cc.cbu; then
3827 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3833 printf("%s\n", __VERSION__);
3835 printf("%s\n", "1");
3841 if $cc -o try $ccflags $ldflags try.c; then
3842 gccversion=`$run ./try`
3843 case "$gccversion" in
3844 '') echo "You are not using GNU cc." ;;
3845 *) echo "You are using GNU cc $gccversion."
3851 echo "*** WHOA THERE!!! ***" >&4
3852 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3853 case "$knowitall" in
3855 echo " You'd better start hunting for one and let me know about it." >&4
3861 case "$gccversion" in
3862 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3864 case "$gccversion" in
3865 '') gccosandvers='' ;;
3866 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3867 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3869 case "$gccosandvers" in
3870 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3871 $osname$osvers) ;; # looking good
3872 $osname*) cat <<EOM >&4
3874 *** WHOA THERE!!! ***
3876 Your gcc has not been compiled for the exact release of
3877 your operating system ($gccosandvers versus $osname$osvers).
3879 In general it is a good idea to keep gcc synchronized with
3880 the operating system because otherwise serious problems
3881 may ensue when trying to compile software, like Perl.
3883 I'm trying to be optimistic here, though, and will continue.
3884 If later during the configuration and build icky compilation
3885 problems appear (headerfile conflicts being the most common
3886 manifestation), I suggest reinstalling the gcc to match
3887 your operating system release.
3891 *) gccosandvers='' ;; # failed to parse, better be silent
3899 # gcc 3.* complain about adding -Idirectories that they already know about,
3900 # so we will take those off from locincpth.
3901 case "$gccversion" in
3903 echo "main(){}">try.c
3904 for incdir in $locincpth; do
3905 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3906 grep '^c[cp]p*[01]: warning: changing search order '`
3907 if test "X$warn" != X; then
3908 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3914 : decide how portable to be. Allow command line overrides.
3915 case "$d_portable" in
3917 *) d_portable="$define" ;;
3920 : set up shell script to do ~ expansion
3926 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3929 if $test -f /bin/csh; then
3930 /bin/csh -f -c "glob \$1"
3935 name=\`$expr x\$1 : '..\([^/]*\)'\`
3936 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3937 if $test ! -d "\$dir"; then
3939 echo "\$me: can't locate home directory for: \$name" >&2
3944 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3960 : now set up to get a file name
3964 cat <<'EOSC' >>getfile
3980 : getfile will accept an answer from the comma-separated list
3981 : enclosed in parentheses even if it does not meet other criteria.
3982 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3983 fn=`echo $fn | sed 's/(.*)//'`
3989 loc_file=`expr $fn : '.*:\(.*\)'`
3990 fn=`expr $fn : '\(.*\):.*'`
3998 */*) fullpath=true;;
4007 *e*) exp_file=true;;
4010 *p*) nopath_ok=true;;
4015 *d*) type='Directory';;
4016 *l*) type='Locate';;
4021 Locate) what='File';;
4026 case "$d_portable" in
4034 while test "$type"; do
4039 true) rp="$rp (~name ok)";;
4042 if test -f UU/getfile.ok && \
4043 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4062 value=`UU/filexp $ans`
4065 if test "$ans" != "$value"; then
4066 echo "(That expands to $value on this system.)"
4080 /*) value="$ansexp" ;;
4081 [a-zA-Z]:/*) value="$ansexp" ;;
4086 echo "I shall only accept a full path name, as in /bin/ls." >&4
4087 echo "Use a ! shell escape if you wish to check pathnames." >&4
4090 echo "Please give a full path name, starting with slash." >&4
4093 echo "Note that using ~name is ok provided it expands well." >&4
4106 for fp in $gfpth; do
4107 if test "X$fp" = X.; then
4112 if test -f "$pf"; then
4114 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4116 echo "($value is not a plain file, but that's ok.)"
4119 if test X"$type" = X; then
4126 for fp in $gfpth; do
4127 if test "X$fp" = X.; then
4132 direxp="$fp/$ansexp"
4134 if test -d "$direxp"; then
4142 if test -d "$ansexp"; then
4143 echo "(Looking for $loc_file in directory $value.)"
4144 value="$value/$loc_file"
4145 ansexp="$ansexp/$loc_file"
4147 if test -f "$ansexp"; then
4150 case "$nopath_ok" in
4151 true) case "$value" in
4153 *) echo "Assuming $value will be in people's path."
4169 if test "$fastread" = yes; then
4174 rp="$what $value doesn't exist. Use that name anyway?"
4193 test "X$gfpthkeep" != Xy && gfpth=""
4196 : What should the include directory be ?
4198 $echo $n "Hmm... $c"
4202 if $test -f /bin/mips && /bin/mips; then
4203 echo "Looks like a MIPS system..."
4204 $cat >usr.c <<'EOCP'
4205 #ifdef SYSTYPE_BSD43
4209 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4210 dflt='/bsd43/usr/include'
4214 mips_type='System V'
4216 $rm -f usr.c usr.out
4217 echo "and you're compiling with the $mips_type compiler and libraries."
4221 echo "Doesn't look like a MIPS system."
4231 case "$xxx_prompt" in
4234 rp='Where are the include files you want to use?'
4242 : see how we invoke the C preprocessor
4244 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4245 cat <<'EOT' >testcpp.c
4251 if test ! -f cppstdin; then
4252 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4253 # AIX cc -E doesn't show the absolute headerfile
4254 # locations but we'll cheat by using the -M flag.
4255 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
4257 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4260 echo "Keeping your $hint cppstdin wrapper."
4263 wrapper=`pwd`/cppstdin
4267 if $test "X$cppstdin" != "X" && \
4268 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4269 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4271 echo "You used to use $cppstdin $cppminus so we'll use that again."
4273 '') echo "But let's see if we can live without a wrapper..." ;;
4275 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4276 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4278 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4281 echo "(However, $cpprun $cpplast does not work, let's see...)"
4289 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4296 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4297 $cc -E <testcpp.c >testcpp.out 2>&1; \
4298 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4299 echo "Yup, it does."
4302 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4303 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4304 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4305 echo "Yup, it does."
4308 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4309 $cc -P <testcpp.c >testcpp.out 2>&1; \
4310 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4311 echo "Yipee, that works!"
4314 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4315 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4316 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4317 echo "At long last!"
4320 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4321 $cpp <testcpp.c >testcpp.out 2>&1; \
4322 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4326 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4327 $cpp - <testcpp.c >testcpp.out 2>&1; \
4328 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4329 echo "Hooray, it works! I was beginning to wonder."
4332 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4333 $wrapper <testcpp.c >testcpp.out 2>&1; \
4334 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4340 rp="No dice. I can't find a C preprocessor. Name one:"
4344 $x_cpp <testcpp.c >testcpp.out 2>&1
4345 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4346 echo "OK, that will do." >&4
4348 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4363 echo "Perhaps can we force $cc -E using a wrapper..."
4364 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4365 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4371 echo "Nope, we'll have to live without it..."
4385 "$wrapper"|'cppstdin') ;;
4386 *) $rm -f $wrapper;;
4388 $rm -f testcpp.c testcpp.out
4390 : Set private lib path
4393 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4398 '') dlist="$loclibpth $plibpth $glibpth";;
4399 *) dlist="$libpth";;
4402 : Now check and see which directories actually exist, avoiding duplicates
4406 if $test -d $xxx; then
4409 *) libpth="$libpth $xxx";;
4415 Some systems have incompatible or broken versions of libraries. Among
4416 the directories listed in the question below, please remove any you
4417 know not to be holding relevant libraries, and add any that are needed.
4418 Say "none" for none.
4429 rp="Directories to use for library searches?"
4436 : compute shared library extension
4439 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4449 On some systems, shared libraries may be available. Answer 'none' if
4450 you want to suppress searching of shared libraries for the remainder
4451 of this configuration.
4454 rp='What is the file extension used for shared libraries?'
4458 : Define several unixisms.
4459 : Hints files or command line option can be used to override them.
4460 : The convoluted testing is in case hints files set either the old
4463 '') case "$exe_ext" in
4465 *) _exe="$exe_ext" ;;
4470 '') case "$lib_ext" in
4477 '') case "$obj_ext" in
4484 '') case "$path_sep" in
4495 : Which makefile gets called first. This is used by make depend.
4496 case "$firstmakefile" in
4497 '') firstmakefile='makefile';;
4500 : Looking for optional libraries
4502 echo "Checking for optional libraries..." >&4
4507 case "$libswanted" in
4508 '') libswanted='c_s';;
4511 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4517 for thisdir in $libpth $xlibpth; do
4518 test -d $thisdir && libspath="$libspath $thisdir"
4520 for thislib in $libswanted; do
4521 for thisdir in $libspath; do
4523 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4524 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4525 $test -f "$xxx" && eval $libscheck
4526 $test -f "$xxx" && libstyle=shared
4528 if test ! -f "$xxx"; then
4529 xxx=$thisdir/lib$thislib.$so
4530 $test -f "$xxx" && eval $libscheck
4531 $test -f "$xxx" && libstyle=shared
4533 if test ! -f "$xxx"; then
4534 xxx=$thisdir/lib$thislib$_a
4535 $test -f "$xxx" && eval $libscheck
4536 $test -f "$xxx" && libstyle=static
4538 if test ! -f "$xxx"; then
4539 xxx=$thisdir/$thislib$_a
4540 $test -f "$xxx" && eval $libscheck
4541 $test -f "$xxx" && libstyle=static
4543 if test ! -f "$xxx"; then
4544 xxx=$thisdir/lib${thislib}_s$_a
4545 $test -f "$xxx" && eval $libscheck
4546 $test -f "$xxx" && libstyle=static
4547 $test -f "$xxx" && thislib=${thislib}_s
4549 if test ! -f "$xxx"; then
4550 xxx=$thisdir/Slib$thislib$_a
4551 $test -f "$xxx" && eval $libscheck
4552 $test -f "$xxx" && libstyle=static
4554 if $test -f "$xxx"; then
4556 shared) echo "Found -l$thislib (shared)." ;;
4557 static) echo "Found -l$thislib." ;;
4558 *) echo "Found -l$thislib ($libstyle)." ;;
4562 *) dflt="$dflt -l$thislib"
4563 libsfound="$libsfound $xxx"
4565 libsfiles="$libsfiles $yyy"
4566 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4567 case " $libsdirs " in
4569 *) libsdirs="$libsdirs $yyy" ;;
4576 if $test ! -f "$xxx"; then
4577 echo "No -l$thislib."
4588 ' '|'') dflt='none';;
4593 In order to compile $package on your machine, a number of libraries
4594 are usually needed. Include any other special libraries here as well.
4595 Say "none" for none. The default list is almost always right.
4599 rp="What libraries to use?"
4606 : determine optimization, if desired, or use for debug flag also
4608 ' '|$undef) dflt='none';;
4610 *) dflt="$optimize";;
4614 By default, $package compiles with the -O flag to use the optimizer.
4615 Alternately, you might want to use the symbolic debugger, which uses
4616 the -g flag (on traditional Unix systems). Either flag can be
4617 specified here. To use neither flag, specify the word "none".
4620 rp="What optimizer/debugger flag should be used?"
4624 'none') optimize=" ";;
4628 : We will not override a previous value, but we might want to
4629 : augment a hint file
4631 default|recommended)
4632 case "$gccversion" in
4633 1*) dflt='-fpcc-struct-return' ;;
4636 *-g*) dflt="$dflt -DDEBUGGING";;
4638 case "$gccversion" in
4639 2*) if test -d /etc/conf/kconfig.d &&
4640 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4646 case "$gccversion" in
4650 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4651 echo 'int main(void) { return 0; }' > gcctest.c
4652 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4653 echo "Yes, it does." 2>&1
4656 echo "Leaving current flags $ccflags alone." 2>&1
4658 *) dflt="$dflt -fno-strict-aliasing" ;;
4661 echo "Nope, it doesn't, but that's ok." 2>&1
4668 case "$mips_type" in
4669 *BSD*|'') inclwanted="$locincpth $usrinc";;
4670 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4672 for thisincl in $inclwanted; do
4673 if $test -d $thisincl; then
4674 if $test x$thisincl != x$usrinc; then
4676 *" -I$thisincl "*);;
4677 *) dflt="$dflt -I$thisincl ";;
4683 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4685 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4693 *) dflt="$dflt -D$2";;
4697 set signal.h LANGUAGE_C; eval $inctest
4701 ccflags="$ccflags -DSOCKS"
4706 default|recommended) dflt="$ccflags $dflt" ;;
4707 *) dflt="$ccflags";;
4716 Your C compiler may want other flags. For this question you should include
4717 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4718 but you should NOT include libraries or ld flags like -lwhatever. If you
4719 want $package to honor its debug switch, you should include -DDEBUGGING here.
4720 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4722 To use no flags, specify the word "none".
4728 rp="Any additional cc flags?"
4735 : the following weeds options from ccflags that are of no interest to cpp
4737 '') cppflags="$ccflags" ;;
4738 *) cppflags="$cppflags $ccflags" ;;
4740 case "$gccversion" in
4741 1*) cppflags="$cppflags -D__GNUC__"
4743 case "$mips_type" in
4745 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4751 echo "Let me guess what the preprocessor flags are..." >&4
4765 *) ftry="$previous $flag";;
4767 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4768 >cpp1.out 2>/dev/null && \
4769 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4770 >cpp2.out 2>/dev/null && \
4771 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4772 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4774 cppflags="$cppflags $ftry"
4784 *-*) echo "They appear to be: $cppflags";;
4786 $rm -f cpp.c cpp?.out
4790 : flags used in final linking phase
4792 '') if ./venix; then
4798 *-posix*) dflt="$dflt -posix" ;;