tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: qmake and STRIP



I thought I'd try to improve this by introducing some new replacement
variables in files/qmake.conf, and set them correctly for the various
cases that exist. However there are so many, and several sub-cases, that
the result is not pretty and I don't like it.

qmake.conf would change something like this:

Index: files/qmake.conf
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt5-qtbase/files/qmake.conf,v
retrieving revision 1.10
diff -u -r1.10 qmake.conf
--- files/qmake.conf	9 Aug 2019 17:41:39 -0000	1.10
+++ files/qmake.conf	28 Jun 2021 16:27:14 -0000
@@ -6,11 +6,11 @@
 CONFIG += qt warn_on release link_prl incremental gdb_dwarf_index
 QMAKE_INCREMENTAL_STYLE = sublib
 
-@QMAKE_EXTRA@
+QMAKE_PLATFORM +=	@PLATFORM@
 
 include(../common/gcc-base-unix.conf)
 include(../common/g++-unix.conf)
-include(../common/unix.conf)
+include(../common/@INCLUDE@)
 
 QMAKE_COMPILER		= @COMPILER@
 
On the Mac, it gets handled pretty much separately from all other cases,
and it has its own template file:

Index: files/qmake.conf.mac
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt5-qtbase/files/qmake.conf.mac,v
retrieving revision 1.4
diff -u -r1.4 qmake.conf.mac
--- files/qmake.conf.mac	9 Aug 2019 17:41:39 -0000	1.4
+++ files/qmake.conf.mac	28 Jun 2021 16:27:14 -0000
@@ -14,7 +14,7 @@
 
 include(../common/gcc-base-mac.conf)
 include(../common/g++-unix.conf)
-include(../common/unix.conf)
+include(../common/bsd/bsd.conf)
 
 QMAKE_COMPILER		= @CC@
 
Then in the Makefile I try to set PLATFORM, INCLUDE and DIRECTORY for
all cases. DIRECTORY is the glob for finding the directori(es) where to
install the pkgsrc version of qmake.conf. This way it doesn't get copied
to wildly inappropriate places.

But it still smells wrong. The qmake.conf explicitly refers to gcc and
g++, even when using clang. The laundry list of assignments in it
(which are compiler-approproate) *might* overwrite the incorrect ones in
the included files, but I would prefer not to bet my life on that.

So this is the result of that idea.

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt5-qtbase/Makefile,v
retrieving revision 1.110
diff -u -r1.110 Makefile
--- Makefile	25 May 2021 09:26:32 -0000	1.110
+++ Makefile	28 Jun 2021 16:36:54 -0000
@@ -66,21 +66,29 @@
 .include "../../mk/compiler.mk"
 
 .if ${OPSYS} == "SunOS"
+PLATFORM =			solaris
 .  if !empty(PKGSRC_COMPILER:Mgcc) || !empty(PKGSRC_COMPILER:Mclang)
+INCLUDE =			solaris.conf
 .    if ${ABI:U} == "64"
 CONFIGURE_ARGS+=		-platform solaris-g++-64
+DIRECTORY =			solaris-g++-64
 .    else
 CONFIGURE_ARGS+=		-platform solaris-g++
+DIRECTORY =			solaris-g++
 .    endif
 .  else
+INCLUDE =			unix.conf
 .    if ${ABI:U} == "64"
 CONFIGURE_ARGS+=		-platform solaris-cc-64
+DIRECTORY =			solaris-cc-64
 .    else
 CONFIGURE_ARGS+=		-platform solaris-cc
+DIRECTORY =			solaris-cc
 .    endif
 .  endif
 NETWORK_LIBS=			-lsocket -lnsl
 .elif ${OPSYS} == "Interix"
+DIRECTORY =			interix-g++ # XXX unsopported my qmake anyway?
 CONFIGURE_ARGS+=		-platform interix-g++
 CFLAGS+=			-I/usr/local/include/bind
 LDFLAGS+=			-L/usr/local/lib/bind -lbind
@@ -92,6 +100,7 @@
 .elif ${OPSYS} == "Darwin"
 CONFIGURE_ARGS+=		-platform macx-clang
 CONFIGURE_ARGS+=		-no-framework
+DIRECTORY =			macx-clang
 # pkgsrc has a patch to avoid using SDK, but the configure
 # logic gets confused if it can't find the header files
 # so give it a direct path to them if they aren't installed
@@ -104,6 +113,9 @@
 .  endif
 .elif ${OPSYS} == "Linux"
 LDFLAGS+=			-ldl
+PLATFORM =			linux
+INCLUDE =			linux.conf
+DIRECTORY =			linux-*
 .elif ${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD"
 .  if exists(/usr/lib/libexecinfo.so)
 LDFLAGS+=			-lexecinfo
@@ -111,6 +123,26 @@
 LDFLAGS.FreeBSD+=		-lutil
 .endif
 
+# Set qmake.conf substitutions for *BSD (not covered above)
+.if ${OPSYS} == "NetBSD"
+PLATFORM =			netbsd
+INCLUDE =			bsd/bsd.conf
+DIRECTORY =			netbsd-g++
+.elif ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
+PLATFORM =			freebsd
+INCLUDE =			bsd/bsd.conf
+DIRECTORY =			freebsd-*
+.elif ${OPSYS} == "OpenBSD"
+PLATFORM =			openbsd
+INCLUDE =			bsd/bsd.conf
+DIRECTORY =			openbsd-g++
+.endif
+
+# Fallbacks for unsupported cases
+PLATFORM ?=			unix
+INCLUDE ?=			unix.conf
+DIRECTORY ?=			${PLATFORM}*
+
 REPLACE_PERL+=		bin/fixqt4headers.pl
 REPLACE_PERL+=		bin/syncqt.pl
 REPLACE_PERL+=		mkspecs/features/data/unix/findclasslist.pl
@@ -161,20 +193,6 @@
 			Qt5PrintSupport.pc Qt5Sql.pc Qt5Test.pc \
 			Qt5Widgets.pc Qt5Xml.pc
 
-.if ${OPSYS} == "Linux"
-QMAKE_EXTRA=		QMAKE_PLATFORM += linux
-.elif ${OPSYS} == "NetBSD"
-QMAKE_EXTRA=		QMAKE_PLATFORM += netbsd
-.elif ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
-QMAKE_EXTRA=		QMAKE_PLATFORM += freebsd
-.elif ${OPSYS} == "OpenBSD"
-QMAKE_EXTRA=		QMAKE_PLATFORM += openbsd
-.elif ${OPSYS} == "SunOS"
-QMAKE_EXTRA=		QMAKE_PLATFORM += solaris
-.else
-QMAKE_EXTRA=
-.endif
-
 COMPILER=	gcc
 .if !empty(PKGSRC_COMPILER:Mclang)
 COMPILER+=	clang llvm
@@ -200,12 +218,13 @@
 		-e 's:@PTHREAD_LIBS@:${PTHREAD_LIBS:Q}:g' \
 		-e 's:@COMPILER_RPATH_FLAG@:${COMPILER_RPATH_FLAG}:g' \
 		-e 's:@QMAKE_RANLIB@:${RANLIB}:g' \
-		-e 's:@QMAKE_EXTRA@:${QMAKE_EXTRA:Q}:g' \
+		-e 's:@PLATFORM@:${PLATFORM:Q}:g' \
+		-e 's:@INCLUDE@:${INCLUDE}:Q}:g' \
 		${FILESDIR}/${QMAKE_CONF} > ${WRKSRC}/qmake.conf
-	for dir in ${WRKSRC}/mkspecs/*; do \
+	for dir in ${WRKSRC}/mkspecs/${DIRECTORY}; do \
 			cp ${WRKSRC}/qmake.conf $${dir}; \
-			rm -f $${dir}/*.orig; \
 		done
+	rm -f ${WRKSRC}/mkspecs/*/*.orig
 	${RM} -f ${WRKSRC}/mkspecs/features/mac/default_pre.prf
 	${RM} -f ${WRKSRC}/mkspecs/features/mac/default_post.prf
 
So I still don't like this wholesale replacing of the upstream
configurations. Anyone has a better idea?

And what is Interix doing in there? I thought we didn't support that
(any more). Qmake doesn't, anyway.

-Olaf.
-- 
___ Q: "What's an anagram of Banach-Tarski?"  -- Olaf "Rhialto" Seibert
\X/ A: "Banach-Tarski Banach-Tarski."         -- rhialto at falu dot nl

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index