Merge pull request #542 from wbx-github/dev

allow to override uname when cross-compiling
This commit is contained in:
Yann Collet 2018-05-29 14:20:48 -07:00 committed by GitHub
commit ef4f1e3047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,7 @@ LIBVER := $(shell echo $(LIBVER_SCRIPT))
BUILD_SHARED:=yes BUILD_SHARED:=yes
BUILD_STATIC:=yes BUILD_STATIC:=yes
OS ?= $(shell uname)
CPPFLAGS+= -DXXH_NAMESPACE=LZ4_ CPPFLAGS+= -DXXH_NAMESPACE=LZ4_
CFLAGS ?= -O3 CFLAGS ?= -O3
DEBUGFLAGS:= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ DEBUGFLAGS:= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
@ -58,7 +59,7 @@ SRCFILES := $(sort $(wildcard *.c))
# OS X linker doesn't support -soname, and use different extension # OS X linker doesn't support -soname, and use different extension
# see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html # see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html
ifeq ($(shell uname), Darwin) ifeq ($(OS), Darwin)
SHARED_EXT = dylib SHARED_EXT = dylib
SHARED_EXT_MAJOR = $(LIBVER_MAJOR).$(SHARED_EXT) SHARED_EXT_MAJOR = $(LIBVER_MAJOR).$(SHARED_EXT)
SHARED_EXT_VER = $(LIBVER).$(SHARED_EXT) SHARED_EXT_VER = $(LIBVER).$(SHARED_EXT)
@ -142,14 +143,14 @@ libdir ?= $(LIBDIR)
INCLUDEDIR ?= $(prefix)/include INCLUDEDIR ?= $(prefix)/include
includedir ?= $(INCLUDEDIR) includedir ?= $(INCLUDEDIR)
ifneq (,$(filter $(shell uname),OpenBSD FreeBSD NetBSD DragonFly)) ifneq (,$(filter $(OS),OpenBSD FreeBSD NetBSD DragonFly))
PKGCONFIGDIR ?= $(prefix)/libdata/pkgconfig PKGCONFIGDIR ?= $(prefix)/libdata/pkgconfig
else else
PKGCONFIGDIR ?= $(libdir)/pkgconfig PKGCONFIGDIR ?= $(libdir)/pkgconfig
endif endif
pkgconfigdir ?= $(PKGCONFIGDIR) pkgconfigdir ?= $(PKGCONFIGDIR)
ifneq (,$(filter $(shell uname),SunOS)) ifneq (,$(filter $(OS),SunOS))
INSTALL ?= ginstall INSTALL ?= ginstall
else else
INSTALL ?= install INSTALL ?= install