[kde-freebsd] Qt 5 and GCC4.9.3

Schaich Alonso alonsoschaich at fastmail.fm
Thu May 21 21:31:23 UTC 2015


On Wed, 20 May 2015 08:03:40 +0000 (UTC)
Dirk Niebelus <dirkniebelus at yahoo.de> wrote:

> Hello,
> I'm using Freebsd 9 (current FreeNAS) and my goal is to compile the qt5 port with gcc493 and the std=c++11 switch enabled.The emphasis is here on the c++11 switch, i figure if c++11 works i can use c++14 as well.
> 
> Tried different things like modified the CXXFLAGS in make.conf. But it still uses c++98
> I'm searching for a rock solid way to this.
> 
> Thank you for the Qt Port!Dirk
> 


You can have qmake5-built ports use some custom c++ flags by
modifying the qmakespecs which are by default installed into
/usr/local/lib/qt5/mkspecs by the devel/qmake5 port. The name to
be set is called QMAKE_CXXFLAGS, and there's no specific place for it,
though you will likely have to put it somewhere referenced by
freebsd-g++.conf. To build devel/qmake5 itself using c++11/14 support,
adding

.if (!empty(.CURDIR:M*devel/qmake5*))
CXXFLAGS+=      -std=c++1y
.endif

to /etc/make.conf works over here - of cause, you can just extend
CXXFLAGS in make.conf for your qmake5 consumers instead of using the
makespecs, too.

AFAIK - unlike on Windows OS, or rather, Visual C++ - FreeBSD's c++98
binaries are ABI compatible to their c++11 built counterparts, and even
linked to the same STL implementation, so I don't think there's a point
of using c++11 compiler mode unless the code actually uses c++11.

If some consumer port specifies pedantic compilation mode, requesting
c++11 or 14 might even break the build.

Alonso
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 603 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-freebsd/attachments/20150521/97bae95a/attachment.sig>


More information about the kde-freebsd mailing list