Qt4.5 for mini2440

         开发环境:Ubuntu12.10,arm-linux-gcc-4.3.3,tslib-1.4,QT4.5,mini2440。

         步骤

       一、编译、安装tslib-1.4

         (1)编写如下脚本

        #!/bin/sh
       export CC=arm-linux-gcc
       export AR=arm-linux-ar
       export LD=arm-linux-ld
       export RANLIB=arm-linux-ranlib
       export PREFIX=/usr/local/tslib
       export EXEC_PREFIX=/usr/local/tslib

        ./configure --prefix=${PREFIX} --exec-prefix=${EXEC_PREFIX} --host=arm-linux --target=arm-linux

                $sudo chmod +x tslib_build

            (2) 然后$make && make install           就会安装到/usr/local/tslib,一般需要tslib的lib目录下的库文件以及include的头文件。

       二、下载 qt4.5。

            (1)编写配置脚本

#!/bin/sh

if [ -d build/build_arm ] ; then
	echo "the build_arm directory is already !"
else
	mkdir -p build/build_arm
fi

if [ -d __install/arm ] ; then
	echo "the __install/arm directory is already !"
else
	mkdir -p __install/arm
fi

cd build/build_arm/

if [ -f Makefile ] ; then
	echo "the Makefile is already !"
else
	echo "Config Qt4.5 now, please wait ..."
	echo yes | ../../qt-embedded-linux-opensource-src-4.5.0/configure -prefix /opt/qt-4.5/__install/arm/ -release -shared -fast -no-largefile -qt-sql-sqlite -no-qt3support -no-xmlpatterns -no-mmx -no-3dnow -no-sse -no-sse2 -no-svg -no-webkit -qt-zlib -qt-gif -qt-libtiff -qt-libpng -qt-libjpeg -make libs -nomake examples -nomake docs -nomake demo -no-nis -no-cups -no-iconv -no-dbus -no-openssl -xplatform qws/linux-arm-g++ -embedded arm -little-endian -qt-freetype -depths 16 -qt-gfx-linuxfb -qt-gfx-transformed -qt-gfx-multiscreen -no-gfx-vnc -no-gfx-qvfb -qt-kbd-usb -no-kbd-qvfb -no-glib -armfpa -no-mouse-qvfb -qt-mouse-linuxtp -qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib &&
	echo "Finished config Qt4.5 !"
fi

if [ -f lib/libQtCore.so.4.5.0 ] ; then
	echo "Qt4.5 library build complete !"
else
	echo "Build Qt4.5 library now, please wait ..."
	make &&
	echo "Finished build Qt4.5 !"
fi

if [ -f ../../__install/arm/lib/libQtCore.so.4.5.0 ] ; then
	echo "Qt4.5 library install in __install/arm/ !"
else
	echo "Install Qt4.5 library now, please wait ..."
	make install &&
	echo "Finished install Qt4.5 !"
fi

cd ../../

                $sudo chmod +x arm_qt_build

                (2)   编译、安装

                $sudo ./arm_qt_build

               如果打印如下信息:

                The tslib functionality test failed!
                you might need to modify the include and library search paths by editing
               QMAKE_INCDIR and QMAKE_LIBDIR
              
将tslib的头文件和库文件的路径赋给QMAKE_INCDIR和QMAKE_LIBDIR两个变量。于是打开mkspecs/qws/linux-arm-g++/qmake.conf文件,在3个include后面添加:

               QMAKE_INCDIR = /usr/local/tslib/include
               QMAKE_LIBDIR = /usr/local/tslib/lib

               将tslib头文件和库文件的路径赋给QMAKE_INCDIR和QMAKE_LIBDIR就可以解决问题。

                $ make && make install

你可能感兴趣的:(Qt4.5 for mini2440)