From 79025b6c3eb3c75426fb5fa2519061c89f37abca Mon Sep 17 00:00:00 2001
From: Martell Malone <martellmalone@gmail.com>
Date: Mon, 18 May 2015 17:31:15 +0100
Subject: [PATCH] Only build correct modules for WINSTORE

---
Must look at libdirectsound and libmft.
They should be buildable but are not
Must find out why :)

diff --git a/Makefile.am b/Makefile.am
index 3c7831a..3448956 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -982,6 +982,7 @@ dist_noinst_SCRIPTS += test/run_vlc.sh
 # Installing plugins cache
 ###############################################################################
 install-exec-hook:
+if !HAVE_WINSTORE
 	if test "$(build)" = "$(host)"; then \
 		PATH="$(DESTDIR)$(bindir):$$PATH" \
 		LD_LIBRARY_PATH="$(DESTDIR)$(libdir):$$LD_LIBRARY_PATH" \
@@ -990,7 +991,7 @@ install-exec-hook:
 	else \
 		echo "Cross-compilation: cache generation skipped!" ; \
 	fi
-
+endif
 uninstall-hook:
 	rm -f -- "$(DESTDIR)$(vlclibdir)/plugins/plugins.dat"
 
diff --git a/modules/access/Makefile.am b/modules/access/Makefile.am
index 5ded5f5..5290525 100644
--- a/modules/access/Makefile.am
+++ b/modules/access/Makefile.am
@@ -267,8 +267,10 @@ if HAVE_DARWIN
 libcdda_plugin_la_LIBADD += -liconv
 libcdda_plugin_la_LDFLAGS += -Wl,-framework,IOKit,-framework,CoreFoundation
 endif
+if !HAVE_WINSTORE
 EXTRA_LTLIBRARIES += libcdda_plugin.la
 access_LTLIBRARIES += $(LTLIBcdda)
+endif
 
 libvcd_plugin_la_SOURCES = access/vcd/vcd.c access/vcd/cdrom.c access/vcd/cdrom.h access/vcd/cdrom_internals.h
 libvcd_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(accessdir)'
@@ -276,8 +278,10 @@ if HAVE_DARWIN
 libvcd_plugin_la_LIBADD = -liconv
 libvcd_plugin_la_LDFLAGS += -Wl,-framework,IOKit,-framework,CoreFoundation
 endif
+if !HAVE_WINSTORE
 EXTRA_LTLIBRARIES += libvcd_plugin.la
 access_LTLIBRARIES += $(LTLIBvcd)
+endif
 
 libvcdx_plugin_la_SOURCES = \
 	access/vcdx/access.h access/vcdx/access.c \
@@ -422,8 +426,10 @@ if HAVE_WIN32
 libsmb_plugin_la_LIBADD += -lmpr
 endif
 libsmb_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(accessdir)'
+if !HAVE_WINSTORE
 access_LTLIBRARIES += $(LTLIBsmb)
 EXTRA_LTLIBRARIES += libsmb_plugin.la
+endif
 
 libdsm_plugin_la_SOURCES = access/dsm/access.c access/dsm/sd.c
 libdsm_plugin_la_CFLAGS = $(AM_CFLAGS) $(DSM_CFLAGS)
diff --git a/modules/audio_filter/Makefile.am b/modules/audio_filter/Makefile.am
index c7b866e..fa6972e 100644
--- a/modules/audio_filter/Makefile.am
+++ b/modules/audio_filter/Makefile.am
@@ -1,22 +1,45 @@
 audio_filterdir = $(pluginsdir)/audio_filter
+audio_filter_LTLIBRARIES =
 
 libaudiobargraph_a_plugin_la_SOURCES = audio_filter/audiobargraph_a.c
 libaudiobargraph_a_plugin_la_LIBADD = $(LIBM)
+if !HAVE_WINSTORE
+audio_filter_LTLIBRARIES += libaudiobargraph_a_plugin.la
+endif
+
 libchorus_flanger_plugin_la_SOURCES = audio_filter/chorus_flanger.c
 libchorus_flanger_plugin_la_LIBADD = $(LIBM)
+audio_filter_LTLIBRARIES += libchorus_flanger_plugin.la
+
 libcompressor_plugin_la_SOURCES = audio_filter/compressor.c
 libcompressor_plugin_la_LIBADD = $(LIBM)
+audio_filter_LTLIBRARIES += libcompressor_plugin.la
+
 libequalizer_plugin_la_SOURCES = audio_filter/equalizer.c \
 	audio_filter/equalizer_presets.h
 libequalizer_plugin_la_LIBADD = $(LIBM)
+audio_filter_LTLIBRARIES += libequalizer_plugin.la
+
 libkaraoke_plugin_la_SOURCES = audio_filter/karaoke.c
+audio_filter_LTLIBRARIES += libkaraoke_plugin.la
+
 libnormvol_plugin_la_SOURCES = audio_filter/normvol.c
 libnormvol_plugin_la_LIBADD = $(LIBM)
+audio_filter_LTLIBRARIES += libnormvol_plugin.la
+
 libgain_plugin_la_SOURCES = audio_filter/gain.c
+audio_filter_LTLIBRARIES += libgain_plugin.la
+
 libparam_eq_plugin_la_SOURCES = audio_filter/param_eq.c
 libparam_eq_plugin_la_LIBADD = $(LIBM)
+audio_filter_LTLIBRARIES += libparam_eq_plugin.la
+
 libscaletempo_plugin_la_SOURCES = audio_filter/scaletempo.c
+audio_filter_LTLIBRARIES += libscaletempo_plugin.la
+
 libstereo_widen_plugin_la_SOURCES = audio_filter/stereo_widen.c
+audio_filter_LTLIBRARIES += libstereo_widen_plugin.la
+
 libspatializer_plugin_la_SOURCES = \
 	audio_filter/spatializer/allpass.cpp \
 	audio_filter/spatializer/allpass.hpp \
@@ -29,19 +52,8 @@ libspatializer_plugin_la_SOURCES = \
 	audio_filter/spatializer/revmodel.hpp \
 	audio_filter/spatializer/spatializer.cpp
 libspatializer_plugin_la_LIBADD = $(LIBM)
+audio_filter_LTLIBRARIES += libspatializer_plugin.la
 
-audio_filter_LTLIBRARIES = \
-	libaudiobargraph_a_plugin.la \
-	libchorus_flanger_plugin.la \
-	libcompressor_plugin.la \
-	libequalizer_plugin.la \
-	libkaraoke_plugin.la \
-	libnormvol_plugin.la \
-	libgain_plugin.la \
-	libparam_eq_plugin.la \
-	libscaletempo_plugin.la \
-	libspatializer_plugin.la \
-	libstereo_widen_plugin.la
 
 # Channel mixers
 libdolby_surround_decoder_plugin_la_SOURCES = \
diff --git a/modules/audio_output/Makefile.am b/modules/audio_output/Makefile.am
index 589e5fe..a0441b2 100644
--- a/modules/audio_output/Makefile.am
+++ b/modules/audio_output/Makefile.am
@@ -72,11 +72,14 @@ endif
 endif
 
 libdirectsound_plugin_la_SOURCES = audio_output/directsound.c \
+libdirectsound_plugin_la_CFLAGS = $(AM_CFLAGS)
 	audio_output/windows_audio_common.h
 libdirectsound_plugin_la_LIBADD = -lole32
 if HAVE_DIRECTX
+if !HAVE_WINSTORE
 aout_LTLIBRARIES += libdirectsound_plugin.la
 endif
+endif
 
 libkai_plugin_la_SOURCES = audio_output/kai.c
 libkai_plugin_la_LIBADD = $(KAI_LIBS)
@@ -94,8 +97,10 @@ libwaveout_plugin_la_SOURCES = audio_output/waveout.c \
 	audio_output/windows_audio_common.h
 libwaveout_plugin_la_LIBADD = -lwinmm
 if HAVE_WIN32
+if !HAVE_WINSTORE
 aout_LTLIBRARIES += libwaveout_plugin.la
 endif
+endif
 
 libauhal_plugin_la_SOURCES = audio_output/auhal.c \
 	audio_output/TPCircularBuffer.h audio_output/TPCircularBuffer.c
diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index f173c0e..a29fab6 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -348,8 +348,10 @@ libdxva2_plugin_la_SOURCES = \
 	codec/avcodec/dxva2.c packetizer/h264_nal.c packetizer/h264_nal.h
 libdxva2_plugin_la_LIBADD = -lole32 -lshlwapi -luuid
 if HAVE_AVCODEC_DXVA2
+if !HAVE_WINSTORE
 codec_LTLIBRARIES += libdxva2_plugin.la
 endif
+endif
 
 libvda_plugin_la_SOURCES = \
 	video_chroma/copy.c video_chroma/copy.h \
@@ -481,8 +483,10 @@ codec_LTLIBRARIES += $(LTLIBtwolame)
 libcrystalhd_plugin_la_SOURCES = codec/crystalhd.c packetizer/h264_nal.c packetizer/h264_nal.h
 libcrystalhd_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)'
 libcrystalhd_plugin_la_LIBADD = $(LIBS_crystalhd)
+if !HAVE_WINSTORE
 EXTRA_LTLIBRARIES += libcrystalhd_plugin.la
 codec_LTLIBRARIES += $(LTLIBcrystalhd)
+endif
 
 libqsv_plugin_la_SOURCES = codec/qsv.c
 libqsv_plugin_la_CFLAGS = $(AM_CFLAGS) $(MFX_CFLAGS)
@@ -498,21 +502,27 @@ libdmo_plugin_la_SOURCES = codec/dmo/dmo.c codec/dmo/dmo.h codec/dmo/buffer.c
 libqsv_plugin_la_CPPFLAGS = $(AM_CPPFLAGS)
 libdmo_plugin_la_LIBADD = $(LIBM)
 if HAVE_WIN32
+if !HAVE_WINSTORE
 libdmo_plugin_la_LIBADD += -lole32 -luuid
 codec_LTLIBRARIES += libdmo_plugin.la
 endif
+endif
 
 libmft_plugin_la_SOURCES = codec/mft.c packetizer/h264_nal.c packetizer/h264_nal.h
 if HAVE_WIN32
+if !HAVE_WINSTORE
 libmft_plugin_la_LIBADD = -lole32 -luuid -lmfuuid -lmfplat
 codec_LTLIBRARIES += libmft_plugin.la
 endif
+endif
 
 libquicktime_plugin_la_SOURCES = codec/quicktime.c
 libquicktime_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)'
 libquicktime_plugin_la_LIBADD = $(LIBM)
+if !HAVE_WINSTORE
 EXTRA_LTLIBRARIES += libquicktime_plugin.la
 codec_LTLIBRARIES += $(LTLIBquicktime)
+endif
 
 libgstdecode_plugin_la_SOURCES = codec/gstdecode.c
 libgstdecode_plugin_la_CFLAGS = $(AM_CFLAGS) $(GST_VIDEO_CFLAGS) $(GST_APP_CFLAGS)
diff --git a/modules/control/Makefile.am b/modules/control/Makefile.am
index 06f258c..8f56eae 100644
--- a/modules/control/Makefile.am
+++ b/modules/control/Makefile.am
@@ -1,20 +1,28 @@
 controldir = $(pluginsdir)/control
+control_LTLIBRARIES =
 
 libdummy_plugin_la_SOURCES = control/dummy.c control/intromsg.h
+control_LTLIBRARIES += libdummy_plugin.la
+
 libgestures_plugin_la_SOURCES = control/gestures.c
+control_LTLIBRARIES += libgestures_plugin.la
+
 libhotkeys_plugin_la_SOURCES = control/hotkeys.c
 libhotkeys_plugin_la_LIBADD = $(LIBM)
+control_LTLIBRARIES += libhotkeys_plugin.la
+
 libnetsync_plugin_la_SOURCES = control/netsync.c
 libnetsync_plugin_la_LIBADD = $(SOCKET_LIBS)
+if !HAVE_WINSTORE
+control_LTLIBRARIES += libnetsync_plugin.la
+endif
+
 liboldrc_plugin_la_SOURCES = control/oldrc.c control/intromsg.h
 liboldrc_plugin_la_LIBADD = $(SOCKET_LIBS) $(LIBM)
 
-control_LTLIBRARIES = \
-	libdummy_plugin.la \
-	libgestures_plugin.la \
-	libhotkeys_plugin.la \
-	libnetsync_plugin.la \
-	liboldrc_plugin.la
+if !HAVE_WINSTORE
+control_LTLIBRARIES += liboldrc_plugin.la
+endif
 
 liblirc_plugin_la_SOURCES = control/lirc.c
 liblirc_plugin_la_LIBADD = -llirc_client
@@ -64,8 +72,8 @@ libntservice_plugin_la_SOURCES = control/ntservice.c
 libwin_hotkeys_plugin_la_SOURCES = control/globalhotkeys/win32.c
 libwin_msg_plugin_la_SOURCES = control/win_msg.c
 if HAVE_WIN32
-control_LTLIBRARIES += libntservice_plugin.la
 if !HAVE_WINSTORE
+control_LTLIBRARIES += libntservice_plugin.la
 control_LTLIBRARIES += libwin_hotkeys_plugin.la libwin_msg_plugin.la
 endif
 endif
diff --git a/modules/services_discovery/Makefile.am b/modules/services_discovery/Makefile.am
index 11fca94..42096ce 100644
--- a/modules/services_discovery/Makefile.am
+++ b/modules/services_discovery/Makefile.am
@@ -11,7 +11,9 @@ sd_LTLIBRARIES += libpodcast_plugin.la
 libsap_plugin_la_SOURCES = services_discovery/sap.c
 libsap_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_sap)
 libsap_plugin_la_LIBADD = $(LIBS_sap) $(SOCKET_LIBS)
+if !HAVE_WINSTORE
 sd_LTLIBRARIES += libsap_plugin.la
+endif
 
 libbonjour_plugin_la_SOURCES = services_discovery/bonjour.c
 libbonjour_plugin_la_CFLAGS = $(AM_CFLAGS) $(BONJOUR_CFLAGS)
@@ -61,8 +63,10 @@ endif
 
 libwindrive_plugin_la_SOURCES = services_discovery/windrive.c
 if HAVE_WIN32
+if !HAVE_WINSTORE
 sd_LTLIBRARIES += libwindrive_plugin.la
 endif
+endif
 
 libos2drive_plugin_la_SOURCES = services_discovery/os2drive.c
 if HAVE_OS2
diff --git a/modules/video_filter/Makefile.am b/modules/video_filter/Makefile.am
index dc2b5b4..882758d 100644
--- a/modules/video_filter/Makefile.am
+++ b/modules/video_filter/Makefile.am
@@ -128,8 +128,10 @@ libatmo_plugin_la_SOURCES = video_filter/atmo/atmo.cpp \
 	video_filter/atmo/FnordlichtConnection.cpp video_filter/atmo/FnordlichtConnection.h \
 	video_filter/atmo/AtmoPacketQueue.cpp video_filter/atmo/AtmoPacketQueue.h
 libatmo_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)'
+if !HAVE_WINSTORE
 video_filter_LTLIBRARIES += $(LTLIBatmo)
 EXTRA_LTLIBRARIES += libatmo_plugin.la
+endif
 
 libdeinterlace_plugin_la_SOURCES = \
 	video_filter/deinterlace/deinterlace.c video_filter/deinterlace/deinterlace.h \
diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am
index 5aaeafb..943ad6a 100644
--- a/modules/video_output/Makefile.am
+++ b/modules/video_output/Makefile.am
@@ -166,8 +166,10 @@ libdirect2d_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
 	-DMODULE_NAME_IS_direct2d
 libdirect2d_plugin_la_LIBADD = -lgdi32 -lole32 -luuid
 libdirect2d_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
+if !HAVE_WINSTORE
 vout_LTLIBRARIES += $(LTLIBdirect2d)
 EXTRA_LTLIBRARIES += libdirect2d_plugin.la
+endif
 
 libdirect3d9_plugin_la_SOURCES = video_output/msw/direct3d9.c \
 	video_output/msw/common.c video_output/msw/common.h \
@@ -178,8 +180,10 @@ libdirect3d9_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
 	-DMODULE_NAME_IS_direct3d9
 libdirect3d9_plugin_la_LIBADD = -lgdi32 -lole32 -luuid
 libdirect3d9_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
+if !HAVE_WINSTORE
 vout_LTLIBRARIES += $(LTLIBdirect3d9)
 EXTRA_LTLIBRARIES += libdirect3d9_plugin.la
+endif
 
 libdirect3d11_plugin_la_SOURCES = video_output/msw/direct3d11.c \
  video_output/msw/common.c video_output/msw/common.h \
@@ -205,8 +209,10 @@ libdirectdraw_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
 	-DMODULE_NAME_IS_directdraw
 libdirectdraw_plugin_la_LIBADD = -luser32 -lgdi32 -lole32 -luuid
 if HAVE_DIRECTX
+if !HAVE_WINSTORE
 vout_LTLIBRARIES += libdirectdraw_plugin.la
 endif
+endif
 
 libglwin32_plugin_la_SOURCES = video_output/msw/glwin32.c \
 	video_output/opengl.c video_output/opengl.h \
diff --git a/modules/video_splitter/Makefile.am b/modules/video_splitter/Makefile.am
index f0e023c..f6f952b 100644
--- a/modules/video_splitter/Makefile.am
+++ b/modules/video_splitter/Makefile.am
@@ -12,7 +12,9 @@ libpanoramix_plugin_la_SOURCES = video_splitter/panoramix.c
 libpanoramix_plugin_la_CFLAGS = $(AM_CFLAGS)
 libpanoramix_plugin_la_LIBADD = $(LIBM)
 if HAVE_WIN32
+if !HAVE_WINSTORE
 splitter_LTLIBRARIES += libpanoramix_plugin.la
+endif
 else
 if HAVE_XCB_RANDR
 libpanoramix_plugin_la_CFLAGS += $(XCB_RANDR_CFLAGS)
-- 
2.4.1

