configure script ignores CFLAGS and CXXFLAGS being passed #5195

Closed
rofl0r opened this Issue Apr 1, 2013 · 7 comments

Projects

None yet

4 participants

@rofl0r
rofl0r commented Apr 1, 2013
CXXFLAGS=-D_GNU_SOURCE ./configure

is the canonical way to pass custom C[XX]FLAGS to configure scripts

doesnt work with node, instead you have to mess around with the generated config files.

@bnoordhuis
Member

It's an artifact of gyp, the build system. You can't pass it CFLAGS/CXXFLAGS at Makefile generation time (it ignores them) and there's no reliable way to pass them through the .gyp or .gypi file.

Just pass your flags to make: make CFLAGS="..." CXXFLAGS="..."

@bnoordhuis bnoordhuis closed this Apr 2, 2013
@rofl0r
rofl0r commented Apr 2, 2013

well i think this could be easily added to the build system.
the flags i entered manually into cflags: in the gypi file are passed to both gcc and g++.

@bnoordhuis
Member

The key here is 'manually'. Now try to have them carry over from the configure file automatically (and override the pre-set flags). If you can get it to work without breaking other things, send a pull request.

@jbergstroem
Member

@bnoordhuis Out of interest, would it perhaps make sense to pass this to config.mk if users insist on a autoconf-like variable passing? I'm just as happy with FOO= make

@rofl0r
rofl0r commented Apr 2, 2013

the problem with FOO= make is that people are not used to it.
they know how autoconf behaves and expect the same from pseudo-configure scripts.
you dont want them all to come here and open a bug report either, i suppose ?

@isaacs
isaacs commented Apr 3, 2013

I'd be ok with a patch to support this kind of behavior, but it's not a high priority issue for us, and would probably have to be an upstream patch to gyp first.

@rofl0r
rofl0r commented Apr 3, 2013

unfortunately one needs a google account to report issues on the gyp issue tracker, and even to subscribe to their google groups. since that requires a mobile phone and general loss of privacy, i am unable to register.
could someone with a google account open an issue there and link this issue and #5197 to them ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment