1 | # $Id: vboximportchecker.kmk 93322 2022-01-18 15:23:38Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # VBox import checker unit.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2017 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | UNIT_vboximportchecker = bldRTLdrCheckImports
|
---|
19 |
|
---|
20 | # Add our property.
|
---|
21 | PROPS_SINGLE += VBOX_IMPORT_CHECKER
|
---|
22 | PROPS_SINGLE_LNK += VBOX_IMPORT_CHECKER
|
---|
23 | PROPS_PROGRAMS_SINGLE += VBOX_IMPORT_CHECKER
|
---|
24 | PROPS_DLLS_SINGLE += VBOX_IMPORT_CHECKER
|
---|
25 | PROPS_SYSMODS_SINGLE += VBOX_IMPORT_CHECKER
|
---|
26 |
|
---|
27 | # Helper for expanding certain variables while assigning.
|
---|
28 | define def_unit_vboximportchecker_internal_expand_twice
|
---|
29 | $(target)_POST_CMDS += $$(if-expr "$$(tool_do)" != "LINK_LIBRARY",$$(NLTAB)$$(VBOX_RTLDRCHECKIMPORTS) -q -p "$$(KBUILD_DEVTOOLS)/$(bld_trg).$(bld_trg_arch)/exports/$$($(target)_2_VBOX_IMPORT_CHECKER)" $$(out),)
|
---|
30 | endef
|
---|
31 |
|
---|
32 | define def_unit_vboximportchecker_target_pre
|
---|
33 | # Do not apply to ASAN builds as it requires newere DLLs.
|
---|
34 | ifneq ($(KBUILD_TYPE),asan)
|
---|
35 |
|
---|
36 | # Set pass 2 variable (simpler) and act on it.
|
---|
37 | $(target)_2_VBOX_IMPORT_CHECKER := $(evalcall def_fn_prop_get_first_defined,VBOX_IMPORT_CHECKER)
|
---|
38 | ifdef $(target)_2_VBOX_IMPORT_CHECKER
|
---|
39 | $(target)_LNK_ORDERDEPS += $(VBOX_RTLDRCHECKIMPORTS)
|
---|
40 | $(eval $(def_unit_vboximportchecker_internal_expand_twice))
|
---|
41 | endif
|
---|
42 |
|
---|
43 | endif
|
---|
44 |
|
---|
45 | endef
|
---|
46 |
|
---|