From b32745f7236abb00789b9535260f739899a26cd3 Mon Sep 17 00:00:00 2001 From: Jose V Beneyto Date: Tue, 13 Aug 2013 19:46:46 +0000 Subject: [PATCH] Modified pkgmk.in to have support for crosscompilation. Added new function: fix_cross_paths (this one appeared in src/pkgmk.in before the upstream merge --- pkgmk.in | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/pkgmk.in b/pkgmk.in index 997453d..45406c6 100755 --- a/pkgmk.in +++ b/pkgmk.in @@ -4,6 +4,9 @@ # # Copyright (c) 2000-2005 Per Liden # Copyright (c) 2006-2013 by CRUX team (http://crux.nu) +# +# Patches for crosscompilation by Jose V Beneyto +# (CRUX-ARM System Team ) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -278,13 +281,13 @@ strip_files() { find . -type f -printf "%P\n" | $FILTER | while read FILE; do case $(file -b "$FILE") in *ELF*executable*not\ stripped) - strip --strip-all "$FILE" + $STRIP_CMD --strip-all "$FILE" ;; *ELF*shared\ object*not\ stripped) - strip --strip-unneeded "$FILE" + $STRIP_CMD --strip-unneeded "$FILE" ;; current\ ar\ archive) - strip --strip-debug "$FILE" + $STRIP_CMD --strip-debug "$FILE" esac done } @@ -314,6 +317,13 @@ compress_manpages() { done } +fix_cross_paths() { + # remove the last / from CLFS path if appeared + CLFS=${CLFS%*/} + + find $PKG -type f -name '*.la' -exec sed -e "s|$CLFS||g" -e "s|$CROSTOOLS/$CTARGET|/usr|g" -i {} \; +} + check_footprint() { local FILE="$PKGMK_WORK_DIR/.tmp" @@ -390,8 +400,9 @@ build_package() { if [ "$PKGMK_NO_STRIP" = "no" ]; then strip_files fi - + compress_manpages + fix_cross_paths cd $PKG info "Build result:" @@ -611,12 +622,6 @@ parse_options() { } main() { - # multilib - PKGMK_ARCH=64 - if [ -f ".32bit" ]; then - PKGMK_ARCH=32 - fi - local FILE TARGET parse_options "$@" -- 2.26.2