Subject: bug#52844: closed (Re: bug#52844: missing perl not recognized properly by configure)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 28 Dec 2021 10:09:03 +0000

Your bug report

#52844: missing perl not recognized properly by configure

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
52844: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52844
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#52844: missing perl not recognized properly by configure
From: Paul Eggert <[email-masked]>
To: Serge Belyshev <[email-masked]>
Cc: [email-masked]
Date: Tue, 28 Dec 2021 02:08:22 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

On 12/27/21 23:07, Serge Belyshev wrote:

> -case $PERL in *"/missing "*) cu_have_perl=no;; esac
> +case $PERL in */missing*) cu_have_perl=no;; esac

Thanks for the bug report and suggested fix. On the whole I think it'd 
be better to address the nearby FIXME instead, so I did that by 
installing this into Gnulib:

https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=8220e0f0b5f46ff61e1d19f8a1614508fa162abd

and the attached into Coreutils. Please give it a try. In the meantime 
I'll assume this will fix the bug for you and so am boldly closing the 
bug report; if that's wrong we can reopen it.
From c7bbfeb80c4be8d55074214e98c236eed8015a15 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Tue, 28 Dec 2021 01:53:44 -0800
Subject: [PATCH 1/2] build: update gnulib submodule to latest

---
 gnulib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnulib b/gnulib
index f67a7185e..8220e0f0b 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit f67a7185e8bee0becde9a6992755d2afa1ca6531
+Subproject commit 8220e0f0b5f46ff61e1d19f8a1614508fa162abd
-- 
2.32.0

From 91042c4d1e5b7b56bf3f7ae9f4c9abc45927809d Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Tue, 28 Dec 2021 02:03:21 -0800
Subject: [PATCH 2/2] build: be more careful about Perl

Problem reported by Serge Belyshev (Bug#52844).
* configure.ac (HAVE_PERL): Rely on latest Gnulib gl_PERL, which
sets gl_cv_prog_perl.
---
 configure.ac | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9b8ea0dde..b982d7e9a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,11 +64,7 @@ gl_INIT
 coreutils_MACROS
 
 # The test suite needs to know if we have a working perl.
-# FIXME: this is suboptimal.  Ideally, we would be able to call gl_PERL
-# with an ACTION-IF-NOT-FOUND argument ...
-cu_have_perl=yes
-case $PERL in *"/missing "*) cu_have_perl=no;; esac
-AM_CONDITIONAL([HAVE_PERL], [test $cu_have_perl = yes])
+AM_CONDITIONAL([HAVE_PERL], [test "$gl_cv_prog_perl" != no])
 
 # gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found])
 # ------------------------------------------------
-- 
2.32.0

Subject: missing perl not recognized properly by configure
From: Serge Belyshev <[email-masked]>
To: [email-masked]
Date: Tue, 28 Dec 2021 10:07:51 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

On my systems without perl,  PERL is set to something like

  ${SHELL} '/usr/src/coreutils-9.0/build-aux/missing'  perl

which causes condition at line 70 in configure.ac to fail, resulting in
incorrect detection of perl and subsequent build failure. Suggested fix:

diff --git a/configure.ac b/configure.ac
index 9b8ea0dde..f6a7a6917 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,7 +67,7 @@ coreutils_MACROS
 # FIXME: this is suboptimal.  Ideally, we would be able to call gl_PERL
 # with an ACTION-IF-NOT-FOUND argument ...
 cu_have_perl=yes
-case $PERL in *"/missing "*) cu_have_perl=no;; esac
+case $PERL in */missing*) cu_have_perl=no;; esac
 AM_CONDITIONAL([HAVE_PERL], [test $cu_have_perl = yes])
 
 # gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found])