-
Notifications
You must be signed in to change notification settings - Fork 11
/
configure.ac
74 lines (60 loc) · 1.71 KB
/
configure.ac
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
# $Id$
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([evldns],[0.2],[[email protected]])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE(foreign)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
CHECK_COMPILER_FLAG([Wall], [CFLAGS="-Wall $CFLAGS"])
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_LN_S
# Checks for libraries.
AC_ARG_WITH(ldns,
[ --with-ldns=DIR LDNS install directory], [
AM_CPPFLAGS="$AM_CPPFLAGS -I$withval/include"
AM_LDFLAGS="$AM_LDFLAGS -L$withval/lib"
])
AC_ARG_WITH(libevent,
[ --with-libevent=DIR libevent install directory], [
AM_CPPFLAGS="$AM_CPPFLAGS -I$withval/include"
AM_LDFLAGS="$AM_LDFLAGS -L$withval/lib"
])
# save user flags
OLDCFLAGS="$CFLAGS"
OLDCPPFLAGS="$CPPFLAGS"
OLDLDFLAGS="$LDFLAGS"
tmp_LIBS="$LIBS"
# check for libraries using supplied flags
CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
AC_CHECK_LIB([ldns], [ldns_dname_match_wildcard], [],
AC_MSG_ERROR([libdns unuseable])
)
AC_CHECK_LIB([event], [event_base_new])
# restore user flags
CPPFLAGS="$OLDCPPFLAGS"
CFLAGS="$OLDCFLAGS"
LDFLAGS="$OLDLDFLAGS"
LIBS="$tmp_LIBS"
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
AC_CHECK_HEADERS([sys/socket.h netdb.h])
AC_CHECK_HEADERS([ldns/ldns.h event.h])
AC_HEADER_STDBOOL
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_SEARCH_LIBS([dlopen], [dl])
AC_CHECK_FUNCS([socket memset strdup])
AC_CHECK_FUNCS([getaddrinfo getnameinfo])
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_LDFLAGS)
AC_OUTPUT