From: Viktor Szakats Date: Fri, 9 Aug 2024 18:18:48 +0000 (+0200) Subject: autotools: add `--with-windows-unicode` option X-Git-Tag: curl-8_10_0~306 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e4a2187e763dd80a1296b07fd3e073f46c4dc8f;p=thirdparty%2Fcurl.git autotools: add `--with-windows-unicode` option - add `--with-windows-unicode` and `--without-windows-unicode` (default) options. - enable it in a CI job. Fixes #7229 Closes #14478 --- diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2bfda6fa95..b1326e589a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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' } diff --git a/configure.ac b/configure.ac index b8b71501af..cb4564a87d 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/docs/TODO b/docs/TODO index 369807ed0e..15fe704a77 100644 --- a/docs/TODO +++ b/docs/TODO @@ -178,7 +178,6 @@ 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 @@ -1307,13 +1306,6 @@ 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 diff --git a/src/Makefile.am b/src/Makefile.am index 73fbe8068f..b8fab703cd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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