[Mono.Posix] Add wrappers for struct sockaddr_*
[mono.git] / support / Makefile.am
1 if HOST_WIN32
2 SUPPORT=
3 else
4 SUPPORT=libMonoSupportW.la
5 endif
6 lib_LTLIBRARIES =                               \
7         libMonoPosixHelper.la                   \
8         $(SUPPORT)
9
10 AM_CPPFLAGS =                                   \
11         $(GLIB_CFLAGS)                          \
12         -I$(top_srcdir)
13
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
25
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-utsname.c   \
48         sys-wait.c                              \
49         sys-xattr.c                             \
50         syslog.c                                \
51         time.c                                  \
52         unistd.c                                \
53         utime.c                                 \
54         x-struct-str.c
55
56 if HOST_WIN32
57 MPH_SOURCE = $(MPH_C_SOURCE)
58 MPH_LIBS   = $(GLIB_LIBS) $(LIBICONV)
59 else
60 MPH_SOURCE = $(MPH_C_SOURCE) $(MPH_UNIX_SOURCE)
61 MPH_LIBS   = $(GLIB_LIBS) $(LIBICONV)
62 endif
63
64 MINIZIP_SOURCE = \
65         minizip/crypt.h \
66         minizip/ioapi.c \
67         minizip/ioapi.h \
68         minizip/unzip.c \
69         minizip/unzip.h \
70         minizip/zip.c   \
71         minizip/zip.h
72
73 ZLIB_SOURCES = \
74         adler32.c       \
75         compress.c      \
76         crc32.c         \
77         uncompr.c       \
78         deflate.c       \
79         trees.c         \
80         zutil.c         \
81         inflate.c       \
82         infback.c       \
83         inftrees.c      \
84         inffast.c       \
85         crc32.h         \
86         deflate.h       \
87         inffast.h       \
88         inffixed.h      \
89         inflate.h       \
90         inftrees.h      \
91         trees.h         \
92         zconf.h         \
93         zlib.h          \
94         zutil.h
95
96 if HAVE_ZLIB
97 Z_SOURCE = zlib-helper.c
98 Z_LIBS= -lz
99 else
100 Z_SOURCE = zlib-helper.c $(ZLIB_SOURCES)
101 Z_LIBS=
102 endif
103
104 libMonoPosixHelper_la_SOURCES =                 \
105         $(MPH_SOURCE)                           \
106         $(Z_SOURCE)                             \
107         $(MINIZIP_SOURCE)
108
109 libMonoPosixHelper_la_LIBADD =                  \
110         $(MPH_LIBS)                             \
111         $(Z_LIBS)                               \
112         $(XATTR_LIB)
113
114 # libMonoPosixHelper_la_LDFLAGS = -no-undefined -version-info 1:0:1
115 libMonoPosixHelper_la_LDFLAGS = -no-undefined -avoid-version
116 libMonoSupportW_la_LDFLAGS = -no-undefined -avoid-version
117
118 libMonoSupportW_la_SOURCES =                    \
119                 supportw.c                      \
120                 support-heap.c                  \
121                 supportw.h
122
123 libMonoSupportW_la_LIBADD =                     \
124                 $(GLIB_LIBS) $(LIBICONV)
125
126
127 # Use this target to refresh the values in map.[ch]
128 #
129 refresh:
130         cp `pkg-config --variable=Programs create-native-map` . && \
131         $(top_builddir)/runtime/mono-wrapper create-native-map.exe \
132         --autoconf-member=d_off                               \
133         --autoconf-member=d_reclen                            \
134         --autoconf-member=d_type                              \
135         --exclude-native-symbol=Mono_Posix_Stdlib_snprintf    \
136         --impl-macro=_GNU_SOURCE --impl-macro=_XOPEN_SOURCE   \
137         --impl-header="<sys/types.h>"                         \
138         --impl-header="<sys/stat.h>"                          \
139         --autoconf-header="<netinet/in.h>"                    \
140         --autoconf-header="<sys/time.h>"                      \
141         --autoconf-header="<sys/poll.h>"                      \
142         --autoconf-header="<sys/wait.h>"                      \
143         --autoconf-header="<sys/statvfs.h>"                   \
144         --autoconf-header="<sys/xattr.h>"                     \
145         --autoconf-header="<sys/mman.h>"                      \
146         --autoconf-header="<sys/socket.h>"                    \
147         --autoconf-header="<sys/uio.h>"                       \
148         --autoconf-header="<unistd.h>"                        \
149         --impl-header="<fcntl.h>"                             \
150         --impl-header="<signal.h>"                            \
151         --autoconf-header="<poll.h>"                          \
152         --autoconf-header="<grp.h>"                           \
153         --impl-header="<errno.h>"                             \
154         --autoconf-header="<syslog.h>"                        \
155         --autoconf-header="<dirent.h>"                        \
156         --autoconf-header="<utime.h>"                         \
157         --impl-header="<time.h>"                              \
158         --impl-header="\"mph.h\""                             \
159         --rename-member=st_atime=st_atime_                    \
160         --rename-member=st_ctime=st_ctime_                    \
161         --rename-member=st_mtime=st_mtime_                    \
162         --rename-namespace=Mono.Unix.Native=Mono.Posix        \
163         --library=MonoPosixHelper                             \
164         $(mcs_topdir_from_srcdir)/class/lib/net_4_x/Mono.Posix.dll map
165
166 # Useful if mono is compiled with --enable-shared=no
167 patch-libtool:
168         cp "../libtool" .
169         sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
170         echo "LIBTOOL = bash ./libtool" > 1
171         echo "LTCOMPILE = bash ./libtool --mode=compile $(COMPILE)" >> 1
172         sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2
173         sed -e 's,LTCOMPILE =,LTCOMPILE2 =,g' 2 > 3
174         cat 1 3 > Makefile
175         touch *.c