Multiple Linkcmds and BSP Options
Ralf Corsepius
corsepiu at faw.uni-ulm.de
Fri Feb 20 13:47:24 UTC 2004
On Wed, 2004-02-18 at 13:13, Cedric Aubert wrote:
> Hi all,
>
> I have some trouble to understand how to have BSP
> Option into my BSP like
> gensh4 for START_HW_INIT for
> example.
Please have a look at how the gensh2 does it.
The gensh4's configuration is a bit dated and needs to be overhauled.
> I would like to have the console to be enable with
> option with the main
> build configure rtems/configure in fact
> with --enable-xxxxx feature :-). Is it correct or I
> make some mistake.
It's possible. Just extend your BSP's configure.ac to handle this
option.
> I saw how to put the option in my BSP like the gensh4
> but how can I do the link with the main configure ?
I don't understand.
A libbsp/<cpu>/<bsp>/configure.ac configures the Makefiles in
directories below it. It also generates a config-header file "bspopts.h"
which is supposed to be included by _all_ files below c/src (It is
included by bsp.h, therefore normally will be included by all BSP
dependent files).
This "bspopts.h" contains all the defines libbsp/<cpu>/<bsp>/configure
generates and want to be propagated and acknowledged by other sources.
The easiest way to do what you want currently is to apply the
RTEMS_BSPOPTS* m4-macros in your BSP's configure scripts.
(cf. gensh2/configure.ac and aclocal/bspopts.m4)
> Example :
> BSP_CONSOLE_ENABLE will be be define with AC_DEFINE in
> configure.ac but wath
> will be the main option :
>
> configure --enable--BSP_CONSOLE_ENABLE ?????????
>
> Another thing, I will want to have different linkcmds
> for RAM or ROM RTEMS
> boot like linkcmds.ram linkcmds.rom
> but how can I do to choose one at compile time ???????
Depends on what you really mean:
* switching between 2 linkcmds within the source-tree is not supported.
Allowing several of them is simply too error-prone - One BSP, one
bsp_specs, one linkcmds.
* switching between 2 linkcmds for applications/application compilation
is possible: Simply pass the corresponding options to your
compiler/linker calls - Of cause, it's up to you to deal with potential
problems and conflicts, then.
> Should I precise it at link option of my application
> or in the BSP compilation ????
The only way to assure consistency, would be to specify it at the BSP's
configuration time, not at BSP compilation nor at application
compilation/configuration time.
However, if you know what you are doing, esp. if you know your linkcmds
are compatible and don't raise any conflicts, you'd better specify it at
application compilation time and let building the source-tree use one
default linkcmds when building the BSP.
Ralf
More information about the users
mailing list