Re: adapting relocatable-prog to non-recursive make

2022-03-24 Thread Ben Pfaff
Does the patch I mentioned earlier make sense?



Re: adapting relocatable-prog to non-recursive make

2022-03-13 Thread Ben Pfaff
On Sun, Mar 13, 2022 at 3:44 PM Bruno Haible  wrote:
>
> Hi Ben,
>
> > When I try to use the Gnulib relocatable-prog module with a program
> > that has an uninstall-hook, Automake gives a warning like this:
> >
> > po/automake.mk:97: warning: uninstall-hook was already defined in
> > condition RELOCATABLE_VIA_WRAPPER, which is included in condition TRUE
> > ...
> > Makefile.am:84:   'po/automake.mk' included from here
> > gl/automake.mk:2187: ... 'uninstall-hook' previously defined here
> > Makefile.am:83:   'gl/automake.mk' included from here
> > Makefile.am:105: warning: uninstall-hook was already defined in
> > condition RELOCATABLE_VIA_WRAPPER, which is included in condition TRUE
> > ...
> > gl/automake.mk:2187: ... 'uninstall-hook' previously defined here
> > Makefile.am:83:   'gl/automake.mk' included from here
>
> What do these two Makefiles look like:
> 1) po/automake.mk around line 97 ?
> 2) gl/automake.mk around line 2187 ?

This is GNU PSPP, tip of master. If you download a configured source
snapshot from
https://benpfaff.org/~blp/pspp-master/20220313140713/source/pspp-1.5.3-g75c0ae.tar.gz
and then run "automake", you can see the messages (line numbers have
changed a little
because I've been doing work):

po/automake.mk:97: warning: uninstall-hook was already defined in
condition RELOCATABLE_
VIA_WRAPPER, which is included in condition TRUE ...
Makefile.am:82:   'po/automake.mk' included from here
gl/automake.mk:2187: ... 'uninstall-hook' previously defined here
Makefile.am:81:   'gl/automake.mk' included from here
Makefile.am:103: warning: uninstall-hook was already defined in
condition RELOCATABLE_VI
A_WRAPPER, which is included in condition TRUE ...
gl/automake.mk:2187: ... 'uninstall-hook' previously defined here
Makefile.am:81:   'gl/automake.mk' included from here

and then po/automake.mk starting from line 97 is:

uninstall-hook: uninstall-gmofiles
uninstall-gmofiles:
   for f in $(GMOFILES); do \
 lang=`echo $$f | $(SED) -e 's%po/\(.*\)\.gmo%\1%' ` ; \
 rm -f $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo
; \
   done
.PHONY: uninstall-gmofiles

and the relevant part of gl/automake.mk is:

if RELOCATABLE_VIA_WRAPPER
uninstall-hook: uninstall-relocwrapper
uninstall-relocwrapper:
   if test $(RELOCATABLE) = yes; then \
 case '$(EXEEXT)' in \
   .bin*) ;; \
   *) cd $(top_builddir) && \
  $(MAKE) $(AM_MAKEFLAGS) EXEEXT=.bin$(EXEEXT) \
  AM_MAKEFLAGS='$(AM_MAKEFLAGS) EXEEXT=.bin$(EXEEXT)' \
  uninstall ;; \
 esac; \
   fi
endif
## Automake warns about conditionally added dependencies to
unconditionally defined targ
ets.
.PHONY: uninstall-relocwrapper

Oh, also Makefile.am at line 103 is:

uninstall-hook: $(UNINSTALL_DATA_HOOKS)

Thanks,

Ben.



Re: adapting relocatable-prog to non-recursive make

2022-03-13 Thread Bruno Haible
Hi Ben,

> When I try to use the Gnulib relocatable-prog module with a program
> that has an uninstall-hook, Automake gives a warning like this:
> 
> po/automake.mk:97: warning: uninstall-hook was already defined in
> condition RELOCATABLE_VIA_WRAPPER, which is included in condition TRUE
> ...
> Makefile.am:84:   'po/automake.mk' included from here
> gl/automake.mk:2187: ... 'uninstall-hook' previously defined here
> Makefile.am:83:   'gl/automake.mk' included from here
> Makefile.am:105: warning: uninstall-hook was already defined in
> condition RELOCATABLE_VIA_WRAPPER, which is included in condition TRUE
> ...
> gl/automake.mk:2187: ... 'uninstall-hook' previously defined here
> Makefile.am:83:   'gl/automake.mk' included from here

What do these two Makefiles look like:
1) po/automake.mk around line 97 ?
2) gl/automake.mk around line 2187 ?

Bruno






adapting relocatable-prog to non-recursive make

2022-03-13 Thread Ben Pfaff
When I try to use the Gnulib relocatable-prog module with a program
that has an uninstall-hook, Automake gives a warning like this:

po/automake.mk:97: warning: uninstall-hook was already defined in
condition RELOCATABLE_VIA_WRAPPER, which is included in condition TRUE
...
Makefile.am:84:   'po/automake.mk' included from here
gl/automake.mk:2187: ... 'uninstall-hook' previously defined here
Makefile.am:83:   'gl/automake.mk' included from here
Makefile.am:105: warning: uninstall-hook was already defined in
condition RELOCATABLE_VIA_WRAPPER, which is included in condition TRUE
...
gl/automake.mk:2187: ... 'uninstall-hook' previously defined here
Makefile.am:83:   'gl/automake.mk' included from here

It appears that applying a patch similar to the following in Gnulib
will fix the problem. I am not confident about it and could use advice
or assistance.

diff --git a/modules/relocatable-prog b/modules/relocatable-prog
index 8e22b20dd0..bb4bc7ce9f 100644
--- a/modules/relocatable-prog
+++ b/modules/relocatable-prog
@@ -38,8 +38,8 @@ if GL_COND_OBJ_PROGRELOC
 lib_SOURCES += progreloc.c
 endif
 DEFS += -DEXEEXT=\"@EXEEXT@\"
-if RELOCATABLE_VIA_WRAPPER
 uninstall-hook: uninstall-relocwrapper
+if RELOCATABLE_VIA_WRAPPER
 uninstall-relocwrapper:
 if test $(RELOCATABLE) = yes; then \
   case '$(EXEEXT)' in \
@@ -50,8 +50,10 @@ uninstall-relocwrapper:
uninstall ;; \
   esac; \
 fi
+else
+uninstall-relocwrapper:
+@# Nothing to do.
 endif
-## Automake warns about conditionally added dependencies to
unconditionally defined targets.
 .PHONY: uninstall-relocwrapper

 Include:


 Include:

Thanks,

Ben.