[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The target libraries in the Cygnus tree are automatically built with multilibs. That means that each library is built multiple times.
This default is set in the top level `configure.in' file, by adding `--enable-multilib' to the list of arguments passed to configure when it is run for the target libraries (see section 5.6.1 Host and Target Libraries).
Each target library uses the shell script `config-ml.in', written by Doug Evans, to prepare to build target libraries. This shell script is invoked after the `Makefile' has been created by the `configure' script. If multilibs are not enabled, it does nothing, otherwise it modifies the `Makefile' to support multilibs.
The `config-ml.in' script makes one copy of the `Makefile' for each multilib in the appropriate subdirectory. When configuring in the source directory (which is not recommended), it will build a symlink tree of the sources in each subdirectory.
The `config-ml.in' script sets several variables in the various `Makefile's. The `Makefile.in' must have definitions for these variables already; `config-ml.in' simply changes the existing values. The `Makefile' should use default values for these variables which will do the right thing in the subdirectories.
All references to the parent of the source directory should use the variable `MULTISRCTOP'. Instead of writing `$(srcdir)/..', you must write `$(srcdir)/$(MULTISRCTOP)..'.
Similarly, references to the parent of the object directory should use the variable `MULTIBUILDTOP'.
In the installation target, the libraries should be installed in the subdirectory `MULTISUBDIR'. Instead of installing `$(libdir)/libfoo.a', install `$(libdir)$(MULTISUBDIR)/libfoo.a'.
The `config-ml.in' script also modifies the top level `Makefile' to add `multi-do' and `multi-clean' targets which are used when building multilibs.
The default target of the `Makefile' should include the following command:
@$(MULTIDO) $(FLAGS_TO_PASS) DO=all multi-do |
The `install' target of the `Makefile' should include the following command:
@$(MULTIDO) $(FLAGS_TO_PASS) DO=install multi-do |
In general, any operation, other than clean, which should be performed on all the multilibs should use a `$(MULTIDO)' line, setting the variable `DO' to the target of each recursive call to `make'.
The `clean' targets (`clean', `mostlyclean', etc.) should use `$(MULTICLEAN)'. For example, the `clean' target should do this:
@$(MULTICLEAN) DO=clean multi-clean |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |