Fix the System.String.Replace throwing NotImplementedException (#20960) (#20978)
[mono-project.git] / support / Makefile.am
blobd660025af8ff27ed7ae6f849181fe18cda1be00a
1 if !ENABLE_MSVC_ONLY
2 if HOST_WIN32
3 SUPPORT=
4 else
5 SUPPORT=libMonoSupportW.la
6 endif
8 if BUILD_SUPPORT
9 lib_LTLIBRARIES =                               \
10         libMonoPosixHelper.la                   \
11         $(SUPPORT)
12 endif
14 AM_CPPFLAGS =                                   \
15         @ZLIB_CFLAGS@                           \
16         $(GLIB_CFLAGS)                          \
17         -I$(top_srcdir)
19 glib_libs = $(top_builddir)/mono/eglib/libeglib.la
21 # Source code which helps implement the ANSI C standards, and thus *should* be
22 # portable to any platform having a C compiler.
23 MPH_C_SOURCE =                                  \
24         errno.c                                 \
25         map.c                                   \
26         map.h                                   \
27         map-impl.h                              \
28         mph.h                                   \
29         signal.c                                \
30         stdio.c                                 \
31         string.c                                        \
32         stdlib.c
34 # Source code which helps implement POSIX and other related Unix standards,
35 # and *may* be portable between Unix platforms.
36 MPH_UNIX_SOURCE =                               \
37         dirent.c                                \
38         fcntl.c                                 \
39         fstab.c                                 \
40         grp.c                                   \
41         macros.c                                \
42         nl.c                                    \
43         nl.h                                    \
44         old-map.c                               \
45         old-map.h                               \
46         pwd.c                                   \
47         serial.c                                \
48         sys-mman.c                              \
49         sys-sendfile.c                          \
50         sys-socket.c                            \
51         sys-stat.c                              \
52         sys-statvfs.c                           \
53         sys-time.c                              \
54         sys-uio.c                               \
55         sys-uio.h                               \
56         sys-utsname.c   \
57         sys-wait.c                              \
58         sys-xattr.c                             \
59         syslog.c                                \
60         time.c                                  \
61         unistd.c                                \
62         utime.c                                 \
63         x-struct-str.c
65 if HOST_WIN32
66 MPH_SOURCE = $(MPH_C_SOURCE)
67 MPH_LIBS   = $(glib_libs)
68 else
69 MPH_SOURCE = $(MPH_C_SOURCE) $(MPH_UNIX_SOURCE)
70 MPH_LIBS   = $(glib_libs)
71 endif
73 MINIZIP_SOURCE = \
74         minizip/crypt.h \
75         minizip/ioapi.c \
76         minizip/ioapi.h \
77         minizip/unzip.c \
78         minizip/unzip.h \
79         minizip/zip.c   \
80         minizip/zip.h
82 BUNDLE_ZLIB_PATH=$(top_builddir)/mono/zlib/libz.la
83 Z_SOURCE=zlib-helper.c
85 if HAVE_STATIC_ZLIB
86 Z_LIBS=$(STATIC_ZLIB_PATH)
87 else
88 if HAVE_SYS_ZLIB
89 Z_LIBS=-lz
90 else
91 Z_LIBS=$(BUNDLE_ZLIB_PATH)
92 endif
93 endif
95 libMonoPosixHelper_la_SOURCES =                 \
96         $(MPH_SOURCE)                           \
97         $(Z_SOURCE)                             \
98         $(MINIZIP_SOURCE)
100 libMonoPosixHelper_la_LIBADD =                  \
101         $(MPH_LIBS)                             \
102         $(Z_LIBS)                               \
103         $(XATTR_LIB)
105 # libMonoPosixHelper_la_LDFLAGS = -no-undefined -version-info 1:0:1
106 libMonoPosixHelper_la_LDFLAGS = -no-undefined -avoid-version
107 libMonoSupportW_la_LDFLAGS = -no-undefined -avoid-version
109 libMonoSupportW_la_SOURCES =                    \
110                 supportw.c                      \
111                 support-heap.c                  \
112                 supportw.h
114 libMonoSupportW_la_LIBADD =                     \
115                 $(glib_libs)
117 test-bundle-local:
118         mkdir -p $(TEST_BUNDLE_PATH)
119         cp -L .libs/libMonoPosixHelper$(libsuffix) $(TEST_BUNDLE_PATH)/
122 # Use this target to refresh the values in map.[ch]
124 refresh:
125         cp `pkg-config --variable=Programs create-native-map` . && \
126         $(top_builddir)/runtime/mono-wrapper create-native-map.exe \
127         --autoconf-member=d_off                               \
128         --autoconf-member=d_reclen                            \
129         --autoconf-member=d_type                              \
130         --exclude-native-symbol=Mono_Posix_Stdlib_snprintf    \
131         --impl-macro=_GNU_SOURCE --impl-macro=_XOPEN_SOURCE   \
132         --impl-header="<sys/types.h>"                         \
133         --impl-header="<sys/stat.h>"                          \
134         --autoconf-header="<netinet/in.h>"                    \
135         --autoconf-header="<sys/time.h>"                      \
136         --autoconf-header="<sys/poll.h>"                      \
137         --autoconf-header="<sys/wait.h>"                      \
138         --autoconf-header="<sys/statvfs.h>"                   \
139         --autoconf-header="<sys/xattr.h>"                     \
140         --autoconf-header="<sys/mman.h>"                      \
141         --autoconf-header="<sys/socket.h>"                    \
142         --autoconf-header="<sys/uio.h>"                       \
143         --autoconf-header="<unistd.h>"                        \
144         --impl-header="<fcntl.h>"                             \
145         --impl-header="<signal.h>"                            \
146         --autoconf-header="<poll.h>"                          \
147         --autoconf-header="<grp.h>"                           \
148         --impl-header="<errno.h>"                             \
149         --autoconf-header="<syslog.h>"                        \
150         --autoconf-header="<dirent.h>"                        \
151         --autoconf-header="<utime.h>"                         \
152         --impl-header="<time.h>"                              \
153         --impl-header="\"mph.h\""                             \
154         --impl-header="\"map-impl.h\""                        \
155         --rename-member=st_atime=st_atime_                    \
156         --rename-member=st_ctime=st_ctime_                    \
157         --rename-member=st_mtime=st_mtime_                    \
158         --rename-namespace=Mono.Unix.Native=Mono.Posix        \
159         --library=MonoPosixHelper                             \
160         $(mcs_topdir_from_srcdir)/class/lib/net_4_x/Mono.Posix.dll map
162 # Useful if mono is compiled with --enable-shared=no
163 patch-libtool:
164         cp "../libtool" .
165         sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
166         echo "LIBTOOL = bash ./libtool" > 1
167         echo "LTCOMPILE = bash ./libtool --mode=compile $(COMPILE)" >> 1
168         sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2
169         sed -e 's,LTCOMPILE =,LTCOMPILE2 =,g' 2 > 3
170         cat 1 3 > Makefile
171         touch *.c
173 endif # !ENABLE_MSVC_ONLY
175 if ENABLE_MSVC_ONLY
177 all-local:
179         make -C $(top_srcdir)/msvc libmonoposixhelper
181 clean-local:
183         make -C $(top_srcdir)/msvc clean-libmonoposixhelper
185 endif # ENABLE_MSVC_ONLY