[Freeciv-Dev] [bug #24942] Configure fails with clang 3.8 and Qt 5.7

2016-08-10 Thread Marko Lindqvist
Follow-up Comment #11, bug #24942 (project freeciv):

> one would need Debian Wheezy or Ubuntu 12.04 to compile Freeciv without
C++11 support.

User can still override the std version in CXXFLAGS. I'm more concerned about
those users who see their standard version going to older one because of this.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24942] Configure fails with clang 3.8 and Qt 5.7

2016-08-10 Thread Louis Moureaux
Follow-up Comment #10, bug #24942 (project freeciv):

(In the code below, #0x050700 should read 0x050700. Habit from CSS: every hex
number begins with #... Sorry)

___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24942] Configure fails with clang 3.8 and Qt 5.7

2016-08-10 Thread Louis Moureaux
Follow-up Comment #9, bug #24942 (project freeciv):

> For the C++11 problem, would something as simple as attached patch work?
Such a patch would work. On the other hand, one would need Debian Wheezy or
Ubuntu 12.04 to compile Freeciv without C++11 support. This would make it more
difficult to check the Freeciv codebase being C++11-free.

I've been thinking of something along these lines:
++
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include 
#if QT_VERSION >= #0x050700
#error ""
#endif]], [[]], [ (enable C++11) ])
--
It's much simpler, but relies on  not depending on C++11 (which
is the case but not guaranteed).


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24942] Configure fails with clang 3.8 and Qt 5.7

2016-08-10 Thread Marko Lindqvist
Follow-up Comment #8, bug #24942 (project freeciv):

For the C++11 problem, would something as simple as attached patch work? That
would be something I would be ready accept even to S2_5. Preferring pkg-config
is probably a good idea (we've headed towards it in general, and we probably
have many bugs hidden in our Qt m4 mess that it would avoid) in trunk, maybe
S2_6.

(file #28251)
___

Additional Item Attachment:

File name: C++11Qt5.patch Size:0 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24942] Configure fails with clang 3.8 and Qt 5.7

2016-08-10 Thread Louis Moureaux
Follow-up Comment #7, bug #24942 (project freeciv):

I checked Kde Neon Developer Edition, which ships Qt 5.7 on a Ubuntu
14.04-based system. The default compiler there is GCC 5.4, which defaults to
C++98. With my patch, freeciv configures fine but build fails (in Qt) as if
std::nullptr_t == int. It works fine if I set CXXFLAGS=--std=c++11, I'll need
to investigate further.

*pkg-config*

Ubuntu's packages of Qt 4.8 has .pc files
(http://packages.ubuntu.com/precise/amd64/libqt4-dev/filelist), so I'm
confident about it being distributed on Linux.

Reading
http://code.qt.io/cgit/qt/qtbase.git/tree/mkspecs/features/qt_module.prf?h=old/5.0,
it looks like the .pc files are built for "unix" and "win32-g++" systems
(which means Linux, *BSD and Windows if Qt was compiled with g++). I don't
know the precise requirement for building on Windows.

> pkg-config for Qt should set --std=c++11 if it needs it, so it's bug there
if we need to set it separately
Qt doesn't know the compiler we use, so it can't guess the required flag. This
is where limitations of autotools and pkg-config show up, and other tools such
as cmake shine. But let's not start a flame war...

> We have macros to set flags only when used compiler supports them.
I saw libtool sets variables for C++11 and PIC, but they're not part of the
public API (as far as I can tell). As PIC didn't use a macro beforehand, there
is no regression.

*Potential problems*

- Qt >= 5.7 will be picked even if Qt < 5.7 is found earlier in pkgconfig's
path.
- QtWidgets < 5.7 and eg QtCore >= 5.7 installed. C++11 won't be used, even
though QtCore requires it. idk if Qt supports such a setup, however.
- If Qt >= 5.7 is found but the compiler doesn't support C++11, the error
message still won't be very useful.


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24942] Configure fails with clang 3.8 and Qt 5.7

2016-08-10 Thread Marko Lindqvist
Follow-up Comment #6, bug #24942 (project freeciv):

> A pc file is provided by Qt itself

It didn't back then when we added .m4 files. It's possible that all Qt5
versions have provided them, though. Anyway, compatibility issues with oldest
supported (by us) versions need to be checked.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24942] Configure fails with clang 3.8 and Qt 5.7

2016-08-10 Thread Louis Moureaux
Follow-up Comment #5, bug #24942 (project freeciv):

Devil is in the details. Really works now...

(file #28240)
___

Additional Item Attachment:

File name: qt-use-pkg-config-2.patch.bz2  Size:1 KB


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24942] Configure fails with clang 3.8 and Qt 5.7

2016-08-10 Thread Marko Lindqvist
Follow-up Comment #4, bug #24942 (project freeciv):

Didn't check the patch yet, but couple of general notes before I forget:
1) pkg-config for Qt should set --std=c++11 if it needs it, so it's bug there
if we need to set it separately
2) We have macros to set flags only when used compiler supports them.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24942] Configure fails with clang 3.8 and Qt 5.7

2016-08-10 Thread Louis Moureaux
Follow-up Comment #3, bug #24942 (project freeciv):

Attached patch uses pkg-config to discover Qt and sets --std=c++11 if needed.
Besides MSVC, I don't know of compilers using other flags. I didn't use
--std=c++0x because it enabled *experimental* C++11 support and is deprecated
in recent GCC.

The moc discovery is left unchanged (there is no pkg-config for it).

For now, only tested with TRUNK on Arch Linux.


(file #28239)
___

Additional Item Attachment:

File name: qt-use-pkg-config.patch.bz2Size:1 KB


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24942] Configure fails with clang 3.8 and Qt 5.7

2016-08-08 Thread Louis Moureaux
Follow-up Comment #2, bug #24942 (project freeciv):

Would Freeciv need such "system consistency", it should check for it and
provide a helpful error message, just like for regular dependencies. So it's
not that easy to implement.

As Qt needs C++11 for all versions >= 5.7.0, the version alone is enough. A pc
file is provided by Qt itself (and distributed by at least Arch and Debian):
++
$ pkg-config --modversion Qt5Core
5.7.0
--
There's also a header  that defines a few macros with version
information, and some CMake files.

As far as I understand, qt5.m4 already checks for -fPIC (which I think is
required by some but not all Qt builds). The same test could be used for
--std=C++0x (or --std=C++11, but older compilers don't understand it).

___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24942] Configure fails with clang 3.8 and Qt 5.7

2016-08-08 Thread Marko Lindqvist
Follow-up Comment #1, bug #24942 (project freeciv):

> The root of the problem is that Qt >= 5.7 require C++11 support.

At the same time you should remember that freeciv does not require Qt >= 5.7,
and shouldn't require C++11 support for Qt 5.0.

Easy way around this would be to declare that people are supposed to keep
their systems consistent. If you have Qt 5.7, you should also have compiler
that defaults to C++11 mode.

There's not much we can do to help, as long as Qt does not indicate (via
pgk-config files or similar) when it requires C++11 compiler.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev