fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / binutils / etc / configure.info
blob1f6bfc6acb29ba222caa9f3e6a1f82009220e846
1 This is configure.info, produced by makeinfo version 4.6 from
2 ./configure.texi.
4 INFO-DIR-SECTION GNU admin
5 START-INFO-DIR-ENTRY
6 * configure: (configure).       The GNU configure and build system
7 END-INFO-DIR-ENTRY
9    This file documents the GNU configure and build system.
11    Copyright (C) 1998 Cygnus Solutions.
13    Permission is granted to make and distribute verbatim copies of this
14 manual provided the copyright notice and this permission notice are
15 preserved on all copies.
17    Permission is granted to copy and distribute modified versions of
18 this manual under the conditions for verbatim copying, provided that
19 the entire resulting derived work is distributed under the terms of a
20 permission notice identical to this one.
22    Permission is granted to copy and distribute translations of this
23 manual into another language, under the above conditions for modified
24 versions, except that this permission notice may be stated in a
25 translation approved by the Foundation.
27 \x1f
28 File: configure.info,  Node: Top,  Next: Introduction,  Up: (dir)
30 GNU configure and build system
31 ******************************
33 The GNU configure and build system.
35 * Menu:
37 * Introduction::                Introduction.
38 * Getting Started::             Getting Started.
39 * Files::                       Files.
40 * Configuration Names::         Configuration Names.
41 * Cross Compilation Tools::     Cross Compilation Tools.
42 * Canadian Cross::              Canadian Cross.
43 * Cygnus Configure::            Cygnus Configure.
44 * Multilibs::                   Multilibs.
45 * FAQ::                         Frequently Asked Questions.
46 * Index::                       Index.
48 \x1f
49 File: configure.info,  Node: Introduction,  Next: Getting Started,  Prev: Top,  Up: Top
51 Introduction
52 ************
54 This document describes the GNU configure and build systems.  It
55 describes how autoconf, automake, libtool, and make fit together.  It
56 also includes a discussion of the older Cygnus configure system.
58    This document does not describe in detail how to use each of the
59 tools; see the respective manuals for that.  Instead, it describes
60 which files the developer must write, which files are machine generated
61 and how they are generated, and where certain common problems should be
62 addressed.
64    This document draws on several sources, including the autoconf
65 manual by David MacKenzie (*note autoconf overview: (autoconf)Top.),
66 the automake manual by David MacKenzie and Tom Tromey (*note automake
67 overview: (automake)Top.), the libtool manual by Gordon Matzigkeit
68 (*note libtool overview: (libtool)Top.), and the Cygnus configure
69 manual by K. Richard Pixley.
71 * Menu:
73 * Goals::                       Goals.
74 * Tools::                       The tools.
75 * History::                     History.
76 * Building::                    Building.
78 \x1f
79 File: configure.info,  Node: Goals,  Next: Tools,  Up: Introduction
81 Goals
82 =====
84 The GNU configure and build system has two main goals.
86    The first is to simplify the development of portable programs.  The
87 system permits the developer to concentrate on writing the program,
88 simplifying many details of portability across Unix and even Windows
89 systems, and permitting the developer to describe how to build the
90 program using simple rules rather than complex Makefiles.
92    The second is to simplify the building of programs distributed as
93 source code.  All programs are built using a simple, standardized, two
94 step process.  The program builder need not install any special tools in
95 order to build the program.
97 \x1f
98 File: configure.info,  Node: Tools,  Next: History,  Prev: Goals,  Up: Introduction
100 Tools
101 =====
103 The GNU configure and build system is comprised of several different
104 tools.  Program developers must build and install all of these tools.
106    People who just want to build programs from distributed sources
107 normally do not need any special tools beyond a Unix shell, a make
108 program, and a C compiler.
110 autoconf
111      provides a general portability framework, based on testing the
112      features of the host system at build time.
114 automake
115      a system for describing how to build a program, permitting the
116      developer to write a simplified `Makefile'.
118 libtool
119      a standardized approach to building shared libraries.
121 gettext
122      provides a framework for translation of text messages into other
123      languages; not really discussed in this document.
126      autoconf requires the GNU version of m4; the standard Unix m4 does
127      not suffice.
129 perl
130      automake requires perl.
132 \x1f
133 File: configure.info,  Node: History,  Next: Building,  Prev: Tools,  Up: Introduction
135 History
136 =======
138 This is a very brief and probably inaccurate history.
140    As the number of Unix variants increased during the 1980s, it became
141 harder to write programs which could run on all variants.  While it was
142 often possible to use `#ifdef' to identify particular systems,
143 developers frequently did not have access to every system, and the
144 characteristics of some systems changed from version to version.
146    By 1992, at least three different approaches had been developed:
147    * The Metaconfig program, by Larry Wall, Harlan Stenn, and Raphael
148      Manfredi.
150    * The Cygnus configure script, by K. Richard Pixley, and the gcc
151      configure script, by Richard Stallman.  These use essentially the
152      same approach, and the developers communicated regularly.
154    * The autoconf program, by David MacKenzie.
156    The Metaconfig program is still used for Perl and a few other
157 programs.  It is part of the Dist package.  I do not know if it is
158 being developed.
160    In 1994, David MacKenzie and others modified autoconf to incorporate
161 all the features of Cygnus configure.  Since then, there has been a
162 slow but steady conversion of GNU programs from Cygnus configure to
163 autoconf. gcc has been converted, eliminating the gcc configure script.
165    GNU autoconf was regularly maintained until late 1996.  As of this
166 writing in June, 1998, it has no public maintainer.
168    Most programs are built using the make program, which requires the
169 developer to write Makefiles describing how to build the programs.
170 Since most programs are built in pretty much the same way, this led to a
171 lot of duplication.
173    The X Window system is built using the imake tool, which uses a
174 database of rules to eliminate the duplication.  However, building a
175 tool which was developed using imake requires that the builder have
176 imake installed, violating one of the goals of the GNU system.
178    The new BSD make provides a standard library of Makefile fragments,
179 which permits developers to write very simple Makefiles.  However, this
180 requires that the builder install the new BSD make program.
182    In 1994, David MacKenzie wrote the first version of automake, which
183 permitted writing a simple build description which was converted into a
184 Makefile which could be used by the standard make program.  In 1995, Tom
185 Tromey completely rewrote automake in Perl, and he continues to enhance
188    Various free packages built libraries, and by around 1995 several
189 included support to build shared libraries on various platforms.
190 However, there was no consistent approach.  In early 1996, Gordon
191 Matzigkeit began working on libtool, which provided a standardized
192 approach to building shared libraries.  This was integrated into
193 automake from the start.
195    The development of automake and libtool was driven by the GNITS
196 project, a group of GNU maintainers who designed standardized tools to
197 help meet the GNU coding standards.
199 \x1f
200 File: configure.info,  Node: Building,  Prev: History,  Up: Introduction
202 Building
203 ========
205 Most readers of this document should already know how to build a tool by
206 running `configure' and `make'.  This section may serve as a quick
207 introduction or reminder.
209    Building a tool is normally as simple as running `configure'
210 followed by `make'.  You should normally run `configure' from an empty
211 directory, using some path to refer to the `configure' script in the
212 source directory.  The directory in which you run `configure' is called
213 the "object directory".
215    In order to use a object directory which is different from the source
216 directory, you must be using the GNU version of `make', which has the
217 required `VPATH' support.  Despite this restriction, using a different
218 object directory is highly recommended:
219    * It keeps the files generated during the build from cluttering up
220      your sources.
222    * It permits you to remove the built files by simply removing the
223      entire build directory.
225    * It permits you to build from the same sources with several sets of
226      configure options simultaneously.
228    If you don't have GNU `make', you will have to run `configure' in
229 the source directory.  All GNU packages should support this; in
230 particular, GNU packages should not assume the presence of GNU `make'.
232    After running `configure', you can build the tools by running `make'.
234    To install the tools, run `make install'.  Installing the tools will
235 copy the programs and any required support files to the "installation
236 directory".  The location of the installation directory is controlled
237 by `configure' options, as described below.
239    In the Cygnus tree at present, the info files are built and
240 installed as a separate step.  To build them, run `make info'.  To
241 install them, run `make install-info'.
243    All `configure' scripts support a wide variety of options.  The most
244 interesting ones are `--with' and `--enable' options which are
245 generally specific to particular tools.  You can usually use the
246 `--help' option to get a list of interesting options for a particular
247 configure script.
249    The only generic options you are likely to use are the `--prefix'
250 and `--exec-prefix' options.  These options are used to specify the
251 installation directory.
253    The directory named by the `--prefix' option will hold machine
254 independent files such as info files.
256    The directory named by the `--exec-prefix' option, which is normally
257 a subdirectory of the `--prefix' directory, will hold machine dependent
258 files such as executables.
260    The default for `--prefix' is `/usr/local'.  The default for
261 `--exec-prefix' is the value used for `--prefix'.
263    The convention used in Cygnus releases is to use a `--prefix' option
264 of `/usr/cygnus/RELEASE', where RELEASE is the name of the release, and
265 to use a `--exec-prefix' option of `/usr/cygnus/RELEASE/H-HOST', where
266 HOST is the configuration name of the host system (*note Configuration
267 Names::).
269    Do not use either the source or the object directory as the
270 installation directory.  That will just lead to confusion.
272 \x1f
273 File: configure.info,  Node: Getting Started,  Next: Files,  Prev: Introduction,  Up: Top
275 Getting Started
276 ***************
278 To start using the GNU configure and build system with your software
279 package, you must write three files, and you must run some tools to
280 manually generate additional files.
282 * Menu:
284 * Write configure.in::          Write configure.in.
285 * Write Makefile.am::           Write Makefile.am.
286 * Write acconfig.h::            Write acconfig.h.
287 * Generate files::              Generate files.
288 * Getting Started Example::     Example.
290 \x1f
291 File: configure.info,  Node: Write configure.in,  Next: Write Makefile.am,  Up: Getting Started
293 Write configure.in
294 ==================
296 You must first write the file `configure.in'.  This is an autoconf
297 input file, and the autoconf manual describes in detail what this file
298 should look like.
300    You will write tests in your `configure.in' file to check for
301 conditions that may change from one system to another, such as the
302 presence of particular header files or functions.
304    For example, not all systems support the `gettimeofday' function.
305 If you want to use the `gettimeofday' function when it is available,
306 and to use some other function when it is not, you would check for this
307 by putting `AC_CHECK_FUNCS(gettimeofday)' in `configure.in'.
309    When the configure script is run at build time, this will arrange to
310 define the preprocessor macro `HAVE_GETTIMEOFDAY' to the value 1 if the
311 `gettimeofday' function is available, and to not define the macro at
312 all if the function is not available.  Your code can then use `#ifdef'
313 to test whether it is safe to call `gettimeofday'.
315    If you have an existing body of code, the `autoscan' program may
316 help identify potential portability problems, and hence configure tests
317 that you will want to use.  *Note Invoking autoscan: (autoconf)Invoking
318 autoscan.
320    Another handy tool for an existing body of code is `ifnames'.  This
321 will show you all the preprocessor conditionals that the code already
322 uses.  *Note Invoking ifnames: (autoconf)Invoking ifnames.
324    Besides the portability tests which are specific to your particular
325 package, every `configure.in' file should contain the following macros.
327 `AC_INIT'
328      This macro takes a single argument, which is the name of a file in
329      your package.  For example, `AC_INIT(foo.c)'.
331 `AC_PREREQ(VERSION)'
332      This macro is optional.  It may be used to indicate the version of
333      `autoconf' that you are using.  This will prevent users from
334      running an earlier version of `autoconf' and perhaps getting an
335      invalid `configure' script.  For example, `AC_PREREQ(2.12)'.
337 `AM_INIT_AUTOMAKE'
338      This macro takes two arguments: the name of the package, and a
339      version number.  For example, `AM_INIT_AUTOMAKE(foo, 1.0)'.  (This
340      macro is not needed if you are not using automake).
342 `AM_CONFIG_HEADER'
343      This macro names the header file which will hold the preprocessor
344      macro definitions at run time.  Normally this should be
345      `config.h'.  Your sources would then use `#include "config.h"' to
346      include it.
348      This macro may optionally name the input file for that header
349      file; by default, this is `config.h.in', but that file name works
350      poorly on DOS filesystems.  Therefore, it is often better to name
351      it explicitly as `config.in'.
353      This is what you should normally put in `configure.in':
354           AM_CONFIG_HEADER(config.h:config.in)
356      (If you are not using automake, use `AC_CONFIG_HEADER' rather than
357      `AM_CONFIG_HEADER').
359 `AM_MAINTAINER_MODE'
360      This macro always appears in Cygnus configure scripts.  Other
361      programs may or may not use it.
363      If this macro is used, the `--enable-maintainer-mode' option is
364      required to enable automatic rebuilding of generated files used by
365      the configure system.  This of course requires that developers be
366      aware of, and use, that option.
368      If this macro is not used, then the generated files will always be
369      rebuilt automatically.  This will cause problems if the wrong
370      versions of autoconf, automake, or others are in the builder's
371      `PATH'.
373      (If you are not using automake, you do not need to use this macro).
375 `AC_EXEEXT'
376      Either this macro or `AM_EXEEXT' always appears in Cygnus configure
377      files.  Other programs may or may not use one of them.
379      This macro looks for the executable suffix used on the host
380      system.  On Unix systems, this is the empty string.  On Windows
381      systems, this is `.exe'.  This macro directs automake to use the
382      executable suffix as appropriate when creating programs.  This
383      macro does not take any arguments.
385      The `AC_EXEEXT' form is new, and is part of a Cygnus patch to
386      autoconf to support compiling with Visual C++.  Older programs use
387      `AM_EXEEXT' instead.
389      (Programs which do not use automake use neither `AC_EXEEXT' nor
390      `AM_EXEEXT').
392 `AC_PROG_CC'
393      If you are writing C code, you will normally want to use this
394      macro.  It locates the C compiler to use.  It does not take any
395      arguments.
397      However, if this `configure.in' file is for a library which is to
398      be compiled by a cross compiler which may not fully work, then you
399      will not want to use `AC_PROG_CC'.  Instead, you will want to use a
400      variant which does not call the macro `AC_PROG_CC_WORKS'.  Examples
401      can be found in various `configure.in' files for libraries that are
402      compiled with cross compilers, such as libiberty or libgloss.
403      This is essentially a bug in autoconf, and there will probably be
404      a better workaround at some point.
406 `AC_PROG_CXX'
407      If you are writing C++ code, you will want to use this macro.  It
408      locates the C++ compiler to use.  It does not take any arguments.
409      The same cross compiler comments apply as for `AC_PROG_CC'.
411 `AM_PROG_LIBTOOL'
412      If you want to build libraries, and you want to permit them to be
413      shared, or you want to link against libraries which were built
414      using libtool, then you will need this macro.  This macro is
415      required in order to use libtool.
417      By default, this will cause all libraries to be built as shared
418      libraries.  To prevent this-to change the default-use
419      `AM_DISABLE_SHARED' before `AM_PROG_LIBTOOL'.  The configure
420      options `--enable-shared' and `--disable-shared' may be used to
421      override the default at build time.
423 `AC_DEFINE(_GNU_SOURCE)'
424      GNU packages should normally include this line before any other
425      feature tests.  This defines the macro `_GNU_SOURCE' when
426      compiling, which directs the libc header files to provide the
427      standard GNU system interfaces including all GNU extensions.  If
428      this macro is not defined, certain GNU extensions may not be
429      available.
431 `AC_OUTPUT'
432      This macro takes a list of file names which the configure process
433      should produce.  This is normally a list of one or more `Makefile'
434      files in different directories.  If your package lives entirely in
435      a single directory, you would use simply `AC_OUTPUT(Makefile)'.
436      If you also have, for example, a `lib' subdirectory, you would use
437      `AC_OUTPUT(Makefile lib/Makefile)'.
439    If you want to use locally defined macros in your `configure.in'
440 file, then you will need to write a `acinclude.m4' file which defines
441 them (if not using automake, this file is called `aclocal.m4').
442 Alternatively, you can put separate macros in an `m4' subdirectory, and
443 put `ACLOCAL_AMFLAGS = -I m4' in your `Makefile.am' file so that the
444 `aclocal' program will be able to find them.
446    The different macro prefixes indicate which tool defines the macro.
447 Macros which start with `AC_' are part of autoconf.  Macros which start
448 with `AM_' are provided by automake or libtool.
450 \x1f
451 File: configure.info,  Node: Write Makefile.am,  Next: Write acconfig.h,  Prev: Write configure.in,  Up: Getting Started
453 Write Makefile.am
454 =================
456 You must write the file `Makefile.am'.  This is an automake input file,
457 and the automake manual describes in detail what this file should look
458 like.
460    The automake commands in `Makefile.am' mostly look like variable
461 assignments in a `Makefile'.  automake recognizes special variable
462 names, and automatically add make rules to the output as needed.
464    There will be one `Makefile.am' file for each directory in your
465 package.  For each directory with subdirectories, the `Makefile.am'
466 file should contain the line
467      SUBDIRS = DIR DIR ...
469 where each DIR is the name of a subdirectory.
471    For each `Makefile.am', there should be a corresponding `Makefile'
472 in the `AC_OUTPUT' macro in `configure.in'.
474    Every `Makefile.am' written at Cygnus should contain the line
475      AUTOMAKE_OPTIONS = cygnus
477 This puts automake into Cygnus mode.  See the automake manual for
478 details.
480    You may to include the version number of `automake' that you are
481 using on the `AUTOMAKE_OPTIONS' line.  For example,
482      AUTOMAKE_OPTIONS = cygnus 1.3
484 This will prevent users from running an earlier version of `automake'
485 and perhaps getting an invalid `Makefile.in'.
487    If your package builds a program, then in the directory where that
488 program is built you will normally want a line like
489      bin_PROGRAMS = PROGRAM
491 where PROGRAM is the name of the program.  You will then want a line
492 like
493      PROGRAM_SOURCES = FILE FILE ...
495 where each FILE is the name of a source file to link into the program
496 (e.g., `foo.c').
498    If your package builds a library, and you do not want the library to
499 ever be built as a shared library, then in the directory where that
500 library is built you will normally want a line like
501      lib_LIBRARIES = libNAME.a
503 where `libNAME.a' is the name of the library.  You will then want a
504 line like
505      libNAME_a_SOURCES = FILE FILE ...
507 where each FILE is the name of a source file to add to the library.
509    If your package builds a library, and you want to permit building the
510 library as a shared library, then in the directory where that library is
511 built you will normally want a line like
512      lib_LTLIBRARIES = libNAME.la
513    The use of `LTLIBRARIES', and the `.la' extension, indicate a
514 library to be built using libtool.  As usual, you will then want a line
515 like
516      libNAME_la_SOURCES = FILE FILE ...
518    The strings `bin' and `lib' that appear above in `bin_PROGRAMS' and
519 `lib_LIBRARIES' are not arbitrary.  They refer to particular
520 directories, which may be set by the `--bindir' and `--libdir' options
521 to `configure'.  If those options are not used, the default values are
522 based on the `--prefix' or `--exec-prefix' options to `configure'.  It
523 is possible to use other names if the program or library should be
524 installed in some other directory.
526    The `Makefile.am' file may also contain almost anything that may
527 appear in a normal `Makefile'.  automake also supports many other
528 special variables, as well as conditionals.
530    See the automake manual for more information.
532 \x1f
533 File: configure.info,  Node: Write acconfig.h,  Next: Generate files,  Prev: Write Makefile.am,  Up: Getting Started
535 Write acconfig.h
536 ================
538 If you are generating a portability header file, (i.e., you are using
539 `AM_CONFIG_HEADER' in `configure.in'), then you will have to write a
540 `acconfig.h' file.  It will have to contain the following lines.
542      /* Name of package.  */
543      #undef PACKAGE
544      
545      /* Version of package.  */
546      #undef VERSION
548    This requirement is really a bug in the system, and the requirement
549 may be eliminated at some later date.
551    The `acconfig.h' file will also similar comment and `#undef' lines
552 for any unusual macros in the `configure.in' file, including any macro
553 which appears in a `AC_DEFINE' macro.
555    In particular, if you are writing a GNU package and therefore include
556 `AC_DEFINE(_GNU_SOURCE)' in `configure.in' as suggested above, you will
557 need lines like this in `acconfig.h':
558      /* Enable GNU extensions.  */
559      #undef _GNU_SOURCE
561    Normally the `autoheader' program will inform you of any such
562 requirements by printing an error message when it is run.  However, if
563 you do anything particular odd in your `configure.in' file, you will
564 have to make sure that the right entries appear in `acconfig.h', since
565 otherwise the results of the tests may not be available in the
566 `config.h' file which your code will use.
568    (Thee `PACKAGE' and `VERSION' lines are not required if you are not
569 using automake, and in that case you may not need a `acconfig.h' file
570 at all).
572 \x1f
573 File: configure.info,  Node: Generate files,  Next: Getting Started Example,  Prev: Write acconfig.h,  Up: Getting Started
575 Generate files
576 ==============
578 Once you have written `configure.in', `Makefile.am', `acconfig.h', and
579 possibly `acinclude.m4', you must use autoconf and automake programs to
580 produce the first versions of the generated files.  This is done by
581 executing the following sequence of commands.
583      aclocal
584      autoconf
585      autoheader
586      automake
588    The `aclocal' and `automake' commands are part of the automake
589 package, and the `autoconf' and `autoheader' commands are part of the
590 autoconf package.
592    If you are using a `m4' subdirectory for your macros, you will need
593 to use the `-I m4' option when you run `aclocal'.
595    If you are not using the Cygnus tree, use the `-a' option when
596 running `automake' command in order to copy the required support files
597 into your source directory.
599    If you are using libtool, you must build and install the libtool
600 package with the same `--prefix' and `--exec-prefix' options as you
601 used with the autoconf and automake packages.  You must do this before
602 running any of the above commands.  If you are not using the Cygnus
603 tree, you will need to run the `libtoolize' program to copy the libtool
604 support files into your directory.
606    Once you have managed to run these commands without getting any
607 errors, you should create a new empty directory, and run the `configure'
608 script which will have been created by `autoconf' with the
609 `--enable-maintainer-mode' option.  This will give you a set of
610 Makefiles which will include rules to automatically rebuild all the
611 generated files.
613    After doing that, whenever you have changed some of the input files
614 and want to regenerated the other files, go to your object directory
615 and run `make'.  Doing this is more reliable than trying to rebuild the
616 files manually, because there are complex order dependencies and it is
617 easy to forget something.
619 \x1f
620 File: configure.info,  Node: Getting Started Example,  Prev: Generate files,  Up: Getting Started
622 Example
623 =======
625 Let's consider a trivial example.
627    Suppose we want to write a simple version of `touch'.  Our program,
628 which we will call `poke', will take a single file name argument, and
629 use the `utime' system call to set the modification and access times of
630 the file to the current time.  We want this program to be highly
631 portable.
633    We'll first see what this looks like without using autoconf and
634 automake, and then see what it looks like with them.
636 * Menu:
638 * Getting Started Example 1::           First Try.
639 * Getting Started Example 2::           Second Try.
640 * Getting Started Example 3::           Third Try.
641 * Generate Files in Example::           Generate Files.
643 \x1f
644 File: configure.info,  Node: Getting Started Example 1,  Next: Getting Started Example 2,  Up: Getting Started Example
646 First Try
647 ---------
649 Here is our first try at `poke.c'.  Note that we've written it without
650 ANSI/ISO C prototypes, since we want it to be highly portable.
652      #include <stdio.h>
653      #include <stdlib.h>
654      #include <sys/types.h>
655      #include <utime.h>
656      
657      int
658      main (argc, argv)
659           int argc;
660           char **argv;
661      {
662        if (argc != 2)
663          {
664            fprintf (stderr, "Usage: poke file\n");
665            exit (1);
666          }
667      
668        if (utime (argv[1], NULL) < 0)
669          {
670            perror ("utime");
671            exit (1);
672          }
673      
674        exit (0);
675      }
677    We also write a simple `Makefile'.
679      CC = gcc
680      CFLAGS = -g -O2
681      
682      all: poke
683      
684      poke: poke.o
685         $(CC) -o poke $(CFLAGS) $(LDFLAGS) poke.o
687    So far, so good.
689    Unfortunately, there are a few problems.
691    On older Unix systems derived from BSD 4.3, the `utime' system call
692 does not accept a second argument of `NULL'.  On those systems, we need
693 to pass a pointer to `struct utimbuf' structure.  Unfortunately, even
694 older systems don't define that structure; on those systems, we need to
695 pass an array of two `long' values.
697    The header file `stdlib.h' was invented by ANSI C, and older systems
698 don't have a copy.  We included it above to get a declaration of `exit'.
700    We can find some of these portability problems by running
701 `autoscan', which will create a `configure.scan' file which we can use
702 as a prototype for our `configure.in' file.  I won't show the output,
703 but it will notice the potential problems with `utime' and `stdlib.h'.
705    In our `Makefile', we don't provide any way to install the program.
706 This doesn't matter much for such a simple example, but a real program
707 will need an `install' target.  For that matter, we will also want a
708 `clean' target.
710 \x1f
711 File: configure.info,  Node: Getting Started Example 2,  Next: Getting Started Example 3,  Prev: Getting Started Example 1,  Up: Getting Started Example
713 Second Try
714 ----------
716 Here is our second try at this program.
718    We modify `poke.c' to use preprocessor macros to control what
719 features are available.  (I've cheated a bit by using the same macro
720 names which autoconf will use).
722      #include <stdio.h>
723      
724      #ifdef STDC_HEADERS
725      #include <stdlib.h>
726      #endif
727      
728      #include <sys/types.h>
729      
730      #ifdef HAVE_UTIME_H
731      #include <utime.h>
732      #endif
733      
734      #ifndef HAVE_UTIME_NULL
735      
736      #include <time.h>
737      
738      #ifndef HAVE_STRUCT_UTIMBUF
739      
740      struct utimbuf
741      {
742        long actime;
743        long modtime;
744      };
745      
746      #endif
747      
748      static int
749      utime_now (file)
750           char *file;
751      {
752        struct utimbuf now;
753      
754        now.actime = now.modtime = time (NULL);
755        return utime (file, &now);
756      }
757      
758      #define utime(f, p) utime_now (f)
759      
760      #endif /* HAVE_UTIME_NULL  */
761      
762      int
763      main (argc, argv)
764           int argc;
765           char **argv;
766      {
767        if (argc != 2)
768          {
769            fprintf (stderr, "Usage: poke file\n");
770            exit (1);
771          }
772      
773        if (utime (argv[1], NULL) < 0)
774          {
775            perror ("utime");
776            exit (1);
777          }
778      
779        exit (0);
780      }
782    Here is the associated `Makefile'.  We've added support for the
783 preprocessor flags we use.  We've also added `install' and `clean'
784 targets.
786      # Set this to your installation directory.
787      bindir = /usr/local/bin
788      
789      # Uncomment this if you have the standard ANSI/ISO C header files.
790      # STDC_HDRS = -DSTDC_HEADERS
791      
792      # Uncomment this if you have utime.h.
793      # UTIME_H = -DHAVE_UTIME_H
794      
795      # Uncomment this if utime (FILE, NULL) works on your system.
796      # UTIME_NULL = -DHAVE_UTIME_NULL
797      
798      # Uncomment this if struct utimbuf is defined in utime.h.
799      # UTIMBUF = -DHAVE_STRUCT_UTIMBUF
800      
801      CC = gcc
802      CFLAGS = -g -O2
803      
804      ALL_CFLAGS = $(STDC_HDRS) $(UTIME_H) $(UTIME_NULL) $(UTIMBUF) $(CFLAGS)
805      
806      all: poke
807      
808      poke: poke.o
809         $(CC) -o poke $(ALL_CFLAGS) $(LDFLAGS) poke.o
810      
811      .c.o:
812         $(CC) -c $(ALL_CFLAGS) poke.c
813      
814      install: poke
815         cp poke $(bindir)/poke
816      
817      clean:
818         rm poke poke.o
820    Some problems with this approach should be clear.
822    Users who want to compile poke will have to know how `utime' works
823 on their systems, so that they can uncomment the `Makefile' correctly.
825    The installation is done using `cp', but many systems have an
826 `install' program which may be used, and which supports optional
827 features such as stripping debugging information out of the installed
828 binary.
830    The use of `Makefile' variables like `CC', `CFLAGS' and `LDFLAGS'
831 follows the requirements of the GNU standards.  This is convenient for
832 all packages, since it reduces surprises for users.  However, it is
833 easy to get the details wrong, and wind up with a slightly nonstandard
834 distribution.
836 \x1f
837 File: configure.info,  Node: Getting Started Example 3,  Next: Generate Files in Example,  Prev: Getting Started Example 2,  Up: Getting Started Example
839 Third Try
840 ---------
842 For our third try at this program, we will write a `configure.in'
843 script to discover the configuration features on the host system, rather
844 than requiring the user to edit the `Makefile'.  We will also write a
845 `Makefile.am' rather than a `Makefile'.
847    The only change to `poke.c' is to add a line at the start of the
848 file:
849      #include "config.h"
851    The new `configure.in' file is as follows.
853      AC_INIT(poke.c)
854      AM_INIT_AUTOMAKE(poke, 1.0)
855      AM_CONFIG_HEADER(config.h:config.in)
856      AC_PROG_CC
857      AC_HEADER_STDC
858      AC_CHECK_HEADERS(utime.h)
859      AC_EGREP_HEADER(utimbuf, utime.h, AC_DEFINE(HAVE_STRUCT_UTIMBUF))
860      AC_FUNC_UTIME_NULL
861      AC_OUTPUT(Makefile)
863    The first four macros in this file, and the last one, were described
864 above; see *Note Write configure.in::.  If we omit these macros, then
865 when we run `automake' we will get a reminder that we need them.
867    The other macros are standard autoconf macros.
869 `AC_HEADER_STDC'
870      Check for standard C headers.
872 `AC_CHECK_HEADERS'
873      Check whether a particular header file exists.
875 `AC_EGREP_HEADER'
876      Check for a particular string in a particular header file, in this
877      case checking for `utimbuf' in `utime.h'.
879 `AC_FUNC_UTIME_NULL'
880      Check whether `utime' accepts a NULL second argument to set the
881      file change time to the current time.
883    See the autoconf manual for a more complete description.
885    The new `Makefile.am' file is as follows.  Note how simple this is
886 compared to our earlier `Makefile'.
888      bin_PROGRAMS = poke
889      
890      poke_SOURCES = poke.c
892    This means that we should build a single program name `poke'.  It
893 should be installed in the binary directory, which we called `bindir'
894 earlier.  The program `poke' is built from the source file `poke.c'.
896    We must also write a `acconfig.h' file.  Besides `PACKAGE' and
897 `VERSION', which must be mentioned for all packages which use automake,
898 we must include `HAVE_STRUCT_UTIMBUF', since we mentioned it in an
899 `AC_DEFINE'.
901      /* Name of package.  */
902      #undef PACKAGE
903      
904      /* Version of package.  */
905      #undef VERSION
906      
907      /* Whether utime.h defines struct utimbuf.  */
908      #undef HAVE_STRUCT_UTIMBUF
910 \x1f
911 File: configure.info,  Node: Generate Files in Example,  Prev: Getting Started Example 3,  Up: Getting Started Example
913 Generate Files
914 --------------
916 We must now generate the other files, using the following commands.
918      aclocal
919      autoconf
920      autoheader
921      automake
923    When we run `autoheader', it will remind us of any macros we forgot
924 to add to `acconfig.h'.
926    When we run `automake', it will want to add some files to our
927 distribution.  It will add them automatically if we use the
928 `--add-missing' option.
930    By default, `automake' will run in GNU mode, which means that it
931 will want us to create certain additional files; as of this writing, it
932 will want `NEWS', `README', `AUTHORS', and `ChangeLog', all of which
933 are files which should appear in a standard GNU distribution.  We can
934 either add those files, or run `automake' with the `--foreign' option.
936    Running these tools will generate the following files, all of which
937 are described in the next chapter.
939    * `aclocal.m4'
941    * `configure'
943    * `config.in'
945    * `Makefile.in'
947    * `stamp-h.in'
949 \x1f
950 File: configure.info,  Node: Files,  Next: Configuration Names,  Prev: Getting Started,  Up: Top
952 Files
953 *****
955 As was seen in the previous chapter, the GNU configure and build system
956 uses a number of different files.  The developer must write a few files.
957 The others are generated by various tools.
959    The system is rather flexible, and can be used in many different
960 ways.  In describing the files that it uses, I will describe the common
961 case, and mention some other cases that may arise.
963 * Menu:
965 * Developer Files::             Developer Files.
966 * Build Files::                 Build Files.
967 * Support Files::               Support Files.
969 \x1f
970 File: configure.info,  Node: Developer Files,  Next: Build Files,  Up: Files
972 Developer Files
973 ===============
975 This section describes the files written or generated by the developer
976 of a package.
978 * Menu:
980 * Developer Files Picture::     Developer Files Picture.
981 * Written Developer Files::     Written Developer Files.
982 * Generated Developer Files::   Generated Developer Files.
984 \x1f
985 File: configure.info,  Node: Developer Files Picture,  Next: Written Developer Files,  Up: Developer Files
987 Developer Files Picture
988 -----------------------
990 Here is a picture of the files which are written by the developer, the
991 generated files which would be included with a complete source
992 distribution, and the tools which create those files.  The file names
993 are plain text and the tool names are enclosed by `*' characters (e.g.,
994 `autoheader' is the name of a tool, not the name of a file).
996 \0\b[image text="   acconfig.h       configure.in                 Makefile.am
997        |                |                           |
998        |  --------------+----------------------     |
999        |  |             |                     |     |
1000        v  v             |    acinclude.m4     |     |
1001    *autoheader*         |         |           v     v
1002        |                |         v      --->*automake* 
1003        v                |--->*aclocal*   |       |      
1004    config.in            |         |      |       v      
1005                         |         v      |   Makefile.in
1006                         |    aclocal.m4---
1007                         |     |
1008                         v     v
1009                        *autoconf*
1010                            |
1011                            v
1012                        configure
1013 "\0\b]
1015 \x1f
1016 File: configure.info,  Node: Written Developer Files,  Next: Generated Developer Files,  Prev: Developer Files Picture,  Up: Developer Files
1018 Written Developer Files
1019 -----------------------
1021 The following files would be written by the developer.
1023 `configure.in'
1024      This is the configuration script.  This script contains
1025      invocations of autoconf macros.  It may also contain ordinary
1026      shell script code.  This file will contain feature tests for
1027      portability issues.  The last thing in the file will normally be
1028      an `AC_OUTPUT' macro listing which files to create when the
1029      builder runs the configure script.  This file is always required
1030      when using the GNU configure system.  *Note Write configure.in::.
1032 `Makefile.am'
1033      This is the automake input file.  It describes how the code should
1034      be built.  It consists of definitions of automake variables.  It
1035      may also contain ordinary Makefile targets.  This file is only
1036      needed when using automake (newer tools normally use automake, but
1037      there are still older tools which have not been converted, in
1038      which the developer writes `Makefile.in' directly).  *Note Write
1039      Makefile.am::.
1041 `acconfig.h'
1042      When the configure script creates a portability header file, by
1043      using `AM_CONFIG_HEADER' (or, if not using automake,
1044      `AC_CONFIG_HEADER'), this file is used to describe macros which are
1045      not recognized by the `autoheader' command.  This is normally a
1046      fairly uninteresting file, consisting of a collection of `#undef'
1047      lines with comments.  Normally any call to `AC_DEFINE' in
1048      `configure.in' will require a line in this file. *Note Write
1049      acconfig.h::.
1051 `acinclude.m4'
1052      This file is not always required.  It defines local autoconf
1053      macros.  These macros may then be used in `configure.in'.  If you
1054      don't need any local autoconf macros, then you don't need this
1055      file at all.  In fact, in general, you never need local autoconf
1056      macros, since you can put everything in `configure.in', but
1057      sometimes a local macro is convenient.
1059      Newer tools may omit `acinclude.m4', and instead use a
1060      subdirectory, typically named `m4', and define `ACLOCAL_AMFLAGS =
1061      -I m4' in `Makefile.am' to force `aclocal' to look there for macro
1062      definitions.  The macro definitions are then placed in separate
1063      files in that directory.
1065      The `acinclude.m4' file is only used when using automake; in older
1066      tools, the developer writes `aclocal.m4' directly, if it is needed.
1068 \x1f
1069 File: configure.info,  Node: Generated Developer Files,  Prev: Written Developer Files,  Up: Developer Files
1071 Generated Developer Files
1072 -------------------------
1074 The following files would be generated by the developer.
1076    When using automake, these files are normally not generated manually
1077 after the first time.  Instead, the generated `Makefile' contains rules
1078 to automatically rebuild the files as required.  When
1079 `AM_MAINTAINER_MODE' is used in `configure.in' (the normal case in
1080 Cygnus code), the automatic rebuilding rules will only be defined if
1081 you configure using the `--enable-maintainer-mode' option.
1083    When using automatic rebuilding, it is important to ensure that all
1084 the various tools have been built and installed on your `PATH'.  Using
1085 automatic rebuilding is highly recommended, so much so that I'm not
1086 going to explain what you have to do if you don't use it.
1088 `configure'
1089      This is the configure script which will be run when building the
1090      package.  This is generated by `autoconf' from `configure.in' and
1091      `aclocal.m4'.  This is a shell script.
1093 `Makefile.in'
1094      This is the file which the configure script will turn into the
1095      `Makefile' at build time.  This file is generated by `automake'
1096      from `Makefile.am'.  If you aren't using automake, you must write
1097      this file yourself.  This file is pretty much a normal `Makefile',
1098      with some configure substitutions for certain variables.
1100 `aclocal.m4'
1101      This file is created by the `aclocal' program, based on the
1102      contents of `configure.in' and `acinclude.m4' (or, as noted in the
1103      description of `acinclude.m4' above, on the contents of an `m4'
1104      subdirectory).  This file contains definitions of autoconf macros
1105      which `autoconf' will use when generating the file `configure'.
1106      These autoconf macros may be defined by you in `acinclude.m4' or
1107      they may be defined by other packages such as automake, libtool or
1108      gettext.  If you aren't using automake, you will normally write
1109      this file yourself; in that case, if `configure.in' uses only
1110      standard autoconf macros, this file will not be needed at all.
1112 `config.in'
1113      This file is created by `autoheader' based on `acconfig.h' and
1114      `configure.in'.  At build time, the configure script will define
1115      some of the macros in it to create `config.h', which may then be
1116      included by your program.  This permits your C code to use
1117      preprocessor conditionals to change its behaviour based on the
1118      characteristics of the host system.  This file may also be called
1119      `config.h.in'.
1121 `stamp.h-in'
1122      This rather uninteresting file, which I omitted from the picture,
1123      is generated by `automake'.  It always contains the string
1124      `timestamp'.  It is used as a timestamp file indicating whether
1125      `config.in' is up to date.  Using a timestamp file means that
1126      `config.in' can be marked as up to date without actually changing
1127      its modification time.  This is useful since `config.in' depends
1128      upon `configure.in', but it is easy to change `configure.in' in a
1129      way which does not affect `config.in'.
1131 \x1f
1132 File: configure.info,  Node: Build Files,  Next: Support Files,  Prev: Developer Files,  Up: Files
1134 Build Files
1135 ===========
1137 This section describes the files which are created at configure and
1138 build time.  These are the files which somebody who builds the package
1139 will see.
1141    Of course, the developer will also build the package.  The
1142 distinction between developer files and build files is not that the
1143 developer does not see the build files, but that somebody who only
1144 builds the package does not have to worry about the developer files.
1146 * Menu:
1148 * Build Files Picture::         Build Files Picture.
1149 * Build Files Description::     Build Files Description.
1151 \x1f
1152 File: configure.info,  Node: Build Files Picture,  Next: Build Files Description,  Up: Build Files
1154 Build Files Picture
1155 -------------------
1157 Here is a picture of the files which will be created at build time.
1158 `config.status' is both a created file and a shell script which is run
1159 to create other files, and the picture attempts to show that.
1161 \0\b[image text="   config.in        *configure*      Makefile.in
1162       |                  |               |
1163       |                  v               |
1164       |             config.status        |
1165       |                  |               |
1166    *config.status*<======+==========>*config.status*
1167       |                                  |
1168       v                                  v
1169    config.h                          Makefile
1170 "\0\b]
1172 \x1f
1173 File: configure.info,  Node: Build Files Description,  Prev: Build Files Picture,  Up: Build Files
1175 Build Files Description
1176 -----------------------
1178 This is a description of the files which are created at build time.
1180 `config.status'
1181      The first step in building a package is to run the `configure'
1182      script.  The `configure' script will create the file
1183      `config.status', which is itself a shell script.  When you first
1184      run `configure', it will automatically run `config.status'.  An
1185      `Makefile' derived from an automake generated `Makefile.in' will
1186      contain rules to automatically run `config.status' again when
1187      necessary to recreate certain files if their inputs change.
1189 `Makefile'
1190      This is the file which make will read to build the program.  The
1191      `config.status' script will transform `Makefile.in' into
1192      `Makefile'.
1194 `config.h'
1195      This file defines C preprocessor macros which C code can use to
1196      adjust its behaviour on different systems.  The `config.status'
1197      script will transform `config.in' into `config.h'.
1199 `config.cache'
1200      This file did not fit neatly into the picture, and I omitted it.
1201      It is used by the `configure' script to cache results between
1202      runs.  This can be an important speedup.  If you modify
1203      `configure.in' in such a way that the results of old tests should
1204      change (perhaps you have added a new library to `LDFLAGS'), then
1205      you will have to remove `config.cache' to force the tests to be
1206      rerun.
1208      The autoconf manual explains how to set up a site specific cache
1209      file.  This can speed up running `configure' scripts on your
1210      system.
1212 `stamp.h'
1213      This file, which I omitted from the picture, is similar to
1214      `stamp-h.in'.  It is used as a timestamp file indicating whether
1215      `config.h' is up to date.  This is useful since `config.h' depends
1216      upon `config.status', but it is easy for `config.status' to change
1217      in a way which does not affect `config.h'.
1219 \x1f
1220 File: configure.info,  Node: Support Files,  Prev: Build Files,  Up: Files
1222 Support Files
1223 =============
1225 The GNU configure and build system requires several support files to be
1226 included with your distribution.  You do not normally need to concern
1227 yourself with these.  If you are using the Cygnus tree, most are already
1228 present.  Otherwise, they will be installed with your source by
1229 `automake' (with the `--add-missing' option) and `libtoolize'.
1231    You don't have to put the support files in the top level directory.
1232 You can put them in a subdirectory, and use the `AC_CONFIG_AUX_DIR'
1233 macro in `configure.in' to tell `automake' and the `configure' script
1234 where they are.
1236    In this section, I describe the support files, so that you can know
1237 what they are and why they are there.
1239 `ABOUT-NLS'
1240      Added by automake if you are using gettext.  This is a
1241      documentation file about the gettext project.
1243 `ansi2knr.c'
1244      Used by an automake generated `Makefile' if you put `ansi2knr' in
1245      `AUTOMAKE_OPTIONS' in `Makefile.am'.  This permits compiling ANSI
1246      C code with a K&R C compiler.
1248 `ansi2knr.1'
1249      The man page which goes with `ansi2knr.c'.
1251 `config.guess'
1252      A shell script which determines the configuration name for the
1253      system on which it is run.
1255 `config.sub'
1256      A shell script which canonicalizes a configuration name entered by
1257      a user.
1259 `elisp-comp'
1260      Used to compile Emacs LISP files.
1262 `install-sh'
1263      A shell script which installs a program.  This is used if the
1264      configure script can not find an install binary.
1266 `ltconfig'
1267      Used by libtool.  This is a shell script which configures libtool
1268      for the particular system on which it is used.
1270 `ltmain.sh'
1271      Used by libtool.  This is the actual libtool script which is used,
1272      after it is configured by `ltconfig' to build a library.
1274 `mdate-sh'
1275      A shell script used by an automake generated `Makefile' to pretty
1276      print the modification time of a file.  This is used to maintain
1277      version numbers for texinfo files.
1279 `missing'
1280      A shell script used if some tool is missing entirely.  This is
1281      used by an automake generated `Makefile' to avoid certain sorts of
1282      timestamp problems.
1284 `mkinstalldirs'
1285      A shell script which creates a directory, including all parent
1286      directories.  This is used by an automake generated `Makefile'
1287      during installation.
1289 `texinfo.tex'
1290      Required if you have any texinfo files.  This is used when
1291      converting Texinfo files into DVI using `texi2dvi' and TeX.
1293 `ylwrap'
1294      A shell script used by an automake generated `Makefile' to run
1295      programs like `bison', `yacc', `flex', and `lex'.  These programs
1296      default to producing output files with a fixed name, and the
1297      `ylwrap' script runs them in a subdirectory to avoid file name
1298      conflicts when using a parallel make program.
1300 \x1f
1301 File: configure.info,  Node: Configuration Names,  Next: Cross Compilation Tools,  Prev: Files,  Up: Top
1303 Configuration Names
1304 *******************
1306 The GNU configure system names all systems using a "configuration
1307 name".  All such names used to be triplets (they may now contain four
1308 parts in certain cases), and the term "configuration triplet" is still
1309 seen.
1311 * Menu:
1313 * Configuration Name Definition::       Configuration Name Definition.
1314 * Using Configuration Names::           Using Configuration Names.
1316 \x1f
1317 File: configure.info,  Node: Configuration Name Definition,  Next: Using Configuration Names,  Up: Configuration Names
1319 Configuration Name Definition
1320 =============================
1322 This is a string of the form CPU-MANUFACTURER-OPERATING_SYSTEM.  In
1323 some cases, this is extended to a four part form:
1324 CPU-MANUFACTURER-KERNEL-OPERATING_SYSTEM.
1326    When using a configuration name in a configure option, it is normally
1327 not necessary to specify an entire name.  In particular, the
1328 MANUFACTURER field is often omitted, leading to strings such as
1329 `i386-linux' or `sparc-sunos'.  The shell script `config.sub' will
1330 translate these shortened strings into the canonical form.  autoconf
1331 will arrange for `config.sub' to be run automatically when it is needed.
1333    The fields of a configuration name are as follows:
1336      The type of processor.  This is typically something like `i386' or
1337      `sparc'.  More specific variants are used as well, such as
1338      `mipsel' to indicate a little endian MIPS processor.
1340 MANUFACTURER
1341      A somewhat freeform field which indicates the manufacturer of the
1342      system.  This is often simply `unknown'.  Other common strings are
1343      `pc' for an IBM PC compatible system, or the name of a workstation
1344      vendor, such as `sun'.
1346 OPERATING_SYSTEM
1347      The name of the operating system which is run on the system.  This
1348      will be something like `solaris2.5' or `irix6.3'.  There is no
1349      particular restriction on the version number, and strings like
1350      `aix4.1.4.0' are seen.  For an embedded system, which has no
1351      operating system, this field normally indicates the type of object
1352      file format, such as `elf' or `coff'.
1354 KERNEL
1355      This is used mainly for GNU/Linux.  A typical GNU/Linux
1356      configuration name is `i586-pc-linux-gnulibc1'.  In this case the
1357      kernel, `linux', is separated from the operating system,
1358      `gnulibc1'.
1360    The shell script `config.guess' will normally print the correct
1361 configuration name for the system on which it is run.  It does by
1362 running `uname' and by examining other characteristics of the system.
1364    Because `config.guess' can normally determine the configuration name
1365 for a machine, it is normally only necessary to specify a configuration
1366 name when building a cross-compiler or when building using a
1367 cross-compiler.
1369 \x1f
1370 File: configure.info,  Node: Using Configuration Names,  Prev: Configuration Name Definition,  Up: Configuration Names
1372 Using Configuration Names
1373 =========================
1375 A configure script will sometimes have to make a decision based on a
1376 configuration name.  You will need to do this if you have to compile
1377 code differently based on something which can not be tested using a
1378 standard autoconf feature test.
1380    It is normally better to test for particular features, rather than to
1381 test for a particular system.  This is because as Unix evolves,
1382 different systems copy features from one another.  Even if you need to
1383 determine whether the feature is supported based on a configuration
1384 name, you should define a macro which describes the feature, rather than
1385 defining a macro which describes the particular system you are on.
1387    Testing for a particular system is normally done using a case
1388 statement in `configure.in'.  The case statement might look something
1389 like the following, assuming that `host' is a shell variable holding a
1390 canonical configuration name (which will be the case if `configure.in'
1391 uses the `AC_CANONICAL_HOST' or `AC_CANONICAL_SYSTEM' macro).
1393      case "${host}" in
1394      i[3-7]86-*-linux-gnu*) do something ;;
1395      sparc*-sun-solaris2.[56789]*) do something ;;
1396      sparc*-sun-solaris*) do something ;;
1397      mips*-*-elf*) do something ;;
1398      esac
1400    It is particularly important to use `*' after the operating system
1401 field, in order to match the version number which will be generated by
1402 `config.guess'.
1404    In most cases you must be careful to match a range of processor
1405 types.  For most processor families, a trailing `*' suffices, as in
1406 `mips*' above.  For the i386 family, something along the lines of
1407 `i[3-7]86' suffices at present.  For the m68k family, you will need
1408 something like `m68*'.  Of course, if you do not need to match on the
1409 processor, it is simpler to just replace the entire field by a `*', as
1410 in `*-*-irix*'.
1412 \x1f
1413 File: configure.info,  Node: Cross Compilation Tools,  Next: Canadian Cross,  Prev: Configuration Names,  Up: Top
1415 Cross Compilation Tools
1416 ***********************
1418 The GNU configure and build system can be used to build "cross
1419 compilation" tools.  A cross compilation tool is a tool which runs on
1420 one system and produces code which runs on another system.
1422 * Menu:
1424 * Cross Compilation Concepts::          Cross Compilation Concepts.
1425 * Host and Target::                     Host and Target.
1426 * Using the Host Type::                 Using the Host Type.
1427 * Specifying the Target::               Specifying the Target.
1428 * Using the Target Type::               Using the Target Type.
1429 * Cross Tools in the Cygnus Tree::      Cross Tools in the Cygnus Tree
1431 \x1f
1432 File: configure.info,  Node: Cross Compilation Concepts,  Next: Host and Target,  Up: Cross Compilation Tools
1434 Cross Compilation Concepts
1435 ==========================
1437 A compiler which produces programs which run on a different system is a
1438 cross compilation compiler, or simply a "cross compiler".  Similarly,
1439 we speak of cross assemblers, cross linkers, etc.
1441    In the normal case, a compiler produces code which runs on the same
1442 system as the one on which the compiler runs.  When it is necessary to
1443 distinguish this case from the cross compilation case, such a compiler
1444 is called a "native compiler".  Similarly, we speak of native
1445 assemblers, etc.
1447    Although the debugger is not strictly speaking a compilation tool,
1448 it is nevertheless meaningful to speak of a cross debugger: a debugger
1449 which is used to debug code which runs on another system.  Everything
1450 that is said below about configuring cross compilation tools applies to
1451 the debugger as well.
1453 \x1f
1454 File: configure.info,  Node: Host and Target,  Next: Using the Host Type,  Prev: Cross Compilation Concepts,  Up: Cross Compilation Tools
1456 Host and Target
1457 ===============
1459 When building cross compilation tools, there are two different systems
1460 involved: the system on which the tools will run, and the system for
1461 which the tools generate code.
1463    The system on which the tools will run is called the "host" system.
1465    The system for which the tools generate code is called the "target"
1466 system.
1468    For example, suppose you have a compiler which runs on a GNU/Linux
1469 system and generates ELF programs for a MIPS embedded system.  In this
1470 case the GNU/Linux system is the host, and the MIPS ELF system is the
1471 target.  Such a compiler could be called a GNU/Linux cross MIPS ELF
1472 compiler, or, equivalently, a `i386-linux-gnu' cross `mips-elf'
1473 compiler.
1475    Naturally, most programs are not cross compilation tools.  For those
1476 programs, it does not make sense to speak of a target.  It only makes
1477 sense to speak of a target for tools like `gcc' or the `binutils' which
1478 actually produce running code.  For example, it does not make sense to
1479 speak of the target of a tool like `bison' or `make'.
1481    Most cross compilation tools can also serve as native tools.  For a
1482 native compilation tool, it is still meaningful to speak of a target.
1483 For a native tool, the target is the same as the host.  For example, for
1484 a GNU/Linux native compiler, the host is GNU/Linux, and the target is
1485 also GNU/Linux.
1487 \x1f
1488 File: configure.info,  Node: Using the Host Type,  Next: Specifying the Target,  Prev: Host and Target,  Up: Cross Compilation Tools
1490 Using the Host Type
1491 ===================
1493 In almost all cases the host system is the system on which you run the
1494 `configure' script, and on which you build the tools (for the case when
1495 they differ, *note Canadian Cross::).
1497    If your configure script needs to know the configuration name of the
1498 host system, and the package is not a cross compilation tool and
1499 therefore does not have a target, put `AC_CANONICAL_HOST' in
1500 `configure.in'.  This macro will arrange to define a few shell
1501 variables when the `configure' script is run.
1503 `host'
1504      The canonical configuration name of the host.  This will normally
1505      be determined by running the `config.guess' shell script, although
1506      the user is permitted to override this by using an explicit
1507      `--host' option.
1509 `host_alias'
1510      In the unusual case that the user used an explicit `--host' option,
1511      this will be the argument to `--host'.  In the normal case, this
1512      will be the same as the `host' variable.
1514 `host_cpu'
1515 `host_vendor'
1516 `host_os'
1517      The first three parts of the canonical configuration name.
1519    The shell variables may be used by putting shell code in
1520 `configure.in'.  For an example, see *Note Using Configuration Names::.
1522 \x1f
1523 File: configure.info,  Node: Specifying the Target,  Next: Using the Target Type,  Prev: Using the Host Type,  Up: Cross Compilation Tools
1525 Specifying the Target
1526 =====================
1528 By default, the `configure' script will assume that the target is the
1529 same as the host.  This is the more common case; for example, it leads
1530 to a native compiler rather than a cross compiler.
1532    If you want to build a cross compilation tool, you must specify the
1533 target explicitly by using the `--target' option when you run
1534 `configure'.  The argument to `--target' is the configuration name of
1535 the system for which you wish to generate code.  *Note Configuration
1536 Names::.
1538    For example, to build tools which generate code for a MIPS ELF
1539 embedded system, you would use `--target mips-elf'.
1541 \x1f
1542 File: configure.info,  Node: Using the Target Type,  Next: Cross Tools in the Cygnus Tree,  Prev: Specifying the Target,  Up: Cross Compilation Tools
1544 Using the Target Type
1545 =====================
1547 When writing `configure.in' for a cross compilation tool, you will need
1548 to use information about the target.  To do this, put
1549 `AC_CANONICAL_SYSTEM' in `configure.in'.
1551    `AC_CANONICAL_SYSTEM' will look for a `--target' option and
1552 canonicalize it using the `config.sub' shell script.  It will also run
1553 `AC_CANONICAL_HOST' (*note Using the Host Type::).
1555    The target type will be recorded in the following shell variables.
1556 Note that the host versions of these variables will also be defined by
1557 `AC_CANONICAL_HOST'.
1559 `target'
1560      The canonical configuration name of the target.
1562 `target_alias'
1563      The argument to the `--target' option.  If the user did not specify
1564      a `--target' option, this will be the same as `host_alias'.
1566 `target_cpu'
1567 `target_vendor'
1568 `target_os'
1569      The first three parts of the canonical target configuration name.
1571    Note that if `host' and `target' are the same string, you can assume
1572 a native configuration.  If they are different, you can assume a cross
1573 configuration.
1575    It is arguably possible for `host' and `target' to represent the
1576 same system, but for the strings to not be identical.  For example, if
1577 `config.guess' returns `sparc-sun-sunos4.1.4', and somebody configures
1578 with `--target sparc-sun-sunos4.1', then the slight differences between
1579 the two versions of SunOS may be unimportant for your tool.  However,
1580 in the general case it can be quite difficult to determine whether the
1581 differences between two configuration names are significant or not.
1582 Therefore, by convention, if the user specifies a `--target' option
1583 without specifying a `--host' option, it is assumed that the user wants
1584 to configure a cross compilation tool.
1586    The variables `target' and `target_alias' should be handled
1587 differently.
1589    In general, whenever the user may actually see a string,
1590 `target_alias' should be used.  This includes anything which may appear
1591 in the file system, such as a directory name or part of a tool name.
1592 It also includes any tool output, unless it is clearly labelled as the
1593 canonical target configuration name.  This permits the user to use the
1594 `--target' option to specify how the tool will appear to the outside
1595 world.
1597    On the other hand, when checking for characteristics of the target
1598 system, `target' should be used.  This is because a wide variety of
1599 `--target' options may map into the same canonical configuration name.
1600 You should not attempt to duplicate the canonicalization done by
1601 `config.sub' in your own code.
1603    By convention, cross tools are installed with a prefix of the
1604 argument used with the `--target' option, also known as `target_alias'
1605 (*note Using the Target Type::).  If the user does not use the
1606 `--target' option, and thus is building a native tool, no prefix is
1607 used.
1609    For example, if gcc is configured with `--target mips-elf', then the
1610 installed binary will be named `mips-elf-gcc'.  If gcc is configured
1611 without a `--target' option, then the installed binary will be named
1612 `gcc'.
1614    The autoconf macro `AC_ARG_PROGRAM' will handle this for you.  If
1615 you are using automake, no more need be done; the programs will
1616 automatically be installed with the correct prefixes.  Otherwise, see
1617 the autoconf documentation for `AC_ARG_PROGRAM'.
1619 \x1f
1620 File: configure.info,  Node: Cross Tools in the Cygnus Tree,  Prev: Using the Target Type,  Up: Cross Compilation Tools
1622 Cross Tools in the Cygnus Tree
1623 ==============================
1625 The Cygnus tree is used for various packages including gdb, the GNU
1626 binutils, and egcs.  It is also, of course, used for Cygnus releases.
1628    In the Cygnus tree, the top level `configure' script uses the old
1629 Cygnus configure system, not autoconf.  The top level `Makefile.in' is
1630 written to build packages based on what is in the source tree, and
1631 supports building a large number of tools in a single
1632 `configure'/`make' step.
1634    The Cygnus tree may be configured with a `--target' option.  The
1635 `--target' option applies recursively to every subdirectory, and
1636 permits building an entire set of cross tools at once.
1638 * Menu:
1640 * Host and Target Libraries::           Host and Target Libraries.
1641 * Target Library Configure Scripts::    Target Library Configure Scripts.
1642 * Make Targets in Cygnus Tree::         Make Targets in Cygnus Tree.
1643 * Target libiberty::                    Target libiberty
1645 \x1f
1646 File: configure.info,  Node: Host and Target Libraries,  Next: Target Library Configure Scripts,  Up: Cross Tools in the Cygnus Tree
1648 Host and Target Libraries
1649 -------------------------
1651 The Cygnus tree distinguishes host libraries from target libraries.
1653    Host libraries are built with the compiler used to build the programs
1654 which run on the host, which is called the host compiler.  This includes
1655 libraries such as `bfd' and `tcl'.  These libraries are built with the
1656 host compiler, and are linked into programs like the binutils or gcc
1657 which run on the host.
1659    Target libraries are built with the target compiler.  If gcc is
1660 present in the source tree, then the target compiler is the gcc that is
1661 built using the host compiler.  Target libraries are libraries such as
1662 `newlib' and `libstdc++'.  These libraries are not linked into the host
1663 programs, but are instead made available for use with programs built
1664 with the target compiler.
1666    For the rest of this section, assume that gcc is present in the
1667 source tree, so that it will be used to build the target libraries.
1669    There is a complication here.  The configure process needs to know
1670 which compiler you are going to use to build a tool; otherwise, the
1671 feature tests will not work correctly.  The Cygnus tree handles this by
1672 not configuring the target libraries until the target compiler is
1673 built.  In order to permit everything to build using a single
1674 `configure'/`make', the configuration of the target libraries is
1675 actually triggered during the make step.
1677    When the target libraries are configured, the `--target' option is
1678 not used.  Instead, the `--host' option is used with the argument of
1679 the `--target' option for the overall configuration.  If no `--target'
1680 option was used for the overall configuration, the `--host' option will
1681 be passed with the output of the `config.guess' shell script.  Any
1682 `--build' option is passed down unchanged.
1684    This translation of configuration options is done because since the
1685 target libraries are compiled with the target compiler, they are being
1686 built in order to run on the target of the overall configuration.  By
1687 the definition of host, this means that their host system is the same as
1688 the target system of the overall configuration.
1690    The same process is used for both a native configuration and a cross
1691 configuration.  Even when using a native configuration, the target
1692 libraries will be configured and built using the newly built compiler.
1693 This is particularly important for the C++ libraries, since there is no
1694 reason to assume that the C++ compiler used to build the host tools (if
1695 there even is one) uses the same ABI as the g++ compiler which will be
1696 used to build the target libraries.
1698    There is one difference between a native configuration and a cross
1699 configuration.  In a native configuration, the target libraries are
1700 normally configured and built as siblings of the host tools.  In a cross
1701 configuration, the target libraries are normally built in a subdirectory
1702 whose name is the argument to `--target'.  This is mainly for
1703 historical reasons.
1705    To summarize, running `configure' in the Cygnus tree configures all
1706 the host libraries and tools, but does not configure any of the target
1707 libraries.  Running `make' then does the following steps:
1709    * Build the host libraries.
1711    * Build the host programs, including gcc.  Note that we call gcc
1712      both a host program (since it runs on the host) and a target
1713      compiler (since it generates code for the target).
1715    * Using the newly built target compiler, configure the target
1716      libraries.
1718    * Build the target libraries.
1720    The steps need not be done in precisely this order, since they are
1721 actually controlled by `Makefile' targets.
1723 \x1f
1724 File: configure.info,  Node: Target Library Configure Scripts,  Next: Make Targets in Cygnus Tree,  Prev: Host and Target Libraries,  Up: Cross Tools in the Cygnus Tree
1726 Target Library Configure Scripts
1727 --------------------------------
1729 There are a few things you must know in order to write a configure
1730 script for a target library.  This is just a quick sketch, and beginners
1731 shouldn't worry if they don't follow everything here.
1733    The target libraries are configured and built using a newly built
1734 target compiler.  There may not be any startup files or libraries for
1735 this target compiler.  In fact, those files will probably be built as
1736 part of some target library, which naturally means that they will not
1737 exist when your target library is configured.
1739    This means that the configure script for a target library may not use
1740 any test which requires doing a link.  This unfortunately includes many
1741 useful autoconf macros, such as `AC_CHECK_FUNCS'.  autoconf macros
1742 which do a compile but not a link, such as `AC_CHECK_HEADERS', may be
1743 used.
1745    This is a severe restriction, but normally not a fatal one, as target
1746 libraries can often assume the presence of other target libraries, and
1747 thus know which functions will be available.
1749    As of this writing, the autoconf macro `AC_PROG_CC' does a link to
1750 make sure that the compiler works.  This may fail in a target library,
1751 so target libraries must use a different set of macros to locate the
1752 compiler.  See the `configure.in' file in a directory like `libiberty'
1753 or `libgloss' for an example.
1755    As noted in the previous section, target libraries are sometimes
1756 built in directories which are siblings to the host tools, and are
1757 sometimes built in a subdirectory.  The `--with-target-subdir' configure
1758 option will be passed when the library is configured.  Its value will be
1759 an empty string if the target library is a sibling.  Its value will be
1760 the name of the subdirectory if the target library is in a subdirectory.
1762    If the overall build is not a native build (i.e., the overall
1763 configure used the `--target' option), then the library will be
1764 configured with the `--with-cross-host' option.  The value of this
1765 option will be the host system of the overall build.  Recall that the
1766 host system of the library will be the target of the overall build.  If
1767 the overall build is a native build, the `--with-cross-host' option
1768 will not be used.
1770    A library which can be built both standalone and as a target library
1771 may want to install itself into different directories depending upon the
1772 case.  When built standalone, or when built native, the library should
1773 be installed in `$(libdir)'.  When built as a target library which is
1774 not native, the library should be installed in `$(tooldir)/lib'.  The
1775 `--with-cross-host' option may be used to distinguish these cases.
1777    This same test of `--with-cross-host' may be used to see whether it
1778 is OK to use link tests in the configure script.  If the
1779 `--with-cross-host' option is not used, then the library is being built
1780 either standalone or native, and a link should work.
1782 \x1f
1783 File: configure.info,  Node: Make Targets in Cygnus Tree,  Next: Target libiberty,  Prev: Target Library Configure Scripts,  Up: Cross Tools in the Cygnus Tree
1785 Make Targets in Cygnus Tree
1786 ---------------------------
1788 The top level `Makefile' in the Cygnus tree defines targets for every
1789 known subdirectory.
1791    For every subdirectory DIR which holds a host library or program,
1792 the `Makefile' target `all-DIR' will build that library or program.
1794    There are dependencies among host tools.  For example, building gcc
1795 requires first building gas, because the gcc build process invokes the
1796 target assembler.  These dependencies are reflected in the top level
1797 `Makefile'.
1799    For every subdirectory DIR which holds a target library, the
1800 `Makefile' target `configure-target-DIR' will configure that library.
1801 The `Makefile' target `all-target-DIR' will build that library.
1803    Every `configure-target-DIR' target depends upon `all-gcc', since
1804 gcc, the target compiler, is required to configure the tool.  Every
1805 `all-target-DIR' target depends upon the corresponding
1806 `configure-target-DIR' target.
1808    There are several other targets which may be of interest for each
1809 directory: `install-DIR', `clean-DIR', and `check-DIR'.  There are also
1810 corresponding `target' versions of these for the target libraries ,
1811 such as `install-target-DIR'.
1813 \x1f
1814 File: configure.info,  Node: Target libiberty,  Prev: Make Targets in Cygnus Tree,  Up: Cross Tools in the Cygnus Tree
1816 Target libiberty
1817 ----------------
1819 The `libiberty' subdirectory is currently a special case, in that it is
1820 the only directory which is built both using the host compiler and
1821 using the target compiler.
1823    This is because the files in `libiberty' are used when building the
1824 host tools, and they are also incorporated into the `libstdc++' target
1825 library as support code.
1827    This duality does not pose any particular difficulties.  It means
1828 that there are targets for both `all-libiberty' and
1829 `all-target-libiberty'.
1831    In a native configuration, when target libraries are not built in a
1832 subdirectory, the same objects are normally used as both the host build
1833 and the target build.  This is normally OK, since libiberty contains
1834 only C code, and in a native configuration the results of the host
1835 compiler and the target compiler are normally interoperable.
1837    Irix 6 is again an exception here, since the SGI native compiler
1838 defaults to using the `O32' ABI, and gcc defaults to using the `N32'
1839 ABI.  On Irix 6, the target libraries are built in a subdirectory even
1840 for a native configuration, avoiding this problem.
1842    There are currently no other libraries built for both the host and
1843 the target, but there is no conceptual problem with adding more.
1845 \x1f
1846 File: configure.info,  Node: Canadian Cross,  Next: Cygnus Configure,  Prev: Cross Compilation Tools,  Up: Top
1848 Canadian Cross
1849 **************
1851 It is possible to use the GNU configure and build system to build a
1852 program which will run on a system which is different from the system on
1853 which the tools are built.  In other words, it is possible to build
1854 programs using a cross compiler.
1856    This is referred to as a "Canadian Cross".
1858 * Menu:
1860 * Canadian Cross Example::              Canadian Cross Example.
1861 * Canadian Cross Concepts::             Canadian Cross Concepts.
1862 * Build Cross Host Tools::              Build Cross Host Tools.
1863 * Build and Host Options::              Build and Host Options.
1864 * CCross not in Cygnus Tree::           Canadian Cross not in Cygnus Tree.
1865 * CCross in Cygnus Tree::               Canadian Cross in Cygnus Tree.
1866 * Supporting Canadian Cross::           Supporting Canadian Cross.
1868 \x1f
1869 File: configure.info,  Node: Canadian Cross Example,  Next: Canadian Cross Concepts,  Up: Canadian Cross
1871 Canadian Cross Example
1872 ======================
1874 Here is an example of a Canadian Cross.
1876    While running on a GNU/Linux, you can build a program which will run
1877 on a Solaris system.  You would use a GNU/Linux cross Solaris compiler
1878 to build the program.
1880    Of course, you could not run the resulting program on your GNU/Linux
1881 system.  You would have to copy it over to a Solaris system before you
1882 would run it.
1884    Of course, you could also simply build the programs on the Solaris
1885 system in the first place.  However, perhaps the Solaris system is not
1886 available for some reason; perhaps you actually don't have one, but you
1887 want to build the tools for somebody else to use.  Or perhaps your
1888 GNU/Linux system is much faster than your Solaris system.
1890    A Canadian Cross build is most frequently used when building
1891 programs to run on a non-Unix system, such as DOS or Windows.  It may
1892 be simpler to configure and build on a Unix system than to support the
1893 configuration machinery on a non-Unix system.
1895 \x1f
1896 File: configure.info,  Node: Canadian Cross Concepts,  Next: Build Cross Host Tools,  Prev: Canadian Cross Example,  Up: Canadian Cross
1898 Canadian Cross Concepts
1899 =======================
1901 When building a Canadian Cross, there are at least two different systems
1902 involved: the system on which the tools are being built, and the system
1903 on which the tools will run.
1905    The system on which the tools are being built is called the "build"
1906 system.
1908    The system on which the tools will run is called the host system.
1910    For example, if you are building a Solaris program on a GNU/Linux
1911 system, as in the previous section, the build system would be GNU/Linux,
1912 and the host system would be Solaris.
1914    It is, of course, possible to build a cross compiler using a Canadian
1915 Cross (i.e., build a cross compiler using a cross compiler).  In this
1916 case, the system for which the resulting cross compiler generates code
1917 is called the target system.  (For a more complete discussion of host
1918 and target systems, *note Host and Target::).
1920    An example of building a cross compiler using a Canadian Cross would
1921 be building a Windows cross MIPS ELF compiler on a GNU/Linux system.  In
1922 this case the build system would be GNU/Linux, the host system would be
1923 Windows, and the target system would be MIPS ELF.
1925    The name Canadian Cross comes from the case when the build, host, and
1926 target systems are all different.  At the time that these issues were
1927 all being hashed out, Canada had three national political parties.
1929 \x1f
1930 File: configure.info,  Node: Build Cross Host Tools,  Next: Build and Host Options,  Prev: Canadian Cross Concepts,  Up: Canadian Cross
1932 Build Cross Host Tools
1933 ======================
1935 In order to configure a program for a Canadian Cross build, you must
1936 first build and install the set of cross tools you will use to build the
1937 program.
1939    These tools will be build cross host tools.  That is, they will run
1940 on the build system, and will produce code that runs on the host system.
1942    It is easy to confuse the meaning of build and host here.  Always
1943 remember that the build system is where you are doing the build, and the
1944 host system is where the resulting program will run.  Therefore, you
1945 need a build cross host compiler.
1947    In general, you must have a complete cross environment in order to do
1948 the build.  This normally means a cross compiler, cross assembler, and
1949 so forth, as well as libraries and include files for the host system.
1951 \x1f
1952 File: configure.info,  Node: Build and Host Options,  Next: CCross not in Cygnus Tree,  Prev: Build Cross Host Tools,  Up: Canadian Cross
1954 Build and Host Options
1955 ======================
1957 When you run `configure', you must use both the `--build' and `--host'
1958 options.
1960    The `--build' option is used to specify the configuration name of
1961 the build system.  This can normally be the result of running the
1962 `config.guess' shell script, and it is reasonable to use
1963 `--build=`config.guess`'.
1965    The `--host' option is used to specify the configuration name of the
1966 host system.
1968    As we explained earlier, `config.guess' is used to set the default
1969 value for the `--host' option (*note Using the Host Type::).  We can
1970 now see that since `config.guess' returns the type of system on which
1971 it is run, it really identifies the build system.  Since the host
1972 system is normally the same as the build system (i.e., people do not
1973 normally build using a cross compiler), it is reasonable to use the
1974 result of `config.guess' as the default for the host system when the
1975 `--host' option is not used.
1977    It might seem that if the `--host' option were used without the
1978 `--build' option that the configure script could run `config.guess' to
1979 determine the build system, and presume a Canadian Cross if the result
1980 of `config.guess' differed from the `--host' option.  However, for
1981 historical reasons, some configure scripts are routinely run using an
1982 explicit `--host' option, rather than using the default from
1983 `config.guess'.  As noted earlier, it is difficult or impossible to
1984 reliably compare configuration names (*note Using the Target Type::).
1985 Therefore, by convention, if the `--host' option is used, but the
1986 `--build' option is not used, then the build system defaults to the
1987 host system.
1989 \x1f
1990 File: configure.info,  Node: CCross not in Cygnus Tree,  Next: CCross in Cygnus Tree,  Prev: Build and Host Options,  Up: Canadian Cross
1992 Canadian Cross not in Cygnus Tree.
1993 ==================================
1995 If you are not using the Cygnus tree, you must explicitly specify the
1996 cross tools which you want to use to build the program.  This is done by
1997 setting environment variables before running the `configure' script.
1999    You must normally set at least the environment variables `CC', `AR',
2000 and `RANLIB' to the cross tools which you want to use to build.
2002    For some programs, you must set additional cross tools as well, such
2003 as `AS', `LD', or `NM'.
2005    You would set these environment variables to the build cross tools
2006 which you are going to use.
2008    For example, if you are building a Solaris program on a GNU/Linux
2009 system, and your GNU/Linux cross Solaris compiler were named
2010 `solaris-gcc', then you would set the environment variable `CC' to
2011 `solaris-gcc'.
2013 \x1f
2014 File: configure.info,  Node: CCross in Cygnus Tree,  Next: Supporting Canadian Cross,  Prev: CCross not in Cygnus Tree,  Up: Canadian Cross
2016 Canadian Cross in Cygnus Tree
2017 =============================
2019 This section describes configuring and building a Canadian Cross when
2020 using the Cygnus tree.
2022 * Menu:
2024 * Standard Cygnus CCross::      Building a Normal Program.
2025 * Cross Cygnus CCross::         Building a Cross Program.
2027 \x1f
2028 File: configure.info,  Node: Standard Cygnus CCross,  Next: Cross Cygnus CCross,  Up: CCross in Cygnus Tree
2030 Building a Normal Program
2031 -------------------------
2033 When configuring a Canadian Cross in the Cygnus tree, all the
2034 appropriate environment variables are automatically set to `HOST-TOOL',
2035 where HOST is the value used for the `--host' option, and TOOL is the
2036 name of the tool (e.g., `gcc', `as', etc.).  These tools must be on
2037 your `PATH'.
2039    Adding a prefix of HOST will give the usual name for the build cross
2040 host tools.  To see this, consider that when these cross tools were
2041 built, they were configured to run on the build system and to produce
2042 code for the host system.  That is, they were configured with a
2043 `--target' option that is the same as the system which we are now
2044 calling the host.  Recall that the default name for installed cross
2045 tools uses the target system as a prefix (*note Using the Target
2046 Type::).  Since that is the system which we are now calling the host,
2047 HOST is the right prefix to use.
2049    For example, if you configure with `--build=i386-linux-gnu' and
2050 `--host=solaris', then the Cygnus tree will automatically default to
2051 using the compiler `solaris-gcc'.  You must have previously built and
2052 installed this compiler, probably by doing a build with no `--host'
2053 option and with a `--target' option of `solaris'.
2055 \x1f
2056 File: configure.info,  Node: Cross Cygnus CCross,  Prev: Standard Cygnus CCross,  Up: CCross in Cygnus Tree
2058 Building a Cross Program
2059 ------------------------
2061 There are additional considerations if you want to build a cross
2062 compiler, rather than a native compiler, in the Cygnus tree using a
2063 Canadian Cross.
2065    When you build a cross compiler using the Cygnus tree, then the
2066 target libraries will normally be built with the newly built target
2067 compiler (*note Host and Target Libraries::).  However, this will not
2068 work when building with a Canadian Cross.  This is because the newly
2069 built target compiler will be a program which runs on the host system,
2070 and therefore will not be able to run on the build system.
2072    Therefore, when building a cross compiler with the Cygnus tree, you
2073 must first install a set of build cross target tools.  These tools will
2074 be used when building the target libraries.
2076    Note that this is not a requirement of a Canadian Cross in general.
2077 For example, it would be possible to build just the host cross target
2078 tools on the build system, to copy the tools to the host system, and to
2079 build the target libraries on the host system.  The requirement for
2080 build cross target tools is imposed by the Cygnus tree, which expects
2081 to be able to build both host programs and target libraries in a single
2082 `configure'/`make' step.  Because it builds these in a single step, it
2083 expects to be able to build the target libraries on the build system,
2084 which means that it must use a build cross target toolchain.
2086    For example, suppose you want to build a Windows cross MIPS ELF
2087 compiler on a GNU/Linux system.  You must have previously installed
2088 both a GNU/Linux cross Windows compiler and a GNU/Linux cross MIPS ELF
2089 compiler.
2091    In order to build the Windows (configuration name `i386-cygwin32')
2092 cross MIPS ELF (configure name `mips-elf') compiler, you might execute
2093 the following commands (long command lines are broken across lines with
2094 a trailing backslash as a continuation character).
2096      mkdir linux-x-cygwin32
2097      cd linux-x-cygwin32
2098      SRCDIR/configure --target i386-cygwin32 --prefix=INSTALLDIR \
2099        --exec-prefix=INSTALLDIR/H-i386-linux
2100      make
2101      make install
2102      cd ..
2103      mkdir linux-x-mips-elf
2104      cd linux-x-mips-elf
2105      SRCDIR/configure --target mips-elf --prefix=INSTALLDIR \
2106        --exec-prefix=INSTALLDIR/H-i386-linux
2107      make
2108      make install
2109      cd ..
2110      mkdir cygwin32-x-mips-elf
2111      cd cygwin32-x-mips-elf
2112      SRCDIR/configure --build=i386-linux-gnu --host=i386-cygwin32 \
2113        --target=mips-elf --prefix=WININSTALLDIR \
2114        --exec-prefix=WININSTALLDIR/H-i386-cygwin32
2115      make
2116      make install
2118    You would then copy the contents of WININSTALLDIR over to the
2119 Windows machine, and run the resulting programs.
2121 \x1f
2122 File: configure.info,  Node: Supporting Canadian Cross,  Prev: CCross in Cygnus Tree,  Up: Canadian Cross
2124 Supporting Canadian Cross
2125 =========================
2127 If you want to make it possible to build a program you are developing
2128 using a Canadian Cross, you must take some care when writing your
2129 configure and make rules.  Simple cases will normally work correctly.
2130 However, it is not hard to write configure and make tests which will
2131 fail in a Canadian Cross.
2133 * Menu:
2135 * CCross in Configure::         Supporting Canadian Cross in Configure Scripts.
2136 * CCross in Make::              Supporting Canadian Cross in Makefiles.
2138 \x1f
2139 File: configure.info,  Node: CCross in Configure,  Next: CCross in Make,  Up: Supporting Canadian Cross
2141 Supporting Canadian Cross in Configure Scripts
2142 ----------------------------------------------
2144 In a `configure.in' file, after calling `AC_PROG_CC', you can find out
2145 whether this is a Canadian Cross configure by examining the shell
2146 variable `cross_compiling'.  In a Canadian Cross, which means that the
2147 compiler is a cross compiler, `cross_compiling' will be `yes'.  In a
2148 normal configuration, `cross_compiling' will be `no'.
2150    You ordinarily do not need to know the type of the build system in a
2151 configure script.  However, if you do need that information, you can get
2152 it by using the macro `AC_CANONICAL_SYSTEM', the same macro that is
2153 used to determine the target system.  This macro will set the variables
2154 `build', `build_alias', `build_cpu', `build_vendor', and `build_os',
2155 which correspond to the similar `target' and `host' variables, except
2156 that they describe the build system.
2158    When writing tests in `configure.in', you must remember that you
2159 want to test the host environment, not the build environment.
2161    Macros like `AC_CHECK_FUNCS' which use the compiler will test the
2162 host environment.  That is because the tests will be done by running the
2163 compiler, which is actually a build cross host compiler.  If the
2164 compiler can find the function, that means that the function is present
2165 in the host environment.
2167    Tests like `test -f /dev/ptyp0', on the other hand, will test the
2168 build environment.  Remember that the configure script is running on the
2169 build system, not the host system.  If your configure scripts examines
2170 files, those files will be on the build system.  Whatever you determine
2171 based on those files may or may not be the case on the host system.
2173    Most autoconf macros will work correctly for a Canadian Cross.  The
2174 main exception is `AC_TRY_RUN'.  This macro tries to compile and run a
2175 test program.  This will fail in a Canadian Cross, because the program
2176 will be compiled for the host system, which means that it will not run
2177 on the build system.
2179    The `AC_TRY_RUN' macro provides an optional argument to tell the
2180 configure script what to do in a Canadian Cross.  If that argument is
2181 not present, you will get a warning when you run `autoconf':
2182      warning: AC_TRY_RUN called without default to allow cross compiling
2184 This tells you that the resulting `configure' script will not work with
2185 a Canadian Cross.
2187    In some cases while it may better to perform a test at configure
2188 time, it is also possible to perform the test at run time.  In such a
2189 case you can use the cross compiling argument to `AC_TRY_RUN' to tell
2190 your program that the test could not be performed at configure time.
2192    There are a few other autoconf macros which will not work correctly
2193 with a Canadian Cross: a partial list is `AC_FUNC_GETPGRP',
2194 `AC_FUNC_SETPGRP', `AC_FUNC_SETVBUF_REVERSED', and
2195 `AC_SYS_RESTARTABLE_SYSCALLS'.  The `AC_CHECK_SIZEOF' macro is
2196 generally not very useful with a Canadian Cross; it permits an optional
2197 argument indicating the default size, but there is no way to know what
2198 the correct default should be.
2200 \x1f
2201 File: configure.info,  Node: CCross in Make,  Prev: CCross in Configure,  Up: Supporting Canadian Cross
2203 Supporting Canadian Cross in Makefiles.
2204 ---------------------------------------
2206 The main Canadian Cross issue in a `Makefile' arises when you want to
2207 use a subsidiary program to generate code or data which you will then
2208 include in your real program.
2210    If you compile this subsidiary program using `$(CC)' in the usual
2211 way, you will not be able to run it.  This is because `$(CC)' will
2212 build a program for the host system, but the program is being built on
2213 the build system.
2215    You must instead use a compiler for the build system, rather than the
2216 host system.  In the Cygnus tree, this make variable `$(CC_FOR_BUILD)'
2217 will hold a compiler for the build system.
2219    Note that you should not include `config.h' in a file you are
2220 compiling with `$(CC_FOR_BUILD)'.  The `configure' script will build
2221 `config.h' with information for the host system.  However, you are
2222 compiling the file using a compiler for the build system (a native
2223 compiler).  Subsidiary programs are normally simple filters which do no
2224 user interaction, and it is normally possible to write them in a highly
2225 portable fashion so that the absence of `config.h' is not crucial.
2227    The gcc `Makefile.in' shows a complex situation in which certain
2228 files, such as `rtl.c', must be compiled into both subsidiary programs
2229 run on the build system and into the final program.  This approach may
2230 be of interest for advanced build system hackers.  Note that the build
2231 system compiler is rather confusingly called `HOST_CC'.
2233 \x1f
2234 File: configure.info,  Node: Cygnus Configure,  Next: Multilibs,  Prev: Canadian Cross,  Up: Top
2236 Cygnus Configure
2237 ****************
2239 The Cygnus configure script predates autoconf.  All of its interesting
2240 features have been incorporated into autoconf.  No new programs should
2241 be written to use the Cygnus configure script.
2243    However, the Cygnus configure script is still used in a few places:
2244 at the top of the Cygnus tree and in a few target libraries in the
2245 Cygnus tree.  Until those uses have been replaced with autoconf, some
2246 brief notes are appropriate here.  This is not complete documentation,
2247 but it should be possible to use this as a guide while examining the
2248 scripts themselves.
2250 * Menu:
2252 * Cygnus Configure Basics::             Cygnus Configure Basics.
2253 * Cygnus Configure in C++ Libraries::   Cygnus Configure in C++ Libraries.
2255 \x1f
2256 File: configure.info,  Node: Cygnus Configure Basics,  Next: Cygnus Configure in C++ Libraries,  Up: Cygnus Configure
2258 Cygnus Configure Basics
2259 =======================
2261 Cygnus configure does not use any generated files; there is no program
2262 corresponding to `autoconf'.  Instead, there is a single shell script
2263 named `configure' which may be found at the top of the Cygnus tree.
2264 This shell script was written by hand; it was not generated by
2265 autoconf, and it is incorrect, and indeed harmful, to run `autoconf' in
2266 the top level of a Cygnus tree.
2268    Cygnus configure works in a particular directory by examining the
2269 file `configure.in' in that directory.  That file is broken into four
2270 separate shell scripts.
2272    The first is the contents of `configure.in' up to a line that starts
2273 with `# per-host:'.  This is the common part.
2275    The second is the rest of `configure.in' up to a line that starts
2276 with `# per-target:'.  This is the per host part.
2278    The third is the rest of `configure.in' up to a line that starts
2279 with `# post-target:'.  This is the per target part.
2281    The fourth is the remainder of `configure.in'.  This is the post
2282 target part.
2284    If any of these comment lines are missing, the corresponding shell
2285 script is empty.
2287    Cygnus configure will first execute the common part.  This must set
2288 the shell variable `srctrigger' to the name of a source file, to
2289 confirm that Cygnus configure is looking at the right directory.  This
2290 may set the shell variables `package_makefile_frag' and
2291 `package_makefile_rules_frag'.
2293    Cygnus configure will next set the `build' and `host' shell
2294 variables, and execute the per host part.  This may set the shell
2295 variable `host_makefile_frag'.
2297    Cygnus configure will next set the `target' variable, and execute
2298 the per target part.  This may set the shell variable
2299 `target_makefile_frag'.
2301    Any of these scripts may set the `subdirs' shell variable.  This
2302 variable is a list of subdirectories where a `Makefile.in' file may be
2303 found.  Cygnus configure will automatically look for a `Makefile.in'
2304 file in the current directory.  The `subdirs' shell variable is not
2305 normally used, and I believe that the only directory which uses it at
2306 present is `newlib'.
2308    For each `Makefile.in', Cygnus configure will automatically create a
2309 `Makefile' by adding definitions for `make' variables such as `host'
2310 and `target', and automatically editing the values of `make' variables
2311 such as `prefix' if they are present.
2313    Also, if any of the `makefile_frag' shell variables are set, Cygnus
2314 configure will interpret them as file names relative to either the
2315 working directory or the source directory, and will read the contents of
2316 the file into the generated `Makefile'.  The file contents will be read
2317 in after the first line in `Makefile.in' which starts with `####'.
2319    These `Makefile' fragments are used to customize behaviour for a
2320 particular host or target.  They serve to select particular files to
2321 compile, and to define particular preprocessor macros by providing
2322 values for `make' variables which are then used during compilation.
2323 Cygnus configure, unlike autoconf, normally does not do feature tests,
2324 and normally requires support to be added manually for each new host.
2326    The `Makefile' fragment support is similar to the autoconf
2327 `AC_SUBST_FILE' macro.
2329    After creating each `Makefile', the post target script will be run
2330 (i.e., it may be run several times).  This script may further customize
2331 the `Makefile'.  When it is run, the shell variable `Makefile' will
2332 hold the name of the `Makefile', including the appropriate directory
2333 component.
2335    Like an autoconf generated `configure' script, Cygnus configure will
2336 create a file named `config.status' which, when run, will automatically
2337 recreate the configuration.  The `config.status' file will simply
2338 execute the Cygnus configure script again with the appropriate
2339 arguments.
2341    Any of the parts of `configure.in' may set the shell variables
2342 `files' and `links'.  Cygnus configure will set up symlinks from the
2343 names in `links' to the files named in `files'.  This is similar to the
2344 autoconf `AC_LINK_FILES' macro.
2346    Finally, any of the parts of `configure.in' may set the shell
2347 variable `configdirs' to a set of subdirectories.  If it is set, Cygnus
2348 configure will recursively run the configure process in each
2349 subdirectory.  If the subdirectory uses Cygnus configure, it will
2350 contain a `configure.in' file but no `configure' file, in which case
2351 Cygnus configure will invoke itself recursively.  If the subdirectory
2352 has a `configure' file, Cygnus configure assumes that it is an autoconf
2353 generated `configure' script, and simply invokes it directly.
2355 \x1f
2356 File: configure.info,  Node: Cygnus Configure in C++ Libraries,  Prev: Cygnus Configure Basics,  Up: Cygnus Configure
2358 Cygnus Configure in C++ Libraries
2359 =================================
2361 The C++ library configure system, written by Per Bothner, deserves
2362 special mention.  It uses Cygnus configure, but it does feature testing
2363 like that done by autoconf generated `configure' scripts.  This
2364 approach is used in the libraries `libio', `libstdc++', and `libg++'.
2366    Most of the `Makefile' information is written out by the shell
2367 script `libio/config.shared'.  Each `configure.in' file sets certain
2368 shell variables, and then invokes `config.shared' to create two package
2369 `Makefile' fragments.  These fragments are then incorporated into the
2370 resulting `Makefile' by the Cygnus configure script.
2372    The file `_G_config.h' is created in the `libio' object directory by
2373 running the shell script `libio/gen-params'.  This shell script uses
2374 feature tests to define macros and typedefs in `_G_config.h'.
2376 \x1f
2377 File: configure.info,  Node: Multilibs,  Next: FAQ,  Prev: Cygnus Configure,  Up: Top
2379 Multilibs
2380 *********
2382 For some targets gcc may have different processor requirements depending
2383 upon command line options.  An obvious example is the `-msoft-float'
2384 option supported on several processors.  This option means that the
2385 floating point registers are not available, which means that floating
2386 point operations must be done by calling an emulation subroutine rather
2387 than by using machine instructions.
2389    For such options, gcc is often configured to compile target libraries
2390 twice: once with `-msoft-float' and once without.  When gcc compiles
2391 target libraries more than once, the resulting libraries are called
2392 "multilibs".
2394    Multilibs are not really part of the GNU configure and build system,
2395 but we discuss them here since they require support in the `configure'
2396 scripts and `Makefile's used for target libraries.
2398 * Menu:
2400 * Multilibs in gcc::                    Multilibs in gcc.
2401 * Multilibs in Target Libraries::       Multilibs in Target Libraries.
2403 \x1f
2404 File: configure.info,  Node: Multilibs in gcc,  Next: Multilibs in Target Libraries,  Up: Multilibs
2406 Multilibs in gcc
2407 ================
2409 In gcc, multilibs are defined by setting the variable
2410 `MULTILIB_OPTIONS' in the target `Makefile' fragment.  Several other
2411 `MULTILIB' variables may also be defined there.  *Note The Target
2412 Makefile Fragment: (gcc)Target Fragment.
2414    If you have built gcc, you can see what multilibs it uses by running
2415 it with the `-print-multi-lib' option.  The output `.;' means that no
2416 multilibs are used.  In general, the output is a sequence of lines, one
2417 per multilib.  The first part of each line, up to the `;', is the name
2418 of the multilib directory.  The second part is a list of compiler
2419 options separated by `@' characters.
2421    Multilibs are built in a tree of directories.  The top of the tree,
2422 represented by `.' in the list of multilib directories, is the default
2423 library to use when no special compiler options are used.  The
2424 subdirectories of the tree hold versions of the library to use when
2425 particular compiler options are used.
2427 \x1f
2428 File: configure.info,  Node: Multilibs in Target Libraries,  Prev: Multilibs in gcc,  Up: Multilibs
2430 Multilibs in Target Libraries
2431 =============================
2433 The target libraries in the Cygnus tree are automatically built with
2434 multilibs.  That means that each library is built multiple times.
2436    This default is set in the top level `configure.in' file, by adding
2437 `--enable-multilib' to the list of arguments passed to configure when
2438 it is run for the target libraries (*note Host and Target Libraries::).
2440    Each target library uses the shell script `config-ml.in', written by
2441 Doug Evans, to prepare to build target libraries.  This shell script is
2442 invoked after the `Makefile' has been created by the `configure'
2443 script.  If multilibs are not enabled, it does nothing, otherwise it
2444 modifies the `Makefile' to support multilibs.
2446    The `config-ml.in' script makes one copy of the `Makefile' for each
2447 multilib in the appropriate subdirectory.  When configuring in the
2448 source directory (which is not recommended), it will build a symlink
2449 tree of the sources in each subdirectory.
2451    The `config-ml.in' script sets several variables in the various
2452 `Makefile's.  The `Makefile.in' must have definitions for these
2453 variables already; `config-ml.in' simply changes the existing values.
2454 The `Makefile' should use default values for these variables which will
2455 do the right thing in the subdirectories.
2457 `MULTISRCTOP'
2458      `config-ml.in' will set this to a sequence of `../' strings, where
2459      the number of strings is the number of multilib levels in the
2460      source tree.  The default value should be the empty string.
2462 `MULTIBUILDTOP'
2463      `config-ml.in' will set this to a sequence of `../' strings, where
2464      the number of strings is number of multilib levels in the object
2465      directory.  The default value should be the empty string.  This
2466      will differ from `MULTISRCTOP' when configuring in the source tree
2467      (which is not recommended).
2469 `MULTIDIRS'
2470      In the top level `Makefile' only, `config-ml.in' will set this to
2471      the list of multilib subdirectories.  The default value should be
2472      the empty string.
2474 `MULTISUBDIR'
2475      `config-ml.in' will set this to the installed subdirectory name to
2476      use for this subdirectory, with a leading `/'.  The default value
2477      shold be the empty string.
2479 `MULTIDO'
2480 `MULTICLEAN'
2481      In the top level `Makefile' only, `config-ml.in' will set these
2482      variables to commands to use when doing a recursive make.  These
2483      variables should both default to the string `true', so that by
2484      default nothing happens.
2486    All references to the parent of the source directory should use the
2487 variable `MULTISRCTOP'.  Instead of writing `$(srcdir)/..', you must
2488 write `$(srcdir)/$(MULTISRCTOP)..'.
2490    Similarly, references to the parent of the object directory should
2491 use the variable `MULTIBUILDTOP'.
2493    In the installation target, the libraries should be installed in the
2494 subdirectory `MULTISUBDIR'.  Instead of installing
2495 `$(libdir)/libfoo.a', install `$(libdir)$(MULTISUBDIR)/libfoo.a'.
2497    The `config-ml.in' script also modifies the top level `Makefile' to
2498 add `multi-do' and `multi-clean' targets which are used when building
2499 multilibs.
2501    The default target of the `Makefile' should include the following
2502 command:
2503      @$(MULTIDO) $(FLAGS_TO_PASS) DO=all multi-do
2505 This assumes that `$(FLAGS_TO_PASS)' is defined as a set of variables
2506 to pass to a recursive invocation of `make'.  This will build all the
2507 multilibs.  Note that the default value of `MULTIDO' is `true', so by
2508 default this command will do nothing.  It will only do something in the
2509 top level `Makefile' if multilibs were enabled.
2511    The `install' target of the `Makefile' should include the following
2512 command:
2513      @$(MULTIDO) $(FLAGS_TO_PASS) DO=install multi-do
2515    In general, any operation, other than clean, which should be
2516 performed on all the multilibs should use a `$(MULTIDO)' line, setting
2517 the variable `DO' to the target of each recursive call to `make'.
2519    The `clean' targets (`clean', `mostlyclean', etc.) should use
2520 `$(MULTICLEAN)'.  For example, the `clean' target should do this:
2521      @$(MULTICLEAN) DO=clean multi-clean
2523 \x1f
2524 File: configure.info,  Node: FAQ,  Next: Index,  Prev: Multilibs,  Up: Top
2526 Frequently Asked Questions
2527 **************************
2529 Which do I run first, `autoconf' or `automake'?
2530      Except when you first add autoconf or automake support to a
2531      package, you shouldn't run either by hand.  Instead, configure
2532      with the `--enable-maintainer-mode' option, and let `make' take
2533      care of it.
2535 `autoconf' says something about undefined macros.
2536      This means that you have macros in your `configure.in' which are
2537      not defined by `autoconf'.  You may be using an old version of
2538      `autoconf'; try building and installing a newer one.  Make sure the
2539      newly installled `autoconf' is first on your `PATH'.  Also, see
2540      the next question.
2542 My `configure' script has stuff like `CY_GNU_GETTEXT' in it.
2543      This means that you have macros in your `configure.in' which should
2544      be defined in your `aclocal.m4' file, but aren't.  This usually
2545      means that `aclocal' was not able to appropriate definitions of the
2546      macros.  Make sure that you have installed all the packages you
2547      need.  In particular, make sure that you have installed libtool
2548      (this is where `AM_PROG_LIBTOOL' is defined) and gettext (this is
2549      where `CY_GNU_GETTEXT' is defined, at least in the Cygnus version
2550      of gettext).
2552 My `Makefile' has `@' characters in it.
2553      This may mean that you tried to use an autoconf substitution in
2554      your `Makefile.in' without adding the appropriate `AC_SUBST' call
2555      to your `configure' script.  Or it may just mean that you need to
2556      rebuild `Makefile' in your build directory.  To rebuild `Makefile'
2557      from `Makefile.in', run the shell script `config.status' with no
2558      arguments.  If you need to force `configure' to run again, first
2559      run `config.status --recheck'.  These runs are normally done
2560      automatically by `Makefile' targets, but if your `Makefile' has
2561      gotten messed up you'll need to help them along.
2563 Why do I have to run both `config.status --recheck' and `config.status'?
2564      Normally, you don't; they will be run automatically by `Makefile'
2565      targets.  If you do need to run them, use `config.status --recheck'
2566      to run the `configure' script again with the same arguments as the
2567      first time you ran it.  Use `config.status' (with no arguments) to
2568      regenerate all files (`Makefile', `config.h', etc.) based on the
2569      results of the configure script.  The two cases are separate
2570      because it isn't always necessary to regenerate all the files
2571      after running `config.status --recheck'.  The `Makefile' targets
2572      generated by automake will use the environment variables
2573      `CONFIG_FILES' and `CONFIG_HEADERS' to only regenerate files as
2574      they are needed.
2576 What is the Cygnus tree?
2577      The Cygnus tree is used for various packages including gdb, the GNU
2578      binutils, and egcs.  It is also, of course, used for Cygnus
2579      releases.  It is the build system which was developed at Cygnus,
2580      using the Cygnus configure script.  It permits building many
2581      different packages with a single configure and make.  The
2582      configure scripts in the tree are being converted to autoconf, but
2583      the general build structure remains intact.
2585 Why do I have to keep rebuilding and reinstalling the tools?
2586      I know, it's a pain.  Unfortunately, there are bugs in the tools
2587      themselves which need to be fixed, and each time that happens
2588      everybody who uses the tools need to reinstall new versions of
2589      them.  I don't know if there is going to be a clever fix until the
2590      tools stabilize.
2592 Why not just have a Cygnus tree `make' target to update the tools?
2593      The tools unfortunately need to be installed before they can be
2594      used.  That means that they must be built using an appropriate
2595      prefix, and it seems unwise to assume that every configuration
2596      uses an appropriate prefix.  It might be possible to make them
2597      work in place, or it might be possible to install them in some
2598      subdirectory; so far these approaches have not been implemented.
2600 \x1f
2601 File: configure.info,  Node: Index,  Prev: FAQ,  Up: Top
2603 Index
2604 *****
2606 * Menu:
2608 * --build option:                        Build and Host Options.
2609 * --host option:                         Build and Host Options.
2610 * --target option:                       Specifying the Target.
2611 * _GNU_SOURCE:                           Write configure.in.
2612 * AC_CANONICAL_HOST:                     Using the Host Type.
2613 * AC_CANONICAL_SYSTEM:                   Using the Target Type.
2614 * AC_CONFIG_HEADER:                      Write configure.in.
2615 * AC_EXEEXT:                             Write configure.in.
2616 * AC_INIT:                               Write configure.in.
2617 * AC_OUTPUT:                             Write configure.in.
2618 * AC_PREREQ:                             Write configure.in.
2619 * AC_PROG_CC:                            Write configure.in.
2620 * AC_PROG_CXX:                           Write configure.in.
2621 * acconfig.h:                            Written Developer Files.
2622 * acconfig.h, writing:                   Write acconfig.h.
2623 * acinclude.m4:                          Written Developer Files.
2624 * aclocal.m4:                            Generated Developer Files.
2625 * AM_CONFIG_HEADER:                      Write configure.in.
2626 * AM_DISABLE_SHARED:                     Write configure.in.
2627 * AM_EXEEXT:                             Write configure.in.
2628 * AM_INIT_AUTOMAKE:                      Write configure.in.
2629 * AM_MAINTAINER_MODE:                    Write configure.in.
2630 * AM_PROG_LIBTOOL:                       Write configure.in.
2631 * AM_PROG_LIBTOOL in configure:          FAQ.
2632 * build option:                          Build and Host Options.
2633 * building with a cross compiler:        Canadian Cross.
2634 * canadian cross:                        Canadian Cross.
2635 * canadian cross in configure:           CCross in Configure.
2636 * canadian cross in cygnus tree:         CCross in Cygnus Tree.
2637 * canadian cross in makefile:            CCross in Make.
2638 * canadian cross, configuring:           Build and Host Options.
2639 * canonical system names:                Configuration Names.
2640 * config.cache:                          Build Files Description.
2641 * config.h:                              Build Files Description.
2642 * config.h.in:                           Generated Developer Files.
2643 * config.in:                             Generated Developer Files.
2644 * config.status:                         Build Files Description.
2645 * config.status --recheck:               FAQ.
2646 * configuration names:                   Configuration Names.
2647 * configuration triplets:                Configuration Names.
2648 * configure:                             Generated Developer Files.
2649 * configure build system:                Build and Host Options.
2650 * configure host:                        Build and Host Options.
2651 * configure target:                      Specifying the Target.
2652 * configure.in:                          Written Developer Files.
2653 * configure.in, writing:                 Write configure.in.
2654 * configuring a canadian cross:          Build and Host Options.
2655 * cross compiler:                        Cross Compilation Concepts.
2656 * cross compiler, building with:         Canadian Cross.
2657 * cross tools:                           Cross Compilation Tools.
2658 * CY_GNU_GETTEXT in configure:           FAQ.
2659 * cygnus configure:                      Cygnus Configure.
2660 * goals:                                 Goals.
2661 * history:                               History.
2662 * host names:                            Configuration Names.
2663 * host option:                           Build and Host Options.
2664 * host system:                           Host and Target.
2665 * host triplets:                         Configuration Names.
2666 * HOST_CC:                               CCross in Make.
2667 * libg++ configure:                      Cygnus Configure in C++ Libraries.
2668 * libio configure:                       Cygnus Configure in C++ Libraries.
2669 * libstdc++ configure:                   Cygnus Configure in C++ Libraries.
2670 * Makefile:                              Build Files Description.
2671 * Makefile, garbage characters:          FAQ.
2672 * Makefile.am:                           Written Developer Files.
2673 * Makefile.am, writing:                  Write Makefile.am.
2674 * Makefile.in:                           Generated Developer Files.
2675 * multilibs:                             Multilibs.
2676 * stamp-h:                               Build Files Description.
2677 * stamp-h.in:                            Generated Developer Files.
2678 * system names:                          Configuration Names.
2679 * system types:                          Configuration Names.
2680 * target option:                         Specifying the Target.
2681 * target system:                         Host and Target.
2682 * triplets:                              Configuration Names.
2683 * undefined macros:                      FAQ.
2686 \x1f
2687 Tag Table:
2688 Node: Top\x7f971
2689 Node: Introduction\x7f1499
2690 Node: Goals\x7f2577
2691 Node: Tools\x7f3293
2692 Node: History\x7f4279
2693 Node: Building\x7f7269
2694 Node: Getting Started\x7f10356
2695 Node: Write configure.in\x7f10865
2696 Node: Write Makefile.am\x7f18108
2697 Node: Write acconfig.h\x7f21263
2698 Node: Generate files\x7f22797
2699 Node: Getting Started Example\x7f24755
2700 Node: Getting Started Example 1\x7f25502
2701 Node: Getting Started Example 2\x7f27436
2702 Node: Getting Started Example 3\x7f30549
2703 Node: Generate Files in Example\x7f32916
2704 Node: Files\x7f33994
2705 Node: Developer Files\x7f34601
2706 Node: Developer Files Picture\x7f34973
2707 Node: Written Developer Files\x7f36282
2708 Node: Generated Developer Files\x7f38822
2709 Node: Build Files\x7f41954
2710 Node: Build Files Picture\x7f42607
2711 Node: Build Files Description\x7f43379
2712 Node: Support Files\x7f45373
2713 Node: Configuration Names\x7f48247
2714 Node: Configuration Name Definition\x7f48743
2715 Node: Using Configuration Names\x7f51058
2716 Node: Cross Compilation Tools\x7f53020
2717 Node: Cross Compilation Concepts\x7f53707
2718 Node: Host and Target\x7f54667
2719 Node: Using the Host Type\x7f56160
2720 Node: Specifying the Target\x7f57501
2721 Node: Using the Target Type\x7f58282
2722 Node: Cross Tools in the Cygnus Tree\x7f61705
2723 Node: Host and Target Libraries\x7f62754
2724 Node: Target Library Configure Scripts\x7f66491
2725 Node: Make Targets in Cygnus Tree\x7f69571
2726 Node: Target libiberty\x7f70907
2727 Node: Canadian Cross\x7f72282
2728 Node: Canadian Cross Example\x7f73119
2729 Node: Canadian Cross Concepts\x7f74230
2730 Node: Build Cross Host Tools\x7f75734
2731 Node: Build and Host Options\x7f76678
2732 Node: CCross not in Cygnus Tree\x7f78456
2733 Node: CCross in Cygnus Tree\x7f79426
2734 Node: Standard Cygnus CCross\x7f79839
2735 Node: Cross Cygnus CCross\x7f81191
2736 Node: Supporting Canadian Cross\x7f83979
2737 Node: CCross in Configure\x7f84586
2738 Node: CCross in Make\x7f87740
2739 Node: Cygnus Configure\x7f89331
2740 Node: Cygnus Configure Basics\x7f90162
2741 Node: Cygnus Configure in C++ Libraries\x7f94832
2742 Node: Multilibs\x7f95831
2743 Node: Multilibs in gcc\x7f96872
2744 Node: Multilibs in Target Libraries\x7f97942
2745 Node: FAQ\x7f102123
2746 Node: Index\x7f106219
2747 \x1f
2748 End Tag Table