Gstreamer的交叉编译

export CC=arm-linux-gnueabihf-gcc

1.zlib 交叉编译 压缩

cd zlib-1.2.11 CC=arm-linux-gnueabihf-gcc ./configure --prefix=/home/chengdu/crossgst/prefix --enable-shared

修改Makefile中的gcc=arm-linux-gnueabihf-gcc make make install

 

2.libffi 交叉编译 实现C语言的消息传递 runtime

cd libffi-3.2 CC=arm-linux-gnueabihf-gcc ./configure --prefix=/home/chengdu/crossgst/prefix --host=arm-linux-gnueabihf HOST=arm-linux-gnueabihf make make install

在configure 时出现 expected an absolute directory name for --prefix=./dir 错误担示,将./dir改成绝对路径即可

./configure --prefix=/home/chengdu/crossgst/libffi-3.2.9999/output/ --host=arm-linux-gnueabihf

 

3.gettext 交叉编译 多语言消息支持

./configure -prefix=/home/chengdu/crossgst/prefix --enable-shared --host=arm-linux-gnueabihf make install

 

4.glib 交叉编译

cd glib-2.56.0

LIBFFI_CFLAGS='-I/home/chengdu/crossgst/prefix/include'

LIBFFI_LIBS='-lffi -L=/home/chengdu/crossgst/prefix/lib' 

这句是我指定libffi的头文件以及库文件位置

ZLIB_CFLAGS='-I/home/chengdu/crossgst/prefix/include'

ZLIB_LIBS='-lz -L/home/chengdu/crossgst/prefix/lib' 

./configure --host=arm-linux-gnueabihf --prefix=/home/chengdu/crossgst/prefix PKG_CONFIG_PATH=/home/chengdu/crossgst/prefix/lib/pkgconfig glib_cv_stack_grows=no glib_cv_uscore=yes ac_cv_func_posix_getpwuid_r=yes ac_cv_func_posix_getgrgid_r=yes --with-pcre=internal --enable-libmount=no make make install

 

5.orc 交叉编译

cd orc-0.4.28 ./configure --prefix=/home/chengdu/crossgst/prefix --host=arm-linux-gnueabihf make make install

6.x264 交叉编译

cd x264 ./configure --prefix=/home/chengdu/crossgst/prefix --enable-shared --host=arm-linux-gnueabihf --disable-asm --cross-prefix=arm-linux-gnueabihf- make make install

 

7. libxml

cd libxml2-2.9.8 ./configure --prefix=/home/chengdu/crossgst/prefix --enable-shared --host=arm-linux-gnueabihf CROSS_COMPILE=arm-linux-gnueabihf- --with-python=no

\Z_CFLAGS='-I/home/chengdu/crossgst/prefix/include'

\Z_LIBS='-lz -L/home/chengdu/crossgst/prefix/lib' 

make && make install

8.openssl 交叉编译

cd openssl-1.1.0h ./config --prefix=/home/chengdu/crossgst/prefix shared no-asm --host=arm-linux-gnueabihf CROSS_COMPILE=arm-linux-gnueabihf- sed -i "s/-m64//g" ./Makefile //sed -i 's/原字符串/新字符串/g' make && make install

 

 

9.gstreamer-1.14.0 交叉编译

cd gstreamer-1.14.0 ./configure --prefix=/home/chengdu/crossgst/prefix --host=arm-linux-gnueabihf LDFLAGS="-Wl,--unresolved-symbols=ignore-in-shared-libs -I/home/chengdu/crossgst/prefix/include" PKG_CONFIG_PATH=/home/chengdu/crossgst/prefix/lib/pkgconfig GIO_LIBS="-L/home/chengdu/crossgst/prefix/lib -lgio-2.0 -lgobject-2.0 -lglib-2.0" GLIB_LIBS="-L/home/chengdu/crossgst/prefix/lib -lglib-2.0 -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0" --disable-loadsave --disable-gtk-doc ac_cv_func_register_printf_function=no --disable-valgrind make && make install

你可能感兴趣的:(C语言,嵌入式,IOT)