summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaetan Nadon <memsize@videotron.ca>2011-01-22 09:27:09 -0500
committerAlan Coopersmith <alan.coopersmith@oracle.com>2019-02-18 18:17:39 -0800
commit8290027e067ffd0a3f37eeafbd27121e2884cea4 (patch)
tree3da8c190879b6fba5100b23fc960a4a3cc4f8cb8
parent07d71396a502515a02bd12c5b01cdd98a7a30dab (diff)
mkfontdir: config: substitute bindir in mkfontdir using Autoconf @bindir@
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. Reviewed-by: RĂ©mi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
-rw-r--r--Makefile.am11
-rw-r--r--configure.ac3
-rwxr-xr-xmkfontdir.cpp3
-rwxr-xr-xmkfontdir.in3
4 files changed, 8 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am
index 40f6fd5..170b7ef 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,13 +23,12 @@ SUBDIRS = man
bin_PROGRAMS = mkfontscale
bin_SCRIPTS = mkfontdir
-.cpp:
- $(AM_V_GEN)$(SED) s,BINDIR,`echo @bindir@/mkfontscale | $(SED) s,/[^/]*$$,,`, < $< | $(SED) s/XCOMM/\#/ > $@
-
-SUFFIXES = .cpp
-
-EXTRA_DIST = mkfontdir.cpp
CLEANFILES = $(bin_SCRIPTS)
+EXTRA_DIST = $(bin_SCRIPTS:=.in)
+DIR_SUBSTS = -e 's|@bindir[@]|$(bindir)|g'
+
+mkfontdir: mkfontdir.in
+ $(AM_V_GEN)$(SED) $(DIR_SUBSTS) < $< > $@
AM_CPPFLAGS = @MKFONTSCALE_CFLAGS@ @X11_CFLAGS@ -D_BSD_SOURCE
AM_CFLAGS = $(CWARNFLAGS)
diff --git a/configure.ac b/configure.ac
index 50d4822..ee427ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,9 +61,6 @@ PKG_CHECK_MODULES(X11, [xproto >= 7.0.25])
dnl Allow checking code with lint, sparse, etc.
XORG_WITH_LINT
-dnl From mkfontdir/configure.ac
-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 "$@"