Mailinglist Archive: opensuse (3666 mails)

< Previous Next >
Re: What is the proper way to optimize compilations?
  • From: Philipp Thomas <philipp.thomas@xxxxxxxxx>
  • Date: Thu, 24 Mar 2005 00:31:23 +0100
  • Message-id: <o9t3415tfklni9f5nt5o521r0ehhd01cke@xxxxxxx>
Hi Carlos,

"Carlos E. R." <robin1.listas@xxxxxxxxxx> [23 Mar 2005 22:19]:

>Perhaps I can find around there a good explanation of what BUILD, TARGET,
>and HOST really means in plain language.

All terms that come from cross-compiling, as you can, for instance,
build gcc on your system, configure it to run on ultrasparc-sun-solaris
and generate code for an ARM system.

>"--build=i786-pc-linux-gnu --host=i786-pc-linux-gnu".

You can only pass to configure what config.sub accepts, as this is the
script that configure will call if you pass it an explicit triple.

I just checked, and current versions of config.sub do accept
pentium4-suse-linux but return i787-suse-linux-gnu.

If you would like configure to set CFLAGS/CXXFLAGS automatically, you
would do something like:

case $build_cpu in
CFLAGS="-march=pentium4 -mcpu=pentium4 $CFLAGS"

>Humm. Then perhaps I only need to give "--build"? Ah, I'm getting a

It's really easy, as you don't ever want to cross-compile: Simply use
--build :)

>Yeap, that is what I always did (although I hack configure itself, not the
>files you mention), as I wasn't sure how to get what I wanted. I can live
>with hacks as I don't distribute my compilations O:-)

Never-the-less I'd recommend getting familiar with the autotools
(autoconf, automake, libtool) as it helps with such tasks. It's far
easier to tweak configure.{in|ac} and then run autoconf to regenerate

>Ok, I see there is not a common way for all compilations, it depends on
>each case.

Yes, that's the state of affairs, unless you want to switch to something
like gentoo.

>Thanks for your input.

You're welcome :)


< Previous Next >
Follow Ups