[PATCH app-rstart 04/15] config: use sed rather than cpp to substitute directory values

Gaetan Nadon memsize at videotron.ca
Sun Jan 23 17:30:13 PST 2011


Use @rstartdir@ from autconf to obtain the $libdir/X11/rstart value.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 Makefile.am |    9 ++++-----
 rstartd.in  |   29 +++++++++++++++++++++++++++++
 server.cpp  |   29 -----------------------------
 3 files changed, 33 insertions(+), 34 deletions(-)
 create mode 100644 rstartd.in
 delete mode 100644 server.cpp

diff --git a/Makefile.am b/Makefile.am
index c867280..857430f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,12 +67,11 @@ rstart: client.cpp
 	$(AM_V_GEN) $(RAWCPP) $(RAWCPPFLAGS) -DRSHCMD=$(RSH) \
 	  < ${srcdir}/client.cpp | $(CPP_SED_MAGIC) > $@
 
-rstartd: server.cpp
-	$(AM_V_GEN) $(RAWCPP) $(RAWCPPFLAGS) \
-	  -DLIBDIR=$(rstartdir) < ${srcdir}/server.cpp | \
-	  $(CPP_SED_MAGIC) > $@
+RSTARTD_SUBSTS = -e 's|@rstartdir[@]|$(rstartdir)|g'
+rstartd: rstartd.in
+	$(AM_V_GEN)$(SED) $(RSTARTD_SUBSTS) < $< > $@
 
-EXTRA_DIST = client.cpp server.cpp config.cpp
+EXTRA_DIST = client.cpp rstartd.in config.cpp
 
 MAINTAINERCLEANFILES = ChangeLog INSTALL
 CLEANFILES = rstart rstartd config
diff --git a/rstartd.in b/rstartd.in
new file mode 100644
index 0000000..255e96c
--- /dev/null
+++ b/rstartd.in
@@ -0,0 +1,29 @@
+#! /bin/sh
+# $Xorg: server.cpp,v 1.3 2000/08/17 19:54:01 cpqbld Exp $
+#
+
+# Copyright (c) 1993 Quarterdeck Office Systems
+#
+# Permission to use, copy, modify, distribute, and sell this software
+# and software and its documentation for any purpose is hereby granted
+# without fee, provided that the above copyright notice appear in all
+# copies and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name
+# Quarterdeck Office Systems, Inc. not be used in advertising or
+# publicity pertaining to distribution of this software without
+# specific, written prior permission.
+#
+# THIS SOFTWARE IS PROVIDED "AS-IS".  QUARTERDECK OFFICE SYSTEMS,
+# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+# NONINFRINGEMENT.  IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS,
+# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL,
+# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR
+# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS
+# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT
+# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# $XFree86: xc/programs/rstart/server.cpp,v 3.2 2001/01/17 23:45:03 dawes Exp $
+
+exec @rstartdir@/rstartd.real -c @rstartdir@/config
diff --git a/server.cpp b/server.cpp
deleted file mode 100644
index dcb7bd2..0000000
--- a/server.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-XCOMM! /bin/sh
-XCOMM $Xorg: server.cpp,v 1.3 2000/08/17 19:54:01 cpqbld Exp $
-XCOMM
-
-XCOMM Copyright (c) 1993 Quarterdeck Office Systems
-XCOMM
-XCOMM Permission to use, copy, modify, distribute, and sell this software
-XCOMM and software and its documentation for any purpose is hereby granted
-XCOMM without fee, provided that the above copyright notice appear in all
-XCOMM copies and that both that copyright notice and this permission
-XCOMM notice appear in supporting documentation, and that the name
-XCOMM Quarterdeck Office Systems, Inc. not be used in advertising or
-XCOMM publicity pertaining to distribution of this software without
-XCOMM specific, written prior permission.
-XCOMM
-XCOMM THIS SOFTWARE IS PROVIDED "AS-IS".  QUARTERDECK OFFICE SYSTEMS,
-XCOMM INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-XCOMM INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF
-XCOMM MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-XCOMM NONINFRINGEMENT.  IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS,
-XCOMM INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL,
-XCOMM INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR
-XCOMM PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS
-XCOMM OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT
-XCOMM OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-XCOMM
-XCOMM $XFree86: xc/programs/rstart/server.cpp,v 3.2 2001/01/17 23:45:03 dawes Exp $
-
-exec LIBDIR/rstartd.real -c LIBDIR/config
-- 
1.6.0.4



More information about the xorg-devel mailing list