Difference between revisions of "Qt4/usr"

From CBLFS
Jump to navigationJump to search
(Qt4 installs arch-specific files in datadir; use libdir for multiarch build. also clean up QMAKESPEC)
 
(One intermediate revision by one other user not shown)
Line 38: Line 38:
 
     -system-libmng \
 
     -system-libmng \
 
     -system-libjpeg \
 
     -system-libjpeg \
    -no-exceptions \
 
 
     -openssl \
 
     -openssl \
 
     -opengl \
 
     -opengl \
 
     -glib \
 
     -glib \
 +
    -stl \
 +
    -reduce-relocations \
 +
    -no-separate-debug-info \
 
     -release &&
 
     -release &&
 
  make
 
  make
Line 70: Line 72:
 
     -plugindir /usr/qt4/lib/plugins \
 
     -plugindir /usr/qt4/lib/plugins \
 
     -headerdir /usr/qt4/include \
 
     -headerdir /usr/qt4/include \
     -datadir /usr/qt4/share \
+
     -datadir /usr/qt4/lib \
 
     -translationdir /usr/qt4/share/translations \
 
     -translationdir /usr/qt4/share/translations \
 
     -docdir /usr/qt4/share/doc/qt \
 
     -docdir /usr/qt4/share/doc/qt \
Line 83: Line 85:
 
     -system-libmng \
 
     -system-libmng \
 
     -system-libjpeg \
 
     -system-libjpeg \
    -no-exceptions \
 
 
     -openssl \
 
     -openssl \
 
     -opengl \
 
     -opengl \
 
     -glib \
 
     -glib \
     -release &&
+
    -stl \
 +
    -reduce-relocations \
 +
    -no-separate-debug-info \
 +
     -release \
 +
    -nomake demos \
 +
    -nomake examples &&
 
  make
 
  make
  
Line 99: Line 105:
 
  mv -v /usr/qt4/include/Qt/qconfig{,-32}.h &&
 
  mv -v /usr/qt4/include/Qt/qconfig{,-32}.h &&
 
  mv -v /usr/qt4/include/QtCore/qconfig{,-32}.h
 
  mv -v /usr/qt4/include/QtCore/qconfig{,-32}.h
 +
unset QMAKESPEC
  
 
=== N32 ===
 
=== N32 ===
Line 123: Line 130:
 
     -plugindir /usr/qt4/lib64/plugins \
 
     -plugindir /usr/qt4/lib64/plugins \
 
     -headerdir /usr/qt4/include \
 
     -headerdir /usr/qt4/include \
     -datadir /usr/qt4/share \
+
     -datadir /usr/qt4/lib64 \
 
     -translationdir /usr/qt4/share/translations \
 
     -translationdir /usr/qt4/share/translations \
 
     -docdir /usr/qt4/share/doc/qt \
 
     -docdir /usr/qt4/share/doc/qt \
Line 136: Line 143:
 
     -system-libmng \
 
     -system-libmng \
 
     -system-libjpeg \
 
     -system-libjpeg \
    -no-exceptions \
 
 
     -openssl \
 
     -openssl \
 
     -opengl \
 
     -opengl \
 
     -glib \
 
     -glib \
 +
    -stl \
 +
    -reduce-relocations \
 +
    -no-separate-debug-info \
 
     -release &&
 
     -release &&
 
  make
 
  make
Line 156: Line 165:
 
  ln -sfv /usr/bin/multiarch_wrapper /usr/qt4/bin/uic3 &&
 
  ln -sfv /usr/bin/multiarch_wrapper /usr/qt4/bin/uic3 &&
 
  ln -sfv /usr/bin/multiarch_wrapper /usr/qt4/bin/moc
 
  ln -sfv /usr/bin/multiarch_wrapper /usr/qt4/bin/moc
 +
unset QMAKESPEC
  
 
Create two qconfig.h header files which select the actual architecture-dependent qconfig-{32,64}.h header files:
 
Create two qconfig.h header files which select the actual architecture-dependent qconfig-{32,64}.h header files:

Latest revision as of 20:29, 9 January 2010

Download Source: http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz

Introduction to Qt4/usr

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 KDE4 is built and Qt4 is the version of Qt that the KDE4 uses. You can of course use Qt for non-KDE applications as well, but if you wish to use KDE4 or any KDE4-based applications, you must have Qt4 installed on your system.

Project Homepage: http://qt-project.org/

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 SQLite3 support add the following to the configure command:

-plugin-sql-sqlite -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 you would like to disable Qt 3 support functionality add the following to the configure command:

-no-qt3support

If you would like to disable QtWebKit module add the following to the configure command:

-no-webkit

If you would like to disable linking Qt libraries and executables using the library install path as a runtime library path add the following to the configure command:

-no-rpath

If you don't need qtxmlpatterns add the following to the configure command (since only qtxmlpatterns requires this):

-no-exceptions

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

-no-xfixes

If you want optimized qmake tool add the following to the configure command:

-optimized-qmake

If you would like to disable GLib event loop (which is known to be buggy) add the following to the configure command:

-no-glib
Caution.png

Note

Also you can disable GLib event loop at runtime by setting NO_GLIB environment variable to 1.

If you don't want to compile demos (save compile time) add the following to the configure command:

-nomake demos

If you don't want to compile examples (save compile time) add the following to the configure command:

-nomake examples


If your GCC is NOT gcc4 you probably need to disable visibility explicitly. Just add the following to the configure command:

-no-reduce-exports

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

Make changes for pure64 systems:

for file in $(grep -lr "/lib64" *)
do
  sed -i "s@/lib64@/lib@g" $file
done

Compile the package:

mkdir -v /usr/qt-4.8.5 &&
ln -v -sfn qt-4.8.5 /usr/qt4 &&
./configure -prefix /usr/qt4 \
    -libdir /usr/qt4/lib \
    -plugindir /usr/qt4/lib/plugins \
    -headerdir /usr/qt4/include \
    -datadir /usr/qt4/share \
    -translationdir /usr/qt4/share/translations \
    -docdir /usr/qt4/share/doc/qt \
    -demosdir /usr/qt4/share/demos \
    -examplesdir /usr/qt4/share/examples \
    -sysconfdir /etc/qt4 \
    -L/usr/lib \
    -qt-gif \
    -system-zlib \
    -system-libtiff \
    -system-libpng \
    -system-libmng \
    -system-libjpeg \
    -openssl \
    -opengl \
    -glib \
    -stl \
    -reduce-relocations \
    -no-separate-debug-info \
    -release &&
make

Install the package

make install

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

mkdir -v /usr/qt-4.8.5 &&
ln -v -sfn qt-4.8.5 /usr/qt4 &&
export QMAKESPEC=linux-g++-32 &&
PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
./configure -prefix /usr/qt4 \
    -libdir /usr/qt4/lib \
    -plugindir /usr/qt4/lib/plugins \
    -headerdir /usr/qt4/include \
    -datadir /usr/qt4/lib \
    -translationdir /usr/qt4/share/translations \
    -docdir /usr/qt4/share/doc/qt \
    -demosdir /usr/qt4/share/demos \
    -examplesdir /usr/qt4/share/examples \
    -sysconfdir /etc/qt4 \
    -L/usr/lib \
    -qt-gif \
    -system-zlib \
    -system-libtiff \
    -system-libpng \
    -system-libmng \
    -system-libjpeg \
    -openssl \
    -opengl \
    -glib \
    -stl \
    -reduce-relocations \
    -no-separate-debug-info \
    -release \
    -nomake demos \
    -nomake examples &&
make

Install the package

make install &&
mv -v /usr/qt4/bin/qmake{,-32} &&
mv -v /usr/qt4/bin/uic{,-32} &&
mv -v /usr/qt4/bin/uic3{,-32} &&
mv -v /usr/qt4/bin/moc{,-32} &&
mv -v /usr/qt4/include/Qt/qconfig{,-32}.h &&
mv -v /usr/qt4/include/QtCore/qconfig{,-32}.h
unset QMAKESPEC

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

mkdir -v /usr/qt-4.8.5 &&
ln -v -sfn qt-4.8.5 /usr/qt4 &&
export QMAKESPEC=linux-g++-64 &&
PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
./configure -prefix /usr/qt4 \
    -libdir /usr/qt4/lib64 \
    -plugindir /usr/qt4/lib64/plugins \
    -headerdir /usr/qt4/include \
    -datadir /usr/qt4/lib64 \
    -translationdir /usr/qt4/share/translations \
    -docdir /usr/qt4/share/doc/qt \
    -demosdir /usr/qt4/share/demos \
    -examplesdir /usr/qt4/share/examples \
    -sysconfdir /etc/qt4 \
    -L/usr/lib64 \
    -qt-gif \
    -system-zlib \
    -system-libtiff \
    -system-libpng \
    -system-libmng \
    -system-libjpeg \
    -openssl \
    -opengl \
    -glib \
    -stl \
    -reduce-relocations \
    -no-separate-debug-info \
    -release &&
make

Install the package

make install &&
mv -v /usr/qt4/bin/qmake{,-64} &&
mv -v /usr/qt4/bin/uic{,-64} &&
mv -v /usr/qt4/bin/uic3{,-64} &&
mv -v /usr/qt4/bin/moc{,-64} &&
mv -v /usr/qt4/include/Qt/qconfig{,-64}.h &&
mv -v /usr/qt4/include/QtCore/qconfig{,-64}.h
ln -sfv /usr/bin/multiarch_wrapper /usr/qt4/bin/qmake &&
ln -sfv /usr/bin/multiarch_wrapper /usr/qt4/bin/uic &&
ln -sfv /usr/bin/multiarch_wrapper /usr/qt4/bin/uic3 &&
ln -sfv /usr/bin/multiarch_wrapper /usr/qt4/bin/moc
unset QMAKESPEC

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 > /usr/qt4/include/Qt/qconfig.h << "EOF"
/* qconfig.h - Stub Header  */
#ifndef __STUB__QCONFIG_H__
#define __STUB__QCONFIG_H__

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

#endif /* __STUB__QCONFIG_H__ */
EOF

Creating a Stub Header For Mips

cat > /usr/qt4/include/Qt/qconfig.h << "EOF"
/* qconfig.h - Stub Header  */
#ifndef __STUB__QCONFIG_H__
#define __STUB__QCONFIG_H__

#include <sgidefs.h>

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

#endif /* __STUB__QCONFIG_H__ */
EOF

Creating a Stub Header (Multilib Only)

Creating a Generic Stub Header

cat > /usr/qt4/include/QtCore/qconfig.h << "EOF"
/* qconfig.h - Stub Header  */
#ifndef __STUB__QCONFIG_H__
#define __STUB__QCONFIG_H__

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

#endif /* __STUB__QCONFIG_H__ */
EOF

Creating a Stub Header For Mips

cat > /usr/qt4/include/QtCore/qconfig.h << "EOF"
/* qconfig.h - Stub Header  */
#ifndef __STUB__QCONFIG_H__
#define __STUB__QCONFIG_H__

#include <sgidefs.h>

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

#endif /* __STUB__QCONFIG_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 QT4DIR="/usr/qt4" 
export PATH="${PATH}:${QT4DIR}/bin"

export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}${PKG_CONFIG_PATH+:}${QT4DIR}/lib/pkgconfig"

# 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

/usr/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 QT4DIR="/usr/qt4" 
export PATH="${PATH}:${QT4DIR}/bin"

export PKG_CONFIG_PATH32="${PKG_CONFIG_PATH32}${PKG_CONFIG_PATH32+:}${QT4DIR}/lib/pkgconfig"
export PKG_CONFIG_PATHN32="${PKG_CONFIG_PATHN32}${PKG_CONFIG_PATHN32+:}${QT4DIR}/lib32/pkgconfig"
export PKG_CONFIG_PATH64="${PKG_CONFIG_PATH64}${PKG_CONFIG_PATH64+:}${QT4DIR}/lib64/pkgconfig"

# 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

/usr/qt4/lib
/usr/qt4/lib32
/usr/qt4/lib64

# End qt4 addition
EOF
ldconfig
Retrieved from "?title=Qt4/usr&oldid=19837"