File: configure.ac

package info (click to toggle)
dnsproxy 1.15-5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 732 kB
  • ctags: 599
  • sloc: ansic: 4,947; sh: 299; makefile: 139
file content (106 lines) | stat: -rw-r--r-- 3,185 bytes parent folder | download
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
dnl $Id: configure.ac,v 1.13 2005/05/15 12:40:48 armin Exp $
dnl ------------------------------------------------------------------

AC_INIT(dnsproxy, 1.15)
AC_PREREQ(2.57)

AC_REVISION([$Revision: 1.13 $])

AC_CONFIG_HEADERS(config.h)

dnl ------------------------------------------------------------------
dnl Check for programs
dnl ------------------------------------------------------------------

AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_CACHE_SAVE

dnl ------------------------------------------------------------------
dnl Check for headers
dnl ------------------------------------------------------------------

AC_C_CONST
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS(sys/types.h sys/socket.h sys/time.h)
AC_CHECK_HEADERS(netinet/in.h arpa/inet.h)
AC_CHECK_HEADERS(errno.h syslog.h)
AC_TYPE_SIGNAL
AC_CACHE_SAVE

dnl ------------------------------------------------------------------
dnl Check for functions
dnl ------------------------------------------------------------------

AC_CHECK_FUNCS(strchr memcpy)
AC_CHECK_FUNCS(setregid setresgid setresuid setreuid)
AC_CHECK_FUNCS(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname)])
AC_CHECK_FUNCS(socket, , [AC_CHECK_LIB(socket, socket)])
AC_CHECK_FUNCS(inet_pton, , [AC_CHECK_LIB(resolv, inet_pton)])
AC_CACHE_SAVE

dnl ------------------------------------------------------------------
dnl Enable extended warnings while developing
dnl ------------------------------------------------------------------

AC_ARG_ENABLE(warnings, [
  --enable-warnings       enable all sorts of warnings for debugging],
[
	CFLAGS="$CFLAGS -Wall -Werror -Wcast-qual -Wmissing-declarations \
		-W -Wmissing-prototypes -Wnested-externs -Wshadow \
		-Wwrite-strings -Wno-unused -Wno-sign-compare"
])
AC_SUBST(CFLAGS)

dnl ------------------------------------------------------------------
dnl Recurse into libevent or check for already installed library
dnl ------------------------------------------------------------------

AC_ARG_WITH(native-libevent, [
  --with-native-libevent  use already installed libevent],
[
	AC_CHECK_LIB(event, event_init)
	INCEVENT=""
	LIBEVENT=""
],[
	AC_CONFIG_SUBDIRS(libevent)
	INCEVENT="-Ilibevent"
	LIBEVENT="libevent/libevent.a"
])
AC_SUBST(INCEVENT)
AC_SUBST(LIBEVENT)

dnl ------------------------------------------------------------------
dnl Check for available nroff and manpage macro package
dnl ------------------------------------------------------------------

AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$PATH:/usr/ucb])
if ${NROFF} -mdoc dnsproxy.1 >/dev/null 2>&1; then
	MAN=mdoc
else
	MAN=man
fi
AC_SUBST(MAN)

dnl ------------------------------------------------------------------
dnl Generate Makefile by default. Others only if their .in file
dnl exists in the current directory, which happens in my workdir
dnl but not for distributed tarballs.
dnl ------------------------------------------------------------------

AC_CONFIG_FILES(Makefile)
if test -r "README.in"; then
	AC_CONFIG_FILES(README)
fi
if test -r "dnsproxy.1.in"; then
	AC_CONFIG_FILES(dnsproxy.1)
fi

AC_OUTPUT()

AC_MSG_RESULT()
AC_MSG_RESULT([Configured successfully. Now run make.])
AC_MSG_RESULT()