]> git.sesse.net Git - vlc/commitdiff
Remove ugly builtin support
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 1 May 2011 18:06:15 +0000 (21:06 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 2 May 2011 08:01:11 +0000 (11:01 +0300)
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.

configure.ac
include/vlc/libvlc.h
modules/common.am
src/control/core.c
src/control/libvlc_internal.h
src/libvlc.c
src/libvlc.sym
src/modules/modules.c
src/modules/modules.h

index fa18aecb12260fa2697ab493e973d7d08ffd95cd..710b88949498659fec8a4c35031f3631bdaf7163 100644 (file)
@@ -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
index 614c3b0c0c1c012b6ed4296fb1cda7a851bb097a..43acdeb3a5e44ee614280c44c0358b93d4bd048f 100644 (file)
@@ -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.
index f001a7f80ecb430a84549312e5f90477cd185ff1..1092b620c11744035820cddebba461ec56457736 100644 (file)
@@ -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
index ee80234fa62dfe6858bb23452f05e1e23e54db15..dfa0bb55a358594fc2f3979945f7a4299e6a69f7 100644 (file)
@@ -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 );
index 935442fa611ebe21dd0a4dbbcfc82873607c70eb..c079f8dba9f7fe5787d477ed12752259c32f4cc0 100644 (file)
@@ -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 * ) );
 
index c495790a36a3134c3a36218acd943a8eb7a53b64..cceb3e69540c62379c5d73a374c26f2d84df149b 100644 (file)
@@ -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;
index 4416afa640fc8e8e3eb358329ca68f32acd10ecb..a95b3ce65792294a6b7f38a908ad7deaffc1e5e1 100644 (file)
@@ -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
index aa758d779d34e8b246eee9515303210fba025b8c..01f3583f04be1ef45f5d06dd5c9698000c0d5b7f 100644 (file)
@@ -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 )
     {
index 90e9f9ee9b6a806799e968568fbfa15dbba81f10..d450409d1e54a68f5eff38a555a4c795f6589de5 100644 (file)
@@ -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)