Bug 224137 - devel/qt5-qmake: Doesn't use the right compiler in case USE_GCC is selected
Summary: devel/qt5-qmake: Doesn't use the right compiler in case USE_GCC is selected
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: kde
: 228341 (view as bug list)
Depends on:
Reported: 2017-12-06 01:20 UTC by Yuri Victorovich
Modified: 2020-01-19 07:51 UTC (History)
3 users (show)

See Also:
tcberner: maintainer-feedback+


Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2017-12-06 01:20:14 UTC
The port multimedia/webcamoid fails to build if USE_GCC=6.0+ is added to the Makefile. Despite QMAKE_CXX set to g++6, it still uses g++ to run tests, and fills g++ into Makefiles.

My guess is that qmake leaks the "g++" compiler from some config files that are installed with it, and it disrespects QMAKE_CXX.

You can see configure failures in libAvKys/config.log in that port.
Comment 1 Tobias C. Berner freebsd_committer 2017-12-16 09:34:16 UTC
Can you provide the log of such a build?

mfg Tobias
Comment 2 Yuri Victorovich freebsd_committer 2017-12-16 10:19:39 UTC
(In reply to Tobias C. Berner from comment #1)

Without the g++ command tests for external libraries fail:
> Checking for ffmpeg... no
> Checking for gstreamer... no
> Checking for jack... no

when it should be:
> Checking for ffmpeg... yes
> Checking for ffmpeg_avcodec_contextframerate... yes
> Checking for ffmpeg_avcodec_extracodecformats... yes
> Checking for ffmpeg_avcodec_freecontext... yes
> Checking for ffmpeg_avcodec_packetref... yes
> Checking for ffmpeg_avcodec_rescalets... yes
> Checking for ffmpeg_avcodec_sendrecv... yes
> Checking for ffmpeg_avcodec_subtitledata... yes
> Checking for ffmpeg_avformat_allocoutputcontext... yes
> Checking for ffmpeg_avformat_codecpar... yes
> Checking for ffmpeg_avutil_extraoptions... yes
> Checking for ffmpeg_avutil_extrapixformats... yes
> Checking for ffmpeg_avutil_framealloc... yes
> Checking for ffmpeg_avutil_sampleformat64... yes
> Checking for ffmpeg_avresample... yes
> Checking for ffmpeg_swresample... yes

As a result, some shared libs aren't built.
The external libs are tested with macros like this: qtCompileTest(ffmpeg_avcodec_contextframerate)

I guess, this qmake macro calls the g++ command instead of ${CXX}.
Comment 3 Adriaan de Groot freebsd_committer 2018-04-18 07:01:46 UTC
This is basically the same as PR 204923. Because of the way qmake's mkspecs work, the compiler from the mkspec is used, rather than ${CC} or ${CXX}.
Comment 4 Tobias C. Berner freebsd_committer 2018-10-20 19:42:17 UTC
*** Bug 228341 has been marked as a duplicate of this bug. ***
Comment 5 Tobias C. Berner freebsd_committer 2018-10-20 21:33:08 UTC
There is some progress on fixing this now. At least on GCC based architectures, the freebsd-gcc mkspec now contains gcc${GCC_DEFAULT}.

This will not yet solve your problem unfortunately. However, could you try using 

BINARY_ALIAS=gcc=${CC} g++=${CXX}

mfg Tobias
Comment 6 Tobias C. Berner freebsd_committer 2020-01-19 07:51:41 UTC
Please reopen if this is still an issue.