Commit 31e1756c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

update: use Makefile conditional to disable code

This fixes the build without gcrypt.
parent 32427fa4
......@@ -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
......
......@@ -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 * );
......
......@@ -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
......
......@@ -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 \
......
......@@ -39,8 +39,6 @@
#include <vlc_common.h>
#include <vlc_update.h>
#ifdef UPDATE_CHECK
#include <assert.h>
#include <vlc_pgpkey.h>
......@@ -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
......@@ -34,8 +34,6 @@
# include "config.h"
#endif
#ifdef UPDATE_CHECK
#include <gcrypt.h>
#include <assert.h>
#include <limits.h>
......@@ -1106,5 +1104,3 @@ int download_signature( vlc_object_t *p_this, signature_packet_t *p_sig,
return VLC_SUCCESS;
}
#endif /* UPDATE_CHECK */
......@@ -402,3 +402,43 @@ vlm_t *vlm_New (vlc_object_t *obj)
return NULL;
}
#endif /* !ENABLE_VLM */
#ifndef UPDATE_CHECK
# include <vlc_update.h>
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 */
......@@ -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 \
......
......@@ -24,15 +24,6 @@
#include <stdio.h>
#ifndef UPDATE_CHECK
int main(void)
{
fprintf(stderr, "Update checking disabled, not testing.\n");
return 77;
}
#else
#include <vlc_common.h>
#include "../src/misc/update_crypto.c"
......@@ -292,4 +283,3 @@ int main(void)
check(&key, &key2, status, &sig, key_longid, key_longid2);
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment