From 079946533905442c8a0fa1a25b76c99462e21b46 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 26 Feb 2014 14:30:28 -0500 Subject: lib/buildsystem/*.sh: Improve more [ commands. --- (limited to 'lib') diff --git a/lib/buildsystem/autoconf.sh b/lib/buildsystem/autoconf.sh index 232ca0d..a2cbc23 100644 --- a/lib/buildsystem/autoconf.sh +++ b/lib/buildsystem/autoconf.sh @@ -42,7 +42,7 @@ _oh_autoconf_configure() --host=$(oh_buildsystem_arch \ "${OPK_HOST_ARCH}" 'autoconf')" fi - if [ -n "${_OH_BUILDSYSTEM_TARGET_ARCH}" ]; then + if [ "x${_OH_BUILDSYSTEM_TARGET_ARCH+set}" = 'xset' ]; then arch_opts="${arch_opts} --target=$(oh_buildsystem_arch \ "${_OH_BUILDSYSTEM_TARGET_ARCH}" 'autoconf')" diff --git a/lib/buildsystem/kbuild.sh b/lib/buildsystem/kbuild.sh index 3d6fd1b..e11daf1 100644 --- a/lib/buildsystem/kbuild.sh +++ b/lib/buildsystem/kbuild.sh @@ -85,11 +85,11 @@ _oh_kbuild_update_target() mkdir -p "${_OH_BUILDSYSTEM_BUILD_DIR}" cd "${_OH_BUILDSYSTEM_BUILD_DIR}" - if [ -n "${_OH_BUILDSYSTEM_BUILD_TARGET}" ]; then + if [ "x${_OH_BUILDSYSTEM_BUILD_TARGET+set}" = 'xset' ]; then make ARCH="${arch}" CROSS_COMPILE="${OPK_TOOL_PREFIX}" \ "${@}" "${_OH_BUILDSYSTEM_BUILD_TARGET}" rc=${?} - elif [ -n "${target}" ]; then + elif [ "x${target+set}" = 'xset' ]; then make ARCH="${arch}" CROSS_COMPILE="${OPK_TOOL_PREFIX}" \ "${@}" "${target}" rc=${?} diff --git a/lib/buildsystem/make.sh b/lib/buildsystem/make.sh index 7ed9dc0..1eacaee 100644 --- a/lib/buildsystem/make.sh +++ b/lib/buildsystem/make.sh @@ -93,10 +93,10 @@ _oh_make_update_first_defined_target() mkdir -p "${_OH_BUILDSYSTEM_BUILD_DIR}" cd "${_OH_BUILDSYSTEM_BUILD_DIR}" - if [ -n "${_OH_BUILDSYSTEM_BUILD_TARGET}" ]; then + if [ "x${_OH_BUILDSYSTEM_BUILD_TARGET+set}" = 'xset' ]; then make "${@}" "${_OH_BUILDSYSTEM_BUILD_TARGET}" rc=${?} - elif [ -n "${targets}" ]; then + elif [ "x${targets+set}" = 'xset' ]; then for target in ${targets}; do # If the target is defined, ... if make -n "${target}" >/dev/null 2>&1; then -- cgit v0.9.1