View previous topic :: View next topic |
Author |
Message |
Guenther Brunthaler Apprentice
Joined: 22 Jul 2006 Posts: 217 Location: Vienna
|
Posted: Tue Sep 19, 2006 6:11 am Post subject: Per-package CFLAGS support in Portage? |
|
|
Hi all,
I would like to use different optimization settings for specific packages (ebuilds).
For instance, I want most of the packages in my system to be compiled with -O2 and -mtune.
But a few performance-critical packages (like vlc, mesa/opengl, xorg and gcc itself) I would like to compile with -O3 and -march instead.
I know that it is possible to override the CFLAGS/CXXFLAGS manually for each emerge.
What I want is a way of making those overrides more permanent in the same way as /etc/portage/package.keyword overrides USE flags on a per-package basis.
Is there something like /etc/portage/package.env available for this purpose?
And if not - has someone an idea how Portage could be patched in order to achieve this?
It would be nice if it worked in a way similar like this:
- In /etc/portage/package.env there is a list very similar to /etc/portage/package.keyword: One DEPEND-atom, followed by a settings key.
- The settings keys are just filenames of files in a /etc/portage/env.d directory. For instance, a settings key max_speed would refer to file /etc/portage/env.d/max_speed.conf.
- The files in the /etc/portage/env.d/*.conf have exactly the same syntax as /etc/make.conf, i. e. comment lines and key = value pairs.
- If a settings key is defined for an ebuild in /etc/portage/package.env, the contents of the corresponding /etc/portage/env.d/*.conf file will be used to override the environment variables from /etc/make.conf when emerging that ebuild.
Example: If /etc/portage/package.env contains
Code: |
=media-video/vlc-* max_speed
>=sys-devel/gcc-4 max_speed
|
and /etc/portage/env.d/max_speed.conf contains
Code: |
CFLAGS="-march=pentium4 -O3 -DNDEBUG -pipe -fomit-frame-pointer -fno-stack-check"
CXXFLAGS="-march=pentium4 -O3 -DNDEBUG -pipe -fomit-frame-pointer -fno-stack-check"
|
then all media-video/vlc ebuilds and all sys-devel/gcc ebuilds of version 4 or better would use the above CFLAGS, while all other ebuilds will use the CFLAGS from /etc/make.conf, which might be:
Code: |
...
CFLAGS="-mtune=pentium4 -O2 -DNDEBUG -pipe -fno-stack-check"
CXXFLAGS="-mtune=pentium4 -O2 -DNDEBUG -pipe -fno-stack-check"
...
|
Once available, this scheme could be used to define different optimization levels and assign them to specific ebuilds.
But it could be used to assign debugging-switches or similar to ebuilds as well. |
|
Back to top |
|
|
Lloeki Guru
Joined: 14 Jun 2006 Posts: 437 Location: France
|
Posted: Tue Sep 19, 2006 6:55 am Post subject: |
|
|
Quote: |
What I want is a way of making those overrides more permanent in the same way as /etc/portage/package.keyword overrides USE flags on a per-package basis. |
it's package.use
and same goes for VIDEO_CARDS and others...
whatever, it's not there (yet?). from what I recall, there's some portage replacement in C/C++ that has this kind of feature. it's still beta, and I can't remember the name. _________________ Moved to using Arch Linux
Life is meant to be lived, not given up...
HOLY COW I'M TOTALLY GOING SO FAST OH F*** |
|
Back to top |
|
|
erikm l33t
Joined: 08 Feb 2005 Posts: 634
|
Posted: Tue Sep 19, 2006 7:10 am Post subject: |
|
|
This is requested every once in a while, but is so far not in portage.
Oh, and let's use the search function and continue posting in the dupe threads, lest the mods come banish you to 'Duplicate Threads' land... |
|
Back to top |
|
|
Lloeki Guru
Joined: 14 Jun 2006 Posts: 437 Location: France
|
|
Back to top |
|
|
mark_alec Bodhisattva
Joined: 11 Sep 2004 Posts: 6066 Location: Melbourne, Australia
|
Posted: Tue Sep 19, 2006 9:00 am Post subject: |
|
|
Moved from Portage & Programming to Duplicate Threads. Banished to the land of the dupes _________________ www.gentoo.org.au || #gentoo-au |
|
Back to top |
|
|
|