From 0610d8b6288e055b7b5e63d6cfe49333b5842cb8 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Nov 16 2016 15:07:49 +0000 Subject: cmake: fix build and clean up cmake.vars. --- diff --git a/build/pkg.build b/build/pkg.build index 1a9746b..c7300df 100644 --- a/build/pkg.build +++ b/build/pkg.build @@ -125,13 +125,17 @@ else fi; if [ -x ${PKG_CONFIGURE} ]\ && ! is_build_script_done configure; then - if test_cmd pkg_${PKG_NAME}_configure_pre; then - pkg_${PKG_NAME}_configure_pre; + if test_cmd pkg_${PKG_NAME}_configure; then + pkg_${PKG_NAME}_configure; + else + if test_cmd pkg_${PKG_NAME}_configure_pre; then + pkg_${PKG_NAME}_configure_pre; + fi; + CFLAGS="${PKG_CFLAGS_CONFIGURE}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}"\ + LDFLAGS="${PKG_LDFLAGS_CONFIGURE}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}}"\ + ${PKG_CONFIGURE} \ + ${PKG_CONFIGURE_ARGS} ${PKG_CONFIGURE_ARGS_EXTRA} ${PKG_CONFIGURE_ARGS_EXTRA_DEBUG}; fi; - CFLAGS="${PKG_CFLAGS_CONFIGURE}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}"\ - LDFLAGS="${PKG_LDFLAGS_CONFIGURE}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}}"\ - ${PKG_CONFIGURE} \ - ${PKG_CONFIGURE_ARGS} ${PKG_CONFIGURE_ARGS_EXTRA} ${PKG_CONFIGURE_ARGS_EXTRA_DEBUG}; set_build_script_done configure clean -build; else __no_autoconf=1; diff --git a/vars/build.vars b/vars/build.vars index eb54da4..4e79f10 100644 --- a/vars/build.vars +++ b/vars/build.vars @@ -421,6 +421,7 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}"; : ${PKG_CMAKE_SHA256SUM:=7d73ee4fae572eb2d7cd3feb48971aea903bb30a20ea5ae8b4da826d8ccad5fe}; : ${PKG_CMAKE_URL:=https://cmake.org/files/v${PKG_CMAKE_VERSION%.*}/cmake-${PKG_CMAKE_VERSION}.tar.gz}; : ${PKG_CMAKE_CONFIGURE_ARGS:="--prefix="}; +: ${PKG_CMAKE_MAKEFLAGS_INSTALL:=}; : ${PKG_COREUTILS_PREFIX_EXTRA:=${PREFIX_MINIPIX}}; : ${PKG_COREUTILS_SHA256SUM:=ec43ca5bcfc62242accb46b7f121f6b684ee21ecd7d075059bf650ff9e37b82d}; : ${PKG_COREUTILS_VERSION:=8.23}; diff --git a/vars/cmake.vars b/vars/cmake.vars index 0eae553..42b3150 100644 --- a/vars/cmake.vars +++ b/vars/cmake.vars @@ -2,33 +2,23 @@ # . ./build.vars and set -o errexit -o noglob are assumed. # -pkg_cmake_configure_pre() { +pkg_cmake_configure() { cp -p ../cmake-${PKG_VERSION}/Modules/Platform/BSDOS.cmake \ ../cmake-${PKG_VERSION}/Modules/Platform/Midipix.cmake; - - rm -rf ../cmake-${PKG_VERSION}-host; - mkdir ../cmake-${PKG_VERSION}-host; - cd ../cmake-${PKG_VERSION}-host; - - echo XXXXXXXXXXXXXXXXXXXXXXXXXXXX - - (unset AR ARFLAGS CC CFLAGS RANLIB RANLIBFLAGS; - ../cmake-${PKG_VERSION}/configure ${PKG_CONFIGURE_ARGS}; - make DESTDIR=${PREFIX} install; - ); - - set_build_script_done configure -clean; - echo YYYYYYYYYYYYYYYYYYYYYYYYYYYY + secure_rm ../cmake-${PKG_VERSION}-host; + insecure_mkdir ../cmake-${PKG_VERSION}-host; + cd ../cmake-${PKG_VERSION}-host; + log_msg info "Bootstrapping cmake..."; + (unset AR CC RANLIB; + ../cmake-${PKG_VERSION}/configure ${PKG_CONFIGURE_ARGS}; + make DESTDIR=${PREFIX} install); + log_msg info "Finished bootstrapping cmake."; + stat ../cmake-${PKG_VERSION}; }; -pkg_cmake_configure() { - stat ../cmake-${PKG_VERSION} - set_build_script_done configure -clean; -} - pkg_cmake_build() { rm -f config.cache; - + log_msg info "Calling cmake..."; env CFLAGS="--sysroot=${PKG_PREFIX}" cmake \ -DBZIP2_INCLUDE_DIR=${PKG_PREFIX}/include \ -DBZIP2_LIBRARIES=${PKG_PREFIX}/lib/libbz2.a \ @@ -54,15 +44,8 @@ pkg_cmake_build() { -DLIBLZMA_LIBRARY=${PKG_PREFIX}/lib/liblzma.lib.a \ -DZLIB_INCLUDE_DIR=${PKG_PREFIX}/include \ -DZLIB_LIBRARY=z ../cmake-${PKG_VERSION}; - + log_msg info "Calling make..."; make ${DEFAULT_MAKEFLAGS_BUILD}; - set_build_script_done build -install }; -pkg_cmake_install() { - make DESTDIR=${PKG_PREFIX} install; - set_build_script_done install -finish - set_build_script_done finish -} - # vim:filetype=sh