site/* Common site files
Here's the common site file stuff again. The main patch is at the end and includes one fix for the "common" site file which was broken in the last patch (cleaned up the code and broke it).
It'd be nice to move forward on this. I'm going to remove all this from my tree now to stop me from accidental using it (again!).
What this does is gives some flexibility with regards to site file processing:
- It allows site files to be per recipe. So instead of updating a global site file they can be added to the individual packages. This is particularly in the case where the same variable needs to be set differently for different packages.
- It allows site file aliases, so i386-linux, i486-linux, i586-linux and i686-linux could all be use a common i86-linux site file (the individual files could still be used if there was anything actually specific to i386 or i486 etc)
- It allows for common site files including a global common file, libc specific common site files, endianess specific site files and bitsize specified endianess files.
The main things I wanted from this are:
- merge all those x86 files
- replace stuff that manually looks in the site files to determine endianess
- replace stuff that manually clears the site file entries because existing entries break it
- allow site files to be per package
- allow a common site files for things that are the same regardless of target.
Here's an example of a package specific common site file:
clamav/site/common-glibc +4 -0
@@ -0,0 +1,4 @@ +clamav_av_func_working_snprintf_long=${clamav_av_func_working_snprintf_long=yes} +clamav_av_have_in_port_t=${clamav_av_have_in_port_t=yes} +clamav_av_have_in_addr_t=${clamav_av_have_in_addr_t=yes} +ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped=yes}
All of these variables are glibc specific, or for clamav, and are the same for all targets. So this one entry would have resulted in clamav building for all glibc based targets. Instead I added these above entries into site/sh4-linux, site/i486-linux and site/i586-linux (the three platforms I tested this on). This means it will not work for other targets until someone else adds these entries to the appropriate site files.
Here's an example of using the config-info class to simplify the situation of manually passing the endianess in a few of the places where this is needed. In this case it queries the endianess of the target and use base_conditional to set the appropriate option based on the returned endianess:
net-snmp/net-snmp_5.1.2.bb +3 -11
@@ -11,23 +11,15 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snm file://snmpd.conf \ file://snmptrapd.conf" -inherit autotools +inherit config-info autotools PARALLEL_MAKE = "" EXTRA_OECONF = "--enable-shared --disable-manuals" EXTRA_OEMAKE = "INSTALL_PREFIX=${D}" do_configure() { - # endianness fun... inspired by openssl.inc - . ${CONFIG_SITE} - if [ "x$ac_cv_c_bigendian" = "xyes" -o "x$ac_cv_c_littleendian" = "xno" ]; then - ENDIANESS=" --with-endianness=big" - elif [ "x$ac_cv_c_littleendian" = "xyes" -o "x$ac_cv_c_bigendian" = "xno" ]; then - ENDIANESS=" --with-endianness=little" - else - oefatal do_configure cannot determine endianess - fi - oenote Determined endianess as: $ENDIANESS + # Additional flag based on target endiness (see config-info.bbclass) + ENDIANESS="${@base_conditional('CONFIG_INFO_ENDIANESS', 'le', '--with-endianness=little', '--with-endianness=big', d)}" oe_runconf $ENDIANESS }
Here's another example which shows the endiness entries from the site files being moved out. This only shows the sh4-linux site file having the entries removed, but they would also be able to be removed from all the other site files. By doing this any new targets would only require the definition in classes/config-info.bbclass in order to pick up the endiness related site file entries;
common-be +2 -0
@@ -0,0 +1,2 @@ +ac_cv_c_littleendian=${ac_cv_c_littleendian=no} +ac_cv_c_bigendian=${ac_cv_c_bigendian=yes}
============================================================
common-le +2 -0
@@ -0,0 +1,2 @@ +ac_cv_c_littleendian=${ac_cv_c_littleendian=yes} +ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
============================================================
sh4-linux +0 -2
@@ -29,8 +29,6 @@ mr_cv_target_elf=${mr_cv_target_elf=yes} mr_cv_target_elf=${mr_cv_target_elf=yes} -ac_cv_c_littleendian=${ac_cv_c_littleendian=yes} -ac_cv_c_bigendian=${ac_cv_c_bigendian=no} ac_cv_time_r_type=${ac_cv_time_r_type=POSIX} # apache
Possible issues with this approach:
- too many possibilities for site files
- more difficult to determine which site files to edit
- more work to figure out what is/isn't common
- may result in something building but being broken on a target it hasn't been tested on (this already happens... more than likely it'll result in it being fixed on all platforms when someone fixes it the ones they are testing on.)
Possible issues with the implementation:
- Encodes the target information in config-info.bbclass (maybe should be split out to a file?)
Here's the main patch:
config-info.bbclass +72 -0
72 lines not on this page · raw message
============================================================
autotools.bbclass +63 -1
68 lines not on this page · raw message
Signature · 1 line
Jamie Lenehan <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jamie Lenehan schreef:
Quoted 32 lines
Here's the common site file stuff again. The main patch is at the end and includes one fix for the "common" site file which was broken in the last patch (cleaned up the code and broke it).
It'd be nice to move forward on this. I'm going to remove all this from my tree now to stop me from accidental using it (again!).
What this does is gives some flexibility with regards to site file processing:
- It allows site files to be per recipe. So instead of updating a global site file they can be added to the individual packages. This is particularly in the case where the same variable needs to be set differently for different packages.
- It allows site file aliases, so i386-linux, i486-linux, i586-linux and i686-linux could all be use a common i86-linux site file (the individual files could still be used if there was anything actually specific to i386 or i486 etc)
- It allows for common site files including a global common file, libc specific common site files, endianess specific site files and bitsize specified endianess files.
The main things I wanted from this are:
- merge all those x86 files
- replace stuff that manually looks in the site files to determine endianess
Quoted 7 lines
- replace stuff that manually clears the site file entries because existing entries break it
- allow site files to be per package
- allow a common site files for things that are the same regardless of target.
The consensus is that we want this in OE, how to we proceed to get this added into .dev?
regards,
Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFFK4PcMkyGM64RGpERAg+nAJsF8M2FpWE68BKU5Zl5e7MSZsufVQCgpvue 1xiW0sH+Uv37gvoij/tKhBo=
=aiqh
-----END PGP SIGNATURE-----
On Tue, Oct 10, 2006 at 01:28:28PM +0200, Koen Kooi wrote:
[...]
Quoted 2 lines
The consensus is that we want this in OE, how to we proceed to get this added into .dev?
If my implementation was ok then I can push it in over a few days. The order being:
- add config_info.bbclass
- modify recipes that use the site file directly to use config_info instead.
- update autotools.bbclass to use config_info.bbclass
Then it's ready to actually use. Merging those x86 site files would be a good place to start.
Signature · 1 line
Jamie Lenehan <[email protected]>
Hello Jamie,
Quoted 8 lines · you
On Tue, Oct 10, 2006 at 01:28:28PM +0200, Koen Kooi wrote:
[...]Quoted 2 lines
The consensus is that we want this in OE, how to we proceed to get this added into .dev?
If my implementation was ok then I can push it in over a few days. The order being:
Quoted 8 lines
- add config_info.bbclass
- modify recipes that use the site file directly to use
config_infoinstead.- update autotools.bbclass to use config_info.bbclass
Then it's ready to actually use. Merging those x86 site files would be a good place to start.
I can second that Jamie's site/* and config_info work would very
useful for anyone adding a new target to OE. We just went thru some implementation details of it (I started this off list to not protract the merge with ungrounded concerns), and once again see that the framework Jamie put together is very flexible and ready to cover broad usecases (for example, site files can be overriden down to a package level (keyword: if needed)).
So, please count my voice for near-term merge.
Signature · 2 lines
Best regards, Paul mailto:[email protected]
Quoted 5 lines · Jamie Lenehan
Quoted 2 lines · Koen Kooi
The consensus is that we want this in OE, how to we proceed to get this added into .dev?
If my implementation was ok then I can push it in over a few days.
I did a little experimenting with this. I did find some of it a little overcomplex for what we need so I came up with a slightly modified version:
http://www.rpsys.net/openzaurus/temp/oe_site_reorg-r0.patch
The main difference is instead of a set of separate options, you provide a list of compatible site files for each target. You can add more than one alias which was a key limitation of the previous version I wanted to avoid.
As you can see, I started to move the site files around too (for testing). I've not stress tested it yet but my gut instinct says it can be safely pushed.
If Jamie is ok with the changes I made and nobody else objects, I'll push sometime soon :)
Richard