pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Redirecting CPP?



Hi,

I'm working on the lang/rust/ package, and I'm part of the time using
it to cross-build rust.  I admit that I'm doing "unspeakable" things
with the package when cross-building, e.g. not really using the
wrappers, buildlink or any of that stuff, but instead using a wrapper
script for the cross-compiler(s), linker, etc.

One error has come up when trying to build for a target which needs to
use clang which I've not been able to figure out, and I think I'm
struggling with a pkgsrc feature, and I'm asking for guidance.

One of the configure scripts of one of the built-in packages bombs out
with this (from config.log):

  configure:4422: checking how to run the C preprocessor
  configure:4492: result: cpp
  configure:4512: cpp -O2 -ffunction-sections -fdata-sections -fPIC -O2 -D_FORTIFY_SOURCE=2 -I/usr/pkg/include -I/usr/include --target=aarch64-unknown-netbsd conftest.c
  cpp: error: unrecognized command line option '--target=aarch64-unknown-netbsd'

The reason it tries to just use "cpp" appears to be because CPP is
passed in in the environment (I have debug output demonstrating that
this one does get CPP through the environment), most probably by the
pkgsrc infrastructure.

I have a suitable wrapper script which takes care of detecting if
you're pre-processing for the target, and then redirecting includes
into the root of the target, plus use the clang cpp instead of the
system's own gcc-based cpp.  However, the trivial attempt at forcing
this did not result in success.  I tried

CPP=${SCRIPTS}/clang-cpp-wrap

but that appears to be overridden by pkgsrc.

Is there a way for me to pass in this CPP settinge?  If not, could
that be made possible?

Best regards,

- Håvard


Home | Main Index | Thread Index | Old Index