itchconfig Documentation
Macros: Installation

Macro IC_INSTALL_CREATE

Creates a sub-target for the Makefile which shall be executed when the user executes "make install". The sub-target will be named "install-target". Standard values for target are bin, include, info, lib, locale, man and sbin; with these, appropriate default values will be used for the other parameters. You can also use any non-standard target name you like (consisting of alphanumeric and underscore characters, starting with a letter) and then set the other parameters as described below.

If path isn't given, it will become prefix/target or archprefix/target, depending on flags & 8. If path is given but isn't an absolute path, it will become prefix/path resp. archprefix/path. (prefix and archprefix are the path prefix values which users can change with the command-line options "--path-prefix" and "--path-archprefix".)

You don't have to provide files here which shall be installed, you can add them later as well with IC_INSTALL_ADD_FILE.

If flags & 1, the installation path isn't known in advance, but it will be auto-detected in the configure script. This mostly affects the default-path text within the help text. Call IC_INSTALL_PATH_SET, usually in combination with IC_IF_INSTALL_PATH_NOT_SET, to set the actual path if a user didn't set it.

If flags & 2, the files will be installed as executable programs. If flags & 4, the files will be installed as executable non-programs (e.g. libraries).

If flags & 8, archprefix will be used instead of prefix.

If you need to know the final installation path somewhere in your package, you can get it by setting behavior. (See IC_SUBSTITUTE.) This will create a substitution identifier of the form "PATH_INSTALL_tt"; tt is the transformed target: all lower-case letters are converted to their upper-case equivalents, and all non-alphanumeric characters are replaced with underscores.

The magic can be used to change the actual, final path and file name of a file (which is to be installed for this target) in special ways. That magic code is basically raw shell script code where you can use certain "meta-variables":

If you don't provide magic, a default magic or none at all will be applied. If magic is just an underscore character ("_"), no magic at all will be applied, even any default magic will be suppressed; this might be useful in some strange cases. You must not attempt to change the values of meta-variables besides %F% and %P%.

All standard targets have the correct default magic already built-in. An example for a default magic: if the files are marked as executable by flags, the file name will be surrounded by the program prefix and suffix chosen by package users: %F%="$%PP%$%F%$%PS%"

Macro IC_INSTALL_ADD_FILE

Adds the files to the targets (which have been formerly created with IC_INSTALL_CREATE).

Macro IC_INSTALL_PATH_SET

Sets the actual installation path for the target to whatever the single-line code gives. Use this in combination with an IC_INSTALL_CREATE command, flags & 1.


This documentation file is part of version 0.0.4 of itchconfig, a configuration tool created by Arne Thomaßen. itchconfig is basically released under certain versions of the GNU General Public License and WITHOUT ANY WARRANTY. Copyright (C) 2002 Arne Thomaßen.