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