Re: Test for rpm variable

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

 



> How can I test if %{__global_cflags} is defined?
>
> I want something in my spec along these lines.
>
> CFLAGS=''"
> CFLAGS = "%{__global_cflags}" if(defined %{__global_cflags})
> CFLAGS = "$CFLAGS my custom arguments here"

I haven't actually tried either of these, so they may not be 100%
functional, but might point you the right direction.

Populating %{cflags} macro:

%{?__global_cflags: %define cflags %{__global_cflags} my custom arguments
here}

And here is a method of doing what you were showing above

%if 0%{?__global_cflags} != 0
 CFLAGS = "%{__global_cflags} my custom arguments here"
%endif

Or even more simply:

CFLAGS = "%{?__global_cflags} my custom arguments here"

which works because it doesn't put anything if %{__global_cflags} is not
defined.

Someone else might be able to give you a better method, but I don't deal
with much in the realms of compiled RPMs, I'm mainly python or repackaging
closed source binaries.

-greg

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux