Re: gprolog DESTDIR and optional install directories

Daniel Diaz <[email protected]> Tue, 20 Jul 2021 09:20:26 +0200
Newsgroups gmane.comp.gnu.prolog.bugs
Message-ID <[email protected]>
--Apple-Mail=_57093A7D-B3F1-4E9D-AD9A-8AED578440D0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hi Keri,

Thank you very muck for detailed reports and the patches. I'll check =
them for inclusion in the next release.

Daniel


> Le 10 juil. 2021 =C3=A0 14:55, Keri Harris <[email protected]> a =C3=A9cri=
t :
>=20
> Hi
>=20
> I ran into the following issue when installing gprolog-1.5.0 when =
DESTDIR is set:
>=20
> In src/Makefile.in the target install directories are defined such =
that DESTDIR is respected:
>=20
> INSTALL_DIR    =3D $(DESTDIR)@INSTALL_DIR@
> LINKS_DIR      =3D $(DESTDIR)@LINKS_DIR@
> DOC_DIR        =3D $(DESTDIR)@DOC_DIR@
> HTML_DIR       =3D $(DESTDIR)@HTML_DIR@
> EXAMPLES_DIR   =3D $(DESTDIR)@EXAMPLES_DIR@
>=20
> So far so good. However, there are special checks in the Makefile to =
see if these destination directories are disabled by way of them being =
set to "none", e.g:
>=20
>     if test $(LINKS_DIR) !=3D none; then ...
>     if test $(DOC_DIR) !=3D none; then ...
>     if test $(HTML_DIR) !=3D none; then ...
>     if test $(EXAMPLES_DIR) !=3D none; then ...
>=20
> If DESTDIR is set, then the above comparisons will always succeed even =
if the the configure script has set the directories to none. In this =
case we are comparing "$(DESTDIR)none" vs "none".
>=20
> There are two ways of addressing this:
>=20
> 1. compare against $(DESTDIR)none. e.g:
>=20
>     if test $(LINKS_DIR) !=3D $(DESTDIR)none; then ...
>=20
> 2. compare the directories without DESTDIR against none. e.g:
>=20
>     if test @LINKS_DIR@ !=3D none; then ...
>=20
>=20
> I've attached a patch I'm using on Gentoo Linux. (The patch applies =
cleanly on top of the gprolog-1.5.0-links.patch [1]).
>=20
>=20
> Thanks
>=20
> Keri
>=20
> [1] https://mail.gnu.org/archive/html/bug-prolog/2021-07/msg00001.html =
<https://mail.gnu.org/archive/html/bug-prolog/2021-07/msg00001.html>
> <gprolog-1.5.0-destdir.patch>


--Apple-Mail=_57093A7D-B3F1-4E9D-AD9A-8AED578440D0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">Hi =
Keri,<div class=3D""><br class=3D""></div><div class=3D"">Thank you very =
muck for detailed reports and the patches. I'll check them for inclusion =
in the next release.</div><div class=3D""><br class=3D""></div><div =
class=3D"">Daniel</div><div class=3D""><br class=3D""><div><br =
class=3D""><blockquote type=3D"cite" class=3D""><div class=3D"">Le 10 =
juil. 2021 =C3=A0 14:55, Keri Harris &lt;<a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a>&gt; a =
=C3=A9crit :</div><br class=3D"Apple-interchange-newline"><div =
class=3D""><div style=3D"text-align:left; direction:ltr;" class=3D""><div =
class=3D"">Hi</div><div class=3D""><br class=3D""></div><div class=3D"">I =
ran into the following issue when installing gprolog-1.5.0 when DESTDIR =
is set:</div><div class=3D""><br class=3D"">In src/<a =
href=3D"http://Makefile.in" class=3D"">Makefile.in</a> the target =
install directories are defined such that DESTDIR is respected:<br =
class=3D""><br class=3D""></div><div =
class=3D"">INSTALL_DIR&nbsp;&nbsp;&nbsp;&nbsp;=3D =
$(DESTDIR)@INSTALL_DIR@</div><div =
class=3D"">LINKS_DIR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=3D =
$(DESTDIR)@LINKS_DIR@</div><div =
class=3D"">DOC_DIR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=3D =
$(DESTDIR)@DOC_DIR@</div><div =
class=3D"">HTML_DIR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=3D =
$(DESTDIR)@HTML_DIR@</div><div class=3D"">EXAMPLES_DIR&nbsp;&nbsp;&nbsp;=3D=
 $(DESTDIR)@EXAMPLES_DIR@</div><div class=3D""><br class=3D""></div><div =
class=3D"">So far so good. However, there are special checks in the =
Makefile to see if these destination directories are disabled by way of =
them being set to "none", e.g:</div><div class=3D""><br =
class=3D""></div><div class=3D"">&nbsp; &nbsp;&nbsp;if test $(LINKS_DIR) =
!=3D none; then ...</div><div class=3D""><div class=3D"">&nbsp; &nbsp; =
if test $(DOC_DIR) !=3D none; then ...</div><div class=3D""><div =
class=3D"">&nbsp; &nbsp; if test $(HTML_DIR) !=3D none; then =
...</div></div><div class=3D""><div class=3D"">&nbsp; &nbsp; if test =
$(EXAMPLES_DIR) !=3D none; then ...</div></div><div class=3D""><br =
class=3D""></div></div><div class=3D"">If DESTDIR is set, then the above =
comparisons will always succeed even if the the configure script has set =
the directories to none. In this case we are comparing "$(DESTDIR)none" =
vs "none".</div><div class=3D""><br class=3D""></div><div class=3D"">There=
 are two ways of addressing this:<br class=3D""><br class=3D""></div><div =
class=3D"">1. compare against $(DESTDIR)none. e.g:</div><div =
class=3D""><br class=3D""></div><div class=3D""><div class=3D"">&nbsp; =
&nbsp; if test $(LINKS_DIR) !=3D $(DESTDIR)none; then ...</div><div =
class=3D""></div></div><div class=3D""><br class=3D""></div><div =
class=3D"">2. compare the directories without DESTDIR against none. =
e.g:</div><div class=3D""><br class=3D""></div><div class=3D""><div =
class=3D""><div class=3D"">&nbsp; &nbsp; if test @LINKS_DIR@ !=3D none; =
then ...</div><div class=3D""></div></div></div><div class=3D""><br =
class=3D""></div><div class=3D""><br class=3D""></div><div class=3D"">I've=
 attached a patch I'm using on Gentoo Linux. (The patch applies cleanly =
on top of the gprolog-1.5.0-links.patch [1]).</div><div class=3D""><br =
class=3D""></div><div class=3D""><br class=3D""></div><div =
class=3D"">Thanks</div><div class=3D""><br class=3D""></div><div =
class=3D"">Keri</div><div class=3D""><br class=3D""></div><div =
class=3D"">[1]&nbsp;<a =
href=3D"https://mail.gnu.org/archive/html/bug-prolog/2021-07/msg00001.html=
" =
class=3D"">https://mail.gnu.org/archive/html/bug-prolog/2021-07/msg00001.h=
tml</a></div><div class=3D""></div><div class=3D""></div></div>
<span =
id=3D"cid:94FD1C44-2DE5-4F42-8FF3-1CE9266D2EFE">&lt;gprolog-1.5.0-destdir.=
patch&gt;</span></div></blockquote></div><br =
class=3D""></div></body></html>=

--Apple-Mail=_57093A7D-B3F1-4E9D-AD9A-8AED578440D0--