交叉编译arm-linux-gcc环境下的gtk教程

4星 · 超过85%的资源 需积分: 33 16 下载量 182 浏览量 更新于2024-09-20 收藏 53KB DOC 举报
"这篇资料详细介绍了如何使用交叉编译工具arm-linux-gcc来构建GTK环境,特别是针对嵌入式设备,如基于ARM架构的Linux系统。资料内容包括一系列依赖库的交叉编译步骤,从glib到gtk+,旨在帮助初学者掌握交叉编译技术并成功构建GTK应用程序在目标板上的运行环境。" 交叉编译是开发嵌入式系统时常用的技术,因为它允许在一台主机上构建适用于不同架构的目标系统的软件。在这个过程中,"arm-linux-gcc" 是一个关键的交叉编译器,它能够生成适合ARM处理器的二进制代码。GTK(GIMP Toolkit)是一个用于创建图形用户界面的开源库,广泛应用于Linux系统。 首先,编译GTK及其依赖库的顺序非常重要,因为每个库都有其依赖项,必须先编译并安装基础库。资料中列出了以下的依赖库顺序: 1. glib-2.14.0 2. atk-1.19.3 3. zlib-1.2.3 4. jpegsrc.v6b 5. libpng-1.2.19 6. freetype-2.1.10 7. libxml2-2.6.29 8. fontconfig-2.4.2 9. tiff-3.7.4 10. DirectFB-1.2.0 11. cairo-1.4.10 12. pango-1.16.4 13. gtk+-2.10.14 以glib为例,交叉编译过程包括: - 进入glib源代码目录:`cd /usr/src/gtk-directfb/glib-2.14.0` - 创建配置缓存文件并设置特定选项:`echo ac_cv_type_long_long=yes > arm-linux.cache`,`echo glib_cv_stack_grows=no >> arm-linux.cache`,`echo glib_cv_uscore=no >> arm-linux.cache`,`echo ac_cv_func_posix_getpwuid_r=yes >> arm-linux.cache` - 使用配置脚本并指定交叉编译信息:`./configure --host=arm-linux --prefix=/gtkdfb --cache-file=arm-linux.cache` - 编译并安装:`make && make install` 交叉编译atk时,同样需要执行配置脚本,但还需要手动修改`/`, `/atk` 和 `/tests` 中的Makefile文件,确保包含正确的依赖库路径和编译选项。 整个过程涉及到的库都是GTK正常运行所必需的,例如glib提供了基础的内存管理、线程支持和数据类型;atk提供辅助技术支持;zlib和jpegsrc.v6b处理压缩数据;libpng和freetype支持图像处理;libxml2处理XML文档;fontconfig管理和配置字体;tiff处理TIFF图像;DirectFB是底层图形框架;cairo用于2D图形绘制;pango处理文本布局和渲染;最后,gtk+自身则包含了构建GUI的组件。 通过这个过程,开发者可以在目标板上创建一个完整的GTK运行环境,使得GTK应用程序能够在ARM架构的Linux系统上顺利运行。对于初学者来说,理解这个过程和正确配置交叉编译环境是至关重要的,这将为他们开发和调试嵌入式系统的GUI应用打下坚实的基础。
2017-08-31 上传
交叉编译libx加GTK+2.1时候用到库各个库文件的集合,不用花费时间网上一个一个下载,已经经过本人亲测试实测,还可以编译GTK+directFB 1.1 libs_for_gtk Dir: atk-1.25.2.tar.gz atk-1.26.0.tar.gz bigreqsproto-1.1.2.tar.bz2 cairo-1.8.6.tar.gz CPAN-1.94.tar.gz DirectFB-1.1.1.tar.gz expat-2.0.1.tar.gz expat-2.1.0.tar.gz ExtUtils-MakeMaker-6.20.tar.gz fontconfig-2.4.2.tar.gz fontconfig-2.6.0.tar.gz fontconfig-2.7.3.tar.gz freetype-2.3.5.tar.bz2 freetype-doc-2.3.6.tar.bz2 glib-2.12.1.tar.bz2 glib-2.14.4.tar.gz glib-2.18.2.tar.bz2 glibc-2.2.5.tar.bz2 gtk+-2.10.14.tar.bz2 gtk+-2.10.7.tar.bz2 gtk+-2.12.12.tar.bz2 inputproto-2.2.tar.bz2 jpegsrc.v6b.rar jpegsrc.v6b.tar.gz kbproto-1.0.6.tar.bz2 libpng-1.2.10.tar.bz2 libpng-1.2.32.tar.lzma libpthread-stubs_0.1.orig.tar.gz libtool-1.5.22.tar.gz libtool-2.4.2.tar.xz libX11-1.0.3.tar.bz2 libX11-1.2.2.tar.bz2 libX11-1.3.2.tar.gz libX11-1.5.0.tar.bz2 libXau-1.0.7.tar.bz2 libXau-1.0.8.tar.bz2 libxcb-1.3.tar.bz2 libxcb-1.4.tar.bz2 libxcb-1.8.1.tar.bz2 libXdmcp-1.0.3.tar.gz libXdmcp-1.1.2.tar.bz2 libXext-1.0.1.tar.bz2 libXfont-1.4.4.tar.bz2 libXft-2.1.12.tar.bz2 libXft-2.1.13.tar.bz2 libxml2-2.6.30.tar.gz libxml2-2.6.32.tar.gz libxslt-1.1.29.tar.gz libXt-1.0.6.tar.bz2 pango-1.16.4.tar.bz2 pango-1.18.2.tar.gz pango-1.22.1.tar.bz2 pango-1.24.4.tar.bz2 pixman-0.24.0.tar.bz2 poky-pinky-3.1.1.tgz stubs-soft.h tiff-3.8.2.tar.gz tiff-4.0.7.tar.gz tslib-1.4.tar.gz xcb-proto-1.7.1.tar.bz2 xcmiscproto-1.1.2.tar.bz2 xcmiscproto-1.2.2.tar.bz2 xextproto-7.2.1.tar.bz2 xorg-server-1.3.0.0.tar.bz2 xorg-server-1.4.2.tar.bz2 xproto-7.0.23.tar.bz2 xtrans-1.2.7.tar.bz2 zlib-1.2.3.rar zlib-1.2.3.tar.gz zlib-1.2.5.tar.gz
2019-04-04 上传
Building on: linux-g++ (x86_64, CPU features: mmx sse sse2) Building for: linux-aarch64-gnu-g++ (arm64, CPU features: neon) Target compiler: gcc 6.3.1 Configuration: cross_compile use_gold_linker compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 concurrent dbus reduce_exports stl Build options: Mode ................................... release Optimize release build for size ........ no Building shared libraries .............. yes Using C standard ....................... C11 Using C++ standard ..................... C++14 Using ccache ........................... no Using gold linker ...................... yes Using new DTAGS ........................ yes Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: NEON ................................. yes Build parts ............................ libs Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... no Qt Gui ................................. yes Qt Network ............................. yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes Support enabled for: Using pkg-config ....................... yes udev ................................... no Using system zlib ...................... yes Qt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... no iconv .................................. yes ICU .................................... no Tracing backend ........................ Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no Using system PCRE2 ..................... no Qt Network: getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no Linux AF_NETLINK ....................... yes OpenSSL ................................ yes Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ no DTLS ................................... yes SCTP ................................... no Use system proxies ..................... yes Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ no HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. no Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... yes PNG .................................. yes Using system libpng ................ no EGL .................................... no OpenVG ................................. no OpenGL: Desktop OpenGL ....................... no OpenGL ES 2.0 ........................ no OpenGL ES 3.0 ........................ no OpenGL ES 3.1 ........................ no OpenGL ES 3.2 ........................ no Vulkan ................................. no Session Management ..................... yes Features used by QPA backends: evdev .................................. yes libinput ............................... no INTEGRITY HID .......................... no mtdev .................................. no tslib .................................. no xkbcommon .............................. no X11 specific: XLib ................................. no EGL on X11 ........................... no QPA backends: DirectFB ............................... no EGLFS .................................. no LinuxFB ................................ yes VNC .................................... yes Mir client ............................. no Qt Sql: SQL item models ........................ yes Qt Widgets: GTK+ ................................... no Styles ................................. Fusion Windows Qt PrintSupport: CUPS ................................... no Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no Qt Testlib: Tester for item models ................. yes Qt SerialBus: Socket CAN ............................. yes Socket CAN FD .......................... yes Qt QML: QML network support .................... yes QML debugging and profiling support .... yes QML sequence object .................... yes QML list model ......................... yes QML XML http request ................... yes QML Locale ............................. yes QML delegate model ..................... yes Qt Quick: Direct3D 12 ............................ no AnimatedImage item ..................... yes Canvas item ............................ yes Support for Qt Quick Designer .......... yes Flipable item .......................... yes GridView item .......................... yes ListView item .......................... yes TableView item ......................... yes Path support ........................... yes PathView item .......................... yes Positioner items ....................... yes Repeater item .......................... yes ShaderEffect item ...................... yes Sprite item ............................ yes Qt Scxml: ECMAScript data model for QtScxml ...... yes Qt Gamepad: SDL2 ................................... no Qt 3D: Assimp ................................. yes System Assimp .......................... no Output Qt3D Job traces ................. no Output Qt3D GL traces .................. no Use SSE2 instructions .................. no Use AVX2 instructions .................. no Aspects: Render aspect ........................ yes Input aspect ......................... yes Logic aspect ......................... yes Animation aspect ..................... yes Extras aspect ........................ yes Qt 3D Renderers: OpenGL Renderer ........................ yes Qt 3D GeometryLoaders: Autodesk FBX ........................... no Qt Wayland Client ........................ no Qt Wayland Compositor .................... no Qt Bluetooth: BlueZ .................................. no BlueZ Low Energy ....................... no Linux Crypto API ....................... no WinRT Bluetooth API (desktop & UWP) .... no Qt Sensors: sensorfw ............................... no Qt Quick Controls 2: Styles ................................. Default Fusion Imagine Material Universal Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... yes Qt Positioning: Gypsy GPS Daemon ....................... no WinRT Geolocation API .................. no Qt Location: Qt.labs.location experimental QML plugin . yes Geoservice plugins: OpenStreetMap ........................ yes HERE ................................. yes Esri ................................. yes Mapbox ............................... yes MapboxGL ............................. no Itemsoverlay ......................... yes QtXmlPatterns: XML schema support ..................... yes Qt Multimedia: ALSA ................................... no GStreamer 1.0 .......................... no GStreamer 0.10 ......................... no Video for Linux ........................ yes OpenAL ................................. no PulseAudio ............................. no Resource Policy (libresourceqt5) ....... no Windows Audio Services ................. no DirectShow ............................. no Windows Media Foundation ............... no Qt Tools: QDoc ................................... no Qt WebEngine: Embedded build ......................... yes Pepper Plugins ......................... no Printing and PDF ....................... no Proprietary Codecs ..................... no Spellchecker ........................... yes Native Spellchecker .................... no WebRTC ................................. no Use System Ninja ....................... no Geolocation ............................ yes WebChannel support ..................... yes Use v8 snapshot ........................ yes Kerberos Authentication ................ no Building v8 snapshot supported ......... yes Use ALSA ............................... no Use PulseAudio ......................... no Optional system libraries used: re2 .................................. no icu .................................. no libwebp, libwebpmux and libwebpdemux . no opus ................................. no ffmpeg ............................... no libvpx ............................... no snappy ............................... no glib ................................. no zlib ................................. yes minizip .............................. no libevent ............................. no jsoncpp .............................. no protobuf ............................. no libxml2 and libxslt .................. no lcms2 ................................ no png .................................. no JPEG ................................. no harfbuzz ............................. no freetype ............................. no x11 .................................. no Required system libraries: fontconfig ........................... no dbus ................................. no nss .................................. no khr .................................. no glibc ................................ yes Required system libraries for qpa-xcb: libdrm ............................... no xcomposite ........................... no xcursor .............................. no xi ................................... no xrandr ............................... no xtst ................................. no Note: Also available for Linux: linux-clang linux-icc