[MacPorts] #65561: Need help with Port - unalz

MacPorts noreply at macports.org
Sat Jul 30 14:28:51 UTC 2022


#65561: Need help with Port - unalz
---------------------+----------------------
  Reporter:  RobK88  |      Owner:  RobK88
      Type:  defect  |     Status:  assigned
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:  2.7.2
Resolution:          |   Keywords:
      Port:  unalz   |
---------------------+----------------------

Comment (by RobK88):

 Ryan -- As you pointed out, with the older compilers (such as Apple's
 clang), the binary will not properly link unless `-stdlib=libc++` is
 passed to each linking command.  If you do not do this, the build (or more
 precisely the linking) will fail with "missing symbols".

 I just discovered a simpler and more elegant way to ensure that the
 binaries are linked against `stdc++`.  Instead of patching the Makefile to
 either add `$(CXXFLAGS)` (or just `-stdlib=libc++`) to all the linking
 commands, it is just easier and more elegant to add this one line to the
 portfile:

 {{{
 configure.ldflags-append    "-stdlib=${configure.cxx_stdlib}"
 }}}

 I tested it and it works.  I will remember this for my next port.  I have
 already submitted the fixed port for `unalz`.  I guess I could change and
 submit an upgraded portfile but I would have to redo all the 7 patch
 files.  That would be too much work for little gain.

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


More information about the macports-tickets mailing list