From: "Pádraig Brady" <P@draigBrady.com>
To: greearb@candelatech.com
Cc: netdev@vger.kernel.org
Subject: Re: [RFC] iproute: Support cross-compiling.
Date: Wed, 16 Nov 2011 10:53:11 +0000 [thread overview]
Message-ID: <4EC39617.5010108@draigBrady.com> (raw)
In-Reply-To: <1321405482-18445-1-git-send-email-greearb@candelatech.com>
On 11/16/2011 01:04 AM, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> This lets users use their own compiler instead of
> hard-coding to use gcc.
>
> Also adds tests to disable some things that were not supported
> in my ARM cross-compile toolchain.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> :100644 100644 c6e4943... 3b00076... M Makefile
> :100755 100755 f5c3d40... 680fdcb... M configure
> :100644 100644 8d03993... 5c91e18... M ip/Makefile
> :100644 100644 e41a598... 773f7cb... M ip/ipnetns.c
> :100644 100644 8c25381... d04358d... M misc/Makefile
> Makefile | 2 +-
> configure | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
> ip/Makefile | 8 +++++
> ip/ipnetns.c | 17 +++++++++++
> misc/Makefile | 5 +++
> 5 files changed, 114 insertions(+), 6 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index c6e4943..3b00076 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -27,7 +27,7 @@ ADDLIB+=dnet_ntop.o dnet_pton.o
> #options for ipx
> ADDLIB+=ipx_ntop.o ipx_pton.o
>
> -CC = gcc
> +CC ?= gcc
Right that allows one to override at build time,
supporting clang, ccache, ...
> HOSTCC = gcc
> CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall
> CFLAGS = $(CCOPTS) -I../include $(DEFINES)
> diff --git a/configure b/configure
> index f5c3d40..680fdcb 100755
> --- a/configure
> +++ b/configure
> @@ -3,6 +3,11 @@
> #
> INCLUDE=${1:-"$PWD/include"}
>
> +if [ "_$CC" == "_" ]
> +then
> + CC=gcc
> +fi
Ditto at configure time.
Note the shell idiom for this is
: ${var:="value"}
Note the leading : is required for portability.
Not applicable here, but if you want to set only if unset
(rather than the above which also handles empty), do:
: ${var="value"}
cheers,
Pádraig.
prev parent reply other threads:[~2011-11-16 10:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-16 1:04 [RFC] iproute: Support cross-compiling greearb
2011-11-16 1:17 ` Stephen Hemminger
2011-11-16 2:41 ` Ben Greear
2011-11-16 4:44 ` Eric Dumazet
2011-11-16 10:53 ` Pádraig Brady [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EC39617.5010108@draigBrady.com \
--to=p@draigbrady.com \
--cc=greearb@candelatech.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).