[Ffmpeg-devel] [PATCH] fix config.h include issue

Limin Wang lance.lmwang
Fri Feb 16 11:26:28 CET 2007


Hi developer,

The patch try to fix ffmpeg included other config.h if using extra-libs which
the library has config.h and on ffmpeg include search path. If you have better
fix, fix it anyway. In fact, some other header include has the same issue just
for config.h is common.

How to reproduce:
./configure --enable-gpl --extra-cflags="-I/your/x264/path"
--extra-libs="-L/your/x264/path"

Then you'll get below error:

gcc -I/home/lmwang/yuvad/code/transcode/3rdparty/x264 -fomit-frame-pointer -g
-Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization
-Wpointer-arith -Wredundant-decls -Wno-pointer-sign -O3
-I"/home/lmwang/yuvad/open/h264/ffmpeg"
-I"/home/lmwang/yuvad/open/h264/ffmpeg"
-I"/home/lmwang/yuvad/open/h264/ffmpeg"/libavutil
-I"/home/lmwang/yuvad/open/h264/ffmpeg"/libavcodec
-I"/home/lmwang/yuvad/open/h264/ffmpeg"/libavformat
-I"/home/lmwang/yuvad/open/h264/ffmpeg"/libswscale -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -c -o ffmpeg.o ffmpeg.c
In file included from ffmpeg.c:24:
/home/lmwang/yuvad/open/h264/ffmpeg/libavformat/avformat.h:258: warning:
'AVFrac' is deprecated
ffmpeg.c: In function 'show_banner':
ffmpeg.c:3673: error: expected ')' before 'FFMPEG_CONFIGURATION'
make: *** [ffmpeg.o] Error 1

By gcc Preprocess, you can get ffmpeg include x264 config.h instead of itself,

gcc -I/home/lmwang/yuvad/code/transcode/3rdparty/x264 -fomit-frame-pointer -g
-Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization
-Wpointer-arith -Wredundant-decls -Wno-pointer-sign -O3
-I"/home/lmwang/yuvad/open/h264/ffmpeg"
-I"/home/lmwang/yuvad/open/h264/ffmpeg"
-I"/home/lmwang/yuvad/open/h264/ffmpeg"/libavutil
-I"/home/lmwang/yuvad/open/h264/ffmpeg"/libavcodec
-I"/home/lmwang/yuvad/open/h264/ffmpeg"/libavformat
-I"/home/lmwang/yuvad/open/h264/ffmpeg"/libswscale -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -E -o ffmpeg.prep ffmpeg.c


Thanks,
Limin
-------------- next part --------------
Index: ffmpeg.c
===================================================================
--- ffmpeg.c	(revision 7991)
+++ ffmpeg.c	(working copy)
@@ -21,6 +21,7 @@
 #define HAVE_AV_CONFIG_H
 #include <signal.h>
 #include <limits.h>
+#include "config.h"
 #include "avformat.h"
 #include "swscale.h"
 #include "framehook.h"
Index: libavutil/common.h
===================================================================
--- libavutil/common.h	(revision 7991)
+++ libavutil/common.h	(working copy)
@@ -30,7 +30,7 @@
 
 #ifdef HAVE_AV_CONFIG_H
 /* only include the following when compiling package */
-#    include "config.h"
+#    include "../config.h"
 
 #    include <stdlib.h>
 #    include <stdio.h>
Index: libavcodec/sparc/dsputil_vis.c
===================================================================
--- libavcodec/sparc/dsputil_vis.c	(revision 7991)
+++ libavcodec/sparc/dsputil_vis.c	(working copy)
@@ -23,7 +23,7 @@
    The vis code from libmpeg2 was adapted for ffmpeg by James A. Morrison.
  */
 
-#include "config.h"
+#include "../config.h"
 
 #ifdef ARCH_SPARC
 
Index: libpostproc/postprocess.c
===================================================================
--- libpostproc/postprocess.c	(revision 7991)
+++ libpostproc/postprocess.c	(working copy)
@@ -73,7 +73,7 @@
 
 //Changelog: use the Subversion log
 
-#include "config.h"
+#include "../config.h"
 #include "avutil.h"
 #include <inttypes.h>
 #include <stdio.h>
Index: libavformat/os_support.c
===================================================================
--- libavformat/os_support.c	(revision 7991)
+++ libavformat/os_support.c	(working copy)
@@ -19,7 +19,7 @@
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-#include "config.h"
+#include "../config.h"
 #include "avformat.h"
 #if defined(CONFIG_WINCE)
 /* Skip includes on WinCE. */
Index: libavformat/framehook.c
===================================================================
--- libavformat/framehook.c	(revision 7991)
+++ libavformat/framehook.c	(working copy)
@@ -19,7 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <errno.h>
-#include "config.h"
+#include "../config.h"
 #include "avformat.h"
 #include "framehook.h"
 
Index: libavformat/barpainet.h
===================================================================
--- libavformat/barpainet.h	(revision 7991)
+++ libavformat/barpainet.h	(working copy)
@@ -21,7 +21,7 @@
 #ifndef BARPA_INET_H
 #define BARPA_INET_H
 
-#include "config.h"
+#include "../config.h"
 
 #ifdef CONFIG_BEOS_NETSERVER
 



More information about the ffmpeg-devel mailing list