1 dnl Checks for header files.
2 AC_LANG_C dnl switch to C
3 AC_HEADER_DIRENT dnl check for dirent.h
4 AC_HEADER_STDC dnl check for other stdc headers. More traditional ;)
5 dnl check for some more header files. You can remove some of
6 dnl them, if you want to. But it doesn't hurt
7 AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/cdefs.h)
8 AC_CHECK_HEADERS(fnmatch.h sysent.h strings.h sys/stat.h)
9 AC_CHECK_HEADERS(sys/ioctl.h pty.h libutil.h util.h)
11 dnl Checks for libraries.
12 AC_CHECK_LIB(socket, socket, [LIBSOCKET="-lsocket -lnsl"]) dnl for Solaris' X11
15 dnl Checks for typedefs, structures, and compiler characteristics.
18 dnl Checks for library functions.
19 AC_CHECK_FUNCS(setpgid putenv socket vsnprintf mkfifo)
21 dnl pseudo tty support in glibc2
22 AC_SEARCH_LIBS(openpty, util,
23 AC_DEFINE_UNQUOTED(HAVE_FUNC_OPENPTY, 1, [Define if you have openpty]))
25 dnl Check whether we want much debugging output
26 AH_TEMPLATE([WANT_TRACE_OUTPUT],
27 [Define if you want to see voluminous trace output])
28 AC_MSG_CHECKING([whether kdbg should generate lots of trace output])
29 dnl Default is no trace output
30 AC_ARG_ENABLE(lots-a-trace,
31 [ --enable-lots-a-trace generate lots of trace output [default=no]],
32 WANT_TRACE_OUTPUT=$enableval, WANT_TRACE_OUTPUT=no)
33 AC_MSG_RESULT($WANT_TRACE_OUTPUT)
34 if test "x$WANT_TRACE_OUTPUT" = "xyes"; then
35 AC_DEFINE_UNQUOTED(WANT_TRACE_OUTPUT)
38 dnl Check whether test programs should be compiled
39 dnl Default is not to compile them
40 AC_ARG_ENABLE(testprogs,
41 [ --enable-testprogs compile test programs [default=no]],
42 [buildtestprogs=$enableval],[buildtestprogs=no])
43 AM_CONDITIONAL(BUILDTESTPROGS,test "x$buildtestprogs" = "xyes")
44 dnl write a notice into the log
45 echo "build test programs: $buildtestprogs" >&5
47 dnl Check where the communication with gdb should be logged
48 AC_MSG_CHECKING([where communication with gdb should be logged])
49 dnl Default is ./gdb-transcript until kdbg is released
50 AC_ARG_WITH(transcript,
51 [ --with-transcript=file log communication with gdb [default=not logged]],
52 GDB_TRANSCRIPT=$withval, GDB_TRANSCRIPT=no)
53 if test "x$GDB_TRANSCRIPT" = "xyes"; then
54 GDB_TRANSCRIPT="./gdb-transcript"
56 if test "x$GDB_TRANSCRIPT" = "xno"; then
57 GDB_TRANSCRIPT="not logged"
60 GDB_TRANSCRIPT=\"$GDB_TRANSCRIPT\"
61 AC_DEFINE_UNQUOTED(GDB_TRANSCRIPT, $GDB_TRANSCRIPT,
62 [Define to the name of the file that communication with gdb
63 should be logged to; undefine it for no logging])
65 AC_MSG_RESULT($GDB_TRANSCRIPT)
67 dnl Check whether placement new works
68 AH_TEMPLATE([HAVE_PLACEMENT_NEW],[Define if placement new works])
70 AC_MSG_CHECKING(whether placement new is available)
71 AC_CACHE_VAL(ac_cv_have_placement_new,
80 ac_cv_have_placement_new=yes,
81 ac_cv_have_placement_new=no)
83 AC_MSG_RESULT($ac_cv_have_placement_new)
84 if eval "test \"`echo `$ac_cv_have_placement_new\" = yes"; then
85 AC_DEFINE(HAVE_PLACEMENT_NEW)
89 AC_PATH_PROG(PS_COMMAND, ps)
90 if test -n "$PS_COMMAND"; then
91 AC_MSG_CHECKING(for suitable ps invocation)
93 PS_COMMAND="$PS_COMMAND -eo pid,ppid,uid,vsz,etime,time,args"
94 if $PS_COMMAND > /dev/null 2>&1; then
95 # works in principle; check output: extract first line, but avoid 'head -1'
96 set x `$PS_COMMAND | (read firstline; echo "$firstline")`
97 if test "$*" = "x PID PPID UID VSZ ELAPSED TIME COMMAND"; then
100 PS_COMMAND="" # not suitable
103 PS_COMMAND="" # not suitable
106 if test -n "$PS_COMMAND"; then
107 AC_MSG_RESULT($PS_COMMAND)
108 PS_COMMAND=\"`echo $PS_COMMAND | sed -e 's/ /", "/g'`\"
109 AC_DEFINE_UNQUOTED(PS_COMMAND, $PS_COMMAND,
110 [Define how to invoke ps])
112 AC_MSG_RESULT([not suitable])
115 AM_CONDITIONAL(HAVE_PS_COMMAND, test -n "$PS_COMMAND")