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