qt之imx6庫編譯

2021-10-04 07:34:02 字數 4166 閱讀 1729

#

# qmake configuration for building with arm-linux-gnueabi-g++

#makefile_generator = unix

config +

= incremental

qmake_incremental_style = sublib

# 配置交叉編譯引數

imx6_cflags =

-march=armv7-a -mfpu=neon -dlinux=

1-degl_api_fb=

1imx6_cflags_release =

-o2 $$imx6_cflags

qmake_cflags_debug +

= $$imx6_cflags

qmake_cxxflags_debug +

= $$imx6_cflags

qmake_cflags_release +

= $$imx6_cflags_release

qmake_cxxflags_release +

= $$imx6_cflags_release

include(.

./common/linux.conf)

include(.

./common/gcc-base-unix.conf)

include(.

./common/g++

-unix.conf)

# 配置交叉編譯工具路徑

poky_path =

/opt/poky/

1.7/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi

# 配置交叉編譯檔案系統

rootfs_path =

/opt/fsl-image-gui-imx6qsabresd

# 配置交叉編譯工具

# modifications to g++.conf

qmake_cc = $$poky_path/arm-poky-linux-gnueabi-gcc -mfloat-abi=hard

qmake_cxx = $$poky_path/arm-poky-linux-gnueabi-g++

-mfloat-abi=hard

qmake_link = $$poky_path/arm-poky-linux-gnueabi-g++

-mfloat-abi=hard

qmake_link_shlib = $$poky_path/arm-poky-linux-gnueabi-g++

-mfloat-abi=hard

# modifications to linux.conf

qmake_ar = $$poky_path/arm-poky-linux-gnueabi-ar cqs

qmake_objcopy = $$poky_path/arm-poky-linux-gnueabi-objcopy

qmake_nm = $$poky_path/arm-poky-linux-gnueabi-nm -p

qmake_strip = $$poky_path/arm-poky-linux-gnueabi-strip

# 配置依賴標頭檔案和庫目錄

qmake_incdir +

= $$rootfs_path/usr/include

qmake_libdir +

= $$rootfs_path/usr/lib

# 配置依賴庫引用(下面是引用opengl庫,還可以引用其他庫)

qmake_libs_egl +

=-legl -lgal

qmake_libs_opengl_es1 +

=-lglesv1_cm -legl -lgal

qmake_libs_opengl_es1cl +

=-lgles_cl -legl -lgal

qmake_libs_opengl_es2 +

=-lglesv2 -legl -lgal -lvsc

qmake_libs_openvg +

=-lopenvg -legl -lgal -lvsc

load

(qt_config)

建立構建目錄,例如:/home/workspace/qt-build。命令選項說明。通過終端進入構建目錄,輸入命令:

./../qt-everywhere-src-5.12.0/configure \

-verbose \

-opensource \

-release \

-shared \

-confirm-license \

-eglfs \

-linuxfb \

-openvg \

-make libs \

-xplatform linux-arm-gnueabi-g++ \

-prefix /opt/qt-5.12.0-imx6

若不開啟opengl功能,則輸入命令:

./../qt-everywhere-src-5.12.0/configure \

-verbose \

-opensource \

-release \

-shared \

-confirm-license \

-linuxfb \

-make libs \

-no-opengl \

-xplatform linux-arm-gnueabi-g++ \

-prefix /opt/qt-5.12.0-imx6

配置成功後,輸入命令:make記憶體最好大於4g以上,不然在某些情況下編譯可能會不過,即進入編譯流程,等候大約三四個小時,編譯成功後,輸入命令:make install,即可把qt庫安裝到目錄:/opt/qt-5.12.0-imx6

進入目錄:/opt/qt-5.14.1-imx6/lib,建立字型目錄fonts,可以把.ttf字型檔案拷貝到字型目錄中。

2、配置/etc/profile

export qt_root=/opt/qt-5.12.0-imx6

export qt_plugin_path=

$qt_root/plugins

export qml2_import_path=

$qt_root/qml

export qt_qpa_fontdir=

$qt_root/lib/fonts

export qt_qpa_platform_plugin_path=

$qt_root/plugins/platforms

export qt_qpa_platform=eglfs

export qt_qpa_eglfs_integration=eglfs_viv

export qt_qpa_eglfs_forcevsync=1

export fb_multi_buffer=2

export xdg_runtime_dir=/tmp

export ld_library_path=

$qt_root/lib:$ld_library_path

export qt_root=/opt/qt-5.12.0-imx6

export qt_plugin_path=

$qt_root/plugins

export qml2_import_path=

$qt_root/qml

export qt_qpa_fontdir=

$qt_root/lib/fonts

export qt_qpa_platform_plugin_path=

$qt_root/plugins/platforms

export qt_qpa_platform=linuxfb

export xdg_runtime_dir=/tmp

export ld_library_path=

$qt_root/lib:$ld_library_path

socat 交叉編譯 imx6

1,為了使用linux虛擬串列埠的功能,選擇移植乙個socat工具。2,設定交叉編譯工具路徑 export path path usr local arm gcc linaro arm linux gnueabihf 4.9 2014.07 linux bin 3,解壓,配置 tar xzvf so...

imx6的qt5 6 2的移植

一 準備工作 需要安裝的庫檔案 sudo apt get install libxcb1 libxcb1 dev libx11 xcb1 libx11 xcb dev libxcb keysyms1 libxcb keysyms1 dev libxcb image0 libxcb image0 de...

Openwrt移植IMX6之增加u boot支援

openwrt已經支援 imx6的 u boot,u boot位於 package boot uboot imx6,只需要針對自己的 u boot新增補丁,openwrt使用 quilt管理補丁 以下是製作補丁的全過程。參考文件 cat quiltrc quilt refresh args no t...