diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-06-04 21:36:36 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-06-05 10:14:41 -0700 |
commit | 855a9cb40ca734e1c99c3a1032630281d99572d1 (patch) | |
tree | c0874bea33b382f8f869b0a38630675ba871023a | |
parent | 7abbe73c0ead0f335f2e39a486ac3004b8c30b08 (diff) |
Use autoconf instead of XORG_RAWCPP to substitute text in gccmakedep
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
-rw-r--r-- | Makefile.am | 24 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | cpprules.in | 26 | ||||
-rw-r--r-- | gccmakedep.in (renamed from gccmdep.cpp) | 34 |
4 files changed, 22 insertions, 66 deletions
diff --git a/Makefile.am b/Makefile.am index 3854465..3cb08f3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,23 +19,7 @@ # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -gccmakedep_DATA = gccmakedep -gccmakedepdir = $(bindir) - -include cpprules.in - -DEFS = \ - -DCCCMD=$(CC)\ - -DRMCMD='"rm -f"'\ - -DLNCMD="ln"\ - -DMVCMD="mv" - -CPP_FILES_FLAGS = $(DEFS) - -gccmakedep: gccmdep - cp gccmdep gccmakedep -install-data-hook: - chmod +x $(DESTDIR)/$(bindir)/gccmakedep +bin_SCRIPTS = gccmakedep appmandir = $(APP_MAN_DIR) @@ -43,14 +27,14 @@ appman_PRE = gccmakedep.man appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) -CLEANFILES = $(appman_DATA) gccmakedep gccmdep +CLEANFILES = $(appman_DATA) -SUFFIXES += .$(APP_MAN_SUFFIX) .man +SUFFIXES = .$(APP_MAN_SUFFIX) .man .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ -EXTRA_DIST = $(appman_PRE) gccmdep.cpp +EXTRA_DIST = $(appman_PRE) MAINTAINERCLEANFILES = ChangeLog diff --git a/configure.ac b/configure.ac index 1ad21cd..b79b64d 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,5 @@ m4_ifndef([XORG_MACROS_VERSION], XORG_MACROS_VERSION(1.8) XORG_DEFAULT_OPTIONS -XORG_PROG_RAWCPP - -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile gccmakedep]) AC_OUTPUT diff --git a/cpprules.in b/cpprules.in deleted file mode 100644 index 09b7567..0000000 --- a/cpprules.in +++ /dev/null @@ -1,26 +0,0 @@ -# -*- Makefile -*- -# Rules for generating files using the C pre-processor -# (Replaces CppFileTarget from Imake) - -SED = sed - -SUFFIXES = .cpp - -WCHAR32_FLAGS = -DWCHAR32=@WCHAR32@ - -# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM -# to cpp, because that trick does not work on all ANSI C preprocessors. -# Delete line numbers from the cpp output (-P is not portable, I guess). -# Allow XCOMM to be preceded by whitespace and provide a means of generating -# output lines with trailing backslashes. -# Allow XHASH to always be substituted, even in cases where XCOMM isn't. - -CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \ - -e '/^\#line *[0-9][0-9]* *.*$$/d' \ - -e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \ - -e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \ - -e '/^[ ]*XHASH/s/XHASH/\#/' \ - -e '/\@\@$$/s/\@\@$$/\\/' - -.cpp: - $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@ diff --git a/gccmdep.cpp b/gccmakedep.in index abab70d..860d102 100644 --- a/gccmdep.cpp +++ b/gccmakedep.in @@ -1,18 +1,18 @@ -XCOMM!/bin/sh +#!/bin/sh -XCOMM -XCOMM makedepend which uses 'gcc -M' -XCOMM -XCOMM $XFree86: xc/config/util/gccmdep.cpp,v 3.10tsi Exp $ -XCOMM -XCOMM Based on mdepend.cpp and code supplied by Hongjiu Lu <hjl@nynexst.com> -XCOMM +# +# makedepend which uses 'gcc -M' +# +# $XFree86: xc/config/util/gccmdep.cpp,v 3.10tsi Exp $ +# +# Based on mdepend.cpp and code supplied by Hongjiu Lu <hjl@nynexst.com> +# TMP=mdep$$.tmp -CC=CCCMD -RM=RMCMD -LN=LNCMD -MV=MVCMD +CC="@CC@" +RM="rm -f" +LN="ln" +MV="mv" ${RM} ${TMP} @@ -32,7 +32,7 @@ while [ $# != 0 ]; do else case "$1" in -D*|-I*|-U*) -XCOMM arg may contain single quotes +# arg may contain single quotes qarg=`echo "$1" | sed "s/'/'\\\\\\\\''/g"` args="$args '$qarg'" ;; @@ -41,7 +41,7 @@ XCOMM arg may contain single quotes *) if [ "$endmarker"x = x ]; then case $1 in -XCOMM ignore these flags +# ignore these flags -w|-o|-cc) shift ;; @@ -76,7 +76,7 @@ XCOMM ignore these flags echo "Unknown option '$1' ignored" 1>&2 ;; *) -XCOMM filename may contain blanks +# filename may contain blanks files="$files '$1'" ;; esac @@ -88,7 +88,7 @@ XCOMM filename may contain blanks done if [ x"$files" = x ]; then -XCOMM Nothing to do +# Nothing to do exit 0 fi @@ -118,7 +118,7 @@ CMD="$CC -M $args $files" if [ X"$makefile" != X- ]; then CMD="$CMD >> $TMP" fi -XCOMM Do not wildcard expand '*' in args +# Do not wildcard expand '*' in args eval "$CMD" if [ X"$makefile" != X- ]; then $RM ${makefile}.bak |