[MacPorts] #36942: ffmpeg @1.0_2 +gpl2 Patch to allow successful build on PPC Tiger
MacPorts
noreply at macports.org
Fri Nov 9 22:27:15 PST 2012
#36942: ffmpeg @1.0_2 +gpl2 Patch to allow successful build on PPC Tiger
----------------------------+--------------------------------
Reporter: ccarey@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.1.2
Keywords: tiger haspatch | Port: ffmpeg
----------------------------+--------------------------------
The {{{ffmpeg @1.0_2 +gpl2}}} port does not successfully build on PPC
Tiger because of
{{{
:debug:configure Executing command line: cd
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/ffmpeg/work/ffmpeg-1.0"
&& ./configure --prefix=/opt/local --enable-swscale --enable-avfilter
--enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora
--enable-libschroedinger --enable-libopenjpeg --enable-libmodplug
--enable-libvpx --enable-libspeex --enable-libfreetype
--mandir=/opt/local/share/man --enable-shared --enable-pthreads
--cc=/usr/bin/gcc-4.0 --arch=ppc --enable-gpl --enable-postproc --enable-
libx264 --enable-libxvid
:info:configure ERROR: libmodplug not found
:info:configure
:info:configure If you think configure made a mistake, make sure you are
using the latest
:info:configure version from Git. If the latest version fails, report the
problem to the
:info:configure ffmpeg-user at ffmpeg.org mailing list or IRC #ffmpeg on
irc.freenode.net.
:info:configure Include the log file "config.log" produced by configure as
this will help
:info:configure solving the problem.
:info:configure Command failed: cd
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/ffmpeg/work/ffmpeg-1.0"
&& ./configure --prefix=/opt/local --enable-swscale --enable-avfilter
--enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora
--enable-libschroedinger --enable-libopenjpeg --enable-libmodplug
--enable-libvpx --enable-libspeex --enable-libfreetype
--mandir=/opt/local/share/man --enable-shared --enable-pthreads
--cc=/usr/bin/gcc-4.0 --arch=ppc --enable-gpl --enable-postproc --enable-
libx264 --enable-libxvid
:info:configure Exit code: 1
}}}
This comes from the following line in {{{configure}}}:
{{{
enabled libmodplug && require libmodplug libmodplug/modplug.h
ModPlug_Load -lmodplug
}}}
The {{{config.log}}} file created by {{{configure}}} shows that the shell
functions in the line above eventually resolve into
{{{
check_func ModPlug_Load -lmodplug
check_ld cc -lmodplug
check_cc
BEGIN /tmp/ffconf.i2DTrTBU.c
1 extern int ModPlug_Load();
2 int main(void){ ModPlug_Load(); }
END /tmp/ffconf.i2DTrTBU.c
/usr/bin/gcc-4.0 -I/opt/local/include -D_ISOC99_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -pipe -O2 -DHAVE_LRINTF
-I/opt/local/include -arch ppc -std=c99 -fomit-frame-pointer -fPIC
-maltivec -mabi=altivec -I/opt/local/include/freetype2
-I/opt/local/include -c -o /tmp/ffconf.VkUK0WDn.o /tmp/ffconf.i2DTrTBU.c
/usr/bin/gcc-4.0 -L/opt/local/lib -arch ppc
-Wl,-dynamic,-search_paths_first -o /tmp/ffconf.s1FqMdCL
/tmp/ffconf.VkUK0WDn.o -lmodplug -L/opt/local/lib -lfreetype -lm -lbz2 -lz
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
operator delete[](void*)
operator delete(void*)
operator new[](unsigned long)
operator new(unsigned long)
collect2: ld returned 1 exit status
ERROR: libmodplug not found
}}}
— that is, although the file to be compiled is C, and the compiler is
instructed to expect the source to be C99, the undefined symbols represent
C++ symbols. (Apparently any program using this libmodplug function that
is linked against {{{/opt/local/lib/libmodplug.dylib}}} on PPC Tiger
requires these C++ symbols.)
I chose to add {{{-lstdc++}}} to the {{{enabled libmodplug}}} line in
{{{configure}}} because it represents the least invasive change to
{{{configure}}}. Note that the program being compiled above is not C++,
and does not itself use any C++ functions; it is compiled merely as part
of the configuration process, to ensure that the sample header, sample
library function, and library from {{{port:libmodplug}}} are available.
In addition, the {{{Portfile}}} has been modified in two ways. First, the
{{{port:dirac}}} dependency has been removed, since the {{{--enable-
libschroedinger}}} option and {{{port:schroedinger}}} dependency render it
unnecessary. Second, Altivec detection in the {{{Portfile}}} has been
enabled for PPC Macs that have the {{{ppc7450}}} machine type; this
section of the updated Portfile can be expanded to detect other PPC
machines with Altivec support (such as G5 models) by providing their
corresponding machine values in matching {{{elseif {$machine eq "…"}}}}
statements. (I have not done this myself because I only have access to a
G4.)
--
Ticket URL: <https://trac.macports.org/ticket/36942>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list