summaryrefslogtreecommitdiff
path: root/x11/qt5-qtbase/Makefile.common
blob: 2867afcc3b23b768a03e9994807ebfa464f98717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# $NetBSD: Makefile.common,v 1.31 2019/04/28 12:46:31 maya Exp $
# used by x11/qt5-mysql/Makefile
# used by x11/qt5-odbc/Makefile
# used by x11/qt5-psql/Makefile
# used by x11/qt5-qtbase/Makefile
# used by x11/qt5-qtcharts/Makefile
# used by x11/qt5-qtconnectivity/Makefile
# used by x11/qt5-qtdeclarative/Makefile
# used by x11/qt5-qtdoc/Makefile
# used by x11/qt5-qtgraphicaleffects/Makefile
# used by x11/qt5-qtimageformats/Makefile
# used by x11/qt5-qtlocation/Makefile
# used by x11/qt5-qtmacextras/Makefile
# used by x11/qt5-qtmultimedia/Makefile
# used by x11/qt5-qtnetworkauth/Makefile
# used by x11/qt5-qtquickcontrols/Makefile
# used by x11/qt5-qtscript/Makefile
# used by x11/qt5-qtsensors/Makefile
# used by x11/qt5-qtserialport/Makefile
# used by x11/qt5-qtsvg/Makefile
# used by x11/qt5-qttools/Makefile
# used by x11/qt5-qttranslations/Makefile
# used by x11/qt5-qtwebchannel/Makefile
# used by x11/qt5-qtwebkit/Makefile
# used by x11/qt5-qtwebsockets/Makefile
# used by x11/qt5-qtx11extras/Makefile
# used by x11/qt5-qtxmlpatterns/Makefile

.include "../../x11/qt5/Makefile.common"
.include "options.mk"

.include "../../mk/dlopen.buildlink3.mk"
BUILDLINK_TRANSFORM+=	opt:-ldl:${BUILDLINK_LDADD.dl:Q}

USE_LANGUAGES=		c c++11
USE_TOOLS+=		gmake perl:build pkg-config

# Avoid failures to due 'register' usage in X11 headers.
CFLAGS+=		-Wno-register

# wcstof(3) etc. is used in C++ code.
CFLAGS.NetBSD+=		-D_NETBSD_SOURCE

# for GL_GLEXT_LEGACY with GL/gl.h error, GL_ARB_shader_objects is not defined.
BUILDLINK_TRANSFORM+=	rm:-Wundef

# SunOS ld doesn't support -rpath-link
BUILDLINK_TRANSFORM.SunOS+=	rm:-Wl,-rpath-link,${PREFIX}/qt5/lib
BUILDLINK_TRANSFORM.SunOS+=	rm:-Wl,-rpath-link,${WRKSRC}/lib

MAKE_ENV+=		QTPREFIX=${QTPREFIX:Q}
PLIST_VARS+=		mac unix
.if ${OPSYS} == "Darwin"
PLIST.mac=		yes
.else
PLIST.unix=		yes
.endif

# avoid creating a .qt directory in the users home directory
SCRIPTS_ENV+=		HOME=${WRKDIR}

.if "${PKGPATH}" != "x11/qt5-qtbase" && "${PKGPATH}" != "x11/qt5-odbc" && \
	"${PKGPATH}" != "x11/qt5-mysql" && "${PKGPATH}" != "x11/qt5-psql"
do-configure:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${QTPREFIX}/bin/qmake -o Makefile
.endif

.if ${OPSYS} == "Darwin"
.PHONY: fix-darwin-install-name
post-install: fix-darwin-install-name
fix-darwin-install-name:
	${FIND} ${DESTDIR}${PREFIX} -name "*.dylib" -print |		\
		while read lib; do					\
		libname=`basename $${lib}`;				\
		libdir=`dirname $${lib} | sed -e 's,${DESTDIR},,'`;	\
		install_name_tool -id $${libdir}/$${libname} $${lib};	\
	done
.endif