Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Specifying multiple configure_opts in build-hooks file: (3 Items)
   
Specifying multiple configure_opts in build-hooks file  
I've run across this problem repeatably in the build-hooks file where I'm assigning various options to the 
configure_opts variable. This is more of a shell question but the solution has eluded me.

This works fine:

function hook_preconfigure {
  configure_opts="${configure_opts} CPPFLAGS=-I/hdrs1"
}

The problem I have is that I'd like to add additional include paths to the CPPFLAGS variable, e.g.

function hook_preconfigure {
  configure_opts="${configure_opts} CPPFLAGS=-I/hdrs1 -I/hdrs2"
}

The CPPFLAGS needs to be passed to "configure" with it's arguments quoted. I've tried escaping them . . .

function hook_preconfigure {
  configure_opts="${configure_opts} CPPFLAGS=\"-I/hdrs1 -I/hdrs2\""
}

This does NOT work. It seems like my escaped quotes are stripped prior to passing it to configure. Is there some way to 
set one of these environment variables (like CFLAGS, CPPFLAGS, etc...) that are passed to configure to contain arguments
 with spaces (and quoted so configure does not try to interpret them)? I'm sure there is an arcane escape sequence I am 
missing. Without some work-around, it seems like you can only assign values to flags that do not contain any spaces.

Re: Specifying multiple configure_opts in build-hooks file  
Glenn Schmottlach wrote:
> I've run across this problem repeatably in the build-hooks file where I'm assigning various options to the 
configure_opts variable. This is more of a shell question but the solution has eluded me.
> 
> This works fine:
> 
> function hook_preconfigure {
>   configure_opts="${configure_opts} CPPFLAGS=-I/hdrs1"
> }
> 
> The problem I have is that I'd like to add additional include paths to the CPPFLAGS variable, e.g.
> 
> function hook_preconfigure {
>   configure_opts="${configure_opts} CPPFLAGS=-I/hdrs1 -I/hdrs2"
> }
> 
> The CPPFLAGS needs to be passed to "configure" with it's arguments quoted. I've tried escaping them . . .
> 
> function hook_preconfigure {
>   configure_opts="${configure_opts} CPPFLAGS=\"-I/hdrs1 -I/hdrs2\""
> }
> 
> This does NOT work. It seems like my escaped quotes are stripped prior to passing it to configure. Is there some way 
to set one of these environment variables (like CFLAGS, CPPFLAGS, etc...) that are passed to configure to contain 
arguments with spaces (and quoted so configure does not try to interpret them)? I'm sure there is an arcane escape 
sequence I am missing. Without some work-around, it seems like you can only assign values to flags that do not contain 
any spaces.


You can try something like this:
CPPFLAGS="-I/hdrs1 -I/hdrs2"; export CPPFLAGS

in your function hook_preconfigure.

So it would look something like:

function hook_preconfigure {
  CPPFLAGS="-I/hdrs1 -I/hdrs2"; export CPPFLAGS
}
Re: Specifying multiple configure_opts in build-hooks file  
Thanks . . . should've thought of that. This approach seems to do the trick for me.

Glenn