From b70ff5b419aebe6f86e737b1cc1be3b35c23a4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luc=C3=ADa=20Andrea=20Illanes=20Albornoz?= Date: Sun, 26 Mar 2023 15:38:55 +0200 Subject: Generalise {configure,make} code. --- etc/README.md | 4 +- groups/211.native_packages_cmdline.group | 2 +- groups/251.native_packages_lib.group | 2 +- midipix.env | 27 ++- subr.ex/ex_pkg_run.subr | 400 +++++++++++++++++++++++++++++++ subr.pkg/pkg_build.subr | 114 ++------- subr.pkg/pkg_build_clean.subr | 74 +++--- subr.pkg/pkg_configure.subr | 168 ++++--------- subr.pkg/pkg_install_make.subr | 83 ++----- 9 files changed, 544 insertions(+), 330 deletions(-) create mode 100644 subr.ex/ex_pkg_run.subr diff --git a/etc/README.md b/etc/README.md index 39b60b1e..6c6c80c0 100644 --- a/etc/README.md +++ b/etc/README.md @@ -720,6 +720,7 @@ VERSION`` and/or ``URLS_GIT``, respectively. | BUILD_STAGES_DISABLE | List( ) | Build stages to disable during package build | | BUILD_TYPE | Set(String) | ``cross``: Cross-compiled toolchain, ``host``: host, ``native``: cross-compiled package | | CC | FileName | Toolchain C compiler ``cc(1)`` | +| CCLD | FileName | Toolchain C compiler-qua-linker ``cc(1)`` | | CFLAGS_BUILD_EXTRA | FlagLine | Additional C compiler flags during package ``make(1)`` build | | CFLAGS_BUILD | FlagLine | C compiler flags during package ``make(1)`` build | | CFLAGS_CONFIGURE_EXTRA | FlagLine | Additional C compiler flags during package (GNU autotools in implementation and/or interface) configuration | @@ -769,7 +770,8 @@ VERSION`` and/or ``URLS_GIT``, respectively. | MAKEFLAGS_INSTALL_EXTRA | FlagLine | ``make(1)`` flags during package ``make(1)`` installation; subject to field splitting w/ ``:`` | | MAKEFLAGS_INSTALL_LIST | List(:) | ``make(1)`` flags during package ``make(1)`` installation; subject to field splitting w/ ``:`` | | MAKEFLAGS_INSTALL_EXTRA_LIST | List(:) | ``make(1)`` flags during package ``make(1)`` installation; subject to field splitting w/ ``:`` | -| MAKEFLAGS_PARALLELISE | FlagLine | ``make(1)`` parallelisation (e.g. -l, -j) flags | +| MAKEFLAGS_LOADAVG | FlagLine | ``make(1)`` load average limit (e.g. -l load) flag | +| MAKEFLAGS_PARALLELISE | FlagLine | ``make(1)`` parallelisation (e.g. -j jobs) flag | | MAKEFLAGS_VERBOSITY | String | Variable-value pair to pass to ``make(1)`` in order to force echo-back of command lines prior to execution | | MAKE_INSTALL_VNAME | String | Variable name of ``make(1)`` installation destination directory variable during package ``make(1)`` installation | | MAKE_SUBDIRS | List( ) | ``make(1)`` subdirectories to exclusively build | diff --git a/groups/211.native_packages_cmdline.group b/groups/211.native_packages_cmdline.group index 8979f5bc..8e2e6e4c 100644 --- a/groups/211.native_packages_cmdline.group +++ b/groups/211.native_packages_cmdline.group @@ -86,7 +86,7 @@ the_silver_searcher toilet tree terminally_tetris ubase which zsh"; : ${PKG_FIGLET_VERSION:=2.2.5}; : ${PKG_FIGLET_URL:=ftp://ftp.figlet.org/pub/figlet/program/unix/figlet-${PKG_FIGLET_VERSION}.tar.gz}; : ${PKG_FIGLET_IN_TREE:=1}; -: ${PKG_FIGLET_MAKEFLAGS_BUILD_LIST:=CC=${DEFAULT_NATIVE_CC}:LD=${DEFAULT_NATIVE_CC}}; +: ${PKG_FIGLET_MAKEFLAGS_BUILD_LIST:=CC=${DEFAULT_NATIVE_CC}:LD=${DEFAULT_NATIVE_CCLD}}; : ${PKG_FINDUTILS_SHA256SUM:=a2bfb8c09d436770edc59f50fa483e785b161a3b7b9d547573cb08065fd462fe}; : ${PKG_FINDUTILS_VERSION:=4.9.0}; : ${PKG_FINDUTILS_URL:=https://ftp.gnu.org/gnu/findutils/findutils-${PKG_FINDUTILS_VERSION}.tar.xz}; diff --git a/groups/251.native_packages_lib.group b/groups/251.native_packages_lib.group index aeab281a..d556c996 100644 --- a/groups/251.native_packages_lib.group +++ b/groups/251.native_packages_lib.group @@ -117,7 +117,7 @@ sdl1_image sdl1_ttf sdl2 sdl2_image sdl2_ttf sdl2_net twolame wolfssl"; : ${PKG_LIBFETCH_URL:=https://sources.archlinux.org/other/libfetch/libfetch-${PKG_LIBFETCH_VERSION}.tar.gz}; : ${PKG_LIBFETCH_ENV_VARS_EXTRA:=CFLAGS=--sysroot=${PREFIX_NATIVE}:LDFLAGS=--sysroot=${PREFIX_NATIVE}}; : ${PKG_LIBFETCH_IN_TREE:=1}; -: ${PKG_LIBFETCH_MAKEFLAGS_BUILD_EXTRA_LIST:="E=echo:Q=:AR=${DEFAULT_TARGET}-ar:CC=${DEFAULT_NATIVE_CC}:LD=${DEFAULT_NATIVE_CC}"}; +: ${PKG_LIBFETCH_MAKEFLAGS_BUILD_EXTRA_LIST:="E=echo:Q=:AR=${DEFAULT_TARGET}-ar:CC=${DEFAULT_NATIVE_CC}:LD=${DEFAULT_NATIVE_CCLD}"}; : ${PKG_LIBFETCH_MAKEFLAGS_INSTALL_EXTRA:="E=echo Q="}; : ${PKG_LIBFFI_SHA256SUM:=d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37}; : ${PKG_LIBFFI_VERSION:=3.2.1}; diff --git a/midipix.env b/midipix.env index 97371e92..a1a1edec 100644 --- a/midipix.env +++ b/midipix.env @@ -21,24 +21,24 @@ DEFAULT_BUILD_STEPS=" \ finish"; DEFAULT_BUILD_VARS=" \ AR AUTOCONF_CONFIG_GUESS BASE_DIR BUILD_DIR BUILD_STEPS_DISABLE \ - BUILD_TYPE CC CFLAGS_BUILD CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE \ + BUILD_TYPE CC CCLD CFLAGS_BUILD CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE \ CFLAGS_CONFIGURE_EXTRA CMAKE CMAKE_ARGS CMAKE_ARGS_EXTRA CMAKE_LISTFILE \ CONFIG_CACHE CONFIG_CACHE_EXTRA CONFIG_CACHE_LOCAL CONFIGURE CONFIGURE_ARGS \ CONFIGURE_ARGS_EXTRA CONFIGURE_ARGS_EXTRA_LIST CONFIGURE_ARGS_LIST CONFIGURE_TYPE \ CXX CXXFLAGS_CONFIGURE CXXFLAGS_CONFIGURE_EXTRA DEPENDS DESTDIR DESTDIR_HOST \ DISABLED ENV_VARS_EXTRA FNAME FORCE_AUTORECONF GITROOT INHERIT_FROM INSTALL_FILES \ INSTALL_FILES_DESTDIR INSTALL_FILES_DESTDIR_EXTRA INSTALL_FILES_V2 INSTALL_TARGET \ - INSTALL_TARGET_EXTRA IN_TREE LDFLAGS_BUILD LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE \ + INSTALL_TARGET_EXTRA IN_TREE LD LDFLAGS_BUILD LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE \ LDFLAGS_CONFIGURE_EXTRA LIBTOOL MAKE MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA \ MAKEFLAGS_BUILD_EXTRA_LIST MAKEFLAGS_BUILD_LIST MAKEFLAGS_INSTALL \ MAKEFLAGS_INSTALL_EXTRA MAKEFLAGS_INSTALL_EXTRA_LIST MAKEFLAGS_INSTALL_LIST \ - MAKEFLAGS_PARALLELISE MAKEFLAGS_VERBOSITY MAKE_INSTALL_VNAME MAKE_SUBDIRS MIRRORS \ - MIRRORS_GIT NO_CLEAN NO_CLEAN_BASE_DIR NO_CLEAN_BUILD_DIR NO_LOG_VARS PATCHES_EXTRA \ - PKG_CONFIG PKG_CONFIG_LIBDIR PKGLIST_DISABLE PREFIX PYTHON RANLIB RPM_DISABLE \ - SHA256SUM SOFORT_NATIVE_CC SOFORT_NATIVE_CFLAGS SOFORT_NATIVE_CFLAGS_EXTRA \ - SOFORT_NATIVE_CXX SOFORT_NATIVE_CXXFLAGS SOFORT_NATIVE_CXXFLAGS_EXTRA \ - SOFORT_NATIVE_LD SOFORT_NATIVE_LDFLAGS SOFORT_NATIVE_LDFLAGS_EXTRA SUBDIR TARGET \ - URL URLS_GIT VARS_FILE VERSION"; + MAKEFLAGS_LOADAVG MAKEFLAGS_PARALLELISE MAKEFLAGS_VERBOSITY MAKE_INSTALL_VNAME \ + MAKE_SUBDIRS MIRRORS MIRRORS_GIT NO_CLEAN NO_CLEAN_BASE_DIR NO_CLEAN_BUILD_DIR \ + NO_LOG_VARS PATCHES_EXTRA PKG_CONFIG PKG_CONFIG_LIBDIR PKGLIST_DISABLE PREFIX \ + PYTHON RANLIB RPM_DISABLE SHA256SUM SOFORT_NATIVE_CC SOFORT_NATIVE_CFLAGS \ + SOFORT_NATIVE_CFLAGS_EXTRA SOFORT_NATIVE_CXX SOFORT_NATIVE_CXXFLAGS \ + SOFORT_NATIVE_CXXFLAGS_EXTRA SOFORT_NATIVE_LD SOFORT_NATIVE_LDFLAGS \ + SOFORT_NATIVE_LDFLAGS_EXTRA SUBDIR TARGET URL URLS_GIT VARS_FILE VERSION"; \ # # Prerequisite commands @@ -142,13 +142,16 @@ rtl_get_var_unsafe \$DEFAULT_LDFLAGS_RUNTIME -u "DEFAULT_LDFLAGS_${BUILD_KIND}_R # Target-relative toolchain defaults : ${DEFAULT_CROSS_AR:=${DEFAULT_TARGET}-ar}; : ${DEFAULT_CROSS_CC:=${DEFAULT_TARGET}-gcc}; +: ${DEFAULT_CROSS_CCLD:=${DEFAULT_TARGET}-gcc}; : ${DEFAULT_CROSS_CMAKE:=cmake}; : ${DEFAULT_CROSS_CXX:=${DEFAULT_TARGET}-g++}; +: ${DEFAULT_CROSS_LD:=${DEFAULT_TARGET}-ld}; : ${DEFAULT_CROSS_LIBTOOL:=slibtool}; : ${DEFAULT_CROSS_MAKE:=make}; : ${DEFAULT_CROSS_RANLIB:=${DEFAULT_TARGET}-ranlib}; : ${DEFAULT_HOST_AR:=ar}; : ${DEFAULT_HOST_CC:=gcc}; +: ${DEFAULT_HOST_CCLD:=gcc}; : ${DEFAULT_HOST_CMAKE:=cmake}; : ${DEFAULT_HOST_CXX:=g++}; : ${DEFAULT_HOST_LD:=ld}; @@ -159,6 +162,7 @@ rtl_get_var_unsafe \$DEFAULT_LDFLAGS_RUNTIME -u "DEFAULT_LDFLAGS_${BUILD_KIND}_R : ${DEFAULT_HOST_RANLIB:=ranlib}; : ${DEFAULT_NATIVE_AR:=${DEFAULT_TARGET}-ar}; : ${DEFAULT_NATIVE_CC:=${DEFAULT_TARGET}-gcc}; +: ${DEFAULT_NATIVE_CCLD:=${DEFAULT_TARGET}-gcc}; : ${DEFAULT_NATIVE_CMAKE:=cmake}; : ${DEFAULT_NATIVE_CXX:=${DEFAULT_TARGET}-g++}; : ${DEFAULT_NATIVE_LD:=${DEFAULT_TARGET}-ld}; @@ -175,7 +179,8 @@ rtl_get_var_unsafe \$DEFAULT_LDFLAGS_RUNTIME -u "DEFAULT_LDFLAGS_${BUILD_KIND}_R : ${DEFAULT_GITROOT:=git://midipix.org}; : ${DEFAULT_GITROOT_HEAD:=git://midipix.org}; : ${DEFAULT_MAKE_INSTALL_VNAME:=DESTDIR}; -: ${DEFAULT_MAKEFLAGS_PARALLELISE:="-j${DEFAULT_BUILD_CPUS} -l${DEFAULT_BUILD_CPUS}"}; +: ${DEFAULT_MAKEFLAGS_LOADAVG:="-l${DEFAULT_BUILD_CPUS}"}; +: ${DEFAULT_MAKEFLAGS_PARALLELISE:="-j${DEFAULT_BUILD_CPUS}"}; : ${DEFAULT_MAKEFLAGS_VERBOSITY:="V=99 VERBOSE=1"}; : ${DEFAULT_GIT_ARGS:=""}; : ${DEFAULT_TIMESTAMP_FMT:="%Y/%m/%d %H:%M:%S"}; @@ -197,7 +202,7 @@ rtl_get_var_unsafe \$DEFAULT_LDFLAGS_RUNTIME -u "DEFAULT_LDFLAGS_${BUILD_KIND}_R : ${DEFAULT_SOFORT_NATIVE_CFLAGS:="-I${PREFIX}/include"}; : ${DEFAULT_SOFORT_NATIVE_CXX:="${DEFAULT_HOST_CXX}"}; : ${DEFAULT_SOFORT_NATIVE_CXXFLAGS:="-I${PREFIX}/include"}; -: ${DEFAULT_SOFORT_NATIVE_LD:="${DEFAULT_HOST_LD}"}; +: ${DEFAULT_SOFORT_NATIVE_LD:="${DEFAULT_HOST_CCLD}"}; : ${DEFAULT_SOFORT_NATIVE_LDFLAGS:="-L${PREFIX}/lib -Wl,-rpath,${PREFIX}/lib"}; # diff --git a/subr.ex/ex_pkg_run.subr b/subr.ex/ex_pkg_run.subr new file mode 100644 index 00000000..38f48f34 --- /dev/null +++ b/subr.ex/ex_pkg_run.subr @@ -0,0 +1,400 @@ +# +# Copyright (c) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 LucĂ­a Andrea Illanes Albornoz +# set +o errexit -o noglob -o nounset is assumed. +# +# Package {configure,make} command execution +# + +# +# ex_pkg_run_configure() - run configure script +# @_ar: ar(1) command name or pathname +# @_cc: C compiler command name or pathname +# @_configure: configure script command name or pathname +# @_cxx: C++ compiler command name or pathname +# @_ld: ld(1) command name or pathname +# @_libtool: libtool(1) command name or pathname or "none" +# @_pkg_config: pkg-config(1) command name or pathname +# @_python: python command name or pathname +# @_ranlib: ranlib(1) command name or pathname +# @--: (ignored) +# @_flags: configure script flags as a whitespace-separated list +# @_flags_extra: extra configure script flags as a whitespace-separated likst +# @_flags_list: configure script flags as a :-separated list +# @_flags_extra_list: extra configure script flags as a :-separated list +# @--: (ignored) +# @_cflags: $CFLAGS +# @_cflags_extra: extra $CFLAGS +# @_cppflags: $CPPFLAGS +# @_cppflags_extra: extra $CPPFLAGS +# @_cxxflags: $CXXFLAGS +# @_cxxflags_extra: extra $CXXFLAGS +# @_ldflags: $LDFLAGS +# @_ldflags_extra: extra $LDFLAGS +# @_pkg_config_libdir: pkg-config(1) search directory +# +# Returns: zero (0) on success, non-zero (>0) on failure +# +ex_pkg_run_configure() { + local _eprc_ar="${1}" _eprc_cc="${2}" _eprc_configure="${3}" _eprc_cxx="${4}" _eprc_ld="${5}" \ + _eprc_libtool="${6}" _eprc_pkg_config="${7}" _eprc_python="${8}" _eprc_ranlib="${9}" \ + _eprc_ignored="${10}" \ + _eprc_flags="${11}" _eprc_flags_extra="${12}" \ + _eprc_flags_list="${13}" _eprc_flags_extra_list="${14}" \ + _eprc_ignored="${15}" \ + _eprc_cflags="${16}" _eprc_cflags_extra="${17}" _eprc_cppflags="${18}" \ + _eprc_cppflags_extra="${19}" _eprc_cxxflags="${20}" _eprc_cxxflags_extra="${21}" \ + _eprc_ldflags="${22}" _eprc_ldflags_extra="${23}" _eprc_pkg_config_libdir="${24}" \ + _eprc_rc=0; + + case "${_eprc_libtool:-}" in + none) _eprc_libtool=""; ;; + esac; + + [ "${_eprc_cflags_extra:+1}" = 1 ] && _eprc_cflags="${_eprc_cflags:+${_eprc_cflags} }${_eprc_cflags_extra}"; + [ "${_eprc_cppflags_extra:+1}" = 1 ] && _eprc_cppflags="${_eprc_cppflags:+${_eprc_cppflags} }${_eprc_cppflags_extra}"; + [ "${_eprc_cxxflags_extra:+1}" = 1 ] && _eprc_cxxflags="${_eprc_cxxflags:+${_eprc_cxxflags} }${_eprc_cxxflags_extra}"; + [ "${_eprc_ldflags_extra:+1}" = 1 ] && _eprc_ldflags="${_eprc_ldflags:+${_eprc_ldflags} }${_eprc_ldflags_extra}"; + +( + if [ "${_eprc_libtool:+1}" = 1 ]; then + export MAKE="make LIBTOOL=${_eprc_libtool}"; + fi; + + [ "${_eprc_ar:+1}" = 1 ] && export AR="${_eprc_ar}"; + [ "${_eprc_cc:+1}" = 1 ] && export CC="${_eprc_cc}"; + [ "${_eprc_cxx:+1}" = 1 ] && export CXX="${_eprc_cxx}"; + [ "${_eprc_ld:+1}" = 1 ] && export LD="${_eprc_ld}"; + [ "${_eprc_libtool:+1}" = 1 ] && export LIBTOOL="${_eprc_libtool}"; + [ "${_eprc_pkg_config:+1}" = 1 ] && export PKG_CONFIG="${_eprc_pkg_config}"; + [ "${_eprc_python:+1}" = 1 ] && export PYTHON="${_eprc_python}"; + [ "${_eprc_ranlib:+1}" = 1 ] && export RANLIB="${_eprc_ranlib}"; + + [ "${_eprc_cflags:+1}" = 1 ] && export CFLAGS="${_eprc_cflags}"; + [ "${_eprc_cppflags:+1}" = 1 ] && export CPPFLAGS="${_eprc_cppflags}"; + [ "${_eprc_cxxflags:+1}" = 1 ] && export CXXFLAGS="${_eprc_cxxflags}"; + [ "${_eprc_ldflags:+1}" = 1 ] && export LDFLAGS="${_eprc_ldflags}"; + [ "${_eprc_pkg_config_libdir:+1}" = 1 ] && export PKG_CONFIG_LIBDIR="${_eprc_pkg_config_libdir}"; + + if [ "${_eprc_flags_list:+1}" = 1 ]; then + rtl_run_cmdlineV ":" "${_eprc_configure}" \ + "${_eprc_flags_list}" \ + "${_eprc_flags_extra_list:-}" \ + ; + exit "${?}"; + elif [ "${_eprc_flags_extra_list:+1}" = 1 ]; then + rtl_run_cmdlineV ":" "${_eprc_configure}" \ + ${_eprc_flags:-} \ + "${_eprc_flags_extra_list:-}" \ + ; + exit "${?}"; + else + rtl_run_cmdlineV ":" "${_eprc_configure}" \ + ${_eprc_flags:-} \ + ${_eprc_flags_extra:-} \ + ; + exit "${?}"; + fi; +); + _eprc_rc="${?}"; + + return "${_eprc_rc}"; +}; + +# +# ex_pkg_run_configure_cmake() - run configure script +# @_ar: ar(1) command name or pathname +# @_cc: C compiler command name or pathname +# @_ccache: ccache(1) command name or pathname or "" +# @_cmake: CMake command name or pathname +# @_cxx: C++ compiler command name or pathname +# @_ld: ld(1) command name or pathname +# @_pkg_config: pkg-config(1) command name or pathname +# @_python: python command name or pathname +# @_ranlib: ranlib(1) command name or pathname +# @--: (ignored) +# @_build_type: CMake build type (host, cross, native) +# @_cmake_args: additional CMake arguments as a whitespace-separated list +# @_cmake_args_extra: additional CMake extra arguments as a whitespace-separated likst +# @_prefix: build prefix pathname +# @_subdir: CMake build directory pathname +# @_system_name: CMake system name +# @_system_processor: CMake system processor +# @--: (ignored) +# @_cflags: $CFLAGS +# @_cflags_extra: extra $CFLAGS +# @_cppflags: $CPPFLAGS +# @_cppflags_extra: extra $CPPFLAGS +# @_cxxflags: $CXXFLAGS +# @_cxxflags_extra: extra $CXXFLAGS +# @_ldflags: $LDFLAGS +# @_ldflags_extra: extra $LDFLAGS +# @_pkg_config_libdir: pkg-config(1) search directory +# +# Returns: zero (0) on success, non-zero (>0) on failure +# +ex_pkg_run_configure_cmake() { + local _eprcc_ar="${1}" _eprcc_cc="${2}" _eprcc_ccache="${3}" _eprcc_cmake="${4}" \ + _eprcc_cxx="${5}" _eprcc_ld="${6}" _eprcc_pkg_config="${7}" _eprcc_python="${8}" \ + _eprcc_ranlib="${9}" \ + _eprcc_ignored="${10}" \ + _eprcc_build_type="${11}" \ + _eprcc_cmake_args="${12}" _eprcc_cmake_args_extra="${13}" \ + _eprcc_prefix="${14}" _eprcc_subdir="${15}" \ + _eprcc_system_name="${16}" _eprcc_system_processor="${17}" \ + _eprcc_ignored="${18}" \ + _eprcc_cflags="${19}" _eprcc_cflags_extra="${20}" _eprcc_cppflags="${21}" \ + _eprcc_cppflags_extra="${22}" _eprcc_cxxflags="${23}" _eprcc_cxxflags_extra="${24}" \ + _eprcc_ldflags="${25}" _eprcc_ldflags_extra="${26}" _eprcc_pkg_config_libdir="${27}" \ + _eprcc_cmd_name="" _eprcc_cmake_args_auto="" _eprcc_rc=0 _eprcc_vname="" _eprcc_vval="" + + [ "${_eprcc_cflags_extra:+1}" = 1 ] && _eprcc_cflags="${_eprcc_cflags:+${_eprcc_cflags} }${_eprcc_cflags_extra}"; + [ "${_eprcc_cppflags_extra:+1}" = 1 ] && _eprcc_cppflags="${_eprcc_cppflags:+${_eprcc_cppflags} }${_eprcc_cppflags_extra}"; + [ "${_eprcc_cxxflags_extra:+1}" = 1 ] && _eprcc_cxxflags="${_eprcc_cxxflags:+${_eprcc_cxxflags} }${_eprcc_cxxflags_extra}"; + [ "${_eprcc_ldflags_extra:+1}" = 1 ] && _eprcc_ldflags="${_eprcc_ldflags:+${_eprcc_ldflags} }${_eprcc_ldflags_extra}"; + +( + [ "${_eprcc_pkg_config:+1}" = 1 ] && export PKG_CONFIG="${_eprcc_pkg_config}"; + [ "${_eprcc_pkg_config_libdir:+1}" = 1 ] && export PKG_CONFIG_LIBDIR="${_eprcc_pkg_config_libdir}"; + [ "${_eprcc_python:+1}" = 1 ] && export PYTHON="${_eprcc_python}"; + + for _eprcc_vname in ar cc cxx ld pkg_config ranlib; do + case "${_eprcc_vname}" in + cc|cxx) + _eprcc_vname="_eprcc_${_eprcc_vname}"; + if [ "${_eprcc_ccache:+1}" = 1 ]; then + eval ${_eprcc_vname}="\${${_eprcc_vname}#${_eprcc_ccache} }"; + fi; + ;; + + *) + _eprcc_vname="_eprcc_${_eprcc_vname}"; + ;; + esac; + + if eval [ '"${'"${_eprcc_vname}"':+1}"' = 1 ]\ + && eval [ '"${'"${_eprcc_vname}"'#/}"' = '"${'"${_eprcc_vname}"'}"' ]; then + eval _eprcc_cmd_name="\${${_eprcc_vname}% *}"; + eval _eprcc_vval="\${${_eprcc_vname}#* }"; + eval ${_eprcc_vname}='$(which "${_eprcc_cmd_name}")' || return 1; + fi; + done; + + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_AR=${_eprcc_ar}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_BUILD_TYPE=${_eprcc_build_type}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_C_COMPILER=${_eprcc_cc}" ":"; + if [ "${_eprcc_ccache:+1}" = 1 ]; then + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_C_COMPILER_LAUNCHER=${_eprcc_ccache}" ":"; + fi; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_C_FLAGS=${_eprcc_cflags}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_CPP_FLAGS=${_eprcc_cppflags}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_CXX_COMPILER=${_eprcc_cxx}" ":"; + if [ "${_eprcc_ccache:+1}" = 1 ]; then + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_CXX_COMPILER_LAUNCHER=${_eprcc_ccache}" ":"; + fi; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_CXX_FLAGS=${_eprcc_cxxflags}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_EXE_LINKER_FLAGS=${_eprcc_ldflags}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_FIND_ROOT_PATH=${_eprcc_prefix}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_INSTALL_PREFIX=" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_LINKER=${_eprcc_ld}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_MODULE_LINKER_FLAGS=${_eprcc_ldflags}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_RANLIB=${_eprcc_ranlib}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_SHARED_LINKER_FLAGS=${_eprcc_ldflags}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_SYSTEM_PROCESSOR=${_eprcc_system_processor}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DPKG_CONFIG_EXECUTABLE=${_eprcc_pkg_config}" ":"; + + case "${_eprcc_build_type}" in + native) + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_SYSROOT=${_eprcc_prefix}" ":"; + rtl_lconcat \$_eprcc_cmake_args_auto "-DCMAKE_SYSTEM_NAME=${_eprcc_system_name}" ":"; + ;; + esac; + + rtl_run_cmdlineV ":" "${_eprcc_cmake}" \ + "${_eprcc_cmake_args_auto}" \ + ${_eprcc_cmake_args:-} \ + ${_eprcc_cmake_args_extra:-} \ + "${_eprcc_subdir}"; + exit "${?}"; +); + _eprcc_rc="${?}"; + + return "${_eprcc_rc}"; +}; + +# +# ex_pkg_run_make() - run make(1) +# @_ar: ar(1) command name or pathname +# @_cc: C compiler command name or pathname +# @_cxx: C++ compiler command name or pathname +# @_ld: ld(1) command name or pathname +# @_libtool: libtool(1) command name or pathname or "none" +# @_make: make(1) command name or pathname +# @_pkg_config: pkg-config(1) command name or pathname +# @_ranlib: ranlib(1) command name or pathname +# @--: (ignored) +# @_set_ccfl: 1 if CC=... is to be passed to make(1), 0 if CC=... is not to be passed to make(1) +# @_subdir: make(1) -C argument +# @--: (ignored) +# @_makeflags: make(1) flags as a whitespace-separated list +# @_makeflags_extra: extra make(1) flags as a whitespace-separated likst +# @_makeflags_list: make(1) flags as a :-separated list +# @_makeflags_extra_list: extra make(1) flags as a :-separated list +# @_makeflags_loadavg: make(1) -l load argument +# @_makeflags_parallelise: make(1) -j jobs argument +# @_makeflags_verbosity: make(1) Makefile verbosity arguments or "none" +# @--: (ignored) +# @_cflags: $CFLAGS +# @_cflags_extra: extra $CFLAGS +# @_cppflags: $CPPFLAGS +# @_cppflags_extra: extra $CPPFLAGS +# @_cxxflags: $CXXFLAGS +# @_cxxflags_extra: extra $CXXFLAGS +# @_ldflags: $LDFLAGS +# @_ldflags_extra: extra $LDFLAGS +# @_pkg_config_libdir: pkg-config(1) search directory +# @--: (ignored) +# @_destdir_spec: DESTDIR=... specification +# @_target: make(1) target +# +# Returns: zero (0) on success, non-zero (>0) on failure +# +ex_pkg_run_make() { + local _eprm_ar="${1}" _eprm_cc="${2}" _eprm_cxx="${3}" _eprm_ld="${4}" \ + _eprm_libtool="${5}" _eprm_make="${6}" _eprm_pkg_config="${7}" _eprm_ranlib="${8}" \ + _eprm_ignored="${9}" \ + _eprm_set_ccfl="${10}" _eprm_subdir="${11}" \ + _eprm_ignored="${12}" \ + _eprm_makeflags="${13}" _eprm_makeflags_extra="${14}" _eprm_makeflags_list="${15}" \ + _eprm_makeflags_extra_list="${16}" _eprm_makeflags_loadavg="${17}" \ + _eprm_makeflags_parallelise="${18}" _eprm_makeflags_verbosity="${19}" \ + _eprm_ignored="${20}" \ + _eprm_cflags="${21}" _eprm_cflags_extra="${22}" _eprm_cppflags="${23}" \ + _eprm_cppflags_extra="${24}" _eprm_cxxflags="${25}" _eprm_cxxflags_extra="${26}" \ + _eprm_ldflags="${27}" _eprm_ldflags_extra="${28}" _eprm_pkg_config_libdir="${29}" \ + _eprm_ignored="${30}" \ + _eprm_destdir_spec="${31}" _eprm_target="${32}" \ + _eprm_rc=0; + + case "${_eprm_makeflags_loadavg:-}" in + none) _eprm_makeflags_loadavg=""; ;; + esac; + + case "${_eprm_libtool:-}" in + none) _eprm_libtool=""; ;; + esac; + + case "${_eprm_makeflags_verbosity}" in + none) _eprm_makeflags_verbosity=""; ;; + esac; + + case "${_eprm_set_ccfl}" in + 1) _eprm_set_ccfl="1"; ;; + *) _eprm_set_ccfl=""; ;; + esac; + +( + if [ "${_eprm_libtool:+1}" = 1 ]; then + export MAKE="make LIBTOOL=${_eprm_libtool}"; + fi; + + if [ "${_eprm_makeflags_list:+1}" = 1 ]; then + rtl_run_cmdlineV ":" "${_eprm_make}" \ + AR="${_eprm_ar}" \ + ${_eprm_set_ccfl:+CC="${_eprm_cc}"} \ + ${_eprm_set_ccfl:+CXX="${_eprm_cxx}"} \ + LD="${_eprm_ld}" \ + ${_eprm_libtool:+LIBTOOL="${_eprm_libtool}"} \ + ${_eprm_pkg_config:+PKG_CONFIG="${_eprm_pkg_config}"} \ + RANLIB="${_eprm_ranlib}" \ + \ + "${_eprm_makeflags_list}" \ + "${_eprm_makeflags_extra_list:-}" \ + ${_eprm_makeflags_loadavg:-} \ + ${_eprm_makeflags_parallelise:-} \ + ${_eprm_makeflags_verbosity} \ + \ + ${_eprm_cflags:+CFLAGS="${_eprm_cflags}"} \ + ${_eprm_cflags_extra:+CFLAGS+="${_eprm_cflags_extra}"} \ + ${_eprm_cppflags:+CPPFLAGS="${_eprm_cppflags}"} \ + ${_eprm_cppflags_extra:+CPPFLAGS+="${_eprm_cppflags_extra}"} \ + ${_eprm_cxxflags:+CXXFLAGS="${_eprm_cxxflags}"} \ + ${_eprm_cxxflags_extra:+CXXFLAGS+="${_eprm_cxxflags_extra}"} \ + ${_eprm_ldflags:+LDFLAGS="${_eprm_ldflags}"} \ + ${_eprm_ldflags_extra:+LDFLAGS+="${_eprm_ldflags_extra}"} \ + ${_eprm_pkg_config_libdir:+PKG_CONFIG_LIBDIR="${_eprm_pkg_config_libdir}"} \ + \ + ${_eprm_subdir:+-C "${_eprm_subdir}"} \ + ${_eprm_destdir_spec:+"${_eprm_destdir_spec}"} \ + ${_eprm_target:+"${_eprm_target}"} \ + ; + exit "${?}"; + elif [ "${_eprm_makeflags_extra_list:+1}" = 1 ]; then + rtl_run_cmdlineV ":" "${_eprm_make}" \ + AR="${_eprm_ar}" \ + ${_eprm_set_ccfl:+CC="${_eprm_cc}"} \ + ${_eprm_set_ccfl:+CXX="${_eprm_cxx}"} \ + LD="${_eprm_ld}" \ + ${_eprm_libtool:+LIBTOOL="${_eprm_libtool}"} \ + ${_eprm_pkg_config:+PKG_CONFIG="${_eprm_pkg_config}"} \ + RANLIB="${_eprm_ranlib}" \ + \ + ${_eprm_makeflags:-} \ + "${_eprm_makeflags_extra_list}" \ + ${_eprm_makeflags_loadavg:-} \ + ${_eprm_makeflags_parallelise:-} \ + ${_eprm_makeflags_verbosity} \ + \ + ${_eprm_cflags:+CFLAGS="${_eprm_cflags}"} \ + ${_eprm_cflags_extra:+CFLAGS+="${_eprm_cflags_extra}"} \ + ${_eprm_cppflags:+CPPFLAGS="${_eprm_cppflags}"} \ + ${_eprm_cppflags_extra:+CPPFLAGS+="${_eprm_cppflags_extra}"} \ + ${_eprm_cxxflags:+CXXFLAGS="${_eprm_cxxflags}"} \ + ${_eprm_cxxflags_extra:+CXXFLAGS+="${_eprm_cxxflags_extra}"} \ + ${_eprm_ldflags:+LDFLAGS="${_eprm_ldflags}"} \ + ${_eprm_ldflags_extra:+LDFLAGS+="${_eprm_ldflags_extra}"} \ + ${_eprm_pkg_config_libdir:+PKG_CONFIG_LIBDIR="${_eprm_pkg_config_libdir}"} \ + \ + ${_eprm_subdir:+-C "${_eprm_subdir}"} \ + ${_eprm_destdir_spec:+"${_eprm_destdir_spec}"} \ + ${_eprm_target:+"${_eprm_target}"} \ + ; + exit "${?}"; + else + rtl_run_cmdlineV ":" "${_eprm_make}" \ + AR="${_eprm_ar}" \ + ${_eprm_set_ccfl:+CC="${_eprm_cc}"} \ + ${_eprm_set_ccfl:+CXX="${_eprm_cxx}"} \ + LD="${_eprm_ld}" \ + ${_eprm_libtool:+LIBTOOL="${_eprm_libtool}"} \ + ${_eprm_pkg_config:+PKG_CONFIG="${_eprm_pkg_config}"} \ + RANLIB="${_eprm_ranlib}" \ + \ + ${_eprm_makeflags:-} \ + ${_eprm_makeflags_extra:-} \ + ${_eprm_makeflags_loadavg:-} \ + ${_eprm_makeflags_parallelise:-} \ + ${_eprm_makeflags_verbosity} \ + \ + ${_eprm_cflags:+CFLAGS="${_eprm_cflags}"} \ + ${_eprm_cflags_extra:+CFLAGS+="${_eprm_cflags_extra}"} \ + ${_eprm_cppflags:+CPPFLAGS="${_eprm_cppflags}"} \ + ${_eprm_cppflags_extra:+CPPFLAGS+="${_eprm_cppflags_extra}"} \ + ${_eprm_cxxflags:+CXXFLAGS="${_eprm_cxxflags}"} \ + ${_eprm_cxxflags_extra:+CXXFLAGS+="${_eprm_cxxflags_extra}"} \ + ${_eprm_ldflags:+LDFLAGS="${_eprm_ldflags}"} \ + ${_eprm_ldflags_extra:+LDFLAGS+="${_eprm_ldflags_extra}"} \ + ${_eprm_pkg_config_libdir:+PKG_CONFIG_LIBDIR="${_eprm_pkg_config_libdir}"} \ + \ + ${_eprm_subdir:+-C "${_eprm_subdir}"} \ + ${_eprm_destdir_spec:+"${_eprm_destdir_spec}"} \ + ${_eprm_target:+"${_eprm_target}"} \ + ; + exit "${?}"; + fi; +); + _eprm_rc="${?}"; + + return "${_eprm_rc}"; +}; + +# vim:filetype=sh textwidth=0 diff --git a/subr.pkg/pkg_build.subr b/subr.pkg/pkg_build.subr index 6eae1093..a11e87ac 100644 --- a/subr.pkg/pkg_build.subr +++ b/subr.pkg/pkg_build.subr @@ -5,20 +5,9 @@ pkg_build() { local _pb_group_name="${1}" _pb_pkg_name="${2}" _pb_restart_at="${3}" \ - _pb_libtool="" _pb_makeflags_verbosity="" _pb_no_autoconf="" \ - _pb_rc=0 _pb_subdir=""; - _pb_makeflags_verbosity="${PKG_MAKEFLAGS_VERBOSITY:-none}"; - if [ "${_pb_makeflags_verbosity}" = "none" ]; then - _pb_makeflags_verbosity=""; - fi; - - case "${PKG_LIBTOOL:-}" in - "") _pb_libtool=""; ;; - none) _pb_libtool=""; ;; - *) _pb_libtool="${PKG_LIBTOOL}"; ;; - esac; + _pb_no_autoconf="" _pb_rc=0 _pb_subdir=""; - if [ ! -x "${PKG_CONFIGURE:-}" ]; then + if ! [ -x "${PKG_CONFIGURE:-}" ]; then _pb_no_autoconf=1; fi; @@ -27,84 +16,31 @@ pkg_build() { _pb_subdir=""; fi; - if [ "${#_pb_libtool}" -gt 0 ]; then - export MAKE="make LIBTOOL=${_pb_libtool}"; - fi; - - # N.B. We only specify CC= here if the current package does not use GNU + # + # N.B. We only pass CC=... here if the current package does not use GNU # autoconf as it often abuses it by appending -std={gnu99,...} to it # instead of amending CFLAGS. - if [ "${PKG_MAKEFLAGS_BUILD_LIST:+1}" = 1 ]; then - rtl_run_cmdlineV ":" "${PKG_MAKE}" \ - "AR=${PKG_AR}" \ - "${_pb_no_autoconf:+CC=${PKG_CC}}" \ - "RANLIB=${PKG_RANLIB}" \ - "${PKG_MAKEFLAGS_BUILD_LIST}" \ - "${PKG_MAKEFLAGS_BUILD_EXTRA_LIST:-}" \ - ${PKG_MAKEFLAGS_PARALLELISE:-} \ - "${PKG_CFLAGS_BUILD:+CFLAGS=${PKG_CFLAGS_BUILD}}" \ - "${PKG_CFLAGS_BUILD_EXTRA:+CFLAGS+=${PKG_CFLAGS_BUILD_EXTRA}}" \ - "${PKG_CPPFLAGS_BUILD:+CPPFLAGS=${PKG_CPPFLAGS_BUILD}}" \ - "${PKG_CPPFLAGS_BUILD_EXTRA:+CPPFLAGS+=${PKG_CPPFLAGS_BUILD_EXTRA}}" \ - "${PKG_CXXFLAGS_BUILD:+CXXFLAGS=${PKG_CXXFLAGS_BUILD}}" \ - "${PKG_CXXFLAGS_BUILD_EXTRA:+CXXFLAGS+=${PKG_CXXFLAGS_BUILD_EXTRA}}" \ - "${PKG_LDFLAGS_BUILD:+LDFLAGS=${PKG_LDFLAGS_BUILD}}" \ - "${PKG_LDFLAGS_BUILD_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_BUILD_EXTRA}}" \ - "${PKG_PKG_CONFIG:+PKG_CONFIG=${PKG_PKG_CONFIG}}" \ - "${PKG_PKG_CONFIG_LIBDIR:+PKG_CONFIG_LIBDIR=${PKG_PKG_CONFIG_LIBDIR}}" \ - ${_pb_libtool:+"LIBTOOL=${_pb_libtool}"} \ - ${_pb_makeflags_verbosity} \ - ${_pb_subdir:+-C "${_pb_subdir}"}; - _pb_rc="${?}"; - elif [ "${PKG_MAKEFLAGS_BUILD_EXTRA_LIST:+1}" = 1 ]; then - rtl_run_cmdlineV ":" "${PKG_MAKE}" \ - "AR=${PKG_AR}" \ - "${_pb_no_autoconf:+CC=${PKG_CC}}" \ - "RANLIB=${PKG_RANLIB}" \ - ${PKG_MAKEFLAGS_BUILD:-} \ - "${PKG_MAKEFLAGS_BUILD_EXTRA_LIST}" \ - ${PKG_MAKEFLAGS_PARALLELISE:-} \ - "${PKG_CFLAGS_BUILD:+CFLAGS=${PKG_CFLAGS_BUILD}}" \ - "${PKG_CFLAGS_BUILD_EXTRA:+CFLAGS+=${PKG_CFLAGS_BUILD_EXTRA}}" \ - "${PKG_CPPFLAGS_BUILD:+CPPFLAGS=${PKG_CPPFLAGS_BUILD}}" \ - "${PKG_CPPFLAGS_BUILD_EXTRA:+CPPFLAGS+=${PKG_CPPFLAGS_BUILD_EXTRA}}" \ - "${PKG_CXXFLAGS_BUILD:+CXXFLAGS=${PKG_CXXFLAGS_BUILD}}" \ - "${PKG_CXXFLAGS_BUILD_EXTRA:+CXXFLAGS+=${PKG_CXXFLAGS_BUILD_EXTRA}}" \ - "${PKG_LDFLAGS_BUILD:+LDFLAGS=${PKG_LDFLAGS_BUILD}}" \ - "${PKG_LDFLAGS_BUILD_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_BUILD_EXTRA}}" \ - "${PKG_PKG_CONFIG:+PKG_CONFIG=${PKG_PKG_CONFIG}}" \ - "${PKG_PKG_CONFIG_LIBDIR:+PKG_CONFIG_LIBDIR=${PKG_PKG_CONFIG_LIBDIR}}" \ - ${_pb_libtool:+"LIBTOOL=${_pb_libtool}"} \ - ${_pb_makeflags_verbosity} \ - ${_pb_subdir:+-C "${_pb_subdir}"}; - _pb_rc="${?}"; - else - rtl_run_cmdlineV ":" "${PKG_MAKE}" \ - "AR=${PKG_AR}" \ - "${_pb_no_autoconf:+CC=${PKG_CC}}" \ - "RANLIB=${PKG_RANLIB}" \ - ${PKG_MAKEFLAGS_BUILD:-} \ - ${PKG_MAKEFLAGS_BUILD_EXTRA:-} \ - ${PKG_MAKEFLAGS_PARALLELISE:-} \ - "${PKG_CFLAGS_BUILD:+CFLAGS=${PKG_CFLAGS_BUILD}}" \ - "${PKG_CFLAGS_BUILD_EXTRA:+CFLAGS+=${PKG_CFLAGS_BUILD_EXTRA}}" \ - "${PKG_CPPFLAGS_BUILD:+CPPFLAGS=${PKG_CPPFLAGS_BUILD}}" \ - "${PKG_CPPFLAGS_BUILD_EXTRA:+CPPFLAGS+=${PKG_CPPFLAGS_BUILD_EXTRA}}" \ - "${PKG_CXXFLAGS_BUILD:+CXXFLAGS=${PKG_CXXFLAGS_BUILD}}" \ - "${PKG_CXXFLAGS_BUILD_EXTRA:+CXXFLAGS+=${PKG_CXXFLAGS_BUILD_EXTRA}}" \ - "${PKG_LDFLAGS_BUILD:+LDFLAGS=${PKG_LDFLAGS_BUILD}}" \ - "${PKG_LDFLAGS_BUILD_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_BUILD_EXTRA}}" \ - "${PKG_PKG_CONFIG:+PKG_CONFIG=${PKG_PKG_CONFIG}}" \ - "${PKG_PKG_CONFIG_LIBDIR:+PKG_CONFIG_LIBDIR=${PKG_PKG_CONFIG_LIBDIR}}" \ - ${_pb_libtool:+"LIBTOOL=${_pb_libtool}"} \ - ${_pb_makeflags_verbosity} \ - ${_pb_subdir:+-C "${_pb_subdir}"}; - _pb_rc="${?}"; - fi; - - if [ "${#_pb_libtool}" -gt 0 ]; then - unset MAKE; - fi; + # + ex_pkg_run_make \ + "${PKG_AR}" "${PKG_CC}" "${PKG_CXX}" "${PKG_CCLD}" "${PKG_LIBTOOL}" \ + "${PKG_MAKE}" "${PKG_PKG_CONFIG}" "${PKG_RANLIB}" \ + -- \ + "${_pb_no_autoconf}" "${_pb_subdir}" \ + -- \ + "${PKG_MAKEFLAGS_BUILD:-}" "${PKG_MAKEFLAGS_BUILD_EXTRA:-}" \ + "${PKG_MAKEFLAGS_BUILD_LIST:-}" "${PKG_MAKEFLAGS_BUILD_EXTRA_LIST:-}" \ + "${PKG_MAKEFLAGS_LOADAVG:-}" "${PKG_MAKEFLAGS_PARALLELISE:-}" \ + "${PKG_MAKEFLAGS_VERBOSITY:-}" \ + -- \ + "${PKG_CFLAGS_BUILD:-}" "${PKG_CFLAGS_BUILD_EXTRA:-}" \ + "${PKG_CPPFLAGS_BUILD:-}" "${PKG_CPPFLAGS_BUILD_EXTRA:-}" \ + "${PKG_CXXFLAGS_BUILD:-}" "${PKG_CXXFLAGS_BUILD_EXTRA:-}" \ + "${PKG_LDFLAGS_BUILD:-}" "${PKG_LDFLAGS_BUILD_EXTRA:-}" \ + "${PKG_PKG_CONFIG_LIBDIR:-}" \ + -- \ + "" "" \ + ; + _pb_rc="${?}"; if [ "${_pb_rc}" -ne 0 ]; then break; diff --git a/subr.pkg/pkg_build_clean.subr b/subr.pkg/pkg_build_clean.subr index f92bfd6d..3cd78bb9 100644 --- a/subr.pkg/pkg_build_clean.subr +++ b/subr.pkg/pkg_build_clean.subr @@ -5,57 +5,45 @@ pkg_build_clean() { local _pbc_group_name="${1}" _pbc_pkg_name="${2}" _pbc_restart_at="${3}" \ - _pbc_libtool="" _pbc_makeflags_verbosity="${PKG_MAKEFLAGS_VERBOSITY:-}" \ _pbc_no_autoconf="" _pbc_rc=0 _pbc_subdir=""; - if ex_pkg_state_test "${PKG_NAME}" "build" "${_pbc_restart_at}"; then - case "${PKG_LIBTOOL:-}" in - "") _pbc_libtool=""; ;; - none) _pbc_libtool=""; ;; - *) _pbc_libtool="${PKG_LIBTOOL}"; ;; - esac; - [ ! -x "${PKG_CONFIGURE:-}" ] && _pbc_no_autoconf=1; + if ! [ -x "${PKG_CONFIGURE:-}" ]; then + _pbc_no_autoconf=1; + fi; + if ex_pkg_state_test "${PKG_NAME}" "build" "${_pbc_restart_at}"; then for _pbc_subdir in ${PKG_MAKE_SUBDIRS:-:}; do - [ "${_pbc_subdir}" = ":" ] && _pbc_subdir=""; - [ "${#_pbc_libtool}" -gt 0 ] && export MAKE="make LIBTOOL=${_pbc_libtool}"; - - if [ "${PKG_MAKEFLAGS_BUILD_LIST:+1}" = 1 ]; then - rtl_run_cmdlineV ":" "${PKG_MAKE}" \ - "${PKG_MAKEFLAGS_BUILD_LIST}" \ - "${PKG_MAKEFLAGS_BUILD_EXTRA_LIST:-}" \ - ${PKG_MAKEFLAGS_PARALLELISE:-} \ - ${_pbc_libtool:+"LIBTOOL=${_pbc_libtool}"} \ - ${_pbc_makeflags_verbosity} \ - ${_pbc_subdir:+-C "${_pbc_subdir}"} \ - clean; - _pbc_rc="${?}"; - elif [ "${PKG_MAKEFLAGS_BUILD_EXTRA_LIST:+1}" = 1 ]; then - rtl_run_cmdlineV ":" "${PKG_MAKE}" \ - ${PKG_MAKEFLAGS_BUILD:-} \ - "${PKG_MAKEFLAGS_BUILD_EXTRA_LIST}" \ - ${PKG_MAKEFLAGS_PARALLELISE:-} \ - ${_pbc_libtool:+"LIBTOOL=${_pbc_libtool}"} \ - ${_pbc_makeflags_verbosity} \ - ${_pbc_subdir:+-C "${_pbc_subdir}"} \ - clean; - _pbc_rc="${?}"; - else - rtl_run_cmdlineV ":" "${PKG_MAKE}" \ - ${PKG_MAKEFLAGS_BUILD:-} \ - ${PKG_MAKEFLAGS_BUILD_EXTRA:-} \ - ${PKG_MAKEFLAGS_PARALLELISE:-} \ - ${_pbc_libtool:+"LIBTOOL=${_pbc_libtool}"} \ - ${_pbc_makeflags_verbosity} \ - ${_pbc_subdir:+-C "${_pbc_subdir}"} \ - clean; - _pbc_rc="${?}"; + if [ "${_pbc_subdir}" = ":" ]; then + _pbc_subdir=""; fi; - [ "${#_pbc_libtool}" -gt 0 ] && unset MAKE; - [ "${_pbc_rc}" -ne 0 ] && return 1; + ex_pkg_run_make \ + "${PKG_AR}" "${PKG_CC}" "${PKG_CXX}" "${PKG_CCLD}" "${PKG_LIBTOOL}" \ + "${PKG_MAKE}" "${PKG_PKG_CONFIG}" "${PKG_RANLIB}" \ + -- \ + "${_pbc_no_autoconf}" "${_pbc_subdir}" \ + -- \ + "${PKG_MAKEFLAGS_BUILD:-}" "${PKG_MAKEFLAGS_BUILD_EXTRA:-}" \ + "${PKG_MAKEFLAGS_BUILD_LIST:-}" "${PKG_MAKEFLAGS_BUILD_EXTRA_LIST:-}" \ + "${PKG_MAKEFLAGS_LOADAVG:-}" "${PKG_MAKEFLAGS_PARALLELISE:-}" \ + "${PKG_MAKEFLAGS_VERBOSITY:-}" \ + -- \ + "${PKG_CFLAGS_BUILD:-}" "${PKG_CFLAGS_BUILD_EXTRA:-}" \ + "${PKG_CPPFLAGS_BUILD:-}" "${PKG_CPPFLAGS_BUILD_EXTRA:-}" \ + "${PKG_CXXFLAGS_BUILD:-}" "${PKG_CXXFLAGS_BUILD_EXTRA:-}" \ + "${PKG_LDFLAGS_BUILD:-}" "${PKG_LDFLAGS_BUILD_EXTRA:-}" \ + "${PKG_PKG_CONFIG_LIBDIR:-}" \ + -- \ + "" "clean" \ + ; + _pbc_rc="${?}"; + + if [ "${_pbc_rc}" -ne 0 ]; then + break; + fi; done; fi; + return 0; }; diff --git a/subr.pkg/pkg_configure.subr b/subr.pkg/pkg_configure.subr index 5403caea..71fac55a 100644 --- a/subr.pkg/pkg_configure.subr +++ b/subr.pkg/pkg_configure.subr @@ -4,7 +4,7 @@ # pkgp_configure_autotools() { - local _ppca_libtool="" _ppca_rc=0; + local _ppca_rc=0; if ! [ -x "${PKG_CONFIGURE:-}" ]; then _ppca_rc=2; @@ -13,148 +13,61 @@ pkgp_configure_autotools() { then _ppca_rc=2; else - case "${PKG_LIBTOOL:-}" in - "") _ppca_libtool=""; ;; - none) _ppca_libtool=""; ;; - *) _ppca_libtool="${PKG_LIBTOOL}"; ;; - esac; - - rtl_export_vars \ - PKG_CONFIG "${PKG_PKG_CONFIG:-}" \ - PKG_CONFIG_LIBDIR "${PKG_PKG_CONFIG_LIBDIR:-}" \ - PYTHON "${PKG_PYTHON:-}" \ - ${_ppca_libtool:+MAKE} ${_ppca_libtool:+"make LIBTOOL=${_ppca_libtool}"}; - - if [ "${PKG_CONFIGURE_ARGS_LIST:+1}" = 1 ]; then - AR="${PKG_AR}" \ - CC="${PKG_CC}" \ - RANLIB="${PKG_RANLIB}" \ - CFLAGS="${PKG_CFLAGS_CONFIGURE:-}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}" \ - CPPFLAGS="${PKG_CFLAGS_CONFIGURE:-}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}" \ - CXXFLAGS="${PKG_CXXFLAGS_CONFIGURE:-}${PKG_CXXFLAGS_CONFIGURE_EXTRA:+ ${PKG_CXXFLAGS_CONFIGURE_EXTRA}}" \ - LDFLAGS="${PKG_LDFLAGS_CONFIGURE:-}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}}" \ - rtl_run_cmdlineV ":" "${PKG_CONFIGURE}" \ - "${PKG_CONFIGURE_ARGS_LIST:-}" \ - "${PKG_CONFIGURE_ARGS_EXTRA_LIST:-}"; - _ppca_rc=$((${?} ? 1 : ${_ppca_rc})); - elif [ "${PKG_CONFIGURE_ARGS_EXTRA_LIST:+1}" = 1 ]; then - AR="${PKG_AR}" \ - CC="${PKG_CC}" \ - RANLIB="${PKG_RANLIB}" \ - CFLAGS="${PKG_CFLAGS_CONFIGURE:-}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}" \ - CPPFLAGS="${PKG_CFLAGS_CONFIGURE:-}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}" \ - CXXFLAGS="${PKG_CXXFLAGS_CONFIGURE:-}${PKG_CXXFLAGS_CONFIGURE_EXTRA:+ ${PKG_CXXFLAGS_CONFIGURE_EXTRA}}" \ - LDFLAGS="${PKG_LDFLAGS_CONFIGURE:-}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}}" \ - rtl_run_cmdlineV ":" "${PKG_CONFIGURE}" \ - ${PKG_CONFIGURE_ARGS:-} \ - "${PKG_CONFIGURE_ARGS_EXTRA_LIST:-}"; - _ppca_rc=$((${?} ? 1 : ${_ppca_rc})); - else - AR="${PKG_AR}" \ - CC="${PKG_CC}" \ - RANLIB="${PKG_RANLIB}" \ - CFLAGS="${PKG_CFLAGS_CONFIGURE:-}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}" \ - CPPFLAGS="${PKG_CFLAGS_CONFIGURE:-}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}" \ - CXXFLAGS="${PKG_CXXFLAGS_CONFIGURE:-}${PKG_CXXFLAGS_CONFIGURE_EXTRA:+ ${PKG_CXXFLAGS_CONFIGURE_EXTRA}}" \ - LDFLAGS="${PKG_LDFLAGS_CONFIGURE:-}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}}" \ - "${PKG_CONFIGURE}" \ - ${PKG_CONFIGURE_ARGS:-} \ - ${PKG_CONFIGURE_ARGS_EXTRA:-}; - _ppca_rc=$((${?} ? 1 : ${_ppca_rc})); - fi; - - rtl_export_vars -u \ - PKG_CONFIG "${PKG_PKG_CONFIG:-}" \ - PKG_CONFIG_LIBDIR "${PKG_PKG_CONFIG_LIBDIR:-}" \ - PYTHON "${PKG_PYTHON:-}" \ - ${_ppca_libtool:+MAKE} ${_ppca_libtool:+"make LIBTOOL=${_ppca_libtool}"}; + ex_pkg_run_configure \ + "${PKG_AR}" "${PKG_CC}" "${PKG_CONFIGURE}" "${PKG_CXX}" "${PKG_LD}" \ + "${PKG_LIBTOOL}" "${PKG_PKG_CONFIG}" "${PKG_PYTHON:-}" "${PKG_RANLIB}" \ + -- \ + "${PKG_CONFIGURE_ARGS:-}" "${PKG_CONFIGURE_ARGS_EXTRA:-}" \ + "${PKG_CONFIGURE_ARGS_LIST:-}" "${PKG_CONFIGURE_ARGS_EXTRA_LIST:-}" \ + -- \ + "${PKG_CFLAGS_CONFIGURE:-}" "${PKG_CFLAGS_CONFIGURE_EXTRA:-}" \ + "${PKG_CPPFLAGS_CONFIGURE:-}" "${PKG_CPPFLAGS_CONFIGURE_EXTRA:-}" \ + "${PKG_CXXFLAGS_CONFIGURE:-}" "${PKG_CXXFLAGS_CONFIGURE_EXTRA:-}" \ + "${PKG_LDFLAGS_CONFIGURE:-}" "${PKG_LDFLAGS_CONFIGURE_EXTRA:-}" \ + "${PKG_PKG_CONFIG_LIBDIR:-}" \ + ; + _ppca_rc=$((${?} ? 1 : ${_ppca_rc})); fi; return "${_ppca_rc}"; }; pkgp_configure_cmake() { - local _ppcc_build_type="" _ppcc_cmake_args_auto="" _ppcc_cmd_name="" \ - _ppcc_rc=0 _ppcc_vname="" _ppcc_vval="" _ppcc_IFS0="${IFS:- }" IFS; + local _ppcc_build_type="" _ppcc_rc=0 _ppcc_system_name="" _ppcc_system_processor=""; if [ "${PKG_CMAKE_LISTFILE:+1}" != 1 ]\ || ! [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/${PKG_CMAKE_LISTFILE}" ]; then _ppcc_rc=2; else - rtl_fileop rm config.cache || return 1; - rtl_export_vars \ - PKG_CONFIG "${PKG_PKG_CONFIG:-}" \ - PKG_CONFIG_LIBDIR "${PKG_PKG_CONFIG_LIBDIR:-}" \ - PYTHON "${PKG_PYTHON:-}"; - case "${BUILD_KIND}" in debug) _ppcc_build_type="debug"; ;; release|*) _ppcc_build_type="release"; ;; esac; - for _ppcc_vname in AR CC CXX PKG_CONFIG RANLIB; do - _ppcc_vname="PKG_${_ppcc_vname}"; - if [ "${ARG_CCACHE:+1}" = 1 ]; then - eval ${_ppcc_vname}="\${${_ppcc_vname}#${ARG_CCACHE} }"; - fi; - if eval [ '"${'"${_ppcc_vname}"':+1}"' = 1 ]\ - && eval [ '"${'"${_ppcc_vname}"'#/}"' = '"${'"${_ppcc_vname}"'}"' ]; then - eval _ppcc_cmd_name="\${${_ppcc_vname}% *}"; - eval _ppcc_vval="\${${_ppcc_vname}#* }"; - eval ${_ppcc_vname}='$(which "${_ppcc_cmd_name}")' || return 1; - fi; - done; - - _ppcc_cmake_args_auto=" - -DCMAKE_AR=${PKG_AR} - -DCMAKE_BUILD_TYPE=${_ppcc_build_type} - -DCMAKE_C_COMPILER=${PKG_CC} - ${ARG_CCACHE:+-DCMAKE_C_COMPILER_LAUNCHER=${ARG_CCACHE}} - -DCMAKE_C_FLAGS=${PKG_CFLAGS_CONFIGURE:-}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}} - -DCMAKE_CPP_FLAGS=${PKG_CPPFLAGS_CONFIGURE:-}${PKG_CPPFLAGS_CONFIGURE_EXTRA:+ ${PKG_CPPFLAGS_CONFIGURE_EXTRA}} - -DCMAKE_CXX_COMPILER=${PKG_CXX} - ${ARG_CCACHE:+-DCMAKE_CXX_COMPILER_LAUNCHER=${ARG_CCACHE}} - -DCMAKE_CXX_FLAGS=${PKG_CXXFLAGS_CONFIGURE:-}${PKG_CXXFLAGS_CONFIGURE_EXTRA:+ ${PKG_CXXFLAGS_CONFIGURE_EXTRA}} - -DCMAKE_EXE_LINKER_FLAGS=${PKG_LDFLAGS_CONFIGURE:-}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}} - -DCMAKE_FIND_ROOT_PATH=${PKG_PREFIX} - -DCMAKE_INSTALL_PREFIX= - -DCMAKE_LINKER=$(which "ld") - -DCMAKE_MODULE_LINKER_FLAGS=${PKG_LDFLAGS_CONFIGURE:-}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}} - -DCMAKE_RANLIB=${PKG_RANLIB} - -DCMAKE_SHARED_LINKER_FLAGS=${PKG_LDFLAGS_CONFIGURE:-}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}} - -DPKG_CONFIG_EXECUTABLE=${PKG_PKG_CONFIG}" || return 1; - case "${PKG_BUILD_TYPE}" in - host|cross) - ;; - native) - _ppcc_cmake_args_auto="${_ppcc_cmake_args_auto:+${_ppcc_cmake_args_auto}} - -DCMAKE_LINKER=$(which "${PKG_TARGET}-ld") - -DCMAKE_SYSROOT=${PKG_PREFIX} - -DCMAKE_SYSTEM_NAME=Midipix" || return 1; - + _ppcc_system_name="Midipix"; case "${ARCH}" in - nt32) _ppcc_cmake_args_auto="${_ppcc_cmake_args_auto:+${_ppcc_cmake_args_auto}} - -DCMAKE_SYSTEM_PROCESSOR=i686"; ;; - nt64) _ppcc_cmake_args_auto="${_ppcc_cmake_args_auto:+${_ppcc_cmake_args_auto}} - -DCMAKE_SYSTEM_PROCESSOR=x86_64"; ;; - esac; ;; - + nt32) _ppcc_system_processor="i686"; ;; + nt64) _ppcc_system_processor="x86_64"; ;; + esac; esac; - IFS=" - "; "${PKG_CMAKE}" \ - ${_ppcc_cmake_args_auto} \ - ${PKG_CMAKE_ARGS:-} \ - ${PKG_CMAKE_ARGS_EXTRA:-} \ - "${PKG_BASE_DIR}/${PKG_SUBDIR}"; - _ppcc_rc=$((${?} ? ${?} : ${_ppcc_rc})); IFS="${_ppcc_IFS0}"; - - rtl_export_vars -u \ - PKG_CONFIG "${PKG_PKG_CONFIG:-}" \ - PKG_CONFIG_LIBDIR "${PKG_PKG_CONFIG_LIBDIR:-}" \ - PYTHON "${PKG_PYTHON:-}"; + ex_pkg_run_configure_cmake \ + "${PKG_AR}" "${PKG_CC}" "${ARG_CCACHE}" "${PKG_CMAKE}" "${PKG_CXX}" \ + "${PKG_LD}" "${PKG_PKG_CONFIG}" "${PKG_PYTHON:-}" "${PKG_RANLIB}" \ + -- \ + "${_ppcc_build_type}" "${PKG_CMAKE_ARGS:-}" "${PKG_CMAKE_ARGS_EXTRA:-}" \ + "${PKG_PREFIX}" "${PKG_BASE_DIR}/${PKG_SUBDIR}" "${_ppcc_system_name}" \ + "${_ppcc_system_processor}" \ + -- \ + "${PKG_CFLAGS_CONFIGURE:-}" "${PKG_CFLAGS_CONFIGURE_EXTRA:-}" \ + "${PKG_CPPFLAGS_CONFIGURE:-}" "${PKG_CPPFLAGS_CONFIGURE_EXTRA:-}" \ + "${PKG_CXXFLAGS_CONFIGURE:-}" "${PKG_CXXFLAGS_CONFIGURE_EXTRA:-}" \ + "${PKG_LDFLAGS_CONFIGURE:-}" "${PKG_LDFLAGS_CONFIGURE_EXTRA:-}" \ + "${PKG_PKG_CONFIG_LIBDIR:-}" \ + ; + _ppcc_rc=$((${?} ? 1 : ${_ppcc_rc})); fi; return "${_ppcc_rc}"; @@ -169,10 +82,15 @@ pkgp_configure_sofort() { && ! [ "${PKG_CONFIGURE_TYPE:-}" = "sofort" ]; then _ppcs_rc=2; else - for _ppcs_vname in AR CC CXX LD RANLIB; do + for _ppcs_vname in AR CC CCLD CXX RANLIB; do if eval [ '"${PKG_'"${_ppcs_vname}"':+1}"' = 1 ]; then - _ppcs_vnames="${_ppcs_vnames:+${_ppcs_vnames} }${_ppcs_vname}"; - eval ${_ppcs_vname}='${PKG_'"${_ppcs_vname}"'}'; export ${_ppcs_vname}; + if [ "${_ppcs_vname}" = CCLD ]; then + _ppcs_vnames="${_ppcs_vnames:+${_ppcs_vnames} }LD"; + eval LD='${PKG_'"${_ppcs_vname}"'}'; export LD; + else + _ppcs_vnames="${_ppcs_vnames:+${_ppcs_vnames} }${_ppcs_vname}"; + eval ${_ppcs_vname}='${PKG_'"${_ppcs_vname}"'}'; export ${_ppcs_vname}; + fi; fi; if eval [ '"${PKG_SOFORT_NATIVE_'"${_ppcs_vname}"':+1}"' = 1 ]; then diff --git a/subr.pkg/pkg_install_make.subr b/subr.pkg/pkg_install_make.subr index 89c61ce8..914a2af2 100644 --- a/subr.pkg/pkg_install_make.subr +++ b/subr.pkg/pkg_install_make.subr @@ -4,71 +4,36 @@ # pkg_install_make() { - local _pim_group_name="${1}" _pim_pkg_name="${2}" _pim_restart_at="${3}" - _pim_libtool="" _pim_rc=0 _pim_subdir=""; - - case "${PKG_LIBTOOL:-}" in - "") _pim_libtool=""; ;; - none) _pim_libtool=""; ;; - *) _pim_libtool="${PKG_LIBTOOL}"; ;; - esac; + local _pim_group_name="${1}" _pim_pkg_name="${2}" _pim_restart_at="${3}" \ + _pim_ranlib="" _pim_rc=0 _pim_subdir=""; for _pim_subdir in ${PKG_MAKE_SUBDIRS:-:}; do + if [ "${PKG_RANLIB_INSTALL:+1}" = 1 ]; then + _pim_ranlib="${PKG_RANLIB_INSTALL}"; + else + _pim_ranlib="${PKG_RANLIB}"; + fi; if [ "${_pim_subdir}" = ":" ]; then _pim_subdir=""; fi; - if [ "${#_pim_libtool}" -gt 0 ]; then - export MAKE="make LIBTOOL=${_pim_libtool}"; - fi; - - if [ "${PKG_MAKEFLAGS_INSTALL_LIST:+1}" = 1 ]; then - rtl_run_cmdlineV ":" "${PKG_MAKE}" \ - "${PKG_MAKEFLAGS_INSTALL_LIST}" \ - "${PKG_MAKEFLAGS_INSTALL_EXTRA_LIST:-}" \ - ${PKG_MAKEFLAGS_PARALLELISE:-} \ - AR="${PKG_AR}" \ - CC="${PKG_CC}" \ - RANLIB="${PKG_RANLIB}" \ - ${PKG_RANLIB_INSTALL:+"RANLIB=${PKG_RANLIB_INSTALL}"} \ - ${_pim_libtool:+"LIBTOOL=${_pim_libtool}"} \ - "${PKG_MAKE_INSTALL_VNAME:-DESTDIR}=${PKG_DESTDIR}/" \ - "${PKG_INSTALL_TARGET:-install}" \ - ${_pim_subdir:+-C "${_pim_subdir}"}; - _pim_rc="${?}"; - elif [ "${PKG_MAKEFLAGS_INSTALL_EXTRA_LIST:+1}" = 1 ]; then - rtl_run_cmdlineV ":" "${PKG_MAKE}" \ - ${PKG_MAKEFLAGS_INSTALL:-} \ - "${PKG_MAKEFLAGS_INSTALL_EXTRA_LIST}" \ - ${PKG_MAKEFLAGS_PARALLELISE:-} \ - AR="${PKG_AR}" \ - CC="${PKG_CC}" \ - RANLIB="${PKG_RANLIB}" \ - ${PKG_RANLIB_INSTALL:+"RANLIB=${PKG_RANLIB_INSTALL}"} \ - ${_pim_libtool:+"LIBTOOL=${_pim_libtool}"} \ - "${PKG_MAKE_INSTALL_VNAME:-DESTDIR}=${PKG_DESTDIR}/" \ - "${PKG_INSTALL_TARGET:-install}" \ - ${_pim_subdir:+-C "${_pim_subdir}"}; - _pim_rc="${?}"; - else - rtl_run_cmdlineV ":" "${PKG_MAKE}" \ - ${PKG_MAKEFLAGS_INSTALL:-} \ - ${PKG_MAKEFLAGS_INSTALL_EXTRA:-} \ - ${PKG_MAKEFLAGS_PARALLELISE:-} \ - AR="${PKG_AR}" \ - CC="${PKG_CC}" \ - RANLIB="${PKG_RANLIB}" \ - ${PKG_RANLIB_INSTALL:+"RANLIB=${PKG_RANLIB_INSTALL}"} \ - ${_pim_libtool:+"LIBTOOL=${_pim_libtool}"} \ - "${PKG_MAKE_INSTALL_VNAME:-DESTDIR}=${PKG_DESTDIR}/" \ - "${PKG_INSTALL_TARGET:-install}" \ - ${_pim_subdir:+-C "${_pim_subdir}"}; - _pim_rc="${?}"; - fi; - - if [ "${#_pim_libtool}" -gt 0 ]; then - unset MAKE; - fi; + ex_pkg_run_make \ + "${PKG_AR}" "${PKG_CC}" "${PKG_CXX}" "${PKG_CCLD}" "${PKG_LIBTOOL}" \ + "${PKG_MAKE}" "${PKG_PKG_CONFIG}" "${_pim_ranlib}" \ + -- \ + 1 "${_pim_subdir}" \ + -- \ + "${PKG_MAKEFLAGS_INSTALL:-}" "${PKG_MAKEFLAGS_INSTALL_EXTRA:-}" \ + "${PKG_MAKEFLAGS_INSTALL_LIST:-}" "${PKG_MAKEFLAGS_INSTALL_EXTRA_LIST:-}" \ + "${PKG_MAKEFLAGS_LOADAVG:-}" "${PKG_MAKEFLAGS_PARALLELISE:-}" \ + "${PKG_MAKEFLAGS_VERBOSITY:-}" \ + -- \ + "" "" "" "" "" "" "" "" "" \ + -- \ + "${PKG_MAKE_INSTALL_VNAME:-DESTDIR}=${PKG_DESTDIR}/" \ + "${PKG_INSTALL_TARGET:-install}" \ + ; + _pim_rc="${?}"; if [ "${_pim_rc}" -ne 0 ]; then return 1; -- cgit v1.2.3