]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
autotools: add `--with-windows-unicode` option
authorViktor Szakats <commit@vsz.me>
Fri, 9 Aug 2024 18:18:48 +0000 (20:18 +0200)
committerViktor Szakats <commit@vsz.me>
Sat, 10 Aug 2024 08:02:49 +0000 (10:02 +0200)
- add `--with-windows-unicode` and `--without-windows-unicode` (default)
  options.

- enable it in a CI job.

Fixes #7229
Closes #14478

.github/workflows/windows.yml
configure.ac
docs/TODO
src/Makefile.am

index 2bfda6fa9529b13de15acfef04cd3ae4768bf507..b1326e589ae37e6780a83e6acdf1818d8ede2f08 100644 (file)
@@ -52,7 +52,7 @@ jobs:
           - { build: 'autotools', sys: 'msys'   , env: 'x86_64'      , tflags: '!19 !504 !704 !705 !1233', config: '--enable-debug --disable-threaded-resolver', name: 'default' }
           - { build: 'cmake'    , sys: 'msys'   , env: 'x86_64'      , tflags: 'skipall'                 , config: '-DENABLE_DEBUG=ON -DENABLE_THREADED_RESOLVER=OFF', name: 'default' }
           - { build: 'autotools', sys: 'msys'   , env: 'x86_64'      , tflags: '!19 !504 !704 !705 !1233', config: '', name: 'default R' }
-          - { build: 'autotools', sys: 'mingw64', env: 'x86_64'      , tflags: 'skiprun'                 , config: '--enable-debug --disable-threaded-resolver --disable-curldebug --enable-static=no', name: 'default' }
+          - { build: 'autotools', sys: 'mingw64', env: 'x86_64'      , tflags: 'skiprun'                 , config: '--enable-debug --disable-threaded-resolver --disable-curldebug --enable-static=no --with-windows-unicode', name: 'default' }
           # FIXME: WebSockets test results ignored due to frequent failures on native Windows:
           - { build: 'cmake'    , sys: 'mingw64', env: 'x86_64'      , tflags: '~2301 ~2302'             , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON', type: 'Debug', name: 'schannel U' }
           - { build: 'cmake'    , sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun'                 , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_CURLDEBUG=ON', type: 'Release', name: 'schannel R TrackMemory' }
index b8b71501afdfb5cf44acbda2d31f0d1b35cdba2c..cb4564a87d6ea0980c217c3518c35e75ddfe7484 100644 (file)
@@ -2523,6 +2523,32 @@ AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
   [test "x$versioned_symbols" = 'xyes'])
 
+dnl ----------------------------
+dnl check Windows Unicode option
+dnl ----------------------------
+
+want_winuni="no"
+if test "$curl_cv_native_windows" = "yes"; then
+  AC_MSG_CHECKING([whether to enable Windows Unicode (Windows native builds only)])
+  OPT_WINUNI="default"
+  AC_ARG_WITH(windows-unicode,
+  AS_HELP_STRING([--with-windows-unicode],[enable Windows Unicode])
+  AS_HELP_STRING([--without-windows-unicode], [disable Windows Unicode (default)]),
+    OPT_WINUNI=$withval)
+  case "$OPT_WINUNI" in
+    yes)
+      CPPFLAGS="${CPPFLAGS} -DUNICODE -D_UNICODE"
+      want_winuni="yes"
+      AC_MSG_RESULT([yes])
+      ;;
+    *)
+      AC_MSG_RESULT([no])
+      ;;
+  esac
+fi
+
+AM_CONDITIONAL([USE_UNICODE], [test "$want_winuni" = "yes"])
+
 dnl -------------------------------------------------
 dnl check winidn option before other IDN libraries
 dnl -------------------------------------------------
@@ -4989,6 +5015,9 @@ else
   ])
 fi
 
+if test "x$want_winuni" = "xyes"; then
+  SUPPORT_FEATURES="$SUPPORT_FEATURES Unicode"
+fi
 if test "x$want_debug" = "xyes"; then
   SUPPORT_FEATURES="$SUPPORT_FEATURES Debug"
 fi
index 369807ed0e4e7209e9dd16bdec8a7e0cb500e3ff..15fe704a77b246ef8ac860df695feb50158f9617 100644 (file)
--- a/docs/TODO
+++ b/docs/TODO
  19.3 Do not use GNU libtool on OpenBSD
  19.4 Package curl for Windows in a signed installer
  19.5 make configure use --cache-file more and better
- 19.6 build curl with Windows Unicode support
 
  20. Test suite
  20.1 SSL tunnel
 
  See https://github.com/curl/curl/issues/7753
 
-19.6 build curl with Windows Unicode support
-
- The user wants an easier way to tell autotools to build curl with Windows
- Unicode support, like ./configure --enable-windows-unicode
-
- See https://github.com/curl/curl/issues/7229
-
 20. Test suite
 
 20.1 SSL tunnel
index 73fbe8068f079688d1fba7d985d3b5b43ae65d00..b8fab703cd6ab7cc874adc4d00499d3f6f7c9950 100644 (file)
@@ -50,6 +50,11 @@ AM_CPPFLAGS += -DCURL_STATICLIB
 endif
 AM_CPPFLAGS += -DBUILDING_CURL
 
+AM_LDFLAGS =
+if USE_UNICODE
+AM_LDFLAGS += -municode
+endif
+
 include Makefile.inc
 
 # CURL_FILES comes from Makefile.inc