2 # This is a shell archive. Remove anything before this line, then unpack
3 # it by saving it into a file and typing "sh file". To overwrite existing
4 # files, type "sh file -c". You can also feed this as standard input via
5 # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
6 # will see the following message at the end:
7 # "End of archive 3 (of 3)."
9 # Wrapped by root@seer on Thu Feb 24 10:15:51 2000
10 PATH=/bin:/usr/bin:/usr/ucb ; export PATH
11 if test -f 'Configure' -a "${1}" != "-c" ; then
12 echo shar: Will not clobber existing file \"'Configure'\"
14 echo shar: Extracting \"'Configure'\" \(106597 characters\)
15 sed "s/^X//" >'Configure' <<'END_OF_FILE'
18 X# If these # comments don't work, trim them. Don't worry about any other
19 X# shell scripts, Configure will trim # comments from them for you.
21 X# (If you are trying to port this package to a machine without sh,
22 X# I would suggest you have a look at the prototypical config_h.SH file
23 X# and edit it to reflect your system. Some packages may include samples
24 X# of config.h for certain machines, so you might look for one of those.)
26 X# Yes, you may rip this off to use in other distribution packages. This
27 X# script belongs to the public domain and cannot be copyrighted.
29 X# (Note: this Configure script was generated automatically. Rather than
30 X# working with this copy of Configure, you may wish to get metaconfig.
31 X# The dist-3.0 package (which contains metaconfig) was posted in
32 X# comp.sources.misc and is available on CPAN under authors/id/RAM so
33 X# you may fetch it yourself from your nearest archive site.)
38 X# Generated on Sat Feb 12 13:14:26 PST 2000 [metaconfig 3.0 PL70b-1]
39 X# (with additional metaconfig patches by bll@gentoo.com)
44 XSCO csh still thinks true is false. Write to SCO today and tell them that next
45 Xyear Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
47 X(Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
48 Xwe'd have to do is go in and swap the && and || tokens, wherever they are.)
50 X[End of diatribe. We now return you to your regularly scheduled programming...]
54 XOOPS! You naughty creature! You didn't run Configure with sh!
55 XI will attempt to remedy the situation by running sh for you...
58 Xtrue || cat /tmp/c1$$ /tmp/c2$$
59 Xtrue || exec sh $0 $argv:q
61 X(exit $?0) || cat /tmp/c2$$
62 X(exit $?0) || exec sh $0 $argv:q
63 Xrm -f /tmp/c1$$ /tmp/c2$$
65 X: compute my invocation name
69 X me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
74 X: Proper separator for the PATH environment variable
76 X: On OS/2 this directory should exist if this is not floppy only system :-]
77 Xif test -d c:/. ; then
78 X if test -n "$OS2_SHELL"; then
80 X PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
81 X OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
82 X elif test -n "$DJGPP"; then
87 X: Proper PATH setting
88 Xpaths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
89 Xpaths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
90 Xpaths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
91 Xpaths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
92 Xpaths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
93 Xpaths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
94 Xpaths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
95 Xpaths="$paths /sbin /usr/sbin /usr/libexec"
99 X case "$p_$PATH$p_" in
101 X *) test -d $p && PATH=$PATH$p_$p ;;
108 X: shall we be using ksh?
114 Xif (PATH=.; alias -x) >/dev/null 2>&1; then
117 Xif test -f /hp-ux -a -f /bin/ksh; then
118 X needksh='to avoid sh bug in "here document" expansion'
120 Xif test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
121 X if test X`/usr/bin/uname -v` = X4; then
122 X avoidksh="to avoid AIX 4's /bin/sh"
126 Xcase "$inksh/$needksh" in
133 Xcase "$inksh/$avoidksh" in
139 Xcase "$inksh/$needksh-$avoidksh-" in
142 X(I see you are using the Korn shell. Some ksh's blow up on $me,
143 Xmainly on older exotic systems. If yours does, try the Bourne shell instead.)
149 X echo "(Feeding myself to $newsh $reason.)"
151 X Configure|*/Configure) exec $newsh $0 "$@";;
152 X *) exec $newsh Configure "$@";;
157 X: if needed set CDPATH to a harmless value that is not chatty
158 X: avoid bash 2.02 problems with empty CDPATH.
162 X *bash*) CDPATH='.' ;;
167 X: Configure runs within the UU subdirectory
168 Xtest -d UU || mkdir UU
286 Xd_64bit_statfs_flds=''
303 Xd_setmntent_one_arg=''
331 Xd_getmntinfobsize=''
332 Xd_getmntinfofsize=''
333 Xd_getmntinfofstype=''
339 Xd_statvfsbasetype=''
392 Xsmallmach='pdp11 i8086 z8000 i80286 iAPX286'
395 X: We must find out about Eunice early
397 Xif test -f /etc/unixtovms; then
398 X eunicefix=/etc/unixtovms
400 Xif test -f /etc/unixtovms.exe; then
401 X eunicefix=/etc/unixtovms.exe
404 X: Trailing extension. Override this in a hint file, if needed.
406 X: Extra object files, if any, needed on this platform.
409 X: Possible local include directories to search.
410 X: Set locincpth to "" in a hint file to defeat local include searches.
411 Xlocincpth="/usr/local/include /opt/local/include /usr/gnu/include"
412 Xlocincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
414 X: no include file wanted by default
418 X: change the next line if compiling for Xenix/286 on Xenix/386
419 Xxlibpth='/usr/lib/386 /lib/386'
421 X: Possible local library directories to search.
422 Xloclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
423 Xloclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
425 X: general looking path for locating libraries
426 Xglibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
427 Xglibpth="$glibpth /lib /usr/lib $xlibpth"
428 Xglibpth="$glibpth /lib/large /usr/lib/small /lib/small"
429 Xglibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
431 X: Private path used by Configure to find libraries. Its value
432 X: is prepended to libpth. This variable takes care of special
433 X: machines, like the mips. Usually, it should be empty.
436 X: default library list
439 X: full support for void wanted by default
442 X: List of libraries we want.
443 X: If anyone needs -lnet, put it in a hint file.
444 Xlibswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
445 Xlibswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
446 Xlibswanted="$libswanted ucb bsd BSD PW x"
447 X: We probably want to search /usr/shlib before most other libraries.
448 X: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
449 Xglibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
450 Xglibpth="/usr/shlib $glibpth"
451 X: Do not use vfork unless overridden by a hint file.
454 X: Find the basic shell for Bourne shell scripts
458 X *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
461 X if test -f "$xxx"; then
464 X : Build up a list and do a single loop so we can 'break' out.
465 X pth=`echo $PATH | sed -e "s/$p_/ /g"`
466 X for xxx in sh bash ksh pdksh ash; do
468 X try="$try ${p}/${xxx}"
471 X for xxx in $try; do
472 X if test -f "$xxx"; then
475 X elif test -f "$xxx.exe"; then
486 X$me: Fatal Error: I can't find a Bourne Shell anywhere.
488 XUsually it's in /bin/sh. How did you even get this far?
489 XPlease contact me (Brad Lanam) at bll@gentoo.com and
490 Xwe'll try to straighten this all out.
496 X: see if sh knows # comments
497 Xif `$sh -c '#' >/dev/null 2>&1`; then
501 X test -f $xcat || xcat=/usr/bin/cat
502 X echo "#!$xcat" >try
506 X if test -s today; then
509 X echo "#! $xcat" > try
513 X if test -s today; then
521 X echo "Your $sh doesn't grok # comments--I will strip them later on."
524 X echo "exec grep -v '^[ ]*#'" >spitshell
526 X $eunicefix spitshell
527 X spitshell=`pwd`/spitshell
529 X echo "I presume that if # doesn't work, #! won't work either!"
534 X: figure out how to guarantee sh startup
536 X'') startsh=${sharpbang}${sh} ;;
548 X : echo "Yup, it does."
550 X echo "Hmm... '$startsh' does not guarantee sh startup..."
551 X echo "You may have to fix up the shell scripts to make sure $sh runs them."
556 X: Save command line options in file UU/cmdline.opt for later use in
557 X: generating config.sh.
558 Xcat > cmdline.opt <<EOSH
559 X# Configure command line arguments.
566 X cat >>cmdline.opt <<EOSH
567 Xconfig_arg$argn='$arg'
569 X argn=`expr $argn + 1`
572 X: produce awk script to parse command line options
573 Xcat >options.awk <<'EOF'
575 X optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
577 X len = length(optstr);
578 X for (i = 1; i <= len; i++) {
579 X c = substr(optstr, i, 1);
580 X if (i < len) a = substr(optstr, i + 1, 1); else a = "";
591 X if (substr(str, 1, 1) != "-") {
592 X printf("'%s'\n", str);
596 X for (i = 2; i <= len; i++) {
597 X c = substr(str, i, 1);
599 X printf("-%s\n", substr(str, i));
602 X printf("-%s\n", c);
605 X printf("'%s'\n", substr(str, i + 1));
618 X: process the command line options
619 Xset X `for arg in "$@"; do echo "X$arg"; done |
620 X sed -e s/X// | awk -f options.awk`
625 X: set up default values
636 Xcat >optdef.sh <<EOS
642 Xwhile test $# -gt 0; do
644 X -d) shift; fastread=yes;;
645 X -e) shift; alldone=cont;;
649 X if test -r "$1"; then
652 X echo "$me: cannot read config file $1." >&2
657 X -h) shift; error=true;;
658 X -r) shift; reuseval=true;;
659 X -s) shift; silent=true; realsilent=true;;
660 X -E) shift; alldone=exit;;
661 X -K) shift; knowitall=true;;
662 X -O) shift; override=true;;
663 X -S) shift; silent=true; extractsh=true;;
668 X echo "$me: use '-U symbol=', not '-D symbol='." >&2
669 X echo "$me: ignoring -D $1" >&2
672 X sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
673 X *) echo "$1='define'" >> optdef.sh;;
680 X *=) echo "$1" >> optdef.sh;;
682 X echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
683 X echo "$me: ignoring -U $1" >&2
685 X *) echo "$1='undef'" >> optdef.sh;;
689 X -V) echo "$me generated by metaconfig 3.0 PL70b-1." >&2
692 X -*) echo "$me: unknown option $1" >&2; shift; error=true;;
700 XUsage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
701 X [-U symbol] [-U symbol=]
702 X -d : use defaults for all answers.
703 X -e : go on without questioning past the production of config.sh.
704 X -f : specify an alternate default configuration file.
705 X -h : print this help message and exit (with an error status).
706 X -r : reuse C symbols value if possible (skips costly nm extraction).
707 X -s : silent mode, only echoes questions and essential information.
708 X -D : define symbol to have some value:
709 X -D symbol symbol gets the value 'define'
710 X -D symbol=value symbol gets the value 'value'
711 X -E : stop at the end of questions, after having produced config.sh.
712 X -K : do not use unless you know what you are doing.
713 X -O : let -D and -U override definitions from loaded configuration file.
714 X -S : perform variable substitutions on all .SH files (can mix with -f)
715 X -U : undefine symbol:
716 X -U symbol symbol gets the value 'undef'
717 X -U symbol= symbol gets completely empty
718 X -V : print version number and exit (with a zero status).
725 Xcase "$fastread$alldone" in
728 X if test ! -t 0; then
729 X echo "Say 'sh Configure', not 'sh <Configure'"
737 Xtrue) exec 1>/dev/null;;
740 X: run the defines and the undefines, if any, but leave the file out there...
746 Xfirst=`echo $package | sed -e 's/^\(.\).*/\1/'`
747 Xlast=`echo $package | sed -e 's/^.\(.*\)/\1/'`
748 Xcase "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
749 XABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
750 X*) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
753 X: Some greps do not return status, grrr.
754 Xecho "grimblepritz" >grimble
755 Xif grep blurfldyick grimble >/dev/null 2>&1 ; then
757 Xelif grep grimblepritz grimble >/dev/null 2>&1 ; then
763 X: the following should work in any shell
767 X echo "AGH! Grep doesn't return a status. Attempting remedial action."
768 X cat >contains <<'EOSS'
769 Xgrep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
774 X: Find the path to the source tree
777 X */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
788 Xif test -f $rsrc/Configure && \
789 X $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
791 X : found it, so we are ok.
794 X for src in . .. ../.. ../../.. ../../../..; do
795 X if test -f ../$src/Configure && \
796 X $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
807 XSorry, I can't seem to locate the source dir for $package. Please start
808 XConfigure with an explicit path -- i.e. /some/path/Configure.
816 X echo "Sources for $package found in \"$src\"." >&4
820 X: script used to extract .SH files with variable substitutions
821 Xcat >extract <<'EOS'
823 Xecho "Doing variable substitutions on .SH files..."
824 Xif test -f $src/MANIFEST; then
825 X set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'`
827 X echo "(Looking for .SH files under the source directory.)"
828 X set x `(cd $src; find . -name "*.SH" -print)`
832 X0) set x `(cd $src; echo *.SH)`; shift;;
834 Xif test ! -f $src/$1; then
840 Xwhile test $name; do
841 X if test ! -d "$name"; then
842 X create="$name $create";
843 X name=`echo $name | sed -e "s|^[^/]*$||"`;
844 X name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
849 Xfor file in $create; do
858 X dir=`expr X$file : 'X\(.*\)/'`
859 X file=`expr X$file : 'X.*/\(.*\)'`
860 X (cd $dir && . ./$file)
870 X dir=`expr X$file : 'X\(.*\)/'`
871 X file=`expr X$file : 'X.*/\(.*\)'`
872 X (set x $dir; shift; eval $mkdir_p)
873 X sh <$src/$dir/$file
882 Xif test -f $src/config_h.SH; then
883 X if test ! -f config.h; then
884 X : oops, they left it out of MANIFEST, probably, so do it anyway.
890 X: extract files and exit if asked to do so
891 Xcase "$extractsh" in
893 X case "$realsilent" in
897 X case "$config_sh" in
898 X '') config_sh='config.sh';;
901 X echo "Fetching answers from $config_sh..."
904 X test "$override" && . ./optdef.sh
913 X: Eunice requires " " instead of "", can you believe it
916 Xecho "Beginning of configuration questions for $package."
918 Xtrap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
920 X: first determine how to suppress newline on echo command
922 Xecho "Checking echo to see how to suppress newlines..."
923 X(echo "hi there\c" ; echo " ") >.echotmp
924 Xif $contains c .echotmp >/dev/null 2>&1 ; then
925 X echo "...using -n."
935 Xecho $n "The star should be here-->$c"
939 X: Now test for existence of everything in MANIFEST
941 Xif test -f $rsrc/MANIFEST; then
942 X echo "First let's make sure your kit is complete. Checking..." >&4
943 X awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
946 X for filelist in x??; do
947 X (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
949 X if test -s missing; then
953 XTHIS PACKAGE SEEMS TO BE INCOMPLETE.
955 XYou have the option of continuing the configuration process, despite the
956 Xdistinct possibility that your kit is damaged, by typing 'y'es. If you
957 Xdo, don't blame me if something goes wrong. I advise you to type 'n'o
958 Xand contact the author (bll@gentoo.com).
961 X echo $n "Continue? [n] $c" >&4
965 X echo "Continuing..." >&4
969 X echo "ABORTING..." >&4
974 X echo "Looks good..."
977 X echo "There is no MANIFEST file. I hope your kit is complete !"
981 X: compute the number of columns on the terminal for proper question formatting
986 X: set up the echo used in my read
987 Xmyecho="case \"\$xxxm\" in
988 X'') echo $n \"\$rp $c\" >&4;;
990 X '') echo $n \"[\$xxxm] $c\";;
992 X if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
994 X echo $n \"[\$xxxm] $c\" >&4
996 X echo $n \"\$rp [\$xxxm] $c\" >&4
1002 X: now set up to do reads with possible shell escape and default assignment
1008 Xcase "\$fastread" in
1009 Xyes) case "\$dflt" in
1012 X case "\$silent-\$rp" in
1017 X*) case "\$silent" in
1018 X true) case "\$rp" in
1023 Xwhile expr "X\$ans" : "X!" >/dev/null; do
1027 X aok=''; eval "ans=\\"\$answ\\"" && aok=y
1035 X set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1044 X set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1049 X echo "(OK, I'll run with -d after this question.)" >&4
1052 X echo "*** Sorry, \$1 not supported yet." >&4
1062 X echo "*** Substitution done -- please confirm."
1064 X ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1069 X echo "*** Error -- try again."
1076 X case "\$ans\$xxxm\$nostick" in
1088 X: create .config dir to save info across Configure sessions
1089 Xtest -d ../.config || mkdir ../.config
1090 Xcat >../.config/README <<EOF
1091 XThis directory created by Configure to save information that should
1092 Xpersist across sessions for $package.
1094 XYou may safely delete it if you wish.
1097 X: general instructions
1100 Xuser=`(logname) 2>/dev/null`
1102 X'') user=`whoami 2>&1`;;
1104 Xif $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1107 X rp='Would you like to see the instructions?'
1112 X *) needman=false;;
1118 XThis installation shell script will examine your system and ask you questions
1119 Xto determine how the di package should be installed. If you get
1120 Xstuck on a question, you may use a ! shell escape to start a subshell or
1121 Xexecute a command. Many of the questions will have default answers in square
1122 Xbrackets; typing carriage return will give you the default.
1124 XOn some of the questions which ask for file or directory names you are allowed
1125 Xto use the ~name construct to specify the login directory belonging to "name",
1126 Xeven if you don't have a shell which knows about that. Questions where this is
1127 Xallowed will be marked "(~name ok)".
1131 X dflt='Type carriage return to continue'
1135 XThe prompter used in this script allows you to use shell variables and
1136 Xbackticks in your answers. You may use $1, $2, etc... to refer to the words
1137 Xin the default answer, as if the default line was a set of arguments given to a
1138 Xscript shell. This means you may also use $* to repeat the whole default line,
1139 Xso you do not have to re-type everything to add something to the default.
1141 XEverytime there is a substitution, you will have to confirm. If there is an
1142 Xerror (e.g. an unmatched backtick), the default answer will remain unchanged
1143 Xand you will be prompted again.
1145 XIf you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1146 Xthe questions and use the computed defaults (or the previous answers if there
1147 Xwas already a config.sh file). Type 'Configure -h' for a list of options.
1148 XYou may also start interactively and then answer '& -d' at any prompt to turn
1149 Xon the non-interactive behaviour for the remainder of the execution.
1155 XMuch effort has been expended to ensure that this shell script will run on any
1156 XUnix system. If despite that it blows up on yours, your best bet is to edit
1157 XConfigure and run it again. If you can't run Configure for some reason,
1158 Xyou'll have to generate a config.sh file by hand. Whatever problems you
1159 Xhave, let me (bll@gentoo.com) know how I blew it.
1161 XThis installation script affects things in two ways:
1163 X1) it may do direct variable substitutions on some of the files included
1165 X2) it builds a config.h file for inclusion in C programs. You may edit
1166 X any of these files as the need arises after running this script.
1168 XIf you make a mistake on a question, there is no easy way to back up to it
1169 Xcurrently. The easiest thing to do is to edit config.sh and rerun all the SH
1170 Xfiles. Configure will offer to let you do this before it runs the SH files.
1173 X dflt='Type carriage return to continue'
1175 X case "$firsttime" in
1176 X true) echo $user >>../.config/instruct;;
1180 X: find out where common programs are
1182 Xecho "Locating common programs..." >&4
1195 X if test -d \$dir/\$thing; then
1201 X for thisthing in \$dir/\$thing; do
1202 X : just loop through to pick last item
1204 X if test -f \$thisthing; then
1207 X elif test -f \$dir/\$thing.exe; then
1208 X if test -n "$DJGPP"; then
1209 X echo \$dir/\$thing.exe
1211 X : on Eunice apparently
1212 X echo \$dir/\$thing
1253 Xpth=`echo $PATH | sed -e "s/$p_/ /g"`
1254 Xpth="$pth /lib /usr/lib"
1255 Xfor file in $loclist; do
1259 X if test -f "$xxx"; then
1262 X echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1263 X xxx=`./loc $file $file $pth`
1266 X '') xxx=`./loc $file $file $pth`;;
1267 X *) xxx=`./loc $xxx $xxx $pth`;;
1273 X echo $file is in $xxx.
1276 X echo $file is in $xxx.
1279 X echo "I don't know where '$file' is, and my life depends on it." >&4
1280 X echo "Go find a public domain implementation or fix your PATH setting!" >&4
1286 Xecho "Don't worry if any of the following aren't found..."
1288 Xfor file in $trylist; do
1292 X if test -f "$xxx"; then
1295 X echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1296 X xxx=`./loc $file $file $pth`
1299 X '') xxx=`./loc $file $file $pth`;;
1300 X *) xxx=`./loc $xxx $xxx $pth`;;
1306 X echo $file is in $xxx.
1309 X echo $file is in $xxx.
1312 X echo "I don't see $file out there, $say."
1319 X echo "Substituting grep for egrep."
1325 X echo "Substituting cp for ln."
1331 X echo "Hopefully test is built into your sh."
1334 X if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1335 X echo "Using the test built into your sh."
1343 X echo "Hopefully echo is built into your sh."
1348 Xecho "Checking compatibility between $echo and builtin echo (if any)..." >&4
1349 X $echo $n "hi there$c" >foo1
1350 X echo $n "hi there$c" >foo2
1351 X if cmp foo1 foo2 >/dev/null 2>&1; then
1352 X echo "They are compatible. In fact, they may be identical."
1355 X '-n') n='' c='\c';;
1359 XThey are not compatible! You are probably running ksh on a non-USG system.
1360 XI'll have to use $echo instead of the builtin, since Bourne shell doesn't
1361 Xhave echo built in and we may have to run some Bourne shell scripts. That
1362 Xmeans I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1365 X $echo $n "The star should be here-->$c"
1372 X: determine whether symbolic links are supported
1375 Xif $ln -s blurfl sym > /dev/null 2>&1 ; then
1376 X echo "Symbolic links are supported." >&4
1379 X echo "Symbolic links are NOT supported." >&4
1384 X: see whether [:lower:] and [:upper:] are supported character classes
1388 Xcase "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1390 X echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1395 X echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1398 X: set up the translation script tr, must be called with ./tr of course
1402 X'[A-Z][a-z]') exec $tr '$up' '$low';;
1403 X'[a-z][A-Z]') exec $tr '$low' '$up';;
1410 X: Try to determine whether config.sh was made on this system
1411 Xcase "$config_sh" in
1413 Xmyuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1414 Xmyuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1415 X ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1416 Xnewmyuname="$myuname"
1418 Xcase "$knowitall" in
1420 X if test -f ../config.sh; then
1421 X if $contains myuname= ../config.sh >/dev/null 2>&1; then
1422 X eval "`grep myuname= ../config.sh`"
1424 X if test "X$myuname" = "X$newmyuname"; then
1432 X: Get old answers from old config file if Configure was run on the
1433 X: same system, otherwise use the hints.
1436 Xif test -f config.sh; then
1438 X rp="I see a config.sh file. Shall I use it to set the defaults?"
1441 X n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1442 X *) echo "Fetching default answers from your old config.sh file..." >&4
1450 X : Older versions did not always set $sh. Catch re-use of such
1451 X : an old config.sh.
1453 X '') sh="$tmp_sh" ;;
1459 Xif test ! -f config.sh; then
1462 XFirst time through, eh? I have some defaults handy for some systems
1463 Xthat need some extra help getting the Configure answers right:
1466 X (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
1468 X : Half the following guesses are probably wrong... If you have better
1469 X : tests or hints, please send them to bll@gentoo.com
1470 X : The metaconfig authors would also appreciate a copy...
1471 X $test -f /irix && osname=irix
1472 X $test -f /xenix && osname=sco_xenix
1473 X $test -f /dynix && osname=dynix
1474 X $test -f /dnix && osname=dnix
1475 X $test -f /lynx.os && osname=lynxos
1476 X $test -f /unicos && osname=unicos && osvers=`$uname -r`
1477 X $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
1478 X $test -f /bin/mips && /bin/mips && osname=mips
1479 X $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1480 X $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1481 X $test -d /usr/apollo/bin && osname=apollo
1482 X $test -f /etc/saf/_sactab && osname=svr4
1483 X $test -d /usr/include/minix && osname=minix
1484 X if $test -d /MachTen; then
1486 X if $test -x /sbin/version; then
1487 X osvers=`/sbin/version | $awk '{print $2}' |
1488 X $sed -e 's/[A-Za-z]$//'`
1489 X elif $test -x /usr/etc/version; then
1490 X osvers=`/usr/etc/version | $awk '{print $2}' |
1491 X $sed -e 's/[A-Za-z]$//'`
1496 X if $test -f $uname; then
1501 X fps*) osname=fps ;;
1504 X umips) osname=umips ;;
1507 X [23]100) osname=mips ;;
1508 X next*) osname=next ;;
1510 X if $test -f /etc/kconfig; then
1512 X if test "$lns" = "ln -s"; then
1514 X elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1516 X elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1522 X if test -n "$DJGPP"; then
1531 X tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1533 X 'not found') osvers="$4"."$3" ;;
1534 X '<3240'|'<>3240') osvers=3.2.0 ;;
1535 X '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1536 X '=3250'|'>3250') osvers=3.2.5 ;;
1540 X *dc.osx) osname=dcosx
1546 X domainos) osname=apollo
1552 X dynixptx*) osname=dynixptx
1555 X freebsd) osname=freebsd
1557 X genix) osname=genix ;;
1559 X osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
1561 X irix*) osname=irix
1568 X linux) osname=linux
1573 X netbsd*) osname=netbsd
1576 X news-os) osvers="$3"
1578 X 4*) osname=newsos4 ;;
1579 X *) osname=newsos ;;
1582 X bsd386) osname=bsd386
1583 X osvers=`$uname -r`
1585 X powerux | power_ux | powermax_os | powermaxos | \
1586 X powerunix | power_unix) osname=powerux
1589 X next*) osname=next ;;
1590 X solaris) osname=solaris
1592 X 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1596 X sunos) osname=sunos
1598 X 5*) osname=solaris
1599 X osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1603 X titanos) osname=titanos
1612 X ultrix) osname=ultrix
1615 X osf1|mls+) case "$5" in
1618 X osvers=`echo "$3" | sed 's/^[xvt]//'`
1620 X hp*) osname=hp_osf1 ;;
1621 X mips) osname=mips_osf1 ;;
1633 X $2) case "$osname" in
1637 X : svr4.x or possibly later
1647 X if test -f /stand/boot ; then
1648 X eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
1649 X if test -n "$INITPROG" -a -f "$INITPROG"; then
1650 X isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1651 X if test -n "$isesix"; then
1659 X *) if test -f /etc/systemid; then
1661 X set `echo $3 | $sed 's/\./ /g'` $4
1662 X if $test -f $src/hints/sco_$1_$2_$3.sh; then
1664 X elif $test -f $src/hints/sco_$1_$2.sh; then
1666 X elif $test -f $src/hints/sco_$1.sh; then
1671 X '') : Still unknown. Probably a generic Sys V.
1680 X *) case "$osname" in
1681 X '') : Still unknown. Probably a generic BSD.
1689 X if test -f /vmunix -a -f $src/hints/news_os.sh; then
1690 X (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
1691 X if $contains news-os UU/kernel.what >/dev/null 2>&1; then
1694 X $rm -f UU/kernel.what
1695 X elif test -d c:/.; then
1702 X : Now look for a hint file osname_osvers, unless one has been
1703 X : specified already.
1704 X case "$hintfile" in
1706 X file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
1707 X : Also try without trailing minor version numbers.
1708 X xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1709 X xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1710 X xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1711 X xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
1714 X *) case "$osvers" in
1717 X *) if $test -f $src/hints/$file.sh ; then
1719 X elif $test -f $src/hints/$xfile.sh ; then
1721 X elif $test -f $src/hints/$xxfile.sh ; then
1723 X elif $test -f $src/hints/$xxxfile.sh ; then
1725 X elif $test -f $src/hints/$xxxxfile.sh ; then
1727 X elif $test -f "$src/hints/${osname}.sh" ; then
1736 X if $test -f Policy.sh ; then
1739 X none) dflt="Policy" ;;
1740 X *) dflt="Policy $dflt" ;;
1745 X dflt=`echo $hintfile | $sed 's/\.sh$//'`
1749 X if $test -f Policy.sh ; then
1752 XThere's also a Policy hint file available, which should make the
1753 Xsite-specific (policy) questions easier to answer.
1760 XYou may give one or more space-separated answers, or "none" if appropriate.
1761 XA well-behaved OS will have no hints, so answering "none" or just "Policy"
1762 Xis a good thing. DO NOT give a wrong version.
1766 X rp="Which of these apply, if any?"
1769 X for file in $tans; do
1770 X if $test X$file = XPolicy -a -f Policy.sh; then
1772 X $cat Policy.sh >> UU/config.sh
1773 X elif $test -f $src/hints/$file.sh; then
1774 X . $src/hints/$file.sh
1775 X $cat $src/hints/$file.sh >> UU/config.sh
1776 X elif $test X$tans = X -o X$tans = Xnone ; then
1779 X : Give one chance to correct a possible typo.
1780 X echo "$file.sh does not exist"
1782 X rp="hint to use instead?"
1784 X for file in $ans; do
1785 X if $test -f "$src/hints/$file.sh"; then
1786 X . $src/hints/$file.sh
1787 X $cat $src/hints/$file.sh >> UU/config.sh
1788 X elif $test X$ans = X -o X$ans = Xnone ; then
1791 X echo "$file.sh does not exist -- ignored."
1798 X : Remember our hint file for later.
1799 X if $test -f "$src/hints/$file.sh" ; then
1809 X echo "Fetching default answers from $config_sh..." >&4
1813 X cp $config_sh config.sh 2>/dev/null
1814 X chmod +w config.sh
1823 Xtest "$override" && . ./optdef.sh
1824 Xmyuname="$newmyuname"
1826 X: Restore computed paths
1827 Xfor file in $loclist $trylist; do
1828 X eval $file="\$_$file"
1833 XConfigure uses the operating system name and version to set some defaults.
1834 XThe default value is probably right if the name rings a bell. Otherwise,
1835 Xsince spelling matters for me, either accept the default or answer "none"
1841 X case "$hintfile" in
1842 X ''|' '|none) dflt=none ;;
1843 X *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
1846 X *) dflt="$osname" ;;
1848 Xrp="Operating system name?"
1852 X*) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
1854 X: who configured the system
1855 Xcf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
1856 Xcf_by=`(logname) 2>/dev/null`
1859 X cf_by=`(whoami) 2>/dev/null`
1861 X "") cf_by=unknown ;;
1868 X$define|true) afs=true ;;
1869 X$undef|false) afs=false ;;
1870 X*) if test -d /afs; then
1878 X echo "AFS may be running... I'll be extra cautious then..." >&4
1880 X echo "AFS does not seem to be running..." >&4
1883 X: determine where manual pages are on this system
1887 X syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
1888 X syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
1889 X syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
1890 X syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
1891 X syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
1892 X sysman=`./loc . /usr/man/man1 $syspath`
1895 Xif $test -d "$sysman"; then
1896 X echo "System manual is in $sysman." >&4
1898 X echo "Could not find manual pages in source form." >&4
1901 X: decide how portable to be
1902 Xcase "$d_portable" in
1903 X"$define") dflt=y;;
1908 XI can set things up so that your shell scripts and binaries are more portable,
1909 Xat what may be a noticable cost in performance. In particular, if you
1910 Xask to be portable, the following happens:
1912 X 1) Shell scripts will rely on the PATH variable rather than using
1913 X the paths derived above.
1914 X 2) ~username interpretations will be done at run time rather than
1918 Xrp="Do you expect to run these scripts and binaries on multiple machines?"
1921 X y*) d_portable="$define"
1923 X *) d_portable="$undef" ;;
1926 X: set up shell script to do ~ expansion
1932 X echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
1935 X if $test -f /bin/csh; then
1936 X /bin/csh -f -c "glob \$1"
1941 X name=\`$expr x\$1 : '..\([^/]*\)'\`
1942 X dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
1943 X if $test ! -d "\$dir"; then
1944 X me=\`basename \$0\`
1945 X echo "\$me: can't locate home directory for: \$name" >&2
1950 X echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
1966 X: now set up to get a file name
1970 Xcat <<'EOSC' >>getfile
1983 X expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
1984 X fn=`echo $fn | sed 's/(.*)//'`
1990 X loc_file=`expr $fn : '.*:\(.*\)'`
1991 X fn=`expr $fn : '\(.*\):.*'`
1999 X*/*) fullpath=true;;
2005 X*n*) none_ok=true;;
2008 X*e*) exp_file=true;;
2011 X*p*) nopath_ok=true;;
2016 X*d*) type='Directory';;
2017 X*l*) type='Locate';;
2022 XLocate) what='File';;
2025 Xcase "$exp_file" in
2027 X case "$d_portable" in
2029 X *) exp_file=true;;
2035 Xwhile test "$type"; do
2040 X true) rp="$rp (~name ok)";;
2043 X if test -f UU/getfile.ok && \
2044 X $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2054 X case "$none_ok" in
2063 X value=`UU/filexp $ans`
2066 X if test "$ans" != "$value"; then
2067 X echo "(That expands to $value on this system.)"
2073 X case "$exp_file" in
2074 X '') value="$ans";;
2078 X case "$fullpath" in
2081 X /*) value="$ansexp" ;;
2084 X case "$already" in
2086 X echo "I shall only accept a full path name, as in /bin/ls." >&4
2087 X echo "Use a ! shell escape if you wish to check pathnames." >&4
2090 X echo "Please give a full path name, starting with slash." >&4
2093 X echo "Note that using ~name is ok provided it expands well." >&4
2106 X if test -f "$ansexp"; then
2108 X elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2110 X echo "($value is not a plain file, but that's ok.)"
2115 X if test -d "$ansexp"; then
2120 X if test -d "$ansexp"; then
2121 X echo "(Looking for $loc_file in directory $value.)"
2122 X value="$value/$loc_file"
2123 X ansexp="$ansexp/$loc_file"
2125 X if test -f "$ansexp"; then
2128 X case "$nopath_ok" in
2129 X true) case "$value" in
2131 X *) echo "Assuming $value will be in people's path."
2147 X if test "$fastread" = yes; then
2152 X rp="$what $value doesn't exist. Use that name anyway?"
2173 X: determine root of directory hierarchy where package will be installed.
2176 X dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2184 XBy default, $package will be installed in $dflt/bin, manual
2185 Xpages under $dflt/man, etc..., i.e. with $dflt as prefix for
2186 Xall installation directories. Typically set to /usr/local, but you
2187 Xmay choose /usr if you wish to install $package among your system
2188 Xbinaries. If you wish to have binaries under /bin but manual pages
2189 Xunder /usr/local/man, that's ok: you will be prompted separately
2190 Xfor each of the installation directories, the prefix being only used
2191 Xto set the defaults.
2195 Xrp='Installation prefix to use?'
2203 X *) oldprefix="$prefix";;
2208 Xprefixexp="$ansexp"
2210 X: set the prefixit variable, to compute a suitable default value
2211 Xprefixit='case "$3" in
2213 X case "$oldprefix" in
2214 X "") eval "$1=\"\$$2\"";;
2219 X eval "tp=\"\$$2\"";
2221 X ""|" ") eval "$1=\"\$$2\"";;
2227 X eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2229 X --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2230 X /*-$oldprefix/*|\~*-$oldprefix/*)
2231 X eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2232 X *) eval "$1=\"\$$2\"";;
2236 X: set the prefixup variable, to restore leading tilda escape
2237 Xprefixup='case "$prefixexp" in
2239 X*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2242 X: determine where manual pages go
2243 Xset mansrc mansrc none
2247 X$spackage has manual pages available in source form.
2251 X echo "However, you don't have nroff, so they're probably useless to you."
2253 X '') mansrc="none";;
2256 Xecho "If you don't want the manual sources installed, answer 'none'."
2259 X lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1"
2260 X lookpath="$lookpath $prefixexp/man/l_man/man1"
2261 X lookpath="$lookpath /usr/local/man/man1 /opt/man/man1 /usr/man/manl"
2262 X lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
2263 X lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2264 X lookpath="$lookpath /usr/man/man.L"
2265 X mansrc=`./loc . $prefixexp/man/man1 $lookpath`
2266 X if $test -d "$mansrc"; then
2280 Xrp='Where do the manual pages (source) go?'
2282 Xif test "X$mansrcexp" != "X$ansexp"; then
2286 Xmansrcexp="$ansexp"
2289 X installmansrc='';;
2291 Xif $afs && $test "$mansrc"; then
2294 XSince you are running AFS, I need to distinguish the directory in which
2295 Xmanual pages reside from the directory in which they are installed (and from
2296 Xwhich they are presumably copied to the former directory by occult means).
2299 X case "$installmansrc" in
2300 X '') dflt=`echo $mansrcexp | sed 's#^/afs/#/afs/.#'`;;
2301 X *) dflt="$installmansrc";;
2304 X rp='Where will man pages be installed?'
2306 X installmansrc="$ans"
2308 X installmansrc="$mansrcexp"
2323 X: set up the script used to warn in case of inconsistency
2327 Xcat <<'EOSC' >>whoa
2330 Xecho "*** WHOA THERE!!! ***" >&4
2331 Xecho " The $hint value for \$$var on this machine was \"$was\"!" >&4
2332 Xrp=" Keep the $hint value?"
2335 Xy) td=$was; tu=$was;;
2339 X: function used to set $1 to $val
2340 Xsetvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2342 X$define$undef) . ./whoa; eval "$var=\$td";;
2343 X$undef$define) . ./whoa; eval "$var=\$tu";;
2344 X*) eval "$var=$val";;
2349 Xvaltemp="$d_64bit_statfs_flds"
2351 X '') valtemp="$undef" ;;
2355 Xset d_64bit_statfs_flds
2357 X: make some quick guesses about what we are up against
2359 X$echo $n "Hmm... $c"
2364 Xecho exit 1 >eunice
2369 X$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2370 Xif test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2372 X echo "Looks kind of like an OSF/1 system, but we'll see..."
2374 Xelif test `echo abc | tr a-z A-Z` = Abc ; then
2375 X xxx=`./loc addbib blurfl $pth`
2376 X if $test -f $xxx; then
2377 X echo "Looks kind of like a USG system with BSD features, but we'll see..."
2381 X if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2382 X echo "Looks kind of like an extended USG system, but we'll see..."
2384 X echo "Looks kind of like a USG system, but we'll see..."
2388 Xelif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2389 X echo "Looks kind of like a BSD system, but we'll see..."
2393 X echo "Looks kind of like a Version 7 system, but we'll see..."
2396 Xcase "$eunicefix" in
2399 XThere is, however, a strange, musty smell in the air that reminds me of
2400 Xsomething...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2402 X echo exit 0 >eunice
2403 X d_eunice="$define"
2404 X: it so happens the Eunice I know will not run shell scripts in Unix format
2408 X echo "Congratulations. You aren't running Eunice."
2412 X: Detect OS2. The p_ variable is set above in the Head.U unit.
2417 XI have the feeling something is not exactly right, however...don't tell me...
2418 Xlemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2423 Xif test -f /xenix; then
2424 X echo "Actually, this looks more like a XENIX system..."
2425 X echo exit 0 >xenix
2429 X echo "It's not Xenix..."
2434 Xif test -f /venix; then
2435 X echo "Actually, this looks more like a VENIX system..."
2436 X echo exit 0 >venix
2442 X echo "Nor is it Venix..."
2445 Xchmod +x bsd usg v7 osf1 eunice xenix venix os2
2446 X$eunicefix bsd usg v7 osf1 eunice xenix venix os2
2449 X: see if we need a special compiler
2453 X '') case "$Mcc" in
2455 X *) case "$large" in
2457 X *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2458 X if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2472 XOn some older systems the default C compiler will not resolve multiple global
2473 Xreferences that happen to have the same name. On some such systems the "Mcc"
2474 Xcommand may be used to force these to be resolved. On other systems a "cc -M"
2475 Xcommand is required. (Note that the -M flag on other systems indicates a
2476 Xmemory model to use!) If you have the Gnu C compiler, you might wish to use
2482 X rp="Use which C compiler?"
2490 X rp="Use which C compiler?"
2494 X: Look for a hint-file generated 'call-back-unit'. Now that the
2495 X: user has specified the compiler, we may need to set or change some
2497 Xif $test -f cc.cbu; then
2501 Xecho "Checking for GNU cc in disguise and/or its version number..." >&4
2502 X$cat >gccvers.c <<EOM
2507 X printf("%s\n", __VERSION__);
2509 X printf("%s\n", "1");
2515 Xif $cc -o gccvers gccvers.c >/dev/null 2>&1; then
2516 X gccversion=`./gccvers`
2517 X case "$gccversion" in
2518 X '') echo "You are not using GNU cc." ;;
2519 X *) echo "You are using GNU cc $gccversion." ;;
2523 X echo "*** WHOA THERE!!! ***" >&4
2524 X echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
2525 X case "$knowitall" in
2527 X echo " You'd better start hunting for one and let me know about it." >&4
2533 Xcase "$gccversion" in
2534 X1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
2537 X: What should the include directory be ?
2539 X$echo $n "Hmm... $c"
2540 Xdflt='/usr/include'
2543 Xif $test -f /bin/mips && /bin/mips; then
2544 X echo "Looks like a MIPS system..."
2545 X $cat >usr.c <<'EOCP'
2546 X#ifdef SYSTYPE_BSD43
2550 X if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
2551 X dflt='/bsd43/usr/include'
2553 X mips_type='BSD 4.3'
2555 X mips_type='System V'
2557 X $rm -f usr.c usr.out
2558 X echo "and you're compiling with the $mips_type compiler and libraries."
2560 X echo "exit 0" >mips
2562 X echo "Doesn't look like a MIPS system."
2564 X echo "exit 1" >mips
2570 X*) dflt="$usrinc";;
2572 Xcase "$xxx_prompt" in
2575 X rp='Where are the include files you want to use?'
2583 X: Set private lib path
2585 X'') if ./mips; then
2586 X plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
2591 X'') dlist="$loclibpth $plibpth $glibpth";;
2592 X*) dlist="$libpth";;
2595 X: Now check and see which directories actually exist, avoiding duplicates
2599 X if $test -d $xxx; then
2600 X case " $libpth " in
2602 X *) libpth="$libpth $xxx";;
2608 XSome systems have incompatible or broken versions of libraries. Among
2609 Xthe directories listed in the question below, please remove any you
2610 Xknow not to be holding relevant libraries, and add any that are needed.
2611 XSay "none" for none.
2622 Xrp="Directories to use for library searches?"
2629 X: compute shared library extension
2632 X if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
2642 XOn some systems, shared libraries may be available. Answer 'none' if
2643 Xyou want to suppress searching of shared libraries for the remaining
2644 Xof this configuration.
2647 Xrp='What is the file extension used for shared libraries?'
2651 X: Define several unixisms.
2652 X: Hints files or command line option can be used to override them.
2653 X: The convoluted testing is in case hints files set either the old
2656 X'') case "$exe_ext" in
2658 X *) _exe="$exe_ext" ;;
2663 X'') case "$lib_ext" in
2665 X *) _a="$lib_ext" ;;
2670 X'') case "$obj_ext" in
2672 X *) _o="$obj_ext";;
2677 X'') case "$path_sep" in
2679 X *) p_="$path_sep";;
2688 X: Looking for optional libraries
2690 Xecho "Checking for optional libraries..." >&4
2695 Xcase "$libswanted" in
2696 X'') libswanted='c_s';;
2698 Xfor thislib in $libswanted; do
2700 X if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
2701 X echo "Found -l$thislib (shared)."
2703 X *"-l$thislib "*);;
2704 X *) dflt="$dflt -l$thislib";;
2706 X elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
2707 X echo "Found -l$thislib (shared)."
2709 X *"-l$thislib "*);;
2710 X *) dflt="$dflt -l$thislib";;
2712 X elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
2713 X echo "Found -l$thislib."
2715 X *"-l$thislib "*);;
2716 X *) dflt="$dflt -l$thislib";;
2718 X elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
2719 X echo "Found -l$thislib."
2721 X *"-l$thislib "*);;
2722 X *) dflt="$dflt -l$thislib";;
2724 X elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
2725 X echo "Found -l${thislib}_s."
2727 X *"-l$thislib "*);;
2728 X *) dflt="$dflt -l${thislib}_s";;
2730 X elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
2731 X echo "Found -l$thislib."
2733 X *"-l$thislib "*);;
2734 X *) dflt="$dflt -l$thislib";;
2737 X echo "No -l$thislib."
2748 X' '|'') dflt='none';;
2753 XSome versions of Unix support shared libraries, which make executables smaller
2754 Xbut make load time slightly longer.
2756 XOn some systems, mostly System V Release 3's, the shared library is included
2757 Xby putting the option "-lc_s" as the last thing on the cc command line when
2758 Xlinking. Other systems use shared libraries by default. There may be other
2759 Xlibraries needed to compile $package on your machine as well. If your system
2760 Xneeds the "-lc_s" option, include it here. Include any other special libraries
2761 Xhere as well. Say "none" for none.
2765 Xrp="Any additional libraries?"
2772 X: see how we invoke the C preprocessor
2774 Xecho "Now, how can we feed standard input to your C preprocessor..." >&4
2775 Xcat <<'EOT' >testcpp.c
2781 Xecho 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
2783 Xwrapper=`pwd`/cppstdin
2787 Xif $test "X$cppstdin" != "X" && \
2788 X $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
2789 X $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2791 X echo "You used to use $cppstdin $cppminus so we'll use that again."
2793 X '') echo "But let's see if we can live without a wrapper..." ;;
2795 X if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
2796 X $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2798 X echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
2801 X echo "(However, $cpprun $cpplast does not work, let's see...)"
2806 X case "$cppstdin" in
2809 X echo "Good old $cppstdin $cppminus does not seem to be of any help..."
2816 Xelif echo 'Maybe "'"$cc"' -E" will work...'; \
2817 X $cc -E <testcpp.c >testcpp.out 2>&1; \
2818 X $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2819 X echo "Yup, it does."
2822 Xelif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
2823 X $cc -E - <testcpp.c >testcpp.out 2>&1; \
2824 X $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2825 X echo "Yup, it does."
2828 Xelif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
2829 X $cc -P <testcpp.c >testcpp.out 2>&1; \
2830 X $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2831 X echo "Yipee, that works!"
2834 Xelif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
2835 X $cc -P - <testcpp.c >testcpp.out 2>&1; \
2836 X $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2837 X echo "At long last!"
2840 Xelif echo 'No such luck, maybe "'$cpp'" will work...'; \
2841 X $cpp <testcpp.c >testcpp.out 2>&1; \
2842 X $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2846 Xelif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
2847 X $cpp - <testcpp.c >testcpp.out 2>&1; \
2848 X $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2849 X echo "Hooray, it works! I was beginning to wonder."
2852 Xelif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
2853 X $wrapper <testcpp.c >testcpp.out 2>&1; \
2854 X $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2860 X rp="No dice. I can't find a C preprocessor. Name one:"
2864 X $x_cpp <testcpp.c >testcpp.out 2>&1
2865 X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2866 X echo "OK, that will do." >&4
2868 Xecho "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
2876 X cppminus="$x_minus"
2878 X cpplast="$x_minus"
2883 X echo "Perhaps can we force $cc -E using a wrapper..."
2884 X if $wrapper <testcpp.c >testcpp.out 2>&1; \
2885 X $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2887 X echo "Yup, we can."
2888 X cppstdin="$wrapper"
2891 X echo "Nope, we'll have to live without it..."
2904 Xcase "$cppstdin" in
2906 X*) $rm -f $wrapper;;
2908 X$rm -f testcpp.c testcpp.out
2910 X: determine optimize, if desired, or use for debug flag also
2911 Xcase "$optimize" in
2912 X' '|$undef) dflt='none';;
2914 X*) dflt="$optimize";;
2918 XSome C compilers have problems with their optimizers. By default, $package
2919 Xcompiles with the -O flag to use the optimizer. Alternately, you might want
2920 Xto use the symbolic debugger, which uses the -g flag (on traditional Unix
2921 Xsystems). Either flag can be specified here. To use neither flag, specify
2925 Xrp="What optimizer/debugger flag should be used?"
2928 Xcase "$optimize" in
2929 X'none') optimize=" ";;
2933 X: We will not override a previous value, but we might want to
2934 X: augment a hint file
2937 X case "$gccversion" in
2938 X 1*) dflt='-fpcc-struct-return' ;;
2940 X case "$optimize" in
2941 X *-g*) dflt="$dflt";;
2943 X case "$gccversion" in
2944 X 2*) if test -d /etc/conf/kconfig.d &&
2945 X $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
2947 X dflt="$dflt -posix"
2954 Xcase "$mips_type" in
2955 X*BSD*|'') inclwanted="$locincpth $usrinc";;
2956 X*) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
2958 Xfor thisincl in $inclwanted; do
2959 X if $test -d $thisincl; then
2960 X if $test x$thisincl != x$usrinc; then
2963 X *) dflt="$dflt -I$thisincl";;
2969 Xinctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
2971 Xelif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
2979 X *) dflt="$dflt -D$2";;
2984 X set signal.h __LANGUAGE_C__; eval $inctest
2986 X set signal.h LANGUAGE_C; eval $inctest
2990 Xnone|recommended) dflt="$ccflags $dflt" ;;
2991 X*) dflt="$ccflags";;
2995 X''|' ') dflt=none;;
2999 XYour C compiler may want other flags. For this question you should include
3000 X-I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3001 Xbut you should NOT include libraries or ld flags like -lwhatever. If you
3002 Xwant $package to honor its debug switch, you should include -DDEBUGGING here.
3003 XYour C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3005 XTo use no flags, specify the word "none".
3011 Xrp="Any additional cc flags?"
3015 X*) ccflags="$ans";;
3018 X: the following weeds options from ccflags that are of no interest to cpp
3019 Xcppflags="$ccflags"
3020 Xcase "$gccversion" in
3021 X1*) cppflags="$cppflags -D__GNUC__"
3023 Xcase "$mips_type" in
3025 X*BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3027 Xcase "$cppflags" in
3031 X echo "Let me guess what the preprocessor flags are..." >&4
3035 X $cat >cpp.c <<'EOM'
3044 X -*) ftry="$flag";;
3045 X *) ftry="$previous $flag";;
3047 X if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3048 X >cpp1.out 2>/dev/null && \
3049 X $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3050 X >cpp2.out 2>/dev/null && \
3051 X $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3052 X $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3054 X cppflags="$cppflags $ftry"
3062 X cppflags=${1+"$@"}
3063 X case "$cppflags" in
3064 X *-*) echo "They appear to be: $cppflags";;
3066 X $rm -f cpp.c cpp?.out
3070 X: flags used in final linking phase
3072 X'') if ./venix; then
3077 X case "$ccflags" in
3078 X *-posix*) dflt="$dflt -posix" ;;
3081 X*) dflt="$ldflags";;
3084 X: Try to guess additional flags to pick up local libraries.
3085 Xfor thislibdir in $libpth; do
3086 X case " $loclibpth " in
3087 X *" $thislibdir "*)
3089 X *"-L$thislibdir "*) ;;
3090 X *) dflt="$dflt -L$thislibdir" ;;
3102 XYour C linker may need flags. For this question you should
3103 Xinclude -L/whatever and any other flags used by the C linker, but you
3104 Xshould NOT include libraries like -lwhatever.
3106 XMake sure you include the appropriate -L/path flags if your C linker
3107 Xdoes not normally search all of the directories you specified above,
3110 XTo use no flags, specify the word "none".
3114 Xrp="Any additional ld flags (NOT including libraries)?"
3118 X*) ldflags="$ans";;
3120 Xrmlist="$rmlist pdp11"
3124 Xecho "Checking your choice of C compiler and flags for coherency..." >&4
3125 Xset X $cc $optimize $ccflags $ldflags -o try try.c $libs
3127 X$cat >try.msg <<EOM
3128 XI've tried to compile and run a simple program with:
3133 Xand I got the following output:
3136 X$cat > try.c <<'EOF'
3138 Xmain() { printf("Ok\n"); exit(0); }
3141 Xif sh -c "$cc $optimize $ccflags $ldflags -o try try.c $libs" >>try.msg 2>&1; then
3142 X if sh -c './try' >>try.msg 2>&1; then
3146 X *) echo 'The program compiled OK, but produced no output.' >> try.msg
3149 X cat >> try.msg <<'EOQS'
3150 XIf $libs contains -lsfio, and sfio is mis-configured, then it
3151 Xsometimes (apparently) runs and exits with a 0 status, but with no
3152 Xoutput! It may have to do with sfio's use of _exit vs. exit.
3155 X rp="You have a big problem. Shall I abort Configure"
3162 X echo "The program compiled OK, but exited with status $?." >>try.msg
3163 X rp="You have a problem. Shall I abort Configure"
3167 X echo "I can't compile the test program." >>try.msg
3168 X rp="You have a BIG problem. Shall I abort Configure"
3174 X case "$knowitall" in
3176 X echo "(The supplied flags might be incorrect with this C compiler.)"
3184 X *) echo "Ok. Stopping Configure." >&4
3189 Xn) echo "OK, that should do.";;
3191 X$rm -f try try.* core
3193 X: define a shorthand compile call
3197 X$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
3198 X: define a shorthand compile call for compilations that should be ok.
3202 X$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
3205 Xecho "Checking for GNU C Library..." >&4
3206 Xcat >gnulibc.c <<EOM
3219 Xif eval $compile_ok && ./gnulibc; then
3221 X echo "You are using the GNU C Library"
3224 X echo "You are not using the GNU C Library"
3230 X: see if nm is to be used to determine whether a symbol is defined or not
3234 X case "$d_gnulibc" in
3237 X echo "nm probably won't work on the GNU C Library." >&4
3243 X if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
3245 X echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
3246 X echo "'nm' won't be sufficient on this sytem." >&4
3252 X '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
3253 X if $test $dflt -gt 20; then
3263 X true|$define) dflt=y;;
3270 XI can use $nm to extract the symbols from your C libraries. This
3271 Xis a time consuming task which may generate huge output on the disk (up
3272 Xto 3 megabytes) but that should make the symbols extraction faster. The
3273 Xalternative is to skip the 'nm' extraction part and to compile a small
3274 Xtest program instead to determine whether each symbol is present. If
3275 Xyou have a fast C compiler and/or if your 'nm' output cannot be parsed,
3276 Xthis may be the best solution.
3278 XYou probably shouldn't let me use 'nm' if you are using the GNU C Library.
3281 Xrp="Shall I use $nm to extract C symbols from the libraries?"
3284 X[Nn]*) usenm=false;;
3289 Xcase "$reuseval" in
3290 Xtrue) runnm=false;;
3293 X: nm options which may be necessary
3295 X'') if $test -f /mach_boot; then
3297 X elif $test -d /usr/ccs/lib; then
3298 X nm_opt='-p' # Solaris (and SunOS?)
3299 X elif $test -f /dgux; then
3300 X nm_opt='-p' # DG-UX
3301 X elif $test -f /lib64/rld; then
3302 X nm_opt='-p' # 64-bit Irix
3308 X: nm options which may be necessary for shared libraries but illegal
3309 X: for archive libraries. Thank you, Linux.
3310 Xcase "$nm_so_opt" in
3311 X'') case "$myuname" in
3313 X if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
3314 X nm_so_opt='--dynamic'
3323 X: get list of predefined functions in a handy place
3328 X *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
3335 X*) for thislib in $libs; do
3336 X case "$thislib" in
3338 X : Handle C library specially below.
3341 X thislib=`echo $thislib | $sed -e 's/^-l//'`
3342 X if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
3344 X elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
3346 X elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
3348 X elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
3350 X elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
3352 X elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
3354 X elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
3359 X libnames="$libnames $try"
3361 X *) libnames="$libnames $thislib" ;;
3370 X for xxx in $libpth; do
3371 X $test -r $1 || set $xxx/libc.$so
3372 X : The messy sed command sorts on library version numbers.
3374 X set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
3375 X tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
3377 X s/[0-9][0-9]*/0000&/g
3378 X s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
3381 X sort | $sed -e 's/^.* //'`
3384 X $test -r $1 || set /usr/ccs/lib/libc.$so
3385 X $test -r $1 || set /lib/libsys_s$_a
3391 Xif $test -r "$1"; then
3392 X echo "Your (shared) C library seems to be in $1."
3394 Xelif $test -r /lib/libc && $test -r /lib/clib; then
3395 X echo "Your C library seems to be in both /lib/clib and /lib/libc."
3397 X libc='/lib/clib /lib/libc'
3398 X if $test -r /lib/syslib; then
3399 X echo "(Your math library is in /lib/syslib.)"
3400 X libc="$libc /lib/syslib"
3402 Xelif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3403 X echo "Your C library seems to be in $libc, as you said before."
3404 Xelif $test -r $incpath/usr/lib/libc$_a; then
3405 X libc=$incpath/usr/lib/libc$_a;
3406 X echo "Your C library seems to be in $libc. That's fine."
3407 Xelif $test -r /lib/libc$_a; then
3408 X libc=/lib/libc$_a;
3409 X echo "Your C library seems to be in $libc. You're normal."
3411 X if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
3413 X elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
3414 X libnames="$libnames "`./loc clib blurfl/dyick $libpth`
3415 X elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
3417 X elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3419 X elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3422 X tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
3424 X if $test -r "$tans"; then
3425 X echo "Your C library seems to be in $tans, of all places."
3431 Xif $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3435 XIf the guess above is wrong (which it might be if you're using a strange
3436 Xcompiler, or your machine supports multiple models), you can override it here.
3441 X echo $libpth | tr ' ' '\012' | sort | uniq > libpath
3443 XI can't seem to find your C library. I've looked in the following places:
3446 X $sed 's/^/ /' libpath
3449 XNone of these seems to contain your C library. I need to get its name...
3454 Xrp='Where is your C library?'
3459 Xecho $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
3460 Xset X `cat libnames`
3463 Xcase $# in 1) xxx=file; esac
3464 Xecho "Extracting names from the following $xxx for later perusal:" >&4
3466 X$sed 's/^/ /' libnames >&4
3468 X$echo $n "This may take a while...$c" >&4
3472 X *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
3473 X *) $nm $nm_opt $file 2>/dev/null;;
3478 X$grep fprintf libc.tmp > libc.ptf
3479 Xxscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
3480 Xxrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
3482 Xif com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
3484 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3486 Xelif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
3488 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3490 Xelif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
3492 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3494 Xelif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
3496 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3498 Xelif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
3500 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3502 Xelif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
3504 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3506 Xelif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
3507 X -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
3509 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3511 Xelif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
3513 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3515 Xelif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
3517 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3519 Xelif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
3521 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3523 Xelif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
3525 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3527 Xelif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
3529 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3531 Xelif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
3533 X $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3536 X $nm -p $* 2>/dev/null >libc.tmp
3537 X $grep fprintf libc.tmp > libc.ptf
3538 X if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
3539 X eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
3545 X echo "$nm didn't seem to work right. Trying $ar instead..." >&4
3547 X if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
3548 X for thisname in $libnames $libc; do
3549 X $ar t $thisname >>libc.tmp
3551 X $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
3553 X elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
3554 X # Repeat libc to extract forwarders to DLL entries too
3555 X for thisname in $libnames $libc; do
3556 X $ar tv $thisname >>libc.tmp
3557 X # Revision 50 of EMX has bug in $ar.
3558 X # it will not extract forwarders to DLL entries
3559 X # Use emximp which will extract exactly them.
3560 X emximp -o tmp.imp $thisname \
3562 X $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
3563 X < tmp.imp >>libc.tmp
3566 X $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
3569 X echo "$ar didn't seem to work right." >&4
3570 X echo "Maybe this is a Cray...trying bld instead..." >&4
3571 X if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
3573 X for thisname in $libnames; do
3574 X bld t $libnames | \
3575 X $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
3576 X $ar t $thisname >>libc.tmp
3580 X echo "That didn't work either. Giving up." >&4
3587 Xif $test -f /lib/syscalls.exp; then
3589 X echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
3590 X $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
3594 X$rm -f libnames libpath
3596 X: is a C symbol defined?
3599 X-v) tf=libc.tmp; tc=""; tdc="";;
3600 X-a) tf=libc.tmp; tc="[0]"; tdc="[]";;
3601 X*) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
3604 Xcase "$reuseval-$4" in
3606 Xtrue-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
3612 X if $contains $tlook $tf >/dev/null 2>&1;
3617 X echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
3618 X if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
3626 X $define) tval=true;;
3632 X: define an is-in-libc? function
3633 Xinlibc='echo " "; td=$define; tu=$undef;
3634 Xsym=$1; var=$2; eval "was=\$$2";
3636 Xcase "$reuseval$was" in
3646 X echo "$sym() found." >&4;
3647 X case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
3649 X echo "$sym() NOT found." >&4;
3650 X case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
3654 X $define) echo "$sym() found." >&4;;
3655 X *) echo "$sym() NOT found." >&4;;
3659 X: see if bcopy exists
3663 X: see if bzero exists
3667 X: see if endmntent exists
3668 Xset endmntent d_endmntent
3671 X: see if fs_info exists
3672 Xset fs_info d_fs_info
3675 X: see if getmnt exists
3676 Xset getmnt d_getmnt
3679 X: see if getmntent exists
3680 Xset getmntent d_getmntent
3683 X: see if getmntinfo exists
3684 Xset getmntinfo d_getmntinfo
3686 X: determine filename position in cpp output
3688 Xecho "Computing filename position in cpp output for #include directives..." >&4
3689 Xecho '#include <stdio.h>' > foo.c
3692 X$cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
3693 X$grep '^[ ]*#.*stdio\.h' | \
3694 Xwhile read cline; do
3697 X while $test \$# -gt 0; do
3698 X if $test -r \`echo \$1 | $tr -d '"'\`; then
3703 X pos=\`expr \$pos + 1\`
3709 X$rm -f foo.c fieldn
3715 X*) pos="${fieldn}th";;
3717 Xecho "Your cpp writes the filename in the $pos field of the line."
3719 X: locate header file
3720 X$cat >findhdr <<EOF
3724 Xif test -f $usrinc/\$wanted; then
3725 X echo "$usrinc/\$wanted"
3728 Xawkprg='{ print \$$fieldn }'
3729 Xecho "#include <\$wanted>" > foo\$\$.c
3730 X$cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
3731 X$grep "^[ ]*#.*\$wanted" | \
3732 Xwhile read cline; do
3733 X name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
3735 X */\$wanted) echo "\$name"; exit 0;;
3746 X: define an alternate in-header-list? function
3747 Xinhdr='echo " "; td=$define; tu=$undef; yyy=$@;
3748 Xcont=true; xxf="echo \"<\$1> found.\" >&4";
3749 Xcase $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
3750 X*) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
3752 Xcase $# in 4) instead=instead;; *) instead="at last";; esac;
3753 Xwhile $test "$cont"; do
3754 X xxx=`./findhdr $1`
3755 X var=$2; eval "was=\$$2";
3756 X if $test "$xxx" && $test -r "$xxx";
3758 X eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
3761 X eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
3762 X set $yyy; shift; shift; yyy=$@;
3763 X case $# in 0) cont="";;
3764 X 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
3765 X xxnf="echo \"and I did not find <\$1> either.\" >&4";;
3766 X *) xxf="echo \"but I found <\$1\> instead.\" >&4";
3767 X xxnf="echo \"there is no <\$1>, ...\" >&4";;
3770 Xwhile $test "$yyy";
3771 Xdo set $yyy; var=$2; eval "was=\$$2";
3772 X eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
3773 X set $yyy; shift; shift; yyy=$@;
3776 X: see if this is a sys/mount.h system
3777 Xset sys/mount.h i_sysmount
3780 Xset xxx valfstype valbsize valfsize
3781 Xvalfstype="$d_getmntinfofstype"
3782 Xvalbsize="$d_getmntinfobsize"
3783 Xvalfsize="$d_getmntinfofsize"
3786 X '') valfstype="$undef" ;;
3789 X '') valbsize="$undef" ;;
3792 X '') valfsize="$undef" ;;
3795 Xxxx=`./findhdr sys/mount.h`
3796 Xif $test -f "$xxx";then
3797 X $cppstdin $cppflags $cppminus < $xxx >$$.h
3798 X : f_fsize is always more preferable. changed from bsize 17 dec 99
3799 X if $contains "[^a-zA-Z_]f_fsize[^a-zA-Z_]*;" $$.h > /dev/null 2>&1
3801 X valfsize="$define"
3803 X if $contains "[^a-zA-Z_]f_bsize[^a-zA-Z_]*;" $$.h > /dev/null 2>&1
3805 X valbsize="$define"
3808 X if $contains "[^a-zA-Z_]f_fstypename[^a-zA-Z_]*;" $$.h > /dev/null 2>&1
3810 X valfstype="$define"
3815 Xset d_getmntinfofstype
3818 Xset d_getmntinfobsize
3821 Xset d_getmntinfofsize
3824 X$rm -f $$.h > /dev/null 2>&1
3825 Xunset xxx valfstype valbsize valfsize
3826 X: see if memcpy exists
3827 Xset memcpy d_memcpy
3830 X: see if memset exists
3831 Xset memset d_memset
3834 X: see if mntctl exists
3835 Xset mntctl d_mntctl
3840 Xvalmtime="$d_mnttime"
3843 X '') valmtime="$undef" ;;
3846 Xxxx=`./findhdr sys/mnttab.h`
3847 Xxxx="$xxx `./findhdr sys/mntctl.h`"
3850 X if $test -f "$x";then
3851 X $cppstdin $cppflags $cppminus < $x >$$.h
3852 X if $contains "[^a-zA-Z_]mnt_time[^a-zA-Z_]*;" $$.h > /dev/null 2>&1
3854 X valmtime="$define"
3856 X if $contains "[^a-zA-Z_]vmt_time[^a-zA-Z_]*;" $$.h > /dev/null 2>&1
3858 X valmtime="$define"
3867 X$rm -f $$.h > /dev/null 2>&1
3868 Xunset x xxx valmtime
3870 X: see if stdlib is available
3871 Xset stdlib.h i_stdlib
3874 X: see if this is a unistd.h system
3875 Xset unistd.h i_unistd
3878 X: see if getopt exists
3879 Xset getopt d_getopt
3882 Xif $test $i_stdlib = "$define" ; then
3883 X x1="#include <stdlib.h>"
3885 Xif $test $i_unistd = "$define" ; then
3886 X x2="#include <unistd.h>"
3889 X$echo "#include <stdio.h>" > gotest.c
3890 X$echo "$x1" >> gotest.c
3891 X$echo "$x2" >> gotest.c
3892 X$cat >>gotest.c <<'EOF'
3894 Xmain() { optind; optarg; }
3898 Xif $cc $ccflags $ldflags gotest.c -o gotest $libs >/dev/null 2>&1; then
3900 X $echo "optind is defined in stdio.h, stdlib.h or unistd.h."
3903 X $echo "optind is not defined in stdio.h, stdlib.h or unistd.h."
3909 X$rm -f gotest gotest.c > /dev/null 2>&1
3910 X: see if setmntent exists
3911 Xset setmntent d_setmntent
3915 Xvaltemp="$d_setmntent_one_arg"
3917 X '') valtemp="$undef" ;;
3920 Xcase "$d_setmntent" in
3922 X : We will try the easy way first...
3923 X : This only works if there are prototypes.
3924 X : And hope the dual universe machines dont define both!
3925 X xxx="`./findhdr mntent.h`"
3926 X xxx="$xxx `./findhdr sys/mount.h`"
3929 X if $test -f "$x"; then
3930 X $cppstdin $cppflags $cppminus < $x >smtest.h
3931 X if $contains '[^a-zA-Z_]setmntent.*([^),]+)' smtest.h > /dev/null 2>&1
3934 X $echo 'You appear to have a single argument setmntent().'
3939 X $rm -f smtest.h > /dev/null 2>&1
3944 Xset d_setmntent_one_arg
3946 Xunset x xxx valtemp
3948 X: see if this is a sys/statfs.h system
3949 Xset sys/statfs.h i_sysstatfs
3953 Xvalfrsize="$d_statfs_frsize"
3955 X '') valfrsize="$undef" ;;
3958 Xxxx=`./findhdr sys/statfs.h`
3959 Xif $test -f "$xxx";then
3960 X $cppstdin $cppflags $cppminus < $xxx >sftemp.h
3961 X if $contains "[^a-zA-Z_]f_frsize[^a-zA-Z_]*;" sftemp.h > /dev/null 2>&1
3963 X valfrsize="$define"
3968 Xset d_statfs_frsize
3971 X$rm -f sftemp.h > /dev/null 2>&1
3972 Xunset xxx valfrsize
3973 X: see if statvfs exists
3974 Xset statvfs d_statvfs
3978 Xif $test "$d_getmnt" = "$define" || \
3979 X $test "$d_getmntinfo" = "$define" || \
3980 X $test "$d_statvfs" = "$define"
3982 X d_statfs="$undef" # we don't care if it's there or not.
3983 X d_statfsbsd="$undef"
3984 X d_statfssysv3="$undef"
3987 X : see if statfs exists
3988 X set statfs d_statfs
3991 X set valbsd xxx valsysv3
3992 X valbsd="$d_statfsbsd"
3993 X valsysv3="$d_statfssysv3"
3996 X '') valbsd="$undef" ;;
3999 X '') valsysv3="$undef" ;;
4002 X case "$d_statfs" in
4004 X : We will try the easy way first...
4005 X : This only works if there are prototypes.
4006 X : And hope the dual universe machines dont define both!
4007 X xxx="`./findhdr sys/statfs.h`"
4008 X xxx="$xxx `./findhdr sys/mount.h`"
4009 X xxx="$xxx `./findhdr sys/vfs.h`"
4012 X if $test -f "$x"; then
4013 X $cppstdin $cppflags $cppminus < $x >sftest.h
4014 X if $contains '[^a-zA-Z_]statfs.*([^,]*,[^,]*,[^,]*,[^,]*)' sftest.h > /dev/null 2>&1
4016 X valsysv3="$define"
4018 X $echo 'You appear to have the System V.3 style statfs()'
4020 X if $contains '[^a-zA-Z_]statfs.*([^,]*,[^,]*)' sftest.h > /dev/null 2>&1
4024 X $echo 'You appear to have the BSD style statfs()'
4027 X if $contains '[^a-zA-Z_]statfs.*([^,]*,[^,]*,[^,]*)' sftest.h > /dev/null 2>&1
4031 X $echo 'You appear to have the BSD style of statfs()'
4038 X case "$valsysv3" in
4042 X rp='How many arguments does your statfs system call accept (2/3/4)?'
4045 X 2) valbsd="$define"
4048 X 3) valbsd="$define"
4051 X 4) valbsd="$undef"
4052 X valsysv3="$define"
4060 X $rm -f sftest.h > /dev/null 2>&1
4070 X unset x xxx valbsd valsysv3
4072 X case ${d_statfssysv3} in
4077 X: see if this is a sys/statvfs.h system
4078 Xset sys/statvfs.h i_sysstatvfs
4081 Xset xxx valbasetype
4082 Xvalbasetype="$d_statvfsbasetype"
4083 Xcase $valbasetype in
4084 X '') valbasetype="$undef" ;;
4086 Xxxx=`./findhdr sys/statvfs.h`
4087 Xif $test -f "$xxx";then
4088 X $cppstdin $cppflags $cppminus < $xxx >$$.h
4089 X if $contains "[^a-zA-Z_]f_basetype[^a-zA-Z_]*;" $$.h > /dev/null 2>&1
4091 X valbasetype="$define"
4096 Xset d_statvfsbasetype
4099 X$rm -f $$.h > /dev/null 2>&1
4100 Xunset xxx valbasetype
4101 X: see which of string.h or strings.h is needed
4103 Xstrings=`./findhdr string.h`
4104 Xif $test "$strings" && $test -r "$strings"; then
4105 X echo "Using <string.h> instead of <strings.h>." >&4
4109 X strings=`./findhdr strings.h`
4110 X if $test "$strings" && $test -r "$strings"; then
4111 X echo "Using <strings.h> instead of <string.h>." >&4
4113 X echo "No string header found -- You'll surely have problems." >&4
4118 Xcase "$i_string" in
4119 X"$undef") strings=`./findhdr strings.h`;;
4120 X*) strings=`./findhdr string.h`;;
4125 Xif set index val -f; eval $csym; $val; then
4126 X if set strchr val -f d_strchr; eval $csym; $val; then
4127 X if $contains strchr "$strings" >/dev/null 2>&1 ; then
4130 X echo "strchr() found." >&4
4134 X echo "index() found." >&4
4139 X echo "index() found." >&4
4142 X if set strchr val -f d_strchr; eval $csym; $val; then
4145 X echo "strchr() found." >&4
4147 X echo "No index() or strchr() found!" >&4
4152 Xset d_strchr; eval $setvar
4154 Xset d_index; eval $setvar
4156 X: see if sysfs exists
4160 X: preserve RCS keywords in files with variable substitution, grrr
4165 Xif $test "$di_prog" = ""; then
4170 Xif $test "$d_getopt" = "$define";then
4178 Xecho "Checking if your $make program sets \$(MAKE)..." >&4
4179 Xcase "$make_set_make" in
4181 X $sed 's/^X //' > testmake.mak << 'EOF'
4183 XX @echo 'maketemp="$(MAKE)"'
4185 X case "`$make -f testmake.mak 2>/dev/null`" in
4186 X *maketemp=*) make_set_make='#' ;;
4187 X *) make_set_make="MAKE=$make" ;;
4189 X $rm -f testmake.mak
4192 Xcase "$make_set_make" in
4193 X'#') echo "Yup, it does.";;
4194 X*) echo "Nope, it doesn't.";;
4197 X: Cruising for prototypes
4199 Xecho "Checking out function prototypes..." >&4
4200 X$cat >prototype.c <<'EOCP'
4201 Xmain(int argc, char *argv[]) {
4204 Xif $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4205 X echo "Your C compiler appears to support function prototypes."
4208 X echo "Your C compiler doesn't seem to understand function prototypes."
4215 X: check for void type
4217 Xecho "Checking to see how well your C compiler groks the void type..." >&4
4218 Xcase "$voidflags" in
4220 X $cat >try.c <<'EOCP'
4226 X extern void moo(); /* function returning void */
4227 X void (*goo)(); /* ptr to func returning void */
4229 X void *hue; /* generic ptr */
4232 X void (*foo[10])();
4244 X if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4245 X voidflags=$defvoidused
4246 X echo "Good. It appears to support void to the level $package wants.">&4
4247 X if $contains warning .out >/dev/null 2>&1; then
4248 X echo "However, you might get some warnings that look like this:"
4252 Xecho "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4253 X if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4254 X echo "It supports 1..."
4255 X if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4256 X echo "It also supports 2..."
4257 X if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4259 X echo "And it supports 4 but not 8 definitely."
4261 X echo "It doesn't support 4..."
4262 X if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4264 X echo "But it supports 8."
4267 X echo "Neither does it support 8."
4271 X echo "It does not support 2..."
4272 X if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4274 X echo "But it supports 4 and 8."
4276 X if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4278 X echo "And it supports 4 but has not heard about 8."
4280 X echo "However it supports 8 but not 4."
4285 X echo "There is no support at all for void."
4290 Xcase "$voidflags" in
4292 X*) $cat >&4 <<'EOM'
4293 X Support flag bits are:
4294 X 1: basic void declarations.
4295 X 2: arrays of pointers to functions returning void.
4296 X 4: operations between pointers to and addresses of void functions.
4297 X 8: generic void pointers.
4299 X dflt="$voidflags";
4300 X rp="Your void support flags add up to what?"
4307 X: see if this is an fshelp.h system
4308 Xset fshelp.h i_fshelp
4311 X: see if this is an kernel/fs_info.h system
4312 Xset kernel/fs_info.h i_kernfsinfo
4315 X: see if this is a limits.h system
4316 Xset limits.h i_limits
4319 X: see if this is a malloc.h system
4320 Xset malloc.h i_malloc
4323 X: see if memory.h is available.
4328 X: See if it conflicts with string.h
4331 X case "$strings" in
4334 X $cppstdin $cppflags $cppminus < $strings > mem.h
4335 X if $contains 'memcpy' mem.h >/dev/null 2>&1; then
4337 X echo "We won't be including <memory.h>."
4347 X: see if this is an mntent.h system
4348 Xset mntent.h i_mntent
4351 X: see if this is an mnttab.h system
4352 Xset mnttab.h i_mnttab
4354 X: see if this is an storage/Directory.h system
4355 Xset storage/Directory.h i_stor_directory
4358 X: see if this is an storage/Entry.h system
4359 Xset storage/Entry.h i_stor_entry
4362 X: see if this is an storage/Path.h system
4363 Xset storage/Path.h i_stor_path
4366 X: see if this is a sys/fstypes.h system
4367 Xset sys/fstypes.h i_sysfstypes
4369 Xset sys/fs_types.h i_sysfs_types
4372 X: see if this is a sys/fstyp.h system
4373 Xset sys/fstyp.h i_sysfstyp
4376 X: see if this is a sys/mntctl.h system
4377 Xset sys/mntctl.h i_sysmntctl
4380 X: see if this is a sys/mntent.h system
4381 Xset sys/mntent.h i_sysmntent
4384 X: see if this is a sys/mnttab.h system
4385 Xset sys/mnttab.h i_sysmnttab
4388 X: see if this is a sys/param system
4389 Xset sys/param.h i_sysparam
4392 X: see if sys/stat.h is available
4393 Xset sys/stat.h i_sysstat
4396 X: see if we should include time.h, sys/time.h, or both
4398 Xecho "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
4399 X$echo $n "I'm now running the test program...$c"
4400 X$cat >try.c <<'EOCP'
4401 X#include <sys/types.h>
4406 X#ifdef SYSTIMEKERNEL
4409 X#include <sys/time.h>
4412 X#include <sys/select.h>
4418 X struct timeval bar;
4421 X struct timezone tzp;
4423 X if (foo.tm_sec == foo.tm_sec)
4426 X if (bar.tv_sec == bar.tv_sec)
4435 Xfor s_timeval in '-DS_TIMEVAL' ''; do
4436 Xfor i_systimek in '' '-DSYSTIMEKERNEL'; do
4437 Xfor i_time in '' '-DI_TIME'; do
4438 Xfor i_systime in '-DI_SYSTIME' ''; do
4440 X '') $echo $n ".$c"
4441 X set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
4442 X if eval $compile; then
4443 X set X $i_time $i_systime $i_systimek $sysselect $s_timeval
4447 X $echo $n "Succeeded with $flags$c"
4458 X*SYSTIMEKERNEL*) i_systimek="$define"
4459 X timeincl=`./findhdr sys/time.h`
4460 X echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
4461 X*) i_systimek="$undef";;
4464 X*I_TIME*) i_time="$define"
4465 X timeincl=`./findhdr time.h`" $timeincl"
4466 X echo "We'll include <time.h>." >&4;;
4467 X*) i_time="$undef";;
4470 X*I_SYSTIME*) i_systime="$define"
4471 X timeincl=`./findhdr sys/time.h`" $timeincl"
4472 X echo "We'll include <sys/time.h>." >&4;;
4473 X*) i_systime="$undef";;
4477 X: see if sys/types.h has to be included
4478 Xset sys/types.h i_systypes
4481 X: see if this is a sys/vfs.h system
4482 Xset sys/vfs.h i_sysvfs
4485 X: see if this is a sys/vfstab.h system
4486 Xset sys/vfstab.h i_sysvfstab
4489 X: see if this is a sys/vmount.h system
4490 Xset sys/vmount.h i_sysvmount
4493 X: end of configuration questions
4495 Xecho "End of configuration questions."
4498 X: back to where it started
4499 Xif test -d ../UU; then
4503 X: configuration may be patched via a 'config.over' file
4504 Xif $test -f config.over; then
4507 X rp='I see a config.over file. Do you wish to load it?'
4510 X n*) echo "OK, I'll ignore it.";;
4511 X *) . ./config.over
4512 X echo "Configuration override changes have been loaded."
4517 X: in case they want portability, strip down executable paths
4518 Xcase "$d_portable" in
4521 X echo "Stripping down executable paths..." >&4
4522 X for file in $loclist $trylist; do
4523 X if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
4524 X eval $file="\$file"
4530 X: create config.sh file
4532 Xecho "Creating config.sh..." >&4
4533 X$spitshell <<EOT >config.sh
4536 X# This file was produced by running the Configure script. It holds all the
4537 X# definitions figured out by Configure. Should you modify one of these values,
4538 X# do not forget to propagate your changes by running "Configure -der". You may
4539 X# instead choose to run each of the .SH files by yourself, or "Configure -S".
4542 X# Package name : $package
4543 X# Source directory : $src
4544 X# Configuration time: $cf_time
4545 X# Configured by : $cf_by
4546 X# Target system : $myuname
4556 XRevision='$Revision'
4564 Xarchobjs='$archobjs'
4579 Xcompress='$compress'
4580 Xcontains='$contains'
4584 Xcppflags='$cppflags'
4586 Xcppminus='$cppminus'
4588 Xcppstdin='$cppstdin'
4590 Xd_64bit_statfs_flds='$d_64bit_statfs_flds'
4594 Xd_endmntent='$d_endmntent'
4595 Xd_eunice='$d_eunice'
4596 Xd_fs_info='$d_fs_info'
4597 Xd_getmnt='$d_getmnt'
4598 Xd_getmntent='$d_getmntent'
4599 Xd_getmntinfo='$d_getmntinfo'
4600 Xd_getmntinfobsize='$d_getmntinfobsize'
4601 Xd_getmntinfofsize='$d_getmntinfofsize'
4602 Xd_getmntinfofstype='$d_getmntinfofstype'
4603 Xd_getopt='$d_getopt'
4604 Xd_gnulibc='$d_gnulibc'
4606 Xd_memcpy='$d_memcpy'
4607 Xd_memset='$d_memset'
4608 Xd_mntctl='$d_mntctl'
4609 Xd_mnttime='$d_mnttime'
4610 Xd_optind='$d_optind'
4611 Xd_portable='$d_portable'
4612 Xd_setmntent='$d_setmntent'
4613 Xd_setmntent_one_arg='$d_setmntent_one_arg'
4614 Xd_statfs='$d_statfs'
4615 Xd_statfs_frsize='$d_statfs_frsize'
4616 Xd_statfsbsd='$d_statfsbsd'
4617 Xd_statfssysv3='$d_statfssysv3'
4618 Xd_statvfs='$d_statvfs'
4619 Xd_statvfsbasetype='$d_statvfsbasetype'
4620 Xd_strchr='$d_strchr'
4624 Xdefvoidused='$defvoidused'
4625 Xdi_otherobj='$di_otherobj'
4630 Xeunicefix='$eunicefix'
4634 Xfirstmakefile='$firstmakefile'
4636 Xgccversion='$gccversion'
4641 Xi_fshelp='$i_fshelp'
4642 Xi_kernfsinfo='$i_kernfsinfo'
4643 Xi_limits='$i_limits'
4644 Xi_malloc='$i_malloc'
4645 Xi_memory='$i_memory'
4646 Xi_mntent='$i_mntent'
4647 Xi_mnttab='$i_mnttab'
4648 Xi_stdlib='$i_stdlib'
4649 Xi_stor_directory='$i_stor_directory'
4650 Xi_stor_entry='$i_stor_entry'
4651 Xi_stor_path='$i_stor_path'
4652 Xi_string='$i_string'
4653 Xi_sysfs_types='$i_sysfs_types'
4654 Xi_sysfstyp='$i_sysfstyp'
4655 Xi_sysfstypes='$i_sysfstypes'
4656 Xi_sysmntctl='$i_sysmntctl'
4657 Xi_sysmntent='$i_sysmntent'
4658 Xi_sysmnttab='$i_sysmnttab'
4659 Xi_sysmount='$i_sysmount'
4660 Xi_sysparam='$i_sysparam'
4661 Xi_sysstat='$i_sysstat'
4662 Xi_sysstatfs='$i_sysstatfs'
4663 Xi_sysstatvfs='$i_sysstatvfs'
4664 Xi_systime='$i_systime'
4665 Xi_systimek='$i_systimek'
4666 Xi_systypes='$i_systypes'
4667 Xi_sysvfs='$i_sysvfs'
4668 Xi_sysvfstab='$i_sysvfstab'
4669 Xi_sysvmount='$i_sysvmount'
4671 Xi_unistd='$i_unistd'
4674 Xinstallmansrc='$installmansrc'
4682 Xlibswanted='$libswanted'
4688 Xlocincpth='$locincpth'
4689 Xloclibpth='$loclibpth'
4696 Xmake_set_make='$make_set_make'
4699 Xmansrcexp='$mansrcexp'
4701 Xmips_type='$mips_type'
4709 Xnm_so_opt='$nm_so_opt'
4712 Xoptimize='$optimize'
4716 Xpath_sep='$path_sep'
4723 Xprefixexp='$prefixexp'
4724 Xprototype='$prototype'
4729 Xsendmail='$sendmail'
4732 Xsharpbang='$sharpbang'
4738 Xspackage='$spackage'
4739 Xspitshell='$spitshell'
4750 Xtimeincl='$timeincl'
4761 Xvoidflags='$voidflags'
4767 X: Add in command line options if available
4768 X$test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
4770 X: add special variables
4771 X$test -f $src/patchlevel.h && \
4772 Xawk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
4773 Xecho "CONFIG=true" >>config.sh
4775 X: propagate old symbols
4776 Xif $test -f UU/config.sh; then
4777 X <UU/config.sh sort | uniq >UU/oldconfig.sh
4778 X sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
4779 X sort | uniq -u >UU/oldsyms
4780 X set X `cat UU/oldsyms`
4786 XHmm...You had some extra variables I don't know about...I'll try to keep 'em...
4788 X echo "# Variables propagated from previous config.sh file." >>config.sh
4789 X for sym in `cat UU/oldsyms`; do
4790 X echo " Propagating $hint variable "'$'"$sym..."
4791 X eval 'tmp="$'"${sym}"'"'
4793 X sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
4799 X: Finish up by extracting the .SH files
4813 XIf you'd like to make any changes to the config.sh file before I begin
4814 Xto configure things, do it as a shell escape now (e.g. !vi config.sh).
4817 X rp="Press return or use a shell escape to edit config.sh:"
4822 X *) : in case they cannot read
4823 X sh 1>&4 -c "$ans";;
4828 X: if this fails, just run all the .SH files by hand
4835 Xif $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
4842 XNow you need to generate make dependencies by running "make depend".
4843 XYou might prefer to run it in background: "make depend > makedepend.out &"
4844 XIt can take a while, so you might not want to run it right now.
4849 X rp="Run make depend now?"
4853 X make depend && echo "Now you must run a make."
4856 X echo "You must run 'make depend' then 'make'."
4859 Xelif test -f [Mm]akefile; then
4861 X echo "Now you must run a make."
4866 Xif $test -f Policy.sh; then
4869 XIf you compile $package on a different machine or from a different object
4870 Xdirectory, copy the Policy.sh file from this object directory to the
4871 Xnew one before you run Configure -- this will help you with most of
4872 Xthe policy defaults.
4876 Xif $test -f config.msg; then
4877 X echo "Hmm. I also noted the following information while running:"
4879 X $cat config.msg >&4
4882 X$rm -f kit*isdone ark*isdone
4888 if test 106597 -ne `wc -c <'Configure'`; then
4889 echo shar: \"'Configure'\" unpacked with wrong size!
4891 chmod +x 'Configure'
4892 # end of 'Configure'
4894 echo shar: End of archive 3 \(of 3\).
4895 cp /dev/null ark3isdone
4898 if test ! -f ark${I}isdone ; then
4899 MISSING="${MISSING} ${I}"
4902 if test "${MISSING}" = "" ; then
4903 echo You have unpacked all 3 archives.
4904 rm -f ark[1-9]isdone
4906 echo You still need to unpack the following archives:
4909 ## End of shell archive.