summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2004-10-30 20:33:43 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2004-10-30 20:33:43 +0000
commit36fbf892d1c2740afa51911b6f2c2e4bf8f871c0 (patch)
tree0a7ef66d2ca24be837e69b6135a717e14b20735c
parent02fa88c73e7df616e1c620996d613b56a119ea4d (diff)
Add -d flag for compilers like the Sun C compilers that produce dependency
lists themselves. To use with the Sun compilers, add to host.def: # define UseCCMakeDepend YES # define DependFlags -cc $(CC) -d -xM (Sun bug id #4245688 - fix by Alan Coopersmith) Add Solaris to the platforms on which mprotect is run to set execute permissions when necessary. (Sun bug id #6175128 - fix by Alan Coopersmith) Internationalize digital output (Sun bug id #4119396 - fix by Steve Swales), add -bgpixmap option to set XPM file as background (originally from STSF project version of xclock by Alan Coopersmith) xc/programs/xmodmap/handle.c,pf.c xmodmap was printing line numbers which are one too low in error messages (Xorg bugzilla #1739, Sun bug id 4637857 - fix by Sam Lau)
-rw-r--r--mdepend.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/mdepend.cpp b/mdepend.cpp
index 3d5a252..9354c5d 100644
--- a/mdepend.cpp
+++ b/mdepend.cpp
@@ -1,18 +1,19 @@
XCOMM!/bin/sh
XCOMM
XCOMM $Xorg: mdepend.cpp,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+XCOMM $XdotOrg: $
XCOMM
XCOMM Do the equivalent of the 'makedepend' program, but do it right.
XCOMM
XCOMM Usage:
XCOMM
XCOMM makedepend [cpp-flags] [-w width] [-s magic-string] [-f makefile]
-XCOMM [-o object-suffix]
+XCOMM [-o object-suffix] [-v] [-a] [-cc compiler] [-d dependencyflag]
XCOMM
XCOMM Notes:
XCOMM
XCOMM The C compiler used can be overridden with the environment
-XCOMM variable "CC".
+XCOMM variable "CC" or the command line flag -cc.
XCOMM
XCOMM The "-v" switch of the "makedepend" program is not supported.
XCOMM
@@ -59,6 +60,7 @@ width=78
endmarker=""
verbose=n
append=n
+compilerlistsdepends=n
while [ $# != 0 ]
do
@@ -122,6 +124,15 @@ do
shift
;;
+ # Flag to tell compiler to output dependencies directly
+ # For example, with Sun compilers, -xM or -xM1 or
+ # with gcc, -M
+ -d)
+ compilerlistsdepends="y"
+ compilerlistdependsflag="$2"
+ shift
+ ;;
+
-*)
echo "Unknown option '$1' ignored" 1>&2
;;
@@ -137,6 +148,10 @@ do
done
echo ' $*' >> $ARGS
+if [ "$compilerlistsdepends"x = "y"x ] ; then
+ CC="$CC $compilerlistdependsflag"
+fi
+
echo "#!/bin/sh" > $CPPCMD
echo "exec $CC `cat $ARGS`" >> $CPPCMD
chmod +x $CPPCMD
@@ -165,6 +180,13 @@ if [ "$verbose"x = "y"x ]; then
fi
echo '' > $DEPENDLINES
+
+if [ "$compilerlistsdepends"x = "y"x ] ; then
+ for i in $files
+ do
+ $CPPCMD $i >> $DEPENDLINES
+ done
+else
for i in $files
do
$CPPCMD $i \
@@ -211,6 +233,7 @@ done \
print rec
}' \
| egrep -v '^[^:]*:[ ]*$' >> $DEPENDLINES
+fi
trap "" 1 2 13 15 # Now we are committed
case "$makefile" in