You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by MK <mk...@cognitivedissonance.ca> on 2011/03/14 00:44:24 UTC

apxs "DEFS"

I hope it is okay to be asking questions about apxs here.

In the makefile created by apxs, there is the following:

#   additional defines, includes and libraries
#DEFS=-Dmy_define=my_value

AFAICT, uncommenting this and using "DEFS" to add a define does not do
anything -- it does not even appear in the call to libtool, etc. Has
anyone else noticed this?

So I have been using the command line instead:

apxs -D myvar=myvalue

which does work.  However, I need to keep the shell away from certain
characters (such as '/') in the value by single quoting the assignment,
which with gcc would look like this:

gcc -D'myvar="/some/path"'

However, it can't be done with apxs :(

Anyone know of a work around?


-- 
"Enthusiasm is not the enemy of the intellect." (said of Irving Howe)
"The angel of history[...]is turned toward the past." (Walter Benjamin)


Re: apxs "DEFS"

Posted by MK <mk...@cognitivedissonance.ca>.
On Mon, 14 Mar 2011 08:14:19 +0000
Nick Kew <ni...@apache.org> wrote:
> > However, it can't be done with apxs :(
> 
> It hadn't crossed my mind to try that with apxs (adjust by hand where
> necessary).  But in principle, Good Idea!  Patches welcome!
> 
> Sorry, no new suggestions 

The "problem" turns out to sort of obvious -- it's because this string
gets passed thru the shell *twice* (once to apxs and then from apxs to
gcc).  So what works is:

apxs -c -D mydef=\\\\"$SOME_ENV_VAR\\\\"

Which leaves a set of escaped double quotes after the first pass for
the second pass...

-- 
"Enthusiasm is not the enemy of the intellect." (said of Irving Howe)
"The angel of history[...]is turned toward the past." (Walter Benjamin)


Re: apxs "DEFS"

Posted by Nick Kew <ni...@apache.org>.
On 13 Mar 2011, at 23:44, MK wrote:

> I hope it is okay to be asking questions about apxs here.

You're welcome to post here, but if you suspect a bug or would like to
suggest an enhancement then dev@httpd would be the right place.

> However, it can't be done with apxs :(

It hadn't crossed my mind to try that with apxs (adjust by hand where
necessary).  But in principle, Good Idea!  Patches welcome!

Sorry, no new suggestions beyond wrowe's reply or "do it by hand".

-- 
Nick Kew

Available for work, contract or permanent
http://www.webthing.com/~nick/cv.html


Re: apxs "DEFS"

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 3/13/2011 6:44 PM, MK wrote:
> I hope it is okay to be asking questions about apxs here.
> 
> In the makefile created by apxs, there is the following:
> 
> #   additional defines, includes and libraries
> #DEFS=-Dmy_define=my_value
> 
> AFAICT, uncommenting this and using "DEFS" to add a define does not do
> anything -- it does not even appear in the call to libtool, etc. Has
> anyone else noticed this?
> 
> So I have been using the command line instead:
> 
> apxs -D myvar=myvalue
> 
> which does work.  However, I need to keep the shell away from certain
> characters (such as '/') in the value by single quoting the assignment,
> which with gcc would look like this:
> 
> gcc -D'myvar="/some/path"'
> 
> However, it can't be done with apxs :(

gcc '-Dmyvar="/some/path"'

> Anyone know of a work around?
> 
>