2
./configure --enable-avfilter --enable-filter=movie --enable-gpl --enable-postproc \
    --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis \
    --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libfaac \
    --enable-libxvid --enable-libx264 --enable-libvpx --enable-libspeex --enable-nonfree \
    --enable-shared --enable-pthreads --disable-indevs --cc=/usr/bin/gcc-4.2 --arch=x86_64

gives an error:

ERROR: libfaac not found

If you think configure made a mistake, make sure you are using the latest version from SVN. If the latest version fails, report the problem to the ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "config.log" produced by configure as this will help solving the problem.

but locate faac gives

/opt/local/bin/faac
/opt/local/include/faac.h
/opt/local/include/faaccfg.h
/opt/local/lib/libfaac.0.dylib
/opt/local/lib/libfaac.a
/opt/local/lib/libfaac.dylib

Any idea how I can tell the configure script how to find libfaac?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
jckdnk111
  • 2,280
  • 5
  • 33
  • 43

4 Answers4

6

A typical configure script as generated by the configure-generation tools will take advantage of environment variables CPPFLAGS and LDFLAGS. You need to use both.

Set CPPFLAGS to -I/opt/local/include so that the header files are found, and LDFLAGS to -L/opt/local/lib so that the library is found by the linker.

Apart from the “environment variables” solution that is specific to the shell you are using, one way that always works for setting these variables in configure is to launch the latter with the command:

./configure CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib
Pascal Cuoq
  • 79,187
  • 7
  • 161
  • 281
  • Brilliant! I owe you a cold beverage. Thanks So much! – jckdnk111 Nov 07 '10 at 20:12
  • How to I do this ? as in setting the flags? – hYk Nov 20 '14 at 09:27
  • @hYk: `./configure CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib` should work; assuming you don't use a C shell, so should `CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib ./configure`, though the information transfer mechanisms are quite different. You can (and I normally do) set CPPFLAGS instead of CFLAGS — that refers to C preprocessor flags. (AFAIK, the trailing slashes on the names are ultra-safe, but are apt to lead to `//` sequences appearing in pathnames.) – Jonathan Leffler Jul 12 '15 at 14:56
  • @JonathanLeffler I have removed the trailing slashes from my answer, and changed CFLAGS to the more specific CPPFLAGS. I assume it works just as well since you say you usually rely on it, and http://stackoverflow.com/questions/2754966/cflags-vs-cppflags sort of reassured me that it wasn't for c++ (that would have been CXXFLAGS, I guess). – Pascal Cuoq Jul 12 '15 at 15:09
  • Since your answer helped originally, I assume that CFLAGS also works — I've not tried it recently, if at all, so I can't answer for it. Let's leave these comments here so people know about both options and can judge for themselves. (Or we could go and try a configuration of something small and see whether both work — but that would involve, like, real work!) – Jonathan Leffler Jul 12 '15 at 15:12
2

I had the same issue but I never had macports installed, I had to use:

brew install --use-clang ffmpeg.

I also had the error message libx264 version must be >= 0.118; I had to upgrade x264 with:

brew upgrade x264 --HEAD.

twe4ked
  • 2,832
  • 21
  • 24
0

Maybe try with

./configure --enable-faac
Jochen
  • 1,853
  • 3
  • 20
  • 28
0

In case someone gets to this thread b/c of the same libfaac not found error but on Homebrew, here is what helped me:

 $brew doctor 
 $brew uninstall faac
 $brew install faac
 $sudo brew link faac
Stpn
  • 6,202
  • 7
  • 47
  • 94