Name

Property define_header — Specify the configuration header file that will be generated for a given package.

Synopsis

cdl_package <name> {
  define_header <file name>
  …
}

Description

When the configuration tools generate a build tree, one of the steps is to output each package's configuration data to a header file. For example the kernel's configuration data gets output to pkgconf/kernel.h. This allows each package's source code to #include the appropriate header file and adapt to the choices made by the user.

By default the configuration tools will synthesize a file name from the package name. This involves removing any prefix such as CYGPKG_, up to and including the first underscore, and then converting the remainder of the name to lower case. In some cases it may be desirable to use a different header file, for example an existing package may have been ported to eCos and the source code may already #include a particular file for configuration data. In such cases a define_header property can be used to specify an alternative filename.

The define_header property can only be used in the body of a cdl_package command. It applies to a package as a whole and cannot be used at a finer grain. The name specified in a define_header property will always be interpreted as relative to the include/pkgconf sub-directory of the install tree.

[Note]Note

For hardware-specific packages such as device drivers and HAL packages, the current scheme of generating a configuration header file name based on the package name may be abandoned. Instead all hardware packages would send their configuration data to a single header file, pkgconf/hardware.h. This would make it easier for code to obtain details of the current hardware, but obviously there are compatibility issues. For now it is recommended that all hardware packages specify their configuration header file explicitly.

Example

cdl_package CYGPKG_HAL_ARM {
  display       "ARM architecture"
  parent        CYGPKG_HAL
  hardware
  include_dir   cyg/hal
  define_header hal_arm.h
  …
}