diff options
author | Sven 'sleipnir' Rebhan <odinshorse@googlemail.com> | 2010-01-23 15:22:13 +0000 |
---|---|---|
committer | Sven 'sleipnir' Rebhan <odinshorse@googlemail.com> | 2010-01-23 15:22:13 +0000 |
commit | 44a2860bcbf5f19c507d87c3288433c104b2a598 (patch) | |
tree | 34ae52758bdd7cc0b49cd7eaa1be1204fab4add3 | |
parent | Remove old version of glib. (diff) | |
download | embedded-cross-44a2860bcbf5f19c507d87c3288433c104b2a598.tar.gz embedded-cross-44a2860bcbf5f19c507d87c3288433c104b2a598.tar.bz2 embedded-cross-44a2860bcbf5f19c507d87c3288433c104b2a598.zip |
Add this little tool that eases the transistion between crossdev-wrappers and the new crossdev version with a cross-compile aware pkg-config.
-rwxr-xr-x | tools/fix-fixed-pc-files | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tools/fix-fixed-pc-files b/tools/fix-fixed-pc-files new file mode 100755 index 0000000..c39ac3b --- /dev/null +++ b/tools/fix-fixed-pc-files @@ -0,0 +1,42 @@ +#!/bin/bash + +if [ -z "$1" ]; then + CHOST=armv4tl-softfloat-linux-gnueabi +else + CHOST="$1" +fi + +PKGCONFDIR="/usr/${CHOST}/usr/lib/pkgconfig" + +echo -e "Checking pkgconfig files in \033[1;36m${PKGCONFDIR}\033[0m" + +# Change to target pkgconfig dir +cd "${PKGCONFDIR}" + +# Find packages which were "fixed" by previous versions of the +# crossdev-wrappers. In the new version the prefix is prefixed +# with the SYSROOT automatically. +pcfiles=$(grep "^prefix=/usr/${CHOST}" *.pc | cut -d: -f1) + +# Find the corresponding packages and put them in a list +pkgs="" +printpkgs="" +for f in ${pcfiles}; do + pkgs="${pkgs} $(ROOT="/usr/${CHOST}" qfile --nocolor "${f}" | cut -d' ' -f1)" + printpkgs="${printpkgs} $(ROOT="/usr/${CHOST}" qfile "${f}" | cut -d' ' -f1)" +done + +# Beautify the output by sorting it uniquely +pkgs=$(echo $pkgs | tr ' ' '\n' | sort -u | tr '\n' ' ') +printpkgs=$(echo $printpkgs | tr ' ' '\n' | sort -u) + +# Print the packages... +for pkg in ${printpkgs}; do + echo " Need to remerge package: ${pkg}" +done + +# Finally, remerge the packages +read -p "Do you really want to remerge these packages (y/n)? " +[ "$REPLY" == "y" ] \ + && emerge-${CHOST} --verbose --keep-going ${pkgs} \ + || echo "Aborting..." |