[vlc-devel] [PATCH 2/4] doc: add an option to build libvlc sample app from the documentation

Steve Lhomme robux4 at ycbcr.xyz
Sat Feb 27 09:48:43 UTC 2021


On 2021-02-26 18:16, Alexandre Janniaux wrote:
> Hi,
> 
> As mentioned privately, I'm not fond of adding yet another build
> system to build examples, especially since it won't even be testing
> the buildsystem final users are supposed to use.

There is not "yet another build system" in this patch.

The final users are free to use whatever they want and that's a good 
reason not to orientate them in any favored direction.

> I'd prefer that we typically use make install to a given prefix and
> then use qmake/foomake/etc with the correct PKG_CONFIG_PATH. The
> alternative is to use only the automake buildsystem but to be fair,

Last time I proposed a similar patch, RĂ©mi advised to use "noinst_" 
instead of "bin_" prefix. And IMO it makes sense not to install sample 
code. The solution you propose is the opposite, it requires to install 
libvlc before building the samples. Something that is not needed by us 
nor the end user who will need to repackage the build anyway.

> what are the odds that final users are building their application
> inside libvlc buildsystem without having an installed package?

Maybe it's customary on Linux (is there a separate libvlc package on 
Linux distros ?) but on Windows or Mac or Android or iOS they will need 
to package libvlc by their own means, with their build system. So the 
way we build it for ourself will not have much impact.

> Regards,
> --
> Alexandre Janniaux
> Videolabs
> 
> On Fri, Feb 26, 2021 at 04:17:53PM +0100, Steve Lhomme wrote:
>> This can useful in the CI the make sure the sample apps are always in sync with
>> the libvlc API.
>>
>> Build the "doc" folder after the "libvlc" folder so it uses the latest libvlc
>> built.
>>
>> For now the QtPlayer, QtGl, win_player, d3d9_player and d3d11_player libvlc
>> apps are supported.
>> ---
>>   Makefile.am            |  2 +-
>>   configure.ac           |  9 ++++++++
>>   doc/Makefile.am        |  2 ++
>>   doc/libvlc/Makefile.am | 52 ++++++++++++++++++++++++++++++++++++++++++
>>   4 files changed, 64 insertions(+), 1 deletion(-)
>>   create mode 100644 doc/libvlc/Makefile.am
>>
>> diff --git a/Makefile.am b/Makefile.am
>> index be9516f9f86..d46707539fe 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -6,7 +6,7 @@
>>   # something. DIST_SUBDIRS stores the directories where nothing is built but
>>   # which have makefiles with distribution information.
>>   #  - src (libvlccore) is nedeed by modules
>> -SUBDIRS = compat doc po share src modules lib bin test
>> +SUBDIRS = compat po share src modules lib bin doc test
>>   DIST_SUBDIRS = m4 $(SUBDIRS)
>>
>>   EXTRA_DIST = \
>> diff --git a/configure.ac b/configure.ac
>> index a82c956c70f..ab7ca8ff2cb 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -4464,6 +4464,14 @@ AS_IF([test "${enable_osx_notifications}" != "no"], [
>>     VLC_ADD_PLUGIN([osx_notifications])
>>   ])
>>
>> +dnl
>> +dnl  doc samples
>> +dnl
>> +AC_ARG_ENABLE([doc_samples],
>> +  AS_HELP_STRING([--enable-doc-samples],
>> +      [enable build of documentation samples (default disabled)]))
>> +AM_CONDITIONAL([HAVE_DOC_SAMPLES], [test "${enable_doc_samples}" = "yes"])
>> +
>>   dnl
>>   dnl Libnotify notification plugin
>>   dnl
>> @@ -4633,6 +4641,7 @@ AC_SUBST([FILE_LIBVLC_DLL])
>>   AC_CONFIG_FILES([
>>     Makefile
>>     doc/Makefile
>> +  doc/libvlc/Makefile
>>     modules/Makefile
>>     m4/Makefile
>>     po/Makefile.in
>> diff --git a/doc/Makefile.am b/doc/Makefile.am
>> index a926b1eef8d..3d0c1c27e55 100644
>> --- a/doc/Makefile.am
>> +++ b/doc/Makefile.am
>> @@ -1,5 +1,7 @@
>>   NULL =
>>
>> +SUBDIRS = libvlc
>> +
>>   LIBVLC_SAMPLES = \
>>   	libvlc/gtk_player.c \
>>   	libvlc/QtPlayer/LICENSE \
>> diff --git a/doc/libvlc/Makefile.am b/doc/libvlc/Makefile.am
>> new file mode 100644
>> index 00000000000..4054df745ed
>> --- /dev/null
>> +++ b/doc/libvlc/Makefile.am
>> @@ -0,0 +1,52 @@
>> +SUFFIXES = .c .cpp .ui .h .hpp .moc.cpp
>> +
>> +moc_verbose = $(moc_verbose_$(V))
>> +moc_verbose_ = $(moc_verbose__$(AM_DEFAULT_VERBOSITY))
>> +moc_verbose_0 = @echo "  MOC   " $@;
>> +moc_verbose__0 = $(moc_verbose_0)
>> +
>> +MOC_CPPFLAGS = $(DEFS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) \
>> +	$(qtgl_libvlc_CPPFLAGS)
>> +
>> +nodist_qtgl_libvlc_SOURCES = qtvlcwidget.moc.cpp
>> +
>> +qtgl_libvlc_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) $(CXXFLAGS_qt)
>> +qtgl_libvlc_LDADD = $(QT_LIBS) $(LIBS_qt) $(LIBM) ../../lib/libvlc.la
>> +qtgl_libvlc_SOURCES = QtGL/main.cpp QtGL/qtvlcwidget.cpp QtGL/qtvlcwidget.h
>> +
>> +qtvlcwidget.moc.cpp: QtGL/qtvlcwidget.h
>> +	$(moc_verbose)$(MOC) $(MOC_CPPFLAGS) -o $@ $<
>> +
>> +nodist_qtplayer_libvlc_SOURCES = player.moc.cpp
>> +
>> +qtplayer_libvlc_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) $(CXXFLAGS_qt)
>> +qtplayer_libvlc_LDADD = $(QT_LIBS) $(LIBS_qt) $(LIBM) ../../lib/libvlc.la
>> +qtplayer_libvlc_SOURCES = QtPlayer/main.cpp QtPlayer/player.cpp QtPlayer/player.h
>> +
>> +player.moc.cpp: QtPlayer/player.h
>> +	$(moc_verbose)$(MOC) $(MOC_CPPFLAGS) -o $@ $<
>> +
>> +d3d9_player_SOURCES = d3d9_player.c
>> +d3d9_player_LDADD =  -ld3d9 ../../lib/libvlc.la
>> +d3d9_player_LDFLAGS = $(AM_LDFLAGS) -mwindows -Wc,-static
>> +
>> +d3d11_player_SOURCES = d3d11_player.cpp
>> +d3d11_player_LDADD =  -ld3d11 -ld3dcompiler_47 ../../lib/libvlc.la
>> +d3d11_player_LDFLAGS = $(AM_LDFLAGS) -mwindows -Wc,-static
>> +
>> +win_player_SOURCES = win_player.c
>> +win_player_LDADD = ../../lib/libvlc.la
>> +win_player_LDFLAGS = $(AM_LDFLAGS) -mwindows -Wc,-static
>> +
>> +noinst_PROGRAMS =
>> +if HAVE_DOC_SAMPLES
>> +if HAVE_WIN32
>> +noinst_PROGRAMS += d3d11_player d3d9_player win_player
>> +endif
>> +if ENABLE_QT
>> +noinst_PROGRAMS += qtplayer_libvlc
>> +if HAVE_GL
>> +noinst_PROGRAMS += qtgl_libvlc
>> +endif
>> +endif
>> +endif
>> --
>> 2.29.2
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> 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