mac support cross compile

This commit is contained in:
hailang 2022-04-10 15:43:29 +08:00
parent 9fceb75a52
commit 3ddff50476
56 changed files with 61 additions and 2 deletions

View File

@ -61,6 +61,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
RPATH = macos
SYSLIB += -rdynamic -L/usr/lib -liconv
LDFLAGS = -dynamiclib -shared

View File

@ -27,6 +27,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -27,6 +27,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,6 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,6 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -29,6 +29,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -53,6 +53,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof -fPIC -Werror \
-Wno-unused-private-field

View File

@ -29,6 +29,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -65,6 +65,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -34,6 +34,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,6 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -38,6 +38,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -33,6 +33,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -38,6 +38,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -58,6 +58,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -49,6 +49,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -53,6 +53,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,6 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -49,6 +49,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,6 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -38,6 +38,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -38,6 +38,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,6 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -30,6 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -104,6 +104,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -Wno-invalid-source-encoding \
-Wno-invalid-offsetof \
-ffunction-sections \

View File

@ -57,6 +57,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -49,6 +49,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX
@ -96,6 +97,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -53,6 +53,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -24,6 +24,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -53,6 +53,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -54,6 +54,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -49,6 +49,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX
@ -96,6 +97,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -30,6 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -D_REENTRANT -pedantic -DMACOSX
SYSLIB = -lpthread
endif

View File

@ -30,6 +30,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -D_REENTRANT -pedantic -DMACOSX
SYSLIB = -lpthread
endif

View File

@ -44,6 +44,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX
@ -83,6 +84,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
endif

View File

@ -94,6 +94,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -Wno-invalid-source-encoding \
-Wno-invalid-offsetof \
-Wno-unused-private-field \

View File

@ -49,6 +49,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -56,6 +56,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -liconv -rdynamic

View File

@ -50,6 +50,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
UNIXTYPE = MACOSX
endif

View File

@ -25,6 +25,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -D_REENTRANT
SYSLIB = -lpthread
endif

View File

@ -73,6 +73,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -94,6 +94,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof \
-Wno-deprecated-declarations

View File

@ -76,6 +76,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof \
-Wno-unused-private-field

View File

@ -54,6 +54,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -64,6 +64,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -53,6 +53,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -31,6 +31,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -40,6 +40,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX

View File

@ -52,6 +52,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -70,6 +70,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -Wno-invalid-source-encoding \
-Wno-invalid-offsetof \
-fdata-sections \

View File

@ -52,6 +52,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -48,6 +48,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
SYSLIB += -rdynamic

View File

@ -25,6 +25,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -D_REENTRANT -pedantic
SYSLIB = -lpthread
endif

View File

@ -44,6 +44,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding -Wno-invalid-offsetof
UNIXTYPE = MACOSX
endif

View File

@ -40,6 +40,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX
UNIXTYPE = MACOSX
endif

View File

@ -45,6 +45,7 @@ endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CC += -arch x86_64 -arch arm64
CFLAGS += -DMACOSX -Wno-invalid-source-encoding -Wno-invalid-offsetof
UNIXTYPE = MACOSX
endif