[FFmpeg-devel] out-of-source build issues.

Gonzalo Garramuño ggarra
Wed Mar 5 17:38:09 CET 2008


Here's a simple example.  I've already built ffmpeg in the main dir (ie. 
not out of source) for mingw.

Now, I go to build out of source for x86_64 on linux....

$ mkdir build-x86_x64
$ cd    build-x86_x64
$ ../configure --enable-shared --enable-static --enable-pthreads
--extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib
--enable-ffplay --enable-libvorbis
install prefix            /usr/local
source path               /home/gga/code/PD/libraries/ffmpeg-trunk

(snipped for sanity)

License: LGPL

$ make
gcc -fPIC -I/usr/local/include -fomit-frame-pointer -pthread -g
....
(snipped for sanity )

/home/gga/code/PD/libraries/ffmpeg-trunk/libavutil/adler32.o: file not
recognized: File format not recognized
collect2: ld returned 1 exit status
make[1]: *** [libavutil.so.49] Error 1
make[1]: Leaving directory
`/home/gga/code/PD/libraries/ffmpeg-trunk/build-x86_x64/libavutil'
make: *** [lib] Error 2
make: *** Waiting for unfinished jobs....

As you can see, even thou I am building out of source, the make system
picks .o files from the in-source build (which, in this case as I mixed 
platforms, breaks).

With autotools, cmake, etc. traditionally an out-of-source build picks 
*only* .h and .c files in-source.  All dependencies, obj and aux files 
are to be looked out of source.  There's never any possibility of overlaps.

Now, if you ask why didn't you run "make distclean" first, right?  In 
principle it shouldn't be needed for out of source, but even then, that 
may show a second problem....

Trying to run make clean or make distclean on a linux system once 
depends were created for mingw also will result in some weird error 
(this not a direct quote, but remembering...)

$ make clean
.depends: wrong dependency of something (or similar error)

The issue is that the "C:/" and similar paths that are saved in .depends
screw up the build system on linux (which sees C: as a dependency).  Not 
sure why "C:/" is being used, as mingw should really be using /C/ instead.

The only way to do a "make clean/distclean" work always reliably across
platforms that I found so far is to actually remove .depend/.vhookdep
first (and *then* run make distclean).

So in summary, I currently do find out of source builds definitively has 
some issues.

I should probably try again building *only* out of source (never in 
source) and see if similar problems still appear.  That may be one way 
to temporarily work around the issues.


-- 
Gonzalo Garramu?o
ggarra at advancedsl.com.ar

AMD4400 - ASUS48N-E
GeForce7300GT
Xubuntu Gutsy




More information about the ffmpeg-devel mailing list