lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4EC39617.5010108@draigBrady.com>
Date:	Wed, 16 Nov 2011 10:53:11 +0000
From:	Pádraig Brady <P@...igBrady.com>
To:	greearb@...delatech.com
CC:	netdev@...r.kernel.org
Subject: Re: [RFC] iproute:  Support cross-compiling.

On 11/16/2011 01:04 AM, greearb@...delatech.com wrote:
> From: Ben Greear <greearb@...delatech.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@...delatech.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ