This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [Fwd: passing option to makefile via RPM-Spec]
On Sun, 14 February 1999, 23:27:11, espie@quatramaran.ens.fr wrote:
> In article <14023.609.290357.409579@saturn.hollstein.net> you write:
> > > cd %{OBJDIR}
> > > CFLAGS="-O2 -g -fno-vtable-thunks" <--- this I entered!!!
>
> >You forgot to "export" the CFLAGS variable: add
>
> >export CFLAGS
>
> > > $RPM_BUILD_DIR/egcs-$RPM_PACKAGE_VERSION/configure -v --prefix=/usr \
> > > --enable-shared --enable-threads \
> > > $RPM_ARCH-redhat-linux
>
> To clarify, there are two /bin/sh constructions. Either
> VAR1=value1 VAR2=value2 command
> which is ONE command which will execute with the right values for the
> variables, or, when you want stuff to stick around, you must use
> separate statements with export, as in
> VAR1=value1; VAR2=value2; export VAR1 VAR2; command
>
> One can easily mistake one form for the other and forget some export
> later on if one gets confused about what's going on. :)
Yep, you're right; to make your first form portable (some lame shells
don't like it - ksh, csh, ...) one should prefix it with the "env"
command as in:
$ env VAR1=value1 VAR2=value2 command
manfred