sci-visualization/gnuplot: fix cross-compile builds
authorMike Frysinger <vapier@gentoo.org>
Fri, 29 Jan 2016 22:50:47 +0000 (17:50 -0500)
committerMike Frysinger <vapier@gentoo.org>
Fri, 29 Jan 2016 22:53:32 +0000 (17:53 -0500)
The upstream build tries to set up CC_FOR_BUILD for building helper tools,
but still mixes target compiler flags in which easily leads to failure.

sci-visualization/gnuplot/gnuplot-4.6.5.ebuild
sci-visualization/gnuplot/gnuplot-5.0.1-r1.ebuild

index b5f2965c11042b1f8c36f26a349fbe030678f7e8..3dd44b263b9f359e54a68638d79aa136feaebf04 100644 (file)
@@ -104,6 +104,13 @@ src_prepare() {
                distributed separately; the gnuplot ebuild no longer installs it.
                Emerge app-emacs/gnuplot-mode for Emacs support.'
        has_version "${CATEGORY}/${PN}[emacs(-)]" && FORCE_PRINT_ELOG=1
+
+       # Make sure we don't mix build & host flags.
+       sed -i \
+               -e 's:@CPPFLAGS@:$(BUILD_CPPFLAGS):' \
+               -e 's:@CFLAGS@:$(BUILD_CFLAGS):' \
+               -e 's:@LDFLAGS@:$(BUILD_LDFLAGS):' \
+               docs/Makefile.in || die
 }
 
 src_configure() {
@@ -117,6 +124,8 @@ src_configure() {
        fi
 
        tc-export CC CXX                        #453174
+       tc-export_build_env BUILD_CC
+       export CC_FOR_BUILD=${BUILD_CC}
 
        econf \
                --without-pdf \
index ad5b62d0097e237830e0f51d84ac6309c4ef7eaf..ed43ed58f61d55901935a183c91021b8074de2e4 100644 (file)
@@ -104,6 +104,14 @@ src_prepare() {
 
        mv configure.in configure.ac || die
        eautoreconf
+
+       # Make sure we don't mix build & host flags.
+       sed -i \
+               -e 's:@CPPFLAGS@:$(BUILD_CPPFLAGS):' \
+               -e 's:@CFLAGS@:$(BUILD_CFLAGS):' \
+               -e 's:@LDFLAGS@:$(BUILD_LDFLAGS):' \
+               -e 's:@CC@:$(CC_FOR_BUILD):' \
+               docs/Makefile.in || die
 }
 
 src_configure() {
@@ -117,6 +125,8 @@ src_configure() {
        fi
 
        tc-export CC CXX                        #453174
+       tc-export_build_env BUILD_CC
+       export CC_FOR_BUILD=${BUILD_CC}
 
        econf \
                --without-pdf \