Commit 8a605bab authored by Felix Paul Kühne's avatar Felix Paul Kühne

build system: add conditional variables to differenciate between iOS and OS X

This allows automagic enabling and disabling of the needed and useful aout and vout modules
parent ca7130d2
......@@ -97,6 +97,8 @@ dnl
dnl Check the operating system
dnl
HAVE_WIN64="0"
HAVE_IOS="0"
HAVE_OSX="0"
YASMFLAGS=""
case "${host}" in
......@@ -172,6 +174,17 @@ case "${host_os}" in
VLC_ADD_LIBS([avcodec access_avio swscale postproc i420_rgb_mmx x262 x264 x26410b],[-Wl,-read_only_relocs,suppress])
VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
AC_EGREP_CPP(yes,
[#import <TargetConditionals.h>
#if TARGET_OS_IPHONE
yes
#endif],
[HAVE_IOS="1"],
[HAVE_OSX="1"])
AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
dnl Allow binaries created on Lion to run on earlier releases
AC_EGREP_CPP(yes,
[#import <Cocoa/Cocoa.h>
......@@ -3102,29 +3115,6 @@ then
])
fi
dnl
dnl Mac Vout
AC_ARG_ENABLE(macosx-vout,
[ --enable-macosx-vout Mac OS X video output module (default enabled on Mac OS X)])
if test "x${enable_macosx_vout}" != "xno" &&
(test "${SYS}" = "darwin" || test "${enable_macosx_vout}" = "yes")
then
VLC_ADD_LIBS([vout_macosx],[-Wl,-framework,Cocoa])
VLC_ADD_LIBS([vout_macosx],[-Wl,-framework,OpenGL])
VLC_ADD_PLUGIN([vout_macosx])
fi
dnl
dnl Mac CoreGraphics Layer Vout
AC_ARG_ENABLE(coregraphicslayer-vout,
[ --enable-coregraphicslayer-vout CoreGraphics layered video output module (default disabled)])
if test "${enable_coregraphicslayer_vout}" = "yes"; then
VLC_ADD_LIBS([vout_coregraphicslayer],[-Wl,-framework,Cocoa])
VLC_ADD_LIBS([vout_coregraphicslayer],[-Wl,-framework,QuartzCore])
VLC_ADD_PLUGIN([vout_coregraphicslayer])
fi
dnl
dnl freetype module
dnl
......@@ -3230,19 +3220,6 @@ if test "${enable_android_surface}" = "yes"; then
fi
fi
dnl
dnl iOS ES2 vout module
dnl
AC_ARG_ENABLE(ios-vout2,
[ --enable-ios-vout2 iOS video output module (default disabled)])
if test "${enable_ios_vout2}" = "yes"
then
VLC_ADD_PLUGIN([vout_ios2])
VLC_ADD_LIBS([vout_ios2], [-Wl,-framework,OpenGLES,-framework,QuartzCore,-framework,UIKit])
fi
dnl
dnl Windows DirectX module
dnl
......@@ -3521,31 +3498,6 @@ AS_IF([test "$enable_wasapi" != "no"], [
])
AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
dnl
dnl CoreAudio plugin
dnl
AC_ARG_ENABLE(macosx-audio,
[ --enable-macosx-audio Mac OS X audio module (default enabled on MacOS X)])
if test "x${enable_macosx_audio}" != "xno" &&
(test "${SYS}" = "darwin" || test "${enable_macosx_audio}" = "yes")
then
AC_CHECK_HEADER([CoreAudio/CoreAudio.h],
[ VLC_ADD_PLUGIN([auhal])
], [ AC_MSG_ERROR([cannot find CoreAudio headers]) ])
fi
dnl
dnl iOS CoreAudio plugin
dnl
AC_ARG_ENABLE(ios-audio,
[ --enable-ios-audio Audio module for iOS (default disabled)])
if test "${enable_ios_audio}" = "yes"
then
AC_CHECK_HEADER([AudioUnit/AudioUnit.h],
[ VLC_ADD_PLUGIN([audiounit_ios])
], [ AC_MSG_ERROR([cannot find AudioUnit headers]) ])
fi
dnl
dnl AudioQueue plugin
dnl
......
......@@ -101,10 +101,16 @@ endif
libauhal_plugin_la_SOURCES = audio_output/auhal.c \
audio_output/TPCircularBuffer.h audio_output/TPCircularBuffer.c
libauhal_plugin_la_LDFLAGS = $(AM_LDFLAGS) -Wl,-framework,CoreAudio,-framework,AudioUnit,-framework,AudioToolbox,-framework,CoreServices -rpath '$(aoutdir)'
if HAVE_OSX
aout_LTLIBRARIES += libauhal_plugin.la
endif
libaudiounit_ios_plugin_la_SOURCES = audio_output/audiounit_ios.c \
audio_output/TPCircularBuffer.h audio_output/TPCircularBuffer.c
libaudiounit_ios_plugin_la_LDFLAGS = $(libauhal_plugin_la_LDFLAGS)
if HAVE_IOS
aout_LTLIBRARIES += libaudiounit_ios_plugin.la
endif
libaudioqueue_plugin_la_SOURCES = audio_output/audioqueue.c
libaudioqueue_plugin_la_LDFLAGS = $(AM_LDFLAGS) -Wl,-framework,CoreAudio,-framework,AudioUnit,-framework,AudioToolbox,-framework,CoreServices -rpath '$(aoutdir)'
EXTRA_LTLIBRARIES += libauhal_plugin.la libaudiounit_ios_plugin.la libaudioqueue_plugin.la
aout_LTLIBRARIES += $(LTLIBauhal) $(LTLIBaudiounit_ios) $(LTLIBaudioqueue)
EXTRA_LTLIBRARIES += libaudioqueue_plugin.la
......@@ -9,9 +9,6 @@ SOURCES_vout_sdl = sdl.c
SOURCES_directfb = directfb.c
SOURCES_vmem = vmem.c
SOURCES_yuv = yuv.c
SOURCES_vout_macosx = macosx.m opengl.h opengl.c
SOURCES_vout_coregraphicslayer = coregraphicslayer.m
SOURCES_vout_ios2 = ios2.m opengl.h opengl.c
SOURCES_android_surface = android/surface.c android/utils.c
SOURCES_android_opaque = android/opaque.c
......@@ -22,12 +19,29 @@ libdecklinkoutput_plugin_la_LIBADD = $(LIBS_decklink) $(LIBDL)
vout_LTLIBRARIES += libdecklinkoutput_plugin.la
endif
if HAVE_DARWIN
if HAVE_OSX
libvout_macosx_plugin_la_SOURCES = macosx.m opengl.c opengl.h
libvout_macosx_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS)
libvout_macosx_plugin_la_LIBADD = $(GL_LIBS)
libvout_macosx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -Wl,-framework,OpenGL,-framework,Cocoa
libvout_coregraphicslayer_plugin_la_SOURCES = coregraphicslayer.m
libvout_coregraphicslayer_plugin_la_CFLAGS = $(AM_CFLAGS)
libvout_coregraphicslayer_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -Wl,-framework,OpenGL,-framework,Cocoa,-framework,QuartzCore
libcaopengllayer_plugin_la_SOURCES = caopengllayer.m opengl.c opengl.h
libcaopengllayer_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS)
libcaopengllayer_plugin_la_LIBADD = $(GL_LIBS)
libcaopengllayer_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -Wl,-framework,OpenGL,-framework,Cocoa,-framework,QuartzCore
vout_LTLIBRARIES += libcaopengllayer_plugin.la
vout_LTLIBRARIES += libvout_macosx_plugin.la libvout_coregraphicslayer_plugin.la libcaopengllayer_plugin.la
endif
if HAVE_IOS
libvout_ios2_plugin_la_SOURCES = ios2.m opengl.h opengl.c
libvout_ios2_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS)
libvout_ios2_plugin_la_LIBADD = $(GL_LIBS)
libvout_ios2_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' -Wl,-framework,OpenGLES,-framework,QuartzCore,-framework,UIKit
vout_LTLIBRARIES += libvout_ios2_plugin.la
endif
### OpenGL ###
......
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