aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlbert Ou <aou@eecs.berkeley.edu>2015-02-20 23:00:00 -0800
committerAlbert Ou <aou@eecs.berkeley.edu>2015-02-20 23:00:00 -0800
commit0d8ba68054701386304819c93084c115024ee5b1 (patch)
tree62967d21a91dcf602701342b47705d52cea6e6a4 /scripts
parent7a0dac10bf10dbf5162f15de84661af60d8550f8 (diff)
downloadriscv-gnu-toolchain-0d8ba68054701386304819c93084c115024ee5b1.zip
riscv-gnu-toolchain-0d8ba68054701386304819c93084c115024ee5b1.tar.gz
riscv-gnu-toolchain-0d8ba68054701386304819c93084c115024ee5b1.tar.bz2
Centralize GNU utility checks in autoconf
Tests for program presence, such as those formerly embedded in the top-level Makefile for gawk and gsed, are better suited for autoconf. Note that it is not sufficient to merely export AWK and SED environment variables, as packages may still directly invoke awk(1) and sed(1) with non-standard features independent of the autotools framework. Wrapper scripts therefore remain necessary, although these are now generated by the configure script to avoid hard-coded paths. Do not assume the existence of /bin/bash on all systems.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/wrapper/.gitignore2
-rw-r--r--[-rwxr-xr-x]scripts/wrapper/awk.in (renamed from scripts/gawk/awk)2
-rw-r--r--[-rwxr-xr-x]scripts/wrapper/sed.in (renamed from scripts/gsed/sed)4
3 files changed, 5 insertions, 3 deletions
diff --git a/scripts/wrapper/.gitignore b/scripts/wrapper/.gitignore
new file mode 100644
index 0000000..7142991
--- /dev/null
+++ b/scripts/wrapper/.gitignore
@@ -0,0 +1,2 @@
+awk
+sed
diff --git a/scripts/gawk/awk b/scripts/wrapper/awk.in
index 89da46f..1e7397a 100755..100644
--- a/scripts/gawk/awk
+++ b/scripts/wrapper/awk.in
@@ -4,4 +4,4 @@
# awk will invoke gawk (rather than mawk etc.).
# We use this to work around systems with awk != gawk.
-gawk "$@"
+exec ${AWK:-@GAWK@} "$@"
diff --git a/scripts/gsed/sed b/scripts/wrapper/sed.in
index 877fd5d..8d8f91a 100755..100644
--- a/scripts/gsed/sed
+++ b/scripts/wrapper/sed.in
@@ -1,7 +1,7 @@
#!/bin/sh
# We can add the current directory to the front of PATH so that
-# sed will invoke gsed (rather than Apple's sed, for example).
+# sed will invoke gsed (rather than FreeBSD's sed, for example).
# We use this to work around systems with sed != gsed.
-gsed "$@"
+exec ${SED:-@GSED@} "$@"