vlc_DEPENDENCIES = $(LIBVLC) $(DATA_win32_rc)
vlc_LDADD = $(DATA_win32_rc) $(LIBVLC) $(LTLIBINTL)
+vlc_LDFLAGS =
+if !HAVE_PLUGINS
+vlc_LDFLAGS += `$(VLC_CONFIG) --target plugin | sed -e 's/\_plugin /_plugin.la /g'`
+endif
vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
LIB_libvlc = libvlc.la
objc) cmd="$(OBJCLINK)" ;; \
c|*) cmd="$(LINK)" ;; \
esac ; \
- cmd="$$cmd $(vlc_OBJECTS) $(vlc_LDADD)" ; \
+ cmd="$$cmd $(vlc_OBJECTS) $(vlc_LDFLAGS) $(vlc_LDADD)" ; \
echo $$cmd ; \
eval $$cmd
###############################################################################
# Stamp rules
###############################################################################
-stamp-builtin: FORCE
- @for dep in "" `$(VLC_CONFIG) --target builtin`; do \
- if test "$${dep}" -nt "$(top_builddir)/vlc$(EXEEXT)"; then \
- rm -f $@; \
+stamp-builtin:
+ @for dep in "" `$(VLC_CONFIG) --target plugin`; do \
+ if test "$${dep}.la" -nt "$(top_builddir)/vlc$(EXEEXT)"; then \
+ touch "$@"; \
break; \
fi; \
done
- @if test ! -f $@; then printf "" > $@; fi
+
+.PHONY: stamp-builtin
###############################################################################
# Enforce Mac OS X deployment target environment variable
###############################################################################
macosx-sdk: Makefile.in $(HEADERS_include) vlc-config
export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET)
-
-###############################################################################
-# Force rule
-###############################################################################
-FORCE:
dnl
dnl Plugin and builtin checks
dnl
-builtin_support=false
-plugin_support=:
-
-dnl Support for plugins - this must be AT THE END
-AC_ARG_ENABLE(plugins,
- [ --disable-plugins make all plugins built-in (default plugins enabled)],
- [if test "${enable_plugins}" = "no"
- then
- plugin_support=false
- fi])
+plugin_support=yes
dnl Automagically disable plugins if there is no system support for
dnl dynamically loadable files (.so, .dll, .dylib).
dnl don't forget vlc-win32 still can load .dll as plugins
-if test "${ac_cv_have_plugins}" = "no"
-then
- echo "*** Your system doesn't have plugin support. All plugins will be built"
- echo "statically."
- plugin_support=false
-fi
+AS_IF([test "${ac_cv_have_plugins}" = "no"], [
+ AC_MSG_WARN([*** No plugin support! Building statically! ***])
+ plugin_support=no
+])
+
+AS_IF([test "${enable_shared}" = "no"], [
+ plugin_support=no
+])
-AS_IF([${plugin_support}], [
+AS_IF([test "${plugin_support}" != "no"], [
AC_DEFINE(HAVE_DYNAMIC_PLUGINS, 1, Define if we have support for dynamic plugins)
-], [
- VLC_ADD_BUILTINS([${PLUGINS}])
- PLUGINS=""
])
+AM_CONDITIONAL(HAVE_PLUGINS, [test "${plugin_support}" != "no"])
+
+dnl Temporary(?) hack for plugins/builtins transition
+VLC_ADD_PLUGINS([${BUILTINS}])
+BUILTINS=""
+
dnl
dnl Pic and shared libvlc stuff
dnl
-VLC_ADD_PLUGINS([${BUILTINS}])
AS_IF([test "${SYS}" = "mingw32"], [
FILE_LIBVLC_DLL="!define LIBVLC_DLL libvlc.dll"
])
-BUILTINS=""
dnl
dnl Stuff used by the program
BUILT_SOURCES = modules/builtin.h misc/revision.c
CLEANFILES = $(BUILT_SOURCES)
-TOOLBOX = srcdir=$(top_srcdir) builddir=$(top_builddir) $(top_srcdir)/toolbox
-
###############################################################################
# Headers
###############################################################################
../include/vlc_vout_synchro.h \
$(NULL)
-modules/builtin.h: modules/builtin.h.in
- $(TOOLBOX) --update-includes
- touch $@
+modules/builtin.h: modules/builtin.h.in ../vlc-config Makefile.am
+ rm -f -- "$@.tmp"
+ cat "$<" > "$@.tmp"
+if !HAVE_PLUGINS
+ plugins="$$($(VLC_CONFIG) --list plugin)" ; \
+ test -n "$${plugins}" && \
+ for p in $${plugins}; do \
+ echo "int vlc_entry__$$p (module_t *);" ; \
+ done >> "$@.tmp"
+endif
+ echo "#define ALLOCATE_ALL_BUILTINS() \\" >> "$@.tmp"
+ echo " do \\" >> "$@.tmp"
+ echo " { \\" >> "$@.tmp"
+if !HAVE_PLUGINS
+ plugins="$$($(VLC_CONFIG) --list plugin)" ; \
+ test -n "$${plugins}" && \
+ for p in $${plugins}; do \
+ echo " ALLOCATE_BUILTIN($$p); \\" ; \
+ done >> "$@.tmp"
+endif
+ echo ' } while( 0 );' >> "$@.tmp"
+ mv -f -- "$@.tmp" "$@"
modules/modules.c: modules/builtin.h
libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc`
libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc`
-libvlc_la_LDFLAGS = $(AM_LDFLAGS) `$(VLC_CONFIG) --libs libvlc` \
+libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs libvlc` $(AM_LDFLAGS) \
-version-info 1:0:0
if HAVE_COMPILER_EXPORT
libvlc_la_LDFLAGS += -export-dynamic