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 Sun Feb 2 17:04:58 EET 2003 [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 if test -e /dev/cputype -a -e /dev/drivers -a -e /dev/osversion -a -e /dev/bintime; then
53 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
54 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
55 *** Please read the README.plan9 for further instructions.
56 *** Cannot continue, aborting.
62 : compute my invocation name
66 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
71 : Proper separator for the PATH environment variable
73 : On OS/2 this directory should exist if this is not floppy only system :-]
74 if test -d c:/. ; then
75 if test -n "$OS2_SHELL"; then
77 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
78 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
79 elif test -n "$DJGPP"; then
80 case "X${MACHTYPE:-nonesuchmach}" in
88 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
89 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
90 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
91 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
92 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
93 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
94 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
95 paths="$paths /sbin /usr/sbin /usr/libexec"
96 paths="$paths /system/gnu_library/bin"
100 case "$p_$PATH$p_" in
102 *) test -d $p && PATH=$PATH$p_$p ;;
109 : shall we be using ksh?
115 if (PATH=.; alias -x) >/dev/null 2>&1; then
118 if test -f /hp-ux -a -f /bin/ksh; then
119 needksh='to avoid sh bug in "here document" expansion'
121 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
122 if test X`/usr/bin/uname -v` = X4; then
123 avoidksh="to avoid AIX 4's /bin/sh"
127 if test -f /osf_boot -a -f /usr/sbin/setld; then
128 if test X`/usr/bin/uname -s` = XOSF1; then
129 avoidksh="to avoid Digital UNIX' ksh"
131 unset BIN_SH # if this is 'xpg4' sh will start up ksh
134 case "$inksh/$needksh" in
141 case "$inksh/$avoidksh" in
147 case "$inksh/$needksh-$avoidksh-" in
150 (I see you are using the Korn shell. Some ksh's blow up on $me,
151 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
158 echo "(Feeding myself to $newsh $reason.)"
160 Configure|*/Configure) exec $newsh $0 "$@";;
161 *) exec $newsh Configure "$@";;
166 : if needed set CDPATH to a harmless value that is not chatty
167 : avoid bash 2.02 problems with empty CDPATH.
171 *bash*) CDPATH='.' ;;
176 : Configure runs within the UU subdirectory
177 test -d UU || mkdir UU
384 endhostent_r_proto=''
390 endprotoent_r_proto=''
396 endservent_r_proto=''
446 gethostbyaddr_r_proto=''
448 gethostbyname_r_proto=''
450 gethostent_r_proto=''
462 getnetbyaddr_r_proto=''
464 getnetbyname_r_proto=''
478 d_getprotobyname_r=''
479 getprotobyname_r_proto=''
480 d_getprotobynumber_r=''
481 getprotobynumber_r_proto=''
483 getprotoent_r_proto=''
495 getservbyname_r_proto=''
497 getservbyport_r_proto=''
499 getservent_r_proto=''
575 d_old_pthread_create_joinable=''
576 old_pthread_create_joinable=''
615 sethostent_r_proto=''
632 setprotoent_r_proto=''
644 setservent_r_proto=''
688 d_stdio_ptr_lval_nochange_cnt=''
689 d_stdio_ptr_lval_sets_cnt=''
890 inc_version_list_init=''
909 ignore_versioned_solibs=''
968 d_perl_otherlibdirs=''
982 version_patchlevel_string=''
997 nv_preserves_uv_bits=''
1086 installsitescript=''
1101 d_stdio_stream_array=''
1102 stdio_stream_array=''
1112 ccflags_uselargefiles=''
1113 ldflags_uselargefiles=''
1114 libswanted_uselargefiles=''
1134 installvendorarch=''
1141 installvendorhtml1=''
1144 installvendorhtml3=''
1152 installvendorman1=''
1155 installvendorman3=''
1162 installvendorscript=''
1176 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1179 : We must find out about Eunice early
1181 if test -f /etc/unixtovms; then
1182 eunicefix=/etc/unixtovms
1184 if test -f /etc/unixtovms.exe; then
1185 eunicefix=/etc/unixtovms.exe
1188 : Set executable suffix now -- needed before hints available
1189 if test -f "/libs/version.library"; then
1192 elif test -f "/system/gnu_library/bin/ar.pm"; then
1195 elif test -n "$DJGPP"; then
1198 elif test -d c:/. ; then
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
1215 : Trailing extension. Override this in a hint file, if needed.
1216 : Extra object files, if any, needed on this platform.
1220 : change the next line if compiling for Xenix/286 on Xenix/386
1221 xlibpth='/usr/lib/386 /lib/386'
1222 : Possible local library directories to search.
1223 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1224 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1226 : general looking path for locating libraries
1227 glibpth="/lib /usr/lib $xlibpth"
1228 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1229 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1230 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1232 : Private path used by Configure to find libraries. Its value
1233 : is prepended to libpth. This variable takes care of special
1234 : machines, like the mips. Usually, it should be empty.
1237 : default library list
1239 : some systems want to use only the non-versioned libso:s
1240 ignore_versioned_solibs=''
1241 : full support for void wanted by default
1247 : set useposix=false in your hint file to disable the POSIX extension.
1249 : set useopcode=false in your hint file to disable the Opcode extension.
1252 ccflags_uselargefiles=''
1253 ldflags_uselargefiles=''
1254 libswanted_uselargefiles=''
1255 : set usemultiplicity on the Configure command line to enable multiplicity.
1256 : set usesocks on the Configure command line to enable socks.
1258 : set usethreads on the Configure command line to enable threads.
1259 usereentrant='undef'
1260 : List of libraries we want.
1261 : If anyone needs -lnet, put it in a hint file.
1262 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1263 libswanted="$libswanted dld ld sun m c cposix posix"
1264 libswanted="$libswanted ndir dir crypt sec"
1265 libswanted="$libswanted ucb bsd BSD PW x util rt posix4"
1266 : We probably want to search /usr/shlib before most other libraries.
1267 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1268 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1269 glibpth="/usr/shlib $glibpth"
1270 : Do not use vfork unless overridden by a hint file.
1273 : Find the basic shell for Bourne shell scripts
1277 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1280 if test -f "$xxx"; then
1283 : Build up a list and do a single loop so we can 'break' out.
1284 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1285 for xxx in sh bash ksh pdksh ash; do
1287 try="$try ${p}/${xxx}"
1291 if test -f "$xxx"; then
1294 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1297 elif test -f "$xxx.exe"; then
1308 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1310 Usually it's in /bin/sh. How did you even get this far?
1311 Please contact me (Perl Maintainers) at perlbug@perl.org and
1312 we'll try to straighten this all out.
1318 : see if sh knows # comments
1319 if `$sh -c '#' >/dev/null 2>&1`; then
1323 test -f $xcat$_exe || xcat=/usr/bin/cat
1324 if test ! -f $xcat$_exe; then
1325 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1326 if test -f $p/cat$_exe; then
1331 if test ! -f $xcat$_exe; then
1332 echo "Can't find cat anywhere!"
1336 echo "#!$xcat" >sharp
1340 if test -s today; then
1343 echo "#! $xcat" > sharp
1347 if test -s today; then
1355 echo "Your $sh doesn't grok # comments--I will strip them later on."
1358 echo "exec grep -v '^[ ]*#'" >spitshell
1360 $eunicefix spitshell
1361 spitshell=`pwd`/spitshell
1363 echo "I presume that if # doesn't work, #! won't work either!"
1368 : figure out how to guarantee sh startup
1370 '') startsh=${sharpbang}${sh} ;;
1382 : echo "Yup, it does."
1384 echo "Hmm... '$startsh' does not guarantee sh startup..."
1385 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1390 : Save command line options in file UU/cmdline.opt for later use in
1391 : generating config.sh.
1392 cat > cmdline.opt <<EOSH
1393 # Configure command line arguments.
1402 cat >>cmdline.opt <<EOSH
1403 config_arg$argn='$arg'
1405 # Extreme backslashitis: replace each ' by '"'"'
1406 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1409 arg_exp=`cat cmdl.opt`
1410 args_exp="$args_exp$args_sep'$arg_exp'"
1411 argn=`expr $argn + 1`
1414 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1415 # used by ./hints/os2.sh
1418 : produce awk script to parse command line options
1419 cat >options.awk <<'EOF'
1421 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1423 len = length(optstr);
1424 for (i = 1; i <= len; i++) {
1425 c = substr(optstr, i, 1);
1426 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1437 if (substr(str, 1, 1) != "-") {
1438 printf("'%s'\n", str);
1442 for (i = 2; i <= len; i++) {
1443 c = substr(str, i, 1);
1445 printf("-%s\n", substr(str, i));
1451 printf("'%s'\n", substr(str, i + 1));
1464 : process the command line options
1465 set X `for arg in "$@"; do echo "X$arg"; done |
1466 sed -e s/X// | awk -f options.awk`
1471 : set up default values
1481 rm -f optdef.sh posthint.sh
1482 cat >optdef.sh <<EOS
1488 while test $# -gt 0; do
1490 -d) shift; fastread=yes;;
1491 -e) shift; alldone=cont;;
1495 if test -r "$1"; then
1498 echo "$me: cannot read config file $1." >&2
1503 -h) shift; error=true;;
1504 -r) shift; reuseval=true;;
1505 -s) shift; silent=true; realsilent=true;;
1506 -E) shift; alldone=exit;;
1507 -K) shift; knowitall=true;;
1508 -O) shift; override=true;;
1509 -S) shift; silent=true; extractsh=true;;
1514 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1515 echo "$me: ignoring -D $1" >&2
1518 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1519 *) echo "$1='define'" >> optdef.sh;;
1526 *=) echo "$1" >> optdef.sh;;
1528 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1529 echo "$me: ignoring -U $1" >&2
1531 *) echo "$1='undef'" >> optdef.sh;;
1542 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1546 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1547 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1553 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1554 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1555 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1556 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1557 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1558 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1564 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1566 echo "$yyy=''" >> posthint.sh ;;
1571 echo "$yyy='$zzz'" >> posthint.sh ;;
1573 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1575 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1580 echo "$yyy=$zzz" >> posthint.sh ;;
1581 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1585 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1588 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1596 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1597 [-U symbol] [-U symbol=] [-A command:symbol...]
1598 -d : use defaults for all answers.
1599 -e : go on without questioning past the production of config.sh.
1600 -f : specify an alternate default configuration file.
1601 -h : print this help message and exit (with an error status).
1602 -r : reuse C symbols value if possible (skips costly nm extraction).
1603 -s : silent mode, only echoes questions and essential information.
1604 -D : define symbol to have some value:
1605 -D symbol symbol gets the value 'define'
1606 -D symbol=value symbol gets the value 'value'
1607 -E : stop at the end of questions, after having produced config.sh.
1608 -K : do not use unless you know what you are doing.
1609 -O : let -D and -U override definitions from loaded configuration file.
1610 -S : perform variable substitutions on all .SH files (can mix with -f)
1611 -U : undefine symbol:
1612 -U symbol symbol gets the value 'undef'
1613 -U symbol= symbol gets completely empty
1614 -A : manipulate symbol after the platform specific hints have been applied:
1615 -A symbol=value append " "value to symbol
1616 -A append:symbol=value append value to symbol
1617 -A define:symbol=value define symbol to have value
1618 -A clear:symbol define symbol to be ''
1619 -A define:symbol define symbol to be 'define'
1620 -A eval:symbol=value define symbol to be eval of value
1621 -A prepend:symbol=value prepend value to symbol
1622 -A undef:symbol define symbol to be 'undef'
1623 -A undef:symbol= define symbol to be ''
1624 -V : print version number and exit (with a zero status).
1631 case "$fastread$alldone" in
1634 case "$extractsh" in
1637 if test ! -t 0; then
1638 echo "Say 'sh Configure', not 'sh <Configure'"
1648 true) exec 1>/dev/null;;
1651 : run the defines and the undefines, if any, but leave the file out there...
1654 : create the posthint manipulation script and leave the file out there...
1659 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1660 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1661 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1662 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1663 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1666 : Some greps do not return status, grrr.
1667 echo "grimblepritz" >grimble
1668 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1670 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1676 : the following should work in any shell
1680 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1681 cat >contains <<'EOSS'
1682 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1687 : Find the path to the source tree
1690 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1694 *) src=`cd ../$src && pwd` ;;
1707 if test -f $rsrc/Configure && \
1708 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1710 : found it, so we are ok.
1713 for src in . .. ../.. ../../.. ../../../..; do
1714 if test -f ../$src/Configure && \
1715 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1726 Sorry, I can't seem to locate the source dir for $package. Please start
1727 Configure with an explicit path -- i.e. /some/path/Configure.
1735 echo "Sources for $package found in \"$src\"." >&4
1739 : script used to extract .SH files with variable substitutions
1740 cat >extract <<'EOS'
1742 echo "Doing variable substitutions on .SH files..."
1743 if test -f MANIFEST; then
1744 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1746 echo "(Looking for .SH files under the source directory.)"
1747 set x `(cd "$src"; find . -name "*.SH" -print)`
1751 0) set x `(cd "$src"; echo *.SH)`; shift;;
1753 if test ! -f "$src/$1"; then
1759 while test $name; do
1760 if test ! -d "$name"; then
1761 create="$name $create";
1762 name=`echo $name | sed -e "s|^[^/]*$||"`;
1763 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1768 for file in $create; do
1777 dir=`expr X$file : 'X\(.*\)/'`
1778 file=`expr X$file : 'X.*/\(.*\)'`
1779 (cd "$dir" && . ./$file)
1789 dir=`expr X$file : 'X\(.*\)/'`
1790 file=`expr X$file : 'X.*/\(.*\)'`
1791 (set x $dir; shift; eval $mkdir_p)
1792 sh <"$src/$dir/$file"
1801 if test -f "$src/config_h.SH"; then
1802 if test ! -f config.h; then
1803 : oops, they left it out of MANIFEST, probably, so do it anyway.
1804 . "$src/config_h.SH"
1809 : extract files and exit if asked to do so
1810 case "$extractsh" in
1812 case "$realsilent" in
1816 case "$config_sh" in
1817 '') config_sh='config.sh';;
1820 echo "Fetching answers from $config_sh..."
1823 test "$override" && . ./optdef.sh
1827 echo "Extraction done."
1832 : Eunice requires " " instead of "", can you believe it
1835 echo "Beginning of configuration questions for $package."
1837 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1839 : first determine how to suppress newline on echo command
1841 echo "Checking echo to see how to suppress newlines..."
1842 (echo "hi there\c" ; echo " ") >.echotmp
1843 if $contains c .echotmp >/dev/null 2>&1 ; then
1854 echo $n "The star should be here-->$c"
1858 : Now test for existence of everything in MANIFEST
1860 if test -f "$rsrc/MANIFEST"; then
1861 echo "First let's make sure your kit is complete. Checking..." >&4
1862 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1865 for filelist in x??; do
1866 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1868 if test -s missing; then
1872 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1874 You have the option of continuing the configuration process, despite the
1875 distinct possibility that your kit is damaged, by typing 'y'es. If you
1876 do, don't blame me if something goes wrong. I advise you to type 'n'o
1877 and contact the author (perlbug@perl.org).
1880 echo $n "Continue? [n] $c" >&4
1884 echo "Continuing..." >&4
1888 echo "ABORTING..." >&4
1893 echo "Looks good..."
1896 echo "There is no MANIFEST file. I hope your kit is complete !"
1901 : Find the appropriate value for a newline for tr
1902 if test -n "$DJGPP"; then
1905 if test X"$trnl" = X; then
1906 case "`echo foo|tr '\n' x 2>/dev/null`" in
1910 if test X"$trnl" = X; then
1911 case "`echo foo|tr '\012' x 2>/dev/null`" in
1912 foox) trnl='\012' ;;
1915 if test X"$trnl" = X; then
1916 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1917 fooxy) trnl='\n\r' ;;
1920 if test X"$trnl" = X; then
1923 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1929 : compute the number of columns on the terminal for proper question formatting
1934 : set up the echo used in my read
1935 myecho="case \"\$xxxm\" in
1936 '') echo $n \"\$rp $c\" >&4;;
1938 '') echo $n \"[\$xxxm] $c\";;
1940 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1942 echo $n \"[\$xxxm] $c\" >&4
1944 echo $n \"\$rp [\$xxxm] $c\" >&4
1950 : now set up to do reads with possible shell escape and default assignment
1956 case "\$fastread" in
1957 yes) case "\$dflt" in
1960 case "\$silent-\$rp" in
1965 *) case "\$silent" in
1966 true) case "\$rp" in
1971 while expr "X\$ans" : "X!" >/dev/null; do
1975 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1983 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1992 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1997 echo "(OK, I'll run with -d after this question.)" >&4
2000 echo "*** Sorry, \$1 not supported yet." >&4
2010 echo "*** Substitution done -- please confirm."
2012 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2017 echo "*** Error -- try again."
2024 case "\$ans\$xxxm\$nostick" in
2036 : create .config dir to save info across Configure sessions
2037 test -d ../.config || mkdir ../.config
2038 cat >../.config/README <<EOF
2039 This directory created by Configure to save information that should
2040 persist across sessions for $package.
2042 You may safely delete it if you wish.
2045 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2047 $define|true|[yY]*) ;;
2048 *) case "$xversion" in
2051 *** WHOA THERE!!! ***
2053 This is an UNSTABLE DEVELOPMENT release.
2054 The version of this $package distribution is $xversion, that is, odd,
2055 (as opposed to even) and that signifies a development release.
2056 If you want a maintenance release, you want an even-numbered version.
2058 Do ***NOT*** install this into production use.
2059 Data corruption and crashes are possible.
2061 It is most seriously suggested that you do not continue any further
2062 unless you want to help in developing and debugging Perl.
2064 If you *still* want to build perl, you can answer 'y' now,
2065 or pass -Dusedevel to Configure.
2068 rp='Do you really want to continue?'
2072 [yY]) echo >&4 "Okay, continuing."
2073 usedevel="$define" ;;
2074 *) echo >&4 "Okay, bye."
2084 case "$versiononly" in
2085 '') versiononly="$define" ;;
2087 case "$installusrbinperl" in
2088 '') installusrbinperl="$undef" ;;
2093 : general instructions
2096 user=`(logname) 2>/dev/null`
2098 '') user=`whoami 2>&1`;;
2100 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2103 rp='Would you like to see the instructions?'
2114 This installation shell script will examine your system and ask you questions
2115 to determine how the perl5 package should be installed. If you get
2116 stuck on a question, you may use a ! shell escape to start a subshell or
2117 execute a command. Many of the questions will have default answers in square
2118 brackets; typing carriage return will give you the default.
2120 On some of the questions which ask for file or directory names you are allowed
2121 to use the ~name construct to specify the login directory belonging to "name",
2122 even if you don't have a shell which knows about that. Questions where this is
2123 allowed will be marked "(~name ok)".
2127 dflt='Type carriage return to continue'
2131 The prompter used in this script allows you to use shell variables and
2132 backticks in your answers. You may use $1, $2, etc... to refer to the words
2133 in the default answer, as if the default line was a set of arguments given to a
2134 script shell. This means you may also use $* to repeat the whole default line,
2135 so you do not have to re-type everything to add something to the default.
2137 Everytime there is a substitution, you will have to confirm. If there is an
2138 error (e.g. an unmatched backtick), the default answer will remain unchanged
2139 and you will be prompted again.
2141 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2142 the questions and use the computed defaults (or the previous answers if there
2143 was already a config.sh file). Type 'Configure -h' for a list of options.
2144 You may also start interactively and then answer '& -d' at any prompt to turn
2145 on the non-interactive behaviour for the remainder of the execution.
2151 Much effort has been expended to ensure that this shell script will run on any
2152 Unix system. If despite that it blows up on yours, your best bet is to edit
2153 Configure and run it again. If you can't run Configure for some reason,
2154 you'll have to generate a config.sh file by hand. Whatever problems you
2155 have, let me (perlbug@perl.org) know how I blew it.
2157 This installation script affects things in two ways:
2159 1) it may do direct variable substitutions on some of the files included
2161 2) it builds a config.h file for inclusion in C programs. You may edit
2162 any of these files as the need arises after running this script.
2164 If you make a mistake on a question, there is no easy way to back up to it
2165 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2166 files. Configure will offer to let you do this before it runs the SH files.
2169 dflt='Type carriage return to continue'
2171 case "$firsttime" in
2172 true) echo $user >>../.config/instruct;;
2176 : find out where common programs are
2178 echo "Locating common programs..." >&4
2191 if test -d \$dir/\$thing; then
2197 for thisthing in \$dir/\$thing; do
2198 : just loop through to pick last item
2200 if test -f \$thisthing; then
2203 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2206 elif test -f \$dir/\$thing.exe; then
2207 if test -n "$DJGPP"; then
2208 echo \$dir/\$thing.exe
2209 elif test "$eunicefix" != ":"; then
2210 : on Eunice apparently
2264 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2265 pth="$pth /lib /usr/lib"
2266 for file in $loclist; do
2270 if test -f "$xxx"; then
2273 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2274 xxx=`./loc $file $file $pth`
2277 '') xxx=`./loc $file $file $pth`;;
2278 *) xxx=`./loc $xxx $xxx $pth`;;
2280 eval $file=$xxx$_exe
2284 echo $file is in $xxx.
2287 echo $file is in $xxx.
2290 echo "I don't know where '$file' is, and my life depends on it." >&4
2291 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2297 echo "Don't worry if any of the following aren't found..."
2299 for file in $trylist; do
2303 if test -f "$xxx"; then
2306 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2307 xxx=`./loc $file $file $pth`
2310 '') xxx=`./loc $file $file $pth`;;
2311 *) xxx=`./loc $xxx $xxx $pth`;;
2313 eval $file=$xxx$_exe
2317 echo $file is in $xxx.
2320 echo $file is in $xxx.
2323 echo "I don't see $file out there, $say."
2330 echo "Substituting grep for egrep."
2337 echo "Substituting cp for ln."
2346 echo "I can't find make or gmake, and my life depends on it." >&4
2347 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2355 *) # We can't have osname yet.
2356 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2357 # Assume that gmake, if found, is definitely GNU make
2358 # and prefer it over the system make.
2359 echo "Substituting gmake for make."
2367 echo "Hopefully test is built into your sh."
2370 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2371 echo "Using the test built into your sh."
2379 echo "Hopefully echo is built into your sh."
2384 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2385 $echo $n "hi there$c" >foo1
2386 echo $n "hi there$c" >foo2
2387 if cmp foo1 foo2 >/dev/null 2>&1; then
2388 echo "They are compatible. In fact, they may be identical."
2395 They are not compatible! You are probably running ksh on a non-USG system.
2396 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2397 have echo built in and we may have to run some Bourne shell scripts. That
2398 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2401 $echo $n "The star should be here-->$c"
2411 cat <<'EOSC' >>trygcc
2416 int main(int argc, char *argv[]) {
2420 if $cc -o try $ccflags $ldflags try.c; then
2423 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2429 case "`$cc -v -c try.c 2>&1`" in
2432 if $test X"$trygcc" = Xyes; then
2433 if gcc -o try -c try.c; then
2435 echo "You seem to have a working gcc, though." >&4
2436 rp="Would you like to use it?"
2438 if $test -f myread; then
2441 if $test -f UU/myread; then
2444 echo "Cannot find myread, sorry. Aborting." >&2
2449 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2450 if $test -f usethreads.cbu; then
2453 *** However, any setting of the C compiler flags (e.g. for thread support)
2454 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2455 *** (together with e.g. -Dusethreads).
2471 cat <<'EOSC' >>checkcc
2476 int main(int argc, char *argv[]) {
2480 if $cc -o try $ccflags $ldflags try.c; then
2483 if $test X"$despair" = Xyes; then
2484 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2487 You need to find a working C compiler.
2488 Either (purchase and) install the C compiler supplied by your OS vendor,
2489 or for a free C compiler try http://gcc.gnu.org/
2490 I cannot continue any further, aborting.
2499 : determine whether symbolic links are supported
2502 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2503 echo "Symbolic links are supported." >&4
2506 echo "Symbolic links are NOT supported." >&4
2511 : determine whether symbolic links are supported
2515 echo "Checking how to test for symbolic links..." >&4
2517 if $test "X$issymlink" = X; then
2519 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2520 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2522 if test $? = 0; then
2525 echo "Your builtin 'test -h' may be broken." >&4
2528 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2531 if test -f "$p/$test"; then
2540 echo "Trying external '$test -h'." >&4
2541 issymlink="$test -h"
2542 if $test ! -h sym >/dev/null 2>&1; then
2543 echo "External '$test -h' is broken, too." >&4
2551 if $test "X$issymlink" = X; then
2552 if $test -L sym 2>/dev/null; then
2553 issymlink="$test -L"
2554 echo "The builtin '$test -L' worked." >&4
2557 if $test "X$issymlink" != X; then
2558 echo "You can test for symbolic links with '$issymlink'." >&4
2560 echo "I do not know how you can test for symbolic links." >&4
2564 *) echo "No symbolic links, so not testing for their testing..." >&4
2570 case "$mksymlinks" in
2573 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2576 *) case "$lns:$issymlink" in
2577 *"ln"*" -s:"*"test -"?)
2578 echo "Creating the symbolic links..." >&4
2579 echo "(First creating the subdirectories...)" >&4
2581 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2583 test -z "$directory" && break
2587 if test ! -d t/base; then
2588 echo "Failed to create the subdirectories. Aborting." >&4
2591 echo "(Then creating the symlinks...)" >&4
2592 awk '{print $1}' $src/MANIFEST | while true; do
2594 test -z "$filename" && break
2595 if test -f $filename; then
2596 if $issymlink $filename; then
2600 if test -f $filename; then
2601 echo "$filename already exists, not symlinking."
2603 ln -s $src/$filename $filename
2607 if test ! -f t/base/lex.t; then
2608 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2613 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2622 case "$usecrosscompile" in
2624 $echo "Cross-compiling..."
2627 *-*-gcc) # A cross-compiling gcc, probably.
2628 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2630 # leave out ld, choosing it is more complex
2632 ranlib=$targetarch-ranlib
2633 $echo 'extern int foo;' > try.c
2634 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2636 if $test $# -gt 0; then
2638 incpth="`$echo $incpth|$sed 's/^ //'`"
2639 echo "Guessing incpth '$incpth'." >&4
2641 j="`$echo $i|$sed 's,/include$,/lib,'`"
2642 if $test -d $j; then
2646 libpth="`$echo $libpth|$sed 's/^ //'`"
2647 echo "Guessing libpth '$libpth'." >&4
2652 case "$targetarch" in
2653 '') echo "Targetarch not defined." >&4; croak=y ;;
2654 *) echo "Using targetarch $targetarch." >&4 ;;
2657 '') echo "Incpth not defined." >&4; croak=y ;;
2658 *) echo "Using incpth '$incpth'." >&4 ;;
2661 '') echo "Libpth not defined." >&4; croak=y ;;
2662 *) echo "Using libpth '$libpth'." >&4 ;;
2665 '') for i in $incpth; do
2666 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2668 echo "Guessing usrinc $usrinc." >&4
2673 '') echo "Usrinc not defined." >&4; croak=y ;;
2676 *) echo "Using usrinc $usrinc." >&4 ;;
2678 case "$targethost" in
2679 '') echo "Targethost not defined." >&4; croak=y ;;
2680 *) echo "Using targethost $targethost." >&4
2685 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2688 /*) run=$src/Cross/run
2689 targetmkdir=$src/Cross/mkdir
2691 from=$src/Cross/from
2693 *) pwd=`$test -f ../Configure & cd ..; pwd`
2695 targetmkdir=$pwd/Cross/mkdir
2697 from=$pwd/Cross/from
2700 case "$targetrun" in
2701 '') targetrun=ssh ;;
2706 case "$targetfrom" in
2707 '') targetfrom=scp ;;
2711 from=$from-$targetfrom
2712 case "$targetdir" in
2714 echo "Guessing targetdir $targetdir." >&4
2717 case "$targetuser" in
2719 echo "Guessing targetuser $targetuser." >&4
2722 case "$targetfrom" in
2726 case "$targetrun" in
2738 '') cwd=$targetdir ;;
2742 if $test ! -f \$exe.xok; then
2746 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2749 *) echo "Unknown targetrun '$targetrun'" >&4
2753 case "$targetmkdir" in
2755 cat >$targetmkdir <<EOF
2757 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2759 $chmod a+rx $targetmkdir
2761 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2773 $targetmkdir \`dirname \$f\`
2774 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2777 $targetmkdir $targetdir/\`dirname \$f\`
2778 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2791 $mkdir -p $targetdir/\`dirname \$f\`
2792 $cp \$f $targetdir/\$f || exit 1
2795 $targetmkdir $targetdir/\`dirname \$f\`
2796 $cp \$f $targetdir/\$f || exit 1
2803 *) echo "Unknown targetto '$targetto'" >&4
2807 case "$targetfrom" in
2814 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2819 cp) cat >$from <<EOF
2824 cp $targetdir/\$f . || exit 1
2829 *) echo "Unknown targetfrom '$targetfrom'" >&4
2833 if $test ! -f $run; then
2834 echo "Target 'run' script '$run' not found." >&4
2838 if $test ! -f $to; then
2839 echo "Target 'to' script '$to' not found." >&4
2843 if $test ! -f $from; then
2844 echo "Target 'from' script '$from' not found." >&4
2848 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2852 Using '$run' for remote execution,
2853 and '$from' and '$to'
2854 for remote file transfer.
2860 usecrosscompile='undef'
2865 : see whether [:lower:] and [:upper:] are supported character classes
2867 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2869 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2873 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2874 # (0xc9 and 0xd1), therefore that is a nice testing point.
2875 if test "X$up" = X -o "X$low" = X; then
2876 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2882 if test "X$up" = X -o "X$low" = X; then
2883 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2889 if test "X$up" = X -o "X$low" = X; then
2890 case "`echo IJ | od -x 2>/dev/null`" in
2892 echo "Hey, this might be EBCDIC." >&4
2893 if test "X$up" = X -o "X$low" = X; then
2894 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2895 ij) up='[A-IJ-RS-Z]'
2900 if test "X$up" = X -o "X$low" = X; then
2901 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2911 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2913 echo "Using $up and $low to convert case." >&4
2916 echo "I don't know how to translate letters from upper to lower case." >&4
2917 echo "Your tr is not acting any way I know of." >&4
2921 : set up the translation script tr, must be called with ./tr of course
2925 '[A-Z][a-z]') exec $tr '$up' '$low';;
2926 '[a-z][A-Z]') exec $tr '$low' '$up';;
2933 : Try to determine whether config.sh was made on this system
2934 case "$config_sh" in
2936 myuname=`$uname -a 2>/dev/null`
2937 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2938 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2939 # because the A-Z/a-z are not consecutive.
2940 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2941 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2942 newmyuname="$myuname"
2944 case "$knowitall" in
2946 if test -f ../config.sh; then
2947 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2948 eval "`grep myuname= ../config.sh`"
2950 if test "X$myuname" = "X$newmyuname"; then
2958 : Get old answers from old config file if Configure was run on the
2959 : same system, otherwise use the hints.
2962 if test -f config.sh; then
2964 rp="I see a config.sh file. Shall I use it to set the defaults?"
2967 n*|N*) echo "OK, I'll ignore it."
2968 mv config.sh config.sh.old
2969 myuname="$newmyuname"
2971 *) echo "Fetching default answers from your old config.sh file..." >&4
2979 : Older versions did not always set $sh. Catch re-use of such
2989 if test ! -f config.sh; then
2992 First time through, eh? I have some defaults handy for some systems
2993 that need some extra help getting the Configure answers right:
2996 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2998 : Half the following guesses are probably wrong... If you have better
2999 : tests or hints, please send them to perlbug@perl.org
3000 : The metaconfig authors would also appreciate a copy...
3001 $test -f /irix && osname=irix
3002 $test -f /xenix && osname=sco_xenix
3003 $test -f /dynix && osname=dynix
3004 $test -f /dnix && osname=dnix
3005 $test -f /lynx.os && osname=lynxos
3006 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3007 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3008 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3009 $test -f /bin/mips && /bin/mips && osname=mips
3010 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3011 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3012 $test -d /usr/apollo/bin && osname=apollo
3013 $test -f /etc/saf/_sactab && osname=svr4
3014 $test -d /usr/include/minix && osname=minix
3015 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3016 if $test -d /MachTen -o -d /MachTen_Folder; then
3018 if $test -x /sbin/version; then
3019 osvers=`/sbin/version | $awk '{print $2}' |
3020 $sed -e 's/[A-Za-z]$//'`
3021 elif $test -x /usr/etc/version; then
3022 osvers=`/usr/etc/version | $awk '{print $2}' |
3023 $sed -e 's/[A-Za-z]$//'`
3029 $test -f /sys/posix.dll &&
3030 $test -f /usr/bin/what &&
3031 set X `/usr/bin/what /sys/posix.dll` &&
3032 $test "$3" = UWIN &&
3036 if $test -f $uname; then
3044 umips) osname=umips ;;
3047 [23]100) osname=mips ;;
3048 next*) osname=next ;;
3050 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3051 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3054 elif $test -f /etc/kconfig; then
3056 if test "$lns" = "$ln -s"; then
3058 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3060 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3067 if test -n "$DJGPP"; then
3076 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3078 'not found') osvers="$4"."$3" ;;
3079 '<3240'|'<>3240') osvers=3.2.0 ;;
3080 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3081 '=3250'|'>3250') osvers=3.2.5 ;;
3085 bsd386) osname=bsd386
3088 cygwin*) osname=cygwin
3091 *dc.osx) osname=dcosx
3097 domainos) osname=apollo
3103 dynixptx*) osname=dynixptx
3104 osvers=`echo "$4"|sed 's/^v//'`
3106 freebsd) osname=freebsd
3108 genix) osname=genix ;;
3110 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3126 netbsd*) osname=netbsd
3129 news-os) osvers="$3"
3131 4*) osname=newsos4 ;;
3135 next*) osname=next ;;
3136 nonstop-ux) osname=nonstopux ;;
3137 openbsd) osname=openbsd
3140 POSIX-BC | posix-bc ) osname=posix-bc
3143 powerux | power_ux | powermax_os | powermaxos | \
3144 powerunix | power_unix) osname=powerux
3150 solaris) osname=solaris
3152 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3159 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3163 titanos) osname=titanos
3172 ultrix) osname=ultrix
3175 osf1|mls+) case "$5" in
3178 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3181 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3184 hp*) osname=hp_osf1 ;;
3185 mips) osname=mips_osf1 ;;
3188 unixware) osname=svr5
3196 $2) case "$osname" in
3200 : svr4.x or possibly later
3210 if test -f /stand/boot ; then
3211 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3212 if test -n "$INITPROG" -a -f "$INITPROG"; then
3213 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3214 if test -n "$isesix"; then
3222 *) if test -f /etc/systemid; then
3224 set `echo $3 | $sed 's/\./ /g'` $4
3225 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3227 elif $test -f $src/hints/sco_$1_$2.sh; then
3229 elif $test -f $src/hints/sco_$1.sh; then
3234 '') : Still unknown. Probably a generic Sys V.
3243 *) case "$osname" in
3244 '') : Still unknown. Probably a generic BSD.
3252 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3253 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3254 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3257 $rm -f UU/kernel.what
3258 elif test -d c:/.; then
3265 case "$targetarch" in
3268 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3273 : Now look for a hint file osname_osvers, unless one has been
3274 : specified already.
3277 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3278 : Also try without trailing minor version numbers.
3279 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3280 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3281 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3282 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3285 *) case "$osvers" in
3288 *) if $test -f $src/hints/$file.sh ; then
3290 elif $test -f $src/hints/$xfile.sh ; then
3292 elif $test -f $src/hints/$xxfile.sh ; then
3294 elif $test -f $src/hints/$xxxfile.sh ; then
3296 elif $test -f $src/hints/$xxxxfile.sh ; then
3298 elif $test -f "$src/hints/${osname}.sh" ; then
3307 if $test -f Policy.sh ; then
3310 none) dflt="Policy" ;;
3311 *) dflt="Policy $dflt" ;;
3316 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3320 if $test -f Policy.sh ; then
3323 There's also a Policy hint file available, which should make the
3324 site-specific (policy) questions easier to answer.
3331 You may give one or more space-separated answers, or "none" if appropriate.
3332 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3333 is a good thing. DO NOT give a wrong version or a wrong OS.
3337 rp="Which of these apply, if any?"
3340 for file in $tans; do
3341 if $test X$file = XPolicy -a -f Policy.sh; then
3343 $cat Policy.sh >> UU/config.sh
3344 elif $test -f $src/hints/$file.sh; then
3345 . $src/hints/$file.sh
3346 $cat $src/hints/$file.sh >> UU/config.sh
3347 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3350 : Give one chance to correct a possible typo.
3351 echo "$file.sh does not exist"
3353 rp="hint to use instead?"
3355 for file in $ans; do
3356 if $test -f "$src/hints/$file.sh"; then
3357 . $src/hints/$file.sh
3358 $cat $src/hints/$file.sh >> UU/config.sh
3359 elif $test X$ans = X -o X$ans = Xnone ; then
3362 echo "$file.sh does not exist -- ignored."
3369 : Remember our hint file for later.
3370 if $test -f "$src/hints/$file.sh" ; then
3380 echo "Fetching default answers from $config_sh..." >&4
3384 cp $config_sh config.sh 2>/dev/null
3394 test "$override" && . ./optdef.sh
3396 : Restore computed paths
3397 for file in $loclist $trylist; do
3398 eval $file="\$_$file"
3403 Configure uses the operating system name and version to set some defaults.
3404 The default value is probably right if the name rings a bell. Otherwise,
3405 since spelling matters for me, either accept the default or answer "none"
3412 ''|' '|none) dflt=none ;;
3413 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3416 *) dflt="$osname" ;;
3418 rp="Operating system name?"
3422 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3428 ''|' '|none) dflt=none ;;
3429 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3430 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3432 ''|' ') dflt=none ;;
3437 *) dflt="$osvers" ;;
3439 rp="Operating system version?"
3449 : who configured the system
3450 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3451 cf_by=`(logname) 2>/dev/null`
3454 cf_by=`(whoami) 2>/dev/null`
3456 "") cf_by=unknown ;;
3460 : set up the script used to warn in case of inconsistency
3467 echo "*** WHOA THERE!!! ***" >&4
3468 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3469 rp=" Keep the $hint value?"
3472 y) td=$was; tu=$was;;
3476 : function used to set $1 to $val
3477 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3479 $define$undef) . ./whoa; eval "$var=\$td";;
3480 $undef$define) . ./whoa; eval "$var=\$tu";;
3481 *) eval "$var=$val";;
3485 $define|true|[yY]*) dflt='y';;
3490 Perl can be built to use the SOCKS proxy protocol library. To do so,
3491 Configure must be run with -Dusesocks. If you use SOCKS you also need
3492 to use the PerlIO abstraction layer, this will be implicitly selected.
3494 If this doesn't make any sense to you, just accept the default '$dflt'.
3496 rp='Build Perl for SOCKS?'
3499 y|Y) val="$define" ;;
3506 $define|true|[yY]*) useperlio="$define";;
3509 case "$useperlio" in
3510 $define|true|[yY]*|'') dflt='y';;
3515 Previous version of $package used the standard IO mechanisms as
3516 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3517 alternate IO mechanisms via the PerlIO abstraction layer, but the
3518 stdio mechanism is still available if needed. The abstraction layer
3519 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3520 Using PerlIO with sfio may cause problems with some extension modules.
3522 If this doesn't make any sense to you, just accept the default '$dflt'.
3524 rp='Use the PerlIO abstraction layer?'
3531 echo "Ok, doing things the stdio way."
3540 case "$useperlio" in
3541 $define|true|[yY]*) ;;
3544 You are using the SOCKS proxy protocol library which means that you
3545 should also use the PerlIO layer. You may be headed for trouble.
3554 case "$usethreads" in
3555 $define|true|[yY]*) dflt='y';;
3556 *) # Catch case where user specified ithreads or 5005threads but
3557 # forgot -Dusethreads (A.D. 4/2002)
3558 case "$useithreads$use5005threads" in
3560 case "$useperlio" in
3561 "$define") dflt='y' ;;
3571 Perl can be built to take advantage of threads on some systems.
3572 To do so, Configure can be run with -Dusethreads.
3574 Note that Perl built with threading support runs slightly slower
3575 and uses more memory than plain Perl. The current implementation
3576 is believed to be stable, but it is fairly new, and so should be
3577 treated with caution.
3579 If this doesn't make any sense to you, just accept the default '$dflt'.
3581 rp='Build a threading Perl?'
3584 y|Y) val="$define" ;;
3590 case "$usethreads" in
3594 Since release 5.6, Perl has had two different threading implementations,
3595 the newer interpreter-based version (ithreads) with one interpreter per
3596 thread, and the older 5.005 version (5005threads).
3597 The 5005threads version is effectively unmaintained and will probably be
3598 removed in Perl 5.10, so there should be no need to build a Perl using it
3599 unless needed for backwards compatibility with some existing 5.005threads
3603 : Default to ithreads unless overridden on command line or with
3606 case "$use5005threads" in
3607 $define|true|[yY]*) dflt='n';;
3609 case "$useithreads" in
3610 $undef|false|[nN]*) dflt='n';;
3612 rp='Use the newer interpreter-based ithreads?'
3615 y|Y) val="$define" ;;
3620 : Now set use5005threads to the opposite value.
3621 case "$useithreads" in
3622 $define) val="$undef" ;;
3629 useithreads="$undef"
3630 use5005threads="$undef"
3634 case "$useithreads$use5005threads" in
3638 You cannot have both the ithreads and the 5.005 threads enabled
3639 at the same time. Disabling the 5.005 threads since they are
3640 much less stable than the ithreads.
3643 use5005threads="$undef"
3647 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3650 *** To build with ithreads you must also use the PerlIO layer.
3651 *** Cannot continue, aborting.
3657 case "$d_oldpthreads" in
3658 '') : Configure tests would be welcome here. For now, assume undef.
3660 *) val="$d_oldpthreads" ;;
3666 case "$usethreads" in
3667 "$define"|true|[yY]*)
3668 : Look for a hint-file generated 'call-back-unit'. If the
3669 : user has specified that a threading perl is to be built,
3670 : we may need to set or change some other defaults.
3671 if $test -f usethreads.cbu; then
3672 echo "Your platform has some specific hints for threaded builds, using them..."
3676 (Your platform doesn't have any specific hints for threaded builds.
3677 Assuming POSIX threads, then.)
3685 Perl can be built so that multiple Perl interpreters can coexist
3686 within the same Perl executable.
3689 case "$useithreads" in
3692 This multiple interpreter support is required for interpreter-based threads.
3696 *) case "$usemultiplicity" in
3697 $define|true|[yY]*) dflt='y';;
3701 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3702 rp='Build Perl for multiplicity?'
3705 y|Y) val="$define" ;;
3714 case "$usemorebits" in
3715 "$define"|true|[yY]*)
3716 use64bitint="$define"
3717 uselongdouble="$define"
3718 usemorebits="$define"
3720 *) usemorebits="$undef"
3724 : make some quick guesses about what we are up against
3726 $echo $n "Hmm... $c"
3736 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3737 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3739 echo "Looks kind of like an OSF/1 system, but we'll see..."
3741 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3742 xxx=`./loc addbib blurfl $pth`
3743 if $test -f $xxx; then
3744 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3748 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3749 echo "Looks kind of like an extended USG system, but we'll see..."
3751 echo "Looks kind of like a USG system, but we'll see..."
3755 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3756 echo "Looks kind of like a BSD system, but we'll see..."
3760 echo "Looks kind of like a Version 7 system, but we'll see..."
3763 case "$eunicefix" in
3766 There is, however, a strange, musty smell in the air that reminds me of
3767 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3771 : it so happens the Eunice I know will not run shell scripts in Unix format
3775 echo "Congratulations. You aren't running Eunice."
3779 : Detect OS2. The p_ variable is set above in the Head.U unit.
3780 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3781 : semicolon as a patch separator
3786 I have the feeling something is not exactly right, however...don't tell me...
3787 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3788 (Or you may be running DOS with DJGPP.)
3793 if test -f /xenix; then
3794 echo "Actually, this looks more like a XENIX system..."
3799 echo "It's not Xenix..."
3804 if test -f /venix; then
3805 echo "Actually, this looks more like a VENIX system..."
3812 echo "Nor is it Venix..."
3815 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3816 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3823 rp="Use which C compiler?"
3827 : See if they have not cc but they do have gcc
3829 : Look for a hint-file generated 'call-back-unit'. Now that the
3830 : user has specified the compiler, we may need to set or change some
3832 if $test -f cc.cbu; then
3838 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3844 printf("%s\n", __VERSION__);
3846 printf("%s\n", "1");
3852 if $cc -o try $ccflags $ldflags try.c; then
3853 gccversion=`$run ./try`
3854 case "$gccversion" in
3855 '') echo "You are not using GNU cc." ;;
3856 *) echo "You are using GNU cc $gccversion."
3862 echo "*** WHOA THERE!!! ***" >&4
3863 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3864 case "$knowitall" in
3866 echo " You'd better start hunting for one and let me know about it." >&4
3872 case "$gccversion" in
3873 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3875 case "$gccversion" in
3876 '') gccosandvers='' ;;
3877 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3878 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3880 case "$gccosandvers" in
3881 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3882 $osname$osvers) ;; # looking good
3883 $osname*) cat <<EOM >&4
3885 *** WHOA THERE!!! ***
3887 Your gcc has not been compiled for the exact release of
3888 your operating system ($gccosandvers versus $osname$osvers).
3890 In general it is a good idea to keep gcc synchronized with
3891 the operating system because otherwise serious problems
3892 may ensue when trying to compile software, like Perl.
3894 I'm trying to be optimistic here, though, and will continue.
3895 If later during the configuration and build icky compilation
3896 problems appear (headerfile conflicts being the most common
3897 manifestation), I suggest reinstalling the gcc to match
3898 your operating system release.
3902 *) gccosandvers='' ;; # failed to parse, better be silent
3910 # gcc 3.* complain about adding -Idirectories that they already know about,
3911 # so we will take those off from locincpth.
3912 case "$gccversion" in
3914 echo "main(){}">try.c
3915 for incdir in $locincpth; do
3916 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3917 grep '^c[cp]p*[01]: warning: changing search order '`
3918 if test "X$warn" != X; then
3919 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3925 : decide how portable to be. Allow command line overrides.
3926 case "$d_portable" in
3928 *) d_portable="$define" ;;
3931 : set up shell script to do ~ expansion
3937 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3940 if $test -f /bin/csh; then
3941 /bin/csh -f -c "glob \$1"
3946 name=\`$expr x\$1 : '..\([^/]*\)'\`
3947 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3948 if $test ! -d "\$dir"; then
3950 echo "\$me: can't locate home directory for: \$name" >&2
3955 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3971 : now set up to get a file name
3975 cat <<'EOSC' >>getfile
3991 : getfile will accept an answer from the comma-separated list
3992 : enclosed in parentheses even if it does not meet other criteria.
3993 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3994 fn=`echo $fn | sed 's/(.*)//'`
4000 loc_file=`expr $fn : '.*:\(.*\)'`
4001 fn=`expr $fn : '\(.*\):.*'`
4009 */*) fullpath=true;;
4018 *e*) exp_file=true;;
4021 *p*) nopath_ok=true;;
4026 *d*) type='Directory';;
4027 *l*) type='Locate';;
4032 Locate) what='File';;
4037 case "$d_portable" in
4045 while test "$type"; do
4050 true) rp="$rp (~name ok)";;
4053 if test -f UU/getfile.ok && \
4054 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4073 value=`UU/filexp $ans`
4076 if test "$ans" != "$value"; then
4077 echo "(That expands to $value on this system.)"
4091 /*) value="$ansexp" ;;
4092 [a-zA-Z]:/*) value="$ansexp" ;;
4097 echo "I shall only accept a full path name, as in /bin/ls." >&4
4098 echo "Use a ! shell escape if you wish to check pathnames." >&4
4101 echo "Please give a full path name, starting with slash." >&4
4104 echo "Note that using ~name is ok provided it expands well." >&4
4117 for fp in $gfpth; do
4118 if test "X$fp" = X.; then
4123 if test -f "$pf"; then
4125 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4127 echo "($value is not a plain file, but that's ok.)"
4130 if test X"$type" = X; then
4137 for fp in $gfpth; do
4138 if test "X$fp" = X.; then
4143 direxp="$fp/$ansexp"
4145 if test -d "$direxp"; then
4153 if test -d "$ansexp"; then
4154 echo "(Looking for $loc_file in directory $value.)"
4155 value="$value/$loc_file"
4156 ansexp="$ansexp/$loc_file"
4158 if test -f "$ansexp"; then
4161 case "$nopath_ok" in
4162 true) case "$value" in
4164 *) echo "Assuming $value will be in people's path."
4180 if test "$fastread" = yes; then
4185 rp="$what $value doesn't exist. Use that name anyway?"
4204 test "X$gfpthkeep" != Xy && gfpth=""
4207 : What should the include directory be ?
4209 $echo $n "Hmm... $c"
4213 if $test -f /bin/mips && /bin/mips; then
4214 echo "Looks like a MIPS system..."
4215 $cat >usr.c <<'EOCP'
4216 #ifdef SYSTYPE_BSD43
4220 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4221 dflt='/bsd43/usr/include'
4225 mips_type='System V'
4227 $rm -f usr.c usr.out
4228 echo "and you're compiling with the $mips_type compiler and libraries."
4232 echo "Doesn't look like a MIPS system."
4242 case "$xxx_prompt" in
4245 rp='Where are the include files you want to use?'
4253 : see how we invoke the C preprocessor
4255 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4256 cat <<'EOT' >testcpp.c
4262 if test ! -f cppstdin; then
4263 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4264 # AIX cc -E doesn't show the absolute headerfile
4265 # locations but we'll cheat by using the -M flag.
4266 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
4268 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4271 echo "Keeping your $hint cppstdin wrapper."
4274 wrapper=`pwd`/cppstdin
4278 if $test "X$cppstdin" != "X" && \
4279 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4280 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4282 echo "You used to use $cppstdin $cppminus so we'll use that again."
4284 '') echo "But let's see if we can live without a wrapper..." ;;
4286 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4287 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4289 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4292 echo "(However, $cpprun $cpplast does not work, let's see...)"
4300 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4307 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4308 $cc -E <testcpp.c >testcpp.out 2>&1; \
4309 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4310 echo "Yup, it does."
4313 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4314 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4315 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4316 echo "Yup, it does."
4319 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4320 $cc -P <testcpp.c >testcpp.out 2>&1; \
4321 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4322 echo "Yipee, that works!"
4325 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4326 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4327 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4328 echo "At long last!"
4331 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4332 $cpp <testcpp.c >testcpp.out 2>&1; \
4333 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4337 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4338 $cpp - <testcpp.c >testcpp.out 2>&1; \
4339 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4340 echo "Hooray, it works! I was beginning to wonder."
4343 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4344 $wrapper <testcpp.c >testcpp.out 2>&1; \
4345 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4351 rp="No dice. I can't find a C preprocessor. Name one:"
4355 $x_cpp <testcpp.c >testcpp.out 2>&1
4356 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4357 echo "OK, that will do." >&4
4359 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4374 echo "Perhaps can we force $cc -E using a wrapper..."
4375 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4376 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4382 echo "Nope, we'll have to live without it..."
4396 "$wrapper"|'cppstdin') ;;
4397 *) $rm -f $wrapper;;
4399 $rm -f testcpp.c testcpp.out
4401 : Set private lib path
4404 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4409 '') dlist="$loclibpth $plibpth $glibpth";;
4410 *) dlist="$libpth";;
4413 : Now check and see which directories actually exist, avoiding duplicates
4417 if $test -d $xxx; then
4420 *) libpth="$libpth $xxx";;
4426 Some systems have incompatible or broken versions of libraries. Among
4427 the directories listed in the question below, please remove any you
4428 know not to be holding relevant libraries, and add any that are needed.
4429 Say "none" for none.
4440 rp="Directories to use for library searches?"
4447 : compute shared library extension
4450 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4460 On some systems, shared libraries may be available. Answer 'none' if
4461 you want to suppress searching of shared libraries for the remainder
4462 of this configuration.
4465 rp='What is the file extension used for shared libraries?'
4469 : Define several unixisms.
4470 : Hints files or command line option can be used to override them.
4471 : The convoluted testing is in case hints files set either the old
4474 '') case "$exe_ext" in
4476 *) _exe="$exe_ext" ;;
4481 '') case "$lib_ext" in
4488 '') case "$obj_ext" in
4495 '') case "$path_sep" in
4506 : Which makefile gets called first. This is used by make depend.
4507 case "$firstmakefile" in
4508 '') firstmakefile='makefile';;
4511 : Looking for optional libraries
4513 echo "Checking for optional libraries..." >&4
4518 case "$libswanted" in
4519 '') libswanted='c_s';;
4522 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4528 for thisdir in $libpth $xlibpth; do
4529 test -d $thisdir && libspath="$libspath $thisdir"
4531 for thislib in $libswanted; do
4532 for thisdir in $libspath; do
4534 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4535 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4536 $test -f "$xxx" && eval $libscheck
4537 $test -f "$xxx" && libstyle=shared
4539 if test ! -f "$xxx"; then
4540 xxx=$thisdir/lib$thislib.$so
4541 $test -f "$xxx" && eval $libscheck
4542 $test -f "$xxx" && libstyle=shared
4544 if test ! -f "$xxx"; then
4545 xxx=$thisdir/lib$thislib$_a
4546 $test -f "$xxx" && eval $libscheck
4547 $test -f "$xxx" && libstyle=static
4549 if test ! -f "$xxx"; then
4550 xxx=$thisdir/$thislib$_a
4551 $test -f "$xxx" && eval $libscheck
4552 $test -f "$xxx" && libstyle=static
4554 if test ! -f "$xxx"; then
4555 xxx=$thisdir/lib${thislib}_s$_a
4556 $test -f "$xxx" && eval $libscheck
4557 $test -f "$xxx" && libstyle=static
4558 $test -f "$xxx" && thislib=${thislib}_s
4560 if test ! -f "$xxx"; then
4561 xxx=$thisdir/Slib$thislib$_a
4562 $test -f "$xxx" && eval $libscheck
4563 $test -f "$xxx" && libstyle=static
4565 if $test -f "$xxx"; then
4567 shared) echo "Found -l$thislib (shared)." ;;
4568 static) echo "Found -l$thislib." ;;
4569 *) echo "Found -l$thislib ($libstyle)." ;;
4573 *) dflt="$dflt -l$thislib"
4574 libsfound="$libsfound $xxx"
4576 libsfiles="$libsfiles $yyy"
4577 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4578 case " $libsdirs " in
4580 *) libsdirs="$libsdirs $yyy" ;;
4587 if $test ! -f "$xxx"; then
4588 echo "No -l$thislib."
4599 ' '|'') dflt='none';;
4604 In order to compile $package on your machine, a number of libraries
4605 are usually needed. Include any other special libraries here as well.
4606 Say "none" for none. The default list is almost always right.
4610 rp="What libraries to use?"
4617 : determine optimization, if desired, or use for debug flag also
4619 ' '|$undef) dflt='none';;
4621 *) dflt="$optimize";;
4625 By default, $package compiles with the -O flag to use the optimizer.
4626 Alternately, you might want to use the symbolic debugger, which uses
4627 the -g flag (on traditional Unix systems). Either flag can be
4628 specified here. To use neither flag, specify the word "none".
4631 rp="What optimizer/debugger flag should be used?"
4635 'none') optimize=" ";;
4639 : We will not override a previous value, but we might want to
4640 : augment a hint file
4642 default|recommended)
4643 case "$gccversion" in
4644 1*) dflt='-fpcc-struct-return' ;;
4647 *-g*) dflt="$dflt -DDEBUGGING";;
4649 case "$gccversion" in
4650 2*) if test -d /etc/conf/kconfig.d &&
4651 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4657 case "$gccversion" in
4661 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4662 echo 'int main(void) { return 0; }' > gcctest.c
4663 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4664 echo "Yes, it does." 2>&1
4667 echo "Leaving current flags $ccflags alone." 2>&1
4669 *) dflt="$dflt -fno-strict-aliasing" ;;
4672 echo "Nope, it doesn't, but that's ok." 2>&1
4679 case "$mips_type" in
4680 *BSD*|'') inclwanted="$locincpth $usrinc";;
4681 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4683 for thisincl in $inclwanted; do
4684 if $test -d $thisincl; then
4685 if $test x$thisincl != x$usrinc; then
4687 *" -I$thisincl "*);;
4688 *) dflt="$dflt -I$thisincl ";;
4694 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4696 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4704 *) dflt="$dflt -D$2";;
4708 set signal.h LANGUAGE_C; eval $inctest
4712 ccflags="$ccflags -DSOCKS"
4717 default|recommended) dflt="$ccflags $dflt" ;;
4718 *) dflt="$ccflags";;
4727 Your C compiler may want other flags. For this question you should include
4728 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4729 but you should NOT include libraries or ld flags like -lwhatever. If you
4730 want $package to honor its debug switch, you should include -DDEBUGGING here.
4731 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4733 To use no flags, specify the word "none".
4739 rp="Any additional cc flags?"
4746 : the following weeds options from ccflags that are of no interest to cpp
4748 '') cppflags="$ccflags" ;;
4749 *) cppflags="$cppflags $ccflags" ;;
4751 case "$gccversion" in
4752 1*) cppflags="$cppflags -D__GNUC__"
4754 case "$mips_type" in
4756 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4762 echo "Let me guess what the preprocessor flags are..." >&4
4776 *) ftry="$previous $flag";;
4778 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4779 >cpp1.out 2>/dev/null && \
4780 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4781 >cpp2.out 2>/dev/null && \
4782 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4783 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4785 cppflags="$cppflags $ftry"
4795 *-*) echo "They appear to be: $cppflags";;
4797 $rm -f cpp.c cpp?.out
4801 : flags used in final linking phase
4803 '') if ./venix; then
4809 *-posix*) dflt="$dflt -posix" ;;
4812 *) dflt="$ldflags";;
4815 : Try to guess additional flags to pick up local libraries.
4816 for thislibdir in $libpth; do
4817 case " $loclibpth " in