mirror of
git://git.savannah.gnu.org/config.git
synced 2025-05-26 09:06:38 +12:00

Here's a patch to recognize Android environments. Such environments are "apps" with POSIX-like tools. Today, the most frequently used one is Termux [1][2][3]; on devices with Android versions before 5.0 one can use Terminal-IDE [4][5]. config.sub already supports this environment: $ sh config.sub armv7l-linux-androideabi armv7l-unknown-linux-androideabi I've built many GNU packages in this environment, with the following recipe: CONFIG_SHELL=$PREFIX/bin/sh; export CONFIG_SHELL CC="clang -ferror-limit=0" CXX="clang++ -ferror-limit=0"; export CC CXX ./configure --host=armv7l-linux-androideabi --prefix=$HOME/local The Termux people have compiled or ported more than 1000 packages as well [6]. But the requirement to pass the --host parameter each time is an annoyance. Without it, based only on the results of uname, config.guess guesses $ sh config.guess armv7l-unknown-linux-gnueabi and many configuration results are wrong (because Android has many functions in libc without declaring them in the .h files, depending on the so-called "Android API level"), leading to many compilation errors. With the attached patch, it produces $ sh config.guess armv7l-unknown-linux-androideabi The patch does not include an addition to the config.guess test suite, since the uname values are: $ uname -m armv7l $ uname -r 4.19.127 $ uname -s Linux $ uname -v #1 SMP PREEMPT Tue Apr 4 16:54:58 IST 2023 $ uname -p unknown which maps to armv7l-unknown-linux-gnueabi. [1] https://github.com/termux/termux-app [2] https://f-droid.org/en/packages/com.termux/ [3] https://wiki.termux.com/wiki/Main_Page [4] https://en.wikibooks.org/wiki/Android/Terminal_IDE [5] http://www.spartacusrex.com/terminalide.htm [6] https://github.com/termux/termux-packages/tree/master/packages * config.guess (Linux|GNU|GNU/*): Detect Android. * doc/config.guess.1: Regenerate. Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
49 lines
1.7 KiB
Groff
49 lines
1.7 KiB
Groff
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5.
|
|
.TH CONFIG.GUESS "1" "August 2023" "GNU config.guess (2023-08-17)" "User Commands"
|
|
.SH NAME
|
|
config.guess \- guess the build system triplet
|
|
.SH SYNOPSIS
|
|
.B config.guess
|
|
[\fI\,OPTION\/\fR]
|
|
.SH DESCRIPTION
|
|
The GNU build system distinguishes three types of machines, the
|
|
`build' machine on which the compilers are run, the `host' machine
|
|
on which the package being built will run, and, exclusively when you
|
|
build a compiler, assembler etc., the `target' machine, for which the
|
|
compiler being built will produce code.
|
|
|
|
This script will guess the type of the `build' machine.
|
|
.PP
|
|
Output the configuration name of the system 'config.guess' is run on.
|
|
.SH OPTIONS
|
|
.TP
|
|
\fB\-h\fR, \fB\-\-help\fR
|
|
print this help, then exit
|
|
.TP
|
|
\fB\-t\fR, \fB\-\-time\-stamp\fR
|
|
print date of last modification, then exit
|
|
.TP
|
|
\fB\-v\fR, \fB\-\-version\fR
|
|
print version number, then exit
|
|
.SH "ENVIRONMENT VARIABLES"
|
|
config.guess might need to compile and run C code, hence it needs a
|
|
compiler for the `build' machine: use the environment variable
|
|
`CC_FOR_BUILD' to specify the compiler for the build machine. If
|
|
`CC_FOR_BUILD' is not specified, `CC' will be used. Be sure to
|
|
specify `CC_FOR_BUILD' if `CC' is a cross-compiler to the `host'
|
|
machine.
|
|
|
|
CC_FOR_BUILD a native C compiler, defaults to `cc'
|
|
CC a native C compiler, CC_FOR_BUILD is preferred
|
|
.SH "REPORTING BUGS"
|
|
Report bugs and patches to <config\-patches@gnu.org>.
|
|
.PP
|
|
.br
|
|
Originally written by Per Bothner.
|
|
.br
|
|
Copyright 1992\-2023 Free Software Foundation, Inc.
|
|
.PP
|
|
.br
|
|
This is free software; see the source for copying conditions. There is NO
|
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|