pastebin - collaborative debugging tool
rovema.kpaste.net RSS


RDE: buildrdecygwin.bash
Posted by Anonymous on Thu 27th Jul 2023 16:16
raw | new post
view followups (newest first): RDE: buildrdecygwin.bash by Anonymous

  1. #!/bin/bash
  2.  
  3. #
  4. # buildrdecygwin.bash - build ROVEMA RDE using Cygwin
  5. #
  6.  
  7. #
  8. # Written by Roland Mainz <roland.mainz@rovema.de>
  9. #
  10.  
  11. #
  12. # Usage:
  13. #
  14. # 1. Build RDE
  15. # mkdir try10_rde_new_rds/
  16. # cd try10_rde_new_rds
  17. # git clone https://RovemaDevelopment@dev.azure.com/RovemaDevelopment/RDE-Development/_git/Dependencies
  18. # git clone --recurse-submodules https://RovemaDevelopment@dev.azure.com/RovemaDevelopment/RDE-Development/_git/RDE-Development
  19. # cd RDE-Development/
  20. # mkdir build_windows4
  21. # cd build_windows4/
  22. # time nice bash ../scripts/buildrdecygwin.bash buildall 2>&1 | tee -a buildlog.log
  23. #
  24. # 2a. Start RDE (manually):
  25. # $ bash -c 'PATH+=":${qtpath}/5.15.2/mingw81_64/bin" ; ./rde'
  26. #
  27. # 2b. Start RDE (via script):
  28. # $ bash buildrdecygwin.bash run
  29. #
  30.  
  31. #
  32. # Configuration paths
  33. #
  34. function configure_paths
  35. {
  36.         boost_Version='1_71_0'
  37.         qt_Version='5_15_2'
  38.  
  39.         #
  40.         # Prebuild RDE build tools (compiler etc)
  41.         # (from $ git clone https://RovemaDevelopment@dev.azure.com/RovemaDevelopment/RDE-Development/_git/Dependencies #)
  42.         #
  43.         #git_rde_dependicies_dir='/cygdrive/h/tmp/winnfstest/hummingbirdnfstest1/rde_windows_developmement/Dependencies/win/'
  44.         #git_rde_dependicies_dir='/home/roland_mainz/work/rde/build_dep/Dependencies/win/'
  45.         git_rde_dependicies_dir="$(realpath "$PWD/../../Dependencies")/win/"
  46.         if [[ ! -d "$git_rde_dependicies_dir" ]] ; then
  47.                 printf $"%s: ERROR: %s dir not found\n" "$0" "$git_rde_dependicies_dir" 1>&2
  48.                 return 1
  49.         fi
  50.  
  51.         boostpath="${git_rde_dependicies_dir}/boost/boost_${boost_Version}/"
  52.         qtpath="${git_rde_dependicies_dir}/qt/qt_${qt_Version}/"
  53.  
  54.         printf $"# building with boost version %s and qt version %s\n" "$boost_Version" "qt_Version"
  55.  
  56.         # Setting-up PATH
  57.         export PATH="$qtpath/Tools/mingw810_64/bin/:$qtpath/5.15.2/mingw81_64/bin/:$qtpath/Tools/CMake_64/bin/:$boostpath/bin/:$boostpath/lib/:$PATH"
  58.         printf $"# PATH=%s\n# Windows PATH=%s\n" "$PATH" "$(cygpath -p -w "$PATH")"
  59.         return 0
  60. }
  61.  
  62. function probe_paths
  63. {
  64.         printf $"# Probing PATH for tools ...\n"
  65.         which -a gcc
  66.         which -a g++
  67.         which -a cmake
  68.         which -a make
  69.  
  70.         return 0
  71. }
  72.  
  73. #
  74. # Build
  75. #
  76.  
  77. function build_clean
  78. {
  79.         printf $"# Cleanup old build stuff ...\n"
  80.         rm -Rf CMake* CPack* CTestTestfile.cmake app_translations.qrc cmake_install.cmake nowide tests RDS Makefile *.qm rde.rc rde_autogen tmp versioninfo.cpp
  81.         return 0
  82. }
  83.  
  84. function build_cmake_config
  85. {
  86.         printf $"# Running build configuration via cmake ...\n"
  87.         # note: Windows/minGW uses '-G "MinGW Makefiles"', while compiling with Cygwin requires '-G "Unix Makefiles"'
  88.         cmake -G "Unix Makefiles" -DBOOST_ROOT="$boostpath" -DBoost_LIB_PREFIX="lib" -DBoost_USE_STATIC_LIBS=TRUE -DBoost_ARCHITECTURE="-x64" -DBUILD_TESTS=ON ".."
  89.         return 0
  90. }
  91.  
  92. function build_cmake_clean
  93. {
  94.         printf $"# Target clean ...\n"
  95.         cmake --build . -j 1 --target clean
  96.         return 0
  97. }
  98.  
  99. function build_cmake_targets
  100. {
  101.         printf $"# Building ...\n"
  102.         cmake --build . -j 4
  103.         printf $"%s: Build done.\n" "$0"
  104.         return 0
  105. }
  106.  
  107. #
  108. # main
  109. #
  110. set -o errexit
  111. set -o nounset
  112. #set -o xtrace # debug
  113.  
  114. printf $"%s: Start ...\n" "$0"
  115.  
  116. # Check whether we are really on Cygwin...
  117. if [[ "$(uname -s)" != *CYGWIN* ]] ; then
  118.         printf $"%s: ERROR: Not a Cygwin environment.\n" "$0" 1>&2
  119.         exit 1
  120. fi
  121.  
  122. typeset boost_Version qt_Version git_rde_dependicies_dir boostpath qtpath
  123.  
  124. configure_paths
  125.  
  126. case "${1-}" in
  127.         'buildall')
  128.                 probe_paths
  129.                 build_clean
  130.                 build_cmake_config
  131.                 build_cmake_clean
  132.                 build_cmake_targets
  133.                 ;;
  134.         'clean')
  135.                 build_clean
  136.                 ;;
  137.         'run')
  138.                 ./rde
  139.                 exit $?
  140.                 ;;
  141.         *)
  142.                 printf $"%s: Unknown cmd %q\n" "$0" "${1-}" 1>&2
  143.                 exit 1
  144.                 ;;
  145. esac
  146.  
  147. exit 0
  148.  
  149. # EOF.

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at