[MacPorts] #65534: nspr @4.34+universal arm64, x86_64 fails to build

MacPorts noreply at macports.org
Tue Jul 26 16:28:53 UTC 2022


#65534: nspr @4.34+universal arm64,x86_64 fails to build
-----------------------+--------------------
  Reporter:  potterpg  |      Owner:  (none)
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  nspr      |
-----------------------+--------------------

Comment (by kencu):

 at least part of the problem is in {{{config/rules.mk}}}

 when the build detects it is cross-compiling, it resets the key
 environment variables like this:

 {{{
 ifdef USE_AUTOCONF
 ifdef CROSS_COMPILE
 ifdef INTERNAL_TOOLS
 CC=$(HOST_CC)
 CCC=$(HOST_CXX)
 CFLAGS=$(HOST_CFLAGS)
 CXXFLAGS=$(HOST_CXXFLAGS)
 LDFLAGS=$(HOST_LDFLAGS)
 endif
 endif
 endif
 }}}

 but as none of those HOST* variables are defined, they all come up empty,
 it appears, and therefore no LDFLAGS are used in the link.

 doing something like this in the Portfile:
 {{{
 configure.env-append HOST_CC=${configure.cc} \
                      HOST_CXX=${configure.cxx} \
                      HOST_CFLAGS=${configure.cflags} \
                      HOST_CXXFLAGS=${configure.cxxflags} \
                      HOST_LDFLAGS=${configure.ldflags}


 }}}
 actually does result in a successful universal build of nspr arm64/x86_64,
 building on Intel at least.

 {{{
  % port -v installed nspr
 The following ports are currently installed:
   nspr @4.34_0+universal (active) requested_variants='+universal'
 platform='darwin 21' archs='arm64 x86_64' date='2022-07-26T09:27:54-0700'
 }}}

 But it's still not 100% right as {{{${configure.ldflags}}}} is not
 properly set up at this point in the Portfile and the environment variable
 is incomplete still.

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


More information about the macports-tickets mailing list