]> git.sesse.net Git - vlc/blobdiff - configure.ac
NEWS: Mention amem and new libvlc functions
[vlc] / configure.ac
index 3af9ed3dfe531065e23128078bafa55d341a00c3..5ea921b97de4c66e93af16c21c71b4ca421ad138 100644 (file)
@@ -57,7 +57,11 @@ dnl Check for tools
 dnl
 AC_PROG_CC_C99
 AC_USE_SYSTEM_EXTENSIONS
-AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to '2' to get glibc warnings.])
+AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
+AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
+AC_DEFINE([_REENTRANT],, [Define to expose reentrant functions.])
+AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
+AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
 
 AM_PROG_CC_C_O
 AC_PROG_CXX
@@ -94,26 +98,6 @@ AS_IF([test -n "${with_binary_version}"],[
          [Binary specific version])
 ])
 
-dnl Check how we are asked to build
-AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
-  AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
-])
-
-AC_ARG_ENABLE(static-modules,
-  [AS_HELP_STRING([--enable-static-modules],
-    [link modules statically - VLC will not work])])
-AS_IF([test "${enable_static_modules}" = yes], [
-   enable_shared="no"
-   enable_static="yes"
-   VLC_DEFAULT_PLUGIN_TYPE="builtin"
-   AS_IF([test "${enable_vlc}" != "no"],
-     [AC_MSG_WARN([Building modules as static. VLC will not work.])])
-], [
-   VLC_DEFAULT_PLUGIN_TYPE="plugin"
-])
-
-AC_SUBST(VLC_DEFAULT_PLUGIN_TYPE)
-
 dnl
 dnl  Check for the contrib directory
 dnl
@@ -444,6 +428,10 @@ m4_defun([AC_DEPLIBS_CHECK_METHOD],[])
 
 lt_cv_deplibs_check_method=pass_all
 
+AS_IF([test "${enable_shared}" = "no"], [
+  AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
+])
+
 dnl
 dnl Gettext stuff
 dnl
@@ -676,7 +664,7 @@ 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],[-lm])
 ])
 AC_CHECK_LIB(m,pow,[
-  VLC_ADD_LIBS([avcodec avformat access_avio swscale postproc ffmpegaltivec i420_rgb faad twolame equalizer spatializer param_eq libvlccore freetype mod mpc dmo quicktime realvideo qt4],[-lm])
+  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])
@@ -980,92 +968,244 @@ AC_CACHE_CHECK([for ntohl in sys/param.h],
 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
     AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
 fi
-CFLAGS="${CFLAGS_save}"
+
+EXTEND_HELP_STRING([Optimization options:])
+VLC_RESTORE_FLAGS
+dnl
+dnl  Compiler warnings
+dnl
 
 RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var error-implicit-function-declaration])
 RDC_PROG_CC_FLAGS([-pipe])
 
+dnl
+dnl  Debugging mode
+dnl
+AC_ARG_ENABLE(debug,
+  [AS_HELP_STRING([--enable-debug],
+    [build with run-time assertions and debug symbols (default disabled)])],,
+  [enable_debug="no"])
+AH_TEMPLATE(NDEBUG,
+            [Define to 1 if debug code should NOT be compiled])
+AS_IF([test "${enable_debug}" != "no"], [
+  AC_CHECK_HEADERS([valgrind/valgrind.h])
+  CFLAGS="${CFLAGS} -g"
+  CXXFLAGS="${CXXFLAGS} -g"
+  OBJCFLAGS="${OBJCFLAGS} -g"
+  LDFLAGS="${LDFLAGS} -g"
+], [
+  AC_DEFINE(NDEBUG)
+])
+
+dnl
+dnl  Profiling
+dnl
+AC_ARG_ENABLE(gprof,
+  [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
+  [enable_gprof="no"])
+AS_IF([test "${enable_gprof}" != "no"], [
+  CFLAGS="${CFLAGS} -pg"
+  CXXFLAGS="${CXXFLAGS} -pg"
+  OBJCFLAGS="${OBJCFLAGS} -pg"
+  LDFLAGS="${LDFLAGS} -pg"
+])
+
+AC_ARG_ENABLE(cprof,
+  [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
+  [enable_cprof="no"])
+AS_IF([test "${enable_gprof}" != "no"], [
+  CFLAGS="${CFLAGS} -finstrument-functions"
+  CXXFLAGS="${CXXFLAGS} -finstrument-functions"
+  OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
+  LDFLAGS="${LDFLAGS} -finstrument-functions"
+])
+
+dnl
+dnl  Test coverage
+dnl
+AC_ARG_ENABLE(coverage,
+  [AS_HELP_STRING([--enable-coverage],
+    [build for test coverage (default disabled)])],,
+  [enable_coverage="no"])
+AS_IF([test "${enable_coverage}" != "no"], [
+  CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
+  CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
+  LDFLAGS="-lgcov ${LDFLAGS}"
+  CFLAGS_save="${CFLAGS}"
+  CXXFLAGS_save="${CXXFLAGS}"
+  LDFLAGS_save="${LDFLAGS}"
+])
+
+AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"], [
+  AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
+                 [ac_cv_c_visibility_hidden], [
+    CFLAGS="${CFLAGS_save} -ffast-math"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
+      ac_cv_c_visibility_hidden=yes
+    ], [
+      ac_cv_c_visibility_hidden=no
+    ])
+  ])
+  AS_IF([test "${ac_cv_c_visibility_hidden}" != "no"], [
+    CFLAGS="${CFLAGS} -fvisibility=hidden"
+    CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
+    OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
+  ])
+])
+
+VLC_SAVE_FLAGS
+
+dnl
+dnl  Enable/disable optimizations
+dnl
+AC_ARG_ENABLE(optimizations,
+  [AS_HELP_STRING([--disable-optimizations],
+    [disable compiler optimizations (default enabled)])],,
+  [enable_optimizations="yes"])
+AS_IF([test "${enable_optimizations}" != "no"], [
+  enable_optimizations="speed"
+])
+
 dnl Check for various optimization flags
-AC_CACHE_CHECK([if \$CC accepts -O4],
-    [ac_cv_c_o4],
-    [CFLAGS="${CFLAGS_save} -O4"
-     AC_TRY_COMPILE([],,ac_cv_c_o4=yes, ac_cv_c_o4=no)])
-if test "${ac_cv_c_o4}" != "no" -a "x${enable_debug}" = "xno"; then
-    CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O4"
-else
-    AC_CACHE_CHECK([if \$CC accepts -O3],
-        [ac_cv_c_o3],
-        [CFLAGS="${CFLAGS_save} -O3"
-         AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
-    if test "${ac_cv_c_o3}" != "no" -a "x${enable_debug}" = "xno"; then
-        CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O3"
-    else
-        AC_CACHE_CHECK([if \$CC accepts -O2],
-            [ac_cv_c_o2],
-            [CFLAGS="${CFLAGS_save} -O2"
-             AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
-        if test "${ac_cv_c_o2}" != "no"; then
-            CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O2"
-        else
-            AC_CACHE_CHECK([if \$CC accepts -O],
-                [ac_cv_c_o],
-                [CFLAGS="${CFLAGS_save} -O"
-                 AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
-            if test "${ac_cv_c_o}" != "no"; then
-                CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O"
-            fi
-        fi
-    fi
-fi
+AS_IF([test "${enable_optimizations}" != "no"], [
+
+  C_O=""
+  dnl -O4 and -O3 only in production builds
+  AS_IF([test "{enable_debug}" = "no"], [
+    AC_CACHE_CHECK([if $CC accepts -O4], [ac_cv_c_o4], [
+      CFLAGS="${CFLAGS_save} -O4"
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
+        ac_cv_c_o4=yes
+      ], [
+        ac_cv_c_o4=no
+      ])
+    ])
+    AS_IF([test "${ac_cv_c_o4}" != "no"], [
+      C_O="-O4"
+    ], [
+      AC_CACHE_CHECK([if $CC accepts -O3],  [ac_cv_c_o3], [
+        CFLAGS="${CFLAGS_save} -O3"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
+          ac_cv_c_o3=yes
+        ], [
+          ac_cv_c_o3=no
+        ])
+      ])
+      AS_IF([test "${ac_cv_c_o3}" != "no"], [
+        C_O="-O3"
+      ])
+    ])
+  ])
 
-AC_CACHE_CHECK([if \$CC accepts -O0],
-    [ac_cv_c_o0],
-    [CFLAGS="${CFLAGS_save} -O0"
-     AC_TRY_COMPILE([],,ac_cv_c_o0=yes, ac_cv_c_o0=no)])
-if test "${ac_cv_c_o0}" != "no"; then
-    CFLAGS_NOOPTIM="${CFLAGS_NOOPTIM} -O0"
-fi
+  dnl -O2 and -O in both production and debug builds
+  AS_IF([test "x$C_O" = "x"], [
+    AC_CACHE_CHECK([if \$CC accepts -O2], [ac_cv_c_o2], [
+      CFLAGS="${CFLAGS_save} -O2"
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
+        ac_cv_c_o2=yes
+      ], [
+        ac_cv_c_o2=no
+      ])
+    ])
+    AS_IF([test "${ac_cv_c_o2}" != "no"], [
+      C_O="-O2"
+    ], [
+      AC_CACHE_CHECK([if \$CC accepts -O], [ac_cv_c_o], [
+        CFLAGS="${CFLAGS_save} -O"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
+          ac_cv_c_o=yes
+        ], [
+          ac_cv_c_o=no
+        ])
+      ])
+      AS_IF([test "${ac_cv_c_o}" != "no"], [
+        C_O="-O"
+      ])
+    ])
+  ])
 
-dnl Check for -ffast-math
-AC_CACHE_CHECK([if \$CC accepts -ffast-math],
-    [ac_cv_c_fast_math],
-    [CFLAGS="${CFLAGS_save} -ffast-math"
-     AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
-if test "${ac_cv_c_fast_math}" != "no"; then
-    CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -ffast-math"
-fi
+  VLC_RESTORE_FLAGS
+  CFLAGS="${CFLAGS} ${C_O}"
+  CXXFLAGS="${CXXFLAGS} ${C_O}"
+  OBJCFLAGS="${OBJCFLAGS} ${C_O}"
+  VLC_SAVE_FLAGS
+
+  dnl Check for -ffast-math
+  AC_CACHE_CHECK([if $CC accepts -ffast-math], [ac_cv_c_fast_math], [
+    CFLAGS="${CFLAGS_save} -ffast-math"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
+      ac_cv_c_fast_math=yes
+    ], [
+      ac_cv_c_fast_math=no
+    ])
+  ])
+  AS_IF([test "${ac_cv_c_fast_math}" != "no"], [
+    VLC_RESTORE_FLAGS
+    CFLAGS="${CFLAGS} -ffast-math"
+    CXXFLAGS="${CXXFLAGS} -ffast-math"
+    OBJCFLAGS="${OBJCFLAGS} -ffast-math"
+    VLC_SAVE_FLAGS
+  ])
 
-dnl Check for -funroll-loops
-AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
-    [ac_cv_c_unroll_loops],
-    [CFLAGS="${CFLAGS_save} -funroll-loops"
-     AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
-if test "${ac_cv_c_unroll_loops}" != "no"; then
-    CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -funroll-loops"
-fi
+  dnl Check for -funroll-loops
+  AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
+    CFLAGS="${CFLAGS_save} -funroll-loops"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
+      ac_cv_c_unroll_loops=yes
+    ], [
+      ac_cv_c_unroll_loops=no
+    ])
+  ])
+  AS_IF([test "${ac_cv_c_unroll_loops}" != "no"], [
+    VLC_RESTORE_FLAGS
+    CFLAGS="${CFLAGS} -funroll-loops"
+    CXXFLAGS="${CXXFLAGS} -funroll-loops"
+    OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
+    VLC_SAVE_FLAGS
+  ])
 
-dnl Check for -fomit-frame-pointer
-AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
-    [ac_cv_c_omit_frame_pointer],
-    [CFLAGS="${CFLAGS_save} -fomit-frame-pointer"
-     AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
-if test "${ac_cv_c_omit_frame_pointer}" != "no"; then
- if test "${SYS}" != "darwin"; then
-    CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
- else
-    dnl On darwin we explicitely disable it.
-    CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fno-omit-frame-pointer"
- fi
-fi
+  AS_IF([test "$enable_debug" = "no"], [
+    dnl Check for -fomit-frame-pointer
+    AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
+      [ac_cv_c_omit_frame_pointer], [
+      CFLAGS="${CFLAGS_save} -fomit-frame-pointer"
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
+        ac_cv_c_omit_frame_pointer=yes
+      ], [
+        ac_cv_c_omit_frame_pointer=no
+      ])
+    ])
+    AS_IF([test "${ac_cv_c_omit_frame_pointer}" != "no"], [
+      VLC_RESTORE_FLAGS
+      AS_IF([test "${SYS}" != "darwin"], [
+        CFLAGS="${CFLAGS} -fomit-frame-pointer"
+        CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
+      ], [
+        dnl On darwin we explicitely disable it.
+        CFLAGS="${CFLAGS} -fno-omit-frame-pointer"
+        CXXFLAGS="${CXXFLAGS} -fno-omit-frame-pointer"
+        OBJCFLAGS="${OBJCFLAGS} -fno-omit-frame-pointer"
+      ])
+      VLC_SAVE_FLAGS
+    ])
+  ])
+])
 
 dnl Check for Darwin plugin linking flags
-AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error],
-    [ac_cv_ld_darwin],
-    [CFLAGS="${CFLAGS_save} -bundle -undefined error"
-     AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
-if test "${ac_cv_ld_darwin}" != "no"; then
+AS_IF([test "${SYS}" = "darwin"], [
+  AC_CACHE_CHECK([if $CC accepts -bundle -undefined error],
+    [ac_cv_ld_darwin], [
+    CFLAGS="${CFLAGS_save} -bundle -undefined error"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
+      ac_cv_ld_darwin=yes
+    ], [
+      ac_cv_ld_darwin=no
+    ])
+  ])
+  AS_IF([test "${ac_cv_ld_darwin}" != "no"], [
     VLC_ADD_LDFLAGS([plugin],[-bundle -undefined error])
-fi
+  ])
+])
 
 dnl Checks for __attribute__(aligned()) directive
 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
@@ -1109,16 +1249,6 @@ dnl Check for backtrace() support
 AC_CHECK_HEADERS(execinfo.h)
 AC_CHECK_FUNCS(backtrace)
 
-dnl
-dnl  Enable profiling
-dnl
-AC_ARG_ENABLE(gprof,
-  [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])])
-AC_ARG_ENABLE(cprof,
-  [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])])
-test "${enable_gprof}" != "yes" && enable_gprof="no"
-test "${enable_cprof}" != "yes" && enable_cprof="no"
-
 dnl
 dnl  default modules
 dnl
@@ -1140,7 +1270,6 @@ fi
 dnl
 dnl  Accelerated modules
 dnl
-EXTEND_HELP_STRING([Optimization options:])
 
 dnl  Check for fully working MMX intrinsics
 dnl  We need support for -mmmx, we need <mmintrin.h>, and we also need a
@@ -1182,7 +1311,6 @@ AS_IF([test "${enable_mmx}" != "no"], [
   AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
     AC_DEFINE(HAVE_MMX_INTRINSICS, 1,
               [Define to 1 if MMX intrinsics are available.])
-    MMX_CFLAGS="-mmmx"
   ])
 
   AC_CACHE_CHECK([if $CC groks MMX inline assembly],
@@ -1207,7 +1335,6 @@ AS_IF([test "${enable_mmx}" != "no"], [
     have_mmxext="yes"
   ])
 ])
-AC_SUBST(MMX_CFLAGS)
 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
 
@@ -1218,7 +1345,7 @@ AC_ARG_ENABLE(sse,
   [AS_HELP_STRING([--disable-sse],
     [disable SSE (1-4) optimizations (default auto)])],, [
   case "${host_cpu}" in
-    i686|x86_64)
+    i?86|x86_64)
       enable_sse=yes
       ;;
     *)
@@ -1250,7 +1377,6 @@ AS_IF([test "${enable_sse}" != "no"], [
   AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
     AC_DEFINE(HAVE_SSE2_INTRINSICS, 1,
               [Define to 1 if SSE2 intrinsics are available.])
-    SSE2_CFLAGS="-msse2"
   ])
 
   AC_CACHE_CHECK([if $CC groks SSE inline assembly],
@@ -1323,7 +1449,6 @@ AS_IF([test "${enable_sse}" != "no"], [
     AC_DEFINE(CAN_COMPILE_SSE4A, 1,
               [Define to 1 if SSE4A inline assembly is available.]) ])
 ])
-AC_SUBST(SSE2_CFLAGS)
 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
 
 have_3dnow="no"
@@ -1391,8 +1516,6 @@ AS_IF([test "${enable_altivec}" = "yes"], [
     AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
               [Define to 1 if AltiVec inline assembly is available.])
     AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
-      VLC_ADD_CFLAGS([idctaltivec],[${ac_cv_altivec_inline}])
-      VLC_ADD_CFLAGS([motionaltivec],[${ac_cv_altivec_inline}])
       VLC_ADD_CFLAGS([memcpyaltivec],[${ac_cv_altivec_inline}])
       VLC_ADD_CFLAGS([i420_yuy2_altivec],[${ac_cv_altivec_inline}])
       VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
@@ -1457,7 +1580,6 @@ dnl - Others: test should fail
     AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1,
               [Define to 1 if C AltiVec extensions are available.])
     VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
-    VLC_ADD_CFLAGS([idctaltivec motionaltivec],[${ac_cv_c_altivec}])
     VLC_ADD_CFLAGS([i420_yuy2_altivec memcpyaltivec deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
     have_altivec="yes"
   ])
@@ -1469,7 +1591,7 @@ dnl - Others: test should fail
      LDFLAGS="${LDFLAGS_save}"
     ])
   AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
-    VLC_ADD_LDFLAGS([libvlccore idctaltivec motionaltivec memcpyaltivec],[-Wl,-framework,vecLib])
+    VLC_ADD_LDFLAGS([libvlccore memcpyaltivec],[-Wl,-framework,vecLib])
   ])
 ])
 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
@@ -1524,31 +1646,6 @@ if test "${enable_optimize_memory}" = "yes"; then
   AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
 fi
 
-dnl
-dnl  Enable/disable optimizations
-dnl
-AC_ARG_ENABLE(optimizations,
-  [AS_HELP_STRING([--disable-optimizations],
-    [disable compiler optimizations (default enabled)])])
-if test "${enable_optimizations}" != "no"; then
-  enable_optimizations="speed"
-fi
-
-dnl
-dnl  Debugging mode
-dnl
-AC_ARG_ENABLE(debug,
-  [AS_HELP_STRING([--enable-debug],
-    [check assertions at run-time (default disabled)])])
-test "${enable_debug}" != "yes" && enable_debug="no"
-AH_TEMPLATE(NDEBUG,
-            [Define to 1 if debug code should NOT be compiled])
-AS_IF([test "x${enable_debug}" = "xno"], [
-  AC_DEFINE(NDEBUG)
-], [
-  AC_CHECK_HEADERS([valgrind/valgrind.h])
-])
-
 dnl
 dnl Allow running as root (useful for people running on embedded platforms)
 dnl
@@ -1560,23 +1657,6 @@ AS_IF([test "${enable_run_as_root}" = "yes"],[
               [Define to 1 to allow running VLC as root (uid 0).])
 ])
 
-dnl
-dnl  Test coverage
-dnl
-AC_ARG_ENABLE(coverage,
-  [AS_HELP_STRING([--enable-coverage],
-    [build for test coverage (default disabled)])],,
-  [enable_coverage="no"])
-AS_IF([test "${enable_coverage}" != "no"], [
-       CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
-       CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
-       LDFLAGS="-lgcov ${LDFLAGS}"
-       dnl ugly...
-       CFLAGS_save="${CFLAGS}"
-       CXXFLAGS_save="${CXXFLAGS}"
-       LDFLAGS_save="${LDFLAGS}"
-])
-
 dnl
 dnl Stream output
 dnl
@@ -1923,7 +2003,7 @@ fi
 dnl
 dnl  Blu-ray Disc Support with libbluray
 dnl
-PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.2 ], (libbluray for Blu-ray disc support ) )
+PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.2 libxml-2.0 >= 2.6 ], (libbluray for Blu-ray disc support ) )
 
 dnl
 dnl  OpenCV wrapper and example filters
@@ -3184,51 +3264,51 @@ dnl
 dnl  freetype module
 dnl
 AC_ARG_ENABLE(freetype,
-  [  --enable-freetype       freetype support (default enabled)])
+  [  --enable-freetype       freetype support   (default auto)])
 AC_ARG_ENABLE(fribidi,
-  [  --enable-fribidi        fribidi support (default enabled)])
+  [  --enable-fribidi        fribidi support    (default auto)])
 AC_ARG_ENABLE(fontconfig,
-  [  --enable-fontconfig     fontconfig support (default enabled)])
+  [  --enable-fontconfig     fontconfig support (default auto)])
+
 if test "${enable_freetype}" != "no"; then
-   PKG_CHECK_MODULES(FREETYPE, freetype2,[
-      VLC_ADD_PLUGIN([freetype])
+   PKG_CHECK_MODULES(FREETYPE, freetype2, [
       have_freetype=yes
+      VLC_ADD_PLUGIN([freetype])
       VLC_ADD_CPPFLAGS([freetype skins2],[${FREETYPE_CFLAGS}])
       if test "${SYS}" = "mingw32"; then
         VLC_ADD_LIBS([freetype],[-liconv -lz])
       fi
       VLC_ADD_LIBS([freetype skins2],[${FREETYPE_LIBS}])
 
+      AC_CHECK_HEADERS(Carbon/Carbon.h,
+                       [VLC_ADD_LDFLAGS([freetype],[-Wl,-framework,Carbon])])
+
+      dnl fontconfig support
       if test "${SYS}" != "mingw32"; then
           if test "${enable_fontconfig}" != "no"; then
-            AC_CHECK_HEADERS(fontconfig/fontconfig.h,
-              [VLC_ADD_CPPFLAGS([freetype],[-DHAVE_FONTCONFIG])
-               VLC_ADD_LIBS([freetype],[-lfontconfig])])
-            AC_CHECK_HEADERS(Carbon/Carbon.h,
-              [VLC_ADD_LDFLAGS([freetype],[-Wl,-framework,Carbon])])
+            AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
+              VLC_ADD_CPPFLAGS([freetype],[-DHAVE_FONTCONFIG])
+              VLC_ADD_LIBS([freetype],[-lfontconfig])
+            ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
           fi
       else
           VLC_ADD_LIBS([freetype],[-lgdi32])
       fi
 
       dnl fribidi support
-      if test "${enable_fribidi}" != "no"
-      then
+      if test "${enable_fribidi}" != "no"; then
         PKG_CHECK_MODULES(FRIBIDI, fribidi, [
           VLC_ADD_CPPFLAGS([freetype skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
           VLC_ADD_LIBS([freetype skins2], [${FRIBIDI_LIBS}])
-        ])
+        ],[AC_MSG_WARN([library fribidi not found. Bidirectional support will be disabled in freetype])])
       fi
 
   ],[
   have_freetype=no
-  AS_IF([ test "${enable_freetype}" =  "yes"],[
-    AC_MSG_ERROR([I couldn't find the freetype package. You can download libfreetype2
-from http://www.freetype.org/, or configure with --disable-freetype. Have a nice day.
-      ])
+  AS_IF([ test "${enable_freetype}" = "yes"],[
+    AC_MSG_ERROR([Freetype2 package cannot be detected. Install Freetype2 development or configure with --disable-freetype.])
     ])
   ])
-
 fi
 
 dnl
@@ -3712,6 +3792,7 @@ then
   VLC_ADD_LDFLAGS([macosx minimal_macosx],            [-Wl,-framework,Carbon])
   VLC_ADD_LDFLAGS([macosx minimal_macosx],            [-Wl,-framework,CoreServices])
   VLC_ADD_LDFLAGS([macosx minimal_macosx],            [-Wl,-framework,AGL])
+  VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,QTKit])
   VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,IOKit])
   VLC_ADD_LDFLAGS([macosx],                           [-F${CONTRIB_DIR}/Sparkle -Wl,-framework,Sparkle])
   VLC_ADD_OBJCFLAGS([macosx],                         [-F${CONTRIB_DIR}/Sparkle])
@@ -4376,9 +4457,6 @@ version               : ${VERSION}
 system                : ${SYS}
 architecture          : ${ARCH}
 build flavour         : "
-test "${enable_debug}" = "yes" && printf "debug "
-test "${enable_cprof}" = "yes" && printf "cprof "
-test "${enable_gprof}" = "yes" && printf "gprof "
 test "${enable_optimizations}" != "no" && printf ${enable_optimizations}
 echo ""
 if test "${enable_vlc}" != "no"; then