From 3b1faeb2e29b62588709208f97d34c1787777dcb Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 10 Jul 2017 12:35:06 +0200 Subject: [PATCH] Make sure $host and $host_os are defined when used. * m4/argz.m4 (gl_FUNC_ARGZ): Require AC_CANONICAL_HOST. * m4/closedir.m4 (gl_FUNC_CLOSEDIR): Likewise. * m4/csharpexec.m4 (gt_CSHARPEXEC): Likewise. * m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise. * m4/expl.m4 (gl_FUNC_EXPL): Likewise. * m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Likewise. * m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Likewise. * m4/opendir.m4 (gl_FUNC_OPENDIR): Likewise. * m4/poll.m4 (gl_FUNC_POLL): Likewise. * m4/pselect.m4 (gl_FUNC_PSELECT): Likewise. * m4/ptsname.m4 (gl_FUNC_PTSNAME): Likewise. * m4/relocatable.m4 (gl_RELOCATABLE_BODY): Likewise. * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Likewise. * m4/ceill.m4 (gl_FUNC_CEILL): Require AC_CANONICAL_HOST outside the m4_ifdef block. --- ChangeLog | 19 +++++++++++++++++++ m4/argz.m4 | 3 ++- m4/ceill.m4 | 4 ++-- m4/closedir.m4 | 3 ++- m4/csharpexec.m4 | 3 ++- m4/dirfd.m4 | 3 ++- m4/expl.m4 | 3 ++- m4/ls-mntd-fs.m4 | 3 ++- m4/lstat.m4 | 3 ++- m4/opendir.m4 | 3 ++- m4/poll.m4 | 3 ++- m4/pselect.m4 | 3 ++- m4/ptsname.m4 | 3 ++- m4/relocatable.m4 | 3 ++- m4/symlinkat.m4 | 5 +++-- 15 files changed, 48 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ae1dd4ad6..52c204e1a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2017-07-10 Bruno Haible + + Make sure $host and $host_os are defined when used. + * m4/argz.m4 (gl_FUNC_ARGZ): Require AC_CANONICAL_HOST. + * m4/closedir.m4 (gl_FUNC_CLOSEDIR): Likewise. + * m4/csharpexec.m4 (gt_CSHARPEXEC): Likewise. + * m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise. + * m4/expl.m4 (gl_FUNC_EXPL): Likewise. + * m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Likewise. + * m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Likewise. + * m4/opendir.m4 (gl_FUNC_OPENDIR): Likewise. + * m4/poll.m4 (gl_FUNC_POLL): Likewise. + * m4/pselect.m4 (gl_FUNC_PSELECT): Likewise. + * m4/ptsname.m4 (gl_FUNC_PTSNAME): Likewise. + * m4/relocatable.m4 (gl_RELOCATABLE_BODY): Likewise. + * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Likewise. + * m4/ceill.m4 (gl_FUNC_CEILL): Require AC_CANONICAL_HOST outside the + m4_ifdef block. + 2017-07-09 Bruno Haible *printf: Fix cross-compilation guess for Solaris. diff --git a/m4/argz.m4 b/m4/argz.m4 index 67f4cbe171..c34d685223 100644 --- a/m4/argz.m4 +++ b/m4/argz.m4 @@ -7,12 +7,13 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 11 argz.m4 +# serial 12 argz.m4 AC_DEFUN([gl_FUNC_ARGZ], [gl_PREREQ_ARGZ AC_REQUIRE([AC_C_RESTRICT]) +AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) diff --git a/m4/ceill.m4 b/m4/ceill.m4 index 8e87acf6c2..e981c7bcf7 100644 --- a/m4/ceill.m4 +++ b/m4/ceill.m4 @@ -1,4 +1,4 @@ -# ceill.m4 serial 14 +# ceill.m4 serial 15 dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,6 +9,7 @@ AC_DEFUN([gl_FUNC_CEILL], m4_divert_text([DEFAULTS], [gl_ceill_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Persuade glibc to declare ceill(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -25,7 +26,6 @@ AC_DEFUN([gl_FUNC_CEILL], fi m4_ifdef([gl_FUNC_CEILL_IEEE], [ if test $gl_ceill_required = ieee && test $REPLACE_CEILL = 0; then - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether ceill works according to ISO C 99 with IEC 60559], [gl_cv_func_ceill_ieee], [ diff --git a/m4/closedir.m4 b/m4/closedir.m4 index 40765b1941..69e41b3c61 100644 --- a/m4/closedir.m4 +++ b/m4/closedir.m4 @@ -1,4 +1,4 @@ -# closedir.m4 serial 5 +# closedir.m4 serial 6 dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_CLOSEDIR], [ AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_FUNCS([closedir]) if test $ac_cv_func_closedir = no; then diff --git a/m4/csharpexec.m4 b/m4/csharpexec.m4 index 73c2ff40da..90b999115b 100644 --- a/m4/csharpexec.m4 +++ b/m4/csharpexec.m4 @@ -1,4 +1,4 @@ -# csharpexec.m4 serial 4 +# csharpexec.m4 serial 5 dnl Copyright (C) 2003-2005, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -12,6 +12,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gt_CSHARPEXEC], [ AC_REQUIRE([gt_CSHARP_CHOICE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_MSG_CHECKING([for C[#] program execution engine]) AC_EGREP_CPP([yes], [ #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ diff --git a/m4/dirfd.m4 b/m4/dirfd.m4 index b4ec3d1910..86c1cb3850 100644 --- a/m4/dirfd.m4 +++ b/m4/dirfd.m4 @@ -1,4 +1,4 @@ -# serial 24 -*- Autoconf -*- +# serial 25 -*- Autoconf -*- dnl Find out how to get the file descriptor associated with an open DIR*. @@ -12,6 +12,7 @@ dnl From Jim Meyering AC_DEFUN([gl_FUNC_DIRFD], [ AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Persuade glibc to declare dirfd(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) diff --git a/m4/expl.m4 b/m4/expl.m4 index 8ddaad5dab..530bad8f4b 100644 --- a/m4/expl.m4 +++ b/m4/expl.m4 @@ -1,4 +1,4 @@ -# expl.m4 serial 8 +# expl.m4 serial 9 dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,6 +8,7 @@ AC_DEFUN([gl_FUNC_EXPL], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Persuade glibc to declare expl(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) diff --git a/m4/ls-mntd-fs.m4 b/m4/ls-mntd-fs.m4 index a678f05553..4c8b4ac77e 100644 --- a/m4/ls-mntd-fs.m4 +++ b/m4/ls-mntd-fs.m4 @@ -1,4 +1,4 @@ -# serial 32 +# serial 33 # How to list mounted file systems. # Copyright (C) 1998-2004, 2006, 2009-2017 Free Software Foundation, Inc. @@ -26,6 +26,7 @@ AC_CHECK_FUNCS([getmntent]) # gl_LIST_MOUNTED_FILE_SYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS], [ +AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_FUNCS([listmntent getmntinfo]) AC_CHECK_HEADERS_ONCE([sys/param.h sys/statvfs.h]) diff --git a/m4/lstat.m4 b/m4/lstat.m4 index 953c117d80..931f3b2727 100644 --- a/m4/lstat.m4 +++ b/m4/lstat.m4 @@ -1,4 +1,4 @@ -# serial 27 +# serial 28 # Copyright (C) 1997-2001, 2003-2017 Free Software Foundation, Inc. # @@ -33,6 +33,7 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], [ dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ. + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether lstat correctly handles trailing slash], [gl_cv_func_lstat_dereferences_slashed_symlink], [rm -f conftest.sym conftest.file diff --git a/m4/opendir.m4 b/m4/opendir.m4 index b970e6557b..0047d34947 100644 --- a/m4/opendir.m4 +++ b/m4/opendir.m4 @@ -1,4 +1,4 @@ -# opendir.m4 serial 4 +# opendir.m4 serial 5 dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_OPENDIR], [ AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_FUNCS([opendir]) if test $ac_cv_func_opendir = no; then diff --git a/m4/poll.m4 b/m4/poll.m4 index 5706ab5144..060052e286 100644 --- a/m4/poll.m4 +++ b/m4/poll.m4 @@ -1,4 +1,4 @@ -# poll.m4 serial 17 +# poll.m4 serial 18 dnl Copyright (c) 2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,6 +8,7 @@ AC_DEFUN([gl_FUNC_POLL], [ AC_REQUIRE([gl_POLL_H]) AC_REQUIRE([gl_SOCKETS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles if test $ac_cv_header_poll_h = no; then ac_cv_func_poll=no gl_cv_func_poll=no diff --git a/m4/pselect.m4 b/m4/pselect.m4 index 3f1c43f650..ea925cb0ea 100644 --- a/m4/pselect.m4 +++ b/m4/pselect.m4 @@ -1,4 +1,4 @@ -# pselect.m4 serial 2 +# pselect.m4 serial 3 dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,6 +8,7 @@ AC_DEFUN([gl_FUNC_PSELECT], [ AC_REQUIRE([gl_HEADER_SYS_SELECT]) AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_FUNCS_ONCE([pselect]) if test $ac_cv_func_pselect = yes; then diff --git a/m4/ptsname.m4 b/m4/ptsname.m4 index 3fd577079f..a8fb6c87df 100644 --- a/m4/ptsname.m4 +++ b/m4/ptsname.m4 @@ -1,4 +1,4 @@ -# ptsname.m4 serial 3 +# ptsname.m4 serial 4 dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_PTSNAME], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Persuade glibc to declare ptsname(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) diff --git a/m4/relocatable.m4 b/m4/relocatable.m4 index a5476e7cd1..6a833ab171 100644 --- a/m4/relocatable.m4 +++ b/m4/relocatable.m4 @@ -1,4 +1,4 @@ -# relocatable.m4 serial 18 +# relocatable.m4 serial 19 dnl Copyright (C) 2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -31,6 +31,7 @@ AC_DEFUN([gl_RELOCATABLE_BODY], AC_BEFORE([AC_PROG_INSTALL],[gl_RELOCATABLE_BODY]) AC_REQUIRE([AC_LIB_LIBPATH]) AC_REQUIRE([gl_RELOCATABLE_LIBRARY_BODY]) + AC_REQUIRE([AC_CANONICAL_HOST]) is_noop=no use_elf_origin_trick=no use_wrapper=no diff --git a/m4/symlinkat.m4 b/m4/symlinkat.m4 index 8d9d4179d5..b1a8a99323 100644 --- a/m4/symlinkat.m4 +++ b/m4/symlinkat.m4 @@ -1,4 +1,4 @@ -# serial 6 +# serial 7 # See if we need to provide symlinkat replacement. dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. @@ -10,9 +10,10 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_SYMLINKAT], [ - AC_REQUIRE([gl_FUNC_OPENAT]) AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_OPENAT]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_FUNCS_ONCE([symlinkat]) if test $ac_cv_func_symlinkat = no; then HAVE_SYMLINKAT=0 -- 2.39.5