Difference between revisions of "Qt4"

From CBLFS
Jump to navigationJump to search
m (Non-Multilib)
Line 66: Line 66:
  
 
  ./configure -prefix /opt/qt-{{Qt4-Version}} \
 
  ./configure -prefix /opt/qt-{{Qt4-Version}} \
  -plugindir /usr/lib/plugins
+
  -plugindir /usr/lib/plugins \
 
  -sysconfdir /etc/qt4 \
 
  -sysconfdir /etc/qt4 \
 
  -qt-gif \
 
  -qt-gif \

Revision as of 21:44, 21 September 2007

Download Source: ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-4.8.5.tar.gz

Introduction to Qt4

Qt is a comprehensive development framework that includes an extensive array of features, capabilities and tools that enable development of high-performance, cross-platform rich-client and server-side applications. Qt is the GUI framework on which KDE is built and Qt4 is the version of Qt that the upcoming KDE4 will use. You can of course use Qt for non-KDE applications as well, but if you wish to use KDE or any KDE-based applications, you must have Qt installed on your system.

Project Homepage: http://www.trolltech.com/products/qt

Dependencies

Required

Optional

Configuration Information

If you would like to compile with MySQL support add the following to the configure command:

-plugin-sql-mysql -I/usr/include/mysql

If you would like to compile with PostgreSQL support add the following to the configure command:

-plugin-sql-psql -I/usr/include/postgresql/server

If you would like to compile with SQLite support add the following to the configure command:

-plugin-sql-sqlite2 -system-sqlite

If you would like to compile with unixODBC support add the following to the configure command:

-plugin-sql-odbc

If you would like to compile with NAS support add the following to the configure command:

-system-nas-sound

If your X Window System is NOT Xorg, then add to configure:

-no-xfixes

Non-Multilib

If you're X Window System prefix is something other then /usr/X11R6 then run the following command to change the hard coded paths in the sources:

for file in $(grep -lr "X11R6" *)
do
    sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" $file
done

Compile the package:

./configure -prefix /opt/qt-4.8.5 \
-plugindir /usr/lib/plugins \
-sysconfdir /etc/qt4 \
-qt-gif \
-system-zlib \
-system-libpng \
-system-libjpeg \
-system-libmng \
-no-exceptions \
-tablet &&
make

Install the package

make install &&
ln -v -sfn qt-4.8.5 /opt/qt4

Multilib

32Bit

If you're X Window System prefix is something other then /usr/X11R6 then run the following command to change the hard coded paths in the sources:

for file in $(grep -lr "X11R6" *)
do
    sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" $file
done

Compile the package

export QMAKESPEC=linux-g++-32 &&
PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
./configure -prefix /opt/qt-4.8.5 \
-libdir /opt/qt-4.8.5/lib \
-plugindir /opt/qt-4.8.5/lib/plugins \
-L/usr/lib \
-sysconfdir /etc/qt4 \
-qt-gif \
-system-zlib \
-system-libpng \
-system-libjpeg \
-system-libmng \
-no-exceptions \
-tablet &&
make

Install the package

make install &&
mv -v /opt/qt-4.8.5/bin/qmake{,-32} &&
mv -v /opt/qt-4.8.5/bin/uic{,-32} &&
mv -v /opt/qt-4.8.5/bin/uic3{,-32} &&
mv -v /opt/qt-4.8.5/bin/moc{,-32} &&
mv -v /opt/qt-4.8.5/bin/qtconfig{,-32} &&
mv -v /opt/qt-4.8.5/include/Qt/qconfig{,-32}.h &&
mv -v /opt/qt-4.8.5/include/QtCore/qconfig{,-32}.h

N32

TO BE DONE

64Bit

If you're X Window System prefix is something other then /usr/X11R6 then run the following command to change the hard coded paths in the sources:

for file in $(grep -lr "X11R6" *)
do
    sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" $file
done

Compile the package

export QMAKESPEC=linux-g++-64 &&
PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
./configure -prefix /opt/qt-4.8.5 \
-libdir /opt/qt-4.8.5/lib64 \
-plugindir /opt/qt-4.8.5/lib64/plugins \
-L/usr/lib64 \
-sysconfdir /etc/qt4 \
-qt-gif \
-system-zlib \
-system-libpng \
-system-libjpeg \
-system-libmng \
-no-exceptions \
-tablet &&
make

Install the package

make install &&
mv -v /opt/qt-4.8.5/bin/qmake{,-64} &&
mv -v /opt/qt-4.8.5/bin/uic{,-64} &&
mv -v /opt/qt-4.8.5/bin/uic3{,-64} &&
mv -v /opt/qt-4.8.5/bin/moc{,-64} &&
mv -v /opt/qt-4.8.5/bin/qtconfig{,-64} &&
mv -v /opt/qt-4.8.5/include/Qt/qconfig{,-64}.h &&
mv -v /opt/qt-4.8.5/include/QtCore/qconfig{,-64}.h
ln -sfv /usr/bin/multiarch_wrapper /opt/qt-4.8.5/bin/qmake &&
ln -sfv /usr/bin/multiarch_wrapper /opt/qt-4.8.5/bin/uic &&
ln -sfv /usr/bin/multiarch_wrapper /opt/qt-4.8.5/bin/uic3 &&
ln -sfv /usr/bin/multiarch_wrapper /opt/qt-4.8.5/bin/moc &&
ln -sfv /usr/bin/multiarch_wrapper /opt/qt-4.8.5/bin/qtconfig &&
ln -v -sfn qt-4.8.5 /opt/qt4

Create two qconfig.h header files which select the actual architecture-dependent qconfig-{32,64}.h header files:

Creating a Stub Header (Multilib Only)

Creating a Generic Stub Header

cat > /opt/qt-4.8.5/include/Qt/qtconfig.h << "EOF"
/* qtconfig.h - Stub Header  */
#ifndef __STUB__QTCONFIG_H__
#define __STUB__QTCONFIG_H__

#if defined(__x86_64__) || \
    defined(__sparc64__) || \
    defined(__arch64__) || \
    defined(__powerpc64__) || \
    defined (__s390x__)
# include "qtconfig-64.h"
#else
# include "qtconfig-32.h"
#endif

#endif /* __STUB__QTCONFIG_H__ */
EOF

Creating a Stub Header For Mips

cat > /opt/qt-4.8.5/include/Qt/qtconfig.h << "EOF"
/* qtconfig.h - Stub Header  */
#ifndef __STUB__QTCONFIG_H__
#define __STUB__QTCONFIG_H__

#include <sgidefs.h>

#if (_MIPS_SIM == _ABIO32)
# include "qtconfig-32.h"
#elif (_MIPS_SIM == _ABIN32)
# include "qtconfig-n32.h"
#elif (_MIPS_SIM == _ABI64)
# include "qtconfig-64.h"
#endif

#endif /* __STUB__QTCONFIG_H__ */
EOF

Creating a Stub Header (Multilib Only)

Creating a Generic Stub Header

cat > /opt/qt-4.8.5/include/QtCore/qtconfig.h << "EOF"
/* qtconfig.h - Stub Header  */
#ifndef __STUB__QTCONFIG_H__
#define __STUB__QTCONFIG_H__

#if defined(__x86_64__) || \
    defined(__sparc64__) || \
    defined(__arch64__) || \
    defined(__powerpc64__) || \
    defined (__s390x__)
# include "qtconfig-64.h"
#else
# include "qtconfig-32.h"
#endif

#endif /* __STUB__QTCONFIG_H__ */
EOF

Creating a Stub Header For Mips

cat > /opt/qt-4.8.5/include/QtCore/qtconfig.h << "EOF"
/* qtconfig.h - Stub Header  */
#ifndef __STUB__QTCONFIG_H__
#define __STUB__QTCONFIG_H__

#include <sgidefs.h>

#if (_MIPS_SIM == _ABIO32)
# include "qtconfig-32.h"
#elif (_MIPS_SIM == _ABIN32)
# include "qtconfig-n32.h"
#elif (_MIPS_SIM == _ABI64)
# include "qtconfig-64.h"
#endif

#endif /* __STUB__QTCONFIG_H__ */
EOF

Configuring

Non-Multilib

/etc/profile.d/20-qt4.sh

Create an addition to the Bash Startup Files:

cat > /etc/profile.d/20-qt4.sh << "EOF"
# Begin /etc/profile.d/20-qt4.sh

export PATH="${PATH}:/opt/qt4/bin"

export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}${PKG_CONFIG_PATH+:}/opt/qt4/lib"

# End /etc/profile.d/20-qt4.sh
EOF

ld.so.conf

cat >> /etc/ld.so.conf << "EOF" &&
# Begin qt4 addition to /etc/ld.so.conf

/opt/qt4/lib

# End qt4 addition
EOF
ldconfig

Multilib

/etc/profile.d/20-qt4.sh

Create an addition to the Bash Startup Files:

cat > /etc/profile.d/20-qt4.sh << "EOF"
# Begin /etc/profile.d/20-qt4.sh

export PATH="${PATH}:/opt/qt4/bin"

export PKG_CONFIG_PATH32="${PKG_CONFIG_PATH32}${PKG_CONFIG_PATH32+:}/opt/qt4/lib"
export PKG_CONFIG_PATHN32="${PKG_CONFIG_PATHN32}${PKG_CONFIG_PATHN32+:}/opt/qt4/lib32"
export PKG_CONFIG_PATH64="${PKG_CONFIG_PATH64}${PKG_CONFIG_PATH64+:}/opt/qt4/lib64"

# End /etc/profile.d/20-qt4.sh
EOF

ld.so.conf

cat >> /etc/ld.so.conf << "EOF" &&
# Begin qt4 addition to /etc/ld.so.conf

/opt/qt4/lib
/opt/qt4/lib32
/opt/qt4/lib64

# End qt4 addition
EOF
ldconfig
Retrieved from "?title=Qt4&oldid=11158"