Commit 5f27fad5 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

- Build builtins before shared libvlc

- Link builtins with libvlc instead of vlc
  (seems to fix shared libvlc on Win32)
parent bf9be9eb
......@@ -225,7 +225,7 @@ else
LIB_libvlc = src/libvlc.a
endif
vlc_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin` $(vlc_WORKAROUNDLDFLAGS)
vlc_LDFLAGS = `$(VLC_CONFIG) --libs vlc` $(vlc_WORKAROUNDLDFLAGS)
vlc_LDADD = $(LIB_libvlc) $(DATA_win32_rc) $(INCLUDED_LIBINTL)
vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
......@@ -235,7 +235,7 @@ DEPENDENCIES_vlc = $(LIB_libvlc) $(DATA_win32_rc)
vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc) stamp-builtin
@rm -f vlc$(EXEEXT)
@case `$(VLC_CONFIG) --linkage vlc builtin` in \
@case `$(VLC_CONFIG) --linkage vlc` in \
c++) cmd="$(CXXLINK)" ;; \
objc) cmd="$(OBJCLINK)" ;; \
c|*) cmd="$(LINK)" ;; \
......
......@@ -110,6 +110,29 @@ misc/modules.c: misc/modules_builtin.h
misc/version.c: FORCE
$(TOOLBOX) --update-version
###############################################################################
# Building builtin modules
###############################################################################
#
# As long as we use builtins with a shared libvlc, we must build them before
# we build libvlc. Maybe one day, libvlc will handle multiple modules per
# shared object, which will make builtins fairly redumdant. Until then, we
# need this workaround.
builtins:
if BUILD_SHARED
@if test "$(pic)" = "pic"; then ext="_pic.a"; else ext=".a"; fi ; \
for c in `$(VLC_CONFIG) --libs builtin`; do \
case $$c in \
../modules/*.a) echo $$c ;; \
esac ; \
done | \
sed -e 's/^\(.*\)\/\([^\/]*\)\.a$$/cd \1 \&\& $(MAKE) \2/g' | \
while read cmd; do echo $$cmd$$ext; eval "($$cmd$$ext)" || exit $$? ; done
endif
.PHONY: builtins
###############################################################################
# Building libvlc
###############################################################################
......@@ -168,9 +191,9 @@ OBJECTS_libvlc_so = $(libvlc_pic_a_OBJECTS)
endif
endif
libvlc$(LIBEXT): $(OBJECTS_libvlc_so)
@ldfl="`$(VLC_CONFIG) --libs plugin vlc $(pic)` $(INCLUDED_LIBINTL)" ; \
case `$(VLC_CONFIG) --linkage vlc` in \
libvlc$(LIBEXT): $(OBJECTS_libvlc_so) builtins
@ldfl="`$(VLC_CONFIG) --libs plugin vlc builtin $(pic)` $(INCLUDED_LIBINTL)" ; \
case `$(VLC_CONFIG) --linkage vlc builtin` in \
c++) ld="$(CXXLINK)" ;; \
objc) ld="$(OBJCLINK)" ;; \
c|*) ld="$(LINK)" ;; \
......
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