GCC Canadian Cross: Difference between revisions

m
[unchecked revision][unchecked revision]
m (Canadian Cross moved to GCC Canadian Cross: Looks better on the category page, and *is* GCC-specific.)
Line 9:
Unfortunately, [[GCC]] doesn't really support this decently. It will generate files for the compiling system instead (since they're nearly identical, right?). There is no way to tell GCC not to, except for hacking the makefile. For our example, the PIV kept adding <tt>-march=pentium4</tt>, which obviously makes them unsuited for the laptop. The solution is to use <tt>sed</tt> plus some command-line tricks. This is done after <tt>configure</tt> (since <tt>configure</tt> generates the Makefile), and before <tt>make</tt> (since <tt>make</tt> uses the Makefile).
 
<source lang="bash">for i in `find ./ -name Makefile`; do mv $i $i.old; cat $i.old | sed -e 's/pentium4/i586/g' >$i; done</source>
 
This effectively forces the compiler to do i586 compilation.
Anonymous user