bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] src: make path to m4 relocatable


From: Akim Demaille
Subject: Re: [PATCH] src: make path to m4 relocatable
Date: Tue, 19 May 2020 08:14:07 +0200

Hi Thomas,

> Le 18 mai 2020 à 08:23, Thomas Petazzoni <address@hidden> a écrit :
> 
> Commit a4ede8f85b0c9a254fcb01e5888cee1983095669 ("package: make bison
> a relocatable package") made Bison relocatable, but in fact it still
> contains one absolute reference: the M4 variable, which points to the
> M4 program. Let's fix that by using relocate().

Good point.


The patch is not right though: you are *forced* to have relocated m4 for
this patch to work: if you moved only your install tree of bison, it looks
for m4 there.

You should check that a relocated m4 is available, and then fallback to
M4 again.

You also have minor stylistic issues.

diff --git a/src/files.c b/src/files.c
index b8b43230..98547571 100644
--- a/src/files.c
+++ b/src/files.c
@@ -424,8 +424,8 @@ pkgdatadir (void)
 char const *
 m4path (void)
 {
-  char const *m4 = getenv("M4");
-  return m4 ? m4 : relocate(M4);
+  char const *m4 = getenv ("M4");
+  return m4 ? m4 : relocate (M4);
 }
 
 void



Cheers!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]