summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_make_world_common.sh
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-06-05 15:54:18 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-06-05 19:04:45 +0200
commit1a27e252f790a5abd485249036e33ab90712f9a8 (patch)
treebc70d5238f18294924ac044ffde48d69f8c3b518 /scripts/lib/ptxd_make_world_common.sh
parentf8125c1e86a71e59f88d105044481763e1ec9706 (diff)
downloadptxdist-1a27e252f790a5abd485249036e33ab90712f9a8.tar.gz
ptxdist-1a27e252f790a5abd485249036e33ab90712f9a8.tar.xz
ptxd_make_world_*: allow ninja generator for cmake
cmake can be used with 'make' and 'ninja'. Currently only 'make' is supported. This introduces a check to determine which generator is selected and calls the corresponding tool in the compile and install stages. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_make_world_common.sh')
-rw-r--r--scripts/lib/ptxd_make_world_common.sh54
1 files changed, 36 insertions, 18 deletions
diff --git a/scripts/lib/ptxd_make_world_common.sh b/scripts/lib/ptxd_make_world_common.sh
index 0cc294915..a65707b15 100644
--- a/scripts/lib/ptxd_make_world_common.sh
+++ b/scripts/lib/ptxd_make_world_common.sh
@@ -336,15 +336,6 @@ ptxd_make_world_init() {
pkg_env="${pkg_env} LC_ALL='$(locale -a | grep -i -m 1 "\.utf[-]\?8")'"
fi
unset c_locale
-
- if [ "${PTXDIST_VERBOSE}" = "1" ]; then
- pkg_make_opt="-v ${pkg_make_opt}"
- pkg_install_opt="-v ${pkg_install_opt}"
- fi
- # pass jobserver via MAKEFLAGS to ninja
- pkg_env="${pkg_env} MAKEFLAGS='${PTXDIST_JOBSERVER_FLAGS}'"
- PTXDIST_PARALLELMFLAGS_INTERN=""
-
unset conf_opt_ptr
;;
*)
@@ -370,15 +361,6 @@ ptxd_make_world_init() {
whitelist_target="$(echo $(cat "${deps_target[@]}" /dev/null 2>/dev/null))"
pkg_env="PKGCONFIG_WHITELIST_HOST='${whitelist_host}' PKGCONFIG_WHITELIST_TARGET='${whitelist_target}' PKGCONFIG_WHITELIST_SRC='${pkg_label}' ${pkg_env}"
- # DESTDIR
- if [[ "${pkg_conf_tool}" =~ "python" ]]; then
- pkg_install_opt="${pkg_install_opt} --root=${pkg_pkg_dir}"
- elif [ "${pkg_conf_tool}" = "meson" ]; then
- pkg_env="${pkg_env} DESTDIR=\"${pkg_pkg_dir}\""
- else
- pkg_install_opt="DESTDIR=\"${pkg_pkg_dir}\" INSTALL_ROOT=\"${pkg_pkg_dir}\" ${pkg_install_opt}"
- fi
-
#
# build dir
@@ -414,6 +396,42 @@ ptxd_make_world_init() {
fi
#
+ # make or ninja
+ #
+ pkg_build_tool="${pkg_conf_tool}"
+ case "${pkg_conf_tool}" in
+ meson)
+ pkg_build_tool=ninja
+ ;;
+ cmake)
+ if [ -e "${pkg_build_dir}/build.ninja" ]; then
+ pkg_build_tool=ninja
+ fi
+ esac
+ if [ "${pkg_build_tool}" = "ninja" ]; then
+ if [ "${PTXDIST_VERBOSE}" = "1" ]; then
+ pkg_make_opt="-v ${pkg_make_opt}"
+ pkg_install_opt="-v ${pkg_install_opt}"
+ fi
+ # pass jobserver via MAKEFLAGS to ninja
+ pkg_env="${pkg_env} MAKEFLAGS='${PTXDIST_JOBSERVER_FLAGS}'"
+ PTXDIST_PARALLELMFLAGS_INTERN=""
+ fi
+
+ # DESTDIR
+ case "${pkg_build_tool}" in
+ python*)
+ pkg_install_opt="${pkg_install_opt} --root=${pkg_pkg_dir}"
+ ;;
+ ninja)
+ pkg_env="DESTDIR=\"${pkg_pkg_dir}\" ${pkg_env}"
+ ;;
+ *)
+ pkg_install_opt="DESTDIR=\"${pkg_pkg_dir}\" INSTALL_ROOT=\"${pkg_pkg_dir}\" ${pkg_install_opt}"
+ ;;
+ esac
+
+ #
# parallelmake
#
case "${pkg_make_par}" in