[PATCH app-mkfontdir] config: substitute bindir in mkfontdir using Autoconf @bindir@

Gaetan Nadon memsize at videotron.ca
Sat Jan 22 07:09:52 PST 2011


Use the Autoconf recommended way of substituting bindir, see
http://www.gnu.org/software/autoconf/manual/autoconf.html

Use # sign for comment in script.
Only sed is used, drop the cpp terminology.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 Makefile.am   |   12 ++++++------
 configure.ac  |    2 --
 mkfontdir.cpp |    3 ---
 mkfontdir.in  |    3 +++
 4 files changed, 9 insertions(+), 11 deletions(-)
 delete mode 100755 mkfontdir.cpp
 create mode 100755 mkfontdir.in

diff --git a/Makefile.am b/Makefile.am
index b7610ec..a98f2c8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,14 +20,14 @@
 #  PERFORMANCE OF THIS SOFTWARE.
 
 SUBDIRS = man
-bin_SCRIPTS = mkfontdir
-
-.cpp:
-	$(AM_V_GEN)$(SED) s,BINDIR,`echo @bindir@/mkfontscale | $(SED) s,/[^/]*$$,,`, < $< | $(SED) s/XCOMM/\#/ > $@
 
-EXTRA_DIST = mkfontdir.cpp
+bin_SCRIPTS = mkfontdir
 CLEANFILES = $(bin_SCRIPTS)
-SUFFIXES = .cpp
+EXTRA_DIST = $(bin_SCRIPTS:=.in)
+DIR_SUBSTS = -e 's|@bindir[@]|$(bindir)|g'
+
+mkfontdir: mkfontdir.in
+	$(AM_V_GEN)$(SED) $(DIR_SUBSTS) < $< > $@
 
 MAINTAINERCLEANFILES = ChangeLog INSTALL
 
diff --git a/configure.ac b/configure.ac
index 3090eab..a5a26c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,8 +36,6 @@ m4_ifndef([XORG_MACROS_VERSION],
 XORG_MACROS_VERSION(1.8)
 XORG_DEFAULT_OPTIONS
 
-AC_SUBST([bindir])
-
 AC_CONFIG_FILES([
 	Makefile
 	man/Makefile])
diff --git a/mkfontdir.cpp b/mkfontdir.cpp
deleted file mode 100755
index 98d8ffa..0000000
--- a/mkfontdir.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-XCOMM!/bin/sh
-
-exec BINDIR/mkfontscale -b -s -l "$@"
diff --git a/mkfontdir.in b/mkfontdir.in
new file mode 100755
index 0000000..dfb512b
--- /dev/null
+++ b/mkfontdir.in
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec @bindir@/mkfontscale -b -s -l "$@"
-- 
1.6.0.4



More information about the xorg-devel mailing list