When building curl for target platform other than x64 and x86, it is now
possible to pass `ARCH=custom`, that will omit all hardcoded logic for
setting up CFLAGS/LDFLAGS/RCFLAGS for these platforms, and let these be
customized via `CURL_CFLAG_EXTRAS`, `CURL_LDFLAG_EXTRAS`, and a newly
added one for the resource compiler: `CURL_RCFLAG_EXTRAS`.
This makes it possible to use `makefile.m32` to build for ARM64 for
example.
Reviewed-by: Daniel Stenberg
Closes #9092
CFLAGS = -O3 $(CURL_CFLAG_EXTRAS) -W -Wall
LDFLAGS = $(CURL_LDFLAG_EXTRAS) $(CURL_LDFLAG_EXTRAS_EXE)
RC = $(CROSSPREFIX)windres
-RCFLAGS = --include-dir=$(PROOT)/include -O coff
+RCFLAGS = --include-dir=$(PROOT)/include -O coff $(CURL_RCFLAG_EXTRAS)
# Set environment var ARCH to your architecture to override autodetection.
ifndef ARCH
endif
endif
+ifneq ($(ARCH),custom)
ifeq ($(ARCH),w64)
CFLAGS += -m64
LDFLAGS += -m64
LDFLAGS += -m32
RCFLAGS += -F pe-i386
endif
+endif
# Platform-dependent helper tool macros
ifeq ($(findstring /sh,$(SHELL)),/sh)
AR = $(CURL_AR)
RANLIB = $(CURL_RANLIB)
RC = $(CROSSPREFIX)windres
-RCFLAGS = --include-dir=$(PROOT)/include -O coff
+RCFLAGS = --include-dir=$(PROOT)/include -O coff $(CURL_RCFLAG_EXTRAS)
STRIP = $(CROSSPREFIX)strip -g
# Set environment var ARCH to your architecture to override autodetection.
endif
endif
+ifneq ($(ARCH),custom)
ifeq ($(ARCH),w64)
CFLAGS += -m64
LDFLAGS += -m64
LDFLAGS += -m32
RCFLAGS += -F pe-i386
endif
+endif
# Platform-dependent helper tool macros
ifeq ($(findstring /sh,$(SHELL)),/sh)
LDFLAGS = $(CURL_LDFLAG_EXTRAS) $(CURL_LDFLAG_EXTRAS_EXE)
AR = $(CURL_AR)
RC = $(CROSSPREFIX)windres
-RCFLAGS = --include-dir=$(PROOT)/include -O coff -DCURL_EMBED_MANIFEST
+RCFLAGS = --include-dir=$(PROOT)/include -O coff -DCURL_EMBED_MANIFEST $(CURL_RCFLAG_EXTRAS)
STRIP = $(CROSSPREFIX)strip -g
# We may need these someday
endif
endif
+ifneq ($(ARCH),custom)
ifeq ($(ARCH),w64)
CFLAGS += -m64
LDFLAGS += -m64
LDFLAGS += -m32
RCFLAGS += -F pe-i386
endif
+endif
# Platform-dependent helper tool macros
ifeq ($(findstring /sh,$(SHELL)),/sh)