diff --git a/configure.ac b/configure.ac index be5bf19067ae02910cb1beaa0926d00b5c3a683c..705009139f4e8b4f811c5c57606f0b7958a4cb6a 100644 --- a/configure.ac +++ b/configure.ac @@ -4107,10 +4107,8 @@ if test "${enable_update_check}" = "yes" then AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[ AC_MSG_ERROR([libgcrypt is required for update checking system]) ]) - VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}]) - VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}]) - AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism]) fi +AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"]) dnl dnl OS X notification plugin diff --git a/include/vlc_update.h b/include/vlc_update.h index df7440546eed36181452b72d16dba5ae48bb4286..8482b4f23de81f9b7937edde8795ceb8105a0a3d 100644 --- a/include/vlc_update.h +++ b/include/vlc_update.h @@ -34,8 +34,6 @@ *VLC software update interface */ -#ifdef UPDATE_CHECK - /** * Describes an update VLC release number */ @@ -49,8 +47,6 @@ struct update_release_t char* psz_desc; ///< Release description }; -#endif /* UPDATE_CHECK */ - typedef struct update_release_t update_release_t; VLC_API update_t * update_New( vlc_object_t * ); diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am index 7e5f5aedd5e475b445d394705cf882ce23b48b8f..dfe9c387a5869863c185754f362129930524d831 100644 --- a/modules/gui/qt/Makefile.am +++ b/modules/gui/qt/Makefile.am @@ -14,6 +14,7 @@ guidir = $(pluginsdir)/gui SUFFIXES += .ui .h .hpp .moc.cpp +libqt_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) libqt_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) $(CXXFLAGS_qt) libqt_plugin_la_LIBADD = $(QT_LIBS) $(LIBS_qt) $(LIBM) libqt_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(guidir)' @@ -31,6 +32,9 @@ endif if HAVE_WIN32 libqt_plugin_la_LIBADD += $(LIBCOM) -lcomctl32 -luuid endif +if UPDATE_CHECK +libqt_plugin_la_CPPFLAGS += -DUPDATE_CHECK +endif gui_LTLIBRARIES = $(LTLIBqt) EXTRA_LTLIBRARIES = libqt_plugin.la diff --git a/src/Makefile.am b/src/Makefile.am index ee676f932a724fb0d06f961454e82e701630b092..66b399f5cc419000df3503a8ada06132c8d3eca5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -339,9 +339,6 @@ libvlccore_la_SOURCES = \ misc/variables.h \ misc/variables.c \ misc/error.c \ - misc/update.h \ - misc/update.c \ - misc/update_crypto.c \ misc/xml.c \ misc/addons.c \ misc/filter.c \ @@ -442,6 +439,15 @@ libvlccore_la_SOURCES += input/vlm.c input/vlm_event.c input/vlmshell.c endif endif +if UPDATE_CHECK +libvlccore_la_SOURCES += \ + misc/update.h misc/update.c \ + misc/update_crypto.c +AM_CPPFLAGS += -DUPDATE_CHECK +AM_CFLAGS += $(GCRYPT_CFLAGS) +libvlccore_la_LIBADD += $(GCRYPT_LIBS) +endif + libvlccore_la_LDFLAGS = \ $(LDFLAGS_libvlccore) \ -no-undefined \ diff --git a/src/misc/update.c b/src/misc/update.c index 46bf80c24e7736daacdbc11e51211d12d99d30f9..d8e6ded003fa610c057f9d95ee701ab0856af59b 100644 --- a/src/misc/update.c +++ b/src/misc/update.c @@ -39,8 +39,6 @@ #include #include -#ifdef UPDATE_CHECK - #include #include @@ -757,40 +755,3 @@ update_release_t *update_GetRelease( update_t *p_update ) { return &p_update->release; } - -#else -#undef update_New -update_t *update_New( vlc_object_t *p_this ) -{ - (void)p_this; - return NULL; -} - -void update_Delete( update_t *p_update ) -{ - (void)p_update; -} - -void update_Check( update_t *p_update, void (*pf_callback)( void*, bool ), - void *p_data ) -{ - (void)p_update; (void)pf_callback; (void)p_data; -} - -bool update_NeedUpgrade( update_t *p_update ) -{ - (void)p_update; - return false; -} - -void update_Download( update_t *p_update, const char *psz_destdir ) -{ - (void)p_update; (void)psz_destdir; -} - -update_release_t *update_GetRelease( update_t *p_update ) -{ - (void)p_update; - return NULL; -} -#endif diff --git a/src/misc/update_crypto.c b/src/misc/update_crypto.c index 11845961bd4f4f8a858d7b9866cde3c54af7a5e7..1ed64769a0bd957f3251a014204e270e898ea08d 100644 --- a/src/misc/update_crypto.c +++ b/src/misc/update_crypto.c @@ -34,8 +34,6 @@ # include "config.h" #endif -#ifdef UPDATE_CHECK - #include #include #include @@ -1106,5 +1104,3 @@ int download_signature( vlc_object_t *p_this, signature_packet_t *p_sig, return VLC_SUCCESS; } - -#endif /* UPDATE_CHECK */ diff --git a/src/missing.c b/src/missing.c index 692b9b5ecf59f496cc21528a91668f18e501b303..1ff22e266cc00ecc5426e3f7e45170981a589438 100644 --- a/src/missing.c +++ b/src/missing.c @@ -402,3 +402,43 @@ vlm_t *vlm_New (vlc_object_t *obj) return NULL; } #endif /* !ENABLE_VLM */ + +#ifndef UPDATE_CHECK +# include + +update_t *(update_New)(vlc_object_t *obj) +{ + (void) obj; + return NULL; +} + +void update_Delete(update_t *u) +{ + (void) u; + vlc_assert_unreachable(); +} + +void update_Check(update_t *u, void (*cb)(void *, bool), void *opaque) +{ + (void) u; (void) cb; (void) opaque; + vlc_assert_unreachable(); +} + +bool update_NeedUpgrade(update_t *u) +{ + (void) u; + vlc_assert_unreachable(); +} + +void update_Download(update_t *u, const char *dir) +{ + (void) u; (void) dir; + vlc_assert_unreachable(); +} + +update_release_t *update_GetRelease(update_t *u) +{ + (void) u; + vlc_assert_unreachable(); +} +#endif /* !UPDATE_CHECK */ diff --git a/test/Makefile.am b/test/Makefile.am index e47430e02ebd4531c4de2ce6cbe42bde4ac556b2..9f33aa6c4c72cb4a786b1595ad9a1d4ef125f8c3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -23,7 +23,6 @@ check_PROGRAMS = \ test_libvlc_slaves \ test_src_config_chain \ test_src_misc_variables \ - test_src_crypto_update \ test_src_input_stream \ test_src_input_stream_fifo \ test_src_interface_dialog \ @@ -32,8 +31,10 @@ check_PROGRAMS = \ test_src_misc_keystore \ test_modules_packetizer_hxxx \ test_modules_keystore \ - test_modules_tls \ - $(NULL) + test_modules_tls +if UPDATE_CHECK +check_PROGRAMS += test_src_crypto_update +endif check_SCRIPTS = \ modules/lua/telnet.sh \ diff --git a/test/src/crypto/update.c b/test/src/crypto/update.c index a1b3e79e1164cc7bd91739e99f529af7e89860f4..ac7def91eae32f55644013cb0e13276dc79009d3 100644 --- a/test/src/crypto/update.c +++ b/test/src/crypto/update.c @@ -24,15 +24,6 @@ #include -#ifndef UPDATE_CHECK -int main(void) -{ - fprintf(stderr, "Update checking disabled, not testing.\n"); - return 77; -} - -#else - #include #include "../src/misc/update_crypto.c" @@ -292,4 +283,3 @@ int main(void) check(&key, &key2, status, &sig, key_longid, key_longid2); } -#endif