[MacPorts] #53625: qscintilla: requires C++11, not using the right compiler
MacPorts
noreply at macports.org
Thu Feb 23 10:06:51 UTC 2017
#53625: qscintilla: requires C++11, not using the right compiler
-------------------------+-----------------------
Reporter: mojca | Owner: michaelld
Type: defect | Status: reopened
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: qscintilla |
-------------------------+-----------------------
Comment (by mojca):
I managed to compile the library after applying the following patch:
{{{
#!diff
diff --git a/_resources/port1.0/group/cxx11-1.1.tcl
b/_resources/port1.0/group/cxx11-1.1.tcl
index b72a9e74f5..88fb1cb15c 100644
--- a/_resources/port1.0/group/cxx11-1.1.tcl
+++ b/_resources/port1.0/group/cxx11-1.1.tcl
@@ -63,7 +63,7 @@ if {${cxx_stdlib} eq "libstdc++" } {
# for OS X Maverick and above, users must select libstdc++, so
# assume they want default ABI compatibility
# see
https://gcc.gnu.org/onlinedocs/gcc-5.2.0/libstdc++/manual/manual/using_dual_abi.html
- configure.cxxflags-append -D_GLIBCXX_USE_CXX11_ABI=0
+ configure.cxxflags-append -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0
}
} else {
# GCC compilers can not use libc++
diff --git a/_resources/port1.0/group/qmake-1.0.tcl
b/_resources/port1.0/group/qmake-1.0.tcl
index a1fb1028ca..387c991d1c 100644
--- a/_resources/port1.0/group/qmake-1.0.tcl
+++ b/_resources/port1.0/group/qmake-1.0.tcl
@@ -44,7 +44,12 @@ pre-configure {
"QMAKE_CXX=${configure.cxx}" \
"QMAKE_OBJC=${configure.objc}" \
"QMAKE_CFLAGS=\"${configure.cflags}
[get_canonical_archflags cc]\"" \
-
"QMAKE_CXXFLAGS=\"${configure.cxxflags} [get_canonical_archflags cxx]\""
+
"QMAKE_CXXFLAGS=\"${configure.cxxflags} [get_canonical_archflags cxx]\"" \
+ "QMAKE_LINK_C=${configure.cc}" \
+ "QMAKE_LINK_C_SHLIB=${configure.cc}"
\
+ "QMAKE_LINK=${configure.cxx}" \
+ "QMAKE_LINK_SHLIB=${configure.cxx}"
+
configure.universal_args-delete --disable-dependency-tracking
if {[variant_exists universal] && [variant_isset universal]} {
}}}
(Perhaps `-std=c++11` should be added for all ports that include the
`cxx11` PortGroup?)
I believe that `cxxflags` for the linker are still missing above since I
had to manually add `-D_GLIBCXX_USE_CXX11_ABI=0 -stdlib=macports-
libstdc++` when calling the linker for `libqscintilla2_qt4`, else the
linker would fail (I added both flags just in case, maybe just fixing the
stdlib would suffice). This wasn't necessary for the other library
`libqscintillaplugin`, but I guess that's just because it doesn't use
C++11?
The `qmake5` PortGroup uses some pretty "complex" code to decide which
linker flags to use and I wasn't sure which one to apply here, but
`QMAKE_LFLAGS` should be set in one way or another.
I also had to do the following in order to finish compilation:
* in `Qt4Qt5`:
{{{
sudo -u macports install_name_tool -id
/opt/local/libexec/qt4/lib/libqscintilla2_qt4.13.0.0.dylib
libqscintilla2_qt4.13.0.0.dylib
sudo -u macports ln -s libqscintilla2_qt4.13.0.0.dylib
libqscintilla2_qt4.dylib
}}}
* in `designer-Qt4Qt5`:
{{{
sudo -u macports install_name_tool -id
/opt/local/libexec/qt4/share/plugins/designer/libqscintillaplugin.dylib
libqscintillaplugin.dylib
}}}
Let me check whether Octave works after this trickery.
--
Ticket URL: <https://trac.macports.org/ticket/53625#comment:11>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list