Re: [PATCH v4] Makefile: Fix build on MSYS2 and Cygwin

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



On Fri, May 19, 2017 at 09:06:54AM +0000, Cufi, Carles wrote:
> The host compiler on MSYS2 and Cygwin does not allow the -fPIC option,
> issuing a warning that is treated as an error and stops the build.
> Detect whether we're running under MSYS2 or Cygwin and avoid adding
> -fPIC to prevent the error from happening.
> 
> Tested on Linux, MSYS2 and Cygwin.
> 
> Signed-off-by: Carles Cufi <carles.cufi@xxxxxxxxx>

Applied, thanks.

> ---
>  Makefile | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 7fa2be8..a3eb585 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -33,12 +33,15 @@ LIBDIR = $(PREFIX)/lib
>  INCLUDEDIR = $(PREFIX)/include
>  
>  HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
> -	    sed -e 's/\(cygwin\).*/cygwin/')
> +	    sed -e 's/\(cygwin\|msys\).*/\1/')
>  
>  ifeq ($(HOSTOS),darwin)
>  SHAREDLIB_EXT     = dylib
>  SHAREDLIB_CFLAGS  = -fPIC
>  SHAREDLIB_LDFLAGS = -fPIC -dynamiclib -Wl,-install_name -Wl,
> +else ifeq ($(HOSTOS),$(filter $(HOSTOS),msys cygwin))
> +SHAREDLIB_EXT     = so
> +SHAREDLIB_LDFLAGS = -shared -Wl,--version-script=$(LIBFDT_version) -Wl,-soname,
>  else
>  SHAREDLIB_EXT     = so
>  SHAREDLIB_CFLAGS  = -fPIC

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux