Next: , Previous: , Up: Adding options to a configure script   [Contents][Index]

11.6 Transforming Program Names When Installing

TODO: Where to put this?

The GNU Build System provides means to automatically rename executables and manpages before they are installed (see Man Pages). This is especially convenient when installing a GNU package on a system that already has a proprietary implementation you do not want to overwrite. For instance, you may want to install GNU tar as gtar so you can distinguish it from your vendor’s tar.

This can be done using one of these three configure options.

--program-prefix=prefix

Prepend prefix to installed program names.

--program-suffix=suffix

Append suffix to installed program names.

--program-transform-name=program

Run sed program on installed program names.

The following commands would install hello as /usr/local/bin/test-hello, for instance.

~/amhello-1.0 % ./configure --program-prefix test-
…
~/amhello-1.0 % make
…
~/amhello-1.0 % sudo make install

Autoconf supports changing the names of programs when installing them. In order to use these transformations, configure.ac must call the macro AC_ARG_PROGRAM.

Macro: AC_ARG_PROGRAM

Place in output variable program_transform_name a sequence of sed commands for changing the names of installed programs.

If any of the options described below are given to configure, program names are transformed accordingly. Otherwise, if AC_CANONICAL_TARGET has been called and a --target value is given, the target type followed by a dash is used as a prefix. Otherwise, no program name transformation is done.

Next: , Previous: , Up: Adding options to a configure script   [Contents][Index]