#241: Have Qmake honor CXX and adjust its parameters according to the compiler's
abilities
----------------------+-----------------------------------------------------
Reporter: levill_r | Owner: Olena Team
Type: defect | Status: new
Priority: major | Milestone:
Component: Olena | Version: 1.0
Keywords: |
----------------------+-----------------------------------------------------
Context: qmake is used by `configure` to set flags like `QT_CXXFLAGS`,
`QT_LDFLAGS`, etc. (thanks to `autotroll.m4`).
Qmake does not set compiler/linker flags based on tests on the tools
themselves; instead, it queries the environment and sets variables
according to some recipe (the « `spec` »).
This is annoying on Mac OS X, since the `spec` detected and used by Qmake
on this OS (`macx-g++`) adds Apple-specific flags to `QT_CXXFLAGS`,
`QT_LDFLAGS`, etc., namely « `-arch x86_64 -Xarch_x86_64` » on Intel64
hosts. This prevents Qt-dependent components from being built with a non
Apple compiler (e.g., `g++` 4.5 from the !MacPorts).
We cannot really solve this problem entirely because it implies patching
qmake. We can however write some workaround in `autotroll.m4` for known
cases (like this one).
In the current case, if non-standard flags `-arch` and/or `-Xarch` are
detected in the `Makefile` generated by qmake, we should try to run `make`
in the `conftest.dir` directory with CXX set to the value found ealier by
`configure`. If this fails, try again with `-arch` and/or `-Xarch`
removed from `QT_CXXFLAGS`, `QT_LDFLAGS`, etc.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/241>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
Show replies by date