Invoking configure

Before attempting to build a package, run:

host% configure --help

This displays the available options for configure, and also checks the dependencies of the package by reading the documentation. It is very important that all the required libraries are already in place.

Note: If any of the libraries in the cross development environment share the same name as libraries that exist as part of the host Linux distribution, then care must be taken that the build process uses the correct libraries. Failure to do so will cause problems that may not be detected until late in the build process.

Some packages compile and run test programs at configure time to check the availability or the presence of features in other software. These test programs will not run on the host system when cross-compiling, so the tests must be disabled. The configure options that control this behavior usually have names ending with the characters test; for example, in gdk-pixbuf the option is --disable-glibtest.

This behavior is also controlled by the --host and --build options in scripts generated by autoconf version 2.5 or later. When both of these options are supplied, the script executes in cross-compile mode and disables all tests which require a test program to be compiled and run.

Note: This mode does not disable the tests that are controlled by command-line options such as --disable-glibtest.

Remember that when using these options, it is necessary to ensure that the correct versions of all the required packages are already installed.

Some recent libraries are delivered with a configuration script. These scripts usually have a name ending in -config (for example, gtk-config). They output the correct compiler options to be used by programs using these libraries when the scripts are invoked with the --cflags or --libs options.

The cross-development versions of these programs should not be available on the PATH; if they are, normal applications cannot be compiled on the host computer. To enable configure to find and use the programs provided by the cross-development package, set the appropriate environment variables to the full path name of the STMicroelectronics version. Here is an example for a program which needs gtk-config:

export GTK_CONFIG="/opt/STM/STLinux-2.0/devkit/sh4/sh4-linux/bin/gtk-config"

The environment variable name is always the name of the program in upper case with an underscore replacing the hyphen.

If the library to be built itself installs a -config script, it is important to check the output when the script is invoked using the --cflags and --libs options. The paths listed must point to the target environment. For example, the output of the ST version of glib-config is:

host% cd /opt/STM/STLinux-2.0/devkit/sh4/sh4-linux/bin
host% ./glib-config --cflags -I/usr/include/glib-1.2 -I/usr/lib/glib/include
host% ./glib-config --libs -L/usr/lib -lglib

This command is part of the development environment belonging to the host and therefore should not be installed on the target. For this reason, the directories it prints should be relative to the development host and not to the embedded target. As the output strings are built at compile time, using the argument of the --prefix option, they must be modified before installing the script.

The path to these directories may be modified by using a simple sed script. The following example assumes a package configured for /usr and substitutes that part of the path for the string /opt/STM/STLinux-2.0/devkit/sh4/sh4-linux :

$ mv gdk-pixbuf-config gdk-pixbuf-config.orig
$ sed -e "s#/usr#/opt/STM/STLinux-2.0/devkit/sh4/sh4-linux#/g" \
      < gdk-pixbuf-config.orig > gdk-pixbuf-config

The line break and the backslash are added for readability