From b113af1b134554004761d38c40da27d657aa7275 Mon Sep 17 00:00:00 2001 From: Octavian Voicu Date: Wed, 3 Aug 2011 01:38:43 +0300 Subject: [PATCH] configure: Disable gstreamer support if headers are not compatible with build environment. --- configure | 25 +++++++++++++++++++++++-- configure.ac | 13 +++++++++---- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 38761273654..7a27706ff45 100755 --- a/configure +++ b/configure @@ -10527,7 +10527,23 @@ then if test "x$ac_cv_header_gst_gstpad_h" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "gst/app/gstappsink.h" "ac_cv_header_gst_app_gstappsink_h" "$ac_includes_default" if test "x$ac_cv_header_gst_app_gstappsink_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gst_pad_get_caps_reffed in -lgstreamer-0.10" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gint64 defined by gst/app/gstappsink.h is indeed 64-bit" >&5 +$as_echo_n "checking whether gint64 defined by gst/app/gstappsink.h is indeed 64-bit... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int a[sizeof(gint64) > 4 ? 1 : -1] + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gst_pad_get_caps_reffed in -lgstreamer-0.10" >&5 $as_echo_n "checking for gst_pad_get_caps_reffed in -lgstreamer-0.10... " >&6; } if ${ac_cv_lib_gstreamer_0_10_gst_pad_get_caps_reffed+:} false; then : $as_echo_n "(cached) " >&6 @@ -10603,12 +10619,17 @@ $as_echo "$ac_cv_lib_gstapp_0_10_gst_app_buffer_new" >&6; } if test "x$ac_cv_lib_gstapp_0_10_gst_app_buffer_new" = xyes; then : GSTREAMER_LIBS="$ac_gst_libs" - GSTREAMER_INCL="$ac_gst_incl" + GSTREAMER_INCL="$ac_gst_incl" fi fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi diff --git a/configure.ac b/configure.ac index ecd74d67ef0..df7a355b636 100644 --- a/configure.ac +++ b/configure.ac @@ -1456,10 +1456,15 @@ then CPPFLAGS="$CPPFLAGS $ac_gst_incl" AC_CHECK_HEADER([gst/gstpad.h], [AC_CHECK_HEADER([gst/app/gstappsink.h], - [AC_CHECK_LIB(gstreamer-0.10,gst_pad_get_caps_reffed, - [AC_CHECK_LIB(gstapp-0.10,gst_app_buffer_new, - [AC_SUBST(GSTREAMER_LIBS,"$ac_gst_libs") - AC_SUBST(GSTREAMER_INCL,"$ac_gst_incl")],,[$ac_gst_libs])])])]) + [AC_MSG_CHECKING([whether gint64 defined by gst/app/gstappsink.h is indeed 64-bit]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int a[sizeof(gint64) > 4 ? 1 : -1]]])], + [AC_MSG_RESULT([yes]) + AC_CHECK_LIB(gstreamer-0.10,gst_pad_get_caps_reffed, + [AC_CHECK_LIB(gstapp-0.10,gst_app_buffer_new, + [AC_SUBST(GSTREAMER_LIBS,"$ac_gst_libs") + AC_SUBST(GSTREAMER_INCL,"$ac_gst_incl")],,[$ac_gst_libs])])], + [AC_MSG_RESULT([no])])])]) fi CPPFLAGS="$ac_save_CPPFLAGS" fi