]> git.sesse.net Git - vlc/blobdiff - configure.ac
sndio: remove amplification until proper implementation
[vlc] / configure.ac
index 4141499dd677c68c1fe35fb5fe7ff84dcdaaf846..1f7916493ce16bb4a1c4b14c45a857e1bc379252 100644 (file)
@@ -173,29 +173,34 @@ case "${host_os}" in
             AC_LIBOBJ([strnlen])],)
 
     dnl
-    dnl  Check for Mac OS X SDK settings
+    dnl  Handle Mac OS X SDK flags
     dnl
     AC_ARG_WITH(macosx-sdk,
       [AS_HELP_STRING([--with-macosx-sdk=DIR],
         [compile using the SDK in DIR])])
-    test "${with_macosx_sdk}" = "" && with_macosx_sdk=/Developer/SDKs/MacOSX10.6.sdk
-    test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
+    if test "${with_macosx_sdk}" != "" ; then
+        test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
+        CPP="${CPP} -isysroot ${with_macosx_sdk}"
+        CC="${CC} -isysroot ${with_macosx_sdk}"
+        CXX="${CXX} -isysroot ${with_macosx_sdk}"
+        OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
+        LD="${LD} -syslibroot ${with_macosx_sdk}"
+    fi
     AC_ARG_WITH(macosx-version-min,
       [AS_HELP_STRING([--with-macosx-version-min=VERSION],
-        [compile for MacOS X VERSION and above])])
-    if test "${with_macosx_version_min}" = "" ; then
-       with_macosx_version_min=10.5
+        [compile for Mac OS X VERSION and above])])
+    if test "${with_macosx_version_min}" != "" ; then
+        MACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}
+        CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
+        CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
+        CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
+        OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
+        LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
+        CFLAGS="${CFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
+        CXXFLAGS="${CXXFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
+        OBJCFLAGS="${OBJCFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
+        export MACOSX_DEPLOYMENT_TARGET
     fi
-    MACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}
-    CPP="${CPP} -isysroot ${with_macosx_sdk} -mmacosx-version-min=${with_macosx_version_min}"
-    CC="${CC} -isysroot ${with_macosx_sdk} -mmacosx-version-min=${with_macosx_version_min}"
-    CXX="${CXX} -isysroot ${with_macosx_sdk} -mmacosx-version-min=${with_macosx_version_min}"
-    OBJC="${OBJC} -isysroot ${with_macosx_sdk} -mmacosx-version-min=${with_macosx_version_min}"
-    LD="${LD} -syslibroot ${with_macosx_sdk} -mmacosx_version_min=${with_macosx_version_min}"
-    CFLAGS="${CFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
-    CXXFLAGS="${CXXFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
-    OBJCFLAGS="${OBJCFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
-    export MACOSX_DEPLOYMENT_TARGET
     ;;
   *mingw32* | *cygwin* | *wince* | *mingwce*)
     AC_CHECK_TOOL(WINDRES, windres, :)
@@ -3138,33 +3143,40 @@ then
 fi
 
 AC_ARG_ENABLE(directx,
-  [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
-if test "${enable_directx}" != "no"; then
-  if test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"; then
-      dnl DDraw
-      AC_CHECK_HEADERS(ddraw.h,
-      [ VLC_ADD_PLUGIN([directx aout_directx])
-        VLC_ADD_LIBS([directx],[-luser32 -lgdi32])
-      ],[AC_MSG_ERROR([Cannot find DirectX headers!])]
-      )
-
-      dnl OpenGL
-      AC_CHECK_HEADERS(GL/wglew.h,
-      [ VLC_ADD_PLUGIN([glwin32])
-        VLC_ADD_LIBS([glwin32],[-lopengl32 -lgdi32])
-      ],[],[
-        #include <windows.h>
-        #include <GL/gl.h>
-      ])
+  [AS_HELP_STRING([--enable-directx],
+    [Microsoft DirectX support (default enabled on Windows)])],, [
+  AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"], [
+    enable_directx="yes"
+  ], [
+    enable_directx="no"
+  ])
+])
+have_directx="no"
+AS_IF([test "${enable_directx}" != "no"], [
+  dnl DirectDraw
+  AC_CHECK_HEADERS(ddraw.h, [
+    have_directx="yes"
+  ], [
+    AC_MSG_ERROR([Cannot find DirectX headers!])
+  ])
 
-      dnl Direct3D
-      AC_CHECK_HEADERS(d3d9.h,
-      [ VLC_ADD_PLUGIN([direct3d])
-        VLC_ADD_LIBS([direct3d],[-lgdi32])
-      ])
-      VLC_ADD_LIBS([direct3d directx glwin32],[-lole32 -luuid])
-  fi
-fi
+  dnl OpenGL
+  AC_CHECK_HEADERS(GL/wglew.h, [
+    VLC_ADD_PLUGIN([glwin32])
+    VLC_ADD_LIBS([glwin32],[-lopengl32 -lgdi32])
+   ],, [
+     #include <windows.h>
+     #include <GL/gl.h>
+   ])
+
+   dnl Direct3D
+   AC_CHECK_HEADERS(d3d9.h, [
+     VLC_ADD_PLUGIN([direct3d])
+     VLC_ADD_LIBS([direct3d],[-lgdi32])
+   ])
+   VLC_ADD_LIBS([direct3d glwin32],[-lole32 -luuid])
+])
+AM_CONDITIONAL([HAVE_DIRECTX], [test "$have_directx" = "yes"])
 
 dnl
 dnl  Windows Direct2D plugin
@@ -3557,64 +3569,71 @@ AS_IF([test "${enable_hildon}" = "yes"], [
 AM_CONDITIONAL(BUILD_HILDON, [test "${enable_hildon}" = "yes"])
 
 dnl
-dnl QT 4
+dnl QT
 dnl
-AC_ARG_ENABLE(qt4,
-  [  --enable-qt4            Qt 4 support (default enabled) ],, [
-  AS_IF([test "${SYS}" = "darwin"], [enable_qt4=no])
+AC_ARG_ENABLE(qt, [
+  AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
+  AS_IF([test "${SYS}" = "darwin"], [
+    enable_qt="no"
+  ])
 ])
-AS_IF([test "${enable_qt4}" != "no"], [
-  PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.6.0], [
-    VLC_ADD_PLUGIN([qt4])
-    VLC_ADD_LIBS([qt4],[${QT4_LIBS}])
-    VLC_ADD_CXXFLAGS([qt4],[${QT4_CFLAGS}])
-    ALIASES="${ALIASES} qvlc"
-
-    AC_LANG_PUSH([C++])
-    VLC_SAVE_FLAGS
+AS_IF([test "${enable_qt}" != "no"], [
+  PKG_CHECK_MODULES([QT], [QtCore >= 5 QtWidgets QtGui],, [
+    PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.6.0],, [
+      AS_IF([test -n "${enable_qt}"],[
+        AC_MSG_ERROR([${QT_PKG_ERRORS}.])
+      ],[
+        AC_MSG_WARN([${QT_PKG_ERRORS}.])
+      ])
+      enable_qt="no"
+    ])
+  ])
+])
+AS_IF([test "${enable_qt}" != "no"], [
+  VLC_ADD_PLUGIN([qt4])
+  VLC_ADD_LIBS([qt4],[${QT_LIBS}])
+  VLC_ADD_CXXFLAGS([qt4],[${QT_CFLAGS}])
+  ALIASES="${ALIASES} qvlc"
 
-    AC_MSG_CHECKING([whether Qt uses X11])
-    CPPFLAGS="${CPPFLAGS} ${QT4_CFLAGS}"
-    AC_PREPROC_IFELSE([AC_LANG_SOURCE([
+  AC_LANG_PUSH([C++])
+  VLC_SAVE_FLAGS
+
+  AC_MSG_CHECKING([whether Qt uses Xlib])
+  CPPFLAGS="${CPPFLAGS} ${QT_CFLAGS}"
+  AC_PREPROC_IFELSE([AC_LANG_SOURCE([
 #include <QWidget>
 #if !defined (Q_WS_X11)
 # error Fail
 #endif
-    ])], [
-      AC_MSG_RESULT([yes])
-      VLC_ADD_LIBS([qt4],[${X_LIBS} ${X_PRE_LIBS} -lX11])
-      VLC_ADD_CXXFLAGS([qt4],[${X_CFLAGS}])
-    ], [
-      AC_MSG_RESULT([no])
-    ])
+  ])], [
+    AC_MSG_RESULT([yes])
+    VLC_ADD_LIBS([qt4],[${X_LIBS} ${X_PRE_LIBS} -lX11])
+    VLC_ADD_CXXFLAGS([qt4],[${X_CFLAGS}])
+  ], [
+    AC_MSG_RESULT([no])
+  ])
 
-    VLC_RESTORE_FLAGS
-    AC_LANG_POP([C++])
+  VLC_RESTORE_FLAGS
+  AC_LANG_POP([C++])
 
-    AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"], [
-        VLC_ADD_LIBS([qt4],[-lole32])
-    ])
-    AS_IF([test "${SYS}" = "darwin" ],[
-         VLC_ADD_LIBS([qt4], [-Wl,-framework,Cocoa])
-    ])
-    AC_PATH_PROGS(MOC, [moc-qt4 moc], moc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
-    AC_PATH_PROG(RCC, rcc, rcc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
-    AC_PATH_PROGS(UIC, [uic-qt4 uic], uic,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
-  ], [
-    AS_IF([test -n "${enable_qt4}"],[
-      AC_MSG_ERROR([${QT4_PKG_ERRORS}.])
-    ],[
-      AC_MSG_WARN([${QT4_PKG_ERRORS}.])
-    ])
-    enable_qt4="no"
+  AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"], [
+      VLC_ADD_LIBS([qt4],[-lole32])
   ])
+  AS_IF([test "${SYS}" = "darwin" ],[
+       VLC_ADD_LIBS([qt4], [-Wl,-framework,Cocoa])
+  ])
+
+  QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
+  AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, [${QT_PATH}/bin])
+  AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin])
+  AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, [${QT_PATH}/bin])
 ])
-AM_CONDITIONAL(ENABLE_QT4, [test "x$enable_qt4" != "xno"])
+AM_CONDITIONAL(ENABLE_QT4, [test "$enable_qt" != "no"])
 
 dnl
 dnl Simple test for skins2 dependency
 dnl
-AS_IF([test "x$enable_qt4" = "xno"], [
+AS_IF([test "$enable_qt" = "no"], [
   AS_IF([test "${enable_skins2}" = "yes"], [
     AC_MSG_ERROR([The skins2 module depends on the Qt4 interface. Without it you will not be able to open any dialog box from the interface, which makes the skins2 interface rather useless. Install the Qt4 development package or alternatively you can also configure with: --disable-qt4 --disable-skins2.])
   ], [