-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
145 lines (128 loc) · 3.67 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
dnl $Id: configure.in,v 1.8.2.1 2006/08/19 22:51:37 marius Exp $
AC_INIT(include/nylon.h)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(nylon, 1.21)
AM_CONFIG_HEADER(include/config.h)
AC_PROG_MAKE_SET
dnl intitialization
if test "x$prefix" = "xNONE"; then
prefix="/usr/local"
fi
dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
dnl Platform specific stuff
case "$host" in
*-*-hpux*)
AC_DEFINE(SPT_TYPE,SPT_PSTAT)
LIBS="$LIBS -lxnet -lsec"
;;
esac
dnl Checks for standard libraries. Solaris sucks ...
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(resolv, hstrerror)
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
dnl Check for __progname; from OpenSSHp
AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
AC_TRY_LINK([],
[ extern char *__progname; printf("%s", __progname); ],
[ ac_cv_libc_defines___progname="yes" ],
[ ac_cv_libc_defines___progname="no" ]
)
])
if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
AC_DEFINE(HAVE___PROGNAME)
fi
AC_CHECK_HEADERS(sys/ioctl.h sys/time.h unistd.h sys/queue.h)
if test "x$ac_cv_header_sys_queue_h" = "xyes"; then
AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h)
AC_EGREP_CPP(yes,
[
#include <sys/queue.h>
#ifdef TAILQ_FOREACH
yes
#endif
], [AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_TAILQFOREACH) ], AC_MSG_RESULT(no)
)
fi
if test "x$ac_cv_header_sys_queue_h" = "xyes"; then
AC_MSG_CHECKING(for LIST_FIRST sys/queue.h)
AC_EGREP_CPP(yes,
[
#include <sys/queue.h>
#ifdef LIST_FIRST
yes
#endif
], [AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LISTFIRST) ], AC_MSG_RESULT(no)
)
fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_CHECK_TYPE(u_int64_t, unsigned long long)
AC_CHECK_TYPE(u_int32_t, unsigned int)
AC_CHECK_TYPE(u_int16_t, unsigned short)
AC_CHECK_TYPE(u_int8_t, unsigned char)
AC_CHECK_TYPE(in_addr_t, unsigned long)
AC_CHECK_TYPE(socklen_t, unsigned int)
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(socket)
dnl XXX - this is kind of hacky; we don't incorporate 'err' here since if it
dnl is needed, that symbol will already by in libevent. FIX THIS, though.
AC_REPLACE_FUNCS(strlcpy strlcat strsep setproctitle daemon)
dnl Checks for libevent
AC_MSG_CHECKING(for libevent)
AC_ARG_WITH(libevent,
[ --with-libevent=DIR use libevent in DIR],
[ case "$withval" in
yes|no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT($withval)
if test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
EVENTINC="-I$withval/include"
EVENTLIB="-L$withval/lib -levent"
elif test -f $withval/event.h -a -f $withval/libevent.a; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
EVENTINC="-I$withval"
EVENTLIB="-L$withval -levent"
else
AC_ERROR(event.h or libevent.a not found in $withval)
fi
;;
esac ],
[ if test -f ${prefix}/include/event.h -a -f ${prefix}/lib/libevent.a;
then
EVENTINC="-I${prefix}/include"
EVENTLIB="-L${prefix}/lib -levent"
elif test -f /usr/include/event.h; then
EVENTLIB="-levent"
else
AC_MSG_RESULT(no)
AC_ERROR(libevent not found)
fi
AC_MSG_RESULT(yes) ]
)
AC_SUBST(EVENTINC)
AC_SUBST(EVENTLIB)
if test "x${sysconfdir}" = 'x${prefix}/etc'; then
csysconfdir="${prefix}/etc"
else
csysconfdir="${sysconfdir}"
fi
AC_DEFINE_UNQUOTED(SYSCONFDIR, "${csysconfdir}")
AC_OUTPUT(Makefile src/Makefile man/Makefile include/Makefile)