qt5base-lts/mkspecs
Thiago Macieira 96166fa56a Update the macros for shared/DLL and static builds
Up until now, we had a mess of different macros used for building
DLLs, for building shared libraries on Unix systems and for building
static libraries. Some of the macros were contradictory and did not
work. From now on, there shall be only:

 - QT_STATIC: indicates that it's a static Qt build and the export
   macros should expand to empty
 - QT_SHARED: indicates that it's a shared / dynamic Qt build and the
   export macros should expand to Q_DECL_EXPORT or Q_DECL_IMPORT,
   depending on whether the macro corresponds to the current module
   being built (the QT_BUILD_XXXX_LIB macro comes from the module's
   .pro file)

QT_BOOTSTRAPPED implies QT_STATIC since the bootstrapped tools link
statically to some source code.

QT_STATIC is recorded in qconfig.h by configure when Qt is configured
for static builds. Nothing is recorded for a shared / dynamic build,
so QT_SHARED is implied if nothing is defined. This allows for the
existence of a static_and_shared build: with nothing recorded,
defining QT_STATIC before qglobal.h causes the export macros to be
that of the static form. Linking to the static libraries is out of the
scope of this change (something for the buildsystem and linker to
figure out).

From this commit on, the proper way of declaring the export macros for
a module called QtFoo is:

    #ifndef QT_STATIC
    #  ifdef QT_BUILD_FOO_LIB
    #    define Q_FOO_EXPORT Q_DECL_EXPORT
    #  else
    #    define Q_FOO_EXPORT Q_DECL_IMPORT
    #  endif
    #else
    #  define Q_FOO_EXPORT
    #endif

The type of the Qt build is recorded in QT_CONFIG (in qconfig.pri) so
all Qt modules build by default the same type of library. The keywords
are "static" and "shared", used in both QT_CONFIG and CONFIG. The
previous keyword of "staticlib" is deprecated and should not be used.

Discussed-on: http://lists.qt-project.org/pipermail/development/2012-April/003172.html
Change-Id: I127896607794795b681c98d08467efd8af49bcf3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-28 06:21:48 +02:00
..
aix-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
aix-g++-64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
aix-xlc centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
aix-xlc-64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
cmake Refactor the creation of imported targets into a macro. 2012-06-27 14:43:00 +02:00
common revamp automatic makefile generation for sub-projects 2012-06-19 16:46:08 +02:00
cygwin-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
darwin-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
devices Set Wayland as default platform on Raspberry-Pi 2012-06-24 05:26:10 +02:00
features Update the macros for shared/DLL and static builds 2012-06-28 06:21:48 +02:00
freebsd-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
freebsd-g++46 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
freebsd-icc centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
hpux-acc centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
hpux-acc-64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
hpux-acc-o64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
hpux-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
hpux-g++-64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
hpuxi-acc-32 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
hpuxi-acc-64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
hpuxi-g++-64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
hurd-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
irix-cc centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
irix-cc-64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
irix-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
irix-g++-64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
linux-arm-gnueabi-g++ Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
linux-cxx centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
linux-ecc-64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
linux-g++ Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
linux-g++-32 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
linux-g++-64 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
linux-g++-maemo Include generic ARM qplatformdefs.h in linux-g++-maemo mkspec 2012-03-19 20:16:04 +01:00
linux-icc centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
linux-icc-32 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
linux-icc-64 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
linux-kcc centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
linux-llvm Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
linux-lsb-g++ Use the LSB linker to link 2012-03-15 00:50:47 +01:00
linux-pgcc centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
lynxos-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
macx-clang Add mkspecs for 32-bit Mac OS X builds. 2012-05-04 09:19:23 +02:00
macx-clang-32 Add mkspecs for 32-bit Mac OS X builds. 2012-05-04 09:19:23 +02:00
macx-clang-libc++ mkspecs: Add macx-clang-libc++ and macx-clang-libc++-32 2012-06-20 15:45:07 +02:00
macx-clang-libc++-32 mkspecs: Add macx-clang-libc++ and macx-clang-libc++-32 2012-06-20 15:45:07 +02:00
macx-g++ Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
macx-g++40 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
macx-g++42 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
macx-g++-32 Add mkspecs for 32-bit Mac OS X builds. 2012-05-04 09:19:23 +02:00
macx-icc Remove all usages of "arch" CFLAGS on Mac. 2012-05-04 09:19:23 +02:00
macx-llvm Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
macx-pbuilder Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
macx-xcode Remove all usages of "arch" CFLAGS on Mac. 2012-05-04 09:19:23 +02:00
macx-xlc centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
modules update readme to current reality 2012-01-27 13:55:27 +01:00
netbsd-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
openbsd-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
sco-cc centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
sco-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
solaris-cc centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
solaris-cc-64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
solaris-cc-64-stlport Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
solaris-cc-stlport Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
solaris-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
solaris-g++-64 centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
tru64-cxx centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
tru64-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
unixware-cc centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
unixware-g++ centralize definitions of shell commands 2012-06-19 16:46:07 +02:00
unsupported Avoid macro re-definition after 1838a6c2fb 2012-06-26 11:37:57 +02:00
win32-g++ Avoid macro re-definition after 1838a6c2fb 2012-06-26 11:37:57 +02:00
win32-icc Avoid macro re-definition after 1838a6c2fb 2012-06-26 11:37:57 +02:00
win32-msvc11 Avoid macro re-definition after 1838a6c2fb 2012-06-26 11:37:57 +02:00
win32-msvc2005 Avoid macro re-definition after 1838a6c2fb 2012-06-26 11:37:57 +02:00
win32-msvc2008 Avoid macro re-definition after 1838a6c2fb 2012-06-26 11:37:57 +02:00
win32-msvc2010 Avoid macro re-definition after 1838a6c2fb 2012-06-26 11:37:57 +02:00
wince50standard-armv4i-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince50standard-armv4i-msvc2008 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince50standard-mipsii-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince50standard-mipsii-msvc2008 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince50standard-mipsiv-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince50standard-mipsiv-msvc2008 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince50standard-sh4-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince50standard-sh4-msvc2008 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince50standard-x86-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince50standard-x86-msvc2008 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince60standard-armv4i-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince60standard-x86-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wince70embedded-armv4i-msvc2008 Enable basic gesture support for WEC7. 2012-02-06 05:15:11 +01:00
wince70embedded-x86-msvc2008 Enable basic gesture support for WEC7. 2012-02-06 05:15:11 +01:00
wincewm50pocket-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wincewm50pocket-msvc2008 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wincewm50smart-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wincewm50smart-msvc2008 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wincewm60professional-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wincewm60professional-msvc2008 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wincewm60standard-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wincewm60standard-msvc2008 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wincewm65professional-msvc2005 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
wincewm65professional-msvc2008 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00