|
MacBuild
Compilation on Mac OSX.
Compilation of GStreamer for the Mac platform is in its earlier stages. MacPorts is currently used as the mechanism to resolve dependencies, apply patches and build the binaries. This is followed by some post-build steps to remove absolute paths in the resulting .dylib and .so files (which MacPorts sets by default to /opt/local/lib). Target platform: 32 bits
> sudo rm -rf \
/opt/local \
/Applications/DarwinPorts \
/Applications/MacPorts \
/Library/LaunchDaemons/org.macports.* \
/Library/Receipts/DarwinPorts*.pkg \
/Library/Receipts/MacPorts*.pkg \
/Library/StartupItems/DarwinPortsStartup \
/Library/Tcl/darwinports1.0 \
/Library/Tcl/macports1.0 \
~/.macportsdefault configure.ldflags {-L${prefix}/lib}with:
this will allow to change later the absolute dependency paths embedded in the .dylib and .so files by relative paths.
build_arch i386 to /opt/local/etc/macports/macports.conf.
> sudo port install gstreamer > sudo port install gst-plugins-base +no_x11 +no_gnome_vfs > sudo port install gst-plugins-good > sudo port install gst-plugins-bad +no_x11 +dc1394 > sudo port install gst-plugins-ugly > sudo port install gst-ffmpeg will fail during the build stage, at least for version 0.10.10. Inspection of the log file will show this error:libavcodec/cabac.h: In function ‘get_cabac_noinline’: libavcodec/cabac.h:527: error: PIC register ‘%ebx’ clobbered in ‘asm’ libavcodec/cabac.h: In function ‘decode_cabac_mb_intra4x4_pred_mode’: libavcodec/cabac.h:527: error: PIC register ‘%ebx’ clobbered in ‘asm’ libavcodec/cabac.h:527: error: PIC register ‘%ebx’ clobbered in ‘asm’ libavcodec/cabac.h:527: error: PIC register ‘%ebx’ clobbered in ‘asm’ libavcodec/cabac.h:527: error: PIC register ‘%ebx’ clobbered in ‘asm’ libavcodec/cabac.h: In function ‘decode_cabac_mb_ref’: libavcodec/cabac.h:527: error: PIC register ‘%ebx’ clobbered in ‘asm’ libavcodec/cabac.h: In function ‘decode_cabac_mb_mvd’: libavcodec/cabac.h:527: error: PIC register ‘%ebx’ clobbered in ‘asm’ libavcodec/cabac.h:527: error: PIC register ‘%ebx’ clobbered in ‘asm’ libavcodec/cabac.h:641: error: PIC register ‘%ebx’ clobbered in ‘asm’Change into the <local repository>/gnome/gst-ffmpeg/work/gst-ffmpeg-0.10.10 folder.
> sudo make followed by:> sudo make installto manually complete the compilation and installation of gst-ffmpeg. Target platform: 64 bitsThe steps to compile for a 64 bits platform are almost identical, with a few exceptions:
build_arch x86_64 although if you are compiling on a 64 bits platform, the target is assumed to be 64 bits by default.
Compiling on a different platformThe steps above assume that you are compiling GStreamer on the same platform as the target. But if you are compiling in Snow Leopard (10.6) with the intention to generate binaries for Leopard (10.5), then you need to do a few additional things right after installing MacPorts and before installing any ports:
default configure.ldflags {"-L${prefix}/lib -Xlinker -headerpad_max_install_names -mmacosx-version-min=10.5 -no_compact_linkedit"}(Based on this discussion).
macosx_deployment_target 10.5 to /opt/local/etc/macports/macports.conf. For more details, see here and here. Additional steps to create GStreamer binaries for bundling with 3rd-party applications
> ./replacepath.py --old /opt/local/lib/ --new @loader_path/ --dir <lib folder> > ./replacepath.py --old /opt/local/lib/ --new @loader_path/../ --dir <lib folder>/gstreamer-0.10 > ./removesymlinks.py --dir <lib folder> The replacepath.py and removesymlinks.py tools are located in the ossbuild source trunk here. |