[sr #110886] autoupdate produces broken configure.ac

Maxim Cournoyer <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
URL:
  <https://savannah.gnu.org/support/?110886>

                 Summary: autoupdate produces broken configure.ac
                   Group: Autoconf
               Submitter: apteryx
               Submitted: Wed 14 Jun 2023 09:41:53 PM EDT
                Category: None
                Priority: 5 - Normal
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Wed 14 Jun 2023 09:41:53 PM EDT By: Maxim Cournoyer <apteryx>
Hi,

I've been trying to use autoupdate on the wxWidgets project [0]

[0]  https://github.com/wxWidgets/wxWidgets

It's a good test, being a 8k lines file apparently last updated for Autoconf
2.59.

After fixing a couple of quoting problems with the help of Alfred (ams), I was
able to have it run once happily.  The problem is that the output it produces
then trips it when running again; in other words, it produces a broken
configure.ac file.

It seems the problem has to do with the _au_m4_changequote([,]) it generates,
that are placed before nested AC_TRY_COMPILE or AC_TRY_LINK usages.

Attaches are the Git patches of my debugging session and recorded observations
/ edits.  They can be applied to wxWidgets at commit
1093bb492bc90531162490ba1711f9dba09f59e0.

Here's the first hunk of the recorded 'autoupdate broken substitutions', for
example:

modified   configure.in
@@ -1407,12 +1407,10 @@ dnl This case is for OS X vs. everything else
 case "${host}" in
   *-*-darwin* )
     AC_MSG_CHECKING([if CoreFoundation/CFBase.h is usable])
-    AC_TRY_COMPILE([#include <CoreFoundation/CFBase.h>
-],[],
-        [AC_MSG_RESULT([yes])],
-        [AC_MSG_RESULT([no])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <CoreFoundation/CFBase.h>
+]], [[]])],[AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])
         AC_MSG_CHECKING([if __CF_USE_FRAMEWORK_INCLUDES__ is required])
-        AC_TRY_COMPILE([#define __CF_USE_FRAMEWORK_INCLUDES__
+        _au_m4_changequote([,])AC_TRY_COMPILE([#define
__CF_USE_FRAMEWORK_INCLUDES__
 #include <CoreFoundation/CFBase.h>
         ],[],
         [AC_MSG_RESULT([yes])
@@ -1421,8 +1419,8 @@ case "${host}" in
         CPPFLAGS="-D__CF_USE_FRAMEWORK_INCLUDES__ $CPPFLAGS"],
         [AC_MSG_FAILURE([no.  CoreFoundation not available.])]
         )
-        ]
-    )
+        
+    ])
   ;;
 esac

You can replay the patches on the mentioned wxWidgets commit above and see for
yourself.  My testing was done using Autoconf 2.71 from GNU Guix at commit
3fc26c6dc4b6bbf558a17b5e3ef8092ea0eeeacd.

I hope that my report is actionable!  Thank you for maintaining this important
(and probably a bit hairy at places) tool.







    _______________________________________________________
File Attachments:


-------------------------------------------------------
Date: Wed 14 Jun 2023 09:41:53 PM EDT  Name:
0001-build-Properly-quote-else-clause-of-AC_TRY_COMPILE.patch  Size: 2KiB  
By: apteryx

<http://savannah.gnu.org/support/download.php?file_id=54836>
-------------------------------------------------------
Date: Wed 14 Jun 2023 09:41:53 PM EDT  Name:
0002-configure.in-Fix-more-quoting-problems.patch  Size: 6KiB   By: apteryx

<http://savannah.gnu.org/support/download.php?file_id=54837>
-------------------------------------------------------
Date: Wed 14 Jun 2023 09:41:53 PM EDT  Name:
0003-autoupdate-valid-substitutions.patch  Size: 38KiB   By: apteryx

<http://savannah.gnu.org/support/download.php?file_id=54838>
-------------------------------------------------------
Date: Wed 14 Jun 2023 09:41:53 PM EDT  Name:
0004-autoupdate-broken-substitutions.patch  Size: 11KiB   By: apteryx

<http://savannah.gnu.org/support/download.php?file_id=54839>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110886>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.