This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
/
configure.in
364 lines (318 loc) · 9.48 KB
/
configure.in
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono-debugger, 2.2)
AM_MAINTAINER_MODE
AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_INSTALL
build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
AC_ARG_ENABLE(build-warnings,
[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
[case "${enableval}" in
yes) ;;
no) build_warnings="-w";;
,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
build_warnings="${build_warnings} ${t}";;
*,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
build_warnings="${t} ${build_warnings}";;
*) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
esac
if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
echo "Setting warning flags = $build_warnings" 6>&1
fi])dnl
WARN_CFLAGS=""
if test "x${build_warnings}" != x && test "x$GCC" = xyes ; then
WARN_CFLAGS="${build_warnings}"
fi
AC_SUBST(WARN_CFLAGS)
AC_MSG_CHECKING([host platform characteristics])
case "$host" in
x86_64-*-linux*)
glue_cflags=-D_GNU_SOURCE
server_cflags=-D_GNU_SOURCE
server_only=no
bfd_target=x86_64
platform=x86_64
;;
*-*-linux*)
glue_cflags=-D_GNU_SOURCE
server_cflags=-D_GNU_SOURCE
server_only=no
bfd_target=i386linux
platform=i386linux
;;
powerpc-apple-darwin*)
glue_flags=
server_cflags=
server_only=yes
bfd_target=powerpc
platform=powerpc
;;
*)
AC_MSG_ERROR([*** This platform is not yet supported.])
;;
esac
AC_MSG_RESULT(ok)
AC_ARG_WITH(bfd-target,
[ --with-bfd-target Manually override the BFD target],
if test x$with_bfd_target != "x"; then
bfd_target=$with_bfd_target
fi
)
AM_CONDITIONAL(BFD_TARGET_POWERPC, test x$bfd_target = xpowerpc)
AM_CONDITIONAL(BFD_TARGET_X86_64, test x$bfd_target = xx86_64)
AM_CONDITIONAL(PLATFORM_X86_64, test x$platform = xx86_64)
AM_CONDITIONAL(PLATFORM_POWERPC, test x$platform = xpowerpc)
AC_SUBST(glue_cflags)
AC_SUBST(server_cflags)
#if test x$platform = xi386linux -a x$server_only != xyes; then
# LINUX_NPTL_CHECK
#fi
dnl may require a specific autoconf version
dnl AC_PROG_CC_FOR_BUILD
dnl CC_FOR_BUILD not automatically detected
CC_FOR_BUILD=$CC
BUILD_EXEEXT=
if test "x$cross_compiling" = "xyes"; then
CC_FOR_BUILD=cc
BUILD_EXEEXT=""
fi
AC_SUBST(CC_FOR_BUILD)
AC_SUBST(HOST_CC)
AC_SUBST(BUILD_EXEEXT)
dnl These must be called before AM_PROG_LIBTOOL, because it may want
dnl to call AC_CHECK_PROG.
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
# Set STDC_HEADERS
AC_HEADER_STDC
AM_PROG_LIBTOOL
# not 64 bit clean in cross-compile
AC_CHECK_SIZEOF(void *, 4)
CFLAGS='-g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wshadow -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings -fno-strict-aliasing'
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
AC_MSG_CHECKING([whether we're compiling from SVN])
if test -f "$srcdir/.svn_version" ; then
from_svn=yes
else
from_svn=no
fi
AC_MSG_RESULT($from_svn)
AM_CONDITIONAL(COMPILING_FROM_SVN, test x$from_svn = xyes)
pkg_config_path=
AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir],
if test x$with_crosspkgdir = "x"; then
if test -s $PKG_CONFIG_PATH; then
pkg_config_path=$PKG_CONFIG_PATH
fi
else
pkg_config_path=$with_crosspkgdir
PKG_CONFIG_PATH=$pkg_config_path
export PKG_CONFIG_PATH
fi
)
## Versions of dependencies
GLIB_REQUIRED_VERSION=2.0.0
MONO_REQUIRED_VERSION=2.0
XSP_REQUIRED_VERSION=2.0
PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
AC_SUBST(BASE_DEPENDENCIES_CFLAGS)
AC_SUBST(BASE_DEPENDENCIES_LIBS)
## Versions of dependencies
PKG_CHECK_MODULES(SERVER_DEPENDENCIES, mono >= $MONO_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION $martin_deps)
AC_SUBST(SERVER_DEPENDENCIES_CFLAGS)
AC_SUBST(SERVER_DEPENDENCIES_LIBS)
## Check Cecil
if pkg-config --modversion cecil>/dev/null; then
AC_MSG_RESULT("Found cecil.pc")
else
AC_MSG_ERROR([You are missing Cecil (cecil.pc for packageconfig)])
fi
CECIL_ASM=`pkg-config --variable=Libraries cecil`
AC_SUBST(CECIL_ASM)
if test x$server_only != xyes ; then
PKG_CHECK_MODULES(WRAPPER, mono >= $MONO_REQUIRED_VERSION gthread-2.0 >= $GLIB_REQUIRED_VERSION)
AC_SUBST(WRAPPER_CFLAGS)
AC_SUBST(WRAPPER_LIBS)
GACUTIL_FLAGS='/package $(PACKAGE) /gacdir $(prefix)/lib /root $(DESTDIR)$(prefix)/lib'
AC_PATH_PROG(GACUTIL, gacutil, no)
if test "x$GACUTIL" = "xno" ; then
AC_MSG_ERROR([No gacutil tool found])
fi
else
GACUTIL_FLAGS=
fi
AC_SUBST(GACUTIL)
AC_SUBST(GACUTIL_FLAGS)
AC_SUBST(CFLAGS)
if test x$server_only != xyes; then
mono_prefix="`$PKG_CONFIG --variable=prefix mono`"
monodoc_prefix="`$PKG_CONFIG --variable=prefix monodoc`"
AC_SUBST(mono_prefix)
AC_SUBST(monodoc_prefix)
AC_PATH_PROG(MONO, mono)
AC_PATH_PROG(MCS, gmcs)
if test "x$MONO" = "x" ; then
AC_MSG_ERROR([Can't find "mono" in your PATH])
fi
if test "x$MCS" = "x" ; then
AC_MSG_ERROR([Can't find "mcs" in your PATH])
fi
AC_PATH_PROG(NUNIT_CONSOLE, nunit-console2)
if test "x$NUNIT_CONSOLE" = "x" ; then
AC_MSG_ERROR([Can't find "nunit-console2" in your PATH])
fi
fi
target_mono_prefix="$prefix"
AC_ARG_WITH(target-mono,
[ --with-target-mono Manually override the Mono used for target applications],
if test "x$with_target_mono" != "x"; then
target_mono_prefix=$with_target_mono
have_target_mono=yes
fi
)
AC_SUBST(target_mono_prefix)
AM_CONDITIONAL(HAVE_TARGET_MONO, test "x$have_target_mono" = "xyes")
if test "x$have_target_mono" = "xyes" ; then
TARGET_MCS="$target_mono_prefix/bin/gmcs"
TARGET_MONO="$target_mono_prefix/bin/mono"
NUNIT_PREFIX="$target_mono_prefix"
NUNIT_VERSION=2.3
else
TARGET_MCS="$MCS"
TARGET_MONO="$MONO"
## Check NUnit
if pkg-config --modversion mono-nunit>/dev/null; then
AC_MSG_RESULT("Found mono-nunit.pc")
else
AC_MSG_ERROR([Cannot find mono-nunit (mono-unit.pc for packageconfig)])
fi
NUNIT_PREFIX=`pkg-config --variable=prefix mono-nunit`
NUNIT_VERSION=`pkg-config --modversion mono-nunit`
fi
NUNIT_PREFIX=`cd $NUNIT_PREFIX && pwd`
AC_SUBST(TARGET_MCS)
AC_SUBST(TARGET_MONO)
AC_SUBST(NUNIT_PREFIX)
have_nunit_2_3=false
if test "x$NUNIT_VERSION" = "x2.3" ; then
have_nunit_2_3=true
elif test "x$NUNIT_VERSION" = "x2.4" ; then
have_nunit_2_3=true
elif test "x$NUNIT_VERSION" = "x2.5" ; then
have_nunit_2_3=true
fi
AM_CONDITIONAL(HAVE_NUNIT_2_3, test "x$have_nunit_2_3" = "xtrue")
real_top_srcdir=`pwd`
AC_SUBST(real_top_srcdir)
AC_SUBST(PATH)
AC_SUBST(LD_LIBRARY_PATH)
dnl
dnl BFD checks
dnl
if test `uname -s` = "Darwin"; then
LIB_PREFIX=
LIB_SUFFIX=.dylib
else
LIB_PREFIX=.so
LIB_SUFFIX=
fi
AC_SUBST(LIB_PREFIX)
AC_SUBST(LIB_SUFFIX)
AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
AC_CHECK_HEADERS(fcntl.h sys/user.h sys/file.h sys/time.h termcap.h termcap/termcap.h)
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
AC_CHECK_FUNCS(strlcpy strlcat)
CHECK_READLINE
min_mono_version=72
symfile_major_version=50
min_symfile_minor_version=0
AC_ARG_WITH(xsp,
[ --with-xsp Enable XSP support (experimental)],
with_xsp=yes, with_xsp=no)
if test "x$with_xsp" = "xyes" ; then
PKG_CHECK_MODULES(XSP, xsp-2 >= $XSP_REQUIRED_VERSION)
XSP_EXE="`$PKG_CONFIG --variable=Executable xsp-2`"
else
XSP_EXE=
XSP_CFLAGS=
XSP_LIBS=
fi
AC_SUBST(XSP_EXE)
AC_SUBST(XSP_CFLAGS)
AC_SUBST(XSP_LIBS)
AM_CONDITIONAL(HAVE_XSP, test "x$with_xsp" = "xyes")
AC_MSG_CHECKING([Whether your Mono is working])
old_CFLAGS=$cflags
CFLAGS=$WRAPPER_CFLAGS
AC_TRY_COMPILE([#include <mono/metadata/mono-debug.h>
#include <mono/metadata/debug-mono-symfile.h>
], [
#if MONO_DEBUGGER_MAJOR_VERSION < $min_mono_version
#error "Your mono is too old for this version of the debugger."
#endif
#if MONO_SYMBOL_FILE_MAJOR_VERSION != $symfile_major_version
#error "Your mono is too old for this version of the debugger."
#endif
#if MONO_SYMBOL_FILE_MINOR_VERSION < $min_symfile_minor_version
#error "Your mono is too old for this version of the debugger."
#endif
], mono_working=yes, mono_working=no)
AC_MSG_RESULT($mono_working)
CFLAGS=$old_CFLAGS
if test x$mono_working != xyes; then
AC_MSG_ERROR([*** Your Mono is too old for this version of the debugger.])
fi
martin_private=no
if test "x$from_svn" = "xyes"; then
if test x`hostname --fqdn` = x'gondor.trier.ximian.com'; then
if test x"$prefix" == "x/work/gondor/INSTALL" ; then
echo "Experimental features are disabled in the Gondor tree."
else
echo "Enabling experimental features."
martin_private=yes
fi
fi
fi
AM_CONDITIONAL(MARTIN_PRIVATE, test x$martin_private = xyes)
AM_CONDITIONAL(DISABLED, false)
AC_OUTPUT([
Makefile
mono-debugger.pc
mono-debugger-frontend.pc
interface/Makefile
classes/Makefile
build/Makefile
build/Mono.Debugger.dll.config
backend/Makefile
backend/server/Makefile
backend/arch/Makefile
backend/arch/libiberty/Makefile
backend/arch/opcodes/Makefile
backend/arch/bfd/Makefile
backend/arch/bfd/hosts/Makefile
backend/arch/bfd/include/Makefile
backend/arch/bfd/include/aout/Makefile
backend/arch/bfd/include/coff/Makefile
backend/arch/bfd/include/elf/Makefile
backend/arch/bfd/include/opcode/Makefile
symbolwriter/Makefile
languages/Makefile
languages/mono/Makefile
languages/native/Makefile
frontend/Makefile
frontend/jay/Makefile
frontend/libedit/Makefile
test/Makefile
test/src/Makefile
test/misc/Makefile
test/testsuite/Makefile
doc/Makefile
])