path: root/mcon/U/usrinc.U
diff options
authorManoj Srivastava <>2014-04-27 18:05:39 -0700
committerManoj Srivastava <>2014-04-27 18:05:39 -0700
commit7d4c02d5c9108aa413fbb0ffa1dc8a39bc5f54a1 (patch)
tree2abb9ad01d397bc1e208f57f528c1ec529761392 /mcon/U/usrinc.U
parent5c913c35c09a82eead2c07534baa709a5dead3e7 (diff)
parent8f5e5726134ce5b4bd436b16f367796d851df553 (diff)
Merge branch 'upstream'
Signed-off-by: Manoj Srivastava <> Conflicts: jmake/
Diffstat (limited to 'mcon/U/usrinc.U')
1 files changed, 22 insertions, 61 deletions
diff --git a/mcon/U/usrinc.U b/mcon/U/usrinc.U
index a599cca..157e25c 100644
--- a/mcon/U/usrinc.U
+++ b/mcon/U/usrinc.U
@@ -1,11 +1,11 @@
-?RCS: $Id: usrinc.U 1 2006-08-24 12:32:52Z rmanfredi $
+?RCS: $Id: usrinc.U 167 2013-05-08 17:58:00Z rmanfredi $
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
-?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
-?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS: $Log: usrinc.U,v $
@@ -16,78 +16,39 @@
?RCS: patch54: ensure that ./mips always exists (ADO)
?RCS: Revision 1994/05/06 15:18:31 ram
-?RCS: patch23: ensure usrinc value is preserved accross sessions (WED)
+?RCS: patch23: ensure usrinc value is preserved across sessions (WED)
?RCS: Revision 3.0 1993/08/18 12:09:58 ram
?RCS: Baseline for dist 3.0 netwide release.
-?MAKE:usrinc incpath mips_type: test cat echo n c Getfile Guess \
- Oldconfig eunicefix contains rm
+?MAKE:usrinc: Getfile Oldconfig incpath
?MAKE: -pick add $@ %<
?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: 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: This variable holds the environment type for the mips system.
-?S: Possible values are "BSD 4.3" and "System V".
-?LINT:create mips
: What should the include directory be ?
echo " "
-$echo $n "Hmm... $c"
-?X: mips_type is used later, to add -DSYSTYPE_BSD43 to cppflags if needed.
-?X: Cannot put the following in Guess, or we get a circular dependency.
-if $test -f /bin/mips && /bin/mips; then
- echo "Looks like a MIPS system..."
- $cat >usr.c <<'EOCP'
-#ifdef SYSTYPE_BSD43
- 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
- echo "Doesn't look like a MIPS system."
- xxx_prompt=n
- echo "exit 1" >mips
-chmod +x mips
-$eunicefix mips
case "$usrinc" in
-'') ;;
+'') dflt="$incpath/usr/include";;
+?X: This is nice, but it does not work on some systems because gcc redirects
+?X: the include to things like ..../gcc45/gcc/4.5.2/include-fixed/stdio.h
+?X: and it does not contain all the files.
+?X: $cat >usr.c <<EOC
+?X: #include <stdio.h>
+?X: dflt=`$cppstdin $cppminus < usr.c 2>/dev/null | \
+?X: $grep "^[ ]*#.*stdio.h" | $tr -d '"' | \
+?X: $sed -ne "1s,\(.*\)[/\\]stdio.h.*,\1,p" | \
+?X: $awk "{ print \\$$fieldn }"`
+?X: ;;
*) dflt="$usrinc";;
-case "$xxx_prompt" in
-y) fn=d/
- echo " "
- rp='Where are the include files you want to use?'
- . ./getfile
- usrinc="$ans"
- ;;
-*) usrinc="$dflt"
- ;;
+rp='Where are the include files you want to use?'
+. ./getfile