-
Notifications
You must be signed in to change notification settings - Fork 61
/
configure.ac
161 lines (137 loc) · 4.01 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(manos, 0.1.3)
AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_LIBTOOL
dnl pkg-config
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
AC_MSG_ERROR([You need to install pkg-config])
fi
dnl C# compiler
AC_PATH_PROG(DMCS, dmcs, no)
CS="C#"
if test "x$DMCS" = "xno" ; then
dnl AC_MSG_ERROR([You need to install a C# compiler])
AC_MSG_ERROR([No $CS compiler (dmcs) found])
fi
AC_SUBST(DMCS)
AC_PATH_PROG(XBUILD, xbuild, no)
if test "x$XBUILD" = "xno" ; then
AC_MSG_ERROR([No xbuild found])
fi
AC_SUBST(XBUILD)
m4_include([m4/pkg.m4])
AC_ARG_WITH([gnutls],
[AS_HELP_STRING([--with-gnutls],
[support SSL/TLS with GnuTLS @<:@default: check@:>@])],
[],
[with_gnutls=check])
AS_IF([test "x$with_gnutls" = xyes],
[AC_CHECK_LIB([gnutls], [gnutls_global_init],
[AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define if you have libgnutls])
PKG_CHECK_MODULES([GNUTLS], [gnutls >= 2.8])
],
[if test "x$with_gnutls" != xcheck; then
AC_MSG_FAILURE([--with-gnutls was given, but test for gnutls failed])
fi],
[])])
AC_ARG_ENABLE([native-io],
[AS_HELP_STRING([--disable-native-io],
[disable support for native IO backends in Manos.IO])],
[IO_COMPILE_FLAGS=FORCE_MANAGED_IO],
[IO_COMPILE_FLAGS=])
AC_SUBST(IO_COMPILE_FLAGS)
AC_DEFINE([PTHREAD_POINTER_ID], [], [Description])
dnl ******************************************************************
dnl *** Check for large file support ***
dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
dnl ******************************************************************
# Check that off_t can represent 2**63 - 1 correctly, working around
# potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
# CPPFLAGS and sets $large_offt to yes if the test succeeds
large_offt=no
AC_DEFUN([LARGE_FILES], [
large_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $1"
AC_TRY_RUN([
#include <sys/types.h>
#define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
int main(void) {
int big_off_t=((BIG_OFF_T%2147483629==721) &&
(BIG_OFF_T%2147483647==1));
if(big_off_t) {
exit(0);
} else {
exit(1);
}
}
], [
AC_MSG_RESULT(ok)
AC_DEFINE(HAVE_LARGE_FILE_SUPPORT, 1, [Have large file support])
large_CPPFLAGS="$large_CPPFLAGS $1"
large_offt=yes
], [
AC_MSG_RESULT(no)
], "")
CPPFLAGS=$large_CPPFLAGS
])
AC_MSG_CHECKING(if off_t is 64 bits wide)
LARGE_FILES("")
if test $large_offt = no; then
AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
LARGE_FILES("-D_FILE_OFFSET_BITS=64")
fi
if test $large_offt = no; then
AC_MSG_WARN([No 64 bit file size support available])
fi
case "$host" in
*-*-linux*)
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
if test "x$disable_munmap" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
;;
*-*-darwin*)
platform_darwin=yes
CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP"
LDFLAGS="$LDFLAGS -pthread"
need_link_unlink=yes
AC_DEFINE(USE_MACH_SEMA, 1, [...])
has_dtrace=yes
if test "x$cross_compiling" = "xyes"; then
has_broken_apple_cpp=yes
fi
BROKEN_DARWIN_FLAGS="-arch i386 -D_XOPEN_SOURCE -mmacosx-version-min=10.5"
CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_FLAGS"
CFLAGS="$CFLAGS $BROKEN_DARWIN_FLAGS"
CXXFLAGS="$CXXFLAGS $BROKEN_DARWIN_FLAGS"
CCASFLAGS="$CCASFLAGS $BROKEN_DARWIN_FLAGS"
;;
esac
m4_include([src/libeio/libeio.m4])
m4_include([src/libev/libev.m4])
AC_CONFIG_HEADERS([src/libev/config.h])
AC_CONFIG_HEADERS([src/libeio/config.h])
AC_CONFIG_HEADERS([src/libmanos/config.h])
AC_OUTPUT([
Makefile
docs/Makefile
man/Makefile
scripts/Makefile
scripts/manos
data/Makefile
data/manos.pc
src/Makefile
src/Manos/Makefile
src/Manos/Assembly/AssemblyInfo.cs
src/Manos.IO/Makefile
src/Manos.IO/Assembly/AssemblyInfo.cs
src/manostool/Makefile
src/manostool/AssemblyInfo.cs
src/libev/Makefile
src/libeio/Makefile
src/libmanos/Makefile
])