最近、ndk を使用して Android 用の ffmpeg をコンパイルしています。configureは正しいのですが、作り始めるとエラーになります。シェルを構成します。
export TMPDIR=D:/temp/android
export NDK=/cygdrive/D/DevelopKit/android-ndk-r8d
export PATH=/cygdrive/C/cygwin/tmp/ffmpeg/bin:$PATH
export CC=arm-linux-androideabi-gcc
export LD=arm-linux-androideabi-ld
export AR=arm-linux-androideabi-ar
export C_INCLUDE_PATH=/cygdrive/C/cygwin/tmp/ffmpeg/sysroot/usr/include
export LIBRARY_PATH=/cygdrive/C/cygwin/tmp/ffmpeg/sysroot/usr/lib
CFLAGS="-O3 -Wall -mthumb -pipe -fpic -fasm \
-finline-limit=300 -ffast-math \
-fstrict-aliasing -Werror=strict-aliasing \
-fmodulo-sched -fmodulo-sched-allow-regmoves \
-Wno-psabi -Wa,--noexecstack \
-D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ \
-D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ \
-DANDROID -DNDEBUG"
EXTRA_CFLAGS="-march=armv7-a -mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad"
EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"
FFMPEG_FLAGS="--prefix=/tmp/ffmpeg/build \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--cross-prefix=arm-linux-androideabi- \
--enable-shared \
--disable-symver \
--disable-doc \
--disable-ffplay \
--disable-ffmpeg \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-avfilter \
--disable-encoders \
--disable-muxers \
--disable-filters \
--disable-devices \
--disable-everything \
--enable-protocols \
--enable-parsers \
--enable-demuxers \
--disable-demuxer=sbg \
--enable-decoders \
--enable-bsfs \
--enable-network \
--enable-swscale \
--enable-asm \
--enable-version3"
./configure $FFMPEG_FLAGS --extra-cflags="$CFLAGS $EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS"
結果の構成 (config.mak の一部):
ifndef FFMPEG_CONFIG_MAK
FFMPEG_CONFIG_MAK=1
FFMPEG_CONFIGURATION=--prefix=/tmp/ffmpeg/build --target-os=linux --arch=arm --enable-cross-compile --cross-prefix=arm-linux-androideabi- --enable-shared --disable-symver --disable-doc --disable-ffplay --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-avdevice --disable-avfilter --disable-encoders --disable-muxers --disable-filters --disable-devices --disable-everything --enable-protocols --enable-parsers --enable-demuxers --disable-demuxer=sbg --enable-decoders --enable-bsfs --enable-network --enable-swscale --enable-asm --enable-version3 --extra-cflags='-O3 -Wall -mthumb -pipe -fpic -fasm -finline-limit=300 -ffast-math -fstrict-aliasing -Werror=strict-aliasing -fmodulo-sched -fmodulo-sched-allow-regmoves -Wno-psabi -Wa,--noexecstack -D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ -DANDROID -DNDEBUG -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad' --extra-ldflags='-Wl,--fix-cortex-a8'
prefix=/tmp/ffmpeg/build
LIBDIR=$(DESTDIR)${prefix}/lib
SHLIBDIR=$(DESTDIR)${prefix}/lib
INCDIR=$(DESTDIR)${prefix}/include
BINDIR=$(DESTDIR)${prefix}/bin
DATADIR=$(DESTDIR)${prefix}/share/ffmpeg
MANDIR=$(DESTDIR)${prefix}/share/man
SRC_PATH=.
ifndef MAIN_MAKEFILE
SRC_PATH:=$(SRC_PATH:.%=..%)
endif
CC_IDENT=gcc 4.6
(GCC)
ARCH=arm
CC=arm-linux-androideabi-gcc
CXX=arm-linux-androideabi-g++
AS=arm-linux-androideabi-gcc
LD=arm-linux-androideabi-gcc
DEPCC=arm-linux-androideabi-gcc
DEPCCFLAGS= $(CPPFLAGS)
DEPAS=arm-linux-androideabi-gcc
DEPASFLAGS= $(CPPFLAGS)
YASM=yasm
DEPYASM=yasm
AR=arm-linux-androideabi-ar
ARFLAGS=rc
AR_O=$@
でも作ったら
CC libavformat/4xm.o
In file included from ./libavutil/bswap.h:35:0,
from ./libavutil/intreadwrite.h:25,
from libavformat/4xm.c:30:
./config.h:8:18: warning: missing terminating " character [enabled by default]
In file included from ./libavutil/bswap.h:35:0,
from ./libavutil/intreadwrite.h:25,
from libavformat/4xm.c:30:
./config.h:9:7: warning: missing terminating " character [enabled by default]
./config.h:9:2: error: missing terminating " character
In file included from ./libavutil/intreadwrite.h:25:0,
from libavformat/4xm.c:30:
./libavutil/bswap.h:58:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'static'
common.mak:48: recipe for target `libavformat/4xm.o' failed
make: *** [libavformat/4xm.o] Error 1
これは文字エラーで、Windows の文字だと思います (私は cygwin を使用しています)。dos2unix を試しましたが、うまくいきませんでした。私を助けてください。アドバイスしてくれてありがとう。