pastebin - collaborative debugging tool
rovema.kpaste.net RSS


RDE: buildrdecygwin.bash
Posted by Anonymous on Thu 27th Jul 2023 15:36
raw | new post
modification of post by Anonymous (view diff)

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