[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Conditional include directories
From: |
Rakesh Sharma |
Subject: |
RE: Conditional include directories |
Date: |
Tue, 4 Aug 2015 05:24:46 -0700 |
Actually, it is getconf which is used for maximum portability.
The POSIX manual has more on that. It's a little-known but
quite a useful tool in the shell toolbox.
--Rakesh
----------------------------------------
> Date: Tue, 4 Aug 2015 13:49:06 +0200
> From: address@hidden
> To: address@hidden
> Subject: Re: Conditional include directories
>
> On Tue Aug 4 04:03:32 2015, address@hidden (Rakesh Sharma) wrote:
>> One way can be as follows:
>>
>> ## pre-define your library directories based on the output of the "getconf"
>> output format
>> LIB_32 := /stage2/lib/dbus-1.0/include
>> LIB_64 := /stage2/lib64/dbus-1.0/include
>>
>> # then compute the architecture of the machine running gmake
>> CFLAGS := -I$(LIB_$(strip $(shell getconf LONG_BIT)))
>>
>> ### now you are all set for using the CFLAGS in your build code.
>> ## you may want to incorporate some amount of error checking
>> # when the `getconf' command delivers output different than either 32 or 64.
>>
>> # another method could be to invoke the "uname -m" command.
>
> How portable is this software supposed to be?
>
> uname exists on all the Unixy systems I've used;
> I'm not sure about getconf, but I notice it exists on Cygwin.
>
> --
> Reinier Post
> TU Eindhoven
>
> _______________________________________________
> Help-make mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-make