aboutsummaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>2015-04-11 01:01:16 -0700
committerPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>2015-04-11 01:05:19 -0700
commit381a7a47b99bc7bf0c7dd8bc5e2908a01c7a7790 (patch)
tree768f9c197a44a8b3f08a467c3cb64017b4ffa683 /Makefile.in
parent6a0927d7fd00b11019e48b059bc2e045b23d64db (diff)
downloadriscv-gnu-toolchain-381a7a47b99bc7bf0c7dd8bc5e2908a01c7a7790.zip
riscv-gnu-toolchain-381a7a47b99bc7bf0c7dd8bc5e2908a01c7a7790.tar.gz
riscv-gnu-toolchain-381a7a47b99bc7bf0c7dd8bc5e2908a01c7a7790.tar.bz2
Avoid wrapping GNU sed/awk on systems where that's the default
I have no idea why, but the installed "sed" wrapper never terminates on RHEL. If I don't use the wrappen the the tools build fine, so this just uses the already set autoconf variables to attempt to determine if the system sed/awk are gsed/gawk and if they are then this avoids using the wrappers. There's a few oddities here: * I have no idea why the sed wrapper fails, as it seems super safe. * I haven't run into any awk problems, but I figured I'd treat it the same as it isn't any harder. * We shouldn't have to support 10 year old distributions. Hopefully this doesn't break anyone's builds...
Diffstat (limited to 'Makefile.in')
-rwxr-xr-xMakefile.in13
1 files changed, 12 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index 2b6786c..57e55ce 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -21,7 +21,18 @@ SYSROOT := $(INSTALL_DIR)/sysroot
SHELL := /bin/sh
AWK := @GAWK@
SED := @GSED@
-PATH := $(INSTALL_DIR)/bin:$(builddir)/scripts/wrapper:$(PATH)
+PATH := $(INSTALL_DIR)/bin:$(PATH)
+
+# Check to see if we need wrapper scripts for awk/sed (which point to
+# gawk/gsed on platforms where these aren't the default), otherwise
+# don't override these as the wrappers don't always work.
+ifneq (@GSED@,/bin/sed)
+ PATH := $(base_dir)/sed:$(PATH)
+endif
+ifneq (@GAWK@,/usr/bin/gawk)
+ PATH := $(base_dir)/awk:$(PATH)
+endif
+
export PATH AWK SED
MULTILIB_FLAGS := @multilib_flags@