]> git.proxmox.com Git - mirror_edk2.git/blob - StdLib/StdLib.inc
StdLib: Improve robustness of stat() and make basename() a public function.
[mirror_edk2.git] / StdLib / StdLib.inc
1 ################################################################
2 # Boilerplate text to be included by any DSC file using the
3 # Standard Libraries.
4 #
5 # The including DSC file must DEFINE the EMULATE macro if
6 # the application is to be run in an emulation environment.
7 #
8 # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
9 # This program and the accompanying materials
10 # are licensed and made available under the terms and conditions of the BSD License
11 # which accompanies this distribution. The full text of the license may be found at
12 # http://opensource.org/licenses/bsd-license.
13 #
14 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 ################################################################
17
18 ##########
19 # Socket Support Libraries
20 ##########
21
22 [LibraryClasses.common]
23 BsdSocketLib|StdLib/BsdSocketLib/BsdSocketLib.inf
24 EfiSocketLib|StdLib/EfiSocketLib/EfiSocketLib.inf
25 UseSocketDxe|StdLib/UseSocketDxe/UseSocketDxe.inf
26
27 [LibraryClasses.Common.UEFI_APPLICATION]
28 #
29 # C Standard Libraries
30 #
31 LibC|StdLib/LibC/LibC.inf
32 LibCType|StdLib/LibC/Ctype/Ctype.inf
33 LibLocale|StdLib/LibC/Locale/Locale.inf
34 LibMath|StdLib/LibC/Math/Math.inf
35 LibSignal|StdLib/LibC/Signal/Signal.inf
36 LibStdio|StdLib/LibC/Stdio/Stdio.inf
37 LibStdLib|StdLib/LibC/StdLib/StdLib.inf
38 LibString|StdLib/LibC/String/String.inf
39 LibTime|StdLib/LibC/Time/Time.inf
40 LibUefi|StdLib/LibC/Uefi/Uefi.inf
41 LibWchar|StdLib/LibC/Wchar/Wchar.inf
42
43 # Common Utilities for Networking Libraries
44 LibNetUtil|StdLib/LibC/NetUtil/NetUtil.inf
45
46 # Additional libraries for POSIX functionality.
47 LibErr|StdLib/PosixLib/Err/LibErr.inf
48 LibGen|StdLib/PosixLib/Gen/LibGen.inf
49 LibGlob|StdLib/PosixLib/Glob/LibGlob.inf
50 LibStringlist|StdLib/PosixLib/Stringlist/LibStringlist.inf
51
52 # Libraries for device abstractions within the Standard C Library
53 # Applications should not directly access any functions defined in these libraries.
54 LibGdtoa|StdLib/LibC/gdtoa/gdtoa.inf
55 DevConsole|StdLib/LibC/Uefi/Devices/daConsole.inf
56 DevShell|StdLib/LibC/Uefi/Devices/daShell.inf
57 DevUtility|StdLib/LibC/Uefi/Devices/daUtility.inf
58
59 ###
60 # Select the correct TimerLib instance depending upon whether running under
61 # an emulation environment, or not.
62 !ifndef $(EMULATE)
63 # Not running in an Emulation Environment
64 [LibraryClasses.IA32.UEFI_APPLICATION]
65 TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
66 # TimerLib|PerformancePkg/Library/DxeTscTimerLib/DxeTscTimerLib.inf
67
68 [LibraryClasses.X64.UEFI_APPLICATION]
69 TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
70 # TimerLib|PerformancePkg/Library/DxeTscTimerLib/DxeTscTimerLib.inf
71
72 [LibraryClasses.IPF.UEFI_APPLICATION]
73 PalLib|MdePkg/Library/UefiPalLib/UefiPalLib.inf
74 TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf
75
76 [LibraryClasses.ARM.UEFI_APPLICATION]
77 NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
78 TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
79
80
81 !else
82 # Use this instance if Running in an Emulation Environment.
83 [LibraryClasses.Common.UEFI_APPLICATION]
84 TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
85
86 [LibraryClasses.ARM.UEFI_APPLICATION]
87 NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
88
89 !endif
90
91 [Components]
92 # BaseLib and BaseMemoryLib need to be built with the /GL- switch when using the Microsoft
93 # tool chain. This is required so that the library functions can be resolved during
94 # the second pass of the linker during Link-time-code-generation.
95 ###
96 MdePkg/Library/BaseLib/BaseLib.inf {
97 <BuildOptions>
98 MSFT:*_*_*_CC_FLAGS = /X /Zc:wchar_t /GL-
99 }
100
101 MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf {
102 <BuildOptions>
103 MSFT:*_*_*_CC_FLAGS = /X /Zc:wchar_t /GL-
104 }
105
106 ##########
107 # Socket Layer
108 ##########
109 StdLib/SocketDxe/SocketDxe.inf
110
111
112 ##############################################################################
113 #
114 # See the additional comments below if you plan to run applications under an
115 # emulation environment.
116 #
117
118 [BuildOptions]
119 !ifndef $(EMULATE)
120 # These Build Options are used when building the Standard Libraries to be run
121 # on real hardware.
122 INTEL:*_*_*_CC_FLAGS = /Qfreestanding
123 MSFT:*_*_*_CC_FLAGS = /X /Zc:wchar_t /D NT32dvm
124 GCC:*_*_*_CC_FLAGS = -nostdinc -nostdlib
125 RVCT:*_*_*_CC_FLAGS = --library_interface=none -J$(WORKSPACE)/StdLib/Include -J$(WORKSPACE)/StdLib/Include/Arm -DNT32dvm
126 ARMGCC:*_*_*_CC_FLAGS = -nostdinc -nostdlib -Wno-unknown-pragmas -Wno-unused -Wno-format-zero-length -DNT32dvm
127
128 !else
129 # The Build Options, below, are only used when building the Standard Libraries
130 # to be run under an emulation environment. They disable the clock() system call
131 # which is currently incompatible with the most emulation environments.
132 # Select the correct TimerLib instance, above.
133 INTEL:*_*_IA32_CC_FLAGS = /Od /D NT32dvm
134 MSFT:*_*_IA32_CC_FLAGS = /Od /D NT32dvm
135 GCC:*_*_IA32_CC_FLAGS = -O0 -DNT32dvm
136 !endif