From b7d05057f960427179287083ffbcc54f1a510a45 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 23 Oct 2015 11:49:36 +0200 Subject: [PATCH] xbps-src: create a cc/g++ wrapper to drop -I/usr/include -L/usr/lib in cross. I'm tired of wasting extra time to fix software to remove standard include/lib dirs. --- .../hooks/pre-configure/02-script-wrapper.sh | 18 ++++++++++++++++++ common/wrappers/cc | 14 ++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 common/wrappers/cc diff --git a/common/hooks/pre-configure/02-script-wrapper.sh b/common/hooks/pre-configure/02-script-wrapper.sh index 498c5b4354b..c4c6194ff82 100644 --- a/common/hooks/pre-configure/02-script-wrapper.sh +++ b/common/hooks/pre-configure/02-script-wrapper.sh @@ -88,6 +88,23 @@ install_wrappers() { done } +install_cross_wrappers() { + local fname + + for fname in cc gcc; do + sed -e "s,@BIN@,/usr/bin/$XBPS_CROSS_TRIPLET-gcc,g" \ + ${XBPS_COMMONDIR}/wrappers/cc > \ + ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname} + chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname} + done + for fname in c++ g++; do + sed -e "s,@BIN@,/usr/bin/$XBPS_CROSS_TRIPLET-g++,g" \ + ${XBPS_COMMONDIR}/wrappers/cc > \ + ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname} + chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname} + done +} + hook() { export PATH="$XBPS_WRAPPERDIR:$PATH" @@ -95,6 +112,7 @@ hook() { [ -z "$CROSS_BUILD" ] && return 0 + install_cross_wrappers pkgconfig_wrapper generic_wrapper icu-config generic_wrapper libgcrypt-config diff --git a/common/wrappers/cc b/common/wrappers/cc new file mode 100644 index 00000000000..d3d9a857ca3 --- /dev/null +++ b/common/wrappers/cc @@ -0,0 +1,14 @@ +#!/bin/sh + +# compiler wrapper to get rid of -I/usr/include and -L/usr/lib, that fucks up +# cross compilation badly. +MYARGS= + +for i in $@; do + if [ $i = "-L/usr/lib" -o $i = "-I/usr/include" ]; then + continue + else + MYARGS+="$i " + fi +done +exec @BIN@ ${MYARGS}