summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/autoconf/autoconf/backports/0028-INSTALL-Clarify-build-host-target-and-the-system-typ.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/autoconf/autoconf/backports/0028-INSTALL-Clarify-build-host-target-and-the-system-typ.patch')
-rw-r--r--meta/recipes-devtools/autoconf/autoconf/backports/0028-INSTALL-Clarify-build-host-target-and-the-system-typ.patch224
1 files changed, 224 insertions, 0 deletions
diff --git a/meta/recipes-devtools/autoconf/autoconf/backports/0028-INSTALL-Clarify-build-host-target-and-the-system-typ.patch b/meta/recipes-devtools/autoconf/autoconf/backports/0028-INSTALL-Clarify-build-host-target-and-the-system-typ.patch
new file mode 100644
index 0000000000..95ad80df5e
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/backports/0028-INSTALL-Clarify-build-host-target-and-the-system-typ.patch
@@ -0,0 +1,224 @@
1From 328f9b88ef896e8e31818c50d9ec2ade5c892ea4 Mon Sep 17 00:00:00 2001
2From: Bruno Haible <bruno@clisp.org>
3Date: Fri, 23 Jun 2023 17:37:35 +0200
4Subject: [PATCH 28/29] INSTALL: Clarify --build, --host, --target, and the
5 system types.
6
7* doc/install.texi (Compilers and Options): Add another reference.
8(System Types): Renamed from System Type. Explain how to canonicalize
9and how to validate a system type. Don't explain --build, --host,
10--target here.
11(Building for a different system type): New section.
12(Troubleshooting the Build Type): New section.
13(Configuring a Compiler): New section.
14(configure Invocation): Mention the --host option, not the --build
15option, since --build is so rarely needed.
16
17Upstream-Status: Backport
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20 doc/autoconf.texi | 6 +--
21 doc/install.texi | 132 +++++++++++++++++++++++++++++++++++++---------
22 2 files changed, 111 insertions(+), 27 deletions(-)
23
24diff --git a/doc/autoconf.texi b/doc/autoconf.texi
25index 7817fc1b5..043f7fb21 100644
26--- a/doc/autoconf.texi
27+++ b/doc/autoconf.texi
28@@ -604,7 +604,7 @@ Running @command{configure} Scripts
29 * Multiple Architectures:: Compiling for multiple architectures at once
30 * Installation Names:: Installing in different directories
31 * Optional Features:: Selecting optional features
32-* System Type:: Specifying the system type
33+* System Types:: Specifying a system type
34 * Sharing Defaults:: Setting site-wide defaults for @command{configure}
35 * Defining Variables:: Specifying the compiler etc.
36 * configure Invocation:: Changing how @command{configure} runs
37@@ -22383,7 +22383,7 @@ system it's running on. To do so it runs a script called
38 command or symbols predefined by the C preprocessor.
39
40 Alternately, the user can specify the system type with command line
41-arguments to @command{configure} (@pxref{System Type}. Doing so is
42+arguments to @command{configure} (@pxref{System Types}. Doing so is
43 necessary when
44 cross-compiling. In the most complex case of cross-compiling, three
45 system types are involved. The options to specify them are:
46@@ -23303,7 +23303,7 @@ may use comes with Autoconf.
47 * Multiple Architectures:: Compiling for multiple architectures at once
48 * Installation Names:: Installing in different directories
49 * Optional Features:: Selecting optional features
50-* System Type:: Specifying the system type
51+* System Types:: Specifying a system type
52 * Sharing Defaults:: Setting site-wide defaults for @command{configure}
53 * Defining Variables:: Specifying the compiler etc.
54 * configure Invocation:: Changing how @command{configure} runs
55diff --git a/doc/install.texi b/doc/install.texi
56index 6d9788fa9..a3ef17828 100644
57--- a/doc/install.texi
58+++ b/doc/install.texi
59@@ -157,8 +157,16 @@ Here is an example:
60 ./configure CC=gcc CFLAGS=-g LIBS=-lposix
61 @end example
62
63-@xref{Defining Variables}, for more details.
64-
65+See
66+@ref{Defining Variables} and
67+@ifset autoconf
68+@ref{Preset Output Variables}
69+@end ifset
70+@ifclear autoconf
71+@ref{Preset Output Variables,,, autoconf, Autoconf}
72+@c (@url{https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/html_node/Preset-Output-Variables.html})
73+@end ifclear
74+for more details.
75
76 @node Multiple Architectures
77 @section Compiling For Multiple Architectures
78@@ -263,18 +271,17 @@ output, which can be overridden with @code{make V=1}; while running
79 @samp{./configure --disable-silent-rules} sets the default to verbose,
80 which can be overridden with @code{make V=0}.
81
82-@node System Type
83-@section Specifying the System Type
84+@node System Types
85+@section Specifying a System Type
86
87-There may be some features @command{configure} cannot figure out
88-automatically, but needs to determine by the type of machine the package
89-will run on. Usually, assuming the package is built to be run on the
90-@emph{same} architectures, @command{configure} can figure that out, but
91-if it prints a message saying it cannot guess the machine type, give it
92-the @option{--build=@var{type}} option. @var{type} can either be a
93-short name like @samp{mingw64} for the system type, or a canonical name
94-like @samp{x86_64-pc-linux-gnu}
95-which has the form:
96+The following sections go into details regarding situations where you
97+may have to specify a system type, either through the option
98+@option{--host=@var{type}}, or through the option
99+@option{--build=@var{type}}, or -- in the case of compilers -- through
100+@option{--target=@var{type}}.
101+
102+A system type @var{type} can either be a short name like @samp{mingw64},
103+or a canonical name like @samp{x86_64-pc-linux-gnu} which has the form:
104
105 @example
106 @var{cpu}-@var{company}-@var{system}
107@@ -291,16 +298,93 @@ where @var{system} can have one of these forms:
108 @noindent
109 See the file @file{config.sub} for the possible values of each field.
110 If @file{config.sub} isn't included in this package, then this package
111-doesn't need to know the machine type.
112+doesn't need to know any machine type.
113+
114+The file @file{config.sub} is a program that validates and canonicalizes
115+a system type.
116+It can do canonicalization, as in
117+
118+@example
119+$ sh config.sub x86_64-linux
120+x86_64-pc-linux-gnu
121+$ sh config.sub arm64-linux
122+aarch64-unknown-linux-gnu
123+@end example
124+
125+@noindent
126+It also validates the parts. For example, this interaction tells you
127+that ``crusoe'' is not a valid cpu architecture name:
128
129-If you are @emph{building} compiler tools for cross-compiling, you
130-should use the option @option{--target=@var{type}} to select the type of
131-system they will produce code for.
132+@example
133+$ sh config.sub crusoe-linux
134+Invalid configuration `crusoe-linux': machine `crusoe-unknown' not recognized
135+@end example
136+
137+@node Building for a different system type
138+@section Creating binaries for a different system type
139+
140+When you want to create binaries that will run on a different machine
141+type than the one you are building on, you need to specify both
142+@itemize @bullet
143+@item
144+a @option{--host=@var{type}} option, specifying the machine type on
145+which the binaries shall run,
146+@item
147+compiler variables (@code{CC} for the C compiler, @code{CXX} for the C++
148+compiler, and so on), pointing to compilers that generate object code
149+for that machine type.
150+@end itemize
151+
152+For example, to create binaries intended to run on a 64-bit ARM
153+processor:
154+@example
155+./configure --host=aarch64-linux-gnu \
156+ CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++
157+@end example
158
159-If you want to @emph{use} a cross compiler, that generates code for a
160-platform different from the build platform, you should specify the
161-@dfn{host} platform (i.e., that on which the generated programs will
162-eventually be run) with @option{--host=@var{type}}.
163+If you do this on a machine that can execute such binaries (e.g.@: by
164+virtue of the @code{qemu-aarch64} program, system libraries for that
165+architecture under @code{$QEMU_LD_PREFIX}, and a Linux
166+@code{binfmt_misc} configuration), the build behaves like a native
167+build.
168+If not, the build is a cross-build, in the sense that @code{configure}
169+will make cross-compilation guesses instead of running test programs,
170+and ``make check'' will not work.
171+
172+@node Troubleshooting the Build Type
173+@section Fixing a ``cannot guess build type'' error
174+
175+In rare cases, it may happen that @code{configure} fails with the error
176+message ``cannot guess build type''.
177+This error means that the files @file{config.guess} and
178+@file{config.sub} don't recognize the type of the system on which you
179+are building.
180+In this case, first fetch the newest versions of these files, from
181+@url{https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess}
182+and
183+@url{https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub},
184+respectively, and use these as drop-in replacement for the files
185+@file{config.guess} and @file{config.sub} that were shipped with this
186+package.
187+
188+If this resolves the problem, feel free to report the solution to the
189+maintainers of this package.
190+
191+Otherwise, it means that your system is not yet supported by
192+@file{config.guess} and @file{config.sub}.
193+As a workaround, you can use a configure option
194+@option{--build=@var{type}}, where @var{type} comes closest to your
195+system type.
196+Also, you're welcome to file a report to
197+@email{config-patches@@gnu.org}.
198+
199+@node Configuring a Compiler
200+@section Configuration options specific to a compiler
201+
202+If you are building a compiler, and this compiler should generate code
203+for a system type that is different from the one on which the compiler
204+binaries shall run on, use the option @option{--target=@var{type}} to
205+select the type of system for which the compiler should produce code.
206
207 @node Sharing Defaults
208 @section Sharing Defaults
209@@ -384,9 +468,9 @@ Use @var{dir} as the installation prefix. @ref{Installation Names}
210 for more details, including other options available for fine-tuning
211 the installation locations.
212
213-@item --build=@var{type}
214-Build for architecture @var{type}. @ref{System Type}.
215-for more details, including other system type options.
216+@item --host=@var{type}
217+Build binaries for architecture @var{type}. @ref{System Types} and
218+@ref{Building for a different system type} for more details.
219
220 @item --enable-@var{feature}
221 @itemx --disable-@var{feature}
222--
2232.41.0
224