[RTEMS Project] #3302: Build System conversion of BSP Config (.cfg) files to pkg-config (.pc) files

RTEMS trac trac at rtems.org
Fri May 10 22:24:25 UTC 2019


#3302: Build System conversion of BSP Config (.cfg) files to pkg-config (.pc)
files
---------------------------+--------------------------
 Reporter:  Chris Johns    |       Owner:  Chris Johns
     Type:  project        |      Status:  assigned
 Priority:  normal         |   Milestone:
Component:  unspecified    |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  SoC ecosystem  |  Blocked By:
 Blocking:                 |
---------------------------+--------------------------
Description changed by Chris Johns:

Old description:

> = Build System conversion of BSP Config (.cfg) files to Package Config
> (.pc) =
>
> [[PageOutline(1-5, Contents, inline)]]
>
> == Mentors ==
>
> Chris Johns
>
> == Students ==
>
> Past, Present, and Potential Students
>
> == Status ==
>
> See Project Tasks.
>
> == Introduction ==
>
> RTEMS BSP's use the `make` syntax in configuration files (`.cfg`) to
> specialize how a BSP is to be built and linked as well as defining any
> extra BSP specific details a user of the BSP may need. This can range
> from nothing through to target specific addresses and formats used to
> inter-operate with a BSP's hardware.
>
> The configuration files currently form part of the user ecosystem via the
> `Makefile.inc` build system. This build system is flawed because it only
> supports `make` as a build system and there are a number of really good
> build systems available to users. The free form nature of the `make`
> syntax in the configuration files means automatically parsing and
> converting these files into another format would require a parser as
> complex as `make` and that is not practical. As a result the ability to
> support the `Makefile.inc` user application build system as it is as
> RTEMS moves forward is limited.
>
> RTEMS users require a way to query and get the BSP build configuration
> for a BSP. The build configuration is the flags needed to compile and
> link code into an application. There is also a need to express BSP
> specific details that define some of the target specific features
> implemented by the BSP developer.
>
> The `pkg-config` tool provides a way to query `.pc` format files and is
> used by a large number of packages to define how a package is build.
>
> == Goal ==
>
> * Convert RTEMS's current BSP configuration from the `make` format to the
> widely used and support `pkg-config` format.
>
> * Convert the RTEMS build system to use the `.pc` files.
>
> * Update `examples-v2` to use the updated `pkg-config` files.
>
> * Update the User Manual.
>
> == Prerequisite ==
>
> * Knowledge of Unix shell
> * Knowledge of M4 and autoconf
> * Knowledge of compiler and linker flags
> * Knowledge of make
> * Knowledge of Python. This is not as important and is used to update
> `rtems-wag.git` which is used by `examples-v2`.
>
> == Tasks ==
>
> 1. Review all BSP configurations and collect all the details and
> specifics. This lets us review and define how the elements are mapped to
> `pkg-config`.
> 2. Write the `pkg-config` files an architecture at a time. Write a test
> to check all files.
> 3. Update the RTEMS build system to use `pkg-config`.
> 4. Update `rtems-waf.git` and test using `examples-v2`.

New description:

 = Build System conversion of BSP Config (.cfg) files to Package Config
 (.pc) =

 [[PageOutline(1-5, Contents, inline)]]

 == Mentors ==

 Chris Johns

 == Students ==

 Past, Present, and Potential Students

 == Status ==

 See Project Tasks.

 == Introduction ==

 RTEMS BSP's use the `make` syntax in configuration files (`.cfg`) to
 specialize how a BSP is to be built and linked as well as defining any
 extra BSP specific details a user of the BSP may need. This can range from
 nothing through to target specific addresses and formats used to inter-
 operate with a BSP's hardware.

 The configuration files currently form part of the user ecosystem via the
 `Makefile.inc` build system. This build system is flawed because it only
 supports `make` as a build system and there are a number of really good
 build systems available to users. The free form nature of the `make`
 syntax in the configuration files means automatically parsing and
 converting these files into another format would require a parser as
 complex as `make` and that is not practical. As a result the ability to
 support the `Makefile.inc` user application build system as it is as RTEMS
 moves forward is limited.

 `Makefile.inc` and the supporting files export internal build details.
 Users may be depending on things that could change and at the same time
 RTEMS is limited in the changes it can do to avoid breaking applications.
 The interface needs to formally specified, invariant and documented.

 Flags and settings in `Makefile.inc` are for building RTEMS while only the
 options related to ABI compatibility need to be exported to a user. A
 common issue is warning flags that break building 3rd packages. RTEMS
 Tools and RTEMS Waf both support the filtering of the `CFLAGS` however
 this should be handled in a formal sense in the exporting of flags from
 RTEMS for a BSP.

 RTEMS users require a way to query and get the BSP build configuration for
 a BSP. The build configuration is the flags needed to compile and link
 code into an application. There is also a need to express BSP specific
 details that define some of the target specific features implemented by
 the BSP developer.

 The `pkg-config` tool provides a way to query `.pc` format files and is
 used by a large number of packages to define how a package is build.

 == Goal ==

 * Convert RTEMS's current BSP configuration from the `make` format to the
 widely used and support `pkg-config` format.

 * Convert the RTEMS build system to use the `.pc` files.

 * Update `examples-v2` to use the updated `pkg-config` files.

 * Update the User Manual.

 == Prerequisite ==

 * Knowledge of Unix shell
 * Knowledge of M4 and autoconf
 * Knowledge of compiler and linker flags
 * Knowledge of make
 * Knowledge of Python. This is not as important and is used to update
 `rtems-wag.git` which is used by `examples-v2`.

 == Tasks ==

 1. Review all BSP configurations and collect all the details and
 specifics. This lets us review and define how the elements are mapped to
 `pkg-config`.
 2. Write the `pkg-config` files an architecture at a time. Write a test to
 check all files.
 3. Update the RTEMS build system to use `pkg-config`.
 4. Update `rtems-waf.git` and test using `examples-v2`.

--

--
Ticket URL: <http://devel.rtems.org/ticket/3302#comment:2>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list