Using "configure"
Introduction
On Linux, Unix, and macOS after you have installed RDM as described in UNIX, Linux, or macOS Installation you now need to configure a build directory for the examples and tutorials.
Optionally, if you are doing a hosted build for Linux or macOS and want to build the examples and tutorials using CMake (A Cross-Platform Build System) instead of the GNU build system, please consult CMake.
A cross compile of RDM using a Unix development host also requires
configure
. Even cross compiles using project files requires
configure
. However, such configures requires additional options
passed on to configure
. Please read on for details.
As explained in the following sections most users will run the
configure
script in its own newly created sub-directory. The
configure
script is crafted using the GNU Build system and can be run
on any UNIX system. The configure
script itself does not rely on any
GNU Auto Tools to be installed. Everything needed is included in the
install. GNU Auto Tools will be needed only if you edit any of the
files that are input to the GNU Build System. Please consult
Using "autoreconf" for details.
Setting up an Environment
You may already have a working development environment that will work with RDM, in which case you can skip this section. If not, please continue.
For some UNIX systems, you will need to set up an environment for the compiler tool chain, and select the compiler and compiler options.
The exact environment we used is documented in an environment script
located in its own target
sub-directory of the install. Depending on
the platform for the object package you installed, you will have one
or more environment scripts like this:
target/qnx-x86_64/env.sh target/arm-unknown-linux-gnueabi/env.sh
For a host development platform, you will have one such script. For a cross compile using the GNU build system there will be two or more such scripts. One script for the host development platform and one for the each cross compiled environment included in the installer package. The scripts contain the exact environment we used for configuring RDM. Make sure that what you use is compatible with this.
These are typical environment variables you may want to set:
Env. Variable | Description |
---|---|
CC | The C compiler to use |
CCX | The C++ compiler to use |
OBJC | The Objective-C compiler to use |
CPPFLAGS | The C and C++ preprocessor defines |
CFLAGS | The C compiler flags |
CXXFLAGS | The C++ compiler flags |
OBJCFLAGS | The Objective-C compiler flags |
LDFLAGS | The linker flags |
LIBS | The libraries to link with |
PATH | The executable search path |
These environment variables should be set before you run
configure
as described below. Make sure you also export
them. The
configure
script will capture these except for the PATH
environment variable. Later, when you run make
, you do not need to have
them set except for the PATH environment variable.
This makes it relatively easy to have more than one build environment and access these build environments using one shell. You can set up one environment for debugging, another one with optimization options set, and maybe even one or more for a cross compile. Some systems may require additional environment variables not captured by the configure script.
If you received our product as an object package, the installer prompted you during installation:
Do you want to compile and run examples [no]?
If you answered "yes," it compiled and ran examples at the end of the installation process.
If you answered "no" to the above question, the examples were not compiled or run during installation. You can compile and run the examples separately as follows (this assume you used the default directory during install):
$ /opt/Raima/{installdir}/compile-and-run-examples.sh
The script will print out all the commands it runs. First, it will
set up the environment. Then it will create a build directory, change
the current working directory to it, run custom configure
scripts
followed by make
, and lastly run all the examples.
Running configure
After you have set up the environment as explained in previous
section, it is time to create a build directory and run configure
.
Running configure for the host development platform
$ mkdir mybuild $ cd mybuild $ /opt/Raima/{installdir}/target/{targetdir}/configure
where {targetdir}
is the actual target you are compiling for. As explained in
previous section there are one or more target configure
scripts.
Running configure for a cross compile using the GNU Build System
Running configure
for a cross compile using the GNU Build System can
be done in the exact same way as described for the host development
platform above except that you will be using the custom configure
script located in the target
directory for the cross compile instead
of the custom configure
script for the host development platform.
Running configure for a cross compile using project files
Doing a cross compile using project files requires a configure for various reasons:
- RDM contains generated source files and the project files do not have any custom rules built into them to produce any of them. These generated source files need to be produced by a hosted build and we therefore need to configure a hosted build for this.
A generated source file is a source file produced during the build that is output from an RDM compile time tool.
- The project files need to reference both source files located in the install and generated source files located in the build directory and the exact location needs to be set directly into the project files.
- Some project files need absolute paths instead of relative paths.
- To comply with standards, we never alter the install directory after the products have been installed. This assumes the build directory is configured outside the install directory.
This type of project file build requires a configure
of the build
directory for a cross compile. The cross compile will rely on a set of project files. The configure
script needs one extra option to instantiate both as described in the
following subsections.
INTEGRITY project files
To configure for a cross compile using Multi project files targeting
INTEGRITY run configure
as follows:
$ {rdm-install-dir}/target/{target-dir}/configure --enable-integrity-project-files
QNX project files
To configure for a cross compile using Workbench targeting QNX run
configure
as follows:
$ {rdm-install-dir}/target/{target-dir}/configure --enable-qnx-project-files
VxWorks 7.x kernel modules project files
To configure for a cross compile using Workbench targeting VxWorks 7.x kernel modules run configure
as follows:
$ {rdm-install-dir}/target/{target-dir}/configure --enable-vxworks7-project-files
VxWorks 7.x RTP project files
To configure for a cross compile using Workbench targeting VxWorks 7.x RTP run configure
as follows:
$ {rdm-install-dir}/target/{target-dir}/configure --enable-vxworks7-project-files
Next Step
When RDM has been configured, the next step is to do a build in the build directory using make as described in Using "make".