From 399603fd952aa74793a59e27edb3867b8e7dceb8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 26 Mar 2019 20:59:31 +0000 Subject: [PATCH] Counterbodge a bodgy warning from 'aclocal'. For ages, when rebuilding the configure script, I've had the mysterious warning "configure.ac:120: warning: macro 'AM_PATH_GTK' not found in library". The reason it was mysterious was that that use of AM_PATH_GTK was inside an ifdef that checked whether it was defined, and it actually wasn't being run! Turns out the warning comes from 'aclocal', which is a Perl script that (among other things) does bodgy text-matching to detect unsupported autoconf/automake macros in your configure script. The warning comes from the function scan_configure_dep() in that file, as of aclocal-1.15. And, indeed, it ignores the ifdef structure, so it doesn't notice that I've carefully guarded the use of that possibly- undefined macro! (Though a comment in aclocal does acknowledge the possibility, which is why it's only a warning.) Against that bodgy and unreliable check, I've deployed an equally bodgy and unreliable countermeasure, by changing the line spacing so that AM_PATH_GTK appears in a context (specifically, not immediately following a newline or space) where the regex will be confident that it's a macro invocation. So that should squelch the warning. --- configure.ac | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 3d9c6873..6d94f041 100644 --- a/configure.ac +++ b/configure.ac @@ -100,25 +100,21 @@ gtk=none case "$gtk_version_desired:$gtk" in 3:none | any:none) - ifdef([AM_PATH_GTK_3_0],[ - AM_PATH_GTK_3_0([3.0.0], [gtk=3], []) - ],[AC_WARNING([generating configure script without GTK 3 autodetection])]) + ifdef([AM_PATH_GTK_3_0],[AM_PATH_GTK_3_0([3.0.0], [gtk=3], [])], + [AC_WARNING([generating configure script without GTK 3 autodetection])]) ;; esac case "$gtk_version_desired:$gtk" in 2:none | any:none) - ifdef([AM_PATH_GTK_2_0],[ - AM_PATH_GTK_2_0([2.0.0], [gtk=2], []) - ],[AC_WARNING([generating configure script without GTK 2 autodetection])]) + ifdef([AM_PATH_GTK_2_0],[AM_PATH_GTK_2_0([2.0.0], [gtk=2], [])], + [AC_WARNING([generating configure script without GTK 2 autodetection])]) ;; esac case "$gtk_version_desired:$gtk" in 1:none | any:none) - ifdef([AM_PATH_GTK],[ - AM_PATH_GTK([1.2.0], [gtk=1], []) - ],[ + ifdef([AM_PATH_GTK],[AM_PATH_GTK([1.2.0], [gtk=1], [])],[ # manual check for gtk1 AC_PATH_PROG(GTK1_CONFIG, gtk-config, absent) if test "$GTK1_CONFIG" != "absent"; then