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