aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/Makefile.am6
-rwxr-xr-xbin/dosubst.awk47
2 files changed, 53 insertions, 0 deletions
diff --git a/bin/Makefile.am b/bin/Makefile.am
new file mode 100644
index 000000000..6c11e26ef
--- /dev/null
+++ b/bin/Makefile.am
@@ -0,0 +1,6 @@
1EXTRA_DIST = \
2 dosubst.awk \
3 grephdr.sh \
4 grepsrc.sh \
5 pogen.sh \
6 rename.sh
diff --git a/bin/dosubst.awk b/bin/dosubst.awk
new file mode 100755
index 000000000..3ed0403dd
--- /dev/null
+++ b/bin/dosubst.awk
@@ -0,0 +1,47 @@
1# Dedicated to the public domain.
2# SPDX-License-Identifier: 0BSD
3#
4# awk script to substitute variables in scripts and applications.
5#
6# You can pass these variables to it in Makefiles or on the
7# commandline:
8# bdir="$(bindir)"
9# py="$(PYTHON)"
10# awkay="$(AWK_BINARY)"
11# pfx="$(prefix)"
12# prl="$(PERL)"
13# sysconfdirectory="$(sysconfdir)"
14# pkgdatadirectory="$(pkgdatadir)"
15
16{
17
18 if (/@bindirectory@/) {
19 gsub("@bindirectory@",bdir) ;
20 }
21
22 if (/@PYTHONEXE@/) {
23 gsub("@PYTHONEXE@",py) ;
24 }
25
26 if (/@AWKEXE@/) {
27 gsub("@AWKEXE@",awkay) ;
28 }
29
30 if (/@SUBSTPREFIX@/) {
31 gsub("@SUBSTPREFIX@",pfx) ;
32 }
33
34 if (/@PERLEXE@/) {
35 gsub("@PERLEXE@",prl) ;
36 }
37
38 if (/@SYSCONFDIR@/) {
39 gsub("@SYSCONFDIR@",sysconfdirectory) ;
40 }
41
42 if (/@PKGDATADIRECTORY@/) {
43 gsub("@PKGDATADIRECTORY@",pkgdatadirectory) ;
44 }
45
46 print $0 ;
47}