From 294b104fbf98d918214c7b2461a07fa0b38554f5 Mon Sep 17 00:00:00 2001 From: Jose V Beneyto Date: Tue, 8 Dec 2009 18:14:41 +0100 Subject: [PATCH] Added patches in order to get all required environment variables and binaries available when crosscompiling using pkgmk --- src/pkgmk.conf | 25 ++++++++++++++++++++++--- src/pkgmk.in | 11 ++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/pkgmk.conf b/src/pkgmk.conf index 07b1cbd..0e781a7 100644 --- a/src/pkgmk.conf +++ b/src/pkgmk.conf @@ -1,9 +1,28 @@ # -# /etc/pkgmk.conf: pkgmk(8) configuration +# pkgmk.conf: pkgmk(8) configuration # -export CFLAGS="-O2 -march=i686 -pipe" -export CXXFLAGS="-O2 -march=i686 -pipe" +export CHOST="$(echo $$MACHTYPE)" +export CTARGET="arm-unknown-linux-gnu" + +export CLFS = /devel/crux-arm/toolchain/clfs +export CROSSTOOLS = /devel/crux-arm/toolchain/crosstools + +export PATH="$CROSSTOOLS/bin:$PATH" +export LD_LIBRARY_PATH="$CROSSTOOLS/lib:$CROSSTOOLS/usr/lib" + +export CC="$CTARGET-gcc" +export CXX="$CTARGET-g++" +export AR="$CTARGET-ar" +export AS="$CTARGET-as" +export RANLIB="$CTARGET-ranlib" +export LD="$CTARGET-ld" +export STRIP="$CTARGET-strip" + +export CFLAGS="-O2 -pipe" +export CXXFLAGS="-O2 -pipe" + +STRIP_CMD="$STRIP" # PKGMK_SOURCE_MIRRORS=() # PKGMK_SOURCE_DIR="$PWD" diff --git a/src/pkgmk.in b/src/pkgmk.in index c7f5432..b599857 100755 --- a/src/pkgmk.in +++ b/src/pkgmk.in @@ -4,6 +4,9 @@ # # Copyright (c) 2000-2005 Per Liden # Copyright (c) 2006-2007 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 @@ -266,13 +269,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 } @@ -671,6 +674,8 @@ readonly PKGMK_VERSION="#VERSION#" readonly PKGMK_COMMAND="$0" readonly PKGMK_ROOT="$PWD" +STRIP_CMD="strip" + PKGMK_CONFFILE="/etc/pkgmk.conf" PKGMK_PKGFILE="Pkgfile" PKGMK_FOOTPRINT=".footprint" -- 2.26.2