[PATCH v2 app-mkfontdir] config: use Autoconf rather than sed to substitute $bindir
Gaetan Nadon
memsize at videotron.ca
Fri Jan 21 18:47:13 PST 2011
The path substitution in mkfontdir script can be done at configuration
time using Autoconf. This is an alternative to using sed and requires
less Makefile work.
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
Makefile.am | 7 -------
configure.ac | 5 ++---
mkfontdir.cpp | 3 ---
mkfontdir.in | 5 +++++
4 files changed, 7 insertions(+), 13 deletions(-)
delete mode 100755 mkfontdir.cpp
create mode 100755 mkfontdir.in
diff --git a/Makefile.am b/Makefile.am
index b7610ec..e945869 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,13 +22,6 @@
SUBDIRS = man
bin_SCRIPTS = mkfontdir
-.cpp:
- $(AM_V_GEN)$(SED) s,BINDIR,`echo @bindir@/mkfontscale | $(SED) s,/[^/]*$$,,`, < $< | $(SED) s/XCOMM/\#/ > $@
-
-EXTRA_DIST = mkfontdir.cpp
-CLEANFILES = $(bin_SCRIPTS)
-SUFFIXES = .cpp
-
MAINTAINERCLEANFILES = ChangeLog INSTALL
.PHONY: ChangeLog INSTALL
diff --git a/configure.ac b/configure.ac
index 3090eab..90dbf7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,9 +36,8 @@ m4_ifndef([XORG_MACROS_VERSION],
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
-AC_SUBST([bindir])
-
AC_CONFIG_FILES([
Makefile
- man/Makefile])
+ man/Makefile
+ mkfontdir])
AC_OUTPUT
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..441fa98
--- /dev/null
+++ b/mkfontdir.in
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+exec @bindir@/mkfontscale -b -s -l "$@"
--
1.6.0.4
More information about the xorg-devel
mailing list