From geoff at infradead.org Thu Sep 29 10:52:22 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:22 +0000 Subject: [PATCH v1 0/5] *** SUBJECT HERE *** Message-ID: *** BLURB HERE *** Geoff Levand (5): bootstrap: Fix warnings yacc: Fix warnings gettext: Fix error Makefile: Add 'make help' Fix build warnings. .gitignore | 3 ++ Makefile.am | 9 +++++ configure.ac | 24 +++++++------ discover/grub2/grub2-parser.y | 4 +-- discover/native/native-parser.y | 4 +-- discover/paths.c | 2 ++ discover/pxe-parser.c | 4 ++- m4/gpgme.m4 | 60 +++++++++++++++++++++++++++------ ui/ncurses/nc-plugin.c | 1 + 9 files changed, 84 insertions(+), 27 deletions(-) -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:18 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:18 +0000 Subject: [PATCH v1 3/5] gettext: Fix error In-Reply-To: References: Message-ID: Bump gettext version to 0.19. Fixes build errors like these: error: gettext infrastructure mismatch Signed-off-by: Geoff Levand --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 524a23d..53c460e 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,8 @@ AC_PROG_INSTALL AM_INIT_AUTOMAKE AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION(0.18.1) +AM_GNU_GETTEXT_VERSION(0.19) + if test "$USE_NLS" = "yes" -a -z "$($MSGFMT --version)"; then AC_MSG_ERROR([[Please install gettext]]) fi -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:20 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:20 +0000 Subject: [PATCH v1 4/5] Makefile: Add 'make help' In-Reply-To: References: Message-ID: Add a new makefile target 'make help'. Signed-off-by: Geoff Levand --- Makefile.am | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile.am b/Makefile.am index 63456ca..2c7a49e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -73,3 +73,12 @@ include man/Makefile.am include utils/Makefile.am +.PHONY: help + +help: + @echo "Targets:" + @echo " make install" + @echo " make dist" + @echo " make distcheck" + @echo " make distclean" + @echo " make maintainer-clean" -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:14 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:14 +0000 Subject: [PATCH v1 0/5] *** SUBJECT HERE *** Message-ID: Hi Jeremy, Here are a few fixups for using newer development tools. -Geoff The following changes since commit 1aded99ae2c7a49856da550ecf0b8be327398169: lib/security: Update full when generating signature url (2022-09-28 17:11:23 -0700) are available in the Git repository at: https://github.com/glevand/petitboot--petitboot.git build-fixes for you to fetch changes up to 452424632f165f07e25aaf549099d1d2e15d4eb4: Fix build warnings. (2022-09-28 21:01:19 -0700) ---------------------------------------------------------------- Geoff Levand (5): bootstrap: Fix warnings yacc: Fix warnings gettext: Fix error Makefile: Add 'make help' Fix build warnings. .gitignore | 3 +++ Makefile.am | 9 +++++++ configure.ac | 24 +++++++++-------- discover/grub2/grub2-parser.y | 4 +-- discover/native/native-parser.y | 4 +-- discover/paths.c | 2 ++ discover/pxe-parser.c | 4 ++- m4/gpgme.m4 | 60 +++++++++++++++++++++++++++++++++-------- ui/ncurses/nc-plugin.c | 1 + 9 files changed, 84 insertions(+), 27 deletions(-) -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:17 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:17 +0000 Subject: [PATCH v1 2/5] yacc: Fix warnings In-Reply-To: References: Message-ID: Fixes yacc warnings like these: warning: deprecated directive: ?%pure-parser?, use ?%define api.pure? Signed-off-by: Geoff Levand --- discover/grub2/grub2-parser.y | 4 ++-- discover/native/native-parser.y | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/discover/grub2/grub2-parser.y b/discover/grub2/grub2-parser.y index f99bbfd..3433415 100644 --- a/discover/grub2/grub2-parser.y +++ b/discover/grub2/grub2-parser.y @@ -1,9 +1,9 @@ -%pure-parser +%define api.pure %lex-param { yyscan_t scanner } %parse-param { struct grub2_parser *parser } %parse-param { void *scanner } -%error-verbose +%define parse.error verbose %{ #include diff --git a/discover/native/native-parser.y b/discover/native/native-parser.y index bafcf49..b5fe9b1 100644 --- a/discover/native/native-parser.y +++ b/discover/native/native-parser.y @@ -1,9 +1,9 @@ -%pure-parser +%define api.pure %lex-param { nscan_t scanner } %parse-param { struct native_parser *parser } %parse-param { void *scanner } -%error-verbose +%define parse.error verbose %define api.prefix {n} %{ -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:21 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:21 +0000 Subject: [PATCH v1 5/5] Fix build warnings. In-Reply-To: References: Message-ID: <452424632f165f07e25aaf549099d1d2e15d4eb4.1664412180.git.geoff@infradead.org> Fixes build warnings like these: warning: implicit declaration of function ?memmem? warning: assignment to ?char *? from ?int? makes pointer from integer without a cast Signed-off-by: Geoff Levand --- discover/paths.c | 2 ++ discover/pxe-parser.c | 4 +++- ui/ncurses/nc-plugin.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/discover/paths.c b/discover/paths.c index 3c43bf6..19674bb 100644 --- a/discover/paths.c +++ b/discover/paths.c @@ -2,6 +2,8 @@ #include "config.h" #endif +#define _GNU_SOURCE + #include #include #include diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c index 035794c..2b10771 100644 --- a/discover/pxe-parser.c +++ b/discover/pxe-parser.c @@ -1,7 +1,9 @@ - #if defined(HAVE_CONFIG_H) #include "config.h" #endif + +#define _GNU_SOURCE + #include #include diff --git a/ui/ncurses/nc-plugin.c b/ui/ncurses/nc-plugin.c index f897cc8..1152bf3 100644 --- a/ui/ncurses/nc-plugin.c +++ b/ui/ncurses/nc-plugin.c @@ -20,6 +20,7 @@ #endif #include +#include #include #include -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:16 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:16 +0000 Subject: [PATCH v1 1/5] bootstrap: Fix warnings In-Reply-To: References: Message-ID: <2e8998e2ff0bb8a49b1069219b8b99d34485a933.1664412180.git.geoff@infradead.org> 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 -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:23 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:23 +0000 Subject: [PATCH v1 1/5] bootstrap: Fix warnings In-Reply-To: References: Message-ID: <2e8998e2ff0bb8a49b1069219b8b99d34485a933.1664412375.git.geoff@infradead.org> 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 -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:29 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:29 +0000 Subject: [PATCH v1 2/5] yacc: Fix warnings In-Reply-To: References: Message-ID: Fixes yacc warnings like these: warning: deprecated directive: ?%pure-parser?, use ?%define api.pure? Signed-off-by: Geoff Levand --- discover/grub2/grub2-parser.y | 4 ++-- discover/native/native-parser.y | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/discover/grub2/grub2-parser.y b/discover/grub2/grub2-parser.y index f99bbfd..3433415 100644 --- a/discover/grub2/grub2-parser.y +++ b/discover/grub2/grub2-parser.y @@ -1,9 +1,9 @@ -%pure-parser +%define api.pure %lex-param { yyscan_t scanner } %parse-param { struct grub2_parser *parser } %parse-param { void *scanner } -%error-verbose +%define parse.error verbose %{ #include diff --git a/discover/native/native-parser.y b/discover/native/native-parser.y index bafcf49..b5fe9b1 100644 --- a/discover/native/native-parser.y +++ b/discover/native/native-parser.y @@ -1,9 +1,9 @@ -%pure-parser +%define api.pure %lex-param { nscan_t scanner } %parse-param { struct native_parser *parser } %parse-param { void *scanner } -%error-verbose +%define parse.error verbose %define api.prefix {n} %{ -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:30 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:30 +0000 Subject: [PATCH v1 3/5] gettext: Fix error In-Reply-To: References: Message-ID: Bump gettext version to 0.19. Fixes build errors like these: error: gettext infrastructure mismatch Signed-off-by: Geoff Levand --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 524a23d..53c460e 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,8 @@ AC_PROG_INSTALL AM_INIT_AUTOMAKE AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION(0.18.1) +AM_GNU_GETTEXT_VERSION(0.19) + if test "$USE_NLS" = "yes" -a -z "$($MSGFMT --version)"; then AC_MSG_ERROR([[Please install gettext]]) fi -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:31 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:31 +0000 Subject: [PATCH v1 5/5] Fix build warnings. In-Reply-To: References: Message-ID: <452424632f165f07e25aaf549099d1d2e15d4eb4.1664412375.git.geoff@infradead.org> Fixes build warnings like these: warning: implicit declaration of function ?memmem? warning: assignment to ?char *? from ?int? makes pointer from integer without a cast Signed-off-by: Geoff Levand --- discover/paths.c | 2 ++ discover/pxe-parser.c | 4 +++- ui/ncurses/nc-plugin.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/discover/paths.c b/discover/paths.c index 3c43bf6..19674bb 100644 --- a/discover/paths.c +++ b/discover/paths.c @@ -2,6 +2,8 @@ #include "config.h" #endif +#define _GNU_SOURCE + #include #include #include diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c index 035794c..2b10771 100644 --- a/discover/pxe-parser.c +++ b/discover/pxe-parser.c @@ -1,7 +1,9 @@ - #if defined(HAVE_CONFIG_H) #include "config.h" #endif + +#define _GNU_SOURCE + #include #include diff --git a/ui/ncurses/nc-plugin.c b/ui/ncurses/nc-plugin.c index f897cc8..1152bf3 100644 --- a/ui/ncurses/nc-plugin.c +++ b/ui/ncurses/nc-plugin.c @@ -20,6 +20,7 @@ #endif #include +#include #include #include -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:31 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:31 +0000 Subject: [PATCH v1 0/5] *** SUBJECT HERE *** Message-ID: *** BLURB HERE *** Geoff Levand (5): bootstrap: Fix warnings yacc: Fix warnings gettext: Fix error Makefile: Add 'make help' Fix build warnings. .gitignore | 3 ++ Makefile.am | 9 +++++ configure.ac | 24 +++++++------ discover/grub2/grub2-parser.y | 4 +-- discover/native/native-parser.y | 4 +-- discover/paths.c | 2 ++ discover/pxe-parser.c | 4 ++- m4/gpgme.m4 | 60 +++++++++++++++++++++++++++------ ui/ncurses/nc-plugin.c | 1 + 9 files changed, 84 insertions(+), 27 deletions(-) -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:30 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:30 +0000 Subject: [PATCH v1 4/5] Makefile: Add 'make help' In-Reply-To: References: Message-ID: Add a new makefile target 'make help'. Signed-off-by: Geoff Levand --- Makefile.am | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile.am b/Makefile.am index 63456ca..2c7a49e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -73,3 +73,12 @@ include man/Makefile.am include utils/Makefile.am +.PHONY: help + +help: + @echo "Targets:" + @echo " make install" + @echo " make dist" + @echo " make distcheck" + @echo " make distclean" + @echo " make maintainer-clean" -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:32 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:32 +0000 Subject: [PATCH v1 1/5] bootstrap: Fix warnings In-Reply-To: References: Message-ID: <2e8998e2ff0bb8a49b1069219b8b99d34485a933.1664412495.git.geoff@infradead.org> 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 -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:33 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:33 +0000 Subject: [PATCH v1 3/5] gettext: Fix error In-Reply-To: References: Message-ID: Bump gettext version to 0.19. Fixes build errors like these: error: gettext infrastructure mismatch Signed-off-by: Geoff Levand --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 524a23d..53c460e 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,8 @@ AC_PROG_INSTALL AM_INIT_AUTOMAKE AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION(0.18.1) +AM_GNU_GETTEXT_VERSION(0.19) + if test "$USE_NLS" = "yes" -a -z "$($MSGFMT --version)"; then AC_MSG_ERROR([[Please install gettext]]) fi -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:32 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:32 +0000 Subject: [PATCH v1 2/5] yacc: Fix warnings In-Reply-To: References: Message-ID: Fixes yacc warnings like these: warning: deprecated directive: ?%pure-parser?, use ?%define api.pure? Signed-off-by: Geoff Levand --- discover/grub2/grub2-parser.y | 4 ++-- discover/native/native-parser.y | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/discover/grub2/grub2-parser.y b/discover/grub2/grub2-parser.y index f99bbfd..3433415 100644 --- a/discover/grub2/grub2-parser.y +++ b/discover/grub2/grub2-parser.y @@ -1,9 +1,9 @@ -%pure-parser +%define api.pure %lex-param { yyscan_t scanner } %parse-param { struct grub2_parser *parser } %parse-param { void *scanner } -%error-verbose +%define parse.error verbose %{ #include diff --git a/discover/native/native-parser.y b/discover/native/native-parser.y index bafcf49..b5fe9b1 100644 --- a/discover/native/native-parser.y +++ b/discover/native/native-parser.y @@ -1,9 +1,9 @@ -%pure-parser +%define api.pure %lex-param { nscan_t scanner } %parse-param { struct native_parser *parser } %parse-param { void *scanner } -%error-verbose +%define parse.error verbose %define api.prefix {n} %{ -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:35 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:35 +0000 Subject: [PATCH v1 4/5] Makefile: Add 'make help' In-Reply-To: References: Message-ID: Add a new makefile target 'make help'. Signed-off-by: Geoff Levand --- Makefile.am | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile.am b/Makefile.am index 63456ca..2c7a49e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -73,3 +73,12 @@ include man/Makefile.am include utils/Makefile.am +.PHONY: help + +help: + @echo "Targets:" + @echo " make install" + @echo " make dist" + @echo " make distcheck" + @echo " make distclean" + @echo " make maintainer-clean" -- 2.34.1 From geoff at infradead.org Thu Sep 29 10:52:35 2022 From: geoff at infradead.org (Geoff Levand) Date: Thu, 29 Sep 2022 00:52:35 +0000 Subject: [PATCH v1 5/5] Fix build warnings. In-Reply-To: References: Message-ID: <452424632f165f07e25aaf549099d1d2e15d4eb4.1664412495.git.geoff@infradead.org> Fixes build warnings like these: warning: implicit declaration of function ?memmem? warning: assignment to ?char *? from ?int? makes pointer from integer without a cast Signed-off-by: Geoff Levand --- discover/paths.c | 2 ++ discover/pxe-parser.c | 4 +++- ui/ncurses/nc-plugin.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/discover/paths.c b/discover/paths.c index 3c43bf6..19674bb 100644 --- a/discover/paths.c +++ b/discover/paths.c @@ -2,6 +2,8 @@ #include "config.h" #endif +#define _GNU_SOURCE + #include #include #include diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c index 035794c..2b10771 100644 --- a/discover/pxe-parser.c +++ b/discover/pxe-parser.c @@ -1,7 +1,9 @@ - #if defined(HAVE_CONFIG_H) #include "config.h" #endif + +#define _GNU_SOURCE + #include #include diff --git a/ui/ncurses/nc-plugin.c b/ui/ncurses/nc-plugin.c index f897cc8..1152bf3 100644 --- a/ui/ncurses/nc-plugin.c +++ b/ui/ncurses/nc-plugin.c @@ -20,6 +20,7 @@ #endif #include +#include #include #include -- 2.34.1