diff options
-rwxr-xr-x | bin/ptxdist | 15 | ||||
-rw-r--r-- | scripts/libptxdist.sh | 16 |
2 files changed, 14 insertions, 17 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index 67e768851..cf4ee9157 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -233,8 +233,9 @@ check_compiler() { # 3) Correct compiler version if a specific compiler version is given # - compiler=$(. ${PLATFORMCONFIG} && echo ${PTXCONF_COMPILER_PREFIX})gcc - vendor_should=$(. ${PLATFORMCONFIG} && echo ${PTXCONF_CROSSCHAIN_VENDOR}) + compiler="$(ptxd_get_ptxconf PTXCONF_COMPILER_PREFIX)gcc" + vendor_should="$(ptxd_get_ptxconf PTXCONF_CROSSCHAIN_VENDOR)" + if [ ! -z "$vendor_should" ]; then # yea! Vendor is specified in the project. So check for # toolchain vendor identification file @@ -258,7 +259,7 @@ check_compiler() { fi fi - compiler_should=$(. "${PLATFORMCONFIG}" && echo ${PTXCONF_CROSSCHAIN_CHECK}) + compiler_should="$(ptxd_get_ptxconf PTXCONF_CROSSCHAIN_CHECK)" compiler_is=$($compiler -dumpversion 2> /dev/null) if [ -z "$compiler_is" ]; then @@ -361,20 +362,20 @@ check_dirs() { # prefix if [ -z "$PREFIX" ]; then - ptxconf_prefix=$(. "${PLATFORMCONFIG}" && echo ${PTXCONF_PREFIX}) + ptxconf_prefix="$(ptxd_get_ptxconf PTXCONF_PREFIX)" else ptxconf_prefix=${PREFIX} fi - ptxconf_prefix_host=$(. "${PLATFORMCONFIG}" && echo ${PTXCONF_HOST_PREFIX}) - ptxconf_prefix_cross=$(. "${PLATFORMCONFIG}" && echo ${PTXCONF_CROSS_PREFIX}) + ptxconf_prefix_host="$(ptxd_get_ptxconf PTXCONF_HOST_PREFIX)" + ptxconf_prefix_cross="$(ptxd_get_ptxconf PTXCONF_CROSS_PREFIX)" for dir in "${ptxconf_prefix_host}" "${ptxconf_prefix_cross}"; do check_dirs_prefix "${dir}" done # sysroot - keep in sync with rules/pre/Rules.make -> SYSROOT - ptxconf_gnu_target=$(. "${PLATFORMCONFIG}" && echo ${PTXCONF_GNU_TARGET}) + ptxconf_gnu_target="$(ptxd_get_ptxconf PTXCONF_GNU_TARGET)" mkdir -p "${ptxconf_prefix}/sysroot/${ptxconf_gnu_target}"/{,usr/}{lib,{,s}bin,include,{,share/}man/man{1,2,3,4,5,6,7,8,9}} # builddirs diff --git a/scripts/libptxdist.sh b/scripts/libptxdist.sh index 7d9906a7d..82f78a27f 100644 --- a/scripts/libptxdist.sh +++ b/scripts/libptxdist.sh @@ -22,16 +22,12 @@ shell() { ptxd_get_ptxconf() { - if test -z "${_ptxd_get_ptxconf_sourced}"; then - if test -f "${PTXCONFIG}" && test -f "${PLATFORMCONFIG}"; then + if test -f "${PTXCONFIG}" -a -f "${PLATFORMCONFIG}"; then source "${PTXCONFIG}" source "${PLATFORMCONFIG}" - _ptxd_get_ptxconf_sourced=true - else + else return - fi fi - echo "${!1}" } @@ -45,7 +41,7 @@ ptxd_kconfig() { copy_back="${1}" fun="${2}" - tmpdir=`mktemp -d /tmp/ptxdist.XXXXXX` + tmpdir="`mktemp -d /tmp/ptxdist.XXXXXX`" # search for kconfig if [ -z "${PTXDIST_KCONFIG}" ]; then @@ -56,16 +52,16 @@ ptxd_kconfig() { fi fi - pushd $tmpdir > /dev/null + pushd "$tmpdir" > /dev/null ln -sf "${PTXDIST_TOPDIR}/rules" ln -sf "${PTXDIST_TOPDIR}/config" ln -sf "${PTXDIST_WORKSPACE}" workspace - ptxcnf=`readlink -f "${PTXDIST_WORKSPACE}/ptxconfig"` + ptxcnf="`readlink -f \"${PTXDIST_WORKSPACE}/ptxconfig\"`" cp "$ptxcnf" .config shift 2 # call ${fun} with the remaining arguments - if ${fun} $* && [ "${copy_back}" = "true" ]; then + if ${fun} "${@}" && [ "${copy_back}" = "true" ]; then cp .config "$ptxcnf" fi |