[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Conditional include directories
From: |
Reinier Post |
Subject: |
Re: Conditional include directories |
Date: |
Tue, 4 Aug 2015 13:49:06 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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