[runtime] Avoid holding the init lock while calling the cctor in mono_runtime_class_i...
[mono-project.git] / support / Makefile.am
blob969ff60e4db002c8b5abe4f7360b1b48a6add11b
1 if HOST_WIN32
2 SUPPORT=
3 else
4 SUPPORT=libMonoSupportW.la
5 endif
6 lib_LTLIBRARIES =                               \
7         libMonoPosixHelper.la                   \
8         $(SUPPORT)
10 AM_CPPFLAGS =                                   \
11         $(GLIB_CFLAGS)                          \
12         -I$(top_srcdir)
14 # Source code which helps implement the ANSI C standards, and thus *should* be
15 # portable to any platform having a C compiler.
16 MPH_C_SOURCE =                                  \
17         errno.c                                 \
18         map.c                                   \
19         map.h                                   \
20         mph.h                                   \
21         signal.c                                \
22         stdio.c                                 \
23         string.c                                        \
24         stdlib.c
26 # Source code which helps implement POSIX and other related Unix standards,
27 # and *may* be portable between Unix platforms.
28 MPH_UNIX_SOURCE =                               \
29         dirent.c                                \
30         fcntl.c                                 \
31         fstab.c                                 \
32         grp.c                                   \
33         macros.c                                \
34         nl.c                                    \
35         nl.h                                    \
36         old-map.c                               \
37         old-map.h                               \
38         pwd.c                                   \
39         serial.c                                \
40         sys-mman.c                              \
41         sys-sendfile.c                          \
42         sys-socket.c                            \
43         sys-stat.c                              \
44         sys-statvfs.c                           \
45         sys-time.c                              \
46         sys-uio.c                               \
47         sys-uio.h                               \
48         sys-utsname.c   \
49         sys-wait.c                              \
50         sys-xattr.c                             \
51         syslog.c                                \
52         time.c                                  \
53         unistd.c                                \
54         utime.c                                 \
55         x-struct-str.c
57 if HOST_WIN32
58 MPH_SOURCE = $(MPH_C_SOURCE)
59 MPH_LIBS   = $(GLIB_LIBS) $(LIBICONV)
60 else
61 MPH_SOURCE = $(MPH_C_SOURCE) $(MPH_UNIX_SOURCE)
62 MPH_LIBS   = $(GLIB_LIBS) $(LIBICONV)
63 endif
65 MINIZIP_SOURCE = \
66         minizip/crypt.h \
67         minizip/ioapi.c \
68         minizip/ioapi.h \
69         minizip/unzip.c \
70         minizip/unzip.h \
71         minizip/zip.c   \
72         minizip/zip.h
74 ZLIB_SOURCES = \
75         adler32.c       \
76         compress.c      \
77         crc32.c         \
78         uncompr.c       \
79         deflate.c       \
80         trees.c         \
81         zutil.c         \
82         inflate.c       \
83         infback.c       \
84         inftrees.c      \
85         inffast.c       \
86         crc32.h         \
87         deflate.h       \
88         inffast.h       \
89         inffixed.h      \
90         inflate.h       \
91         inftrees.h      \
92         trees.h         \
93         zconf.h         \
94         zlib.h          \
95         zutil.h
97 if HAVE_ZLIB
98 Z_SOURCE = zlib-helper.c
99 Z_LIBS= -lz
100 else
101 Z_SOURCE = zlib-helper.c $(ZLIB_SOURCES)
102 Z_LIBS=
103 endif
105 libMonoPosixHelper_la_SOURCES =                 \
106         $(MPH_SOURCE)                           \
107         $(Z_SOURCE)                             \
108         $(MINIZIP_SOURCE)
110 libMonoPosixHelper_la_LIBADD =                  \
111         $(MPH_LIBS)                             \
112         $(Z_LIBS)                               \
113         $(XATTR_LIB)
115 # libMonoPosixHelper_la_LDFLAGS = -no-undefined -version-info 1:0:1
116 libMonoPosixHelper_la_LDFLAGS = -no-undefined -avoid-version
117 libMonoSupportW_la_LDFLAGS = -no-undefined -avoid-version
119 libMonoSupportW_la_SOURCES =                    \
120                 supportw.c                      \
121                 support-heap.c                  \
122                 supportw.h
124 libMonoSupportW_la_LIBADD =                     \
125                 $(GLIB_LIBS) $(LIBICONV)
128 # Use this target to refresh the values in map.[ch]
130 refresh:
131         cp `pkg-config --variable=Programs create-native-map` . && \
132         $(top_builddir)/runtime/mono-wrapper create-native-map.exe \
133         --autoconf-member=d_off                               \
134         --autoconf-member=d_reclen                            \
135         --autoconf-member=d_type                              \
136         --exclude-native-symbol=Mono_Posix_Stdlib_snprintf    \
137         --impl-macro=_GNU_SOURCE --impl-macro=_XOPEN_SOURCE   \
138         --impl-header="<sys/types.h>"                         \
139         --impl-header="<sys/stat.h>"                          \
140         --autoconf-header="<netinet/in.h>"                    \
141         --autoconf-header="<sys/time.h>"                      \
142         --autoconf-header="<sys/poll.h>"                      \
143         --autoconf-header="<sys/wait.h>"                      \
144         --autoconf-header="<sys/statvfs.h>"                   \
145         --autoconf-header="<sys/xattr.h>"                     \
146         --autoconf-header="<sys/mman.h>"                      \
147         --autoconf-header="<sys/socket.h>"                    \
148         --autoconf-header="<sys/uio.h>"                       \
149         --autoconf-header="<unistd.h>"                        \
150         --impl-header="<fcntl.h>"                             \
151         --impl-header="<signal.h>"                            \
152         --autoconf-header="<poll.h>"                          \
153         --autoconf-header="<grp.h>"                           \
154         --impl-header="<errno.h>"                             \
155         --autoconf-header="<syslog.h>"                        \
156         --autoconf-header="<dirent.h>"                        \
157         --autoconf-header="<utime.h>"                         \
158         --impl-header="<time.h>"                              \
159         --impl-header="\"mph.h\""                             \
160         --rename-member=st_atime=st_atime_                    \
161         --rename-member=st_ctime=st_ctime_                    \
162         --rename-member=st_mtime=st_mtime_                    \
163         --rename-namespace=Mono.Unix.Native=Mono.Posix        \
164         --library=MonoPosixHelper                             \
165         $(mcs_topdir_from_srcdir)/class/lib/net_4_x/Mono.Posix.dll map
167 # Useful if mono is compiled with --enable-shared=no
168 patch-libtool:
169         cp "../libtool" .
170         sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
171         echo "LIBTOOL = bash ./libtool" > 1
172         echo "LTCOMPILE = bash ./libtool --mode=compile $(COMPILE)" >> 1
173         sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2
174         sed -e 's,LTCOMPILE =,LTCOMPILE2 =,g' 2 > 3
175         cat 1 3 > Makefile
176         touch *.c