summaryrefslogtreecommitdiffstats
path: root/scripts
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
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')
-rw-r--r--scripts/lib/ptxd_make_world_common.sh54
-rw-r--r--scripts/lib/ptxd_make_world_compile.sh4
-rw-r--r--scripts/lib/ptxd_make_world_install.sh4
3 files changed, 40 insertions, 22 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
diff --git a/scripts/lib/ptxd_make_world_compile.sh b/scripts/lib/ptxd_make_world_compile.sh
index 6d4a611fc..a15a46054 100644
--- a/scripts/lib/ptxd_make_world_compile.sh
+++ b/scripts/lib/ptxd_make_world_compile.sh
@@ -17,7 +17,7 @@ ptxd_make_world_compile() {
# no build dir -> assume the package has nothing to build.
return
fi &&
- case "${pkg_conf_tool}" in
+ case "${pkg_build_tool}" in
python*)
(
ptxd_eval \
@@ -30,7 +30,7 @@ ptxd_make_world_compile() {
"${pkg_make_opt}"
)
;;
- meson)
+ ninja)
ptxd_eval \
"${pkg_path}" \
"${pkg_env}" \
diff --git a/scripts/lib/ptxd_make_world_install.sh b/scripts/lib/ptxd_make_world_install.sh
index 9f865de97..74ca980f1 100644
--- a/scripts/lib/ptxd_make_world_install.sh
+++ b/scripts/lib/ptxd_make_world_install.sh
@@ -70,7 +70,7 @@ ptxd_make_world_install() {
ptxd_make_world_install_prepare &&
- case "${pkg_conf_tool}" in
+ case "${pkg_build_tool}" in
python*)
cmd=( \
cd "${pkg_build_dir}" '&&' \
@@ -87,7 +87,7 @@ ptxd_make_world_install() {
cmd[${#cmd[@]}]=ptxd_make_world_install_python_cleanup
fi
;;
- meson)
+ ninja)
cmd=( \
"${pkg_path}" \
"${pkg_env}" \