summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2014-02-26 14:09:04 (EST)
committer P. J. McDermott <pjm@nac.net>2014-02-26 14:09:04 (EST)
commit7e3a86e5195282ad42154449e7f409ba9f62c439 (patch)
tree4d0f7c2c45d9c33823ec196a557729c427f1792e /lib
parentb1a939f2506b8faa4f283f743f59f88014fa5b32 (diff)
lib/buildsystem.sh: Move var init to global scope.
Also, improve the behavior of a [ command with unset variables.
Diffstat (limited to 'lib')
-rw-r--r--lib/buildsystem.sh15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/buildsystem.sh b/lib/buildsystem.sh
index 0d695c8..28893e2 100644
--- a/lib/buildsystem.sh
+++ b/lib/buildsystem.sh
@@ -25,6 +25,10 @@ autoconf
kbuild
make
'
+_OH_BUILDSYSTEM_SOURCE_DIR="${PWD}/src"
+_OH_BUILDSYSTEM_BUILD_DIR="${PWD}/src"
+_OH_BUILDSYSTEM_DESTDIR="${PWD}/dest"
+_OH_BUILDSYSTEM_SYSTEM=''
oh_buildsystems_init()
{
@@ -36,15 +40,6 @@ oh_buildsystems_init()
_OH_BUILDSYSTEM_WORK_AREA="${PWD}"
- [ -z "${_OH_BUILDSYSTEM_SOURCE_DIR}" ] && \
- _OH_BUILDSYSTEM_SOURCE_DIR="${PWD}/src"
- [ -z "${_OH_BUILDSYSTEM_BUILD_DIR}" ] && \
- _OH_BUILDSYSTEM_BUILD_DIR="${PWD}/src"
- [ -z "${_OH_BUILDSYSTEM_DESTDIR}" ] && \
- _OH_BUILDSYSTEM_DESTDIR="${PWD}/dest"
- [ -z "${_OH_BUILDSYSTEM_SYSTEM}" ] && \
- _OH_BUILDSYSTEM_SYSTEM=''
-
return 0
}
@@ -100,7 +95,7 @@ oh_buildsystem_find()
return 125
fi
- if [ -n "${_OH_BUILDSYSTEM_SYSTEM}" ]; then
+ if [ "x${_OH_BUILDSYSTEM_SYSTEM+set}" = 'xset' ]; then
if "_oh_${_OH_BUILDSYSTEM_SYSTEM}_can_${test_step}"; then
printf '%s\n' "${_OH_BUILDSYSTEM_SYSTEM}"
return 0