makefile.m32: add support for custom ARCH [ci skip]

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
This commit is contained in:
Viktor Szakats 2022-07-04 10:26:30 +00:00
parent 8ba22ffb20
commit 8ef0f35a04
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
3 changed files with 9 additions and 3 deletions

View File

@ -118,7 +118,7 @@ CC = $(CURL_CC)
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
@ -129,6 +129,7 @@ ARCH = w32
endif
endif
ifneq ($(ARCH),custom)
ifeq ($(ARCH),w64)
CFLAGS += -m64
LDFLAGS += -m64
@ -138,6 +139,7 @@ CFLAGS += -m32
LDFLAGS += -m32
RCFLAGS += -F pe-i386
endif
endif
# Platform-dependent helper tool macros
ifeq ($(findstring /sh,$(SHELL)),/sh)

View File

@ -115,7 +115,7 @@ LDFLAGS = $(CURL_LDFLAG_EXTRAS) $(CURL_LDFLAG_EXTRAS_DLL)
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.
@ -127,6 +127,7 @@ ARCH = w32
endif
endif
ifneq ($(ARCH),custom)
ifeq ($(ARCH),w64)
CFLAGS += -m64
LDFLAGS += -m64
@ -136,6 +137,7 @@ CFLAGS += -m32
LDFLAGS += -m32
RCFLAGS += -F pe-i386
endif
endif
# Platform-dependent helper tool macros
ifeq ($(findstring /sh,$(SHELL)),/sh)

View File

@ -119,7 +119,7 @@ CFLAGS = -O3 $(CURL_CFLAG_EXTRAS) -W -Wall
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
@ -135,6 +135,7 @@ ARCH = w32
endif
endif
ifneq ($(ARCH),custom)
ifeq ($(ARCH),w64)
CFLAGS += -m64
LDFLAGS += -m64
@ -144,6 +145,7 @@ CFLAGS += -m32
LDFLAGS += -m32
RCFLAGS += -F pe-i386
endif
endif
# Platform-dependent helper tool macros
ifeq ($(findstring /sh,$(SHELL)),/sh)