]> git.sesse.net Git - vlc/blobdiff - configure.ac
Allow overriding _WIN32_WINNT through CPPFLAGS
[vlc] / configure.ac
index aabbe79b7af7b637cb0a568d40f281552df35f86..9192c109209417efcbbcf5657e5114df17f6314e 100644 (file)
@@ -1,6 +1,6 @@
 dnl Autoconf settings for vlc
 
-AC_COPYRIGHT([Copyright 2002-2012 VLC authors and VideoLAN])
+AC_COPYRIGHT([Copyright 2002-2013 VLC authors and VideoLAN])
 
 AC_INIT(vlc, 2.1.0-git)
 VERSION_MAJOR=2
@@ -14,7 +14,7 @@ AC_SUBST(PKGDIR)
 
 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
 CODENAME="Rincewind"
-COPYRIGHT_YEARS="1996-2012"
+COPYRIGHT_YEARS="1996-2013"
 
 AC_CONFIG_SRCDIR(src/libvlc.c)
 AC_CONFIG_AUX_DIR(autotools)
@@ -25,7 +25,7 @@ AC_CANONICAL_HOST
 AC_PRESERVE_HELP_ORDER
 
 AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS([config.h])
 
 # Disable with "./configure --disable-silent-rules" or "make V=1"
 AM_SILENT_RULES([yes])
@@ -205,8 +205,12 @@ case "${host_os}" in
   *mingw32* | *cygwin* | *wince* | *mingwce*)
     AC_CHECK_TOOL(WINDRES, windres, :)
     AC_CHECK_TOOL(OBJCOPY, objcopy, :)
-    AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows XP SP2 APIs.])
+    AH_TOP([#if defined(WIN32) && !defined(_WIN32_WINNT)])
+    AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
+    AH_TOP([#endif])
     AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
+    AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
+    AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
 
     case "${host_os}" in
       *mingw32*)
@@ -459,6 +463,16 @@ dnl Check for fnative-struct or mms-bitfields support for mingw32
     fi
 ])
 
+AC_ARG_ENABLE(winstore_app,
+     AS_HELP_STRING([--enable-winstore-app],
+                    [Build targetted for Windows Store apps (default disabled)]))
+
+AS_IF([test "${SYS}" = "mingw32"], [
+    AS_IF([test "${enable_winstore_app}" == "yes"], [
+       AC_DEFINE(WINAPI_FAMILY_APP, 1, [Define if you want to build for Windows Store apps])])
+    ])
+
+
 dnl
 dnl Buggy glibc prevention. Purposedly not cached.
 dnl See sourceware.org bugs 5058 and 5443.
@@ -492,7 +506,7 @@ need_libc=false
 dnl Check for usual libc functions
 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
 AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
-AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
+AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
 AC_CHECK_FUNCS(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
 ])
@@ -1745,21 +1759,25 @@ AC_ARG_ENABLE(decklink,
 AC_ARG_WITH(decklink_sdk,
   [AS_HELP_STRING[--with-decklink-sdk=DIR],
     [                        location of Blackmagic DeckLink SDI SDK])])
+have_decklink=no
 if test "${enable_decklink}" != "no"
 then
   if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
   then
-    VLC_ADD_CPPFLAGS([decklink],[-I${with_decklink_sdk}/include])
+    VLC_ADD_CXXFLAGS([decklink],[-I${with_decklink_sdk}/include])
   fi
   VLC_SAVE_FLAGS
-  CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
+  CXXFLAGS="${CXXFLAGS} ${CXXFLAGS_decklink}"
   AC_LANG_PUSH(C++)
   AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
-    VLC_ADD_PLUGIN([decklink])
-  ],[AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)])
+      have_decklink=yes
+  ], [
+      AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
+  ])
   AC_LANG_POP(C++)
   VLC_RESTORE_FLAGS
 fi
+AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
 
 
 dnl
@@ -2576,11 +2594,6 @@ then
   fi
 fi
 
-AC_ARG_WITH(a52-fixed,
-      [  --with-a52-fixed        specify if liba52 has been compiled with fixed point support],
-      [
-        VLC_ADD_CPPFLAGS([a52tofloat32],[-DLIBA52_FIXED]) ])
-
 dnl
 dnl DTS Coherent Acoustics decoder plugin
 dnl
@@ -2946,13 +2959,18 @@ AS_IF([test "${enable_xcb}" != "no"], [
     AC_MSG_WARN([${XCB_RANDR_PKG_ERRORS}. Panoramix filter will not be supported.])
   ])
 
-  dnl xcb-utils
-  PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [
-    PKG_CHECK_MODULES(XPROTO, [xproto])
-    VLC_ADD_PLUGIN([globalhotkeys])
-    VLC_ADD_CFLAGS([xcb_window], [-DHAVE_XCB_KEYSYMS])
+  PKG_CHECK_MODULES(XPROTO, [xproto], [
+    VLC_ADD_PLUGIN([xwd])
+
+    dnl xcb-utils
+    PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [
+      VLC_ADD_PLUGIN([globalhotkeys])
+      VLC_ADD_CFLAGS([xcb_window], [-DHAVE_XCB_KEYSYMS])
+    ], [
+      AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
+    ])
   ], [
-    AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
+    AC_MSG_WARN([${XPROTO_PKG_ERRORS}. Hotkeys and XWD will not work.])
   ])
 
   AS_IF([test "${enable_glx}" != "no"], [
@@ -2966,6 +2984,44 @@ AS_IF([test "${enable_xcb}" != "no"], [
 ])
 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
 
+
+dnl
+dnl VDPAU needs X11 and avcodec
+dnl
+AC_ARG_ENABLE(vdpau,
+  [AS_HELP_STRING([--enable-vdpau],
+    [VDPAU hardware decoder support (default auto)])])
+have_vdpau="no"
+AS_IF([test "${enable_vdpau}" != "no"], [
+  PKG_CHECK_MODULES([VDPAU], [vdpau], [
+    have_vdpau="yes"
+    AS_IF([test "${no_x}" = "yes"], [
+      AC_MSG_ERROR([VDPAU requires Xlib (X11).])
+    ])
+    AC_MSG_NOTICE([VDPAU acceleration activated])
+  ], [
+    AS_IF([test -n "${enable_vdpau}"], [
+      AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
+    ])
+  ])
+])
+dnl AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
+
+have_avcodec_vdpau="no"
+AS_IF([test "${have_vdpau}" = "yes"], [
+  PKG_CHECK_EXISTS([libavutil >= 0.52.4 libavcodec >= 54.36.0], [
+    have_avcodec_vdpau="yes"
+  ], [
+    AS_IF([test -n "${enable_vdpau}"], [
+      AC_MSG_ERROR([libavutil >= 0.52.4 and libavcodec >= 54.36.0 are required for VDPAU decoding.])
+    ], [
+      AC_MSG_WARN([libavutil >= 0.52.4 and libavcodec >= 54.36.0 are required for VDPAU decoding.])
+    ])
+  ])
+])
+AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
+
+
 dnl
 dnl  SDL module
 dnl
@@ -3321,11 +3377,11 @@ AC_ARG_ENABLE(alsa,
 ])
 have_alsa="no"
 AS_IF([test "${enable_alsa}" != "no"], [
-  PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.16], [
+  PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
     have_alsa="yes"
   ], [
     AS_IF([test "x${enable_alsa}" != "x"], [
-      AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.16 or later required.])
+      AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
     ])
   ])
 ])
@@ -3646,7 +3702,7 @@ AC_ARG_ENABLE(minimal-macosx,
   [  --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
 then
-  VLC_ADD_LIBS([minimal_macosx], [-Wl,-framework,Cocoa -Wl,-framework,OpenGL -Wl,-framework,Carbon -Wl,-framework,CoreServices -Wl,-framework,AGL])
+  VLC_ADD_LIBS([minimal_macosx], [-Wl,-framework,Cocoa])
   VLC_ADD_OBJCFLAGS([minimal_macosx], [-fobjc-exceptions] )
   VLC_ADD_PLUGIN([minimal_macosx])
 fi