From 1d9880f38526ea8e07457b08102b95ac50ab7d81 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Mon, 30 Mar 2009 13:16:58 +0200 Subject: Add configure.ac and Makefile.am. --- Makefile.am | 1 + configure.ac | 42 ++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 15 +++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 Makefile.am create mode 100644 configure.ac create mode 100644 src/Makefile.am diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..af437a6 --- /dev/null +++ b/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..7e69d05 --- /dev/null +++ b/configure.ac @@ -0,0 +1,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 +#include +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 diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..19892e6 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,15 @@ +lib_LTLIBRARIES = libdnsldap.la + +LIBMAJOR = 1 +LIBMINOR = 0 + +HDRS = cache.h ldap_convert.h ldap_helper.h log.h rdlist.h semaphore.h \ + settings.h str.h util.h zone_manager.h + +libdnsldap_la_SOURCES = $(HDRS) cache.c ldap_convert.c ldap_driver.c \ + ldap_helper.c log.c rdlist.c semaphore.c settings.c str.c \ + zone_manager.c + +libdnsldap_la_CFLAGS = -Wall -Wextra -pedantic -std=c99 + +libdnsldap_la_LDFLAGS = -version-info $(LIBMAJOR):$(LIBMINOR):0 -- cgit