forked from achernya/hesiod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
90 lines (79 loc) · 2.86 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([hesiod], [3.2.1], [[email protected]])
AM_INIT_AUTOMAKE([-Wall])
AM_MAINTAINER_MODE([enable])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/lib/hesiod.h])
AC_CONFIG_HEADERS([config.h])
AC_USE_SYSTEM_EXTENSIONS
# Checks for programs.
AC_PROG_CC
# automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT
# Checks for libraries.
hesiod_save_LIBS="$LIBS"
LIBS=
AC_ARG_WITH([libidn],
[AS_HELP_STRING([--with-libidn], [Support IDN (needs GNU libidn) @<:@check@:>@])],
[with_libidn="$withval"],
[with_libidn="check"])
AS_IF([test x"$with_libidn" != xno],
[AC_SEARCH_LIBS([stringprep_check_version], [idn],
[AC_DEFINE([HAVE_LIBIDN], [1], [Define if libidn is available.])],
[AS_IF([test x"$with_idn" = xcheck],
[AC_MSG_WARN([Unable to find libidn.])],
[AC_MSG_ERROR([--with-libidn was given but libidn was not found.])])])])
AC_ARG_WITH([libidn-headers],
[AS_HELP_STRING([--with-libidn-headers], [Path to libidn headers @<:@default=/usr/include@:>@])],
[CFLAGS="$CFLAGS -I$with_libidn_headers"],
[])
AC_CHECK_LIB([resolv], [res_mkquery], [], [
AC_MSG_CHECKING([if res_mkquery is provided by libresolv with mangled symbols])
save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
AC_TRY_LINK([#include <resolv.h>],
[res_mkquery(0,NULL,0,0,NULL,0,NULL,NULL,0);], [
AC_DEFINE(HAVE_LIBRESOLV, [1], [Define if your libresolv provides res_mkquery.])
AC_MSG_RESULT(yes)], [
LIBS="$save_LIBS"
AC_MSG_RESULT(no)])])
AC_SUBST([SUPPORTING_LIBS], $LIBS)
LIBS=$hesiod_save_LIBS
# Checks for header files.
AC_HEADER_RESOLV
AC_CHECK_HEADERS([netdb.h netinet/in.h stdlib.h string.h sys/socket.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SSIZE_T
AC_TYPE_UID_T
AC_EGREP_HEADER([pw_quota], [pwd.h],
AC_DEFINE([HAVE_PW_QUOTA], 1,
[Define if struct passwd has a field pw_quota]))
AC_EGREP_HEADER([pw_comment], [pwd.h],
AC_DEFINE([HAVE_PW_COMMENT], 1,
[Define if struct passwd has a field pw_comment]))
AC_EGREP_HEADER([pw_class], [pwd.h],
AC_DEFINE([HAVE_PW_CLASS], 1,
[Define if struct passwd has a field pw_class]))
AC_EGREP_HEADER([pw_change], [pwd.h],
AC_DEFINE([HAVE_PW_CHANGE], 1,
[Define if struct passwd has a field pw_change]))
AC_EGREP_HEADER([pw_expire], [pwd.h],
AC_DEFINE([HAVE_PW_EXPIRE], 1,
[Define if struct passwd has a field pw_expire]))
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([strchr strdup secure_getenv])
AC_CONFIG_FILES([
Makefile
src/Makefile
src/lib/Makefile
src/hesinfo/Makefile
man/Makefile
src/hesiod.pc
])
AC_OUTPUT