2 dnl Process this file with autoconf to produce a configure script.
4 dnl This file is part of libasyncns.
6 dnl Copyright 2005-2008 Lennart Poettering
8 dnl libasyncns is free software; you can redistribute it and/or modify
9 dnl it under the terms of the GNU Lesser General Public License as
10 dnl published by the Free Software Foundation, either version 2.1 of the
11 dnl License, or (at your option) any later version.
13 dnl libasyncns is distributed in the hope that it will be useful, but
14 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
15 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 dnl Lesser General Public License for more details.
18 dnl You should have received a copy of the GNU Lesser General Public
19 dnl License along with libasyncns. If not, see
20 dnl <http://www.gnu.org/licenses/>.
23 AC_INIT([libasyncns],[0.8],[mznflapaf (at) 0pointer (dot) de])
24 AC_CONFIG_SRCDIR([libasyncns/asyncns.c])
25 AC_CONFIG_HEADERS([config.h])
26 AC_CONFIG_MACRO_DIR([m4])
27 AM_INIT_AUTOMAKE([foreign 1.10 -Wall])
29 AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/libasyncns/])
31 AC_SUBST(LIBASYNCNS_VERSION_INFO, [3:1:3])
33 if type -p stow > /dev/null && test -d /usr/local/stow ; then
34 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
35 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
38 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
40 dnl Checks for programs.
46 AC_USE_SYSTEM_EXTENSIONS
53 CC_CHECK_CFLAGS_APPEND([-pipe -Wall -W -Wextra -pedantic -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -Wstrict-aliasing])
55 dnl Checks for header files.
59 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h stdlib.h string.h sys/socket.h unistd.h sys/prctl.h netinet/in.h arpa/nameser_compat.h])
61 dnl Checks for typedefs, structures, and compiler characteristics.
70 dnl Checks for library functions.
73 AC_FUNC_SELECT_ARGTYPES
75 AC_CHECK_FUNCS([memset select strndup setresuid setreuid strerror])
79 AC_CHECK_LIB(nsl, gethostbyname)
80 AC_CHECK_LIB(socket, connect)
82 ACF_SEARCH_FUNCTION([res_query], [-lresolv, -lbind],
83 [], [AC_MSG_ERROR([res_query not found])],
86 ]], [[res_query(0, 0, 0, 0, 0);]])
95 AC_CONFIG_FILES([Makefile libasyncns/Makefile doc/Makefile doc/README.html doxygen/Makefile doxygen/doxygen.conf libasyncns.pc])