Welcome! Log In Create A New Profile

Advanced

[PATCH] Configure: fix build on Windows using non-MSVC compilers

Piotr Sikora via nginx-devel
May 02, 2024 05:34PM
# HG changeset patch
# User Piotr Sikora <piotr@aviatrix.com>
# Date 1714589717 0
# Wed May 01 18:55:17 2024 +0000
# Node ID 43b04ece77b7132db868122a20c99c8ba89adfb5
# Parent 49dce50fad40bf09db81ca2a35983ecd7b740e43
Configure: fix build on Windows using non-MSVC compilers.

Previously, kernel32 and user32 libraries were linked only when
using MSVC, but they are needed regardless of the compiler.

Signed-off-by: Piotr Sikora <piotr@aviatrix.com>

diff -r 49dce50fad40 -r 43b04ece77b7 auto/cc/msvc
--- a/auto/cc/msvc Tue Apr 16 18:29:59 2024 +0400
+++ b/auto/cc/msvc Wed May 01 18:55:17 2024 +0000
@@ -114,8 +114,6 @@

CFLAGS="$CFLAGS $LIBC"

-CORE_LIBS="$CORE_LIBS kernel32.lib user32.lib"
-
# Win32 GUI mode application
#CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup"

diff -r 49dce50fad40 -r 43b04ece77b7 auto/os/win32
--- a/auto/os/win32 Tue Apr 16 18:29:59 2024 +0400
+++ b/auto/os/win32 Wed May 01 18:55:17 2024 +0000
@@ -19,14 +19,14 @@
case "$NGX_CC_NAME" in

clang | gcc)
- CORE_LIBS="$CORE_LIBS -ladvapi32 -lws2_32"
+ CORE_LIBS="$CORE_LIBS -lkernel32 -luser32 -ladvapi32 -lws2_32"
MAIN_LINK="$MAIN_LINK -Wl,--export-all-symbols"
MAIN_LINK="$MAIN_LINK -Wl,--out-implib=$NGX_OBJS/libnginx.a"
MODULE_LINK="-shared -L $NGX_OBJS -lnginx"
;;

*)
- CORE_LIBS="$CORE_LIBS advapi32.lib ws2_32.lib"
+ CORE_LIBS="$CORE_LIBS kernel32.lib user32.lib advapi32.lib ws2_32.lib"
;;

esac
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Configure: fix build on Windows using non-MSVC compilers

Piotr Sikora via nginx-devel 292 May 02, 2024 05:34PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 137
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready