0.環境
- OS:RHEL5.1-Server
- Soft Version:x264-snapshot-20120817-2245
- 編譯器:gcc 4.1.2
- 交叉編譯器:arm-linux-gcc 4.3.2
X264資源來源:http://www.videolan.org/developers/x264.html
1.配置
- ./configure --disable-asm
執行上述語句後生成config.mak等一系列文件
2.修改配置參數(移植到ARM平台,做如下操作)
修改config.mak:
- SRCPATH=.
- prefix=/usr/local
- exec_prefix=${prefix}
- bindir=${exec_prefix}/bin
- libdir=${exec_prefix}/lib
- includedir=${prefix}/include
- #這裡修改為ARM
- ARCH=ARM
- SYS=LINUX
- #這裡修改為arm-linux-gcc
- CC=arm-linux-gcc
- #這裡去掉-m32
- CFLAGS=-Wshadow -O3 -ffast-math -Wall -I. -I$(SRCPATH) -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize
- DEPMM=-MM -g0
- DEPMT=-MT
- #這裡修改為arm-linux-gcc
- LD=arm-linux-gcc -o
- LDFLAGS=-lm -lpthread
- LIBX264=libx264.a
- AR=ar rc
- RANLIB=ranlib
- STRIP=strip
- AS=
- ASFLAGS= -O2 -f elf -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
- RC=
- RCFLAGS=
- EXE=
- HAVE_GETOPT_LONG=1
- DEVNULL=/dev/null
- PROF_GEN_CC=-fprofile-generate
- PROF_GEN_LD=-fprofile-generate
- PROF_USE_CC=-fprofile-use
- PROF_USE_LD=-fprofile-use
- default: cli
- install: install-cli
- LDFLAGSCLI =
- CLI_LIBX264 = $(LIBX264)
3.編譯安裝
- make
- make install
PS:此文檔格式參考了別人文章的格式,記錄自己的努力