This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
/
configure.in
205 lines (177 loc) · 5.02 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
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono-debugger, 0.2.0)
AM_MAINTAINER_MODE
AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_INSTALL
AC_MSG_CHECKING([host platform characteristics])
case "$host" in
*-*-linux*)
server_sources="i386-linux-ptrace.c i386-linux-ptrace.h"
;;
*-*-freebsd*)
server_sources="i386-freebsd-ptrace.c i386-freebsd-ptrace.h"
;;
*)
AC_MSG_ERROR([*** This platform is not yet supported.])
;;
esac
AC_MSG_RESULT(ok)
AC_SUBST(server_sources)
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)
# 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'
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([if building the GUI is requested])
AC_ARG_ENABLE(gui, [ --disable-gui don't build the GUI], build_gui=$enableval, build_gui=yes)
AC_MSG_RESULT($build_gui)
if test "x$build_gui" = "xyes"; then
BUILD_GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0 libgnome-2.0`
BUILD_GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0 libgnome-2.0`
GUI_TARGETS=Debugger.exe
else
BUILD_GTK_CFLAGS=
BUILD_GTK_LIBS=
GUI_TARGETS=
fi
AC_SUBST(BUILD_GTK_CFLAGS)
AC_SUBST(BUILD_GTK_LIBS)
AC_SUBST(GUI_TARGETS)
AM_CONDITIONAL(BUILD_GUI, test "x$build_gui" = "xyes")
PKG_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_PATH=$PKG_CONFIG_PATH
fi
else
PKG_PATH=$with_crosspkgdir
PKG_CONFIG_PATH=$PKG_PATH
export PKG_CONFIG_PATH
fi
)
## Versions of dependencies
GLIB_REQUIRED_VERSION=2.0.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, glib-2.0 >= $GLIB_REQUIRED_VERSION)
AC_SUBST(SERVER_DEPENDENCIES_CFLAGS)
AC_SUBST(SERVER_DEPENDENCIES_LIBS)
AC_SUBST(CFLAGS)
top_srcdir=`pwd`
AC_SUBST(top_srcdir)
AC_CHECK_HEADER(dis-asm.h,, [AC_MSG_ERROR(
[Can't find <dis-asm.h>, make sure you have binutils-dev >= 2.12 installed.])])
old_LIBS=$LIBS
AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(
[Can't find libbfd, make sure you have binutils-dev >= 2.12 installed.])])
AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(
[Can't find libopcodes, make sure you have binutils >= 2.12 installed.])], -lbfd)
LIBS=$old_LIBS
old_LIBS=$LIBS
LIBS="-lbfd"
AC_MSG_CHECKING(whether we have a shared libbfd.so)
AC_TRY_LINK_FUNC(_sch_istable,,[AC_MSG_ERROR([
*** You libbfd is unusable for the debugger.
*** Please read the binutils and libbfd issues section in README.FreeBSD.])])
LIBS=$old_LIBS
AC_MSG_RESULT(ok)
AC_PATH_PROG(MONO, mono)
AC_PATH_PROG(MCS, mcs)
AC_PATH_PROG(JAY, jay)
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
have_jay=yes
if test "x$JAY" = "x" ; then
have_yay=no
AC_MSG_WARN([Can't find "jay" in your PATH])
fi
AM_CONDITIONAL(HAVE_JAY, test "x$have_jay" = "xyes")
AC_SUBST(PATH)
dnl
dnl See if readline needs -ltermcap
dnl
AC_MSG_CHECKING([if using the readline library is requested])
AC_ARG_ENABLE(readline, [ --disable-readline don't use GNU readline], use_readline=$enableval, use_readline=yes)
AC_MSG_RESULT($use_readline)
if test "x$use_readline" = "xyes"; then
AC_DEFINE(USE_READLINE,1,[Whether to use GNU readline])
old_LIBS=$LIBS
LIBS="-lreadline"
AC_TRY_LINK(,,[
READLINE_DEPLIBS="-lreadline"
],[
LIBS="$LIBS -ltermcap"
AC_TRY_LINK(,,[
READLINE_DEPLIBS="-lreadline -ltermcap"
],[
AC_MSG_ERROR([Cannot figure out how to link with the readline library; see config.log for more information])
])
])
LIBS=$old_LIBS
else
READLINE_DEPLIBS=
fi
AC_SUBST(READLINE_DEPLIBS)
dnl
dnl Quick hack
dnl
monopath=`which mono`
monopathbin=`dirname $monopath`
GTKSHARP_PREFIX=`dirname $monopathbin`
AC_SUBST(GTKSHARP_PREFIX)
AC_OUTPUT([
Makefile
interfaces/Makefile
classes/Makefile
glue/Makefile
lib/Makefile
lib/Debugger.exe.config
lib/Interpreter.exe.config
widgets/Makefile
widgets/gtk/Makefile
widgets/mono.debugger.gui/Makefile
widgets/generator/Makefile
widgets/sources/Makefile
widgets/sources/gtksourceview/Makefile
widgets/sources/debuggerwidgets/Makefile
backends/Makefile
backends/classes/Makefile
backends/server/Makefile
backends/ptrace/Makefile
backends/mono-csharp/Makefile
frontends/Makefile
frontends/scripting/Makefile
frontends/command-line/Makefile
frontends/gui/Makefile
arch/Makefile
test/Makefile
doc/Makefile
])