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, I would
7 # suggest you cut out the prototypical config.h from the end of Configure
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 # $Header: Configure,v 2.0.1.1 88/06/28 16:24:02 root Exp $
13 # Yes, you may rip this off to use in other distribution packages.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.)
18 PATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin'
19 export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)
22 echo "Say 'sh Configure', not 'sh <Configure'"
26 (alias) >/dev/null 2>&1 && \
27 echo "(I see you are using the Korn shell. Some ksh's blow up on Configure," && \
28 echo "especially on exotic machines. If yours does, try the Bourne shell instead.)"
30 if test ! -d ../UU; then
38 -d) shift; fastread='yes';;
132 echo "Beginning of configuration questions for $package kit."
133 : Eunice requires " " instead of "", can you believe it
138 libpth='/usr/lib /usr/local/lib /lib'
139 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
140 rmlist='kit[1-9]isdone kit[1-9][0-9]isdone'
141 trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3
143 : We must find out about Eunice early
145 if test -f /etc/unixtovms; then
146 eunicefix=/etc/unixtovms
148 if test -f /etc/unixtovms.exe; then
149 eunicefix=/etc/unixtovms.exe
152 attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
153 attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
154 attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
155 attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"
156 attrlist="$attrlist $mc68k __STDC__"
157 pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib /lib"
158 d_newshome="../../NeWS"
161 : some greps do not return status, grrr.
162 echo "grimblepritz" >grimble
163 if grep blurfldyick grimble >/dev/null 2>&1 ; then
165 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
171 : the following should work in any shell
175 echo "AGH! Grep doesn't return a status. Attempting remedial action."
176 cat >contains <<'EOSS'
177 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
182 : first determine how to suppress newline on echo command
183 echo "Checking echo to see how to suppress newlines..."
184 (echo "hi there\c" ; echo " ") >.echotmp
185 if $contains c .echotmp >/dev/null 2>&1 ; then
196 echo $n "Type carriage return to continue. Your cursor should be here-->$c"
200 : now set up to do reads with possible shell escape and default assignment
203 yes) ans=''; echo " " ;;
206 while expr "X\$ans" : "X!" >/dev/null; do
215 set \`expr "X\$ans" : "X!\(.*\)\$"\`
228 : general instructions
231 This installation shell script will examine your system and ask you questions
232 to determine how the $package package should be installed. If you get stuck
233 on a question, you may use a ! shell escape to start a subshell or execute
234 a command. Many of the questions will have default answers in square
235 brackets--typing carriage return will give you the default.
237 On some of the questions which ask for file or directory names you are
238 allowed to use the ~name construct to specify the login directory belonging
239 to "name", even if you don't have a shell which knows about that. Questions
240 where this is allowed will be marked "(~name ok)".
243 rp="[Type carriage return to continue]"
248 Much effort has been expended to ensure that this shell script will run
249 on any Unix system. If despite that it blows up on you, your best bet is
250 to edit Configure and run it again. Also, let me (lwall@jpl-devvax.jpl.nasa.gov)
251 know how I blew it. If you can't run Configure for some reason, you'll have
252 to generate a config.sh file by hand.
254 This installation script affects things in two ways: 1) it may do direct
255 variable substitutions on some of the files included in this kit, and
256 2) it builds a config.h file for inclusion in C programs. You may edit
257 any of these files as the need arises after running this script.
259 If you make a mistake on a question, there is no easy way to back up to it
260 currently. The easiest thing to do is to edit config.sh and rerun all the
261 SH files. Configure will offer to let you do this before it runs the SH files.
264 rp="[Type carriage return to continue]"
268 : get old answers, if there is a config file out there
269 if test -f ../config.sh; then
272 rp="I see a config.sh file. Did Configure make it on THIS system? [$dflt]"
276 n*) echo "OK, I'll ignore it.";;
277 *) echo "Fetching default answers from your old config.sh file..."
287 : find out where common programs are
289 echo "Locating common programs..."
302 if test -d \$dir/\$thing; then
308 if test -f \$dir/\$thing; then
311 elif test -f \$dir/\$thing.exe; then
312 : on Eunice apparently
344 for file in $loclist; do
345 xxx=`loc $file $file $pth`
350 echo $file is in $xxx.
353 echo "I don't know where $file is. I hope it's in everyone's PATH."
358 echo "Don't worry if any of the following aren't found..."
360 for file in $trylist; do
361 xxx=`loc $file $file $pth`
366 echo $file is in $xxx.
369 echo "I don't see $file out there, $ans."
376 echo "Substituting grep for egrep."
382 echo "Hopefully test is built into your sh."
387 rp="Is your "'"'"test"'"'" built into sh? [$dflt] (OK to guess)"
400 echo "Hopefully echo is built into your sh."
404 echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
405 $echo $n "hi there$c" >foo1
406 echo $n "hi there$c" >foo2
407 if cmp foo1 foo2 >/dev/null 2>&1; then
408 echo "They are compatible. In fact, they may be identical."
411 '-n') n='' c='\c' ans='\c' ;;
412 *) n='-n' c='' ans='-n' ;;
415 They are not compatible! You are probably running ksh on a non-USG system.
416 I'll have to use /bin/echo instead of the builtin, since Bourne shell doesn't
417 have echo built in and we may have to run some Bourne shell scripts. That
418 means I'll have to use $ans to suppress newlines now. Life is ridiculous.
421 rp="Your cursor should be here-->"
434 : get list of predefined functions in a handy place
436 if test -f /lib/libc.a; then
437 echo "Your C library is in /lib/libc.a. You're normal."
440 ans=`loc libc.a blurfl/dyick $libpth`
441 if test ! -f $ans; then
442 ans=`loc clib blurfl/dyick $libpth`
444 if test ! -f $ans; then
445 ans=`loc libc blurfl/dyick $libpth`
447 if test -f $ans; then
448 echo "Your C library is in $ans, of all places."
451 if test -f "$libc"; then
452 echo "Your C library is in $libc, like you said before."
456 I can't seem to find your C library. I've looked in the following places:
460 None of these seems to contain your C library. What is the full name
463 $echo $n "of your C library? $c"
464 rp='C library full name?'
471 $echo $n "Extracting names from $libc for later perusal...$c"
472 nm $libc 2>/dev/null | sed -n -e 's/^.* T _//p' -e 's/^.* T //p' > libc.list
473 if $contains '^printf$' libc.list >/dev/null 2>&1; then
476 nm $libc 2>/dev/null | sed -n -e 's/^.* D _//p' -e 's/^.* D //p' > libc.list
477 if $contains '^printf$' libc.list >/dev/null 2>&1; then
481 echo "nm didn't seem to work right."
482 echo "Trying ar instead..."
483 rmlist="$rmlist libc.tmp"
484 if ar t $libc > libc.tmp; then
485 sed -e 's/\.o$//' < libc.tmp > libc.list
488 echo "ar didn't seem to work right."
489 echo "Maybe this is a Cray...trying bld instead..."
490 if bld t $libc | sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
493 echo "That didn't work either. Giving up."
499 rmlist="$rmlist libc.list"
501 : make some quick guesses about what we are up against
504 if $contains SIGTSTP /usr/include/signal.h >/dev/null 2>&1 ; then
505 echo "Looks kind of like a BSD system, but we'll see..."
509 elif $contains '^fcntl$' libc.list >/dev/null 2>&1 ; then
510 echo "Looks kind of like a USG system, but we'll see..."
515 echo "Looks kind of like a version 7 system, but we'll see..."
520 if $contains '^vmssystem$' libc.list >/dev/null 2>&1 ; then
522 There is, however, a strange, musty smell in the air that reminds me of
523 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
525 echo "exit 0" >eunice
528 : it so happens the Eunice I know will not run shell scripts in Unix format
531 echo "Congratulations. You aren't running Eunice."
534 echo "exit 1" >eunice
536 if test -f /xenix; then
537 echo "Actually, this looks more like a XENIX system..."
541 echo "It's not Xenix..."
546 if test -f /venix; then
547 echo "Actually, this looks more like a VENIX system..."
554 echo "Nor is it Venix..."
558 chmod +x bsd usg v7 eunice venix
559 $eunicefix bsd usg v7 eunice venix
560 rmlist="$rmlist bsd usg v7 eunice venix xenix"
562 : see if sh knows # comments
564 echo "Checking your sh to see if it knows about # comments..."
565 if sh -c '#' >/dev/null 2>&1 ; then
566 echo "Your sh handles # comments correctly."
570 echo "Okay, let's see if #! works on this system..."
571 echo "#!/bin/echo hi" > try
575 if $contains hi today >/dev/null 2>&1; then
579 echo "#! /bin/echo hi" > try
583 if test -s today; then
592 echo "Your sh doesn't grok # comments--I will strip them later on."
594 echo "exec grep -v '^#'" >spitshell
597 spitshell=`pwd`/spitshell
598 echo "I presume that if # doesn't work, #! won't work either!"
602 : figure out how to guarantee sh startup
604 echo "Checking out how to guarantee sh startup..."
605 startsh=$sharpbang'/bin/sh'
606 echo "Let's see if '$startsh' works..."
618 echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
622 : see how we invoke the C preprocessor
624 echo "Now, how can we feed standard input to your C preprocessor..."
625 cat <<'EOT' >testcpp.c
630 echo 'Maybe "'$cpp'" will work...'
631 $cpp <testcpp.c >testcpp.out 2>&1
632 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
637 echo 'Nope, maybe "'$cpp' -" will work...'
638 $cpp - <testcpp.c >testcpp.out 2>&1
639 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
644 echo 'No such luck...maybe "cc -E" will work...'
645 cc -E <testcpp.c >testcpp.out 2>&1
646 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
651 echo 'Nixed again...maybe "cc -E -" will work...'
652 cc -E - <testcpp.c >testcpp.out 2>&1
653 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
654 echo "Hooray, it works! I was beginning to wonder."
658 echo 'Nope...maybe "cc -P" will work...'
659 cc -P <testcpp.c >testcpp.out 2>&1
660 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
661 echo "Yup, that does."
665 echo 'Nope...maybe "cc -P -" will work...'
666 cc -P - <testcpp.c >testcpp.out 2>&1
667 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
668 echo "Yup, that does."
672 echo 'Hmm...perhaps you already told me...'
675 *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
677 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
678 echo "Hooray, you did! I was beginning to wonder."
680 echo 'Uh-uh. Time to get fancy...'
681 echo 'Trying (cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)'
682 cppstdin='(cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)'
684 $cppstdin <testcpp.c >testcpp.out 2>&1
685 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
689 $echo $n "No dice. I can't find a C preprocessor. Name one: $c"
690 rp='Name a C preprocessor:'
693 $cppstdin <testcpp.c >testcpp.out 2>&1
694 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
695 echo "OK, that will do."
697 echo "Sorry, I can't get that to work. Go find one."
708 rm -f testcpp.c testcpp.out
710 : see if bcopy exists
712 if $contains '^bcopy$' libc.list >/dev/null 2>&1; then
713 echo 'bcopy() found.'
716 echo 'bcopy() not found.'
720 : see if sprintf is declared as int or pointer to char
722 cat >.ucbsprf.c <<'EOF'
723 main() { char buf[10]; exit((unsigned long)sprintf(buf,"%s","foo") > 10L); }
725 if cc .ucbsprf.c -o .ucbsprf >/dev/null 2>&1 && .ucbsprf; then
726 echo "Your sprintf() returns (int)."
729 echo "Your sprintf() returns (char*)."
732 /bin/rm -f .ucbsprf.c .ucbsprf
734 : see if crypt exists
736 if $contains '^crypt$' libc.list >/dev/null 2>&1; then
737 echo 'crypt() found.'
740 echo 'crypt() not found.'
744 : now see if they want to do setuid emulation
757 Some sites have disabled setuid #! scripts because of a bug in the kernel
758 that prevents them from being secure. If you are on such a system, the
759 setuid/setgid bits on scripts are currently useless. It is possible for
760 $package to detect those bits and emulate setuid/setgid in a secure fashion
761 until a better solution is devised for the kernel problem.
764 rp="Do you want to do setuid/setgid emulation? [$dflt]"
771 y*) d_dosuid="$define";;
772 *) d_dosuid="$undef";;
775 : see if fchmod exists
777 if $contains '^fchmod$' libc.list >/dev/null 2>&1; then
778 echo 'fchmod() found.'
781 echo 'fchmod() not found.'
785 : see if fchown exists
787 if $contains '^fchown$' libc.list >/dev/null 2>&1; then
788 echo 'fchown() found.'
791 echo 'fchown() not found.'
795 : see if getgroups exists
797 if $contains '^getgroups$' libc.list >/dev/null 2>&1; then
798 echo 'getgroups() found.'
801 echo 'getgroups() not found.'
811 if $contains '^index$' libc.list >/dev/null 2>&1 ; then
812 if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
813 echo "Your system has both index() and strchr(). Shall I use"
814 rp="index() rather than strchr()? [$dflt]"
818 n*) d_index="$define" ;;
819 *) d_index="$undef" ;;
823 echo "index() found."
826 if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
828 echo "strchr() found."
830 echo "No index() or strchr() found!"
835 : see if killpg exists
837 if $contains '^killpg$' libc.list >/dev/null 2>&1; then
838 echo 'killpg() found.'
841 echo 'killpg() not found.'
845 : see if memcpy exists
847 if $contains '^memcpy$' libc.list >/dev/null 2>&1; then
848 echo 'memcpy() found.'
851 echo 'memcpy() not found.'
855 : see if rename exists
857 if $contains '^rename$' libc.list >/dev/null 2>&1; then
858 echo 'rename() found.'
861 echo 'rename() not found.'
865 : see if setegid exists
867 if $contains '^setegid$' libc.list >/dev/null 2>&1; then
868 echo 'setegid() found.'
871 echo 'setegid() not found.'
875 : see if seteuid exists
877 if $contains '^seteuid$' libc.list >/dev/null 2>&1; then
878 echo 'seteuid() found.'
881 echo 'seteuid() not found.'
885 : see if setrgid exists
887 if $contains '^setrgid$' libc.list >/dev/null 2>&1; then
888 echo 'setrgid() found.'
891 echo 'setrgid() not found.'
895 : see if setruid exists
897 if $contains '^setruid$' libc.list >/dev/null 2>&1; then
898 echo 'setruid() found.'
901 echo 'setruid() not found.'
905 : see if stat knows about block sizes
907 if $contains 'st_blocks;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then
908 if $contains 'st_blksize;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then
909 echo "Your stat knows about block sizes."
912 echo "Your stat doesn't know about block sizes."
916 echo "Your stat doesn't know about block sizes."
920 : see if stdio is really std
922 if $contains 'char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then
923 if $contains '_cnt;' /usr/include/stdio.h >/dev/null 2>&1 ; then
924 echo "Your stdio is pretty std."
927 echo "Your stdio isn't very std."
931 echo "Your stdio isn't very std."
935 : see if strcspn exists
937 if $contains '^strcspn$' libc.list >/dev/null 2>&1; then
938 echo 'strcspn() found.'
941 echo 'strcspn() not found.'
945 : check for structure copying
947 echo "Checking to see if your C compiler can copy structs..."
958 if cc -c try.c >/dev/null 2>&1 ; then
963 echo "Nope, it can't."
967 : see if symlink exists
969 if $contains '^symlink$' libc.list >/dev/null 2>&1; then
970 echo 'symlink() found.'
973 echo 'symlink() not found.'
977 : see if struct tm is defined in sys/time.h
979 if $contains 'struct tm' /usr/include/time.h >/dev/null 2>&1 ; then
980 echo "You have struct tm defined in <time.h> rather than <sys/time.h>."
983 echo "You have struct tm defined in <sys/time.h> rather than <time.h>."
987 : see if there is a vfork
989 if $contains '^vfork$' libc.list >/dev/null 2>&1 ; then
990 echo "vfork() found."
993 echo "No vfork() found--will use fork() instead."
997 : see if signal is declared as pointer to function returning int or void
999 if $contains 'void.*signal' /usr/include/signal.h >/dev/null 2>&1 ; then
1000 echo "You have void (*signal())() instead of int."
1003 echo "You have int (*signal())() instead of void."
1007 : check for void type
1010 Checking to see how well your C compiler groks the void type...
1012 Support flag bits are:
1013 1: basic void declarations.
1014 2: arrays of pointers to functions returning void.
1015 4: operations between pointers to and addresses of void functions.
1018 case "$voidflags" in
1020 $cat >try.c <<'EOCP'
1040 if cc -S -DTRY=7 try.c >.out 2>&1 ; then
1042 echo "It appears to support void fully."
1043 if $contains warning .out >/dev/null 2>&1; then
1044 echo "However, you might get some warnings that look like this:"
1048 echo "Hmm, you compiler has some difficulty with void. Checking further..."
1049 if cc -S -DTRY=1 try.c >/dev/null 2>&1 ; then
1050 echo "It supports 1..."
1051 if cc -S -DTRY=3 try.c >/dev/null 2>&1 ; then
1053 echo "And it supports 2 but not 4."
1055 echo "It doesn't support 2..."
1056 if cc -S -DTRY=3 try.c >/dev/null 2>&1 ; then
1058 echo "But it supports 4."
1061 echo "And it doesn't support 4."
1065 echo "There is no support at all for void."
1071 rp="Your void support flags add up to what? [$dflt]"
1077 : see what type gids are declared as in the kernel
1080 if $contains 'gid_t;' /usr/include/sys/types.h >/dev/null 2>&1 ; then
1083 set `grep 'groups\[NGROUPS\];' /usr/include/sys/user.h 2>/dev/null` unsigned short
1085 unsigned) dflt="$1 $2" ;;
1095 rp="What type are group ids on this system declared as? [$dflt]"
1100 : set up shell script to do ~ expansion
1106 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
1109 if $test -f /bin/csh; then
1110 /bin/csh -f -c "glob \$1"
1113 name=\`$expr x\$1 : '..\([^/]*\)'\`
1114 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
1115 if $test ! -d "\$dir"; then
1117 echo "\$me: can't locate home directory for: \$name" >&2
1122 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
1138 : determine where private executables go
1142 test -d /usr/local/lib && dflt=/usr/local/lib/perl
1149 The perl package has some perl subroutine libraries that should be put in
1150 a directory that is accessible by everyone. Where do you want to put these
1152 $echo $n "libraries? [$dflt] $c"
1153 rp="Put perl libraries where? [$dflt]"
1155 privlib=`filexp $ans`
1157 : see what type of char stdio uses.
1159 if $contains 'unsigned.*char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then
1160 echo "Your stdio uses unsigned chars."
1161 stdchar="unsigned char"
1163 echo "Your stdio uses signed chars."
1167 : see what type uids are declared as in the kernel
1170 if $contains 'uid_t;' /usr/include/sys/types.h >/dev/null 2>&1 ; then
1173 set `grep '_ruid;' /usr/include/sys/user.h 2>/dev/null` unsigned short
1175 unsigned) dflt="$1 $2" ;;
1185 rp="What type are user ids on this system declared as? [$dflt]"
1190 : preserve RCS keywords in files with variable substitution, grrr
1194 : determine where public executables go
1197 dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
1203 while $test "$cont" ; do
1205 rp="Where do you want to put the public executables? [$dflt]"
1210 if test -d $bin; then
1214 rp="Directory $bin doesn't exist. Use that name anyway? [$dflt]"
1224 : determine where manual pages go
1227 dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/local/man1 /usr/man/u_man/man1 /usr/man/man1`
1233 while $test "$cont" ; do
1235 rp="Where do the manual pages (source) go? [$dflt]"
1238 mansrc=`filexp "$ans"`
1239 if test -d $mansrc; then
1243 rp="Directory $mansrc doesn't exist. Use that name anyway? [$dflt]"
1267 : get C preprocessor symbols handy
1269 echo $attrlist | $tr '[ - ]' '[\012-\012]' >Cppsym.know
1281 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
1283 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
1286 unknown="\$unknown \$sym"
1296 echo \$* | $tr '[ - ]' '[\012-\012]' | $sed -e 's/\(.*\)/\\
1298 exit 0; _ _ _ _\1\\ \1\\
1301 echo exit 1 >>/tmp/Cppsym\$\$
1302 $cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
1304 true) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
1310 $rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
1315 echo "Your C preprocessor defines the following symbols:"
1316 Cppsym -l $attrlist >Cppsym.true
1318 rmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
1320 : see what memory models we can support
1323 if Cppsym pdp11; then
1324 dflt='unsplit split'
1326 ans=`loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
1329 *) if $test -d /lib/small || $test -d /usr/lib/small; then
1334 if $test -d /lib/medium || $test -d /usr/lib/medium; then
1337 if $test -d /lib/large || $test -d /usr/lib/large; then
1340 if $test -d /lib/huge || $test -d /usr/lib/huge; then
1346 *) dflt="$models" ;;
1350 Some systems have different model sizes. On most systems they are called
1351 small, medium, large, and huge. On the PDP11 they are called unsplit and
1352 split. If your system doesn't support different memory models, say "none".
1353 If you wish to force everything to one memory model, say "none" here and
1354 put the appropriate flags later when it asks you for other cc and ld flags.
1355 Venix systems may wish to put "none" and let the compiler figure things out.
1356 (In the following question multiple model names should be space separated.)
1359 rp="Which models are supported? [$dflt]"
1376 if $contains '\-i' $mansrc/ld.1 >/dev/null 2>&1 || \
1377 $contains '\-i' $mansrc/cc.1 >/dev/null 2>&1; then
1385 rp="What flag indicates separate I and D space? [$dflt]"
1394 *large*|*small*|*medium*|*huge*)
1401 rp="What flag indicates large model? [$dflt]"
1417 rp="What flag indicates huge model? [$dflt]"
1433 rp="What flag indicates medium model? [$dflt]"
1441 *) medium="$large";;
1449 rp="What flag indicates small model? [$dflt]"
1461 echo "Unrecognized memory models--you may have to edit Makefile.SH"
1467 *) dflt="$ccflags";;
1470 rp="Any additional cc flags? [$dflt]"
1485 *) dflt="$ldflags";;
1488 rp="Any additional ld flags? [$dflt]"
1496 : see if we need a special compiler
1510 if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
1524 On some systems the default C compiler will not resolve multiple global
1525 references that happen to have the same name. On some such systems the
1526 "Mcc" command may be used to force these to be resolved. On other systems
1527 a "cc -M" command is required. (Note that the -M flag on other systems
1528 indicates a memory model to use!) What command will force resolution on
1530 $echo $n "this system? [$dflt] $c"
1531 rp="Command to resolve multiple refs? [$dflt]"
1535 echo "Not a USG system--assuming cc can resolve multiple definitions."
1539 : see if we should include -lnm
1541 if $test -r /usr/lib/libnm.a || $test -r /usr/local/lib/libnm.a ; then
1542 echo "New math library found."
1545 ans=`loc libnm.a x $libpth`
1548 echo "No nm library found--the normal math library will have to do."
1552 echo "New math library found in $ans."
1558 : determine which malloc to compile in
1560 case "$usemymalloc" in
1568 *) dflt="$usemymalloc"
1571 rp="Do you wish to attempt to use the malloc that comes with $package? [$dflt]"
1579 y*) mallocsrc='malloc.c'; mallocobj='malloc.o';;
1580 *) mallocsrc=''; mallocobj='';;
1584 echo "End of configuration questions."
1587 : create config.sh file
1589 if test -d ../UU; then
1592 echo "Creating config.sh..."
1593 $spitshell <<EOT >config.sh
1596 # This file was produced by running the Configure script.
1598 d_eunice='$d_eunice'
1599 eunicefix='$eunicefix'
1630 contains='$contains'
1631 cppstdin='$cppstdin'
1632 cppminus='$cppminus'
1634 d_charsprf='$d_charsprf'
1636 d_dosuid='$d_dosuid'
1637 d_fchmod='$d_fchmod'
1638 d_fchown='$d_fchown'
1639 d_getgrps='$d_getgrps'
1641 d_killpg='$d_killpg'
1642 d_memcpy='$d_memcpy'
1643 d_rename='$d_rename'
1644 d_setegid='$d_setegid'
1645 d_seteuid='$d_seteuid'
1646 d_setrgid='$d_setrgid'
1647 d_setruid='$d_setruid'
1648 d_statblks='$d_statblks'
1649 d_stdstdio='$d_stdstdio'
1650 d_strcspn='$d_strcspn'
1651 d_strctcpy='$d_strctcpy'
1652 d_symlink='$d_symlink'
1653 d_tminsys='$d_tminsys'
1655 d_voidsig='$d_voidsig'
1659 mallocsrc='$mallocsrc'
1660 mallocobj='$mallocobj'
1661 usemymalloc='$usemymalloc'
1675 spitshell='$spitshell'
1677 sharpbang='$sharpbang'
1681 voidflags='$voidflags'
1682 defvoidused='$defvoidused'
1692 echo "If you didn't make any mistakes, then just type a carriage return here."
1693 rp="If you need to edit config.sh, do it as a shell escape here:"
1698 *) : in case they cannot read
1704 echo "Doing variable substitutions on .SH files..."
1705 set x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
1708 0) set x *.SH; shift;;
1710 if test ! -f $1; then
1716 dir=`$expr X$file : 'X\(.*\)/'`
1717 file=`$expr X$file : 'X.*/\(.*\)'`
1718 (cd $dir && . $file)
1725 if test -f config.h.SH; then
1726 if test ! -f config.h; then
1727 : oops, they left it out of MANIFEST, probably, so do it anyway.
1732 if $contains '^depend:' Makefile >/dev/null 2>&1; then
1736 Now you need to generate make dependencies by running "make depend".
1737 You might prefer to run it in background: "make depend > makedepend.out &"
1738 It can take a while, so you might not want to run it right now.
1741 rp="Run make depend now? [$dflt]"
1746 echo "Now you must run a make."
1748 *) echo "You must run 'make depend' then 'make'."
1751 elif test -f Makefile; then
1753 echo "Now you must run a make."
1759 : the following is currently useless
1760 cd UU && $rm -f $rmlist
1761 : since this removes it all anyway