Subject: Re: bug#19964: automake fails if files named“install.sh” and“install-sh” are found in the parent directory

From: Karl Berry <[email-masked]>
Date: Mon, 24 Feb 2025 16:35:16 -0700

Hi Florent - you sent in a report about automake gratuitously finding
install.sh in a parent directory back in 2015 (!). Sorry.

    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19964

    You probably have reasons to look in .. or ../.. (and I would be
    quite interested to hear them, actually), 

According to the autoconf manual (AC_CONFIG_AUX_DIR is an autoconf
directive, not automake):

  For convenience when working with subdirectories with their own
  configure scripts (*note Subdirectories::), if the scripts are not in
  `SRCDIR' it will also look in `SRCDIR/..'  and `SRCDIR/../..'

Personally I find this less than compelling as an argument, but it's
been that way forever and it would cause much too big a compatibility
problem to change it now, IMHO. (Though I am not the autoconf maintainer.)

Anyway, back on your report:

       err_am "'install.sh' is an anachronism; use 'install-sh' instead"
         if -f $config_aux_dir . '/install.sh';

    ... I don't think it should fail in the specific case I described above.

I agree. I changed the error to a warning. The presence of a stray
install.sh file hardly seems fatal.

    hard for me to understand which ``install.sh'' file this error was
    talking about

Yes, that must have been frustrating. I also changed the message to
include the full location of the install.sh that was found.

Thanks for the report, and finding the spot in the code. Closing this
bug now, but feel free to reply/reopen or open a new issue if
desired. --thanks, karl.

-----------------------------------------------------------------------------
automake: warn about install.sh being found, rather than error.

Report from https://bugs.gnu.org/19964.

* bin/automake.in (scan_autoconf_files): give a msg 'obsolete'
rather than err_am. Mention where install.sh was found.
(En passant, fix some doubled words.)
* NEWS: mention this.
diff --git a/NEWS b/NEWS
index d06de78fd..9c1b56851 100644
--- a/NEWS
+++ b/NEWS
@@ -41,10 +41,13 @@ New in 1.x:
   - The compile script is more robust to Windows configurations;
     specifically, avoiding double-path translation on MSYS. (bug#75939)

+  - Only warn about install.sh being found, instead of it being a fatal
+    error. (bug#19964)
+
   - AM_SILENT_RULES once again always ends with a newline. (bug#72267)

diff --git a/bin/automake.in b/bin/automake.in
index 70c512af2..a92b02e06 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -5668,8 +5668,15 @@ sub scan_autoconf_files ()
     {
       require_conf_file ($required_aux_file{$file}->get, FOREIGN, $file)
     }
-  err_am "'install.sh' is an anachronism; use 'install-sh' instead"
-    if -f $config_aux_dir . '/install.sh';
+  
+  my $auxdir_install_dot_sh = "$config_aux_dir/install.sh";
+  # Maybe there is a way to report the line number of the
+  # AC_CONFIG_AUX_DIR call in configure.ac? Don't know.
+  msg 'obsolete', "$configure_ac", "'install.sh' is an anachronism\n"
+                                 . "  (found in $auxdir_install_dot_sh,\n"
+                                 . "   defined by AC_CONFIG_AUX_DIR);\n"
+                                 . "  use 'install-sh' instead"
+    if -f $auxdir_install_dot_sh;

compile finished at Mon Feb 24 15:33:37 2025