Chapter 9. Reference for pkgconf.tcl

pkgconf.tcl is the script that should be used to create a build tree. Given this build tree it is then possible to build the system and its testcases, and to change fine-grained configuration options. pkgconf.tcl itself deals with a number of coarse-grained configuration options such as the target platform and the packages that should be used.

pkgconf.tcl is implemented in the scripting language Tcl/Tk, and therefore it must be run from inside a suitable Tcl interpreter. Such an interpreter is supplied with this release as part of the GNUPro software. The command used to invoke pkgconf.tcl is:

$ tclsh BASE_DIR/pkgconf.tcl options

Usually the pkgconf.tcl script will be run inside the build tree itself. If you are creating a new build tree then typically you will create a new empty directory using the mkdir command, cd into that directory, and then invoke pkgconf.tcl. Once a build tree exists it is possible to run pkgconf.tcl again inside the same build tree and change some of the coarse-grained configuration options, for example it is possible to switch between a simulator and an evaluation board.

The available command line arguments are as follows:

--help

Provide basic online help for the available options

--target=<arch>

Select a specific architecture. The architectures available will depend on the exact release of eCos that you are using, and is defined in the file BASE_DIR/targets. If your release only supports a single architecture then this argument is optional since pkgconf.tcl will default to that architecture.

--targets

Use this to list of the supported architectures and the platforms available for each platform.

--platform=<platform>

Select a specific platform for the current architecture, for example "sim". The default platform for a given architecture is the first one listed in the targets file. Use the option --targets to list the available architectures and platforms.

--startup=<value>

For some platforms it is possible to start up eCos in a number of ways. For a ROM startup the application linked with eCos will typically be burned into EPROM's and eCos will start up when the board is powered up. For a RAM startup the application linked with eCos will be downloaded into a board that is already powered up and running a ROM monitor program of some sort. The default setting for all platforms is a RAM startup.

--disable-<package>

In the current release all packages relevant to the architecture and platform are enabled by default. To disable a given package it is necessary to pass the appropriate command line argument to pkgconf.tcl. For example to configure a system without the µITRON package the following command could be used:

$ tclsh BASE_DIR/pkgconf.tcl --disable-uitron <other options>

It should be noted that not all packages are completely self-contained. For example there are routines in the C library such as strtod() which perform floating point operations and hence require the math library to be present. Therefore it is not sufficient to simply disable the math library using command line arguments to pkgconf, it is also necessary to change a number of fine-grained configuration options for the C library after running pkgconf.tcl. Future versions of the eCos Configuration Tools will automate the handling of such dependencies.

--enable-<package>

If a given package has been disabled in an existing build tree and must now be reenabled, run pkgconf.tcl again using a --enable argument. For example, to reenable the µITRON package use the following command:

$ tclsh BASE_DIR/pkgconf.tcl --enable-uitron <other options>

--<package>-version=v0_4

As additional releases of the eCos system are made there may be multiple versions of a given package available. By default pkgconf.tcl will always use the most recent version of a given package, but if you want to use an older version of a package you can pass an appropriate argument to pkgconf.tcl. For example, to select a specific version of the µITRON package, use the following command:

$ tclsh BASE_DIR/pkgconf.tcl --uitron-version=v0_4 <other options>

--packages

Use this option to list the available packages and the available versions for each package.

--defaults

When pkgconf.tcl is first used to create a build tree it will save the various coarse grained configuration settings in a file pkgconf.sav. If pkgconf.tcl is run again inside the same build tree to change one of these settings then the script will read in the save file. The command line option --defaults causes the script to ignore the settings in the save file and apply the default settings instead.

--srcdir=<dir>

Typically the pkgconf.tcl script resides at the top level of the eCos component repository, and hence the script can identify the location of the component repository by examining its own pathname. If it is necessary to use an alternative eCos source tree, use the --srcdir command line argument, for example:

$ tclsh BASE_DIR/pkgconf.tcl --srcdir=/tmp/new-ecossrc <other options>

--builddir=<dir>

By default pkgconf.tcl assumes that the current directory is the build tree, and it will create various files and subdirectories there. If it is necessary to specify an alternative build tree, use the --builddir option, for example:

$ tclsh BASE_DIR/pkgconf.tcl --builddir=/tmp/ecosobj <other options>

--prefix=<dir>

In addition to the build tree pkgconf.tcl will generate an install tree. The various header files, the library libtarget.a, and any other files needed to develop applications, will end up in this install tree. By default the install tree resides inside a directory "install" in the build tree, but it is possible to specify an alternative directory if necessary. In some environments this would make it easier to share the built eCos system between developers.

$ tclsh BASE_DIR/pkgconf.tcl --prefix=//share/ecosobj <other options>