poke-devel
[Top][All Lists]
Advanced

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

Re: compilation error in VPATH build


From: Jose E. Marchesi
Subject: Re: compilation error in VPATH build
Date: Sat, 20 Feb 2021 13:46:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi Bruno.

This is also OK for master.
Thanks!

>> The cause is that I have a 3-months old pkl-gen.pkc in $(srcdir) and a
>> freshly generated one in the builddir. But the compilation picks up the
>> one in $(srcdir).
>
> The same symptom also occurs with the pvm-vm.h file:
>
> $ make
> ...
> ../libpoke/.libs/libpoke.so: undefined reference to `pvm_routine_disassemble'
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makefile:2174: poke] Error 1
>
> The cause is that there are two copies of pvm-vm.h: a new one that defines
> pvm_routine_disassemble as a macro, and an old one that doesn't.
>
> $ ll libpoke/pvm-vm*
> -rw-rw-r-- 1 bruno bruno  488789 Nov 21 20:39 libpoke/pvm-vm1.c
> -rw-rw-r-- 1 bruno bruno 2069692 Nov 21 20:39 libpoke/pvm-vm2.c
> -rw-rw-r-- 1 bruno bruno  107729 Nov 21 20:39 libpoke/pvm-vm.h
> $ ll build-64/libpoke/pvm-vm*
> -rw-rw-r-- 1 bruno bruno  520809 Feb 19 21:47 build-64/libpoke/pvm-vm1.c
> -rw-rw-r-- 1 bruno bruno 2437279 Feb 19 21:47 build-64/libpoke/pvm-vm2.c
> -rw-rw-r-- 1 bruno bruno  112382 Feb 19 21:47 build-64/libpoke/pvm-vm.h
>
> Here is a proposed patch.
>
>
>>From 7f778eb979660626d6c330832dbe22303fc643b1 Mon Sep 17 00:00:00 2001
> From: Bruno Haible <bruno@clisp.org>
> Date: Fri, 19 Feb 2021 22:38:57 +0100
> Subject: [PATCH] Fix another compilation error in a VPATH build.
>
> * libpoke/Makefile.am (pvm-vm.h pvm-vm1.c pvm-vm2.c): Generate these files in
> srcdir.
> (BUILT_SOURCES): Remove duplicates.
> ---
>  libpoke/Makefile.am | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/libpoke/Makefile.am b/libpoke/Makefile.am
> index 5644d89..fecf46d 100644
> --- a/libpoke/Makefile.am
> +++ b/libpoke/Makefile.am
> @@ -79,8 +79,7 @@ MOSTLYCLEANFILES += pkl-gen.pkc.tmp pkl-asm.pkc.tmp
>  EXTRA_DIST = pkl-tab.y pkl-lex.h ras
>  
>  BUILT_SOURCES = pkl-tab.h pkl-tab.c pkl-lex.c \
> -                pkl-gen.pkc pkl-asm.pkc \
> -                pvm-vm.h pvm-vm1.c pvm-vm2.c
> +                pkl-gen.pkc pkl-asm.pkc
>  
>  pkl-tab.h pkl-tab.c: pkl-tab.y
>       $(POKE_BISON) -d -t --report=state --output pkl-tab.c \
> @@ -126,6 +125,13 @@ libpoke_la_CPPFLAGS += $(JITTER_CPPFLAGS)
>  BUILT_SOURCES += pvm-vm.h pvm-vm1.c pvm-vm2.c
>  
>  pvm-vm.h pvm-vm1.c pvm-vm2.c: pvm.jitter
> -     $(JITTER) $(srcdir)/pvm.jitter --output $(builddir)
> +     $(JITTER) $(srcdir)/pvm.jitter --output $(builddir) \
> +     && { test $(builddir) = $(srcdir) \
> +          || { mv pvm-vm.h $(srcdir)/pvm-vm.h \
> +               && mv pvm-vm1.c $(srcdir)/pvm-vm1.c \
> +               && mv pvm-vm2.c $(srcdir)/pvm-vm2.c; \
> +             }; \
> +        } \
> +     || { rm -f pvm-vm.h pvm-vm1.c pvm-vm2.c; false; }
>  
>  # End of Makefile.am



reply via email to

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