1##
2##	$Id: configure.ac,v 1.114 2005/04/21 16:40:13 bboy Exp $
3##
4##	Copyright (C) 2002-2005  Don Moore <bboy@bboy.net>
5##
6##	This program is free software; you can redistribute it and/or modify
7##	it under the terms of the GNU General Public License as published by
8##	the Free Software Foundation; either version 2 of the License, or
9##	(at Your option) any later version.
10##
11##	This program is distributed in the hope that it will be useful,
12##	but WITHOUT ANY WARRANTY; without even the implied warranty of
13##	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14##	GNU General Public License for more details.
15##
16##	You should have received a copy of the GNU General Public License
17##	along with this program; if not, write to the Free Software
18##	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19##
20
21AC_INIT(mydns, [1.2.8.31], [http://bugs.mydns-ng.com/])
22AC_USE_SYSTEM_EXTENSIONS
23AC_PREREQ([2.60])
24AC_COPYRIGHT([Portions of this script are Copyright 2002-2005 Don Moore  2007-2009 Howard Wilkinson])
25AM_INIT_AUTOMAKE([1.9.5 dist-bzip2])
26AM_CONFIG_HEADER(config.h)
27AC_CONFIG_MACRO_DIR([m4])
28
29## Checks for programs
30AC_PROG_AWK
31AC_PROG_CC
32AC_PROG_INSTALL
33AC_PROG_LN_S
34AC_PROG_LIBTOOL
35
36## GNU gettext
37AM_GNU_GETTEXT
38AM_GNU_GETTEXT_VERSION(0.12)
39
40## Checks for header files
41AC_HEADER_STDC
42AC_CHECK_HEADERS([fcntl.h getopt.h libintl.h netdb.h pwd.h signal.h stdarg.h termios.h time.h])
43AC_CHECK_HEADERS([sys/fcntl.h sys/file.h sys/ioctl.h sys/resource.h])
44AC_CHECK_HEADERS([sys/socket.h sys/sockio.h sys/time.h sys/wait.h])
45AC_CHECK_HEADERS([sys/select.h])
46AC_CHECK_HEADERS([netinet/in.h])
47AC_CHECK_HEADERS([net/if.h])
48AC_CHECK_HEADERS([arpa/inet.h])
49AC_CHECK_HEADERS([inttypes.h])
50AC_CHECK_HEADERS([string.h])
51AC_CHECK_HEADERS([poll.h])
52AC_CHECK_HEADERS([langinfo.h])
53AC_CHECK_HEADERS([stdio_ext.h])
54AC_CHECK_HEADERS([syslog.h])
55
56
57## Typedefs, structures, and compiler characteristics.
58AC_C_CONST
59AC_C_INLINE
60AC_TYPE_INT32_T
61AC_TYPE_PID_T
62AC_TYPE_SSIZE_T
63AC_TYPE_UID_T
64AC_TYPE_UINT16_T
65AC_TYPE_UINT32_T
66AC_TYPE_UINT64_T
67AC_TYPE_UINT8_T
68AC_TYPE_OFF_T
69
70AC_CHECK_TYPES([uchar uint uint8_t uint16_t uint32_t])
71
72## Library functions
73AC_FUNC_MALLOC
74AC_TYPE_SIGNAL
75AC_FUNC_ALLOCA
76AC_FUNC_REALLOC
77AC_FUNC_CHOWN
78AC_FUNC_FORK
79AC_FUNC_STRCOLL
80AC_CHECK_FUNCS([memset getpwuid shutdown inet_pton strsep strndup strdup strncmp])
81AC_CHECK_FUNCS([select poll])
82AC_CHECK_FUNCS([getaddrinfo getnameinfo])
83AC_CHECK_FUNCS([alarm])
84AC_CHECK_FUNCS([gethostbyname])
85AC_CHECK_FUNCS([gethostname])
86AC_CHECK_FUNCS([gettimeofday])
87AC_CHECK_FUNCS([inet_ntoa])
88AC_CHECK_FUNCS([memchr])
89AC_CHECK_FUNCS([memmove])
90AC_CHECK_FUNCS([mkdir])
91AC_CHECK_FUNCS([nl_langinfo])
92AC_CHECK_FUNCS([socket])
93AC_CHECK_FUNCS([strchr])
94AC_CHECK_FUNCS([strcspn])
95AC_CHECK_FUNCS([strerror])
96AC_CHECK_FUNCS([strncasecmp])
97AC_CHECK_FUNCS([strpbrk])
98AC_CHECK_FUNCS([strrchr])
99AC_CHECK_FUNCS([strstr])
100AC_CHECK_FUNCS([strtol])
101
102
103AC_CHECK_FUNC(inet_ntop, AC_DEFINE(HAVE_INET_NTOP, 1, [Define to 1 if you have the 'inet_ntop' function.]),
104    AC_CHECK_LIB(nsl, inet_ntop, AC_DEFINE(HAVE_INET_NTOP, 1, [Define to 1 if you have the 'inet_ntop' function.])))
105
106AC_LIB_SOCKET
107AC_LIB_NSL
108AC_LIB_MATH
109
110## Declarations
111AC_CHECK_DECLS([strcasecmp, strcoll, strerror, strncasecmp, strsep, strndup, strdup, strncmp])
112AC_CHECK_DECLS([poll, select])
113
114
115##
116## Package-specific variables
117##
118PACKAGE_HOMEPAGE="http://mydns.bboy.net"
119PACKAGE_COPYRIGHT="Copyright (C) 2002-2005 Don Moore  2007-2008 Howard Wilkinson"
120PACKAGE_AUTHOR="Don Moore <bboy@bboy.net>  Howard Wilkinson <howard@cohtech.com>"
121
122
123##
124## Some MyDNS-specific checks (see m4/mydns.m4)
125##
126AC_CHECK_IPV6			#	Check IPv6 support
127AC_CHECK_SOCKADDR_SA_LEN	#	Check for sa_len in struct sockaddr_in
128AC_MYDNS_PKGINFO		#	Set some package-specific variables
129AC_ENABLE_ALIAS			#	Enable David Phillips aliasing?
130AC_CHECK_MYSQL			#	Check for MySQL support
131AC_CHECK_PGSQL			#	Check for PostgreSQL support
132AC_WITH_OPENSSL			#	Check if OpenSSL is desired
133AC_MYDNS_CONF			#	Set conf file location
134AC_ENABLE_STATIC_BUILD		#	Build static binary?
135AC_CHOOSE_DB			#	Choose between MySQL and PostgreSQL
136AC_ENABLE_PROFILING		#	Enable profiling?
137AC_ENABLE_DEBUG			#	Enable debugging?
138AC_ENABLE_VALGRIND		#	Compile with Valgrind-friendly flags?
139AC_ENABLE_STRICT		#	Compile with extra-strict warnings?
140AC_ENABLE_ALT_NAMES		#	Alternate column names for DN
141AC_ENABLE_STATUS		#	Enable the STATUS opcode to check server status
142AC_DISABLE_DATE_LOGGING		#	Disable date/time in verbose output?
143AC_MYDNS_VARS			#  Set variables containing dirs
144
145AC_CONFIG_FILES(contrib/Makefile  intl/Makefile\
146		po/Makefile.in \
147		m4/Makefile \
148		Makefile \
149		lib/Makefile \
150		src/Makefile \
151		src/lib/Makefile \
152		src/mydns/Makefile \
153		src/util/Makefile \
154		pkg/Makefile \
155		doc/Makefile \
156		doc/mydns.8 \
157		doc/mydnscheck.8 \
158		doc/mydns.conf.5 \
159		doc/mydns-conf.8 \
160		doc/mydnsexport.8 \
161		doc/mydnsimport.8 \
162		doc/mydnsptrconvert.8 \
163		pkg/mydns-mysql.spec \
164		pkg/mydns-postgres.spec
165		)
166
167AC_OUTPUT
168
169echo
170echo "  ###"
171echo "  ###  MyDNS $PACKAGE_VERSION configured.  Using $USE_DB_NAME database."
172echo "  ###"
173echo "  ###  Type \"make\" to build, then \"make install\" to install."
174echo "  ###"
175echo
176
177## vi:set ts=3:
178