[PATCH app-xfs 4/4] Using the C preprocessor to generate "config" is no longer needed.

Alan Coopersmith alan.coopersmith at oracle.com
Thu Aug 5 12:58:22 PDT 2010


Gaetan Nadon wrote:
> Reuse and adapt the man makefile using sed in a seperate directory
> Replace XCOMM IMakefile comment with #
> 
> Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
> ---
>  .gitignore         |    1 -
>  Makefile.am        |   49 ++-----------------------------------------------
>  config.cpp         |   10 ----------
>  config/.gitignore  |    1 +
>  config/Makefile.am |   37 +++++++++++++++++++++++++++++++++++++
>  config/config.cpp  |   10 ++++++++++
>  configure.ac       |    2 +-
>  7 files changed, 51 insertions(+), 59 deletions(-)
>  delete mode 100644 config.cpp
>  create mode 100644 config/.gitignore
>  create mode 100644 config/Makefile.am
>  create mode 100644 config/config.cpp
> 
> diff --git a/.gitignore b/.gitignore
> index fa2721d..f18a5d9 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -76,7 +76,6 @@ core
>  #		Edit the following section as needed
>  # For example, !report.pc overrides *.pc. See 'man gitignore'
>  # 
> -config
>  xfs
>  xfs-config.h
>  xfs-config.h.in
> diff --git a/Makefile.am b/Makefile.am
> index c54396b..b092079 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -19,9 +19,7 @@
>  #  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
>  #  PERFORMANCE OF THIS SOFTWARE.
>  
> -SUBDIRS=doc man
> -
> -configdir = $(sysconfdir)/X11/fs
> +SUBDIRS=config doc man
>  
>  bin_PROGRAMS = xfs
>  
> @@ -94,51 +92,8 @@ xfs_SOURCES = \
>  	include/swaprep.h \
>  	include/swapreq.h
>  
> -FSERRORS = /var/log/xfs.log
> -
> -# Strings to replace in config.cpp
> -CPP_FILES_FLAGS = $(MANDEFS) \
> -	-DDEFAULTFONTPATH="$(FONTPATH)" -DFSERRORS="$(FSERRORS)"
> -
> -config_DATA = config
> -
> -EXTRA_DIST = xfs.def config.cpp
> +EXTRA_DIST = xfs.def
>  MAINTAINERCLEANFILES = ChangeLog INSTALL
> -CLEANFILES = config
> -
> -# 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 '/XSLASHGLOB/s/XSLASHGLOB/\/\*/' \
> -                       -e '/\@\@$$/s/\@\@$$/\\/'
> -
> -# Strings to replace in man pages
> -XORGRELSTRING = @PACKAGE_STRING@
> -  XORGMANNAME = X Version 11
> -
> -MANDEFS =  \
> -	-D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
> -	-D__appmansuffix__=$(APP_MAN_SUFFIX) \
> -	-D__libmansuffix__=$(LIB_MAN_SUFFIX) \
> -	-D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \
> -	-D__miscmansuffix__=$(MISC_MAN_SUFFIX) \
> -	-D__filemansuffix__=$(FILE_MAN_SUFFIX) \
> -	-D__configfiledesc__="$(CONFIG_FILE_DESC)" \
> -	-D__configfilepath__="$(CONFIG_FILE_PATH)"
> -
> -SUFFIXES = .cpp
> -
> -.cpp:
> -	$(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
>  
>  .PHONY: ChangeLog INSTALL
>  
> diff --git a/config.cpp b/config.cpp
> deleted file mode 100644
> index cc858b3..0000000
> --- a/config.cpp
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -XCOMM X font server configuration file
> -XCOMM See xfs(__appmansuffix__) man page for more information.
> -
> -clone-self = on
> -use-syslog = off
> -catalogue = DEFAULTFONTPATH
> -error-file = FSERRORS
> -XCOMM in decipoints
> -default-point-size = 120
> -default-resolutions = 75,75,100,100
> diff --git a/config/.gitignore b/config/.gitignore
> new file mode 100644
> index 0000000..04204c7
> --- /dev/null
> +++ b/config/.gitignore
> @@ -0,0 +1 @@
> +config
> diff --git a/config/Makefile.am b/config/Makefile.am
> new file mode 100644
> index 0000000..70bb896
> --- /dev/null
> +++ b/config/Makefile.am
> @@ -0,0 +1,37 @@
> +#
> +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
> +#
> +# Permission is hereby granted, free of charge, to any person obtaining a
> +# copy of this software and associated documentation files (the "Software"),
> +# to deal in the Software without restriction, including without limitation
> +# the rights to use, copy, modify, merge, publish, distribute, sublicense,
> +# and/or sell copies of the Software, and to permit persons to whom the
> +# Software is furnished to do so, subject to the following conditions:
> +#
> +# The above copyright notice and this permission notice (including the next
> +# paragraph) shall be included in all copies or substantial portions of the
> +# Software.
> +#
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> +# DEALINGS IN THE SOFTWARE.
> +#
> +
> +configdir = $(sysconfdir)/X11/fs
> +config_DATA = config
> +
> +EXTRA_DIST = config.cpp
> +
> +CLEANFILES = config
> +
> +# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
> +MAN_SUBSTS += -e 's|DEFAULTFONTPATH|$(FONTPATH)|g'
> +MAN_SUBSTS += -e 's|FSERRORS|/var/log/xfs.log|g'
> +
> +config: config.cpp
> +	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
> +
> diff --git a/config/config.cpp b/config/config.cpp
> new file mode 100644
> index 0000000..66cf56a
> --- /dev/null
> +++ b/config/config.cpp
> @@ -0,0 +1,10 @@
> +# X font server configuration file
> +# See xfs(__appmansuffix__) man page for more information.
> +
> +clone-self = on
> +use-syslog = off
> +catalogue = DEFAULTFONTPATH
> +error-file = FSERRORS
> +# in decipoints
> +default-point-size = 120
> +default-resolutions = 75,75,100,100
> diff --git a/configure.ac b/configure.ac
> index 1a082ba..fb42e44 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -50,7 +50,6 @@ XORG_ENABLE_DEVEL_DOCS
>  XORG_WITH_XMLTO(0.0.20)
>  XORG_WITH_FOP
>  XORG_CHECK_SGML_DOCTOOLS(1.5)
> -XORG_PROG_RAWCPP
>  XORG_WITH_LINT
>  
>  AC_CHECK_HEADERS([stdint.h])
> @@ -133,6 +132,7 @@ AC_SUBST(XFS_LIBS)
>  XTRANS_CONNECTION_FLAGS
>  
>  AC_CONFIG_FILES([Makefile
> +                 config/Makefile
>                   doc/Makefile
>                   man/Makefile])
>  AC_OUTPUT

Not sure why you put Oracle's copyright on a file you created, but the code
changes look fine to me.

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list