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