ADM 2.5 r7741 patch - Make ffmpeg use same C-Compiler

Started by nibbles, February 25, 2012, 02:26:40 AM

Previous topic - Next topic

nibbles

That patch to propagate CMAKE_C_COMPILER into admFFmpegBuild.cmake that you did for 2.6 was very helpful.
https://lists.berlios.de/pipermail/avidemux-svn-commit/2012-January/004872.html
The reason for that patch was it fixes compiler errors with clang CFLAGS getting passed to a hard coded gcc command.

Here is a patch to do the same thing to 2.5 r7741.  There are DOS/Unix line ending problems.
The attached version works.  Below is broken only because of Firefox paste.
Conceptually that patch propogates --cc, --ld, and  --ar, for everyone.  Is that ok?

--- a/cmake/admFFmpegBuild.cmake 2011-12-28 06:51:49.000000000 -0800
+++ b/cmake/admFFmpegBuild.cmake 2012-02-24 01:50:30.000000000 -0800
@@ -18,7 +18,8 @@
set(FFMPEG_MUXERS  flv  matroska  mpeg1vcd  mpeg2dvd  mpeg2svcd  mpegts  mov  mp4  psp)
set(FFMPEG_PARSERS  ac3  h263  h264  mpeg4video)
set(FFMPEG_PROTOCOLS  file)
-set(FFMPEG_FLAGS  --enable-shared --disable-static --disable-everything --enable-hwaccels --enable-postproc --enable-gpl
+set(FFMPEG_FLAGS  --enable-shared --disable-static --disable-everything --enable-hwaccels --enable-postproc --enable-gpl
+                  --cc=${CMAKE_C_COMPILER} --ld=${CMAKE_C_COMPILER} --ar=${CMAKE_AR}
  --enable-runtime-cpudetect --disable-network --disable-ffplay --disable-ffprobe --prefix=${CMAKE_INSTALL_PREFIX})

include(admFFmpegPatch)
@@ -118,6 +119,13 @@
if (NOT EXISTS "${FFMPEG_BINARY_DIR}/Makefile")
set(FFMPEG_PERFORM_BUILD 1)
endif (NOT EXISTS "${FFMPEG_BINARY_DIR}/Makefile")
+
+MESSAGE(STATUS "Building ffmpeg with CC=${CMAKE_C_COMPILER}")
+MESSAGE(STATUS "Building ffmpeg with LD=${CMAKE_C_COMPILER}")
+MESSAGE(STATUS "Building ffmpeg with AR=${CMAKE_AR}")
+MESSAGE(STATUS "Building ffmpeg with CMAKE_C_FLAGS=${CMAKE_C_FLAGS}")
+MESSAGE(STATUS "Building ffmpeg with CFLAGS=${FF_FLAGS}")
+MESSAGE(STATUS "Building ffmpeg with CFLAGS2=${FFMPEG_FLAGS}")

if (FFMPEG_PERFORM_BUILD)
message(STATUS "Configuring FFmpeg")


nibbles

Thanks for fixing this in r7742.  It works well and fixes a clang compile error.