Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

321 lines (272 sloc) 7.767 kB
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono-debugger, 0.8)
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
*-*-linux*)
glue_cflags=
server_cflags=
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(PLATFORM_POWERPC, test x$platform = xpowerpc)
AC_SUBST(glue_cflags)
AC_SUBST(server_cflags)
if test x$server_only != xyes; then
old_LIBS=$LIBS
LIBS="$LIBS -lpthread"
AC_MSG_CHECKING(for NPTL support)
AC_RUN_IFELSE([
#include <stdio.h>
#include <errno.h>
#include <wait.h>
#include <semaphore.h>
#include <pthread.h>
#include <sys/ptrace.h>
static pid_t child_pid;
static sem_t start_sem;
static sem_t finished_sem;
static int ok = 0;
static int
thread_func (void *data)
{
int ret, status;
// Wait until main thread forked.
sem_wait (&start_sem);
ret = waitpid (-1, &status, WUNTRACED | __WALL);
if (ret == child_pid) {
fprintf (stderr, "OK\n");
ok = 1;
} else {
fprintf (stderr, "Result: %d - %x - %s\n", ret, status, strerror (errno));
ok = 0;
}
sem_post (&finished_sem);
exit (!ok);
}
int
main (void)
{
pthread_t thread;
sem_init (&start_sem, 1, 0);
sem_init (&finished_sem, 1, 0);
// First, we create a thread.
pthread_create (&thread, NULL, thread_func, NULL);
// Now let's fork a child and trace it.
child_pid = fork ();
if (!child_pid) {
ptrace (PTRACE_TRACEME, 0, NULL, NULL);
asm ("int \$03");
}
// Ok, child created. Now let our sibling thread wait for it.
sem_post (&start_sem);
sem_wait (&finished_sem);
fprintf (stderr, "OK: %d\n", ok);
exit (!ok);
}], nptl=yes, nptl=no)
AC_MSG_RESULT($nptl)
LIBS=$old_LIBS
if test x$nptl != xyes; then
AC_ERROR([
***
*** Your kernel/glibc has no NPTL support !
*** Please read README.build
***])
fi
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'
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 CVS])
if test -f "$srcdir/.cvs_version" ; then
from_cvs=yes
else
from_cvs=no
fi
AC_MSG_RESULT($from_cvs)
AM_CONDITIONAL(COMPILING_FROM_CVS, test x$from_cvs = 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
)
AC_ARG_ENABLE(martin_hacks, [ --enable-martin-hacks This is only for Martin Baulig], use_martin_hacks=$enableval, use_martin_hacks=no)
AM_CONDITIONAL(MARTIN_HACKS, test x$use_martin_hacks = xyes)
martin_deps=
if test x$use_martin_hacks = xyes; then
martin_deps="ORBit-2.0 >= 2.8.3"
AC_DEFINE(MARTIN_HACKS,1, [Enable Martin's playground.])
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 $martin_deps)
AC_SUBST(SERVER_DEPENDENCIES_CFLAGS)
AC_SUBST(SERVER_DEPENDENCIES_LIBS)
if test x$server_only != xyes ; then
MONO_REQUIRED_VERSION=0.25
PKG_CHECK_MODULES(WRAPPER, mono >= $MONO_REQUIRED_VERSION gthread-2.0 >= $GLIB_REQUIRED_VERSION)
AC_SUBST(WRAPPER_CFLAGS)
AC_SUBST(WRAPPER_LIBS)
fi
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, mcs)
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
fi
top_srcdir=`pwd`
AC_SUBST(top_srcdir)
AC_SUBST(PATH)
AC_SUBST(LD_LIBRARY_PATH)
if test x$server_only != xyes ; then
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)
fi
dnl
dnl BFD checks
dnl
AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
AC_OUTPUT([
Makefile
mono-debugger.pc
interfaces/Makefile
classes/Makefile
glue/Makefile
wrapper/Makefile
backends/Makefile
backends/classes/Makefile
backends/server/Makefile
backends/ptrace/Makefile
backends/mono-csharp/Makefile
backends/native/Makefile
frontends/Makefile
frontends/scripting/Makefile
frontends/command-line/Makefile
arch/Makefile
arch/libiberty/Makefile
arch/opcodes/Makefile
arch/bfd/Makefile
arch/bfd/hosts/Makefile
arch/bfd/include/Makefile
arch/bfd/include/aout/Makefile
arch/bfd/include/coff/Makefile
arch/bfd/include/elf/Makefile
arch/bfd/include/opcode/Makefile
test/Makefile
test/mono-debugger.tests/Makefile
doc/Makefile
])
Jump to Line
Something went wrong with that request. Please try again.