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 Sep 12 16:47:06 EET DST 2000 [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...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
295 ignore_versioned_solibs=''
327 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
330 : We must find out about Eunice early
332 if test -f /etc/unixtovms; then
333 eunicefix=/etc/unixtovms
335 if test -f /etc/unixtovms.exe; then
336 eunicefix=/etc/unixtovms.exe
342 : Trailing extension. Override this in a hint file, if needed.
344 : Extra object files, if any, needed on this platform.
348 : Possible local include directories to search.
349 : Set locincpth to "" in a hint file to defeat local include searches.
350 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
351 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
353 : no include file wanted by default
356 : change the next line if compiling for Xenix/286 on Xenix/386
357 xlibpth='/usr/lib/386 /lib/386'
358 : Possible local library directories to search.
359 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
360 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
362 : general looking path for locating libraries
363 glibpth="/lib /usr/lib $xlibpth"
364 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
365 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
366 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
368 : Private path used by Configure to find libraries. Its value
369 : is prepended to libpth. This variable takes care of special
370 : machines, like the mips. Usually, it should be empty.
373 : default library list
375 : some systems want to use only the non-versioned libso:s
376 ignore_versioned_solibs=''
377 : set usesocks on the Configure command line to enable socks.
378 : List of libraries we want.
379 : If anyone needs -lnet, put it in a hint file.
380 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
381 libswanted="$libswanted dld ld sun m c cposix posix"
382 libswanted="$libswanted ndir dir crypt sec"
383 libswanted="$libswanted ucb bsd BSD PW x iconv util"
384 : We probably want to search /usr/shlib before most other libraries.
385 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
386 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
387 glibpth="/usr/shlib $glibpth"
388 : Do not use vfork unless overridden by a hint file.
391 : Find the basic shell for Bourne shell scripts
395 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
398 if test -f "$xxx"; then
401 : Build up a list and do a single loop so we can 'break' out.
402 pth=`echo $PATH | sed -e "s/$p_/ /g"`
403 for xxx in sh bash ksh pdksh ash; do
405 try="$try ${p}/${xxx}"
409 if test -f "$xxx"; then
412 elif test -f "$xxx.exe"; then
423 $me: Fatal Error: I can't find a Bourne Shell anywhere.
425 Usually it's in /bin/sh. How did you even get this far?
426 Please contact me (Perl Maintainers) at perlbug@perl.org and
427 we'll try to straighten this all out.
433 : see if sh knows # comments
434 if `$sh -c '#' >/dev/null 2>&1`; then
438 test -f $xcat || xcat=/usr/bin/cat
443 if test -s today; then
446 echo "#! $xcat" > try
450 if test -s today; then
458 echo "Your $sh doesn't grok # comments--I will strip them later on."
461 echo "exec grep -v '^[ ]*#'" >spitshell
464 spitshell=`pwd`/spitshell
466 echo "I presume that if # doesn't work, #! won't work either!"
471 : figure out how to guarantee sh startup
473 '') startsh=${sharpbang}${sh} ;;
485 : echo "Yup, it does."
487 echo "Hmm... '$startsh' does not guarantee sh startup..."
488 echo "You may have to fix up the shell scripts to make sure $sh runs them."
493 : Save command line options in file UU/cmdline.opt for later use in
494 : generating config.sh.
495 cat > cmdline.opt <<EOSH
496 # Configure command line arguments.
503 cat >>cmdline.opt <<EOSH
504 config_arg$argn='$arg'
506 argn=`expr $argn + 1`
509 : produce awk script to parse command line options
510 cat >options.awk <<'EOF'
512 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
514 len = length(optstr);
515 for (i = 1; i <= len; i++) {
516 c = substr(optstr, i, 1);
517 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
528 if (substr(str, 1, 1) != "-") {
529 printf("'%s'\n", str);
533 for (i = 2; i <= len; i++) {
534 c = substr(str, i, 1);
536 printf("-%s\n", substr(str, i));
542 printf("'%s'\n", substr(str, i + 1));
555 : process the command line options
556 set X `for arg in "$@"; do echo "X$arg"; done |
557 sed -e s/X// | awk -f options.awk`
562 : set up default values
572 rm -f optdef.sh posthint.sh
579 while test $# -gt 0; do
581 -d) shift; fastread=yes;;
582 -e) shift; alldone=cont;;
586 if test -r "$1"; then
589 echo "$me: cannot read config file $1." >&2
594 -h) shift; error=true;;
595 -r) shift; reuseval=true;;
596 -s) shift; silent=true; realsilent=true;;
597 -E) shift; alldone=exit;;
598 -K) shift; knowitall=true;;
599 -O) shift; override=true;;
600 -S) shift; silent=true; extractsh=true;;
605 echo "$me: use '-U symbol=', not '-D symbol='." >&2
606 echo "$me: ignoring -D $1" >&2
609 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
610 *) echo "$1='define'" >> optdef.sh;;
617 *=) echo "$1" >> optdef.sh;;
619 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
620 echo "$me: ignoring -U $1" >&2
622 *) echo "$1='undef'" >> optdef.sh;;
633 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
637 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
638 yyy=`echo $yyy|sed 's!=.*!!'` ;;
644 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
645 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
646 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
647 yyy=`echo $yyy|sed 's!=.*!!'` ;;
648 *) xxx=`echo $yyy|sed 's!:.*!!'`
649 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
655 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
657 echo "$yyy=''" >> posthint.sh ;;
662 echo "$yyy='$zzz'" >> posthint.sh ;;
664 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
666 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
671 echo "$yyy=$zzz" >> posthint.sh ;;
672 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
676 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
679 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
687 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
688 [-U symbol] [-U symbol=] [-A command:symbol...]
689 -d : use defaults for all answers.
690 -e : go on without questioning past the production of config.sh.
691 -f : specify an alternate default configuration file.
692 -h : print this help message and exit (with an error status).
693 -r : reuse C symbols value if possible (skips costly nm extraction).
694 -s : silent mode, only echoes questions and essential information.
695 -D : define symbol to have some value:
696 -D symbol symbol gets the value 'define'
697 -D symbol=value symbol gets the value 'value'
698 -E : stop at the end of questions, after having produced config.sh.
699 -K : do not use unless you know what you are doing.
700 -O : let -D and -U override definitions from loaded configuration file.
701 -S : perform variable substitutions on all .SH files (can mix with -f)
702 -U : undefine symbol:
703 -U symbol symbol gets the value 'undef'
704 -U symbol= symbol gets completely empty
705 -A : manipulate symbol after the platform specific hints have been applied:
706 -A symbol=value append " "value to symbol
707 -A append:symbol=value append value to symbol
708 -A define:symbol=value define symbol to have value
709 -A clear:symbol define symbol to be ''
710 -A define:symbol define symbol to be 'define'
711 -A eval:symbol=value define symbol to be eval of value
712 -A prepend:symbol=value prepend value to symbol
713 -A undef:symbol define symbol to be 'undef'
714 -A undef:symbol= define symbol to be ''
715 -V : print version number and exit (with a zero status).
722 case "$fastread$alldone" in
729 echo "Say 'sh Configure', not 'sh <Configure'"
739 true) exec 1>/dev/null;;
742 : run the defines and the undefines, if any, but leave the file out there...
745 : create the posthint manipulation script and leave the file out there...
751 : Some greps do not return status, grrr.
752 echo "grimblepritz" >grimble
753 if grep blurfldyick grimble >/dev/null 2>&1 ; then
755 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
761 : the following should work in any shell
765 echo "AGH! Grep doesn't return a status. Attempting remedial action."
766 cat >contains <<'EOSS'
767 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
772 : Find the path to the source tree
775 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
778 *) src=`cd ../$src && pwd` ;;
791 if test -f $rsrc/Configure && \
792 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
794 : found it, so we are ok.
797 for src in . .. ../.. ../../.. ../../../..; do
798 if test -f ../$src/Configure && \
799 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
810 Sorry, I can't seem to locate the source dir for $package. Please start
811 Configure with an explicit path -- i.e. /some/path/Configure.
819 echo "Sources for $package found in \"$src\"." >&4
823 : script used to extract .SH files with variable substitutions
826 echo "Doing variable substitutions on .SH files..."
827 if test -f $src/MANIFEST; then
828 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
830 echo "(Looking for .SH files under the source directory.)"
831 set x `(cd $src; find . -name "*.SH" -print)`
835 0) set x `(cd $src; echo *.SH)`; shift;;
837 if test ! -f $src/$1; then
844 if test ! -d "$name"; then
845 create="$name $create";
846 name=`echo $name | sed -e "s|^[^/]*$||"`;
847 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
852 for file in $create; do
861 dir=`expr X$file : 'X\(.*\)/'`
862 file=`expr X$file : 'X.*/\(.*\)'`
863 (cd $dir && . ./$file)
873 dir=`expr X$file : 'X\(.*\)/'`
874 file=`expr X$file : 'X.*/\(.*\)'`
875 (set x $dir; shift; eval $mkdir_p)
885 if test -f $src/config_h.SH; then
886 if test ! -f config.h; then
887 : oops, they left it out of MANIFEST, probably, so do it anyway.
893 : extract files and exit if asked to do so
896 case "$realsilent" in
901 '') config_sh='config.sh';;
904 echo "Fetching answers from $config_sh..."
907 test "$override" && . ./optdef.sh
916 : Eunice requires " " instead of "", can you believe it
919 echo "Beginning of configuration questions for $package."
921 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
923 : first determine how to suppress newline on echo command
925 echo "Checking echo to see how to suppress newlines..."
926 (echo "hi there\c" ; echo " ") >.echotmp
927 if $contains c .echotmp >/dev/null 2>&1 ; then
938 echo $n "The star should be here-->$c"
942 : Now test for existence of everything in MANIFEST
944 if test -f $rsrc/MANIFEST; then
945 echo "First let's make sure your kit is complete. Checking..." >&4
946 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
949 for filelist in x??; do
950 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
952 if test -s missing; then
956 THIS PACKAGE SEEMS TO BE INCOMPLETE.
958 You have the option of continuing the configuration process, despite the
959 distinct possibility that your kit is damaged, by typing 'y'es. If you
960 do, don't blame me if something goes wrong. I advise you to type 'n'o
961 and contact the author (perlbug@perl.org).
964 echo $n "Continue? [n] $c" >&4
968 echo "Continuing..." >&4
972 echo "ABORTING..." >&4
980 echo "There is no MANIFEST file. I hope your kit is complete !"
985 : Find the appropriate value for a newline for tr
986 if test -n "$DJGPP"; then
989 if test X"$trnl" = X; then
990 case "`echo foo|tr '\n' x 2>/dev/null`" in
994 if test X"$trnl" = X; then
995 case "`echo foo|tr '\012' x 2>/dev/null`" in
999 if test X"$trnl" = X; then
1002 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1008 : compute the number of columns on the terminal for proper question formatting
1013 : set up the echo used in my read
1014 myecho="case \"\$xxxm\" in
1015 '') echo $n \"\$rp $c\" >&4;;
1017 '') echo $n \"[\$xxxm] $c\";;
1019 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1021 echo $n \"[\$xxxm] $c\" >&4
1023 echo $n \"\$rp [\$xxxm] $c\" >&4
1029 : now set up to do reads with possible shell escape and default assignment
1035 case "\$fastread" in
1036 yes) case "\$dflt" in
1039 case "\$silent-\$rp" in
1044 *) case "\$silent" in
1045 true) case "\$rp" in
1050 while expr "X\$ans" : "X!" >/dev/null; do
1054 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1062 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1071 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1076 echo "(OK, I'll run with -d after this question.)" >&4
1079 echo "*** Sorry, \$1 not supported yet." >&4
1089 echo "*** Substitution done -- please confirm."
1091 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1096 echo "*** Error -- try again."
1103 case "\$ans\$xxxm\$nostick" in
1115 : create .config dir to save info across Configure sessions
1116 test -d ../.config || mkdir ../.config
1117 cat >../.config/README <<EOF
1118 This directory created by Configure to save information that should
1119 persist across sessions for $package.
1121 You may safely delete it if you wish.
1124 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1126 $define|true|[yY]*) ;;
1127 *) case "$xversion" in
1130 *** WHOA THERE!!! ***
1132 This is an UNSTABLE DEVELOPMENT release.
1133 The version of this $package distribution is $xversion, that is, odd,
1134 (as opposed to even) and that signifies a development release.
1135 If you want a maintenance release, you want an even-numbered version.
1137 Do ***NOT*** install this into production use.
1138 Data corruption and crashes are possible.
1140 It is most seriously suggested that you do not continue any further
1141 unless you want to help in developing and debugging Perl.
1144 rp='Do you really want to continue?'
1148 [yY]) echo >&4 "Okay, continuing." ;;
1149 *) echo >&4 "Okay, bye."
1158 : general instructions
1161 user=`(logname) 2>/dev/null`
1163 '') user=`whoami 2>&1`;;
1165 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1168 rp='Would you like to see the instructions?'
1179 This installation shell script will examine your system and ask you questions
1180 to determine how the perl5 package should be installed. If you get
1181 stuck on a question, you may use a ! shell escape to start a subshell or
1182 execute a command. Many of the questions will have default answers in square
1183 brackets; typing carriage return will give you the default.
1185 On some of the questions which ask for file or directory names you are allowed
1186 to use the ~name construct to specify the login directory belonging to "name",
1187 even if you don't have a shell which knows about that. Questions where this is
1188 allowed will be marked "(~name ok)".
1192 dflt='Type carriage return to continue'
1196 The prompter used in this script allows you to use shell variables and
1197 backticks in your answers. You may use $1, $2, etc... to refer to the words
1198 in the default answer, as if the default line was a set of arguments given to a
1199 script shell. This means you may also use $* to repeat the whole default line,
1200 so you do not have to re-type everything to add something to the default.
1202 Everytime there is a substitution, you will have to confirm. If there is an
1203 error (e.g. an unmatched backtick), the default answer will remain unchanged
1204 and you will be prompted again.
1206 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1207 the questions and use the computed defaults (or the previous answers if there
1208 was already a config.sh file). Type 'Configure -h' for a list of options.
1209 You may also start interactively and then answer '& -d' at any prompt to turn
1210 on the non-interactive behaviour for the remainder of the execution.
1216 Much effort has been expended to ensure that this shell script will run on any
1217 Unix system. If despite that it blows up on yours, your best bet is to edit
1218 Configure and run it again. If you can't run Configure for some reason,
1219 you'll have to generate a config.sh file by hand. Whatever problems you
1220 have, let me (perlbug@perl.org) know how I blew it.
1222 This installation script affects things in two ways:
1224 1) it may do direct variable substitutions on some of the files included
1226 2) it builds a config.h file for inclusion in C programs. You may edit
1227 any of these files as the need arises after running this script.
1229 If you make a mistake on a question, there is no easy way to back up to it
1230 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1231 files. Configure will offer to let you do this before it runs the SH files.
1234 dflt='Type carriage return to continue'
1236 case "$firsttime" in
1237 true) echo $user >>../.config/instruct;;
1241 : find out where common programs are
1243 echo "Locating common programs..." >&4
1256 if test -d \$dir/\$thing; then
1262 for thisthing in \$dir/\$thing; do
1263 : just loop through to pick last item
1265 if test -f \$thisthing; then
1268 elif test -f \$dir/\$thing.exe; then
1269 if test -n "$DJGPP"; then
1270 echo \$dir/\$thing.exe
1272 : on Eunice apparently
1311 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1312 pth="$pth /lib /usr/lib"
1313 for file in $loclist; do
1317 if test -f "$xxx"; then
1320 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1321 xxx=`./loc $file $file $pth`
1324 '') xxx=`./loc $file $file $pth`;;
1325 *) xxx=`./loc $xxx $xxx $pth`;;
1331 echo $file is in $xxx.
1334 echo $file is in $xxx.
1337 echo "I don't know where '$file' is, and my life depends on it." >&4
1338 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1344 echo "Don't worry if any of the following aren't found..."
1346 for file in $trylist; do
1350 if test -f "$xxx"; then
1353 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1354 xxx=`./loc $file $file $pth`
1357 '') xxx=`./loc $file $file $pth`;;
1358 *) xxx=`./loc $xxx $xxx $pth`;;
1364 echo $file is in $xxx.
1367 echo $file is in $xxx.
1370 echo "I don't see $file out there, $say."
1377 echo "Substituting grep for egrep."
1383 echo "Substituting cp for ln."
1389 echo "Hopefully test is built into your sh."
1392 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1393 echo "Using the test built into your sh."
1401 echo "Hopefully echo is built into your sh."
1406 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1407 $echo $n "hi there$c" >foo1
1408 echo $n "hi there$c" >foo2
1409 if cmp foo1 foo2 >/dev/null 2>&1; then
1410 echo "They are compatible. In fact, they may be identical."
1417 They are not compatible! You are probably running ksh on a non-USG system.
1418 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1419 have echo built in and we may have to run some Bourne shell scripts. That
1420 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1423 $echo $n "The star should be here-->$c"
1433 cat <<'EOSC' >>checkcc
1438 int main(int argc, char *argv[]) {
1442 if $cc -o try try.c; then
1445 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
1451 case "`$cc -v -c try.c 2>&1`" in
1454 if $test X"$trygcc" = Xyes; then
1455 if gcc -o try -c try.c; then
1457 echo "You seem to have a working gcc, though." >&4
1458 rp="Would you like to use it?"
1460 if $test -f myread; then
1463 if $test -f UU/myread; then
1466 echo "Cannot find myread, sorry. Aborting." >&2
1471 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
1475 if $test X"$despair" = Xyes; then
1476 echo "You need to find a working C compiler." >&4
1477 echo "I cannot continue any further, aborting." >&4
1486 : determine whether symbolic links are supported
1489 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1490 echo "Symbolic links are supported." >&4
1493 echo "Symbolic links are NOT supported." >&4
1498 : see whether [:lower:] and [:upper:] are supported character classes
1500 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1502 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1506 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1507 # (0xc9 and 0xd1), therefore that is a nice testing point.
1508 if test "X$up" = X -o "X$low" = X; then
1509 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1515 if test "X$up" = X -o "X$low" = X; then
1516 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1522 if test "X$up" = X -o "X$low" = X; then
1523 case "`echo IJ | od -x 2>/dev/null`" in
1525 echo "Hey, this might be EBCDIC." >&4
1526 if test "X$up" = X -o "X$low" = X; then
1527 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1528 ij) up='[A-IJ-RS-Z]'
1533 if test "X$up" = X -o "X$low" = X; then
1534 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1544 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
1546 echo "Using $up and $low to convert case." >&4
1549 echo "I don't know how to translate letters from upper to lower case." >&4
1550 echo "Your tr is not acting any way I know of." >&4
1554 : set up the translation script tr, must be called with ./tr of course
1558 '[A-Z][a-z]') exec $tr '$up' '$low';;
1559 '[a-z][A-Z]') exec $tr '$low' '$up';;
1566 : Try to determine whether config.sh was made on this system
1567 case "$config_sh" in
1569 myuname=`$uname -a 2>/dev/null`
1570 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
1571 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
1572 # because the A-Z/a-z are not consecutive.
1573 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1574 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1575 newmyuname="$myuname"
1577 case "$knowitall" in
1579 if test -f ../config.sh; then
1580 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1581 eval "`grep myuname= ../config.sh`"
1583 if test "X$myuname" = "X$newmyuname"; then
1591 : Get old answers from old config file if Configure was run on the
1592 : same system, otherwise use the hints.
1595 if test -f config.sh; then
1597 rp="I see a config.sh file. Shall I use it to set the defaults?"
1600 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1601 *) echo "Fetching default answers from your old config.sh file..." >&4
1609 : Older versions did not always set $sh. Catch re-use of such
1619 if test ! -f config.sh; then
1622 First time through, eh? I have some defaults handy for some systems
1623 that need some extra help getting the Configure answers right:
1626 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
1628 : Half the following guesses are probably wrong... If you have better
1629 : tests or hints, please send them to perlbug@perl.org
1630 : The metaconfig authors would also appreciate a copy...
1631 $test -f /irix && osname=irix
1632 $test -f /xenix && osname=sco_xenix
1633 $test -f /dynix && osname=dynix
1634 $test -f /dnix && osname=dnix
1635 $test -f /lynx.os && osname=lynxos
1636 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1637 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
1638 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
1639 $test -f /bin/mips && /bin/mips && osname=mips
1640 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1641 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1642 $test -d /usr/apollo/bin && osname=apollo
1643 $test -f /etc/saf/_sactab && osname=svr4
1644 $test -d /usr/include/minix && osname=minix
1645 if $test -d /MachTen -o -d /MachTen_Folder; then
1647 if $test -x /sbin/version; then
1648 osvers=`/sbin/version | $awk '{print $2}' |
1649 $sed -e 's/[A-Za-z]$//'`
1650 elif $test -x /usr/etc/version; then
1651 osvers=`/usr/etc/version | $awk '{print $2}' |
1652 $sed -e 's/[A-Za-z]$//'`
1658 $test -f /sys/posix.dll &&
1659 $test -f /usr/bin/what &&
1660 set X `/usr/bin/what /sys/posix.dll` &&
1661 $test "$3" = UWIN &&
1665 if $test -f $uname; then
1673 umips) osname=umips ;;
1676 [23]100) osname=mips ;;
1677 next*) osname=next ;;
1679 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
1680 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
1683 elif $test -f /etc/kconfig; then
1685 if test "$lns" = "$ln -s"; then
1687 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1689 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1696 if test -n "$DJGPP"; then
1705 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1707 'not found') osvers="$4"."$3" ;;
1708 '<3240'|'<>3240') osvers=3.2.0 ;;
1709 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1710 '=3250'|'>3250') osvers=3.2.5 ;;
1714 bsd386) osname=bsd386
1717 cygwin*) osname=cygwin
1720 *dc.osx) osname=dcosx
1726 domainos) osname=apollo
1732 dynixptx*) osname=dynixptx
1733 osvers=`echo "$4"|sed 's/^v//'`
1735 freebsd) osname=freebsd
1737 genix) osname=genix ;;
1739 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
1755 netbsd*) osname=netbsd
1758 news-os) osvers="$3"
1760 4*) osname=newsos4 ;;
1764 next*) osname=next ;;
1765 POSIX-BC | posix-bc ) osname=posix-bc
1768 powerux | power_ux | powermax_os | powermaxos | \
1769 powerunix | power_unix) osname=powerux
1775 solaris) osname=solaris
1777 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1784 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1788 titanos) osname=titanos
1797 ultrix) osname=ultrix
1800 osf1|mls+) case "$5" in
1803 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
1806 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
1809 hp*) osname=hp_osf1 ;;
1810 mips) osname=mips_osf1 ;;
1813 unixware) osname=svr5
1819 $2) case "$osname" in
1823 : svr4.x or possibly later
1833 if test -f /stand/boot ; then
1834 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
1835 if test -n "$INITPROG" -a -f "$INITPROG"; then
1836 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1837 if test -n "$isesix"; then
1845 *) if test -f /etc/systemid; then
1847 set `echo $3 | $sed 's/\./ /g'` $4
1848 if $test -f $src/hints/sco_$1_$2_$3.sh; then
1850 elif $test -f $src/hints/sco_$1_$2.sh; then
1852 elif $test -f $src/hints/sco_$1.sh; then
1857 '') : Still unknown. Probably a generic Sys V.
1866 *) case "$osname" in
1867 '') : Still unknown. Probably a generic BSD.
1875 if test -f /vmunix -a -f $src/hints/news_os.sh; then
1876 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
1877 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
1880 $rm -f UU/kernel.what
1881 elif test -d c:/.; then
1888 : Now look for a hint file osname_osvers, unless one has been
1889 : specified already.
1892 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
1893 : Also try without trailing minor version numbers.
1894 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
1895 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
1896 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
1897 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
1900 *) case "$osvers" in
1903 *) if $test -f $src/hints/$file.sh ; then
1905 elif $test -f $src/hints/$xfile.sh ; then
1907 elif $test -f $src/hints/$xxfile.sh ; then
1909 elif $test -f $src/hints/$xxxfile.sh ; then
1911 elif $test -f $src/hints/$xxxxfile.sh ; then
1913 elif $test -f "$src/hints/${osname}.sh" ; then
1922 if $test -f Policy.sh ; then
1925 none) dflt="Policy" ;;
1926 *) dflt="Policy $dflt" ;;
1931 dflt=`echo $hintfile | $sed 's/\.sh$//'`
1935 if $test -f Policy.sh ; then
1938 There's also a Policy hint file available, which should make the
1939 site-specific (policy) questions easier to answer.
1946 You may give one or more space-separated answers, or "none" if appropriate.
1947 A well-behaved OS will have no hints, so answering "none" or just "Policy"
1948 is a good thing. DO NOT give a wrong version or a wrong OS.
1952 rp="Which of these apply, if any?"
1955 for file in $tans; do
1956 if $test X$file = XPolicy -a -f Policy.sh; then
1958 $cat Policy.sh >> UU/config.sh
1959 elif $test -f $src/hints/$file.sh; then
1960 . $src/hints/$file.sh
1961 $cat $src/hints/$file.sh >> UU/config.sh
1962 elif $test X$tans = X -o X$tans = Xnone ; then
1965 : Give one chance to correct a possible typo.
1966 echo "$file.sh does not exist"
1968 rp="hint to use instead?"
1970 for file in $ans; do
1971 if $test -f "$src/hints/$file.sh"; then
1972 . $src/hints/$file.sh
1973 $cat $src/hints/$file.sh >> UU/config.sh
1974 elif $test X$ans = X -o X$ans = Xnone ; then
1977 echo "$file.sh does not exist -- ignored."
1984 : Remember our hint file for later.
1985 if $test -f "$src/hints/$file.sh" ; then
1995 echo "Fetching default answers from $config_sh..." >&4
1999 cp $config_sh config.sh 2>/dev/null
2009 test "$override" && . ./optdef.sh
2010 myuname="$newmyuname"
2012 : Restore computed paths
2013 for file in $loclist $trylist; do
2014 eval $file="\$_$file"
2019 Configure uses the operating system name and version to set some defaults.
2020 The default value is probably right if the name rings a bell. Otherwise,
2021 since spelling matters for me, either accept the default or answer "none"
2028 ''|' '|none) dflt=none ;;
2029 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2032 *) dflt="$osname" ;;
2034 rp="Operating system name?"
2038 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2044 ''|' '|none) dflt=none ;;
2045 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2046 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2048 ''|' ') dflt=none ;;
2053 *) dflt="$osvers" ;;
2055 rp="Operating system version?"
2065 : who configured the system
2066 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2067 cf_by=`(logname) 2>/dev/null`
2070 cf_by=`(whoami) 2>/dev/null`
2072 "") cf_by=unknown ;;
2076 : make some quick guesses about what we are up against
2078 $echo $n "Hmm... $c"
2088 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2089 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2091 echo "Looks kind of like an OSF/1 system, but we'll see..."
2093 elif test `echo abc | tr a-z A-Z` = Abc ; then
2094 xxx=`./loc addbib blurfl $pth`
2095 if $test -f $xxx; then
2096 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2100 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2101 echo "Looks kind of like an extended USG system, but we'll see..."
2103 echo "Looks kind of like a USG system, but we'll see..."
2107 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2108 echo "Looks kind of like a BSD system, but we'll see..."
2112 echo "Looks kind of like a Version 7 system, but we'll see..."
2115 case "$eunicefix" in
2118 There is, however, a strange, musty smell in the air that reminds me of
2119 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2123 : it so happens the Eunice I know will not run shell scripts in Unix format
2127 echo "Congratulations. You aren't running Eunice."
2131 : Detect OS2. The p_ variable is set above in the Head.U unit.
2132 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
2133 : semicolon as a patch separator
2138 I have the feeling something is not exactly right, however...don't tell me...
2139 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2140 (Or you may be running DOS with DJGPP.)
2145 if test -f /xenix; then
2146 echo "Actually, this looks more like a XENIX system..."
2151 echo "It's not Xenix..."
2156 if test -f /venix; then
2157 echo "Actually, this looks more like a VENIX system..."
2164 echo "Nor is it Venix..."
2167 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2168 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2175 rp="Use which C compiler?"
2178 : Look for a hint-file generated 'call-back-unit'. Now that the
2179 : user has specified the compiler, we may need to set or change some
2181 if $test -f cc.cbu; then
2187 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2188 $cat >gccvers.c <<EOM
2193 printf("%s\n", __VERSION__);
2195 printf("%s\n", "1");
2201 if $cc $ldflags -o gccvers gccvers.c; then
2202 gccversion=`./gccvers`
2203 case "$gccversion" in
2204 '') echo "You are not using GNU cc." ;;
2205 *) echo "You are using GNU cc $gccversion."
2211 echo "*** WHOA THERE!!! ***" >&4
2212 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
2213 case "$knowitall" in
2215 echo " You'd better start hunting for one and let me know about it." >&4
2221 case "$gccversion" in
2222 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
2224 case "$gccversion" in
2225 '') gccosandvers='' ;;
2226 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
2227 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
2229 case "$gccosandvers" in
2230 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
2231 $osname$osvers) ;; # looking good
2232 $osname*) cat <<EOM >&4
2234 *** WHOA THERE!!! ***
2236 Your gcc has not been compiled for the exact release of
2237 your operating system ($gccosandvers versus $osname$osvers).
2239 In general it is a good idea to keep gcc synchronized with
2240 the operating system because otherwise serious problems
2241 may ensue when trying to compile software, like Perl.
2243 I'm trying to be optimistic here, though, and will continue.
2244 If later during the configuration and build icky compilation
2245 problems appear (headerfile conflicts being the most common
2246 manifestation), I suggest reinstalling the gcc to match
2247 your operating system release.
2251 *) gccosandvers='' ;; # failed to parse, better be silent
2259 : see how we invoke the C preprocessor
2261 echo "Now, how can we feed standard input to your C preprocessor..." >&4
2262 cat <<'EOT' >testcpp.c
2268 if test ! -f cppstdin; then
2269 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
2270 # AIX cc -E doesn't show the absolute headerfile
2271 # locations but we'll cheat by using the -M flag.
2272 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
2274 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
2277 echo "Keeping your $hint cppstdin wrapper."
2280 wrapper=`pwd`/cppstdin
2284 if $test "X$cppstdin" != "X" && \
2285 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
2286 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2288 echo "You used to use $cppstdin $cppminus so we'll use that again."
2290 '') echo "But let's see if we can live without a wrapper..." ;;
2292 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
2293 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2295 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
2298 echo "(However, $cpprun $cpplast does not work, let's see...)"
2306 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
2313 elif echo 'Maybe "'"$cc"' -E" will work...'; \
2314 $cc -E <testcpp.c >testcpp.out 2>&1; \
2315 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2316 echo "Yup, it does."
2319 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
2320 $cc -E - <testcpp.c >testcpp.out 2>&1; \
2321 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2322 echo "Yup, it does."
2325 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
2326 $cc -P <testcpp.c >testcpp.out 2>&1; \
2327 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2328 echo "Yipee, that works!"
2331 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
2332 $cc -P - <testcpp.c >testcpp.out 2>&1; \
2333 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2334 echo "At long last!"
2337 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
2338 $cpp <testcpp.c >testcpp.out 2>&1; \
2339 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2343 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
2344 $cpp - <testcpp.c >testcpp.out 2>&1; \
2345 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2346 echo "Hooray, it works! I was beginning to wonder."
2349 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
2350 $wrapper <testcpp.c >testcpp.out 2>&1; \
2351 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2357 rp="No dice. I can't find a C preprocessor. Name one:"
2361 $x_cpp <testcpp.c >testcpp.out 2>&1
2362 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2363 echo "OK, that will do." >&4
2365 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
2380 echo "Perhaps can we force $cc -E using a wrapper..."
2381 if $wrapper <testcpp.c >testcpp.out 2>&1; \
2382 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2388 echo "Nope, we'll have to live without it..."
2402 "$wrapper"|'cppstdin') ;;
2403 *) $rm -f $wrapper;;
2405 $rm -f testcpp.c testcpp.out
2407 : decide how portable to be. Allow command line overrides.
2408 case "$d_portable" in
2410 *) d_portable="$define" ;;
2413 : set up shell script to do ~ expansion
2419 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2422 if $test -f /bin/csh; then
2423 /bin/csh -f -c "glob \$1"
2428 name=\`$expr x\$1 : '..\([^/]*\)'\`
2429 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2430 if $test ! -d "\$dir"; then
2432 echo "\$me: can't locate home directory for: \$name" >&2
2437 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2453 : now set up to get a file name
2457 cat <<'EOSC' >>getfile
2473 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2474 fn=`echo $fn | sed 's/(.*)//'`
2480 loc_file=`expr $fn : '.*:\(.*\)'`
2481 fn=`expr $fn : '\(.*\):.*'`
2489 */*) fullpath=true;;
2498 *e*) exp_file=true;;
2501 *p*) nopath_ok=true;;
2506 *d*) type='Directory';;
2507 *l*) type='Locate';;
2512 Locate) what='File';;
2517 case "$d_portable" in
2525 while test "$type"; do
2530 true) rp="$rp (~name ok)";;
2533 if test -f UU/getfile.ok && \
2534 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2553 value=`UU/filexp $ans`
2556 if test "$ans" != "$value"; then
2557 echo "(That expands to $value on this system.)"
2571 /*) value="$ansexp" ;;
2572 [a-zA-Z]:/*) value="$ansexp" ;;
2577 echo "I shall only accept a full path name, as in /bin/ls." >&4
2578 echo "Use a ! shell escape if you wish to check pathnames." >&4
2581 echo "Please give a full path name, starting with slash." >&4
2584 echo "Note that using ~name is ok provided it expands well." >&4
2597 for fp in $gfpth; do
2598 if test "X$fp" = X.; then
2603 if test -f "$pf"; then
2605 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
2607 echo "($value is not a plain file, but that's ok.)"
2610 if test X"$type" = X; then
2617 for fp in $gfpth; do
2618 if test "X$fp" = X.; then
2623 direxp="$fp/$ansexp"
2625 if test -d "$direxp"; then
2633 if test -d "$ansexp"; then
2634 echo "(Looking for $loc_file in directory $value.)"
2635 value="$value/$loc_file"
2636 ansexp="$ansexp/$loc_file"
2638 if test -f "$ansexp"; then
2641 case "$nopath_ok" in
2642 true) case "$value" in
2644 *) echo "Assuming $value will be in people's path."
2660 if test "$fastread" = yes; then
2665 rp="$what $value doesn't exist. Use that name anyway?"
2684 test "X$gfpthkeep" != Xy && gfpth=""
2687 : What should the include directory be ?
2689 $echo $n "Hmm... $c"
2693 if $test -f /bin/mips && /bin/mips; then
2694 echo "Looks like a MIPS system..."
2695 $cat >usr.c <<'EOCP'
2696 #ifdef SYSTYPE_BSD43
2700 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
2701 dflt='/bsd43/usr/include'
2705 mips_type='System V'
2707 $rm -f usr.c usr.out
2708 echo "and you're compiling with the $mips_type compiler and libraries."
2712 echo "Doesn't look like a MIPS system."
2722 case "$xxx_prompt" in
2725 rp='Where are the include files you want to use?'
2733 : Set private lib path
2736 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
2741 '') dlist="$loclibpth $plibpth $glibpth";;
2742 *) dlist="$libpth";;
2745 : Now check and see which directories actually exist, avoiding duplicates
2749 if $test -d $xxx; then
2752 *) libpth="$libpth $xxx";;
2758 Some systems have incompatible or broken versions of libraries. Among
2759 the directories listed in the question below, please remove any you
2760 know not to be holding relevant libraries, and add any that are needed.
2761 Say "none" for none.
2772 rp="Directories to use for library searches?"
2779 : compute shared library extension
2782 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
2792 On some systems, shared libraries may be available. Answer 'none' if
2793 you want to suppress searching of shared libraries for the remainder
2794 of this configuration.
2797 rp='What is the file extension used for shared libraries?'
2801 : Define several unixisms.
2802 : Hints files or command line option can be used to override them.
2803 : The convoluted testing is in case hints files set either the old
2806 '') case "$exe_ext" in
2808 *) _exe="$exe_ext" ;;
2813 '') case "$lib_ext" in
2820 '') case "$obj_ext" in
2827 '') case "$path_sep" in
2838 : set up the script used to warn in case of inconsistency
2845 echo "*** WHOA THERE!!! ***" >&4
2846 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2847 rp=" Keep the $hint value?"
2850 y) td=$was; tu=$was;;
2854 : function used to set $1 to $val
2855 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2857 $define$undef) . ./whoa; eval "$var=\$td";;
2858 $undef$define) . ./whoa; eval "$var=\$tu";;
2859 *) eval "$var=$val";;
2863 $define|true|[yY]*) dflt='y';;
2868 Perl can be built to use the SOCKS proxy protocol library. To do so,
2869 Configure must be run with -Dusesocks.
2871 If this doesn't make any sense to you, just accept the default '$dflt'.
2873 rp='Build Perl for SOCKS?'
2876 y|Y) val="$define" ;;
2882 : Looking for optional libraries
2884 echo "Checking for optional libraries..." >&4
2889 case "$libswanted" in
2890 '') libswanted='c_s';;
2893 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
2899 for thisdir in $libpth $xlibpth; do
2900 test -d $thisdir && libspath="$libspath $thisdir"
2902 for thislib in $libswanted; do
2903 for thisdir in $libspath; do
2905 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
2906 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
2907 $test -f "$xxx" && eval $libscheck
2908 $test -f "$xxx" && libstyle=shared
2910 if test ! -f "$xxx"; then
2911 xxx=$thisdir/lib$thislib.$so
2912 $test -f "$xxx" && eval $libscheck
2913 $test -f "$xxx" && libstyle=shared
2915 if test ! -f "$xxx"; then
2916 xxx=$thisdir/lib$thislib$_a
2917 $test -f "$xxx" && eval $libscheck
2918 $test -f "$xxx" && libstyle=static
2920 if test ! -f "$xxx"; then
2921 xxx=$thisdir/$thislib$_a
2922 $test -f "$xxx" && eval $libscheck
2923 $test -f "$xxx" && libstyle=static
2925 if test ! -f "$xxx"; then
2926 xxx=$thisdir/lib${thislib}_s$_a
2927 $test -f "$xxx" && eval $libscheck
2928 $test -f "$xxx" && libstyle=static
2929 $test -f "$xxx" && thislib=${thislib}_s
2931 if test ! -f "$xxx"; then
2932 xxx=$thisdir/Slib$thislib$_a
2933 $test -f "$xxx" && eval $libscheck
2934 $test -f "$xxx" && libstyle=static
2936 if $test -f "$xxx"; then
2938 shared) echo "Found -l$thislib (shared)." ;;
2939 static) echo "Found -l$thislib." ;;
2940 *) echo "Found -l$thislib ($libstyle)." ;;
2944 *) dflt="$dflt -l$thislib"
2945 libsfound="$libsfound $xxx"
2947 libsfiles="$libsfiles $yyy"
2948 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
2949 case " $libsdirs " in
2951 *) libsdirs="$libsdirs $yyy" ;;
2958 if $test ! -f "$xxx"; then
2959 echo "No -l$thislib."
2970 ' '|'') dflt='none';;
2975 In order to compile $package on your machine, a number of libraries
2976 are usually needed. Include any other special libraries here as well.
2977 Say "none" for none. The default list is almost always right.
2981 rp="What libraries to use?"
2988 : determine filename position in cpp output
2990 echo "Computing filename position in cpp output for #include directives..." >&4
2991 echo '#include <stdio.h>' > foo.c
2994 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
2995 $grep '^[ ]*#.*stdio\.h' | \
2996 while read cline; do
2999 while $test \$# -gt 0; do
3000 if $test -r \`echo \$1 | $tr -d '"'\`; then
3005 pos=\`expr \$pos + 1\`
3017 *) pos="${fieldn}th";;
3019 echo "Your cpp writes the filename in the $pos field of the line."
3021 : locate header file
3026 for usrincdir in $usrinc
3028 if test -f \$usrincdir/\$wanted; then
3029 echo "\$usrincdir/\$wanted"
3033 awkprg='{ print \$$fieldn }'
3034 echo "#include <\$wanted>" > foo\$\$.c
3035 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
3036 $grep "^[ ]*#.*\$wanted" | \
3037 while read cline; do
3038 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
3040 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
3041 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
3046 # status = 0: grep returned 0 lines, case statement not executed
3047 # status = 1: headerfile found
3048 # status = 2: while loop executed, no headerfile found
3052 if test \$status -eq 1; then
3059 : define an alternate in-header-list? function
3060 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
3061 cont=true; xxf="echo \"<\$1> found.\" >&4";
3062 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
3063 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
3065 case $# in 4) instead=instead;; *) instead="at last";; esac;
3066 while $test "$cont"; do
3068 var=$2; eval "was=\$$2";
3069 if $test "$xxx" && $test -r "$xxx";
3071 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
3074 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
3075 set $yyy; shift; shift; yyy=$@;
3076 case $# in 0) cont="";;
3077 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
3078 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
3079 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
3080 xxnf="echo \"there is no <\$1>, ...\" >&4";;
3084 do set $yyy; var=$2; eval "was=\$$2";
3085 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
3086 set $yyy; shift; shift; yyy=$@;
3089 : see if dld is available
3093 : determine optimization, if desired, or use for debug flag also
3095 ' '|$undef) dflt='none';;
3097 *) dflt="$optimize";;
3101 By default, $package compiles with the -O flag to use the optimizer.
3102 Alternately, you might want to use the symbolic debugger, which uses
3103 the -g flag (on traditional Unix systems). Either flag can be
3104 specified here. To use neither flag, specify the word "none".
3107 rp="What optimizer/debugger flag should be used?"
3111 'none') optimize=" ";;
3115 : We will not override a previous value, but we might want to
3116 : augment a hint file
3118 default|recommended)
3119 case "$gccversion" in
3120 1*) dflt='-fpcc-struct-return' ;;
3123 *-g*) dflt="$dflt -DDEBUGGING";;
3125 case "$gccversion" in
3126 2*) if test -d /etc/conf/kconfig.d &&
3127 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3133 case "$gccversion" in
3137 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3138 echo 'int main(void) { return 0; }' > gcctest.c
3139 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3140 echo "Yes, it does." 2>&1
3143 echo "Leaving current flags $ccflags alone." 2>&1
3145 *) dflt="$dflt -fno-strict-aliasing" ;;
3148 echo "Nope, it doesn't, but that's ok." 2>&1
3155 case "$mips_type" in
3156 *BSD*|'') inclwanted="$locincpth $usrinc";;
3157 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3159 for thisincl in $inclwanted; do
3160 if $test -d $thisincl; then
3161 if $test x$thisincl != x$usrinc; then
3163 *" -I$thisincl "*);;
3164 *) dflt="$dflt -I$thisincl ";;
3170 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3172 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3180 *) dflt="$dflt -D$2";;
3184 set signal.h LANGUAGE_C; eval $inctest
3188 ccflags="$ccflags -DSOCKS"
3193 default|recommended) dflt="$ccflags $dflt" ;;
3194 *) dflt="$ccflags";;
3203 Your C compiler may want other flags. For this question you should include
3204 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3205 but you should NOT include libraries or ld flags like -lwhatever. If you
3206 want $package to honor its debug switch, you should include -DDEBUGGING here.
3207 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3209 To use no flags, specify the word "none".
3215 rp="Any additional cc flags?"
3222 : the following weeds options from ccflags that are of no interest to cpp
3224 case "$gccversion" in
3225 1*) cppflags="$cppflags -D__GNUC__"
3227 case "$mips_type" in
3229 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3235 echo "Let me guess what the preprocessor flags are..." >&4
3249 *) ftry="$previous $flag";;
3251 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3252 >cpp1.out 2>/dev/null && \
3253 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3254 >cpp2.out 2>/dev/null && \
3255 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3256 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3258 cppflags="$cppflags $ftry"
3268 *-*) echo "They appear to be: $cppflags";;
3270 $rm -f cpp.c cpp?.out
3274 : flags used in final linking phase
3276 '') if ./venix; then
3282 *-posix*) dflt="$dflt -posix" ;;
3285 *) dflt="$ldflags";;
3288 : Try to guess additional flags to pick up local libraries.
3289 for thislibdir in $libpth; do
3290 case " $loclibpth " in
3293 *"-L$thislibdir "*) ;;
3294 *) dflt="$dflt -L$thislibdir" ;;
3306 Your C linker may need flags. For this question you should
3307 include -L/whatever and any other flags used by the C linker, but you
3308 should NOT include libraries like -lwhatever.
3310 Make sure you include the appropriate -L/path flags if your C linker
3311 does not normally search all of the directories you specified above,
3314 To use no flags, specify the word "none".
3318 rp="Any additional ld flags (NOT including libraries)?"
3324 rmlist="$rmlist pdp11"
3328 echo "Checking your choice of C compiler and flags for coherency..." >&4
3329 $cat > try.c <<'EOF'
3331 int main() { printf("Ok\n"); exit(0); }
3333 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
3335 $cat >try.msg <<'EOM'
3336 I've tried to compile and run the following simple program:
3339 $cat try.c >> try.msg
3341 $cat >> try.msg <<EOM
3348 and I got the following output:
3352 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
3353 if sh -c './try' >>try.msg 2>&1; then
3357 *) echo 'The program compiled OK, but produced no output.' >> try.msg
3360 cat >> try.msg <<'EOQS'
3361 If $libs contains -lsfio, and sfio is mis-configured, then it
3362 sometimes (apparently) runs and exits with a 0 status, but with no
3363 output! It may have to do with sfio's use of _exit vs. exit.
3366 rp="You have a big problem. Shall I abort Configure"
3373 echo "The program compiled OK, but exited with status $?." >>try.msg
3374 rp="You have a problem. Shall I abort Configure"
3378 echo "I can't compile the test program." >>try.msg
3379 rp="You have a BIG problem. Shall I abort Configure"
3385 case "$knowitall" in
3387 echo "(The supplied flags or libraries might be incorrect.)"
3395 *) echo "Ok. Stopping Configure." >&4
3400 n) echo "OK, that should do.";;
3402 $rm -f try try.* core
3404 : define a shorthand compile call
3408 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
3409 : define a shorthand compile call for compilations that should be ok.
3413 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
3416 echo "Checking for GNU C Library..." >&4
3417 cat >gnulibc.c <<EOM
3429 if eval $compile_ok && ./gnulibc; then
3431 echo "You are using the GNU C Library"
3434 echo "You are not using the GNU C Library"
3440 : see if nm is to be used to determine whether a symbol is defined or not
3444 case "$d_gnulibc" in
3447 echo "nm probably won't work on the GNU C Library." >&4
3453 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
3455 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
3456 echo "'nm' won't be sufficient on this sytem." >&4
3462 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
3463 if $test $dflt -gt 20; then
3473 true|$define) dflt=y;;
3480 I can use $nm to extract the symbols from your C libraries. This
3481 is a time consuming task which may generate huge output on the disk (up
3482 to 3 megabytes) but that should make the symbols extraction faster. The
3483 alternative is to skip the 'nm' extraction part and to compile a small
3484 test program instead to determine whether each symbol is present. If
3485 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
3486 this may be the best solution.
3488 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
3491 rp="Shall I use $nm to extract C symbols from the libraries?"
3494 [Nn]*) usenm=false;;
3503 : nm options which may be necessary
3505 '') if $test -f /mach_boot; then
3507 elif $test -d /usr/ccs/lib; then
3508 nm_opt='-p' # Solaris (and SunOS?)
3509 elif $test -f /dgux; then
3511 elif $test -f /lib64/rld; then
3512 nm_opt='-p' # 64-bit Irix
3518 : nm options which may be necessary for shared libraries but illegal
3519 : for archive libraries. Thank you, Linux.
3520 case "$nm_so_opt" in
3521 '') case "$myuname" in
3523 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
3524 nm_so_opt='--dynamic'
3533 : get list of predefined functions in a handy place
3538 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
3545 *) for thislib in $libs; do
3548 : Handle C library specially below.
3551 thislib=`echo $thislib | $sed -e 's/^-l//'`
3552 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
3554 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
3556 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
3558 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
3560 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
3562 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
3564 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
3569 libnames="$libnames $try"
3571 *) libnames="$libnames $thislib" ;;
3580 for xxx in $libpth; do
3581 $test -r $1 || set $xxx/libc.$so
3582 : The messy sed command sorts on library version numbers.
3584 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
3585 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
3587 s/[0-9][0-9]*/0000&/g
3588 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
3591 sort | $sed -e 's/^.* //'`
3594 $test -r $1 || set /usr/ccs/lib/libc.$so
3595 $test -r $1 || set /lib/libsys_s$_a
3601 if $test -r "$1"; then
3602 echo "Your (shared) C library seems to be in $1."
3604 elif $test -r /lib/libc && $test -r /lib/clib; then
3605 echo "Your C library seems to be in both /lib/clib and /lib/libc."
3607 libc='/lib/clib /lib/libc'
3608 if $test -r /lib/syslib; then
3609 echo "(Your math library is in /lib/syslib.)"
3610 libc="$libc /lib/syslib"
3612 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3613 echo "Your C library seems to be in $libc, as you said before."
3614 elif $test -r $incpath/usr/lib/libc$_a; then
3615 libc=$incpath/usr/lib/libc$_a;
3616 echo "Your C library seems to be in $libc. That's fine."
3617 elif $test -r /lib/libc$_a; then
3619 echo "Your C library seems to be in $libc. You're normal."
3621 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
3623 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
3624 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
3625 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
3627 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3629 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3632 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
3634 if $test -r "$tans"; then
3635 echo "Your C library seems to be in $tans, of all places."
3641 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3645 If the guess above is wrong (which it might be if you're using a strange
3646 compiler, or your machine supports multiple models), you can override it here.
3651 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
3653 I can't seem to find your C library. I've looked in the following places:
3656 $sed 's/^/ /' libpath
3659 None of these seems to contain your C library. I need to get its name...
3664 rp='Where is your C library?'
3669 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
3670 set X `cat libnames`
3673 case $# in 1) xxx=file; esac
3674 echo "Extracting names from the following $xxx for later perusal:" >&4
3676 $sed 's/^/ /' libnames >&4
3678 $echo $n "This may take a while...$c" >&4
3682 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
3683 *) $nm $nm_opt $file 2>/dev/null;;
3688 $grep fprintf libc.tmp > libc.ptf
3689 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
3690 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
3692 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
3694 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3696 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
3698 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3700 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
3702 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3704 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
3706 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3708 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
3710 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3712 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
3714 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3716 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
3717 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
3719 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3721 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
3723 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3725 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
3727 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3729 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
3731 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3733 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
3735 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3737 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
3739 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3741 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
3743 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3745 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
3747 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3750 $nm -p $* 2>/dev/null >libc.tmp
3751 $grep fprintf libc.tmp > libc.ptf
3752 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
3753 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
3759 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
3761 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
3762 for thisname in $libnames $libc; do
3763 $ar t $thisname >>libc.tmp
3765 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
3767 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
3768 # Repeat libc to extract forwarders to DLL entries too
3769 for thisname in $libnames $libc; do
3770 $ar tv $thisname >>libc.tmp
3771 # Revision 50 of EMX has bug in $ar.
3772 # it will not extract forwarders to DLL entries
3773 # Use emximp which will extract exactly them.
3774 emximp -o tmp.imp $thisname \
3776 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
3777 < tmp.imp >>libc.tmp
3780 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
3783 echo "$ar didn't seem to work right." >&4
3784 echo "Maybe this is a Cray...trying bld instead..." >&4
3785 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
3787 for thisname in $libnames; do
3789 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
3790 $ar t $thisname >>libc.tmp
3794 echo "That didn't work either. Giving up." >&4
3801 if $test -f /lib/syscalls.exp; then
3803 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
3804 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
3808 $rm -f libnames libpath
3810 : is a C symbol defined?
3813 -v) tf=libc.tmp; tc=""; tdc="";;
3814 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
3815 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
3818 case "$reuseval-$4" in
3820 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
3826 if $contains $tlook $tf >/dev/null 2>&1;
3831 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
3832 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
3840 $define) tval=true;;
3846 : define an is-in-libc? function
3847 inlibc='echo " "; td=$define; tu=$undef;
3848 sym=$1; var=$2; eval "was=\$$2";
3850 case "$reuseval$was" in
3860 echo "$sym() found." >&4;
3861 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
3863 echo "$sym() NOT found." >&4;
3864 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
3868 $define) echo "$sym() found." >&4;;
3869 *) echo "$sym() NOT found." >&4;;
3873 : see if dlopen exists
3880 : determine which dynamic loading, if any, to compile in
3882 dldir="ext/DynaLoader"
3895 $define) dflt='y' ;;
3898 $define) dflt='y' ;;
3900 : Does a dl_xxx.xs file exist for this operating system
3901 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
3904 rp="Do you wish to use dynamic loading?"
3911 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
3912 dflt="$dldir/dl_${osname}.xs"
3913 elif $test "$d_dlopen" = "$define" ; then
3914 dflt="$dldir/dl_dlopen.xs"
3915 elif $test "$i_dld" = "$define" ; then
3916 dflt="$dldir/dl_dld.xs"
3921 *) dflt="$dldir/$dlsrc"
3924 echo "The following dynamic loading files are available:"
3925 : Can not go over to $dldir because getfile has path hard-coded in.
3926 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
3927 rp="Source file to use for dynamic loading"
3933 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
3937 Some systems may require passing special flags to $cc -c to
3938 compile modules that will be used to create a shared library.
3939 To use no flags, say "none".
3942 case "$cccdlflags" in
3943 '') case "$gccversion" in
3944 '') case "$osname" in
3946 next) dflt='none' ;;
3947 irix*) dflt='-KPIC' ;;
3948 svr4*|esix*|solaris) dflt='-KPIC' ;;
3949 sunos) dflt='-pic' ;;
3953 *) case "$osname" in
3954 svr4*|esix*|solaris) dflt='-fPIC' ;;
3959 *) dflt="$cccdlflags" ;;
3961 rp="Any special flags to pass to $cc -c to compile shared library modules?"
3964 none) cccdlflags=' ' ;;
3965 *) cccdlflags="$ans" ;;
3970 Some systems use ld to create libraries that can be dynamically loaded,
3971 while other systems (such as those using ELF) use $cc.
3975 '') $cat >try.c <<'EOM'
3976 /* Test for whether ELF binaries are produced */
3981 int i = open("a.out",O_RDONLY);
3984 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
3985 exit(0); /* succeed (yes, it's ELF) */
3990 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
3992 You appear to have ELF support. I'll use $cc to build dynamic libraries.
3996 echo "I'll use ld to build dynamic libraries."
4005 rp="What command should be used to create dynamic libraries?"
4011 Some systems may require passing special flags to $ld to create a
4012 library that can be dynamically loaded. If your ld flags include
4013 -L/other/path options to locate libraries outside your loader's normal
4014 search path, you may need to specify those -L options here as well. To
4015 use no flags, say "none".
4018 case "$lddlflags" in
4019 '') case "$osname" in
4020 beos) dflt='-nostart' ;;
4022 case "$gccversion" in
4023 '') dflt="$dflt +vnocompatwarnings" ;;
4026 linux|irix*) dflt='-shared' ;;
4027 next) dflt='none' ;;
4028 solaris) dflt='-G' ;;
4029 sunos) dflt='-assert nodefinitions' ;;
4030 svr4*|esix*) dflt="-G $ldflags" ;;
4034 *) dflt="$lddlflags" ;;
4037 : Try to guess additional flags to pick up local libraries.
4038 : Be careful not to append to a plain 'none'
4042 for thisflag in $ldflags; do
4047 *) dflt="$dflt $thisflag" ;;
4054 ''|' ') dflt='none' ;;
4057 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
4060 none) lddlflags=' ' ;;
4061 *) lddlflags="$ans" ;;
4066 Some systems may require passing special flags to $cc to indicate that
4067 the resulting executable will use dynamic linking. To use no flags,
4071 case "$ccdlflags" in
4072 '') case "$osname" in
4073 hpux) dflt='-Wl,-E' ;;
4074 linux) dflt='-rdynamic' ;;
4075 next) dflt='none' ;;
4076 sunos) dflt='none' ;;
4080 *) dflt="$ccdlflags" ;;
4082 rp="Any special flags to pass to $cc to use dynamic linking?"
4085 none) ccdlflags=' ' ;;
4086 *) ccdlflags="$ans" ;;
4097 : Remove libraries needed only for extensions
4098 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
4101 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
4109 : Remove build directory name from cppstdin so it can be used from
4110 : either the present location or the final installed location.
4112 : Get out of the UU directory to get correct path name.
4116 echo "Stripping down cppstdin path name"
4122 : end of configuration questions
4124 echo "End of configuration questions."
4127 : back to where it started
4128 if test -d ../UU; then
4132 : configuration may be patched via a 'config.over' file
4133 if $test -f config.over; then
4136 rp='I see a config.over file. Do you wish to load it?'
4139 n*) echo "OK, I'll ignore it.";;
4141 echo "Configuration override changes have been loaded."
4146 : in case they want portability, strip down executable paths
4147 case "$d_portable" in
4150 echo "Stripping down executable paths..." >&4
4151 for file in $loclist $trylist; do
4153 eval $file=`basename $temp`
4158 : create config.sh file
4160 echo "Creating config.sh..." >&4
4161 $spitshell <<EOT >config.sh
4164 # This file was produced by running the Configure script. It holds all the
4165 # definitions figured out by Configure. Should you modify one of these values,
4166 # do not forget to propagate your changes by running "Configure -der". You may
4167 # instead choose to run each of the .SH files by yourself, or "Configure -S".
4170 # Package name : $package
4171 # Source directory : $src
4172 # Configuration time: $cf_time
4173 # Configured by : $cf_by
4174 # Target system : $myuname
4184 Revision='$Revision'
4191 archobjs='$archobjs'
4199 cccdlflags='$cccdlflags'
4200 ccdlflags='$ccdlflags'
4203 ccversion='$ccversion'
4210 compress='$compress'
4211 contains='$contains'
4215 cppflags='$cppflags'
4217 cppminus='$cppminus'
4219 cppstdin='$cppstdin'
4222 d_dlopen='$d_dlopen'
4223 d_eunice='$d_eunice'
4224 d_gnulibc='$d_gnulibc'
4225 d_portable='$d_portable'
4232 eunicefix='$eunicefix'
4236 firstmakefile='$firstmakefile'
4238 gccosandvers='$gccosandvers'
4239 gccversion='$gccversion'
4245 ignore_versioned_solibs='$ignore_versioned_solibs'
4250 lddlflags='$lddlflags'
4257 libsdirs='$libsdirs'
4258 libsfiles='$libsfiles'
4259 libsfound='$libsfound'
4260 libspath='$libspath'
4261 libswanted='$libswanted'
4267 locincpth='$locincpth'
4268 loclibpth='$loclibpth'
4275 make_set_make='$make_set_make'
4276 mips_type='$mips_type'
4284 nm_so_opt='$nm_so_opt'
4287 optimize='$optimize'
4291 path_sep='$path_sep'
4293 perllibs='$perllibs'
4302 sendmail='$sendmail'
4305 sharpbang='$sharpbang'
4311 spackage='$spackage'
4312 spitshell='$spitshell'
4329 usesocks='$usesocks'
4338 : Add in command line options if available
4339 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
4341 : add special variables
4342 $test -f $src/patchlevel.h && \
4343 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
4344 echo "CONFIGDOTSH=true" >>config.sh
4346 : propagate old symbols
4347 if $test -f UU/config.sh; then
4348 <UU/config.sh sort | uniq >UU/oldconfig.sh
4349 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
4350 sort | uniq -u >UU/oldsyms
4351 set X `cat UU/oldsyms`
4357 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
4359 echo "# Variables propagated from previous config.sh file." >>config.sh
4360 for sym in `cat UU/oldsyms`; do
4361 echo " Propagating $hint variable "'$'"$sym..."
4362 eval 'tmp="$'"${sym}"'"'
4364 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
4370 : preserve RCS keywords in files with variable substitution, grrr
4373 : Finish up by extracting the .SH files
4387 If you'd like to make any changes to the config.sh file before I begin
4388 to configure things, do it as a shell escape now (e.g. !vi config.sh).
4391 rp="Press return or use a shell escape to edit config.sh:"
4396 *) : in case they cannot read
4402 : if this fails, just run all the .SH files by hand
4409 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
4416 Now you need to generate make dependencies by running "$make depend".
4417 You might prefer to run it in background: "$make depend > makedepend.out &"
4418 It can take a while, so you might not want to run it right now.
4423 rp="Run $make depend now?"
4427 $make depend && echo "Now you must run '$make'."
4430 echo "You must run '$make depend' then '$make'."
4433 elif test -f [Mm]akefile; then
4435 echo "Now you must run a $make."
4440 if $test -f Policy.sh; then
4443 If you compile $package on a different machine or from a different object
4444 directory, copy the Policy.sh file from this object directory to the
4445 new one before you run Configure -- this will help you with most of
4446 the policy defaults.
4450 if $test -f config.msg; then
4451 echo "Hmm. I also noted the following information while running:"
4456 $rm -f kit*isdone ark*isdone