0
votes

I'm trying to compile x264 for use in an iPhone application. I see there are instructions on how to compile ffmpeg for use on the platform here: http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-October/076618.html , but I can't seem to find anything this complete for compiling x264 on the iPhone. I've found this source tree: http://gitorious.org/x264-arm that seems to have support for the ARM platform.

Here is my config line:

./configure --cross-prefix=/usr/bin/ --host=arm-apple-darwin10 --extra-cflags="-B /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/lib/ -I /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/lib/"

...and inside configure I'm using the gas-preprocessor script (first link above) as my assembler:

gas-preprocessor.pl gcc

When I start compiling, it chunks away for a little while, then it spits out these warnings and a huge list of undefined symbols:

ld: warning: option -s is obsolete and being ignored
ld: warning: -force_cpusubtype_ALL will become unsupported for ARM architectures
ld: warning: in /usr/lib/crt1.o, missing required architecture arm in file
ld: warning: in /usr/X11R6/lib/libX11.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libm.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libpthread.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libgcc_s.1.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libSystem.dylib, missing required architecture arm in file
Undefined symbols:

My guess would be that the problem has to do with the "missing required architecture arm in file" warning...any ideas?

2

2 Answers

1
votes

Check this site: http://github.com/gabriel/ffmpeg-iphone-build File: build-x264-armv6

You will love it!

Bye & Good Luck!

1
votes

Many of the developers experience issues compiling FFMpeg sources after transition to XCode 4.3. This is mostly due to the fact, that unlike in previous releases, XCode4.3 comes as a bundle, and doesn't include the command-line tools initially.

We've tried to build the universal script; you can download the complete environment for building FFMpeg along with XCode4.3 here: https://github.com/melnikov/ffmpeg4iphone_4.3

PREREQUISITES:

  1. you have to have XCode4.2 or 4.3 installed on your Mac
  2. you have to have XCode command line tools installed (can be installed via XCode -> Preferences ->Downloads)
  3. you have to have git for mac installed.

INSTRUCTIONS and EXPLANATIONS:

  1. place build script into some directory (say, /tmp/ffbuild), set executable flag on it (by running 'chmod +x ./build)
  2. run the script. What it will do:
  3. it will checkout latest version of FFMpeg into FFmpeg directory (you can safely comment this out if you have already checked out FFmpeg into current directory)
  4. it will try to detect the location of your Xcode.app and will exit if Xcode is not installed
  5. it will try to locate gcc inside of the Xcode.app and will exit if it's not found (this may happen if Xcode Command Tools are not installed)
  6. if the above steps ran smoothly, script will
  7. create build_results folder
  8. will subsequently run FFmpeg configure and make for 3 different architectures (armv6, armv7, i386) and will put them into respective directories inside of build_results folder
  9. will run lipo and create universal libs (and will put them inside build_results/Universal) folder.

BTW, I've tested the script on a number of my colleague's macs, and some of them tend to not return any results in mdfind for Xcode.app. So, if the script will return 'Xcode is not installed', please feel free to set XCODEPATH variable to the path to Xcode.app