URL:
  <https://savannah.gnu.org/support/?111140>

                 Summary: autoscan gets confused by Makefile rules that start
with '-' to ignore errors
                   Group: Autoconf
               Submitter: egallager
               Submitted: Sun 20 Oct 2024 12:51:01 AM UTC
                Priority: 5 - Unprioritized
                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: Sun 20 Oct 2024 12:51:01 AM UTC By: Eric Gallager <egallager>
Make has a feature where starting a line with a tab and a minus sign will
ignore errors on that line:
https://www.gnu.org/software/make/manual/html_node/Errors.html
However, if the command whose errors are meant to be ignored starts with an
"l", `autoscan` will think it's a library that the user is trying to link
with, and thus needs to be checked. Say I have the following Makefile in a
directory:

$ cat Makefile
symlinks:
        -ln -s foo bar
$

If I then run `autoscan`, it will produce a `configure.scan` file that looks
like this:

$ cat configure.scan
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.72])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])

# Checks for programs.

# Checks for libraries.
# FIXME: Replace 'main' with a function in '-ln':
AC_CHECK_LIB([n], [main])

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

However, there is no actual "libn" that needs to be linked with, so `autoscan`
shouldn't suggest checking for it. I think a decent heuristic to tell these
apart would be that if a "-l" sequence in a Makefile is preceded by a tab
immediately following the start of a line, it's probably a command rather than
a library.








    _______________________________________________________

Reply to this item at:

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

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to