[MacPorts] #60323: NanoVNA-QT: cc1plus: error: unrecognized command line option "-std=c++0x"

MacPorts noreply at macports.org
Sun Apr 5 10:56:56 UTC 2020


#60323: NanoVNA-QT: cc1plus: error: unrecognized command line option "-std=c++0x"
------------------------+------------------------
 Reporter:  ryandesign  |      Owner:  ra1nb0w
     Type:  defect      |     Status:  assigned
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:  2.6.2
 Keywords:              |       Port:  NanoVNA-QT
------------------------+------------------------
 [https://build.macports.org/builders/ports-10.6_x86_64-builder/builds/23880/steps
 /install-port/logs/stdio NanoVNA-QT does not build]:

 {{{
 cc1plus: error: unrecognized command line option "-std=c++0x"
 }}}

 This is because although the portfile specifies `compiler.cxx_standard
 2011` it is not UsingTheRightCompiler. It has this block that does the
 autotools part of the build manually:

 {{{
 post-configure {
     system -W ${worksrcpath} "CPATH=\"${prefix}/include\"
 LDFLAGS=\"-L${prefix}/lib\" CFLAGS=\"-I${prefix}/include\" ./configure
 --prefix=${prefix}"
     system -W ${worksrcpath} "CPATH=\"${prefix}/include\"
 LDFLAGS=\"-L${prefix}/lib\" CFLAGS=\"-I${prefix}/include\" make -f
 Makefile"
 }
 }}}

 This does not preserve all of the variables that MacPorts would set if it
 were running these commands normally. Specifically, note that `CC`, `CXX`,
 `CXXFLAGS` are not being set.

 It is unfortunate that this software apparently has a qmake part of the
 build and a separate autotools part of the build. MacPorts isn't really
 designed to accommodate running two different things in a phase, but it
 can be coerced into doing so... (for example, you can override the
 configure phase and in that block, invoke `portconfigure::configure_main`
 to run the normal configure phase, then modify configure env, args, etc.
 as desired, then invoke `portconfigure::configure_main` again.
 `portconfigure::build_main` is also available. These are internal MacPorts
 functions not intended to be used from Portfiles (indicated by the `::` in
 the name) and this usage may break in a future version of MacPorts. But I
 use it in the php 1.1 portgroup for example and there are a handful of
 ports that use it: astyle, nlohman-json, freeimage, reduce.) Or you might
 be able to get away with just modifying `configure.cmd` or `build.cmd` to
 do two things.

-- 
Ticket URL: <https://trac.macports.org/ticket/60323>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list