summaryrefslogtreecommitdiff
path: root/mcon/U/usrinc.U
diff options
context:
space:
mode:
authorrmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d>2010-11-28 00:21:26 +0000
committerrmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d>2010-11-28 00:21:26 +0000
commitc1d13fe0f4272b18a44fff07b956d4e4d206177d (patch)
tree8578a77d28a2534257a6a485e56a5c501869bc9a /mcon/U/usrinc.U
parente1369f5a1a89361f23f54c61a9f3b4384db35c6d (diff)
Moved computation of the filename position in cpp output from Findhdr.U to
a standalone unit. Extracted MIPS system detection from usrinc.U to Mips.U. Compute default value for usrinc by parsing cpp output. Added WINDOWS_SYSTEM define for Windows. Random cleanup. git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@41 2592e710-e01b-42a5-8df0-11608a6cc53d
Diffstat (limited to 'mcon/U/usrinc.U')
-rw-r--r--mcon/U/usrinc.U73
1 files changed, 16 insertions, 57 deletions
diff --git a/mcon/U/usrinc.U b/mcon/U/usrinc.U
index 4db8078..a3c21a9 100644
--- a/mcon/U/usrinc.U
+++ b/mcon/U/usrinc.U
@@ -21,73 +21,32 @@
?RCS: Revision 3.0 1993/08/18 12:09:58 ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
-?MAKE:usrinc incpath mips_type: test cat echo n c Getfile Guess \
- Oldconfig eunicefix contains rm
+?MAKE:usrinc: cat Getfile Guess Oldconfig cppstdin cppminus \
+ fieldn grep sed awk tr
?MAKE: -pick add $@ %<
?S:usrinc:
?S: This variable holds the path of the include files, which is
?S: usually /usr/include. It is mainly used by other Configure units.
?S:.
-?S:incpath:
-?S: This variable must preceed the normal include path to get hte
-?S: right one, as in "$incpath/usr/include" or "$incpath/usr/lib".
-?S: Value can be "" or "/bsd43" on mips.
-?S:.
-?S:mips_type:
-?S: This variable holds the environment type for the mips system.
-?S: Possible values are "BSD 4.3" and "System V".
-?S:.
?D:usrinc='/usr/include'
-?LINT:create mips
-?T:xxx_prompt
-?F:./mips
+?F:!usr.c
: What should the include directory be ?
echo " "
-$echo $n "Hmm... $c"
dflt='/usr/include'
-incpath=''
-?X: mips_type is used later, to add -DSYSTYPE_BSD43 to cppflags if needed.
-mips_type=''
-?X:
-?X: Cannot put the following in Guess, or we get a circular dependency.
-?X:
-if $test -f /bin/mips && /bin/mips; then
- echo "Looks like a MIPS system..."
- $cat >usr.c <<'EOCP'
-#ifdef SYSTYPE_BSD43
-/bsd43
-#endif
-EOCP
- if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
- dflt='/bsd43/usr/include'
- incpath='/bsd43'
- mips_type='BSD 4.3'
- else
- mips_type='System V'
- fi
- $rm -f usr.c usr.out
- echo "and you're compiling with the $mips_type compiler and libraries."
- xxx_prompt=y
- echo "exit 0" >mips
-else
- echo "Doesn't look like a MIPS system."
- xxx_prompt=n
- echo "exit 1" >mips
-fi
-chmod +x mips
-$eunicefix mips
case "$usrinc" in
-'') ;;
-*) dflt="$usrinc";;
-esac
-case "$xxx_prompt" in
-y) fn=d/
- echo " "
- rp='Where are the include files you want to use?'
- . ./getfile
- usrinc="$ans"
- ;;
-*) usrinc="$dflt"
+'')
+ $cat >usr.c <<EOC
+ #include <stdio.h>
+EOC
+ dflt=`$cppstdin $cppminus < usr.c 2>/dev/null | \
+ $grep "^[ ]*#.*stdio.h" | $tr -d '"' | \
+ $sed -ne "1s,\(.*\)[/\\]stdio.h.*,\1,p" | \
+ $awk "{ print \\$$fieldn }"`
;;
+*) dflt="$usrinc";;
esac
+fn=d/
+rp='Where are the include files you want to use?'
+. ./getfile
+usrinc="$ans"