From patchwork Thu Sep 29 00:52:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 1684174 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=JLoHNLJP; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MdFG35Vvwz1yqH for ; Thu, 29 Sep 2022 10:52:59 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4MdFG32mrZz3c5v for ; Thu, 29 Sep 2022 10:52:59 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=JLoHNLJP; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1234::107; helo=merlin.infradead.org; envelope-from=geoff@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=JLoHNLJP; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1234::107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4MdFFY3lbYz2xZp for ; Thu, 29 Sep 2022 10:52:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Date:Cc:To:Subject:From:References: In-Reply-To:Message-Id:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Sb26FuGwNCMd/iu0qm3wEYxsPJZgv4sLzwnEza0bQ5Q=; b=JLoHNLJPDh9Iozk1mo+KMU85yC Z+ruxiUV01yFR0FEstFIs2HA1VGevOQMsI7isIvZoA4O8jKEgsRbWeH9EcLBw82zd+JTbrgKkjbb0 oWI5fXsr6E5e+9vUET/aYPRm9c3xoN8EMQaeYOwINxe2xnhyFViSbEdHxv79gb6O9wtGbZ2Yd3ObY E0pUV0u+DDqDGLxDR94oUFEPJtuOsO6BcE/iTRDMdUdySi3jtGIp8n1IaDiMbLQ+WdZGIN93EE4fQ C8zbOXkERhVZ01l4O87VgLJe/vhpOQeHdA3ibWUBxj3s0lNSbalvAtDgd7fSOWi5D0QdRbhe45ksn MS70UGUg==; Received: from geoff by merlin.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1odhmp-0061XP-Dr; Thu, 29 Sep 2022 00:52:25 +0000 Message-Id: <2e8998e2ff0bb8a49b1069219b8b99d34485a933.1664412375.git.geoff@infradead.org> In-Reply-To: References: From: Geoff Levand Patch-Date: Tue, 27 Sep 2022 20:06:15 -0700 Subject: [PATCH v1 1/5] bootstrap: Fix warnings To: Jeremy Kerr Date: Thu, 29 Sep 2022 00:52:23 +0000 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: petitboot@lists.ozlabs.org MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Fixes bootstrap/autotools warnings like these: warning: The macro `AC_GNU_SOURCE' is obsolete. warning: The macro `AC_TRY_LINK' is obsolete. Signed-off-by: Geoff Levand --- .gitignore | 3 +++ configure.ac | 21 +++++++++--------- m4/gpgme.m4 | 60 ++++++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 63 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 77b16f3..6845ec8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,10 +5,13 @@ autom4te.cache/* compile config.guess config.h.in +config.h.in~ config.log config.rpath +config.rpath~ config.sub configure +configure~ cscope.out depcomp install-sh diff --git a/configure.ac b/configure.ac index 6683be6..524a23d 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ AC_PREFIX_DEFAULT([/usr/local]) AS_IF([test "x$CFLAGS" = "x"], [AC_SUBST([CFLAGS], [""])]) AC_PROG_CC -AC_PROG_LEX +AC_PROG_LEX(yywrap) if test -z "$($LEX --version)"; then AC_MSG_ERROR([[Please install flex/lex]]) fi @@ -36,7 +36,6 @@ fi AC_PROG_INSTALL AM_INIT_AUTOMAKE -AC_GNU_SOURCE AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION(0.18.1) if test "$USE_NLS" = "yes" -a -z "$($MSGFMT --version)"; then @@ -121,19 +120,21 @@ AC_CHECK_HEADERS([varargs.h]) dnl Checking for va_copy availability AC_MSG_CHECKING([for va_copy]) -AC_TRY_LINK([#include -va_list ap1,ap2;], [va_copy(ap1,ap2);], -have_va_copy=yes, -have_va_copy=no) + +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +va_list ap1,ap2;]], [[va_copy(ap1,ap2);]])], +[have_va_copy=yes], +[have_va_copy=no]) + AC_MSG_RESULT($have_va_copy) if test x"$have_va_copy" = x"yes"; then AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) else AC_MSG_CHECKING([for __va_copy]) - AC_TRY_LINK([#include - va_list ap1,ap2;], [__va_copy(ap1,ap2);], - have___va_copy=yes, - have___va_copy=no) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include + va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])], + [have___va_copy=yes], + [have___va_copy=no]) AC_MSG_RESULT($have___va_copy) if test x"$have___va_copy" = x"yes"; then AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) diff --git a/m4/gpgme.m4 b/m4/gpgme.m4 index 6c2be44..c749a5d 100644 --- a/m4/gpgme.m4 +++ b/m4/gpgme.m4 @@ -1,5 +1,5 @@ # gpgme.m4 - autoconf macro to detect GPGME. -# Copyright (C) 2002, 2003, 2004, 2014 g10 Code GmbH +# Copyright (C) 2002, 2003, 2004, 2014, 2018 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -9,12 +9,12 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2014-10-02 +# Last-changed: 2020-11-20 AC_DEFUN([_AM_PATH_GPGME_CONFIG], [ AC_ARG_WITH(gpgme-prefix, - AC_HELP_STRING([--with-gpgme-prefix=PFX], + AS_HELP_STRING([--with-gpgme-prefix=PFX], [prefix where GPGME is installed (optional)]), gpgme_config_prefix="$withval", gpgme_config_prefix="") if test x"${GPGME_CONFIG}" = x ; then @@ -36,10 +36,24 @@ AC_DEFUN([_AM_PATH_GPGME_CONFIG], fi fi - AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no) + use_gpgrt_config="" + if test x"${GPGME_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then + if $GPGRT_CONFIG gpgme --exists; then + GPGME_CONFIG="$GPGRT_CONFIG gpgme" + AC_MSG_NOTICE([Use gpgrt-config as gpgme-config]) + use_gpgrt_config=yes + fi + fi + if test -z "$use_gpgrt_config"; then + AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no) + fi if test "$GPGME_CONFIG" != "no" ; then - gpgme_version=`$GPGME_CONFIG --version` + if test -z "$use_gpgrt_config"; then + gpgme_version=`$GPGME_CONFIG --version` + else + gpgme_version=`$GPGME_CONFIG --modversion` + fi fi gpgme_version_major=`echo $gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` @@ -52,12 +66,16 @@ AC_DEFUN([_AM_PATH_GPGME_CONFIG], AC_DEFUN([_AM_PATH_GPGME_CONFIG_HOST_CHECK], [ - gpgme_config_host=`$GPGME_CONFIG --host 2>/dev/null || echo none` + if test -z "$use_gpgrt_config"; then + gpgme_config_host=`$GPGME_CONFIG --host 2>/dev/null || echo none` + else + gpgme_config_host=`$GPGME_CONFIG --variable=host 2>/dev/null || echo none` + fi if test x"$gpgme_config_host" != xnone ; then if test x"$gpgme_config_host" != x"$host" ; then AC_MSG_WARN([[ *** -*** The config script $GPGME_CONFIG was +*** The config script "$GPGME_CONFIG" was *** built for $gpgme_config_host and thus may not match the *** used host $host. *** You may want to use the configure option --with-gpgme-prefix @@ -118,7 +136,11 @@ AC_DEFUN([AM_PATH_GPGME], # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then - tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` + if test -z "$use_gpgrt_config"; then + tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` + else + tmp=`$GPGME_CONFIG --variable=api_version 2>/dev/null || echo 0` + fi if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no @@ -258,7 +280,11 @@ AC_DEFUN([AM_PATH_GPGME_GLIB], # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then - tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` + if test -z "$use_gpgrt_config"; then + tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` + else + tmp=`$GPGME_CONFIG --variable=api_version 2>/dev/null || echo 0` + fi if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no @@ -267,8 +293,20 @@ AC_DEFUN([AM_PATH_GPGME_GLIB], fi fi if test $ok = yes; then - GPGME_GLIB_CFLAGS=`$GPGME_CONFIG --glib --cflags` - GPGME_GLIB_LIBS=`$GPGME_CONFIG --glib --libs` + if test -z "$use_gpgrt_config"; then + GPGME_GLIB_CFLAGS=`$GPGME_CONFIG --glib --cflags` + GPGME_GLIB_LIBS=`$GPGME_CONFIG --glib --libs` + else + if $GPGRT_CONFIG gpgme-glib --exists; then + GPGME_CONFIG="$GPGRT_CONFIG gpgme-glib" + GPGME_GLIB_CFLAGS=`$GPGME_CONFIG --cflags` + GPGME_GLIB_LIBS=`$GPGME_CONFIG --libs` + else + ok = no + fi + fi + fi + if test $ok = yes; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) _AM_PATH_GPGME_CONFIG_HOST_CHECK