From 2b80c0f7d9f5452ce81b82c00e15320a760b1e97 Mon Sep 17 00:00:00 2001 From: Brad House Date: Tue, 23 Jul 2024 19:48:58 -0400 Subject: [PATCH] msvc Makefiles: Remove support for MSVC 6 and 7 since we can't target legacy Windows versions supported by those compilers anymore --- Makefile.am | 2 +- Makefile.msvc | 32 +++++--------------------------- msvc_ver.inc | 26 -------------------------- test/Makefile.msvc | 32 +++++--------------------------- 4 files changed, 11 insertions(+), 81 deletions(-) delete mode 100644 msvc_ver.inc diff --git a/Makefile.am b/Makefile.am index 6c71f4d7..e99161a4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc 1.9.6 ACLOCAL_AMFLAGS = -I m4 --install -MSVCFILES = msvc_ver.inc buildconf.bat +MSVCFILES = buildconf.bat # adig and ahost are just sample programs and thus not mentioned with the # regular sources and headers diff --git a/Makefile.msvc b/Makefile.msvc index 7f0c38e6..1be67619 100644 --- a/Makefile.msvc +++ b/Makefile.msvc @@ -75,11 +75,6 @@ RTLIBD = /MTd USE_WATT32 = 0 !ENDIF -# -------------------------------------------------------- -# Detect compiler version. -# -------------------------------------------------------- -!INCLUDE .\msvc_ver.inc - # ---------------------------------------------------- # Verify that current subdir is the c-ares source one # ---------------------------------------------------- @@ -190,30 +185,13 @@ EX_LIBS_REL = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib EX_LIBS_DBG = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib !ENDIF -# ------------------------------------------------- -# Switches that depend on ancient compiler versions -# ------------------------------------------------- - -!IF $(CC_VERS_NUM) == 60 -PDB_NONE = /pdb:none -PDBTYPE_CONSOLIDATE = /pdbtype:consolidate -!ELSE -!UNDEF PDB_NONE -!UNDEF PDBTYPE_CONSOLIDATE -!ENDIF - -!IF $(CC_VERS_NUM) <= 70 -RT_ERROR_CHECKING = /GZ -!ELSE -RT_ERROR_CHECKING = /RTCsu -!ENDIF # ---------------------------- # Assorted commands and flags # ---------------------------- CC_CMD_REL = cl.exe /nologo $(RTLIB) /DNDEBUG /O2 -CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi $(RT_ERROR_CHECKING) +CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi /RTCsu CC_CFLAGS = $(CFLAGS) /D_REENTRANT /I.\src\lib /I.\include /W3 /EHsc /FD RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG" @@ -223,8 +201,8 @@ LINK_CMD_LIB = link.exe /lib /nologo LINK_CMD_DLL = link.exe /dll /nologo /incremental:no /fixed:no LINK_CMD_EXE = link.exe /nologo /incremental:no /fixed:no /subsystem:console -LINK_CMD_EXE_REL = $(LINK_CMD_EXE) /release $(PDB_NONE) -LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE) +LINK_CMD_EXE_REL = $(LINK_CMD_EXE) /release +LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug # --------------------------------- # Configuration dependent settings @@ -255,7 +233,7 @@ CC_CMD = $(CC_CMD_DBG) !IF "$(CFG)" == "dll-release" CARES_TARGET = $(DYN_LIB_REL).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY -CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(CARES_OUTDIR)\$(IMP_LIB_REL).lib $(PDB_NONE) +CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(CARES_OUTDIR)\$(IMP_LIB_REL).lib SPROG_CFLAGS = /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_REL) $(IMP_LIB_REL).lib CARES_LINK = $(LINK_CMD_DLL) @@ -268,7 +246,7 @@ RC_CMD = $(RC_CMD_REL) !IF "$(CFG)" == "dll-debug" CARES_TARGET = $(DYN_LIB_DBG).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD -CARES_LFLAGS = /debug $(EX_LIBS_DBG) /implib:$(CARES_OUTDIR)\$(IMP_LIB_DBG).lib /pdb:$(CARES_OUTDIR)\$(DYN_LIB_DBG).pdb $(PDBTYPE_CONSOLIDATE) +CARES_LFLAGS = /debug $(EX_LIBS_DBG) /implib:$(CARES_OUTDIR)\$(IMP_LIB_DBG).lib /pdb:$(CARES_OUTDIR)\$(DYN_LIB_DBG).pdb SPROG_CFLAGS = /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_DBG) $(IMP_LIB_DBG).lib CARES_LINK = $(LINK_CMD_DLL) diff --git a/msvc_ver.inc b/msvc_ver.inc deleted file mode 100644 index 61bdb59a..00000000 --- a/msvc_ver.inc +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) The c-ares project and its contributors -# SPDX-License-Identifier: MIT -# ----------------------------------------------- -# Detect NMAKE version deducing old MSVC versions -# ----------------------------------------------- - -!IFNDEF _NMAKE_VER -! MESSAGE Macro _NMAKE_VER not defined. -! MESSAGE Use MSVC's NMAKE to process this makefile. -! ERROR See previous message. -!ENDIF - -!IF "$(_NMAKE_VER)" == "6.00.8168.0" -CC_VERS_NUM = 60 -!ELSEIF "$(_NMAKE_VER)" == "6.00.9782.0" -CC_VERS_NUM = 60 -!ELSEIF "$(_NMAKE_VER)" == "7.00.8882" -CC_VERS_NUM = 70 -!ELSEIF "$(_NMAKE_VER)" == "7.00.9466" -CC_VERS_NUM = 70 -!ELSEIF "$(_NMAKE_VER)" == "7.00.9955" -CC_VERS_NUM = 70 -!ELSE -# Pick an arbitrary bigger number for all later versions -CC_VERS_NUM = 199 -!ENDIF diff --git a/test/Makefile.msvc b/test/Makefile.msvc index bb2648c2..9c81b6c1 100644 --- a/test/Makefile.msvc +++ b/test/Makefile.msvc @@ -62,11 +62,6 @@ RTLIB = /MT RTLIBD = /MTd !ENDIF -# -------------------------------------------------------- -# Detect compiler version. -# -------------------------------------------------------- -!INCLUDE ..\msvc_ver.inc - # --------------------------------------------------------- # Verify that current subdir is below the c-ares source one # --------------------------------------------------------- @@ -148,30 +143,13 @@ CFLAGS = /DWIN32 EX_LIBS_REL = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib EX_LIBS_DBG = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib -# ------------------------------------------------- -# Switches that depend on ancient compiler versions -# ------------------------------------------------- - -!IF $(CC_VERS_NUM) == 60 -PDB_NONE = /pdb:none -PDBTYPE_CONSOLIDATE = /pdbtype:consolidate -!ELSE -!UNDEF PDB_NONE -!UNDEF PDBTYPE_CONSOLIDATE -!ENDIF - -!IF $(CC_VERS_NUM) <= 70 -RT_ERROR_CHECKING = /GZ -!ELSE -RT_ERROR_CHECKING = /RTCsu -!ENDIF # ---------------------------- # Assorted commands and flags # ---------------------------- CC_CMD_REL = cl.exe /nologo $(RTLIB) /DNDEBUG /O2 /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS -CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS $(RT_ERROR_CHECKING) +CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /RTCsu CC_CFLAGS = $(CFLAGS) /I. /I../src/lib /I../include /I $(GTEST_ROOT)/include /W3 /EHsc /FD RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG" @@ -181,8 +159,8 @@ LINK_CMD_LIB = link.exe /lib /nologo LINK_CMD_DLL = link.exe /dll /nologo /incremental:no /fixed:no LINK_CMD_EXE = link.exe /nologo /incremental:no /fixed:no /subsystem:console -LINK_CMD_EXE_REL = $(LINK_CMD_EXE) /release $(PDB_NONE) -LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE) +LINK_CMD_EXE_REL = $(LINK_CMD_EXE) /release +LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug # --------------------------------- # Configuration dependent settings @@ -213,7 +191,7 @@ CC_CMD = $(CC_CMD_DBG) !IF "$(CFG)" == "dll-release" CARES_TARGET = $(DYN_LIB_REL).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY -CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(PROG_OUTDIR)\$(IMP_LIB_REL).lib $(PDB_NONE) +CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(PROG_OUTDIR)\$(IMP_LIB_REL).lib SPROG_CFLAGS = /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_REL) $(IMP_LIB_REL).lib CARES_LINK = $(LINK_CMD_DLL) @@ -226,7 +204,7 @@ RC_CMD = $(RC_CMD_REL) !IF "$(CFG)" == "dll-debug" CARES_TARGET = $(DYN_LIB_DBG).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD -CARES_LFLAGS = /debug $(EX_LIBS_DBG) /implib:$(PROG_OUTDIR)\$(IMP_LIB_DBG).lib /pdb:$(PROG_OUTDIR)\$(DYN_LIB_DBG).pdb $(PDBTYPE_CONSOLIDATE) +CARES_LFLAGS = /debug $(EX_LIBS_DBG) /implib:$(PROG_OUTDIR)\$(IMP_LIB_DBG).lib /pdb:$(PROG_OUTDIR)\$(DYN_LIB_DBG).pdb SPROG_CFLAGS = /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_DBG) $(IMP_LIB_DBG).lib CARES_LINK = $(LINK_CMD_DLL)