Skip to content

Commit 50ab325

Browse files
crassDaniel Kiper
authored and
Daniel Kiper
committed
INSTALL: Add information on using --build when cross-compiling
The autoconf 2.65 manual [1] strongly recommends specifying the --build option when the --host is used. Add this to the example and add a note that this is recommended. [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/Hosts-and-Cross_002dCompilation.html Signed-off-by: Glenn Washburn <[email protected]> Reviewed-by: Daniel Kiper <[email protected]>
1 parent 2aa6717 commit 50ab325

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

INSTALL

+13-7
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,20 @@ For this example the configure line might look like (more details below)
189189
(some options are optional and included here for completeness but some rarely
190190
used options are omitted):
191191

192-
./configure --host=x86_64-linux-gnu --target=arm-linux-gnueabihf \
193-
--with-platform=efi BUILD_CC=gcc BUILD_PKG_CONFIG=pkg-config \
192+
./configure --build=sparc64-freebsd --host=x86_64-linux-gnu \
193+
--target=arm-linux-gnueabihf --with-platform=efi \
194+
BUILD_CC=gcc BUILD_PKG_CONFIG=pkg-config \
194195
HOST_CC=x86_64-linux-gnu-gcc HOST_CFLAGS='-g -O2' \
195196
PKG_CONFIG=x86_64-linux-gnu-pkg-config TARGET_CC=arm-linux-gnueabihf-gcc \
196197
TARGET_CFLAGS='-Os -march=armv8.3-a' TARGET_CCASFLAGS='-march=armv8.3-a' \
197198
TARGET_OBJCOPY=arm-linux-gnueabihf-objcopy \
198199
TARGET_STRIP=arm-linux-gnueabihf-strip TARGET_NM=arm-linux-gnueabihf-nm \
199200
TARGET_RANLIB=arm-linux-gnueabihf-ranlib LEX=flex
200201

202+
Note, that the autoconf 2.65 manual states that when using the --host argument
203+
to configure, the --build argument should be specified as well. Not sending
204+
--build, enters a compatibility mode that will be removed in the future.
205+
201206
Normally, for building a GRUB on amd64 with tools to run on amd64 to
202207
generate images to run on ARM, using your Linux distribution's
203208
packaged cross compiler, the following would suffice:
@@ -209,13 +214,14 @@ version look at prerequisites. All tools not mentioned in this section under
209214
corresponding platform are not needed for the platform in question.
210215

211216
- For build
212-
1. BUILD_CC= to gcc able to compile for build. This is used, for
217+
1. --build= to autoconf name of build.
218+
2. BUILD_CC= to gcc able to compile for build. This is used, for
213219
example, to compile build-gentrigtables which is then run to
214220
generate sin and cos tables.
215-
2. BUILD_CFLAGS= for C options for build.
216-
3. BUILD_CPPFLAGS= for C preprocessor options for build.
217-
4. BUILD_LDFLAGS= for linker options for build.
218-
5. BUILD_PKG_CONFIG= for pkg-config for build (optional).
221+
3. BUILD_CFLAGS= for C options for build.
222+
4. BUILD_CPPFLAGS= for C preprocessor options for build.
223+
5. BUILD_LDFLAGS= for linker options for build.
224+
6. BUILD_PKG_CONFIG= for pkg-config for build (optional).
219225

220226
- For host
221227
1. --host= to autoconf name of host.

0 commit comments

Comments
 (0)