build: use AC_CANONICAL_HOST, not AC_CANONICAL_TARGET

htop is a program which will be run on CHOST after cross-compilation;
CTARGET is only for a small number of cases where a program itself outputs
code (so you might cross-compile a compiler which spits out code for a third
architecture/platform).

We want to use AC_CANONICAL_HOST to check CHOST for the platform currently
being used to build htop.

The confusion around this issue was compounded by a mistake in autoconf-archive
which has since been fixed (AX_PTHREAD pulled it in incorrectly).

See: https://github.com/libstatgrab/libstatgrab/pull/131
See: https://github.com/fenrus75/powertop/pull/90#discussion_r705803725
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James 2022-01-22 03:54:42 +00:00
parent 3e1a27a981
commit 939685dff9
No known key found for this signature in database
GPG Key ID: F4922810EEA0483B
1 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ AC_CONFIG_SRCDIR([htop.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_TARGET
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([-Wall std-options subdir-objects])
# ----------------------------------------------------------------------
@ -22,7 +22,7 @@ AM_INIT_AUTOMAKE([-Wall std-options subdir-objects])
# Checks for platform.
# ----------------------------------------------------------------------
case "$target_os" in
case "$host_os" in
linux*|gnu*)
my_htop_platform=linux
AC_DEFINE([HTOP_LINUX], [], [Building for Linux.])