home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / info / autoconf.info-4 (.txt) < prev    next >
GNU Info File  |  1994-12-22  |  49KB  |  858 lines

  1. This is Info file /gnu/src/amiga/autoconf-2.1/autoconf.info, produced
  2. by Makeinfo-1.55 from the input file
  3. /gnu/src/amiga/autoconf-2.1/autoconf.texi.
  4. START-INFO-DIR-ENTRY
  5. * Autoconf: (autoconf).         Create source code configuration scripts.
  6. END-INFO-DIR-ENTRY
  7.    This file documents the GNU Autoconf package for creating scripts to
  8. configure source code packages using templates and an `m4' macro
  9. package.
  10.    Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
  11.    Permission is granted to make and distribute verbatim copies of this
  12. manual provided the copyright notice and this permission notice are
  13. preserved on all copies.
  14.    Permission is granted to copy and distribute modified versions of
  15. this manual under the conditions for verbatim copying, provided that
  16. the entire resulting derived work is distributed under the terms of a
  17. permission notice identical to this one.
  18.    Permission is granted to copy and distribute translations of this
  19. manual into another language, under the above conditions for modified
  20. versions, except that this permission notice may be stated in a
  21. translation approved by the Foundation.
  22. File: autoconf.info,  Node: Transforming Names,  Next: Site Defaults,  Prev: Site Details,  Up: Site Configuration
  23. Transforming Program Names When Installing
  24. ==========================================
  25.    Autoconf supports changing the names of programs when installing
  26. them.  In order to use these transformations, `configure.in' must call
  27. the macro `AC_ARG_PROGRAM'.
  28.  - Macro: AC_ARG_PROGRAM
  29.      Place in output variable `program_transform_name' a sequence of
  30.      `sed' commands for changing the names of installed programs.
  31.      If any of the options described below are given to `configure',
  32.      program names are transformed accordingly.  Otherwise, if
  33.      `AC_CANONICAL_SYSTEM' has been called and a `--target' value is
  34.      given that differs from the host type (specified with `--host' or
  35.      defaulted by `config.sub'), the target type followed by a dash is
  36.      used as a prefix.  Otherwise, no program name transformation is
  37.      done.
  38. * Menu:
  39. * Transformation Options::      `configure' options to transforme names.
  40. * Transformation Examples::     Sample uses of transforming names.
  41. * Transformation Rules::        `Makefile' uses of transforming names.
  42. File: autoconf.info,  Node: Transformation Options,  Next: Transformation Examples,  Up: Transforming Names
  43. Transformation Options
  44. ----------------------
  45.    You can specify name transformations by giving `configure' these
  46. command line options:
  47. `--program-prefix=PREFIX'
  48.      prepend PREFIX to the names;
  49. `--program-suffix=SUFFIX'
  50.      append SUFFIX to the names;
  51. `--program-transform-name=EXPRESSION'
  52.      perform `sed' substitution EXPRESSION on the names.
  53. File: autoconf.info,  Node: Transformation Examples,  Next: Transformation Rules,  Prev: Transformation Options,  Up: Transforming Names
  54. Transformation Examples
  55. -----------------------
  56.    These transformations are useful with programs that can be part of a
  57. cross-compilation development environment.  For example, a
  58. cross-assembler running on a Sun 4 configured with
  59. `--target=i960-vxworks' is normally installed as `i960-vxworks-as',
  60. rather than `as', which could be confused with a native Sun 4 assembler.
  61.    You can force a program name to begin with `g', if you don't want
  62. GNU programs installed on your system to shadow other programs with the
  63. same name.  For example, if you configure GNU `diff' with
  64. `--program-prefix=g', then when you run `make install' it is installed
  65. as `/usr/local/bin/gdiff'.
  66.    As a more sophistocated example, you could use
  67.      --program-transform-name='s/^/g/; s/^gg/g/; s/^gless/less/'
  68. to prepend `g' to most of the program names in a source tree, excepting
  69. those like `gdb' that already have one and those like `less' and
  70. `lesskey' that aren't GNU programs.  (That is assuming that you have a
  71. source tree containing those programs that is set up to use this
  72. feature.)
  73.    One way to install multiple versions of some programs simultaneously
  74. is to append a version number to the name of one or both.  For example,
  75. if you want to keep Autoconf version 1 around for awhile, you can
  76. configure Autoconf version 2 using `--program-suffix=2' to install the
  77. programs as `/usr/local/bin/autoconf2', `/usr/local/bin/autoheader2',
  78. File: autoconf.info,  Node: Transformation Rules,  Prev: Transformation Examples,  Up: Transforming Names
  79. Transformation Rules
  80. --------------------
  81.    Here is how to use the variable `program_transform_name' in a
  82. `Makefile.in':
  83.      transform=@program_transform_name@
  84.      install: all
  85.              $(INSTALL_PROGRAM) myprog $(bindir)/`echo myprog|sed '$(transform)'`
  86.      
  87.      uninstall:
  88.              rm -f $(bindir)/`echo myprog|sed '$(transform)'`
  89. If you have more than one program to install, you can do it in a loop:
  90.      PROGRAMS=cp ls rm
  91.      install:
  92.              for p in $(PROGRAMS); do \
  93.                $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
  94.              done
  95.      
  96.      uninstall:
  97.              for p in $(PROGRAMS); do \
  98.                rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
  99.              done
  100.    Whether to do the transformations on documentation files (Texinfo or
  101. `man') is a tricky question; there seems to be no perfect answer, due
  102. to the several reasons for name transforming.  Documentation is not
  103. usually particular to a specific architecture, and Texinfo files do not
  104. conflict with system documentation.  But they might conflict with
  105. earlier versions of the same files, and `man' pages sometimes do
  106. conflict with system documentation.  As a compromise, it is probably
  107. best to do name transformations on `man' pages but not on Texinfo
  108. manuals.
  109. File: autoconf.info,  Node: Site Defaults,  Prev: Transforming Names,  Up: Site Configuration
  110. Setting Site Defaults
  111. =====================
  112.    Autoconf-generated `configure' scripts allow your site to provide
  113. default values for some configuration values.  You do this by creating
  114. site- and system-wide initialization files.
  115.    If the environment variable `CONFIG_SITE' is set, `configure' uses
  116. its value as the name of a shell script to read.  Otherwise, it reads
  117. the shell script `PREFIX/share/config.site' if it exists, then
  118. `PREFIX/etc/config.site' if it exists.  Thus, settings in
  119. machine-specific files override those in machine-independent ones in
  120. case of conflict.
  121.    Site files can be arbitrary shell scripts, but only certain kinds of
  122. code are really appropriate to be in them.  Because `configure' reads
  123. any cache file after it has read any site files, a site file can define
  124. a default cache file to be shared between all Autoconf-generated
  125. `configure' scripts run on that system.  If you set a default cache
  126. file in a site file, it is a good idea to also set the output variable
  127. `CC' in that site file, because the cache file is only valid for a
  128. particular compiler, but many systems have several available.
  129.    Site files are also good places to set default values for other
  130. output variables, such as `CFLAGS', if you need to give them non-default
  131. values: anything you would normally do, repetitively, on the command
  132. line.  If you use non-default values for PREFIX or EXEC_PREFIX
  133. (wherever you locate the site file), you can set them in the site file
  134. if you specify it with the `CONFIG_SITE' environment variable.
  135.    You can set some cache values in the site file itself.  Doing this is
  136. useful if you are cross-compiling, so it is impossible to check features
  137. that require running a test program.  You could "prime the cache" by
  138. setting those values correctly for that system in
  139. `PREFIX/etc/config.site'.  To find out the names of the cache variables
  140. you need to set, look for shell variables with `_cv_' in their names in
  141. the affected `configure' scripts, or in the Autoconf `m4' source code
  142. for those macros.
  143.    The cache file is careful to not override any variables set in the
  144. site files.  Similarly, you should not override command-line options in
  145. the site files.  Your code should check that variables such as `prefix'
  146. and `cache_file' have their default values (as set near the top of
  147. `configure') before changing them.
  148.    Here is a sample file `/usr/share/local