You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
147 lines
6.0 KiB
147 lines
6.0 KiB
# Extract plugins and convenience libraries from the libtool libraries
|
|
# being built, excluding the ones using them.
|
|
|
|
# Remove the special targets
|
|
ALL_TARGETS_2 := $(LTLIBRARIES:libvlc_static_modules.la=)
|
|
ALL_TARGETS := $(ALL_TARGETS_2:libvlc_plugin.la=)
|
|
|
|
# Remove the non-plugins, it needs intermediate steps because
|
|
# we can only replace and not match inverse. Instead we;
|
|
# 1/ replace plugins .la targets by plugins names
|
|
# 2/ remove every word which is a .la target (ie. non-plugins)
|
|
# 3/ rename every plugin name back into the target name
|
|
ALL_TARGETS_PLUGIN_RENAMED := $(ALL_TARGETS:%_plugin.la=%)
|
|
PLUGINS_NAMES := $(ALL_TARGETS_PLUGIN_RENAMED:%.la=)
|
|
PLUGINS1 := $(PLUGINS_NAMES:%=%_plugin.la)
|
|
PLUGINS := $(PLUGINS1:libglbwdif_plugin.la=)
|
|
|
|
PARTIAL_PLUGINS := $(PLUGINS:%_plugin.la=%_plugin.partial.la)
|
|
|
|
%.partial.la: %.la %.la.symbollist
|
|
$(AM_V_at)$(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@.module.lo \
|
|
"$(top_srcdir)/modules/module_expose.c"
|
|
if !HAVE_DARWIN
|
|
$(AM_V_at)libpath=`grep old_library= "$<" | cut -d"'" -f 2`; \
|
|
dependencies=`grep "dependency_libs=" "$<"| cut -d= -f2-`; \
|
|
dependencies="$${dependencies%\'}"; dependencies="$${dependencies#\'}"; \
|
|
dependencies=`echo $${dependencies} | sed "s,[^ ]*libcompat\.la,,g"`; \
|
|
dependencies=`echo $${dependencies} | sed "s,[^ ]*libvlccore\.la,,g"`; \
|
|
static_dependencies=`echo $${dependencies} | sed "s,\-L[ ]*[^ ]+,,g"`; \
|
|
echo $${libpath}; echo $${static_dependencies}; \
|
|
$(LIBTOOL) --mode=link --tag=CXX $(CXX) -fPIC -export-symbols-regex "^vlc_entry__" -o .deps/$@.o \
|
|
-Wl,-Ur $@.module.lo .libs/$${libpat} $${static_dependencies}
|
|
else
|
|
$(AM_V_at)object_file=`if [ -f $@.module.o ]; then echo $@.module.o; else echo .libs/$@.module.o; fi`; \
|
|
libpath=`grep old_library= "$<" | cut -d"'" -f 2`; \
|
|
static_dependencies=`$(top_srcdir)/extras/package/apple/dependencies.sh static $<`; \
|
|
xcrun ranlib .libs/$${libpath}; \
|
|
$(CXX) $(CXXFLAGS) $(LDFLAGS) -r -o .deps/$@.o -fPIC -exported_symbols_list "$*.la.symbollist" \
|
|
$${object_file} .libs/$${libpath} $${static_dependencies}
|
|
endif
|
|
|
|
# Stupid libtool checks that the following coment is there to check that
|
|
# libtool object is correct, so provide it
|
|
$(AM_V_at)echo "# .deps/$@.lo - a libtool object file" > $@.lo
|
|
$(AM_V_at)echo "# Generated by doltcompile, not libtool" >> $@.lo #$$($(LIBTOOL) --version | head -n1)" > .deps/$@.lo
|
|
$(AM_V_at)echo "non_pic_object=none" >> $@.lo
|
|
$(AM_V_at)echo "pic_object=.deps/$@.o" >> $@.lo
|
|
$(AM_V_at)$(LIBTOOL) --mode=link --tag=CXX $(CXX) $(CXXFLAGS) $(LDFLAGS) -Wl,-Ur -fPIC -o $@ "$@.lo" \
|
|
-export-symbols-regex "^vlc_entry__"
|
|
$(AM_V_GEN)dependencies=`$(top_srcdir)/extras/package/apple/dependencies.sh forward $<`; \
|
|
sed -i.orig "s,dependency_libs=.*\$$,dependency_libs=' $${dependencies}'," $@ \
|
|
|| (rm $@ && exit 1)
|
|
|
|
if HAVE_MERGE_PLUGINS
|
|
%.la.symbollist: %.la
|
|
$(AM_V_GEN)libpath=`grep old_library= "$<" | cut -d"'" -f 2`; \
|
|
entrypoint=`$(NM) ".libs/$${libpath}" | grep vlc_entry__ | cut -d" " -f 3 | head -n1`; \
|
|
echo $${entrypoint} > $@
|
|
|
|
vlc_modules_manifest.h: $(PARTIAL_PLUGINS) $(PARTIAL_PLUGINS:%=%.symbollist) Makefile
|
|
## Collect paths of all static libraries needed (plugins and contribs)
|
|
$(AM_V_at)echo "#define VLC_MODULE_LIST(F) \\" > $@.tmp
|
|
## Note: $(NULL) here is to fix syntax interpretation of \\ in the string
|
|
$(AM_V_GEN)for ltlib in $(PARTIAL_PLUGINS); do \
|
|
module_name=`cat $${ltlib}.symbollist | sed s/.*vlc_entry__//`; \
|
|
echo "F($${module_name}) \\$(NULL)" >> $@.tmp; \
|
|
done
|
|
$(AM_V_at)echo "" >> $@.tmp
|
|
$(AM_V_at)mv $@.tmp $@
|
|
endif
|
|
|
|
if HAVE_MERGE_PLUGINS
|
|
BUILT_SOURCES += vlc_modules_manifest.h
|
|
CLEANFILES += vlc_modules_manifest.h
|
|
endif
|
|
|
|
libvlc_plugin_frameworks = \
|
|
-Wl,-framework,CoreFoundation,-framework,Foundation \
|
|
-Wl,-framework,CoreAudio,-framework,AudioToolbox \
|
|
-Wl,-framework,CoreVideo,-framework,QuartzCore \
|
|
-Wl,-framework,OpenGLES,-framework,UIKit \
|
|
-Wl,-framework,Security,-framework,AVFoundation \
|
|
-Wl,-framework,CoreImage,-framework,CoreGraphics \
|
|
-Wl,-framework,VideoToolbox,-framework,Security \
|
|
-Wl,-framework,CoreMedia,-framework,CoreText
|
|
|
|
libvlc_static_modules_la_SOURCES = plugin_static.c
|
|
libvlc_static_modules_la_CFLAGS =
|
|
libvlc_static_modules_la_LDFLAGS = \
|
|
-static -export-symbols-regex ^vlc_entry \
|
|
$(top_builddir)/compat/libcompat.la $(LTLIBVLCCORE)
|
|
libvlc_static_modules_la_LIBADD = $(PARTIAL_PLUGINS)
|
|
if HAVE_IOS
|
|
libvlc_static_modules_la_LDFLAGS += $(libvlc_plugin_frameworks)
|
|
endif
|
|
if HAVE_TVOS
|
|
libvlc_static_modules_la_LDFLAGS += $(libvlc_plugin_frameworks)
|
|
endif
|
|
EXTRA_libvlc_static_modules_la_DEPENDENCIES = vlc_modules_manifest.h
|
|
|
|
../src/vlccore.framework/vlccore: $(LTLIBVLCCORE)
|
|
mkdir -p $(shell dirname $@)
|
|
cp ../src/.libs/libvlccore.dylib $@
|
|
|
|
EXTRA_libvlc_plugin_la_SOURCES = dummy.cpp
|
|
libvlc_plugin_la_SOURCES = plugin_static.c
|
|
libvlc_plugin_la_CFLAGS =
|
|
libvlc_plugin_la_LDFLAGS = \
|
|
-avoid-version -module \
|
|
-export-symbols-regex ^vlc_entry \
|
|
-shrext $(LIBEXT) \
|
|
-no-undefined \
|
|
$(top_builddir)/compat/libcompat.la \
|
|
-Wl,-F../src/ -Wl,-framework,vlccore
|
|
if HAVE_TVOS
|
|
libvlc_plugin_la_LDFLAGS += $(libvlc_plugin_frameworks)
|
|
endif
|
|
libvlc_plugin_la_LIBADD = $(PARTIAL_PLUGINS)
|
|
EXTRA_libvlc_plugin_la_DEPENDENCIES = vlc_modules_manifest.h ../src/vlccore.framework/vlccore
|
|
|
|
if HAVE_IOS
|
|
libvlc_plugin_la_LDFLAGS += -avoid-version
|
|
endif
|
|
if HAVE_TVOS
|
|
libvlc_plugin_la_LDFLAGS += -avoid-version -Xlinker -install_name -Xlinker @rpath/vlc_plugin.framework/vlc_plugin
|
|
endif
|
|
|
|
if HAVE_OSX
|
|
libvlc_plugin_la_LDFLAGS += \
|
|
-rpath '$(pkglibdir)' \
|
|
-Wl,-framework,CoreFoundation,-framework,Foundation \
|
|
-Wl,-framework,CoreAudio,-framework,AudioToolbox \
|
|
-Wl,-framework,CoreVideo,-framework,QuartzCore \
|
|
-Wl,-framework,OpenGL,-framework,Cocoa \
|
|
-Wl,-framework,Security,-framework,AVFoundation \
|
|
-Wl,-framework,CoreImage,-framework,IOKit \
|
|
-Wl,-framework,SystemConfiguration,-framework,ScriptingBridge \
|
|
-Wl,-weak_framework,MediaPlayer,-framework,WebKit
|
|
endif
|
|
|
|
if HAVE_MERGE_PLUGINS
|
|
if HAVE_DYNAMIC_PLUGINS
|
|
pkglib_LTLIBRARIES += libvlc_plugin.la
|
|
else
|
|
pkglib_LTLIBRARIES += libvlc_static_modules.la
|
|
endif
|
|
endif
|
|
|