libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd configure configure.in cvd/videofilebuff...


From: Edward Rosten
Subject: [libcvd-members] libcvd configure configure.in cvd/videofilebuff...
Date: Thu, 14 Apr 2011 20:50:35 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Edward Rosten <edrosten>        11/04/14 20:50:35

Modified files:
        .              : configure configure.in 
        cvd            : videofilebuffer.h 

Log message:
        Fix bug reported by Olaf Christ with regards to FFPMEG support.
        
        ffmpeg now requires __STDC_CONSTANT_MACROS to be defined when used from 
        C++.
        
        WARNING:
        
        If you include videofilebuffer.h, then you will need to compile with 
        -D__STDC_CONSTANT_MACROS or you will get the following errors:
        
        In file included from /usr/local/include/libavutil/avutil.h:81,
                         from /usr/local/include/libavcodec/avcodec.h:30,
                         from ./cvd/videofilebuffer.h:47,
                         from cvd_src/videofilebuffer.cc:28:
        /usr/local/include/libavutil/common.h: In function ‘int32_t 
av_clipl_int32(int64_t)’:
        /usr/local/include/libavutil/common.h:154: error: ‘UINT64_C’ was 
not declared in this scope

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure?cvsroot=libcvd&r1=1.156&r2=1.157
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure.in?cvsroot=libcvd&r1=1.157&r2=1.158
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/videofilebuffer.h?cvsroot=libcvd&r1=1.16&r2=1.17

Patches:
Index: configure
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -b -r1.156 -r1.157
--- configure   6 Dec 2010 16:31:34 -0000       1.156
+++ configure   14 Apr 2011 20:50:34 -0000      1.157
@@ -11791,33 +11791,16 @@
 done
 
 
+               { $as_echo "$as_me:$LINENO: checking for ffmpeg headers" >&5
+$as_echo_n "checking for ffmpeg headers... " >&6; }
+               cat >conftest.$ac_ext <<_ACEOF
 
+                       #define __STDC_CONSTANT_MACROS
+                       #include <libavcodec/avcodec.h>
+                       #include <libavformat/avformat.h>
+                       #include <libswscale/swscale.h>
+                       int main(){}
 
-for ac_header in libavcodec/avcodec.h libavformat/avformat.h 
libswscale/swscale.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -11837,108 +11820,85 @@
         test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+   ffmpeg_new_headers=1
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_header_compiler=no
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
+               if test "$ffmpeg_new_headers" == 1
+               then
+                       { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+       if test "" == ""
+       then
+               { $as_echo "$as_me:$LINENO: checking if compiler flag 
-D__STDC_CONSTANT_MACROS works" >&5
+$as_echo_n "checking if compiler flag -D__STDC_CONSTANT_MACROS works... " >&6; 
}
+       else
+               { $as_echo "$as_me:$LINENO: checking " >&5
+$as_echo_n "checking ... " >&6; }
+       fi
+       save_CXXFLAGS="$CXXFLAGS"
+       CXXFLAGS="$CXXFLAGS -D__STDC_CONSTANT_MACROS"
+
+
+
+       cat >conftest.$ac_ext <<_ACEOF
+int main(){}
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+       } && test -s conftest.$ac_objext; then
+  cvd_conf_test=1
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+       cvd_conf_test=0
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, 
rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by 
the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the 
compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" 
>&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be 
compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing 
prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite 
headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf 
documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But 
Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be 
Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the 
preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's 
result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the 
compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take 
precedence" >&2;}
 
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- ffmpeg_new_headers=1
-fi
 
-done
 
+       if test $cvd_conf_test = 1
+       then
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+               ts_success=yes
+       else
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+               CXXFLAGS="$save_CXXFLAGS"
+               ts_success=no
+       fi
 
+               else
+                       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+               fi
 
                if test "$ffmpeg_old_headers" == 1 || test 
"$ffmpeg_new_headers" == 1
                then

Index: configure.in
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure.in,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -b -r1.157 -r1.158
--- configure.in        6 Dec 2010 16:31:35 -0000       1.157
+++ configure.in        14 Apr 2011 20:50:34 -0000      1.158
@@ -796,8 +796,23 @@
        then
 
                AC_CHECK_HEADERS(ffmpeg/avcodec.h ffmpeg/avformat.h 
ffmpeg/swscale.h, [ffmpeg_old_headers=1], [])
-               AC_CHECK_HEADERS(libavcodec/avcodec.h libavformat/avformat.h 
libswscale/swscale.h, [ffmpeg_new_headers=1], [])
 
+               AC_MSG_CHECKING([for ffmpeg headers])
+               AC_COMPILE_IFELSE([
+                       #define __STDC_CONSTANT_MACROS
+                       #include <libavcodec/avcodec.h>
+                       #include <libavformat/avformat.h>
+                       #include <libswscale/swscale.h>
+                       int main(){}
+               ], [ ffmpeg_new_headers=1], [])
+
+               if test "$ffmpeg_new_headers" == 1
+               then
+                       AC_MSG_RESULT(yes)
+                       TEST_AND_SET_CXXFLAG(-D__STDC_CONSTANT_MACROS)
+               else
+                       AC_MSG_RESULT(no)
+               fi
 
                if test "$ffmpeg_old_headers" == 1 || test 
"$ffmpeg_new_headers" == 1
                then

Index: cvd/videofilebuffer.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/videofilebuffer.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- cvd/videofilebuffer.h       2 Dec 2008 17:30:40 -0000       1.16
+++ cvd/videofilebuffer.h       14 Apr 2011 20:50:35 -0000      1.17
@@ -22,6 +22,9 @@
 #ifndef CVD_VIDEOFILEBUFFER_H
 #define CVD_VIDEOFILEBUFFER_H
 
+#ifndef __STDC_CONSTANT_MACROS
+#define __STDC_CONSTANT_MACROS
+#endif
 #include <vector>
 #include <string>
 #include <fstream>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]