From 7e3a86e5195282ad42154449e7f409ba9f62c439 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 26 Feb 2014 14:09:04 -0500 Subject: lib/buildsystem.sh: Move var init to global scope. Also, improve the behavior of a [ command with unset variables. --- (limited to 'lib') 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 -- cgit v0.9.1