From 1daace6713e70482e3752f93768f7b050c782ab4 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 9 May 2017 23:34:16 +0200 Subject: [PATCH] OS specific build settings moved to configuration file --- Pmodules/modbuild | 16 +++++++--------- config/modbuild.conf | 9 +++++++++ install_pmodules.sh | 4 ++++ 3 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 config/modbuild.conf diff --git a/Pmodules/modbuild b/Pmodules/modbuild index f1541a6..2ddad5c 100755 --- a/Pmodules/modbuild +++ b/Pmodules/modbuild @@ -267,16 +267,8 @@ fi [[ -n ${BUILD_BLOCK} ]] || std::die 1 "No build-block specified!" [[ -r ${BUILD_BLOCK} ]] || std::die 1 "${BUILD_BLOCK}: no such file!" -# :FIXME: move to library? -# :FIXME: implement this with OS/system dependend plugins - declare -r OS -case ${OS} in -Darwin ) - declare -x MACOSX_DEPLOYMENT_TARGET='10.9' - #declare -rx SDKROOT='macosx10.9' - ;; -esac + # source Pmodule environment configuration if [[ "${bootstrap}" == "yes" ]]; then @@ -285,10 +277,16 @@ if [[ "${bootstrap}" == "yes" ]]; then source "${BUILD_BLOCK_DIR}/../config/${pmodule_environment}" declare -r BUILD_BASEDIR=$(std::get_abspath "${BUILD_BLOCK_DIR}/..") + if [[ -r "${BUILD_BLOCK_DIR}/../config/modbuild.conf" ]]; then + source "${BUILD_BLOCK_DIR}/../config/modbuild.conf" + fi elif [[ -n ${PMODULES_ROOT} ]] && [[ -n ${PMODULES_CONFIG_DIR} ]] && \ [[ -r ${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/${pmodule_environment} ]]; then source ${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/${pmodule_environment} declare -r BUILD_BASEDIR=$(std::get_abspath "${BUILD_BLOCK_DIR}/../..") + if [[ -r "${PMODULES_ROOT}/config/modbuild.conf" ]]; then + source "${PMODULES_ROOT}/config/modbuild.conf" + fi else std::die 3 "Build environment not setup properbly!" diff --git a/config/modbuild.conf b/config/modbuild.conf new file mode 100644 index 0000000..7a25d05 --- /dev/null +++ b/config/modbuild.conf @@ -0,0 +1,9 @@ +#!/bin/bash + +case ${OS} in +Darwin ) + declare -x MACOSX_DEPLOYMENT_TARGET='10.12' + #declare -rx SDKROOT='macosx10.9' + ;; +esac + diff --git a/install_pmodules.sh b/install_pmodules.sh index 61d7e50..1eedbc9 100755 --- a/install_pmodules.sh +++ b/install_pmodules.sh @@ -92,6 +92,10 @@ if [[ ! -e "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/profile.bash" ]]; then install -m 0755 "${SRC_DIR}/profile.bash" "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/profile.bash" fi +if [[ ! -e "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/modbuild.conf" ]]; then + install -m 0755 "${BOOTSTRAP_DIR}/config/modbuild.conf" "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/modbuild.conf" +fi + mkdir -p "${PMODULES_ROOT}/Tools/modulefiles" mkdir -p "${PMODULES_ROOT}/Libraries/modulefiles"