On Thursday 20 March 2003 10:39 pm, Aaron Matteson wrote:
> Quick question, maybe pretty simple. Here is the scenario, I want to
> avoid adding --target=<athlon|pentium4> to the rpmbuild commandline
> options, how exactly can i set GCC 3.2.x to build for this arch. by
> default?
>
> I assume there is a config somewhere or a way at the commandline to set
> GCC to this.
>
> Any help is much appriciated, tia.
If you build your rpms as root (not recommended) create an /etc/rmrc file. If
you build as user (best way) create a ~/.rpmrc file. When I did mine, I
started with the /usr/lib/rpm/rpmrc file and modified it accordingly to do
athlon-xp by default. Here is the contents:
$ cat ~/.rpmrc
# This is a user specific RPM configuration file.
#
# /etc/rpmrc based on default config in /usr/lib/rpm/rpmrc and modified
# unnecessary lines related to architectures other than x86 have been
# removed.
#
# Created by Gregory K. Meyer - September 22, 2002
#
#############################################################
# Values for RPM_OPT_FLAGS
# These are the optflags that have been used in the past on
# Mandrake Linux. These are from release 8.2
optflags: i386 -O3 -fomit-frame-pointer -pipe -march=i386 -ffast-math
-fno-strength-reduce
optflags: i486 -O3 -fomit-frame-pointer -pipe -march=i486 -ffast-math
-fno-strength-reduce
optflags: k6 -O3 -fomit-frame-pointer -pipe -march=k6 -ffast-math
-fno-strength-reduce
optflags: i586 -O3 -fomit-frame-pointer -pipe -mcpu=pentiumpro -march=i586
-ffast-math -fno-strength-reduce
optflags: i686 -O3 -fomit-frame-pointer -pipe -march=i686 -ffast-math
-fno-strength-reduce
#optflags: athlon -O3 -fomit-frame-pointer -pipe -march=athlon -ffast-math
-fno-strength-reduce
# My GCC optflags for rpm building
# On research, it looks like previously reported problems with
# -fstrength-reduce are fixed, so I do not turn it off.
# Add funroll-loops and -fforce-addr
# NotE: -fforce-mem turned on by -O2
# -finline-functions turned on by -O3
# I recommend you use the default optflags until you are comfortable adding
# others
optflags: athlon -O3 -funroll-loops -fomit-frame-pointer -pipe
-march=athlon-xp -ffast-math -fforce-addr -fno-strength-reduce
#############################################################
# Canonical arch names and numbers
# Removed lines unrelated to the x86 architecture.
arch_canon: athlon: athlon 1
arch_canon: i686: i686 1
arch_canon: i586: i586 1
arch_canon: k6: k6 1
arch_canon: i486: i486 1
arch_canon: i386: i386 1
#############################################################
# Canonical OS names and numbers
# Removed lines unrelated to Linux since I only care about Linux
os_canon: Linux: Linux 1
#############################################################
# For a given uname().machine, the default build arch
# Originally, all machines higher than i586 were translated here
# to i586 on an Mandrake system.
#buildarchtranslate: athlon: i586
#buildarchtranslate: i686: i586
#buildarchtranslate: k6: i586
#buildarchtranslate: i586: i586
#buildarchtranslate: i486: i486
#buildarchtranslate: i386: i386
# Removed lines unrelated to the x86 architecture.
# For this machine, we don't want to translate to i586, but
# build for the Athlon architecture, since uname -m returns
# i686 for the Athlon processor, we translate i686 to athlon
# manually
buildarchtranslate: athlon: athlon
buildarchtranslate: i686: athlon
buildarchtranslate: i586: i586
#############################################################
# Architecture compatibility
# Removed lines unrelated to the x86 architecture.
# Will allow rpm's built for i686 and lower to be installed
# onto this machine.
arch_compat: athlon: i686
arch_compat: i686: i586
arch_compat: k6: i586
arch_compat: i586: i486
arch_compat: i486: i386
arch_compat: i386: noarch
buildarch_compat: athlon: i686
buildarch_compat: i686: i586
buildarch_compat: k6: i586
buildarch_compat: i586: i486
buildarch_compat: i486: i386
buildarch_compat: i386: noarch
#############################################################
#Macros
macrofiles:
/usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.specspo:/etc/rpm/macros.db1:/etc/rpm/macros.cdb:/etc/rpm/macros:/etc/rpm/%{_target}/macros:~/.rpmmacros
--
Greg
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com