This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: changing compile source in cdl based on platform
>>>>> "Sergei" == Sergei Gavrikov <sergei.gavrikov@gmail.com> writes:
<snip>
Sergei> Nice tutorial! I would prefer option (2) too. I wonder
Sergei> will it work
Sergei> cdl_option CYGBLD_BUILD_FOO_ARM {
Sergei> requires { is_substr(CYGBLD_GLOBAL_COMMAND_PREFIX, "arm" }
Sergei> compile arm_version.S
Sergei> }
Sergei> cdl_option CYGBLD_BUILD_FOO_I386 {
Sergei> requires { is_substr(CYGBLD_GLOBAL_COMMAND_PREFIX, "i386" }
Sergei> compile x86_version.S
Sergei> }
Not exactly. Replacing the "calculated" property with "requires" means
that both CYGBLD_BUILD_FOO_ARM and CYGBLD_BUILD_FOO_I386 now become a
user-editable options. It does not make sense for users to edit these.
For a given platform, and hence architecture, only one can be enabled.
Once the user has selected the platform there is no point in letting
the user edit these individual options.
Also, using is_substr(CYGBLD_GLOBAL_COMMAND_PREFIX) is probably a bad
idea compared with using CYGPKG_HAL_ARM or CYGPKG_HAL_I386. The test
for "arm" will succeed for both ARM and Cortex M3, so you could end up
trying to build ARM-specific assembler for Cortex. Similarly the test
for "i386" could succeed when cross-compiling the synthetic target on
Windows as well as for a real x86 target. Maybe that is what you want,
but then (CYGPKG_HAL_I386 || CYGPKG_HAL_SYNTH) would be a lot clearer
than trying to do clever stuff with COMMAND_PREFIX.
Bart
--
Bart Veer eCos Configuration Architect
eCosCentric Limited The eCos experts http://www.ecoscentric.com/
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss