Opened 2 months ago

Closed 2 months ago

#69464 closed defect (fixed)

gmp @6.3.0_0 configure error : configure: error: No usable m4 in $PATH or /usr/5bin

Reported by: nanigashi-uji (Nanigashi Uji) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.9.1
Keywords: sonoma haspatch Cc:
Port: gmp

Description (last modified by nanigashi-uji (Nanigashi Uji))

Under the environment at Sonoma 14.4 and Xcode15.3, even Xcode command line is installed, m4 can not be detected during "configure".

Corresponding part of outout from 'port -v install gmp'

...
checking for sstream... yes
checking for std::locale... yes
checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin (see config.log for reasons).
Command failed:  cd "......../gmp/work/gmp-6.3.0" && ./configure --prefix=/....  --host=applem1-apple-darwin23 --enable-cxx 
Exit code: 1
...

I found that the issue can be averted by adding the following lines in Portfile.

if {${os.platform} eq "darwin" && ${os.major} > 13 && [string match *clang* ${configure.compiler}]} {
    configure.env-append    M4=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/gm4
}

Change History (5)

comment:1 Changed 2 months ago by nanigashi-uji (Nanigashi Uji)

Description: modified (diff)

comment:2 Changed 2 months ago by jmroot (Joshua Root)

Owner: set to MarcusCalhoun-Lopez
Port: gmp added
Status: newassigned

Please attach the config.log.

comment:3 Changed 2 months ago by ryandesign (Ryan Carsten Schmidt)

I'd be very curious to learn where the "5" in /usr/5bin is coming from. Might want to attach the main.log file too.

comment:4 Changed 2 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: sonoma haspatch added

Ok, gmp's configure script, and other files, do literally reference /usr/5bin. Apparently it's a System V thing. Not relevant to macOS.

We have discovered in other tickets (e.g. comment:ticket:69467:6) that Apple forgot (?) to include m4 in the Xcode 15.3 command line tools (although they did still include gm4), so that's probably what's to blame here.

Since gmp uses m4, it should use the newer MacPorts version of m4. Here's a PR to do that: https://github.com/macports/macports-ports/pull/22985

comment:5 Changed 2 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In c50b7da948a9553dc28e24e1b0753e0ebf89fd75/macports-ports (master):

gmp: Use MacPorts m4

Xcode 15.3 CLT doesn't include m4, possibly due to an oversight.

Closes: #69464

Note: See TracTickets for help on using tickets.