[mplayerosx-devel] build mplayer for iOS 4 on mac os x 10.6

Ronny Falk mailronny at gmail.com
Wed Jan 26 03:53:39 CET 2011


I am trying to build mplayer for iOS to make it play around on the iPod and AppleTV2g.

My problem is that make fails with the following output:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 -O -DCODECS2HTML -I. -Iffmpeg -o codec-cfg codec-cfg.c
In file included from /usr/include/sys/_types.h:33,
                from /usr/include/_types.h:27,
                from /usr/include/stdio.h:64,
                from codec-cfg.c:35:
/usr/include/machine/_types.h:36:24: error: arm/_types.h: No such file or directory
In file included from /usr/include/_types.h:27,
                from /usr/include/stdio.h:64,
                from codec-cfg.c:35:

Could somebody please put me on the right track? I thought the system was going to use the include/sys/_types.h of the isysroot/usr/include folder but this does not seem to be the case.
FFMpeg builds and runs just fine with this configure:
CONFIGURE=./configure --prefix=$(PREFIX) --target-os=darwin --enable-cross-compile --enable-pic --arch=arm --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7' --cpu=cortex-a8

I use the following to build (see below for results)

config.mk:
# Find where this Makefile is located
TOP := $(dir $(lastword $(MAKEFILE_LIST)))

platform_os=iPhoneOS
platform_sdk_version=4.2
platform_min_version=iphoneos-version-min=4.1
platform_gcc_version=4.2.1
platform_host=arm-apple-darwin10
platform_path=/Developer/Platforms/iPhoneOS.platform/Developer
platform_os_cflags=-march=armv7 -mcpu=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -pipe -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -gdwarf-2
platform_os_ldflags=-march=armv7 -mcpu=cortex-a8
prefix_path=$(shell cd $(TOP); pwd)/build
platform_sdk_path=${platform_path}/SDKs/${platform_os}${platform_sdk_version}.sdk
platform_bin_path=${platform_path}/usr/bin

export NM=/usr/bin/nm
export CPP=/usr/bin/cpp
export CXXCPP=${CPP} -I${platform_sdk_path}/usr/include/c++/${platform_gcc_version}/${platform_host}
export CPPFLAGS=-I${platform_sdk_path}/usr/include  -I${prefix_path}/include
export CC=${platform_bin_path}/${platform_host}-gcc-${platform_gcc_version}
export CFLAGS=-std=gnu99 -no-cpp-precomp -m${platform_min_version} -isysroot ${platform_sdk_path} -I${platform_sdk_path}/usr/include ${platform_os_cflags}
export LD=${platform_bin_path}/ld
export LDFLAGS=-m${platform_min_version} -isysroot ${platform_sdk_path} -L${platform_sdk_path}/usr/lib ${platform_os_ldflags} -L${prefix_path}/lib
export CXX=${platform_bin_path}/${platform_host}-g++-${platform_gcc_version} -I${platform_sdk_path}/usr/include/c++/${platform_gcc_version}/${platform_host}
export CXXFLAGS=-m${platform_min_version} -isysroot ${platform_sdk_path} ${platform_os_cflags}
export AR=${platform_bin_path}/ar
export AS=${prefix_path}/bin/gas-preprocessor.pl ${CC}
export CCAS=--tag CC ${prefix_path}/bin/gas-preprocessor.pl ${CC}
export STRIP=${platform_bin_path}/strip
export RANLIB=${platform_bin_path}/ranlib
export ACLOCAL=aclocal -I /Developer/usr/share/aclocal -I ${prefix_path}/share/aclocal
export LIBTOOL=/Developer/usr/bin/glibtool
export LIBTOOLIZE=/Developer/usr/bin/glibtoolize
export HOST=${platform_host}
export PREFIX=${prefix_path}
export DEVROOT=${platform_path}
export SDKROOT=${platform_sdk_path}
export PKG_CONFIG_PATH=${prefix_path}:${platform_sdk_path}/usr/lib/pkgconfig
export PATH:=${prefix_path}/bin:${platform_bin_path}:/Developer/usr/bin:$(PATH)

Makefile:
#  A quick and dirty Makefile to download/build and install
#
#  Usage:
#    make
#    sudo make install

include ../config.mk

# lib name, version
LIBNAME=mplayer
VERSION=
SOURCE=$(LIBNAME)-svn
# download location and format
BASE_URL=svn://svn.mplayerhq.hu/mplayer/trunk
ARCHIVE=

RETRIEVE_TOOL=/usr/bin/svn
RETRIEVE_TOOL_FLAGS=co
ARCHIVE_TOOL=
ARCHIVE_TOOL_FLAGS=

# configuration settings
#export CFLAGS+=-undefined dynamic_lookup
#export LDFLAGS+=-Wl,-read_only_relocs,suppress
CONFIGURE=./configure --prefix=$(PREFIX) --target=$(HOST) --enable-cross-compile 

CLEAN_FILES=$(ARCHIVE) $(SOURCE)

all: $(LIBNAME) .installed

$(SOURCE): $(ARCHIVE)
	$(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL) $(LIBNAME)
	#echo $(ARCHIVE) > .gitignore
	echo $(LIBNAME) >> .gitignore
	cd $(LIBNAME); $(CONFIGURE)

$(LIBNAME): $(SOURCE)
	make -C $(LIBNAME)

.installed:
	make -C $(LIBNAME) install
	touch $@

clean:
	make -C $(LIBNAME) clean
	rm  .installed

distclean::
	rm -rf $(SOURCE) .installed

make result:
make -C mplayer
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 -O -DCODECS2HTML -I. -Iffmpeg -o codec-cfg codec-cfg.c
In file included from /usr/include/sys/_types.h:33,
                from /usr/include/_types.h:27,
                from /usr/include/stdio.h:64,
                from codec-cfg.c:35:
/usr/include/machine/_types.h:36:24: error: arm/_types.h: No such file or directory
In file included from /usr/include/_types.h:27,
                from /usr/include/stdio.h:64,
                from codec-cfg.c:35:
/usr/include/sys/_types.h:94: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_blkcnt_t'
/usr/include/sys/_types.h:95: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_blksize_t'
/usr/include/sys/_types.h:96: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_dev_t'
/usr/include/sys/_types.h:99: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_gid_t'
/usr/include/sys/_types.h:100: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_id_t'
/usr/include/sys/_types.h:101: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_ino64_t'
/usr/include/sys/_types.h:103: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_ino_t'
/usr/include/sys/_types.h:107: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_mach_port_name_t'
/usr/include/sys/_types.h:108: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_mach_port_t'
/usr/include/sys/_types.h:109: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_mode_t'
/usr/include/sys/_types.h:110: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_off_t'
/usr/include/sys/_types.h:111: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_pid_t'
/usr/include/sys/_types.h:131: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_sigset_t'
/usr/include/sys/_types.h:132: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_suseconds_t'
/usr/include/sys/_types.h:133: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_uid_t'
/usr/include/sys/_types.h:134: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__darwin_useconds_t'
In file included from codec-cfg.c:35:
/usr/include/stdio.h:70: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'va_list'
/usr/include/stdio.h:75: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'off_t'
/usr/include/stdio.h:80: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'size_t'
/usr/include/stdio.h:87: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fpos_t'
/usr/include/stdio.h:145: error: expected specifier-qualifier-list before 'fpos_t'
/usr/include/stdio.h:255: error: expected declaration specifiers or '...' before 'fpos_t'
/usr/include/stdio.h:265: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread'
/usr/include/stdio.h:270: error: expected ';', ',' or ')' before '*' token
/usr/include/stdio.h:272: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite'
/usr/include/stdio.h:290: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:296: error: expected declaration specifiers or '...' before 'va_list'
/usr/include/stdio.h:297: error: expected declaration specifiers or '...' before 'va_list'
/usr/include/stdio.h:298: error: expected declaration specifiers or '...' before 'va_list'
/usr/include/stdio.h:301: error: expected declaration specifiers or '...' before 'va_list'
/usr/include/stdio.h:322: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:331: error: expected declaration specifiers or '...' before 'off_t'
/usr/include/stdio.h:332: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ftello'
/usr/include/stdio.h:353: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:355: error: expected declaration specifiers or '...' before 'va_list'
/usr/include/stdio.h:356: error: expected declaration specifiers or '...' before 'va_list'
/usr/include/stdio.h:357: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:357: error: expected declaration specifiers or '...' before 'va_list'
/usr/include/stdio.h:358: error: expected declaration specifiers or '...' before 'va_list'
/usr/include/stdio.h:372: error: expected declaration specifiers or '...' before 'fpos_t'
/usr/include/stdio.h:385: error: expected declaration specifiers or '...' before 'va_list'
In file included from /usr/include/stdio.h:443,
                from codec-cfg.c:35:
/usr/include/secure/_stdio.h:42: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/secure/_stdio.h:49: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/secure/_stdio.h:49: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/secure/_stdio.h:56: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/secure/_stdio.h:57: error: expected declaration specifiers or '...' before 'va_list'
/usr/include/secure/_stdio.h:63: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/secure/_stdio.h:63: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/secure/_stdio.h:64: error: expected declaration specifiers or '...' before 'va_list'
In file included from /usr/include/stdlib.h:65,
                from codec-cfg.c:36:
/usr/include/sys/wait.h:90: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pid_t'
/usr/include/sys/wait.h:95: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'id_t'
In file included from /usr/include/sys/signal.h:81,
                from /usr/include/sys/wait.h:116,
                from /usr/include/stdlib.h:65,
                from codec-cfg.c:36:
/usr/include/machine/signal.h:36:24: error: arm/signal.h: No such file or directory
In file included from /usr/include/sys/_structs.h:57,
                from /usr/include/sys/signal.h:154,
                from /usr/include/sys/wait.h:116,
                from /usr/include/stdlib.h:65,
                from codec-cfg.c:36:
/usr/include/machine/_structs.h:33:26: error: arm/_structs.h: No such file or directory
In file included from /usr/include/sys/signal.h:154,
                from /usr/include/sys/wait.h:116,
                from /usr/include/stdlib.h:65,
                from codec-cfg.c:36:
/usr/include/sys/_structs.h:78: error: expected specifier-qualifier-list before '__darwin_size_t'
/usr/include/sys/_structs.h:131: error: expected specifier-qualifier-list before '__darwin_sigset_t'
In file included from /usr/include/sys/wait.h:116,
                from /usr/include/stdlib.h:65,
                from codec-cfg.c:36:
[ ... ]

libmpdemux/demuxer.h:363: error: expected declaration specifiers or '...' before 'off_t'
libmpdemux/demuxer.h:368: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ds_tell'
libmpdemux/demuxer.h:406: error: expected declaration specifiers or '...' before 'off_t'
libmpdemux/demuxer.h:450: error: expected declaration specifiers or '...' before 'size_t'
In file included from codec-cfg.c:57:
libmpdemux/aviheader.h:350: error: expected specifier-qualifier-list before 'off_t'
codec-cfg.c: In function 'add_to_inout':
codec-cfg.c:258: warning: incompatible implicit declaration of built-in function 'strlen'
codec-cfg.c:258: error: too many arguments to function 'strncmp'
codec-cfg.c:272: warning: incompatible implicit declaration of built-in function 'strlen'
codec-cfg.c:272: error: too many arguments to function 'strncmp'
codec-cfg.c: In function 'validate_codec':
codec-cfg.c:370: warning: incompatible implicit declaration of built-in function 'strlen'
codec-cfg.c: In function 'add_comment':
codec-cfg.c:420: warning: incompatible implicit declaration of built-in function 'strlen'
codec-cfg.c:423: warning: incompatible implicit declaration of built-in function 'strlen'
codec-cfg.c:423: error: too many arguments to function 'realloc'
codec-cfg.c:427: error: 'size_t' undeclared (first use in this function)
codec-cfg.c: In function 'get_cpuflags':
codec-cfg.c:444: warning: incompatible implicit declaration of built-in function 'strlen'
codec-cfg.c:444: error: too many arguments to function 'strncmp'
codec-cfg.c: In function 'get_token':
codec-cfg.c:477: error: 'size_t' undeclared (first use in this function)
codec-cfg.c:477: error: too many arguments to function '__inline_memset_chk'
codec-cfg.c: In function 'parse_codec_cfg':
codec-cfg.c:623: error: too many arguments to function 'realloc'
codec-cfg.c:629: error: 'size_t' undeclared (first use in this function)
codec-cfg.c:629: error: too many arguments to function '__inline_memset_chk'
codec-cfg.c:630: error: too many arguments to function '__inline_memset_chk'
codec-cfg.c:631: error: too many arguments to function '__inline_memset_chk'
codec-cfg.c:632: error: too many arguments to function '__inline_memset_chk'
codec-cfg.c: In function 'stringset_add':
codec-cfg.c:873: error: too many arguments to function 'realloc'
make[2]: *** [codec-cfg] Error 1
make[1]: *** [mplayer] Error 2
make: *** [mplayer] Error 2

Best,
Ronny


More information about the mplayerosx-devel mailing list