qt5base-lts/mkspecs/features
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
..
mac configure: Remove the -dwarf2 argument for Mac OS X builds 2012-05-11 12:52:21 +02:00
qpa Install fonts when not using fontconfig 2012-03-16 21:30:59 +01:00
unix define have_target CONFIG flag 2012-06-19 16:40:02 +02:00
win32 correctly find idc even for makefiles 2012-06-19 16:46:07 +02:00
build_pass.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
c++11.prf configure: Auto-detect and enable C++11 support if available 2012-06-05 12:30:13 +02:00
configure.prf add qtCompileTest() 2012-06-19 16:45:57 +02:00
create_cmake.prf Don't re-evaluate the lib location. 2012-06-26 04:18:29 +02:00
ctest_testcase.prf Factorize the cmake test infrastructure to be reusable. 2012-06-26 11:49:52 +02:00
dbusadaptors.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
dbusinterfaces.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
debug_and_release.prf qmake: remove symbian support 2011-11-07 13:26:41 +01:00
debug.prf configure: Remove the -dwarf2 argument for Mac OS X builds 2012-05-11 12:52:21 +02:00
declarative_debug.prf Enable QML debugging of qtquick1 with CONFIG+=quick1 2012-05-02 12:21:55 +02:00
default_post.prf Update the macros for shared/DLL and static builds 2012-06-28 06:21:48 +02:00
default_pre.prf let default_pre add modules to the qmake path 2012-06-19 16:46:03 +02:00
designer_defines.prf dispose of library-bound feature files 2012-06-19 16:39:52 +02:00
device_config.prf mkspecs: Use the right variable name to find the qdevice.pri 2012-06-26 20:02:55 +02:00
dll.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
egl.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
exceptions_off.prf turn off exceptions by default where they aren't required 2012-05-17 05:14:26 +02:00
exceptions.prf turn off exceptions by default where they aren't required 2012-05-17 05:14:26 +02:00
exclusive_builds.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
include_source_dir.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
incredibuild_xge.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
lex.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
link_pkgconfig.prf Make pkg-config cross-compile aware 2011-10-19 22:27:09 +02:00
moc.prf remove backwards compatibility hacks 2012-06-19 16:46:00 +02:00
module.prf make qt_module_config.prf install the module pri file 2012-06-19 16:40:00 +02:00
no_debug_info.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
opengles1.prf Add a new qmake feature to support OpenGL ES 1 apps 2012-02-28 22:35:24 +01:00
qml_debug.prf Rename the 'declarative debug support' to 'qml debug support' 2012-03-31 16:33:04 +02:00
qmltestcase.prf Remove declarative from qmltestcase.prf. 2012-05-11 12:52:21 +02:00
qt_build_config.prf fix misnomer: qt_module.prf => qt_build_config.prf 2012-06-19 16:46:08 +02:00
qt_config.prf scan module path backwards 2012-06-19 16:46:04 +02:00
qt_functions.prf make using testlib automatically "promote" all modules to -private 2012-06-26 11:51:34 +02:00
qt_installs.prf remove workarounds for broken syncqt 2012-06-19 16:46:00 +02:00
qt_module_config.prf Update the macros for shared/DLL and static builds 2012-06-28 06:21:48 +02:00
qt_module_fwdpri.prf support for private depends in modules 2012-06-19 16:46:08 +02:00
qt_module_headers.prf move generation of module master headers to qt_module_headers 2012-06-19 16:46:01 +02:00
qt_module.prf fix misnomer: qt_module.prf => qt_build_config.prf 2012-06-19 16:46:08 +02:00
qt_plugin.prf Update the macros for shared/DLL and static builds 2012-06-28 06:21:48 +02:00
qt_targets.prf bump version of QMAKE_TARGET_PRODUCT 2012-02-27 20:52:45 +01:00
qt.prf Update the macros for shared/DLL and static builds 2012-06-28 06:21:48 +02:00
quick1_debug.prf Enable QML debugging of qtquick1 with CONFIG+=quick1 2012-05-02 12:21:55 +02:00
release.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
resolve_target.prf Add missing naming for libraries built statically. 2011-11-11 02:45:05 +01:00
resources.prf move moc, rcc and uic CONFIG additions to the respective qt modules 2012-06-19 16:39:53 +02:00
shared.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
silent.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
static_and_shared.prf define have_target CONFIG flag 2012-06-19 16:40:02 +02:00
static.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
staticlib.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
testcase.prf embedded doesn't exist anymore 2012-06-22 07:41:31 +02:00
testcocoon.prf CodeCoverage: Exclude all header files from intrumentation. 2012-03-01 07:52:44 +01:00
testlib_defines.prf auto-generate module pris 2012-06-19 16:40:06 +02:00
uic.prf remove backwards compatibility hacks 2012-06-19 16:46:00 +02:00
use_c_linker.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
vxworks.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
warn_off.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
warn_on.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
wayland-scanner.prf Add a wayland-scanner rule to qmake 2011-12-12 17:27:19 +01:00
yacc.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00