Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 329729 - dev-libs/icu needs to be compiled twice if cross compiled
Summary: dev-libs/icu needs to be compiled twice if cross compiled
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-24 18:54 UTC by Johannes Krude
Modified: 2012-11-04 12:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
mipsel-unknown-linux-gnu --info (emerge.info,3.45 KB, text/plain)
2010-07-24 18:54 UTC, Johannes Krude
Details
emerge output for icu (icu-emerge.log,2.93 KB, text/plain)
2010-07-24 18:55 UTC, Johannes Krude
Details
working ebuild (icu-4.4.1.ebuild,2.40 KB, text/plain)
2010-07-24 18:56 UTC, Johannes Krude
Details
icu ebuild cross compile patch (icu-4.4.1.ebuild-cross.patch,888 bytes, patch)
2010-07-25 18:22 UTC, Johannes Krude
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Krude 2010-07-24 18:54:15 UTC
When cross compiling icu's configure gives the following message

configure: error: Error! Cross compiling but no --with-cross-build option specified - please supply the path to an executable ICU's build root

To cross compile icu, icu needs first be compiled with host=build and the compiled again for the target architecture.

I achived this, by adding the following lines to the ebuild:
--- /usr/portage/dev-libs/icu/icu-4.4.1.ebuild	2010-07-03 01:05:39.000000000 +0200
+++ /usr/local/portage/dev-libs/icu/icu-4.4.1.ebuild	2010-07-24 14:35:27.000000000 +0200
@@ -52,6 +52,22 @@
 
 	epatch "${FILESDIR}/${P}-pkgdata.patch"
 	epatch "${FILESDIR}/${P}-et_EE.patch"
+
+	if [[ "$CBUILD" != "$CHOST" ]]; then
+		cd $S/..
+		cp -r source source.native
+		cd source.native
+		cflags_= $CFLAGS
+		CFLAGS=""
+		cxxflags_= $CXXFLAGS
+		CXXFLAGS=""
+		./configure --build=$CBUILD --host=$CBUILD --disable-debug --disable-samples --disable-static
+		make
+		CFLAGS=$cflags_
+		CXXFLAGS=$cxxflags_
+		cd $S
+		crossbuilddir=" --with-cross-build=${S}.native"
+	fi
 }
 
 src_configure() {
@@ -60,7 +76,8 @@
 	econf \
 		$(use_enable debug) \
 		$(use_enable examples samples) \
-		$(use_enable static-libs static)
+		$(use_enable static-libs static) \
+		${crossbuilddir}
 }
 
 src_test() {



Reproducible: Always
Comment 1 Johannes Krude 2010-07-24 18:54:51 UTC
Created attachment 240029 [details]
mipsel-unknown-linux-gnu --info
Comment 2 Johannes Krude 2010-07-24 18:55:25 UTC
Created attachment 240031 [details]
emerge output for icu
Comment 3 Johannes Krude 2010-07-24 18:56:08 UTC
Created attachment 240033 [details]
working ebuild
Comment 4 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-07-25 14:54:19 UTC
Comment on attachment 240033 [details]
working ebuild

Attach patches for ebuilds, not whole ebuilds.
Comment 5 Johannes Krude 2010-07-25 18:22:02 UTC
Created attachment 240123 [details, diff]
icu ebuild cross compile patch

This is the same patch as already written in the first comment.
Comment 6 DaboD 2012-01-05 15:33:37 UTC
src_configure() {
	if tc-is-cross-compiler; then
		CFLAGS="" CXXFLAGS="" ASFLAGS="" LDFLAGS="" \
		CC=$(tc-getBUILD_CC) CXX=$(tc-getBUILD_CXX) AR=$(tc-getBUILD_AR) \
		RANLIB=$(tc-getBUILD_RANLIB) LD=$(tc-getBUILD_LD) \
			./configure --disable-debug --disable-samples --enable-static || die
		emake
		
		mkdir host
		cp -a {bin,lib,config} host
		
		emake clean
		
		extra_params="--with-cross-build=${S}/host"
	fi
	
	econf \
		$(use_enable debug) \
		$(use_enable examples samples) \
		$(use_enable static-libs static) \
		${extra_params} 
}
Comment 7 Tomáš Chvátal (RETIRED) gentoo-dev 2012-11-04 12:26:53 UTC
I commited patch that should handle the cross compilation to icu-50_rc-r2.

Could you please test it and reopen/open new bug if it is still causing issues?