Commit 3284ec0b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

- experimental disabled-by-default shared libvlc build.

  I said "experimental". I meant it.
  Developers might try --enable-shared-libvlc
- remove autom4te*.cache on bootstrap
  (some customized autoconf add their version number)
- some clean up
parent b8fec336
......@@ -33,6 +33,7 @@ EXTRA_DIST = \
$(NULL)
BUILT_SOURCES = \
vlc-config \
stamp-api \
src/misc/modules_builtin.h \
src/misc/version.c \
......@@ -65,6 +66,7 @@ dist_pkginclude_HEADERS = \
$(NULL)
noinst_HEADERS = $(HEADERS_include)
noinst_DATA = $(DATA_noinst_beos) $(DATA_noinst_libvlc)
HEADERS_include = \
include/aout_internal.h \
......@@ -130,7 +132,7 @@ HEADERS_include = \
src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in vlc-config
srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
touch $@
touch src/misc/modules_builtin.h
src/misc/version.c: FORCE
srcdir=$(srcdir) $(srcdir)/toolbox --update-version
......@@ -271,18 +273,28 @@ dist-hook:
bin_SCRIPTS = vlc-config
vlc-config: $(top_builddir)/config.status $(top_builddir)/vlc-config.in
cd $(top_builddir) && $(SHELL) ./config.status --file=$@
-cd $(top_builddir) && chmod 0755 $@
$(SHELL) ./config.status --file=vlc-config
chmod 0755 vlc-config
vlc-config.in: vlc-config.in.in
./config.status --recheck
$(SOURCES): vlc-config
MOSTLYCLEANFILES = $(DATA_noinst_libvlc)
CLEANFILES = $(BUILT_SOURCES) stamp-builtin
DISTCLEANFILES = vlc-config.in vlc-config
DISTCLEANFILES = vlc-config.in
lib_LIBRARIES = lib/libvlc.a $(LIBRARIES_libvlc_pic)
if HAVE_WIN32
lib_LIBRARIES = lib/libvlc.a
else
if BUILD_SHARED
lib_LIBRARIES = lib/libvlc_pic.a
else
lib_LIBRARIES = lib/libvlc.a
if BUILD_MOZILLA
lib_LIBRARIES += lib/libvlc_pic.a
endif
endif
endif
lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
lib_libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
......@@ -312,12 +324,27 @@ endif
if BUILD_GETOPT
OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
endif
if BUILD_MOZILLA
if !HAVE_WIN32
LIBRARIES_libvlc_pic = lib/libvlc_pic.a
# Build libvlc as a shared library
if BUILD_SHARED
DATA_noinst_libvlc = libvlc$(LIBEXT)
if HAVE_WIN32
OBJECTS_libvlc_so = $(lib_libvlc_a_OBJECTS)
else
OBJECTS_libvlc_so = $(lib_libvlc_pic_a_OBJECTS)
endif
endif
libvlc$(LIBEXT): $(OBJECTS_libvlc_so)
@ldfl="`$(VLC_CONFIG) --libs plugin vlc $(pic) builtin`" ; \
case `$(VLC_CONFIG) --linkage vlc` in \
c++) ld="$(CXXLINK)" ;; \
objc) ld="$(OBJCLINK)" ;; \
c|*) ld="$(LINK)" ;; \
esac ; \
echo $$ld $(OBJECTS_libvlc_so) $$ldfl ; \
$$ld $(OBJECTS_libvlc_so) $$ldfl
EXTRA_DIST += \
$(SOURCES_libvlc_beos) \
$(SOURCES_libvlc_darwin) \
......@@ -442,27 +469,40 @@ vlc_SOURCES = src/vlc.c
# Work around a bug in the arm-wince-pe linker
if HAVE_WINCE
vlc_WORKAROUNDLDFLAGS = lib/libvlc.a
vlc_WORKAROUNDLDFLAGS = $(LIB_libvlc)
endif
vlc_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin` $(vlc_WORKAROUNDLDFLAGS)
vlc_LDADD = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
if BUILD_SHARED
### libvlc.so cannot be created into lib/
LIB_libvlc = libvlc$(LIBEXT)
LDFLAGS_libvlc =
#-Wl,-rpath $(libdir)
else
LIB_libvlc = lib/libvlc.a
LDFLAGS_libvlc = `$(VLC_CONFIG) --libs vlc builtin`
endif
vlc_LDFLAGS = $(LDFLAGS_libvlc) $(vlc_WORKAROUNDLDFLAGS)
vlc_LDADD = $(LIB_libvlc) $(DATA_win32_rc) $(LIB_intl)
vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
# We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
# old automake-1.5 bug (automake/279).
DEPENDENCIES_vlc = lib/libvlc.a $(DATA_win32_rc) $(LIB_intl)
DEPENDENCIES_vlc = $(LIB_libvlc) $(DATA_win32_rc) $(LIB_intl)
vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc) stamp-builtin
@rm -f $(top_builddir)/vlc$(EXEEXT)
@rm -f vlc$(EXEEXT)
@case `$(VLC_CONFIG) --linkage vlc builtin` in \
c++) echo $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDFLAGS) $(LIBS) ; $(CXXLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) $(vlc_LDADD) ;; \
objc) echo $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDFLAGS) $(LIBS) ; $(OBJCLINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) $(vlc_LDADD) ;; \
c|*) echo $(LINK) $(vlc_OBJECTS) $(vlc_LDFLAGS) $(LIBS) ; $(LINK) $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS) $(LIBS) $(vlc_LDADD) ;; \
esac
c++) cmd="$(CXXLINK)" ;; \
objc) cmd="$(OBJCLINK)" ;; \
c|*) cmd="$(LINK)" ;; \
esac ; \
cmd="$$cmd $(vlc_OBJECTS) $(vlc_LDFLAGS) $(vlc_LDADD) $(LIBS)" ; \
echo $$cmd ; \
eval $$cmd
if HAVE_BEOS
noinst_DATA = vlc-bundle
DATA_noinst_beos = vlc-bundle
vlc-bundle: vlc
rm -Rf $(top_builddir)/vlc-bundle ; mkdir -p $(top_builddir)/vlc-bundle
cp $(top_builddir)/vlc $(top_builddir)/vlc-bundle/
......
......@@ -199,23 +199,12 @@ EXTRA_DIST = Modules.am
BUILT_SOURCES =
SUBDIRS = ${subdirs}
SUFFIXES = _plugin\$(LIBEXT) _plugin.a
### TODO ought to be defined somewhere else
libvlcdir = \$(libdir)/vlc/\$(basedir)
EXTRA_LIBRARIES = ${extra_libs}
include Modules.am
if !BUILD_MOZILLA
pic = no
else
if HAVE_WIN32
### There's no need for pic code on win32 so get rid of this to substantially
### reduce the compilation time.
pic = no
endif
endif
all: all-modules
# Find out which modules were enabled and tell make to build them
......@@ -223,7 +212,7 @@ all-modules:
@set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\
if test "\$(plugin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list plugin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_plugin\$(LIBEXT);; esac; done; fi; \\
if test "\$(builtin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}.a;; esac; done; fi; \\
if test "\$(pic)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_pic.a;; esac; done; fi; \\
if test "\$(pic)" == "pic"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_pic.a;; esac; done; fi; \\
\`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\
test -z "\$\$fail"
......@@ -406,7 +395,7 @@ set -x
# remove autotools cruft
rm -f aclocal.m4 configure config.log config.h config.h.in
rm -Rf autom4te.cache
rm -Rf autom4te*.cache
# remove old autotools extra cruft
rm -f config.guess config.sub missing mkinstalldirs compile depcomp install-sh
# remove new autotools extra cruft
......
......@@ -4428,6 +4428,20 @@ then
fi]
AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})
AC_ARG_ENABLE(shared-libvlc,
[ --enable-shared-libvlc shared libvlc (default disabled EXPERIMENTAL)],
,[shared_libvlc=no])
AM_CONDITIONAL(BUILD_SHARED, [test "${shared_libvlc}" != "no"])
pic=no
AS_IF([test "${shared_libvlc}" != "no"], [pic=pic])
AS_IF([${mozilla}], [pic=pic])
AS_IF([test "${SYS}" = "mingw32"], [pic=no])
AS_IF([test "${pic}" = "no"], [pic=])
AC_SUBST(pic)
dnl Import conditional variables generated by bootstrap
VLC_CONDITIONALS
......@@ -4451,7 +4465,7 @@ dnl AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for modu
dnl AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
dnl New definitions with value matching 0.8.2 release
module_symbol="0_8_2"
module_symbol="0_8_4"
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${module_symbol}", [String suffix for module functions])
AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $module_symbol, [Symbol suffix for module functions])
VLC_ENTRY="vlc_entry__${module_symbol}"
......
......@@ -39,13 +39,11 @@ BUNDLE_mozilla = VLC\ Plugin.plugin
vlc_moz_FLAGS = `$(VLC_CONFIG) --libs vlc builtin pic mozilla`
moz_CFLAGS = `$(MOZILLA_CONFIG) --cflags plugin java nspr/obsolete nspr oji xpcom xpconnect`
moz_plugin_FLAGS = -I. -I$(top_builddir) -I$(srcdir)/../include -c -F/System/Library/Frameworks/CoreFoundation.framework $(moz_CFLAGS) -I/Developer/Headers/FlatCarbon -arch ppc -fno-common -fpascal-strings -O0 -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -DXP_MACOSX=1 -DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1 -pipe -fmessage-length=0 -g -include mozilla-config.h
pic = pic
LIBRARIES_libvlc = $(top_builddir)/lib/libvlc_pic.a
else
LIBRARIES_mozilla = libvlcplugin$(LIBEXT)
SOURCES_unix = support/npunix.c
pic = pic
LIBRARIES_libvlc = $(top_builddir)/lib/libvlc_pic.a
endif
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