]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Makefile.m32: add support for UNICODE builds
authorViktor Szakats <commit@vsz.me>
Mon, 23 Nov 2020 16:56:27 +0000 (16:56 +0000)
committerViktor Szakats <commit@vsz.me>
Mon, 23 Nov 2020 16:56:27 +0000 (16:56 +0000)
It requires the linker to support the `-municode` option.
This is available in more recent mingw-w64 releases.

Ref: https://gcc.gnu.org/onlinedocs/gcc/x86-Windows-Options.html
Ref: https://stackoverflow.com/questions/3571250/wwinmain-unicode-and-mingw/11706847#11706847

Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
Closes #6228

lib/Makefile.m32
src/Makefile.m32

index 3463dee20f4f476145ae3ba2b0fb5f61ccdf8777..d23eeead3bf5540c94083a5e151c2d37d8b37d20 100644 (file)
@@ -226,6 +226,9 @@ endif
 ifeq ($(findstring -ngtcp2,$(CFG)),-ngtcp2)
 NGTCP2 = 1
 endif
+ifeq ($(findstring -unicode,$(CFG)),-unicode)
+UNICODE = 1
+endif
 
 INCLUDES = -I. -I../include
 CFLAGS += -DBUILDING_LIBCURL
@@ -234,6 +237,9 @@ ifdef SSL
     CFLAGS += -DCURL_WITH_MULTI_SSL
   endif
 endif
+ifdef UNICODE
+  CFLAGS += -DUNICODE -D_UNICODE
+endif
 
 ifdef SYNC
   CFLAGS += -DUSE_SYNC_DNS
index ba74fe157e6dc864264a113467a4e600dab4ff6b..03c2b676c773a060b8778834cb1558834915877b 100644 (file)
@@ -238,6 +238,9 @@ endif
 ifeq ($(findstring -ngtcp2,$(CFG)),-ngtcp2)
 NGTCP2 = 1
 endif
+ifeq ($(findstring -unicode,$(CFG)),-unicode)
+UNICODE = 1
+endif
 
 INCLUDES = -I. -I../include -I../lib
 ifdef SSL
@@ -245,6 +248,10 @@ ifdef SSL
     CFLAGS += -DCURL_WITH_MULTI_SSL
   endif
 endif
+ifdef UNICODE
+  CFLAGS += -DUNICODE -D_UNICODE
+  LDFLAGS += -municode
+endif
 
 ifdef DYN
   curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll