Opened 5 years ago

Closed 4 years ago

#47882 closed defect (fixed)

pyxplot @0.9.2_2 is not UsingTheRightCompiler

Reported by: ryandesign (Ryan Schmidt) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version: 2.3.99
Keywords: haspatch Cc:
Port: pyxplot

Description

pyxplot is not UsingTheRightCompiler -- the configure script isn't, at least. It is hardcoded to run gcc.

Attachments (2)

patch-configure.diff (3.9 KB) - added by Schamschula (Marius Schamschula) 5 years ago.
Portfile-pyxplot.diff (1.0 KB) - added by Schamschula (Marius Schamschula) 5 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 5 years ago by Schamschula (Marius Schamschula)

It checks for gcc, and will accept nothing else…

I've written a patch to check for clang if gcc is not found.

The compiler defaults to CC, which by default is /usr/bin/cc -> clang

comment:2 Changed 5 years ago by larryv (Lawrence Velázquez)

So now the configure script checks for gcc and then clang? That will produce false positives if someone has an actual GCC installed that comes before /usr/bin in $PATH.

Can you not patch the configure script to actually look at the value of $CC?

comment:3 Changed 5 years ago by Schamschula (Marius Schamschula)

Good point, Larry.

I've simplified the configure script to just check for cc.

comment:4 Changed 5 years ago by Schamschula (Marius Schamschula)

Use "echo $CC" rather than "which cc"

comment:5 Changed 5 years ago by ryandesign (Ryan Schmidt)

What I actually meant was all of the subsequent times that the configure script explicitly invokes gcc, for example:

if printf '#include <stdio.h>\n#include <readline/readline.h>\nint main() { return 0; }\n' | gcc -x c - -o conf.out > conf.stdout 2> conf.stderr

It should just use $CC.

comment:6 Changed 5 years ago by Schamschula (Marius Schamschula)

Ah.

I was only looking for the part where the script is looking for the compiler itself.

The updated patch makes the balance of the substitutions.

Changed 5 years ago by Schamschula (Marius Schamschula)

Attachment: patch-configure.diff added

comment:7 Changed 5 years ago by ryandesign (Ryan Schmidt)

The build still doesn't use the right compiler. The Makefile uses $(CC), but the value of CC that was set at configure time isn't remembered anywhere by the build system. Could fix by having the configure script write the value of CC to a file that's included in the Makefile, or by passing the value of CC again as an environment variable in the build phase.

Changed 5 years ago by Schamschula (Marius Schamschula)

Attachment: Portfile-pyxplot.diff added

comment:8 Changed 5 years ago by Schamschula (Marius Schamschula)

Use build.env to use same CC for build as configure.

Also noticed that there was a rev bump due to the recent ghostscript update.

comment:9 Changed 4 years ago by ryandesign (Ryan Schmidt)

Keywords: haspatch added
Resolution: fixed
Status: newclosed

Committed in r140051 with a small change: instead of merely checking whether the CC environment variable is non-empty, it verifies that running it actually works. It also defaults CC to "gcc".

Note: See TracTickets for help on using tickets.