From f539a4f6f6e2865d20f6fa6129e8c5315c3eafa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Fri, 3 Feb 2017 04:17:55 +0100 Subject: subr/pkg_{build,install,setup}.subr: cleanup. --- subr/pkg_build.subr | 3 --- subr/pkg_install.subr | 74 ++++++++++++++++++++++++++++----------------------- subr/pkg_setup.subr | 5 +++- 3 files changed, 45 insertions(+), 37 deletions(-) diff --git a/subr/pkg_build.subr b/subr/pkg_build.subr index d9b1e684..58a9e55c 100644 --- a/subr/pkg_build.subr +++ b/subr/pkg_build.subr @@ -7,9 +7,6 @@ pkg_build() { if [ -n "${PKG_BUILD_CMDLINE}" ]; then ${PKG_BUILD_CMDLINE}; elif [ ${PKG_NO_MAKE_BUILD:-0} -eq 0 ]; then - if [ "${PKG_SLIBTOOL}" != "default" ]; then - export MAKE="make LIBTOOL=${PKG_SLIBTOOL:-slibtool}"; - fi; # N.B. We only specify 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. diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr index 67df0fd6..ddd6230b 100644 --- a/subr/pkg_install.subr +++ b/subr/pkg_install.subr @@ -3,44 +3,15 @@ # See warning at the top of build.vars. # -pkg_install() { - if test_cmd pkg_${PKG_NAME}_install; then - pkg_${PKG_NAME}_install; - else - if [ ${PKG_NO_MAKE_INSTALL:-0} -eq 0 ]; then - run_cmd_unsplit make \ - ${PKG_MAKEFLAGS_INSTALL} \ - ${PKG_MAKEFLAGS_INSTALL_EXTRA} \ - AR=${AR} CC=${CC} RANLIB=${RANLIB} \ - "${PKG_CFLAGS_INSTALL:+CFLAGS=${PKG_CFLAGS_INSTALL}}" \ - "${PKG_CFLAGS_INSTALL_EXTRA:+CFLAGS+=${PKG_CFLAGS_INSTALL_EXTRA}}" \ - "${PKG_LDFLAGS_INSTALL:+LDFLAGS=${PKG_LDFLAGS_INSTALL}}" \ - "${PKG_LDFLAGS_INSTALL_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_INSTALL_EXTRA}}" \ - "${PKG_RANLIB_INSTALL:+RANLIB=${PKG_RANLIB_INSTALL}}" \ - ${PKG_INSTALL_TARGET:=install}; - if [ -n "${PKG_PREFIX_EXTRA}" ]; then - run_cmd_unsplit make \ - ${PKG_MAKEFLAGS_INSTALL} \ - ${PKG_MAKEFLAGS_INSTALL_EXTRA} \ - AR=${AR} CC=${CC} RANLIB=${RANLIB} \ - "${PKG_CFLAGS_INSTALL:+CFLAGS=${PKG_CFLAGS_INSTALL}}" \ - "${PKG_CFLAGS_INSTALL_EXTRA:+CFLAGS+=${PKG_CFLAGS_INSTALL_EXTRA}}" \ - "${PKG_LDFLAGS_INSTALL:+LDFLAGS=${PKG_LDFLAGS_INSTALL}}" \ - "${PKG_LDFLAGS_INSTALL_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_INSTALL_EXTRA}}" \ - "${PKG_RANLIB_INSTALL:+RANLIB=${PKG_RANLIB_INSTALL}}" \ - ${PKG_INSTALL_TARGET_EXTRA:=install} \ - DESTDIR=${PKG_PREFIX_EXTRA}; - fi; - fi; - if test_cmd pkg_${PKG_NAME}_install_post; then - pkg_${PKG_NAME}_install_post; - fi; - fi; +pkgp_install_clean_lib() { if [ -d ${PKG_PREFIX}/lib ]; then for __ in $(find ${PKG_PREFIX}/lib -type f -name \*.la); do secure_rm ${__}; done; fi; +}; + +pkgp_install_files() { if [ -n "${PKG_INSTALL_FILES}" ]; then (set -- ${PKG_INSTALL_FILES}; while [ ${#} -gt 0 ]; do @@ -65,6 +36,9 @@ pkg_install() { esac; shift; done); fi; +}; + +pkgp_install_dlltool() { if [ "${PKG_BUILD_TYPE}" != "host" ] \ && test_cmd perk \ && test_cmd ${PKG_TARGET}-dlltool; then @@ -91,6 +65,40 @@ pkg_install() { fi; done; fi; +}; + +pkg_install() { + if [ ${PKG_NO_MAKE_INSTALL:-0} -eq 0 ]; then + run_cmd_unsplit make \ + ${PKG_MAKEFLAGS_INSTALL} \ + ${PKG_MAKEFLAGS_INSTALL_EXTRA} \ + AR=${AR} CC=${CC} RANLIB=${RANLIB} \ + "${PKG_CFLAGS_INSTALL:+CFLAGS=${PKG_CFLAGS_INSTALL}}" \ + "${PKG_CFLAGS_INSTALL_EXTRA:+CFLAGS+=${PKG_CFLAGS_INSTALL_EXTRA}}" \ + "${PKG_LDFLAGS_INSTALL:+LDFLAGS=${PKG_LDFLAGS_INSTALL}}" \ + "${PKG_LDFLAGS_INSTALL_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_INSTALL_EXTRA}}" \ + "${PKG_RANLIB_INSTALL:+RANLIB=${PKG_RANLIB_INSTALL}}" \ + ${PKG_INSTALL_TARGET:=install}; + if [ -n "${PKG_PREFIX_EXTRA}" ]; then + run_cmd_unsplit make \ + ${PKG_MAKEFLAGS_INSTALL} \ + ${PKG_MAKEFLAGS_INSTALL_EXTRA} \ + AR=${AR} CC=${CC} RANLIB=${RANLIB} \ + "${PKG_CFLAGS_INSTALL:+CFLAGS=${PKG_CFLAGS_INSTALL}}" \ + "${PKG_CFLAGS_INSTALL_EXTRA:+CFLAGS+=${PKG_CFLAGS_INSTALL_EXTRA}}" \ + "${PKG_LDFLAGS_INSTALL:+LDFLAGS=${PKG_LDFLAGS_INSTALL}}" \ + "${PKG_LDFLAGS_INSTALL_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_INSTALL_EXTRA}}" \ + "${PKG_RANLIB_INSTALL:+RANLIB=${PKG_RANLIB_INSTALL}}" \ + ${PKG_INSTALL_TARGET_EXTRA:=install} \ + DESTDIR=${PKG_PREFIX_EXTRA}; + fi; + fi; + if test_cmd pkg_${PKG_NAME}_install_post; then + pkg_${PKG_NAME}_install_post; + fi; + pkgp_install_clean_lib; + pkgp_install_files; + pkgp_install_dlltool; set_build_script_done install -finish; }; diff --git a/subr/pkg_setup.subr b/subr/pkg_setup.subr index c9a78a49..0ee60bb7 100644 --- a/subr/pkg_setup.subr +++ b/subr/pkg_setup.subr @@ -10,7 +10,6 @@ pkg_setup() { else PKG_CONFIGURE=${PWD}/${PKG_CONFIGURE#/}; fi; - cd ${PKG_BUILD_DIR}; if [ "${PKG_BUILD_TYPE}" = "host" ]; then export AR=ar; export CC=gcc; @@ -27,6 +26,10 @@ pkg_setup() { else __no_autoconf=1; fi; + if [ "${PKG_SLIBTOOL}" != "default" ]; then + export MAKE="make LIBTOOL=${PKG_SLIBTOOL:-slibtool}"; + fi; + cd ${PKG_BUILD_DIR}; set_build_script_done setup distclean -configure; }; -- cgit v1.2.3