]> git.sesse.net Git - vlc/commitdiff
Build plugins statically if --disable-shared is used
authorRafaël Carré <rafael.carre@gmail.com>
Mon, 29 Aug 2011 12:51:05 +0000 (08:51 -0400)
committerRafaël Carré <rafael.carre@gmail.com>
Mon, 29 Aug 2011 12:51:05 +0000 (08:51 -0400)
Only allow static plugins if vlc binary is not built

configure.ac
modules/common.am

index c484481373018232a950540baf9e38a2a9626dfe..9812a531bace81f4e5cd8c101e09734c596e5912 100644 (file)
@@ -461,10 +461,12 @@ m4_defun([AC_DEPLIBS_CHECK_METHOD],[])
 
 lt_cv_deplibs_check_method=pass_all
 
-AS_IF([test "${enable_shared}" = "no"], [
+AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
   AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
 ])
 
+AM_CONDITIONAL(HAVE_SHARED_PLUGINS, [test "${enable_shared}" != "no"])
+
 dnl
 dnl Gettext stuff
 dnl
index d0b2d0eca0e800cdbc35ddd9f53e7490dc387e76..e2b21bf087403258f22393b195ca165c2864135d 100644 (file)
@@ -19,8 +19,10 @@ MODULE_NAME = `p="$@"; p="$${p\#\#*/}"; p="$${p\#lib}"; echo "$${p%_plugin*}"`
 AM_CPPFLAGS = \
        -DMODULE_NAME=$(MODULE_NAME) \
        -DMODULE_NAME_IS_$(MODULE_NAME) \
-       -DMODULE_STRING=\"$(MODULE_NAME)\" \
-       -D__PLUGIN__
+       -DMODULE_STRING=\"$(MODULE_NAME)\"
+if HAVE_SHARED_PLUGINS
+AM_CPPFLAGS += -D__PLUGIN__
+endif
 AM_CFLAGS =
 AM_CXXFLAGS =
 AM_OBJCFLAGS =