2013-10-08 18:02:21 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
2014-01-06 17:16:52 +01:00
|
|
|
# Provide support for qmake-based projects
|
2013-10-08 18:02:21 +02:00
|
|
|
#
|
|
|
|
# Feature: qmake
|
|
|
|
# Usage: USES=qmake or USES=qmake:ARGS
|
2014-01-06 17:16:52 +01:00
|
|
|
# Must be used along with 'USE_QT*=#'
|
|
|
|
# Valid ARGS: norecursive outsource
|
2013-10-08 18:02:21 +02:00
|
|
|
# ARGS description:
|
|
|
|
# norecursive Don't pass -recursive argument to qmake binary
|
2014-01-06 17:16:52 +01:00
|
|
|
# outsource Perform an out-of-source build
|
2013-10-08 18:02:21 +02:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# Variables for ports:
|
|
|
|
# QMAKE_ENV - Environment passed to qmake.
|
|
|
|
# Default: ${CONFIGURE_ENV}
|
2013-11-21 15:15:53 +01:00
|
|
|
# QMAKE_ARGS - Arguments passed to qmake.
|
2013-10-08 18:02:21 +02:00
|
|
|
# Default: see below
|
2013-11-21 15:15:53 +01:00
|
|
|
# QMAKE_SOURCE_PATH - Path to qmake project files.
|
2014-01-06 17:16:52 +01:00
|
|
|
# Default: ${WRKSRC} if out-of-source build is
|
|
|
|
# requested, empty otherwise.
|
2013-10-08 18:02:21 +02:00
|
|
|
#
|
|
|
|
# User defined variables:
|
2013-11-21 15:15:53 +01:00
|
|
|
# QMAKE_VERBOSE - Enable verbose configure output.
|
2013-10-08 18:02:21 +02:00
|
|
|
#
|
2014-03-15 11:31:54 +01:00
|
|
|
# MAINTAINER: kde@FreeBSD.org
|
2013-10-08 18:02:21 +02:00
|
|
|
|
|
|
|
.if !defined(_INCLUDE_USES_QMAKE_MK)
|
|
|
|
_INCLUDE_USES_QMAKE_MK= yes
|
|
|
|
|
2014-01-06 17:16:52 +01:00
|
|
|
# _QT_VERSION is defined in bsd.qt.mk, only if a correct Qt version was selected
|
|
|
|
# via USE_QT*.
|
|
|
|
.if empty(_QT_VERSION)
|
|
|
|
IGNORE= 'USES+= qmake' must be accompanied with 'USE_QT[${_QT_SUPPORTED:S/ //g}]= #'
|
2013-10-08 18:02:21 +02:00
|
|
|
.endif
|
|
|
|
|
2014-01-06 17:16:52 +01:00
|
|
|
# _env is a private argument used only by bsd.qt.mk to get variables and custom
|
|
|
|
# targets (currently, only qmake-configure), without qmake being added to the
|
|
|
|
# configure stage.
|
|
|
|
_VALID_ARGS= norecursive outsource _env
|
|
|
|
|
2014-09-28 18:36:31 +02:00
|
|
|
.for arg in ${qmake_ARGS}
|
2014-01-06 17:16:52 +01:00
|
|
|
. if empty(_VALID_ARGS:M${arg})
|
|
|
|
IGNORE= Incorrect 'USES+= qmake' usage: argument '${arg}' is not recognized
|
|
|
|
. endif
|
2014-09-28 18:36:31 +02:00
|
|
|
.endfor
|
2013-10-08 18:02:21 +02:00
|
|
|
|
2014-09-28 18:36:31 +02:00
|
|
|
.if ! ${qmake_ARGS:M_env}
|
2014-01-06 17:16:52 +01:00
|
|
|
USE_QT${_QT_VERSION:R:R}+= qmake_build
|
2013-10-08 18:02:21 +02:00
|
|
|
.endif
|
|
|
|
|
2014-01-06 17:16:52 +01:00
|
|
|
# QMAKESPEC belongs to bsd.qt.mk.
|
|
|
|
QMAKE_ENV?= ${CONFIGURE_ENV}
|
|
|
|
QMAKE_ARGS+= -spec ${QMAKESPEC} \
|
|
|
|
QMAKE_CC="${CC}" QMAKE_CXX="${CXX}" \
|
|
|
|
QMAKE_LINK_C="${CC}" QMAKE_LINK_C_SHLIB="${CC}" \
|
|
|
|
QMAKE_LINK="${CXX}" QMAKE_LINK_SHLIB="${CXX}" \
|
|
|
|
QMAKE_CFLAGS="${CFLAGS}" \
|
|
|
|
QMAKE_CXXFLAGS="${CXXFLAGS}" \
|
|
|
|
QMAKE_LFLAGS="${LDFLAGS}" \
|
Update the Qt4 ports to 4.8.7.
According to upstream, this is the last planned Qt4 release.
A list of changes since 4.8.6 can be found here:
<http://download.qt.io/official_releases/qt/4.8/4.8.7/changes-4.8.7>
Porting notes and changes:
- Remove several patches that have been upstreamed.
- Make Uses/qmake.mk pass the contents of LIBS to the qmake environment. [1]
- Repurpose devel/qt4/files/extrapatch-src-corelib-global-qglobal.h now the
original patch is part of the release (curiously enough, the original
patch was never actually used, as the ?= assignment in r362837 after
r362770 was never possible).
This works around the way compiler support for C++11 features is detected
in Qt 4.8.7: while it originally only uses the compiler to determine if
something is supported or not, the initializer lists feature also depends
on the C++ standard library being used. It's a problem in FreeBSD 9.x,
where USES=compiler:c++0x or USES=compiler:c++11-lang means we will use
clang to build a port but use libstdc++ from base (GCC 4.2). The latter
obviously does not support initializer lists, and the build fails because
Qt tries to include headers that do not exist (<initializer_list>).
Since detecting libstdc++'s version is not trivial (we need to include a
non-lightweight header like cstdio and then check for __GLIBCXX__), we
just enable Q_COMPILER_INITIALIZER_LISTS support only when libc++ is used
(there should be no reason for someone to be using clang with GCC 4.8's
libstdc++, for example).
x11/kdelibs4's FindQt4.cmake had to include a backported change from the
upstream FindQt4.cmake in CMake itself to use a C++ compiler to detect
flags like Q_WS_X11, otherwise the inclusion of <ciso646> in qglobal.h
makes the build fail.
This patch contains changes by me, makc@ and alonso@.
PR: 202552 [1]
PR: 202808 [exp-run]
Submitted by: pawel@ [1]
2015-09-16 10:55:04 +02:00
|
|
|
QMAKE_LIBS="${LIBS}" \
|
2014-04-09 21:00:49 +02:00
|
|
|
QMAKE_CFLAGS_DEBUG="" \
|
|
|
|
QMAKE_CFLAGS_RELEASE="" \
|
|
|
|
QMAKE_CXXFLAGS_DEBUG="" \
|
|
|
|
QMAKE_CXXFLAGS_RELEASE="" \
|
2014-01-06 17:16:52 +01:00
|
|
|
PREFIX="${PREFIX}"
|
2013-10-08 18:02:21 +02:00
|
|
|
|
2014-01-06 17:16:52 +01:00
|
|
|
.if defined(WITH_DEBUG)
|
|
|
|
QMAKE_ARGS+= CONFIG+="debug" \
|
|
|
|
CONFIG-="release"
|
|
|
|
.else
|
|
|
|
QMAKE_ARGS+= CONFIG+="release" \
|
|
|
|
CONFIG-="debug separate_debug_info"
|
|
|
|
.endif # defined(WITH_DEBUG)
|
|
|
|
|
|
|
|
# We set -recursive by default to keep qmake from running in the build stage.
|
2014-09-28 18:36:31 +02:00
|
|
|
.if ! ${qmake_ARGS:Mnorecursive}
|
2013-10-08 18:02:21 +02:00
|
|
|
QMAKE_ARGS+= -recursive
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(QMAKE_VERBOSE)
|
|
|
|
QMAKE_ARGS+= -d
|
|
|
|
.endif
|
|
|
|
|
2014-01-06 17:16:52 +01:00
|
|
|
# _QMAKE_WRKSRC (and _QMAKE, below) are needed to abstract the qmake target and
|
|
|
|
# use it for both qtbase and USES=qmake ports. They are private, not supposed to
|
|
|
|
# be used anywhere else.
|
|
|
|
_QMAKE_WRKSRC?= ${CONFIGURE_WRKSRC}
|
2014-09-28 18:36:31 +02:00
|
|
|
.if ${qmake_ARGS:Moutsource}
|
2014-01-06 17:16:52 +01:00
|
|
|
CONFIGURE_WRKSRC= ${WRKDIR}/.build
|
|
|
|
BUILD_WRKSRC= ${CONFIGURE_WRKSRC}
|
|
|
|
INSTALL_WRKSRC= ${BUILD_WRKSRC}
|
2016-10-18 13:20:01 +02:00
|
|
|
TEST_WRKSRC= ${BUILD_WRKSRC}
|
2014-01-06 17:16:52 +01:00
|
|
|
QMAKE_SOURCE_PATH?= ${WRKSRC}
|
|
|
|
.else
|
|
|
|
QMAKE_SOURCE_PATH?= # empty
|
|
|
|
.endif
|
|
|
|
|
2014-09-28 18:36:31 +02:00
|
|
|
.if ! ${qmake_ARGS:M_env}
|
2014-01-06 17:16:52 +01:00
|
|
|
DESTDIRNAME= INSTALL_ROOT
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Define a custom target to make it usable by bsd.qt.mk for internal Qt
|
|
|
|
# configuration.
|
|
|
|
qmake-configure:
|
|
|
|
@${MKDIR} ${_QMAKE_WRKSRC}
|
|
|
|
@cd ${_QMAKE_WRKSRC} && \
|
|
|
|
${SETENV} ${QMAKE_ENV} ${_QMAKE} ${QMAKE_ARGS} ${QMAKE_SOURCE_PATH}
|
2013-11-21 15:15:53 +01:00
|
|
|
|
2014-09-28 18:36:31 +02:00
|
|
|
.if !target(do-configure) && ! ${qmake_ARGS:M_env}
|
2016-05-28 22:01:16 +02:00
|
|
|
_USES_configure+= 450:qmake-configure
|
2013-10-08 18:02:21 +02:00
|
|
|
.endif
|
|
|
|
|
2014-01-06 17:16:52 +01:00
|
|
|
.endif # !defined(_INCLUDE_USES_QMAKE_MK)
|