[MacPorts] #61588: p5.28-wx: error: unknown type name 'class'

MacPorts noreply at macports.org
Wed Mar 30 06:39:25 UTC 2022


#61588: p5.28-wx: error: unknown type name 'class'
-----------------------------+----------------------
  Reporter:  NozomuIshiguro  |      Owner:  mojca
      Type:  defect          |     Status:  assigned
  Priority:  Normal          |  Milestone:
 Component:  ports           |    Version:  2.6.4
Resolution:                  |   Keywords:
      Port:  p5-wx           |
-----------------------------+----------------------
Changes (by ryandesign):

 * cc: jmroot (added)


Comment:

 p5-wx uses MakeMaker, and I'm unclear whether MakeMaker supports using C++
 at all. As far as I can tell, it does not.
 This [https://web.archive.org/web/20121105103613/http://www.johnkeiser.com
 /perl-xs-c++.html writeup from 2001 about how to shoehorn C++ support into
 MakeMaker] says to do what p5-wx is already doing, setting `CC` to be the
 C++ compiler. MakeMaker doesn't seem to have a `CXX` sertting. (When I
 tried to patch Any_wx_config.pm to set it, I got `'CXX' is not a known
 MakeMaker parameter name.`) Then there's this
 [https://perl5-porters.perl.narkive.com/fC7b4Lsk/patch-makemaker-xs-and-c
 discussion and patch from 2003 adding more official C++ support to
 MakeMaker] but it appears to have been rejected. I also found this
 [https://www.perlmonks.org/?node_id=853194 writeup from 2010 about the
 insanity of getting MakeMaker to support C++]. Some of these talk about
 adding `-C++` to `XSOPT` which p5-wx does not do but that's fine since
 `man xsubpp` says `-C++` doesn't do anything at all.

 Where I think that leaves us, not just for fixing this problem but the
 same problem in any other C++ perl modules, is that we do in fact have to
 make the perl5 portgroup aware of this situation and handle it properly.
 We cannot just replace `CC` with the C compiler like we are currently
 doing. A solution that occurs to me is that it would decide based on
 whether the existing value of `CC` contains `++` whether to set it to the
 C compiler or the C++ compiler. Or, since Josh said in
 [7080039472288d673d7b7cbd261095768bdc458f/macports-ports] that the problem
 was that MakeMaker was setting `CC` in the main Makefile but not in
 Makefiles in subdirectories, a solution could be to capture the correct
 `CC` value from the main Makefile and insert it into the sub-Makefiles.

 However, p5-wx has many sub-Makefiles and MakeMaker appears to be
 inserting `CC` properly into all of them. The commit message said
 p5-encode was affected; I am unable to reproduce a problem with p5-encode
 either. (I tested on macOS 10.15.7 by reverting Josh's change to the perl5
 portgroup and then configuring using a non-default compiler (e.g. `sudo
 port configure p5.28-encode configure.compiler=macports-clang-9.0`) and
 then checking the work directory for all compiler paths (`grep bin/clang
 -r $(port work p5.28-encode)`). All compiler references are indeed to
 MacPorts clang 9.0 as they should be. There are no references to
 /usr/bin/clang which had built perl5.28.

 So Josh... Do you remember any more about the problem you were fixing with
 that commit? Can you still reproduce the problem if you revert your
 commit? If not can we revert your commit to resolve this ticket?

-- 
Ticket URL: <https://trac.macports.org/ticket/61588#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list