# $Id: Makefile.kmk 106061 2024-09-16 14:03:52Z vboxsync $ ## @file # Sub-Makefile for the libxml2 library. # # # Copyright (C) 2007-2024 Oracle and/or its affiliates. # # This file is part of VirtualBox base platform packages, as # available from https://www.virtualbox.org. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation, in version 3 of the # License. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # SPDX-License-Identifier: GPL-3.0-only # SUB_DEPTH = ../../.. include $(KBUILD_PATH)/subheader.kmk if !defined(VBOX_ONLY_VALIDATIONKIT) || defined(VBOX_WITH_VALIDATIONKIT_UNITTESTS_PACKING) # Needed for VBoxRT for Validation Kit unit tests. LIBRARIES += VBox-libxml2 endif VBox-libxml2_TEMPLATE = VBoxR3RuntimeDllNonPedantic VBox-libxml2_SDKS = VBoxZlib VBox-libxml2_DEFS = _REENTRANT # the latter triggers thread support, see xmlversion-default.h and win32xmlversion.h. VBox-libxml2_DEFS.win = WIN32 _WINDOWS _MBCS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE \ LIBXML_STATIC LIBXML_STATIC_FOR_DLL HAVE_WIN32_THREADS HAVE_COMPILER_TLS HAVE_ZLIB_H VBox-libxml2_CFLAGS.win.amd64 = -wd4267 VBox-libxml2_CFLAGS.win += -wd4701 # potentially uninitialized local variable 'l' used VBox-libxml2_CFLAGS.win += -wd4232 # nonstandard extension used : 'xmlFree' : address of dllimport 'free' is not static, identity not guaranteed VBox-libxml2_CFLAGS.win += -wd4305 # 'type cast' : truncation from 'xmlChar *' to 'long' VBox-libxml2_CFLAGS.win += -wd4306 # 'type cast' : conversion from 'long' to 'void *' of greater size [TODO: check these out?] VBox-libxml2_CFLAGS.win += -wd4090 # 'function': different 'const' qualifiers VBox-libxml2_CFLAGS.win += -wd4047 # dwarning C4047: 'function': 'xmlMutexPtr' differs in levels of indirection from 'xmlMutexPtr *' VBox-libxml2_CFLAGS.win += -wd4024 # warning C4024: 'xmlMutexLock': different types for formal and actual parameter 1 VBox-libxml2_CFLAGS.win += -wd4098 # warning C4098: 'xmlInitMemoryInternal': 'void' function returning a value VBox-libxml2_CFLAGS.win += -wd4703 # warning C4703: potentially uninitialized local pointer variable 'nsuri' used VBox-libxml2_CFLAGS.win += -wd4013 # warning C4013: 'sprintf' undefined; assuming extern returning int if "$(VBOX_VCC_TOOL_STEM)" >= "VCC120" VBox-libxml2_CFLAGS.win += -wd4311 # parser.c(1346) : warning C4311: 'type cast' : pointer truncation from 'void *' to 'long' VBox-libxml2_CFLAGS.win += -wd4312 # parser.c(1327) : warning C4312: 'type cast' : conversion from 'long' to 'void *' of greater size VBox-libxml2_CFLAGS.win += -wd4005 # sdk\v7.1\include\sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition endif if "$(VBOX_VCC_TOOL_STEM)" >= "VCC140" VBox-libxml2_CFLAGS.win += -wd4777 # timsort.h(326): warning C4777: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'unsigned int' VBox-libxml2_CFLAGS.win += -wd4477 # timsort.h(326): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t' VBox-libxml2_CFLAGS.win += -wd4723 # xpath.c(505) : warning C4723: potential divide by 0 endif ifn1of ($(KBUILD_TARGET), win) VBox-libxml2_CFLAGS = -Wno-format-security -Wno-strict-prototypes -Wno-format-extra-args $(VBOX_GCC_Wno-tautological-pointer-compare) endif VBox-libxml2_INCS = include VBox-libxml2_SOURCES = \ buf.c \ chvalid.c \ dict.c \ encoding.c \ entities.c \ error.c \ globals.c \ hash.c \ list.c \ parser.c \ parserInternals.c \ pattern.c \ relaxng.c \ SAX2.c \ threads.c \ tree.c \ uri.c \ valid.c \ xmlIO.c \ xmlmemory.c \ xmlreader.c \ xmlsave.c \ xmlunicode.c \ xmlwriter.c \ xmlstring.c # For linking: # VBox-libxml2_LDFLAGS.win = /VERSION:$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION) # VBox-libxml2_SDKS.win += WINPSDK ifdef VBOX_WITH_32_ON_64_MAIN_API # 32-bit edition. LIBRARIES += VBox-libxml2-x86 VBox-libxml2-x86_TEMPLATE = VBoxR3RuntimeDllNonPedantic-x86 VBox-libxml2-x86_EXTENDS = VBox-libxml2 endif LIBRARIES += VBox-libxml2-static VBox-libxml2-static_TEMPLATE = VBoxR3StaticNonPedantic VBox-libxml2-static_EXTENDS = VBox-libxml2 ifdef VBOX_WITH_NOCRT_STATIC VBox-libxml2-static_DEFS = $(VBox-libxml2_DEFS) IPRT_NO_CRT_FOR_3RD_PARTY endif include $(FILE_KBUILD_SUB_FOOTER)