From 9a531da861056a0baa00a0ce746d9f59b2702ea9 Mon Sep 17 00:00:00 2001 From: KangDroid Date: Wed, 16 May 2018 12:22:03 +0900 Subject: [PATCH] Support Darwin environment on buildroot/bin (#10751) --- buildroot/bin/opt_disable | 4 +++- buildroot/bin/opt_disable_adv | 4 +++- buildroot/bin/opt_enable | 4 +++- buildroot/bin/opt_enable_adv | 4 +++- buildroot/bin/opt_set | 4 +++- buildroot/bin/opt_set_adv | 4 +++- buildroot/bin/pins_set | 4 +++- 7 files changed, 21 insertions(+), 7 deletions(-) diff --git a/buildroot/bin/opt_disable b/buildroot/bin/opt_disable index 35ad1aad4a..c219f36170 100755 --- a/buildroot/bin/opt_disable +++ b/buildroot/bin/opt_disable @@ -1,5 +1,7 @@ #!/usr/bin/env bash +SED=$(which gsed || which sed) + for opt in "$@" ; do - eval "sed -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration.h" + eval "${SED} -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration.h" done diff --git a/buildroot/bin/opt_disable_adv b/buildroot/bin/opt_disable_adv index 80d83183e5..bbb7ca5ae5 100755 --- a/buildroot/bin/opt_disable_adv +++ b/buildroot/bin/opt_disable_adv @@ -1,5 +1,7 @@ #!/usr/bin/env bash +SED=$(which gsed || which sed) + for opt in "$@" ; do - eval "sed -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration_adv.h" + eval "${SED} -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration_adv.h" done diff --git a/buildroot/bin/opt_enable b/buildroot/bin/opt_enable index 7b119fa15f..7be02ed9b4 100755 --- a/buildroot/bin/opt_enable +++ b/buildroot/bin/opt_enable @@ -1,5 +1,7 @@ #!/usr/bin/env bash +SED=$(which gsed || which sed) + for opt in "$@" ; do - eval "sed -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration.h" + eval "${SED} -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration.h" done diff --git a/buildroot/bin/opt_enable_adv b/buildroot/bin/opt_enable_adv index a34e56f12c..73a9d95415 100755 --- a/buildroot/bin/opt_enable_adv +++ b/buildroot/bin/opt_enable_adv @@ -1,5 +1,7 @@ #!/usr/bin/env bash +SED=$(which gsed || which sed) + for opt in "$@" ; do - eval "sed -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration_adv.h" + eval "${SED} -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration_adv.h" done diff --git a/buildroot/bin/opt_set b/buildroot/bin/opt_set index cf8c0d850c..c1de22f5e9 100755 --- a/buildroot/bin/opt_set +++ b/buildroot/bin/opt_set @@ -1,3 +1,5 @@ #!/usr/bin/env bash -eval "sed -i 's/\(#define \b${1}\b\).*$/\1 ${2}/g' Marlin/Configuration.h" +SED=$(which gsed || which sed) + +eval "${SED} -i 's/\(#define \b${1}\b\).*$/\1 ${2}/g' Marlin/Configuration.h" diff --git a/buildroot/bin/opt_set_adv b/buildroot/bin/opt_set_adv index 54076a0bca..4c72c4a831 100755 --- a/buildroot/bin/opt_set_adv +++ b/buildroot/bin/opt_set_adv @@ -1,3 +1,5 @@ #!/usr/bin/env bash -eval "sed -i 's/\(#define \b${1}\b\).*$/\1 ${2}/g' Marlin/Configuration_adv.h" +SED=$(which gsed || which sed) + +eval "${SED} -i 's/\(#define \b${1}\b\).*$/\1 ${2}/g' Marlin/Configuration_adv.h" diff --git a/buildroot/bin/pins_set b/buildroot/bin/pins_set index 2dc5693937..639995e24c 100755 --- a/buildroot/bin/pins_set +++ b/buildroot/bin/pins_set @@ -1,3 +1,5 @@ #!/usr/bin/env bash -eval "sed -i 's/\(#define \b${2}\b\).*$/\1 ${3}/g' Marlin/src/pins/pins_${1}.h" +SED=$(which gsed || which sed) + +eval "${SED} -i 's/\(#define \b${2}\b\).*$/\1 ${3}/g' Marlin/src/pins/pins_${1}.h"