]> git.sesse.net Git - vlc/blobdiff - configure.ac
aout: mix and convert before slicing the audio packets
[vlc] / configure.ac
index c5bf290deff4129757be334f5096050fdf7e0a6d..014e07eab768ce4c0e24e6f74a2b0b90b3c7e465 100644 (file)
@@ -3,10 +3,12 @@ dnl Autoconf settings for vlc
 AC_COPYRIGHT([Copyright 2002-2011 the VideoLAN team])
 
 AC_INIT(vlc, 1.2.0-git)
-VERSION_MAJOR="1"
-VERSION_MINOR="2"
-VERSION_REVISION="0"
-VERSION_EXTRA="-git"
+VERSION_MAJOR=1
+VERSION_MINOR=2
+VERSION_REVISION=0
+VERSION_EXTRA=0
+VERSION_DEV=git
+
 PKGDIR="vlc"
 AC_SUBST(PKGDIR)
 
@@ -102,52 +104,76 @@ dnl
 dnl  Check for the contrib directory
 dnl
 AC_ARG_WITH(contrib,
-  [AS_HELP_STRING([--without-contrib],
-    [do not use the libraries in CONTRIB_DIR])])
-AC_ARG_VAR([CONTRIB_DIR], [directory containing pre-built contrib, overriding extras/contrib])
-AS_IF([test "${with_contrib}" != "no"],[
-  AS_IF([test -z "$CONTRIB_DIR"], [
-      topdir="`dirname $0`"
-      if test "`echo \"$topdir\" | cut -c 1`" != "/"; then
-         topdir="`pwd`/$topdir"
-      fi
-      CONTRIB_DIR="${topdir}/extras/contrib/hosts/${host}"
-      if ! test -d "$CONTRIB_DIR"
-      then
-        gccmachine=`$CC -dumpmachine`
-        CONTRIB_DIR="${topdir}/extras/contrib/hosts/${gccmachine}"
-      fi
+  [AS_HELP_STRING([--with-contrib[=DIR]],
+    [search for 3rd party libraries in DIR/include and DIR/lib])
+])
+AC_MSG_CHECKING([for 3rd party libraries path])
+AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
+  CONTRIB_DIR="${srcdir}/contrib/${host}"
+  AS_IF([test ! -d "${CONTRIB_DIR}"], [
+    echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
+    CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
+    AS_IF([test ! -d "${CONTRIB_DIR}"], [
+      echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
+      CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
+      AS_IF([test ! -d "${CONTRIB_DIR}"], [
+        echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
+        CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
+        AS_IF([test ! -d "${CONTRIB_DIR}"], [
+          echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
+          CONTRIB_DIR=""
+          AC_MSG_RESULT([not found])
+        ])
+      ])
+    ])
+  ])
+], [
+  AS_IF([test "${with_contrib}" != "no"], [
+    CONTRIB_DIR="${with_contrib}"
+  ], [
+    CONTRIB_DIR=""
+    AC_MSG_RESULT([disabled])
   ])
-  AC_MSG_CHECKING([for libs in ${CONTRIB_DIR}])
+])
+AS_IF([test -n "${CONTRIB_DIR}"], [
   AS_IF([test -d "${CONTRIB_DIR}/lib"],[
-    AC_MSG_RESULT([yes])
-    AC_SUBST(CONTRIB_DIR)
-    export PATH=${CONTRIB_DIR}/bin:$PATH
-    CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
-    CPPFLAGS_save="${CPPFLAGS_save} -I${CONTRIB_DIR}/include"
-    CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
-    CFLAGS_save="${CFLAGS_save} -I${CONTRIB_DIR}/include"
-    CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
-    CXXFLAGS_save="${CXXFLAGS_save} -I${CONTRIB_DIR}/include"
-    OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
-    OBJCFLAGS_save="${OBJCFLAGS_save} -I${CONTRIB_DIR}/include"
-    if test "$build" = "$host" -o "$PKG_CONFIG_LIBDIR"; then
-        export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
-    else
-        export PKG_CONFIG_LIBDIR="${CONTRIB_DIR}/lib/pkgconfig"
-    fi
-    LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
-    LDFLAGS_save="${LDFLAGS_save} -L${CONTRIB_DIR}/lib"
-
-    if test "${SYS}" = "darwin"; then
-      export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
-      export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
-    fi
-  ],[
-    AC_MSG_RESULT([no])
+    CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
+  ], [
+    echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
     CONTRIB_DIR=""
+    AC_MSG_RESULT([not usable])
   ])
+
 ])
+AS_IF([test -n "${CONTRIB_DIR}"], [
+  AC_MSG_RESULT([${CONTRIB_DIR}])
+  export PATH=${CONTRIB_DIR}/bin:$PATH
+  CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
+  CPPFLAGS_save="${CPPFLAGS_save} -I${CONTRIB_DIR}/include"
+  CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
+  CFLAGS_save="${CFLAGS_save} -I${CONTRIB_DIR}/include"
+  CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
+  CXXFLAGS_save="${CXXFLAGS_save} -I${CONTRIB_DIR}/include"
+  OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
+  OBJCFLAGS_save="${OBJCFLAGS_save} -I${CONTRIB_DIR}/include"
+  AS_IF([test "$build" = "$host" -o "$PKG_CONFIG_LIBDIR"], [
+    export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
+  ], [
+    export PKG_CONFIG_LIBDIR="${CONTRIB_DIR}/lib/pkgconfig"
+  ])
+  LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
+  LDFLAGS_save="${LDFLAGS_save} -L${CONTRIB_DIR}/lib"
+
+  AS_IF([test "${SYS}" = "darwin"], [
+    export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
+    export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
+  ])
+], [
+  AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
+    AC_MSG_ERROR([Third party libraries not found!])
+  ])
+])
+AC_SUBST(CONTRIB_DIR)
 
 dnl
 dnl  Set default values
@@ -567,7 +593,7 @@ need_libc=false
 
 dnl Check for usual libc functions
 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
-AC_CHECK_FUNCS([daemon fcntl fdopendir fstatvfs fork getenv getpwuid_r gettimeofday if_nameindex if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp uselocale])
+AC_CHECK_FUNCS([daemon fcntl fdopendir fstatvfs fork getenv getpwuid_r if_nameindex if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp uselocale])
 AC_REPLACE_FUNCS([asprintf atof atoll dirfd flockfile fsync getdelim getpid gmtime_r lldiv localtime_r nrand48 rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy vasprintf])
 AC_CHECK_FUNCS(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
@@ -676,29 +702,13 @@ AC_CHECK_FUNC(getopt_long,, [
 ])
 AC_SUBST(GNUGETOPT_LIBS)
 
-if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
 AC_CHECK_LIB(m,cos,[
-  VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom visual panoramix rotate noise grain scene kate flac lua chorus_flanger freetype],[-lm])
-])
-AC_CHECK_LIB(m,pow,[
-  VLC_ADD_LIBS([avcodec avformat access_avio swscale postproc i420_rgb faad twolame equalizer spatializer param_eq libvlccore freetype mod mpc dmo quicktime realvideo qt4],[-lm])
-])
-AC_CHECK_LIB(m,sqrt,[
-  VLC_ADD_LIBS([compressor headphone_channel_mixer normvol audiobargraph_a speex mono colorthres extract ball],[-lm])
-])
-AC_CHECK_LIB(m,ceil,[
-  VLC_ADD_LIBS([access_imem hotkeys mosaic],[-lm])
-])
-AC_CHECK_LIB(m,exp,[
-  VLC_ADD_LIBS([gaussianblur],[-lm])
-])
-AC_CHECK_LIB(m,round,[
-  VLC_ADD_LIBS([dbus],[-lm])
-])
-AC_CHECK_LIB(m,sqrtf,[
-  VLC_ADD_LIBS([x264],[-lm])
+  VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom visual panoramix rotate noise grain scene kate flac lua chorus_flanger freetype avcodec avformat access_avio swscale postproc i420_rgb faad twolame equalizer spatializer param_eq libvlccore freetype mod mpc dmo quicktime realvideo qt4 compressor headphone_channel_mixer normvol audiobargraph_a speex mono colorthres extract ball access_imem hotkeys mosaic gaussianblur dbus x264],[-lm])
+  LIBM="-lm"
+], [
+  LIBM=""
 ])
-fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
+AC_SUBST(LIBM)
 
 AC_CHECK_LIB(m,lrintf, [
   AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
@@ -1821,7 +1831,7 @@ if test "${enable_live555}" != "no"; then
           AC_MSG_WARN([The installed liveMedia version is too old:
 Version 2010.05.29 or later is required to proceed.
 You can get an updated one from http://www.live555.com/liveMedia .])
-          AS_IF([test "${enable_live555}" == "yes"], [
+          AS_IF([test "${enable_live555}" = "yes"], [
             AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable the plugin.])
           ])
         ],[
@@ -2555,13 +2565,13 @@ AS_IF([test "${enable_libva}" != "no"], [
            AC_DEFINE(HAVE_AVCODEC_VAAPI, 1, [Define if avcodec has to be built with VAAPI support.])
            echo "VAAPI acceleration activated"
         ],[
-       AS_IF([test "${enable_libva}" == "yes"],
+       AS_IF([test "${enable_libva}" = "yes"],
              [AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])],
               [AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])])
         ])
         VLC_RESTORE_FLAGS
       ],[
-       AS_IF([test "${enable_libva}" == "yes"],
+       AS_IF([test "${enable_libva}" = "yes"],
               [AC_MSG_ERROR([Could not find required libva.])],
               [AC_MSG_WARN([libva not found  ])])
       ])
@@ -2588,12 +2598,12 @@ AS_IF([test "${enable_dxva2}" != "no"], [
            AC_DEFINE(HAVE_AVCODEC_DXVA2, 1, [Define if avcodec has to be built with DxVA2 support.])
            echo "DxVA2 acceleration activated"
         ],[
-       AS_IF([test "${enable_dxva2}" == "yes"],
+       AS_IF([test "${enable_dxva2}" = "yes"],
              [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
               [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
         ])
       ],[
-       AS_IF([test "${enable_dxva2}" == "yes"],
+       AS_IF([test "${enable_dxva2}" = "yes"],
               [AC_MSG_ERROR([Could not find required dxva2api.h])],
               [AC_MSG_WARN([dxva2api.h not found])])
       ])
@@ -3355,7 +3365,7 @@ then
         VLC_ADD_LIBS([directx],[-lgdi32])
       ],[AC_MSG_ERROR([Cannot find DirectX headers!])]
       )
-      AC_CHECK_HEADERS(GL/gl.h,
+      AC_CHECK_HEADERS(GL/glext.h,
       [ VLC_ADD_PLUGIN([glwin32])
         VLC_ADD_LIBS([glwin32],[-lopengl32 -lgdi32])
       ])
@@ -3788,7 +3798,8 @@ dnl  MacOS X video output/gui modules
 dnl
 AC_ARG_ENABLE(macosx,
   [  --enable-macosx         Mac OS X gui support (default enabled on Mac OS X)])
-if test "x${enable_macosx}" = "xyes"
+if test "x${enable_macosx}" != "xno" &&
+(test "${SYS}" = "darwin" || test "${enable_macosx}" = "yes")
 then
   VLC_ADD_LDFLAGS([macosx minimal_macosx],[-Wl,-framework,Cocoa])
   VLC_ADD_LDFLAGS([macosx minimal_macosx],[-Wl,-framework,OpenGL])
@@ -4261,10 +4272,11 @@ AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string
 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
-AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,"${VERSION_MAJOR}", [version major number])
-AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,"${VERSION_MINOR}", [version minor number])
-AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,"${VERSION_REVISION}", [version minor number])
-AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,"${VERSION_EXTRA}", [version minor number])
+AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
+AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
+AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
+AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
+AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
 AC_SUBST(COPYRIGHT_MESSAGE)
 AC_SUBST(VERSION_MESSAGE)
 AC_SUBST(VERSION_MAJOR)
@@ -4275,13 +4287,6 @@ AC_SUBST(COPYRIGHT_YEARS)
 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami`", [user who ran configure])
 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1`", [compiler])
-dnl Win32 need s a numerical version_extra.
-case $( echo ${VERSION_EXTRA}|wc -m ) in
-       "1") VERSION_EXTRA_RC="0";;
-       "2") VERSION_EXTRA_RC=$( echo ${VERSION_EXTRA}|tr "abcdefghi" "123456789") ;;
-       *) VERSION_EXTRA_RC="99"
-esac
-AC_SUBST(VERSION_EXTRA_RC)
 dnl
 dnl  Handle substvars that use $(top_srcdir)
 dnl