forked from mono/debugger
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.in
399 lines (355 loc) · 10.7 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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono-debugger, 2.11)
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
bfd_target=x86_64
platform=x86_64
;;
*-*-linux*)
glue_cflags=-D_GNU_SOURCE
server_cflags=-D_GNU_SOURCE
bfd_target=i386linux
platform=i386linux
;;
powerpc-apple-darwin*)
glue_flags=
server_cflags=
bfd_target=powerpc
platform=powerpc
;;
*86-apple-darwin*)
glue_flags=
server_cflags=
server_only=yes
bfd_target=i386darwin
platform=i386darwin
;;
*)
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_X86_MACH, test x$bfd_target = xi386darwin)
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_DARWIN, test x$platform = xi386darwin)
AM_CONDITIONAL(PLATFORM_POWERPC, test x$platform = xpowerpc)
AM_CONDITIONAL(PLATFORM_X86_64, test x$platform = xx86_64)
AC_SUBST(glue_cflags)
AC_SUBST(server_cflags)
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 ${CFLAGS} -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
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)
debugger_major_version=81
min_debugger_minor_version=0
symfile_major_version=50
min_symfile_minor_version=0
AC_MSG_CHECKING([Whether we're using Mono from trunk])
## Check for Mono from trunk
if pkg-config --modversion mono-2>/dev/null; then
have_mono_trunk=true
mono_pc=mono-2
min_debugger_minor_version=6
server_deps="glib-2.0 >= $GLIB_REQUIRED_VERSION $martin_deps"
AC_MSG_RESULT([yes])
else
have_mono_trunk=false
mono_pc=mono
server_deps="$mono_pc >= $MONO_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION $martin_deps"
AC_MSG_RESULT([no])
fi
## Versions of dependencies
PKG_CHECK_MODULES(SERVER_DEPENDENCIES, $server_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)
PKG_CHECK_MODULES(WRAPPER, $mono_pc >= $MONO_REQUIRED_VERSION glib-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
AC_SUBST(GACUTIL)
AC_SUBST(GACUTIL_FLAGS)
AC_SUBST(CFLAGS)
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)
AC_PATH_PROG(MONODIS, monodis)
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
if test "x$MONODIS" = "x" ; then
AC_MSG_ERROR([Can't find "monodis" 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
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"
TARGET_MONODIS="$target_mono_prefix/bin/monodis"
NUNIT_PREFIX="$target_mono_prefix"
NUNIT_VERSION=2.3
else
TARGET_MCS="$MCS"
TARGET_MONO="$MONO"
TARGET_MONODIS="$MONODIS"
## 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(TARGET_MONODIS)
AC_SUBST(NUNIT_PREFIX)
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 fgetln)
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")
#not sure why, but I cannot get this test to pass on OS X.
if test x$platform != xi386darwin ; then
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 != $debugger_major_version
#error "Your mono is too old for this version of the debugger."
#endif
#if MONO_DEBUGGER_MINOR_VERSION < $min_debugger_minor_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
AC_MSG_CHECKING([Whether attaching is supported in this version of the Mono runtime])
old_CFLAGS=$CFLAGS
CFLAGS=$WRAPPER_CFLAGS
#define MONO_DEBUGGER_MAJOR_VERSION 81
#define MONO_DEBUGGER_MINOR_VERSION 3
AC_TRY_COMPILE([#include <mono/metadata/mono-debug.h>
#include <mono/metadata/debug-mono-symfile.h>
], [
#if MONO_DEBUGGER_MAJOR_VERSION < 81
#error "Major version older than 81."
#endif
#if MONO_DEBUGGER_MAJOR_VERSION == 81
#if MONO_DEBUGGER_MINOR_VERSION < 3
#error "Minor version older than 3."
#endif
#endif
], attaching_supported=yes, attaching_supported=no)
AC_MSG_RESULT($attaching_supported)
CFLAGS=$old_CFLAGS
else
attaching_supported=no
fi
AM_CONDITIONAL(ATTACHING_SUPPORTED, test x$attaching_supported = xyes)
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)
if test x$have_mono_trunk = xtrue; then
AC_DEFINE([USING_MONO_FROM_TRUNK], [1], [Whether we're using Mono from trunk])
fi
AM_CONDITIONAL(MONO_TRUNK, test x$have_mono_trunk = xtrue)
AC_OUTPUT([
Makefile
mono-debugger.spec
mono-debugger.pc
mono-debugger-frontend.pc
interface/Makefile
classes/Makefile
build/Makefile
build/Mono.Debugger.dll.config
sysdeps/Makefile
sysdeps/bfd/libiberty/Makefile
sysdeps/bfd/opcodes/Makefile
sysdeps/bfd/Makefile
sysdeps/bfd/hosts/Makefile
sysdeps/bfd/include/Makefile
sysdeps/bfd/include/aout/Makefile
sysdeps/bfd/include/coff/Makefile
sysdeps/bfd/include/elf/Makefile
sysdeps/bfd/include/opcode/Makefile
sysdeps/server/Makefile
backend/Makefile
backend/arch/Makefile
backend/mono/Makefile
backend/os/Makefile
symbolwriter/Makefile
languages/Makefile
languages/mono/Makefile
languages/native/Makefile
frontend/Makefile
frontend/jay/Makefile
test/Makefile
test/src/Makefile
test/misc/Makefile
test/framework/Makefile
test/testsuite/Makefile
doc/Makefile
])