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
|
dnl $Id: configure.in,v 1.6 2007-02-26 14:38:42 derick Exp $
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
divert(1)
dnl
dnl Start
dnl
AC_INIT([main.c])
AC_PREFIX_DEFAULT([/usr/local])
AM_INIT_AUTOMAKE(debugclient, $VERSION)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
# This is needed if SUBDIRS is set
AC_PROG_MAKE_SET
divert(2)
dnl
dnl Checks for working compiler and other programs needed.
dnl
AC_PROG_CC
if test "$ac_cv_c_compiler_gnu" = "yes"
then
AS="$CC -c"
AC_SUBST(AS)
else
AC_PATH_PROG(AS, as, as)
fi
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL
dnl
dnl Checks for needed header files.
dnl
AC_HEADER_STDC
AC_CHECK_HEADERS(
error.h \
fcntl.h \
malloc.h \
syslog.h \
unistd.h \
dlfcn.h \
)
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_C_CONST
AC_C_INLINE
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 2)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(long long, 8)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(socket, socket)
AC_CHECK_FUNCS(strerror strtol strtoul)
dnl
dnl Debug section:
dnl
dnl Debug on/off [default: OFF]
dnl
XDEBUG_HELP_SEPARATOR(DEBUGGING:)
AC_MSG_CHECKING([whether to enable debugging])
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debugging.],
[
if test "$enableval" = "yes" ; then
AC_DEFINE(XDEBUG_DEBUG, 1, [Whether debugging is enabled or not.])
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS -Wall -Werror"
else
AC_DEFINE(XDEBUG_DEBUG, 0, [Whether debugging is enabled or not.])
AC_MSG_RESULT([no])
CFLAGS="$CFLAGS -Wall -Werror"
fi
],[
AC_MSG_RESULT([no])
])
AC_MSG_CHECKING([whether to use dmalloc debugging])
AC_ARG_ENABLE(dmalloc,
[ --enable-dmalloc Enable dmalloc debugging ],
[
if test "$enableval" = "yes" ; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(dmalloc, dmalloc_error,
[
AC_DEFINE(HAVE_DMALLOC, 1, [Dmalloc])
LIBS="-ldmalloc $LIBS"
])
else
AC_MSG_RESULT([no])
fi
],[
AC_MSG_RESULT([no])
])
AC_MSG_CHECKING([whether to use libedit])
AC_ARG_WITH(libedit,
[ --with-libedit Enable libedit ],
[
if test "$withval" = "yes" ; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(termcap, tgetflag,
[
AC_DEFINE(HAVE_TERMCAP, 1, [ ])
LIBS="-ltermcap $LIBS"
])
AC_CHECK_LIB(edit, el_set,
[
AC_DEFINE(HAVE_LIBEDIT, 1, [ ])
LIBS="-ledit $LIBS"
AC_MSG_CHECKING([for H_SETSIZE])
AC_EGREP_CPP(yes, [
#include <histedit.h>
#ifdef H_SETSIZE
yes
#endif
], [
AC_DEFINE([XDC_H_SETSIZE], H_SETSIZE, [H_SETSIZE or H_EVENT])
AC_MSG_RESULT([H_SETSIZE])
], [
AC_DEFINE([XDC_H_SETSIZE], H_EVENT, [H_SETSIZE or H_EVENT])
AC_MSG_RESULT([H_EVENT])
])
AC_MSG_CHECKING([for number of arguments to el_init])
AC_TRY_COMPILE([
#include <stdio.h>
#include <histedit.h>
], [
static EditLine *el = NULL;
int main()
{
el = el_init("foo", stdin, stdout, stderr);
}
],
XDC_ELINIT_ARGS=4,
[AC_TRY_COMPILE([
#include <stdio.h>
#include <histedit.h>
], [
static EditLine *el = NULL;
int main()
{
el = el_init("foo", stdin, stdout);
}
],
XDC_ELINIT_ARGS=3,
[AC_ERROR("you have strange libedit")]
)]
)
AC_DEFINE_UNQUOTED([XDC_ELINIT_ARGS], $XDC_ELINIT_ARGS, [Number of arguments to el_init])
AC_MSG_RESULT($XDC_ELINIT_ARGS)
],
[
AC_ERROR("libedit was not found on your system.")
])
else
AC_MSG_RESULT([no])
fi
],[
AC_MSG_RESULT([no])
])
dnl
dnl System dependant checks
dnl
case $host_alias in
*darwin*|*rhapsody*)
CFLAGS="$CFLAGS -Wno-long-double"
AC_DEFINE(XDEBUG_MACOSX,1,[ ])
AC_DEFINE(HAVE_DYLD,1, [ ])
;;
esac
AC_SUBST(XDEBUG_MODULES)
AC_SUBST(XDEBUG_STATIC_MODULES)
AC_SUBST(XDEBUG_STATIC_LDADD)
AC_SUBST(XDEBUG_MOD_MAKEFILES)
AC_SUBST(INCLUDES)
dnl
dnl Output
dnl
AC_OUTPUT([Makefile], [], [
if test "\$CONFIG_FILES" = "$MAKES" || test -z "\$CONFIG_FILES"; then
REDO_ALL=yes
fi
])
|