You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.6 KiB

  1. --- /dev/null
  2. +++ b/cmake/Toolchain-cross.cmake
  3. @@ -0,0 +1,5 @@
  4. +# search for programs in the build host directories
  5. +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  6. +# for libraries and headers in the target directories
  7. +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
  8. +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
  9. --- a/configure
  10. +++ b/configure
  11. @@ -27,6 +27,7 @@ Usage: ./configure [options]
  12. --help|-h shows this help
  13. --prefix=<path> installation prefix
  14. +--cross-root=<path> cross-compilation prefix
  15. --enable-shared enables shared build
  16. --enable-debug enables debug build
  17. --enable-tiger enables Mac OS X 10.4 (Tiger) build
  18. @@ -51,6 +52,7 @@ BUILD_DIR="$SOURCE_DIR/build-configure"
  19. # cmake parameters
  20. CMAKE_PREFIX=
  21. +CMAKE_ROOT=
  22. CMAKE_SHARED=
  23. CMAKE_DEBUG=
  24. CMAKE_BACKUP=
  25. @@ -69,6 +71,10 @@ while [ "$#" -gt 0 ] ; do
  26. --prefix=*)
  27. CMAKE_PREFIX="-DCMAKE_INSTALL_PREFIX=${1##--prefix=}"
  28. ;;
  29. + --cross-root=*)
  30. + CMAKE_ROOT="-DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/cmake/Toolchain-cross.cmake"
  31. + echo "SET(CMAKE_FIND_ROOT_PATH ${1##--cross-root=})" >> $SOURCE_DIR/cmake/Toolchain-cross.cmake
  32. + ;;
  33. --enable-backup)
  34. CMAKE_BACKUP="-DWITH_BACKUP=ON"
  35. ;;
  36. @@ -147,4 +153,4 @@ fi
  37. cd "$BUILD_DIR"
  38. # invoke cmake to do configuration
  39. -cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV
  40. +cmake $SOURCE_DIR $CMAKE_ROOT $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV