summaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 7e69d05a15f67e755065959f69fd91754bae20f5 (plain)
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
AC_PREREQ([2.59])
AC_INIT([libdnsldap], [0.1.0a1], [put_bugreport_address_here])

AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])

AC_CONFIG_SRCDIR([src/zone_manager.h])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL

# Checks for libraries.
AC_CHECK_LIB([dns], [dns_name_init])
AC_CHECK_LIB([ldap], [ldap_initialize])

# Checks for header files.
AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

# Checks for library functions.
AC_CHECK_FUNCS([memset strcasecmp strncasecmp])

# Check version of libdns
AC_MSG_CHECKING([libdns version])
AC_TRY_RUN([
#include <stdio.h>
#include <dns/version.h>
int main(void) {
	printf("%d\n", dns_libinterface);
	return 0;
}],[LIBDNS_VERSION_MAJOR=`./conftest$ac_exeext`
    AC_DEFINE_UNQUOTED([LIBDNS_VERSION_MAJOR], [$LIBDNS_VERSION_MAJOR],
    [Define libdns version])],
[AC_MSG_ERROR([Can't obtain libdns version.])],
[AC_MSG_ERROR([Cross compilling is not supported.])]
)

AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT