GNU bug report logs - #70557
Fix compilation of Vala files conditionally added to _SOURCES

Previous Next

Package: automake;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Wed, 24 Apr 2024 20:59:06 UTC

Severity: normal

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Karl Berry <karl <at> freefriends.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#70557: closed (Fix compilation of Vala files conditionally
 added to _SOURCES)
Date: Mon, 06 May 2024 15:18:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 6 May 2024 09:17:01 -0600
with message-id <202405061517.446FH1HW022217 <at> freefriends.org>
and subject line Re: bug#70557: Fix compilation of Vala files conditionally added to _SOURCES
has caused the debbugs.gnu.org bug report #70557,
regarding Fix compilation of Vala files conditionally added to _SOURCES
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
70557: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70557
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Reuben Thomas <rrt <at> sc3d.org>
To: bug-automake <bug-automake <at> gnu.org>
Subject: Fix compilation of Vala files conditionally added to _SOURCES
Date: Wed, 24 Apr 2024 22:57:17 +0200
[Message part 3 (text/plain, inline)]
I attach two patches. The first is a trivial documentation fix. The second
fixes a bug I ran into recently with Vala compilation.

I just needed to add some Vala source files to my program that are added to
the relevant _SOURCES variable conditionally:

if OS_WIN32
libenchant_la_SOURCES += api-windows.vala
else
libenchant_la_SOURCES += api-posix.vala
endif

(Motivation: the reason I have to add the files conditionally is two-fold:
first, api-windows.vala and api-posix.vala call APIs that are only
available on Windows and POSIX systems respectively. In itself, this does
not require conditional inclusion; I can use Vala preprocessor directives,
just as I would in C. But the Vala compiler generates C files, and I want
the user of my package not to need a Vala compiler. Therefore, the
generated C code must be independent of build-time configuration. Since the
Vala compiler does not generate C preprocessor directives, I have to do
conditional inclusion at build time some other way. So, I am doing it by
using automake conditionals.)

With current automake, something like the following Makefile line is
generated:

$(builddir)/libenchant_la_vala.stamp: api-windows.vala api-posix.vala…

With my patch, the following line is generated instead:

$(builddir)/libenchant_la_vala.stamp: $(libenchant_la_SOURCES)

Of course, $(libenchant_la_SOURCES) expands to the actual sources.

The patch is trivial, so hopefully it's obvious if there's a problem for
some reason! I hope I explained well enough what problem I'm trying to
solve.

-- 
https://rrt.sc3d.org
[Message part 4 (text/html, inline)]
[0002-vala-do-not-build-Vala-sources-excluded-by-automake-.patch (text/x-patch, attachment)]
[0001-doc-add-missing-close-parenthesis-in-comment.patch (text/x-patch, attachment)]
[Message part 7 (message/rfc822, inline)]
From: Karl Berry <karl <at> freefriends.org>
To: rrt <at> sc3d.org
Cc: 70557 <at> debbugs.gnu.org
Subject: Re: bug#70557: Fix compilation of Vala files conditionally added to
 _SOURCES
Date: Mon, 6 May 2024 09:17:01 -0600
Thanks for the Vala doc patch, Reuben. Installed and closing. --best, karl.


This bug report was last modified 1 year and 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.