In regards to prebuilt binaries

Jeremy Fowler jfowler at westrope.com
Tue Oct 22 09:23:04 CDT 2002


> Here's something I'm ignorant of (any probably easily found in
> documentation), how does rpm handle traditional ./configure options?
>  For example:  let's say I'm installing php on my apache system which
> also runs mysql and gd.  With configure/make/make install I'd pass it
> --with-mysql --with-apache=../foo/bar/httpd --with-gd=/what/ever/gd, etc...
>
> How are those handled with rpm, does it just know?  Do the others have
> to be installed via rpm for it to work.  I'd love to use more rpms
> because of the simplicity and ease of upgrading but I don't know how to
> do it so I just do it the old way.

With binary rpms you are relying on the package creator as to which options are
enabled. These options, along with build instructions, patch information, and
various other miscellaneous instructions are all held in the .spec file in the
Source RPM of whatever package you are trying to install. You can install the
source rpm which will end up putting the package's source code in
/usr/src/redhat/SOURCE, the .spec file in /usr/src/redhat/SPEC, and will compile
everything in /usr/src/redhat/BUILD. However, the only reason you would do this
is if you needed to change something in the .spec file manually, like add a
patch to the source. If all you want to do is to add a --with or --without
option, just download the source rpm for the package and recompile everything
with one quick command:

rpm -bb --with=foo foobar.src.rpm

This will compile a new binary rpm package with the foo option enabled and place
it in /usr/src/redhat/RPMS/

If you wanted to disable an option:

rpm -bb --without=bar foobar.src.rpm

For those hard-core people out there, if you want to use some compile-time
optimizations, here are a few tips. RPM uses /usr/lib/rpm/rpmrc and a call to
uname to find out what type of system to compile for and what compiler options
to use. Don't edit this file directly instead create either /etc/rpmrc or
~/.rpmrc and put your options in there. Use `rpm --showrc` to see which options
are being used. Since redhat 8.0 uses the GCC 3.2 compiler, you have a lot more
CPU specific options you can use. For example, GCC now supports processor
specific optimizations when using the --mcpu=<cpu> and --march=<arch> options.
So if you have an Athlon XP processor, you can tell GCC to use --mpcu=athlonxp
and optimizations for that specific processor are compiled in, but code will
remain backward compatible with all x86 architectures. If you want GCC to
compile for that particular CPU and use the optimizations that are NOT backward
compatible, use the -march=athlonxp option. You can also use
the -mmmx, -msse, -msse2, and -m3dnow options with the Athlon XP and this
enables using built-in functions that use those processor extensions, great for
speeding up those video and multimedia enabled packages! Don't forget those
other optimizations
like -O3 -fomit-frame-pointer -fforce-addr -frerun-cse-after-loop -frerun-loop-o
pt -falign-functions=4 ...etc.

Maximum RPM (User Guide):
http://www.rpm.org/max-rpm/

GCC 3.2 User Manual:
http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/

GCC 3.2 Intel 386 and AMD x86-64 Options:
http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/i386-and-x86-64-Options.html#i386%20an
d%20x86-64%20Options

GCC 3.2 Options That Control Optimization
http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Optimize-Options.html#Optimize%20Optio
ns




More information about the Kclug mailing list