From 4184e7f9713bad88a8b2acf09efab2d596371006 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Wed, 20 Apr 2022 20:41:46 +0200 Subject: [PATCH] quote most bash variables --- build-taox11-for-osx.sh | 64 ++++++++++++++++++++++------------------ build-taox11-on-linux.sh | 44 ++++++++++++++------------- 2 files changed, 58 insertions(+), 50 deletions(-) diff --git a/build-taox11-for-osx.sh b/build-taox11-for-osx.sh index d80f24a..e79d2be 100755 --- a/build-taox11-for-osx.sh +++ b/build-taox11-for-osx.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # adapted from: # https://github.com/RemedyIT/axcioma/blob/master/.github/workflows/linux.yml @@ -11,9 +11,9 @@ export LANG=C export CC=clang export CXX=clang++ -export WORKSPACE=`realpath ..` -export X11_BASE_ROOT=$WORKSPACE/axcioma -export INSTALL_PREFIX=$X11_BASE_ROOT/stage +export WORKSPACE=$(realpath ..) +export X11_BASE_ROOT="${WORKSPACE}/axcioma" +export INSTALL_PREFIX="${X11_BASE_ROOT}/stage" source .env_add.sh @@ -24,27 +24,27 @@ export BRIX11_NUMBER_OF_PROCESSORS=6 # TODO: force to build only taox11! CK rm -rf ciaox11 dancex11 -rm -f *.log +rm -f ./*.log -$X11_BASE_ROOT/bin/brix11 bootstrap taox11 +"${X11_BASE_ROOT}/bin/brix11" bootstrap taox11 ############################################################ # patch to build ACE with -std=c++20 -cd $ACE_ROOT && git stash && patch -p2 < ../../ACE_Auto_Ptr.patch -cd $X11_BASE_ROOT +cd "${ACE_ROOT}" && git stash && patch -p2 < ../../ACE_Auto_Ptr.patch +cd "${X11_BASE_ROOT}" ############################################################ -$X11_BASE_ROOT/bin/brix11 configure -W aceroot=$ACE_ROOT -W taoroot=$TAO_ROOT -W mpcroot=$MPC_ROOT +"${X11_BASE_ROOT}/bin/brix11" configure -W aceroot="${ACE_ROOT}" -W taoroot="${TAO_ROOT}" -W mpcroot="${MPC_ROOT}" # Print brix11 configuration -$X11_BASE_ROOT/bin/brix11 --version -$X11_BASE_ROOT/bin/brix11 env -- configure -P 2>&1 | tee configure.log +"${X11_BASE_ROOT}/bin/brix11" --version +"${X11_BASE_ROOT}/bin/brix11" env -- configure -P 2>&1 | tee configure.log ############################################################ # gen GNUmakefile from workspace.mwc # see taox11/tao/x11/taox11.mpc # and ACE/ACE/ace/ace_for_tao.mpc -# NO! bin/brix11 gen build workspace.mwc -- gen build ${TAOX11_ROOT}/examples -- gen build ${TAOX11_ROOT}/orbsvcs/tests -- gen build ${TAOX11_ROOT}/tests +# NO! "${X11_BASE_ROOT}/bin/brix11" gen build workspace.mwc -- gen build ${TAOX11_ROOT}/examples -- gen build ${TAOX11_ROOT}/orbsvcs/tests -- gen build ${TAOX11_ROOT}/tests ############################################################ # FIXME: quickfixes for OSX @@ -53,7 +53,7 @@ $X11_BASE_ROOT/bin/brix11 env -- configure -P 2>&1 | tee configure.log # ACE/ACE/include/makeinclude/platform_macosx_common.GNU # ACE/ACE/include/makeinclude/platform_macosx.GNU platform_file='include $(ACE_ROOT)/include/makeinclude/platform_macosx.GNU' -echo ${platform_file} > ${ACE_ROOT}/include/makeinclude/platform_macros.GNU +echo ${platform_file} > "${ACE_ROOT}/include/makeinclude/platform_macros.GNU" # ACE/ACE/ace/config.h # ACE/ACE/ace/config-macosx.h @@ -66,33 +66,39 @@ echo ${platform_file} > ${ACE_ROOT}/include/makeinclude/platform_macros.GNU # ACE/ACE/ace/config-macosx-mountainlion.h # ACE/ACE/ace/config-macosx-lion.h # ACE/ACE/ace/config-macosx-leopard.h -echo '#include "ace/config-macosx.h"' > ${ACE_ROOT}/ace/config.h -echo '#define throw() noexcept' >> ${ACE_ROOT}/ace/config.h +echo '#include "ace/config-macosx.h"' > "${ACE_ROOT}/ace/config.h" +echo '#define throw() noexcept' >> "${ACE_ROOT}/ace/config.h" # ACE/ACE/bin/MakeProjectCreator/config/default.features -echo 'ipv6=1' > ${ACE_ROOT}/bin/MakeProjectCreator/config/default.features -echo 'versioned_namespace=1' >> ${ACE_ROOT}/bin/MakeProjectCreator/config/default.features -echo 'acetaompc=1' >> ${ACE_ROOT}/bin/MakeProjectCreator/config/default.features -echo 'inline=1' >> ${ACE_ROOT}/bin/MakeProjectCreator/config/default.features -echo 'optimize=1' >> ${ACE_ROOT}/bin/MakeProjectCreator/config/default.features +echo 'ipv6=1' > "${ACE_ROOT}/bin/MakeProjectCreator/config/default.features" +echo 'versioned_namespace=1' >> "${ACE_ROOT}/bin/MakeProjectCreator/config/default.features" +echo 'acetaompc=1' >> "${ACE_ROOT}/bin/MakeProjectCreator/config/default.features" +echo 'inline=1' >> "${ACE_ROOT}/bin/MakeProjectCreator/config/default.features" +echo 'optimize=1' >> "${ACE_ROOT}/bin/MakeProjectCreator/config/default.features" # generate all GNUmakefile's # see workspace.mwc -perl ${TAOX11_ROOT}/bin/mwc.pl -type gnuace ${X11_BASE_ROOT}/workspace.mwc -workers ${BRIX11_NUMBER_OF_PROCESSORS} -perl ${TAOX11_ROOT}/bin/mwc.pl -type gnuace ${TAOX11_ROOT}/orbsvcs/tests -workers ${BRIX11_NUMBER_OF_PROCESSORS} -perl ${TAOX11_ROOT}/bin/mwc.pl -type gnuace ${TAOX11_ROOT}/examples -workers ${BRIX11_NUMBER_OF_PROCESSORS} -perl ${TAOX11_ROOT}/bin/mwc.pl -type gnuace ${TAOX11_ROOT}/tests -workers ${BRIX11_NUMBER_OF_PROCESSORS} +perl "${TAOX11_ROOT}/bin/mwc.pl" -type gnuace "${X11_BASE_ROOT}/workspace.mwc" -workers ${BRIX11_NUMBER_OF_PROCESSORS} +perl "${TAOX11_ROOT}/bin/mwc.pl" -type gnuace "${TAOX11_ROOT}/orbsvcs/tests" -workers ${BRIX11_NUMBER_OF_PROCESSORS} +perl "${TAOX11_ROOT}/bin/mwc.pl" -type gnuace "${TAOX11_ROOT}/examples" -workers ${BRIX11_NUMBER_OF_PROCESSORS} +perl "${TAOX11_ROOT}/bin/mwc.pl" -type gnuace "${TAOX11_ROOT}/tests" -workers ${BRIX11_NUMBER_OF_PROCESSORS} # make all make c++20=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} 2>&1 | tee make-all.log -make c++20=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C ${TAOX11_ROOT}/orbsvcs/tests 2>&1 | tee -a make-all.log -make c++20=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C ${TAOX11_ROOT}/examples 2>&1 | tee -a make-all.log -make c++20=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C ${TAOX11_ROOT}/tests 2>&1 | tee -a make-all.log +make c++20=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C "${TAOX11_ROOT}/orbsvcs/tests" 2>&1 | tee -a make-all.log +make c++20=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C "${TAOX11_ROOT}/examples" 2>&1 | tee -a make-all.log +make c++20=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C "${TAOX11_ROOT}/tests" 2>&1 | tee -a make-all.log # make tests -$X11_BASE_ROOT/bin/brix11 run list -l taox11/bin/taox11_tests.lst -r taox11 2>&1 | tee run-list.log +"${X11_BASE_ROOT}/bin/brix11" run list -l taox11/bin/taox11_tests.lst -r taox11 2>&1 | tee run-list.log # install -make -j ${BRIX11_NUMBER_OF_PROCESSORS} install 2>&1 | tee make-install.log +make -j ${BRIX11_NUMBER_OF_PROCESSORS} -C "${X11_BASE_ROOT}" install 2>&1 | tee make-install.log + +find "${INSTALL_PREFIX}/include" -type d -name home -prune | xargs tree +find "${INSTALL_PREFIX}/include" -type d -name home -prune | xargs rm -rf + +#FIXME: remove the installed include garbage! CK +rm -rf "${INSTALL_PREFIX}/include" exit 0 diff --git a/build-taox11-on-linux.sh b/build-taox11-on-linux.sh index e186e67..304ab16 100755 --- a/build-taox11-on-linux.sh +++ b/build-taox11-on-linux.sh @@ -11,9 +11,9 @@ export LANG=C export CC=gcc export CXX=g++ -export WORKSPACE=`realpath ..` -export X11_BASE_ROOT=$WORKSPACE/axcioma -export INSTALL_PREFIX=$X11_BASE_ROOT/stage +export WORKSPACE=$(realpath ..) +export X11_BASE_ROOT="${WORKSPACE}/axcioma" +export INSTALL_PREFIX="${X11_BASE_ROOT}/stage" source .env_add.sh @@ -24,45 +24,47 @@ export BRIX11_NUMBER_OF_PROCESSORS=6 # TODO: force to build only taox11! CK rm -rf ciaox11 dancex11 -rm -f *.log +rm -f ./*.log -bin/brix11 bootstrap taox11 +"${X11_BASE_ROOT}/bin/brix11" bootstrap taox11 ############################################################ # patch to build ACE with -std=c++17 -cd $ACE_ROOT && git stash && patch -p2 < ../../ACE_Auto_Ptr.patch -cd $X11_BASE_ROOT +cd "${ACE_ROOT}" && git stash && patch -p2 < ../../ACE_Auto_Ptr.patch +cd "${X11_BASE_ROOT}" ############################################################ -bin/brix11 configure -W aceroot=$ACE_ROOT -W taoroot=$TAO_ROOT -W mpcroot=$MPC_ROOT +"${X11_BASE_ROOT}/bin/brix11" configure -W aceroot="${ACE_ROOT}" -W taoroot="${TAO_ROOT}" -W mpcroot="${MPC_ROOT}" # Print brix11 configuration -bin/brix11 --version -bin/brix11 env -- configure -P 2>&1 | tee configure.log +"${X11_BASE_ROOT}/bin/brix11" --version +"${X11_BASE_ROOT}/bin/brix11" env -- configure -P 2>&1 | tee configure.log -bin/brix11 gen build workspace.mwc -- gen build ${TAOX11_ROOT}/examples -- gen build ${TAOX11_ROOT}/orbsvcs/tests -- gen build ${TAOX11_ROOT}/tests +"${X11_BASE_ROOT}/bin/brix11" gen build workspace.mwc -- gen build "${TAOX11_ROOT}/examples" -- gen build "${TAOX11_ROOT}/orbsvcs/tests" -- gen build "${TAOX11_ROOT}/tests" # ACE/ACE/ace/config.h #FIXME: NO! echo '#define throw() noexcept' >> ${ACE_ROOT}/ace/config.h -#NO! bin/brix11 make -N -d ${X11_BASE_ROOT} -- make -N -d ${TAOX11_ROOT}/examples -- make -N -d ${TAOX11_ROOT}/orbsvcs/tests -- make -N -d ${TAOX11_ROOT}/tests 2>&1 | tee make-all.log +#NO! "${X11_BASE_ROOT}/bin/brix11" make -N -d ${X11_BASE_ROOT} -- make -N -d ${TAOX11_ROOT}/examples -- make -N -d ${TAOX11_ROOT}/orbsvcs/tests -- make -N -d ${TAOX11_ROOT}/tests 2>&1 | tee make-all.log # make all -make c++17=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C ${X11_BASE_ROOT} 2>&1 | tee make-all.log -make c++17=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C ${TAOX11_ROOT}/orbsvcs/tests 2>&1 | tee -a make-all.log -make c++17=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C ${TAOX11_ROOT}/examples 2>&1 | tee -a make-all.log -make c++17=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C ${TAOX11_ROOT}/tests 2>&1 | tee -a make-all.log +make c++17=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C "${X11_BASE_ROOT}" 2>&1 | tee make-all.log +make c++17=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C "${TAOX11_ROOT}/orbsvcs/tests" 2>&1 | tee -a make-all.log +make c++17=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C "${TAOX11_ROOT}/examples" 2>&1 | tee -a make-all.log +make c++17=1 -j ${BRIX11_NUMBER_OF_PROCESSORS} -C "${TAOX11_ROOT}/tests" 2>&1 | tee -a make-all.log #TODO: workaround to prevent problems with WSL and windows firewall! CK egrep "^127.0.1.1\s+$HOSTNAME" /etc/hosts && echo "change to 127.0.0.1!" && exit 1 -#XXX bin/brix11 run list -l taox11/bin/taox11_tests.lst -r taox11 2>&1 | tee run-test.log +# make tests +"${X11_BASE_ROOT}/bin/brix11" run list -l taox11/bin/taox11_tests.lst -r taox11 2>&1 | tee run-list.log -make -j -C ${X11_BASE_ROOT} install 2>&1 | tee make-install.log +# install +make -j ${BRIX11_NUMBER_OF_PROCESSORS} -C "${X11_BASE_ROOT}" install 2>&1 | tee make-install.log -find ${INSTALL_PREFIX}/include -type d -name home -prune | xargs tree -find ${INSTALL_PREFIX}/include -type d -name home -prune | xargs rm -rf +find "${INSTALL_PREFIX}/include" -type d -name home -prune | xargs tree +find "${INSTALL_PREFIX}/include" -type d -name home -prune | xargs rm -rf #FIXME: remove the installed include garbage! CK -rm -rf ${INSTALL_PREFIX}/include +rm -rf "${INSTALL_PREFIX}/include" exit 0