Skip to content
Permalink
Browse files

qt4-mac: allow newer compilers on older systems

  • Loading branch information
MarcusCalhoun-Lopez authored and kencu committed Nov 9, 2019
1 parent a98f36b commit 532963a6177616e80b43856db1390107636fff7f
@@ -355,6 +355,24 @@ patchfiles-append patch-src_gui_text_qfontengine_coretext.mm.diff
# see https://trac.macports.org/ticket/58205
patchfiles-append patch-qt4-openssl111.diff

# newer versions of MacPorts Clang default to newer C++ standards
# see https://trac.macports.org/ticket/57751
if {![variant_isset cxx11]} {
patchfiles-append patch-compiler_standard.diff
}

# the configure script uses the compiler version to determine if QtXmlPatterns and QtWebKit can be built
# the logic does not work for newer versions of GCC or Clang (masquerading as GCC)
patchfiles-append patch-test_compiler_version.diff

# the version header file is part of C++20
# newer versions of Clang find VERSION instead
post-extract {
move \
${worksrcpath}/src/3rdparty/javascriptcore/VERSION \
${worksrcpath}/src/3rdparty/javascriptcore/VERSION.txt
}

# error out if trying to build on a new OSX version (> 10.15).

platform darwin {
@@ -529,7 +547,7 @@ post-patch {

compiler.blacklist-append { clang <= 503 } \
gcc-3.3 *gcc-4.0 macports-gcc* \
{macports-clang-[6-9].0}
{macports-clang-[6-8].0}

# --prefix is not recognized

@@ -627,6 +645,12 @@ foreach driver {mysql odbc psql sqlite sqlite2} {
configure.args-append -no-sql-${driver}
}

# on older systems, /usr/include/rpcsvc/yp_prot.h redefines bool unless BOOL_DEFINED is defined
if {${os.major} < 11} {
configure.args-append {-D BOOL_DEFINED}
patchfiles-append patch-nis.diff
}

pre-configure {

# use the corrected CPATH and LIBRARY_PATH for build
@@ -0,0 +1,16 @@
--- configure.orig 2019-11-03 08:14:10.000000000 -0700
+++ configure 2019-11-03 08:21:30.000000000 -0700
@@ -8030,6 +8030,13 @@
QMAKE_CONFIG="$QMAKE_CONFIG exceptions_off"
fi

+if [ "$PLATFORM_MAC" = "yes" ]; then
+ QMakeVar add QMAKE_CFLAGS "-std=c99"
+ QMakeVar add QMAKE_CXXFLAGS "-std=c++98"
+ QMakeVar add QMAKE_OBJECTIVE_CFLAGS "-std=c99"
+ QMakeVar add QMAKE_OBJECTIVE_CXXFLAGS "-std=c++98"
+fi
+
# On Mac, set the minimum deployment target for the different architechtures
# using the Xarch compiler option when supported (10.5 and up). On 10.4 the
# deployment version is set to 10.4 globally using the QMAKE_MACOSX_DEPLOYMENT_TARGET
@@ -0,0 +1,10 @@
--- config.tests/unix/nis/nis.cpp.orig 2015-05-07 07:14:42.000000000 -0700
+++ config.tests/unix/nis/nis.cpp 2019-11-04 10:14:47.000000000 -0700
@@ -41,6 +41,7 @@

#include <sys/types.h>
#include <rpc/rpc.h>
+#define BOOL_DEFINED
#include <rpcsvc/ypclnt.h>
#include <rpcsvc/yp_prot.h>

@@ -0,0 +1,11 @@
--- configure.orig 2019-11-04 10:17:41.000000000 -0700
+++ configure 2019-11-04 11:13:15.000000000 -0700
@@ -7795,8 +7795,6 @@
canBuildWebKit="no"
;;
*)
- canBuildWebKit="no"
- canBuildQtXmlPatterns="no"
;;
esac
;;

0 comments on commit 532963a

Please sign in to comment.
You can’t perform that action at this time.