Enable GSS on Linux and Android (#17223)
[mono-project.git] / mono / native / Makefile.am
blob9ade5e38e8ec1a14c286593d89c8ca3ef7349bdd
1 if !ENABLE_MSVC_ONLY
2 if MONO_NATIVE_COMPAT
3 lib_LTLIBRARIES = libmono-native-compat.la libmono-native-unified.la
4 else
5 lib_LTLIBRARIES = libmono-native.la
6 endif
7 endif # !ENABLE_MSVC_ONLY
9 CC = $(MONO_NATIVE_CC)
10 CCLD = $(MONO_NATIVE_CC)
11 CCAS = $(MONO_NATIVE_CC)
12 CPP = $(MONO_NATIVE_CC) -E
13 CXX = $(MONO_NATIVE_CXX)
14 CXXCPP = $(MONO_NATIVE_CXX) -E
15 CC_FOR_BUILD = $(MONO_NATIVE_CC)
17 if !ENABLE_MSVC_ONLY
19 common_sources = \
20         pal_config.h \
21         mono-native-platform.h \
22         mono-native-platform.c \
23         ../../external/corefx/src/Native/Unix/Common/pal_compiler.h \
24         ../../external/corefx/src/Native/Unix/Common/pal_safecrt.h \
25         ../../external/corefx/src/Native/Unix/Common/pal_types.h \
26         ../../external/corefx/src/Native/Unix/Common/pal_utilities.h \
27         ../../external/corefx/src/Native/Unix/System.Native/pal_errno.c \
28         ../../external/corefx/src/Native/Unix/System.Native/pal_errno.h \
29         ../../external/corefx/src/Native/Unix/System.Native/pal_maphardwaretype.c \
30         ../../external/corefx/src/Native/Unix/System.Native/pal_maphardwaretype.h \
31         ../../external/corefx/src/Native/Unix/System.Native/pal_memory.c \
32         ../../external/corefx/src/Native/Unix/System.Native/pal_memory.h \
33         ../../external/corefx/src/Native/Unix/System.Native/pal_uid.c \
34         ../../external/corefx/src/Native/Unix/System.Native/pal_uid.h \
35         ../../external/corefx/src/Native/Unix/System.Native/pal_time.c \
36         ../../external/corefx/src/Native/Unix/System.Native/pal_time.h \
37         ../../external/corefx/src/Native/AnyOS/brotli/enc/dictionary_hash.c \
38         ../../external/corefx/src/Native/AnyOS/brotli/enc/backward_references_hq.c \
39         ../../external/corefx/src/Native/AnyOS/brotli/enc/histogram.c \
40         ../../external/corefx/src/Native/AnyOS/brotli/enc/memory.c \
41         ../../external/corefx/src/Native/AnyOS/brotli/enc/entropy_encode.c \
42         ../../external/corefx/src/Native/AnyOS/brotli/enc/compress_fragment_two_pass.c \
43         ../../external/corefx/src/Native/AnyOS/brotli/enc/block_splitter.c \
44         ../../external/corefx/src/Native/AnyOS/brotli/enc/encode.c \
45         ../../external/corefx/src/Native/AnyOS/brotli/enc/cluster.c \
46         ../../external/corefx/src/Native/AnyOS/brotli/enc/backward_references.c \
47         ../../external/corefx/src/Native/AnyOS/brotli/enc/utf8_util.c \
48         ../../external/corefx/src/Native/AnyOS/brotli/enc/compress_fragment.c \
49         ../../external/corefx/src/Native/AnyOS/brotli/enc/brotli_bit_stream.c \
50         ../../external/corefx/src/Native/AnyOS/brotli/enc/bit_cost.c \
51         ../../external/corefx/src/Native/AnyOS/brotli/enc/static_dict.c \
52         ../../external/corefx/src/Native/AnyOS/brotli/enc/literal_cost.c \
53         ../../external/corefx/src/Native/AnyOS/brotli/enc/metablock.c \
54         ../../external/corefx/src/Native/AnyOS/brotli/dec/state.c \
55         ../../external/corefx/src/Native/AnyOS/brotli/dec/decode.c \
56         ../../external/corefx/src/Native/AnyOS/brotli/dec/huffman.c \
57         ../../external/corefx/src/Native/AnyOS/brotli/dec/bit_reader.c \
58         ../../external/corefx/src/Native/AnyOS/brotli/common/dictionary.c
60 macos_sources = $(unix_sources)
62 ios_sources = \
63         pal-icalls.h \
64         pal-icalls.c \
65         ../../external/corefx/src/Native/Unix/System.Native/pal_io.c \
66         ../../external/corefx/src/Native/Unix/System.Native/pal_io.h \
67         ../../external/corefx/src/Native/Unix/System.Native/pal_networking.c \
68         ../../external/corefx/src/Native/Unix/System.Native/pal_networking.h \
69         ../../external/corefx/src/Native/Unix/System.Native/pal_tcpstate.c \
70         ../../external/corefx/src/Native/Unix/System.Native/pal_tcpstate.h \
71         ../../external/corefx/src/Native/Unix/System.Native/pal_random.c \
72         ../../external/corefx/src/Native/Unix/System.Native/pal_random.h
74 linux_sources = $(unix_sources)
76 aix_sources = $(unix_sources)
78 freebsd_sources = $(unix_sources)
80 netbsd_sources = $(unix_sources)
82 haiku_sources = $(unix_sources)
84 android_sources = \
85         pal-android.h \
86         pal-android.c \
87         pal-icalls.h \
88         pal-icalls.c \
89         ../../external/corefx/src/Native/Unix/System.Native/pal_io.c \
90         ../../external/corefx/src/Native/Unix/System.Native/pal_io.h \
91         ../../external/corefx/src/Native/Unix/System.Native/pal_networkstatistics.c \
92         ../../external/corefx/src/Native/Unix/System.Native/pal_networkstatistics.h \
93         ../../external/corefx/src/Native/Unix/System.Native/pal_random.c \
94         ../../external/corefx/src/Native/Unix/System.Native/pal_random.h
97 unix_sources = \
98         pal-icalls.h \
99         pal-icalls.c \
100         ../../external/corefx/src/Native/Unix/System.Native/pal_io.c \
101         ../../external/corefx/src/Native/Unix/System.Native/pal_io.h \
102         ../../external/corefx/src/Native/Unix/System.Native/pal_networking.c \
103         ../../external/corefx/src/Native/Unix/System.Native/pal_networking.h \
104         ../../external/corefx/src/Native/Unix/System.Native/pal_networkstatistics.c \
105         ../../external/corefx/src/Native/Unix/System.Native/pal_networkstatistics.h \
106         ../../external/corefx/src/Native/Unix/System.Native/pal_tcpstate.c \
107         ../../external/corefx/src/Native/Unix/System.Native/pal_tcpstate.h \
108         ../../external/corefx/src/Native/Unix/System.Native/pal_random.c \
109         ../../external/corefx/src/Native/Unix/System.Native/pal_random.h
111 gss_sources = \
112         ../../external/corefx/src/Native/Unix/System.Net.Security.Native/pal_gssapi.c \
113         ../../external/corefx/src/Native/Unix/System.Net.Security.Native/pal_gssapi.h
115 if ENABLE_GSS
116 macos_sources += $(gss_sources)
117 linux_sources += $(gss_sources)
118 ios_sources += $(gss_sources)
119 endif
121 EXTRA_libmono_native_la_SOURCES = $(common_sources) $(macos_sources) $(ios_sources) $(linux_sources) $(aix_sources) $(freebsd_sources) $(netbsd_sources) $(haiku_sources) $(unix_sources) $(gss_sources)
123 if MONO_NATIVE_PLATFORM_MACOS
124 platform_sources = $(macos_sources)
125 else
126 if MONO_NATIVE_PLATFORM_IOS
127 platform_sources = $(ios_sources)
128 else
129 if MONO_NATIVE_PLATFORM_LINUX
130 platform_sources = $(linux_sources)
131 else
132 if MONO_NATIVE_PLATFORM_AIX
133 platform_sources = $(aix_sources)
134 else
135 if MONO_NATIVE_PLATFORM_ANDROID
136 platform_sources = $(android_sources)
137 else
138 if MONO_NATIVE_PLATFORM_FREEBSD
139 platform_sources = $(freebsd_sources)
140 else
141 if MONO_NATIVE_PLATFORM_NETBSD
142 platform_sources = $(netbsd_sources)
143 else
144 if MONO_NATIVE_PLATFORM_HAIKU
145 platform_sources = $(haiku_sources)
146 endif
147 endif
148 endif
149 endif
150 endif
151 endif
152 endif
153 endif
155 common_cppflags = -I$(top_srcdir) -I$(top_srcdir)/mono
157 common_cflags = \
158         -I$(abs_top_srcdir)/external/corefx/src/Native/Unix/Common \
159         -I$(abs_top_srcdir)/external/corefx/src/Native/Unix/System.Native \
160         -I$(abs_top_srcdir)/external/corefx/src/Native/AnyOS/brotli/include \
161         $(GLIB_CFLAGS) \
162         $(SHARED_CFLAGS) \
163         -DBROTLI_BUILD_NO_RBIT \
164         -Wno-typedef-redefinition
166 endif # !ENABLE_MSVC_ONLY
168 # clear these flags as we set values for each target separately and automake always appends CFLAGS
169 CFLAGS=
170 CPPFLAGS=
171 CXXFLAGS=
172 LDFLAGS=
173 CCASFLAGS=
175 if !ENABLE_MSVC_ONLY
177 libmono_native_la_SOURCES = $(common_sources) $(platform_sources) platform-type.c
179 libmono_native_la_CFLAGS = $(MONO_NATIVE_CFLAGS) $(common_cflags)
181 libmono_native_la_CPPFLAGS = $(MONO_NATIVE_CPPFLAGS) $(common_cppflags)
183 libmono_native_la_CXXFLAGS = $(MONO_NATIVE_CXXFLAGS)
185 libmono_native_la_LDFLAGS = $(MONO_NATIVE_LDFLAGS)
187 libmono_native_la_CCASFLAGS = $(MONO_NATIVE_CCASFLAGS)
189 libmono_native_la_LIBADD = $(MONO_NATIVE_LIBADD)
191 libmono_native_compat_la_SOURCES = $(common_sources) $(platform_sources) platform-type-compat.c
193 libmono_native_compat_la_CFLAGS = $(MONO_NATIVE_COMPAT_CFLAGS) $(common_cflags)
195 libmono_native_compat_la_CPPFLAGS = $(MONO_NATIVE_COMPAT_CPPFLAGS) $(common_cppflags)
197 libmono_native_compat_la_CXXFLAGS = $(MONO_NATIVE_COMPAT_CXXFLAGS)
199 libmono_native_compat_la_LDFLAGS = $(MONO_NATIVE_COMPAT_LDFLAGS)
201 libmono_native_compat_la_CCASFLAGS = $(MONO_NATIVE_COMPAT_CCASFLAGS)
203 libmono_native_compat_la_LIBADD = $(MONO_NATIVE_LIBADD)
205 libmono_native_unified_la_SOURCES = $(common_sources) $(platform_sources) platform-type-unified.c
207 libmono_native_unified_la_CFLAGS = $(MONO_NATIVE_UNIFIED_CFLAGS) $(common_cflags)
209 libmono_native_unified_la_CPPFLAGS = $(MONO_NATIVE_UNIFIED_CPPFLAGS) $(common_cppflags)
211 libmono_native_unified_la_CXXFLAGS = $(MONO_NATIVE_UNIFIED_CXXFLAGS)
213 libmono_native_unified_la_LDFLAGS = $(MONO_NATIVE_UNIFIED_LDFLAGS)
215 libmono_native_unified_la_CCASFLAGS = $(MONO_NATIVE_UNIFIED_CCASFLAGS)
217 libmono_native_unified_la_LIBADD = $(MONO_NATIVE_LIBADD)
219 test-bundle-local:
220         mkdir -p $(TEST_BUNDLE_PATH)
221         cp -L .libs/libmono-native$(libsuffix) $(TEST_BUNDLE_PATH)/
223 endif # !ENABLE_MSVC_ONLY