[vlc-devel] [PATCH] libvlc/core: Use a revision.h in build dir instead of .c file

Marvin Scholz epirat07 at gmail.com
Fri Jun 21 13:38:58 CEST 2019


On 21 Jun 2019, at 13:31, Rémi Denis-Courmont wrote:

> Hi,
>
> This looks like it'll cause too eager dependencies and too systematic 
> rebuild of libvlc{,core}. I think we used to do something similar and 
> purposefully stopped.

I tried that and it seemed to be fine, as it would only actually change
the revision.h when the revision changes. So it didn't rebuilt the files 
that
depend on revision.h when the revision was unchanged.

Although maybe I overlooked some edgecase… Did you get it to rebuild 
unnecessarily
with the patch applied, if yes I would be very interested in the verbose 
make
output of that.

>
> Le 21 juin 2019 00:33:17 GMT+02:00, Marvin Scholz <epirat07 at gmail.com> 
> a écrit :
>> Instead of generating the revision.c file in the source tree
>> and including the c file in lib/core.c, generate a .h file in the
>> build dir and include that instead.
>> ---
>> lib/core.c      | 2 +-
>> src/Makefile.am | 7 +++----
>> src/libvlc.c    | 1 +
>> 3 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/lib/core.c b/lib/core.c
>> index 06fd52fbfa..c1fb78b7cf 100644
>> --- a/lib/core.c
>> +++ b/lib/core.c
>> @@ -34,7 +34,7 @@
>> #include <limits.h>
>> #include <assert.h>
>>
>> -#include "../src/revision.c"
>> +#include "../src/revision.h"
>>
>> libvlc_instance_t * libvlc_new( int argc, const char *const *argv )
>> {
>> diff --git a/src/Makefile.am b/src/Makefile.am
>> index 3f73999fdb..b25df0b56e 100644
>> --- a/src/Makefile.am
>> +++ b/src/Makefile.am
>> @@ -198,7 +198,6 @@ libvlccore_la_SOURCES = \
>> 	libvlc.h \
>> 	libvlc-module.c \
>> 	missing.c \
>> -	revision.c \
>> 	version.c \
>> 	config/configuration.h \
>> 	config/core.c \
>> @@ -618,10 +617,10 @@ LDADD = libvlccore.la \
>> # GIT revision
>> ###############################################################################
>>
>> -BUILT_SOURCES += stamp-revision
>> -MAINTAINERCLEANFILES = $(srcdir)/revision.txt $(srcdir)/revision.c
>> +BUILT_SOURCES += stamp-revision revision.h
>> +MAINTAINERCLEANFILES = $(srcdir)/revision.txt revision.h
>>
>> -$(srcdir)/revision.c: $(srcdir)/revision.txt
>> +revision.h: $(srcdir)/revision.txt
>> 	$(AM_V_at)rm -f -- $@
>> 	$(AM_V_GEN)echo "const char psz_vlc_changeset[] = \"$$(cat $<)\";" \
>> 		> $@
>> diff --git a/src/libvlc.c b/src/libvlc.c
>> index 018987f0bf..d65258761f 100644
>> --- a/src/libvlc.c
>> +++ b/src/libvlc.c
>> @@ -65,6 +65,7 @@
>> #include <vlc_thumbnailer.h>
>>
>> #include "libvlc.h"
>> +#include "revision.h"
>>
>> #include <vlc_vlm.h>
>>
>> -- 
>> 2.20.1 (Apple Git-117)
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez 
> excuser ma brièveté._______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list