Commit 473a276f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove ugly builtin support

I don't this abomination to leak through the stable LibVLC interface.
To link statically, modules should be linked into LibVLC instead.

And then, there is no need to reintroduce the old "builtin" vlc-config
type if all modules are built the same. In prehistoric times, the
distinction was needed because some modules were static and some not.
parent a0355914
......@@ -94,26 +94,6 @@ AS_IF([test -n "${with_binary_version}"],[
[Binary specific version])
])
dnl Check how we are asked to build
AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
])
AC_ARG_ENABLE(static-modules,
[AS_HELP_STRING([--enable-static-modules],
[link modules statically - VLC will not work])])
AS_IF([test "${enable_static_modules}" = yes], [
enable_shared="no"
enable_static="yes"
VLC_DEFAULT_PLUGIN_TYPE="builtin"
AS_IF([test "${enable_vlc}" != "no"],
[AC_MSG_WARN([Building modules as static. VLC will not work.])])
], [
VLC_DEFAULT_PLUGIN_TYPE="plugin"
])
AC_SUBST(VLC_DEFAULT_PLUGIN_TYPE)
dnl
dnl Check for the contrib directory
dnl
......@@ -444,6 +424,10 @@ m4_defun([AC_DEPLIBS_CHECK_METHOD],[])
lt_cv_deplibs_check_method=pass_all
AS_IF([test "${enable_shared}" = "no"], [
AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
])
dnl
dnl Gettext stuff
dnl
......
......@@ -135,41 +135,6 @@ const char *libvlc_printerr (const char *fmt, ...);
VLC_PUBLIC_API libvlc_instance_t *
libvlc_new( int argc , const char *const *argv );
/**
* \return a static entry point for a module, suitable for passing to
* libvlc_new_with_builtins. This is to be used when you want to statically
* link to a module.
*
* Note, statically linking to a module will results in nearly zero speed gain
* and increased memory usage. Use with caution.
*/
#define vlc_plugin(module) & vlc_plugin_entry(module)
#define vlc_plugin_entry(module) vlc_entry__ ## module
#define vlc_declare_plugin(module) extern void *vlc_plugin_entry(module);
/**
* Create and initialize a libvlc instance.
*
* \param argc the number of arguments
* \param argv command-line-type arguments
* \param builtins a NULL terminated array of \see vlc_plugin.
* \return the libvlc instance or NULL in case of error
* @begincode
* {
* vlc_declare_plugin(mp4);
* vlc_declare_plugin(dummy);
* const void **builtins = { vlc_plugin(mp4), vlc_plugin(dummy), NULL };
* libvlc_instance_t *vlc = libvlc_new_with_builtins(argc, argv, builtins);
* }
* @endcode
*/
VLC_PUBLIC_API libvlc_instance_t *
libvlc_new_with_builtins( int argc , const char *const *argv, const void **builtins);
/**
* Decrement the reference count of a libvlc instance, and destroy it
* if it reaches zero.
......
......@@ -13,17 +13,17 @@ CLEANFILES = $(BUILT_SOURCES)
LTLIBVLCCORE = $(top_builddir)/src/libvlccore.la
AM_CFLAGS = `$(VLC_CONFIG) --cflags $(VLC_DEFAULT_PLUGIN_TYPE) $@`
AM_CXXFLAGS = `$(VLC_CONFIG) --cxxflags $(VLC_DEFAULT_PLUGIN_TYPE) $@`
AM_OBJCFLAGS = `$(VLC_CONFIG) --objcflags $(VLC_DEFAULT_PLUGIN_TYPE) $@`
AM_CFLAGS = `$(VLC_CONFIG) --cflags plugin $@`
AM_CXXFLAGS = `$(VLC_CONFIG) --cxxflags plugin $@`
AM_OBJCFLAGS = `$(VLC_CONFIG) --objcflags plugin $@`
AM_LDFLAGS = -rpath '$(libvlcdir)' \
-avoid-version -module \
-export-symbols-regex ^vlc_entry \
-shrext $(LIBEXT) \
-rpath "$(libvlcdir)" \
-no-undefined \
`$(VLC_CONFIG) --ldflags $(VLC_DEFAULT_PLUGIN_TYPE) $@`
AM_LIBADD = `$(VLC_CONFIG) -libs $(VLC_DEFAULT_PLUGIN_TYPE) $@` \
`$(VLC_CONFIG) --ldflags plugin $@`
AM_LIBADD = `$(VLC_CONFIG) -libs plugin $@` \
$(LTLIBVLCCORE) $(top_builddir)/compat/libcompat.la
include $(srcdir)/Modules.am
......
......@@ -38,8 +38,7 @@
static const char nomemstr[] = "Insufficient memory";
libvlc_instance_t * libvlc_new_with_builtins( int argc, const char *const *argv,
const void ** builtins_module)
libvlc_instance_t * libvlc_new( int argc, const char *const *argv )
{
libvlc_instance_t *p_new = malloc (sizeof (*p_new));
if (unlikely(p_new == NULL))
......@@ -57,7 +56,7 @@ libvlc_instance_t * libvlc_new_with_builtins( int argc, const char *const *argv,
if (unlikely (p_libvlc_int == NULL))
goto error;
if (libvlc_InternalInit( p_libvlc_int, argc + 1, my_argv, builtins_module ))
if (libvlc_InternalInit( p_libvlc_int, argc + 1, my_argv ))
{
libvlc_InternalDestroy( p_libvlc_int );
goto error;
......@@ -81,12 +80,6 @@ error:
return NULL;
}
libvlc_instance_t * libvlc_new( int argc, const char *const *argv)
{
return libvlc_new_with_builtins(argc, argv, NULL);
}
void libvlc_retain( libvlc_instance_t *p_instance )
{
assert( p_instance != NULL );
......
......@@ -44,7 +44,7 @@
* Internal creation and destruction functions
***************************************************************************/
VLC_EXPORT (libvlc_int_t *, libvlc_InternalCreate, ( void ) );
VLC_EXPORT (int, libvlc_InternalInit, ( libvlc_int_t *, int, const char *ppsz_argv[], const void **builtins_module) );
VLC_EXPORT (int, libvlc_InternalInit, ( libvlc_int_t *, int, const char *ppsz_argv[] ) );
VLC_EXPORT (void, libvlc_InternalCleanup, ( libvlc_int_t * ) );
VLC_EXPORT (void, libvlc_InternalDestroy, ( libvlc_int_t * ) );
......
......@@ -249,7 +249,7 @@ error:
* - configuration and commandline parsing
*/
int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
const char *ppsz_argv[], const void **builtins_module )
const char *ppsz_argv[] )
{
libvlc_priv_t *priv = libvlc_priv (p_libvlc);
char * p_tmp = NULL;
......@@ -410,7 +410,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
* list of configuration options exported by each module and loads their
* default values.
*/
module_LoadPlugins( p_libvlc, builtins_module );
module_LoadPlugins( p_libvlc );
if( p_libvlc->b_die )
{
b_exit = true;
......
......@@ -160,7 +160,6 @@ libvlc_media_set_state
libvlc_media_set_user_data
libvlc_media_subitems
libvlc_new
libvlc_new_with_builtins
libvlc_playlist_play
libvlc_release
libvlc_retain
......
......@@ -201,19 +201,13 @@ void module_EndBank( vlc_object_t *p_this, bool b_plugins )
* \param p_this vlc object structure
* \return nothing
*/
void module_LoadPlugins( vlc_object_t * p_this, const void **builtins )
void module_LoadPlugins( vlc_object_t * p_this )
{
module_bank_t *p_bank = p_module_bank;
assert( p_bank );
/*vlc_assert_locked( &module_lock ); not for static mutexes :( */
if (builtins)
{
for (int i = 0; builtins[i]; i++)
AllocateBuiltinModule( p_this, builtins[i] );
}
#ifdef HAVE_DYNAMIC_PLUGINS
if( p_bank->i_usage == 1 )
{
......
......@@ -137,10 +137,10 @@ struct module_t
module_t *vlc_module_create (vlc_object_t *);
module_t *vlc_submodule_create (module_t *module);
void module_InitBank( vlc_object_t *);
void module_InitBank( vlc_object_t * );
#define module_InitBank(a) module_InitBank(VLC_OBJECT(a))
void module_LoadPlugins( vlc_object_t *, const void ** );
#define module_LoadPlugins(a, b) module_LoadPlugins(VLC_OBJECT(a), b)
void module_LoadPlugins( vlc_object_t * );
#define module_LoadPlugins(a) module_LoadPlugins(VLC_OBJECT(a))
void module_EndBank( vlc_object_t *, bool );
#define module_EndBank(a,b) module_EndBank(VLC_OBJECT(a), b)
......
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