summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac74
1 files changed, 74 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..4678d3a
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,74 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.61)
+
+AC_COPYRIGHT([Copyright (c) 2008 Patrick McHardy <kaber@trash.net>])
+AC_INIT([libdect], [0.0.1], [kaber@trash.net])
+AC_DEFINE([RELEASE_NAME], ["libdect"], [Release name])
+
+AC_CONFIG_SRCDIR([src/s_msg.c])
+AC_CONFIG_HEADER([config.h])
+
+AC_DEFINE([_GNU_SOURCE], [], [Enable various GNU extensions])
+AC_DEFINE([_STDC_FORMAT_MACROS], [], [printf-style format macros])
+
+AC_ARG_ENABLE([debug],
+ AS_HELP_STRING([--enable-debug], [Enable debugging]),
+ [CONFIG_DEBUG="$(echo $enableval | cut -b1)"],
+ [CONFIG_DEBUG="y"])
+AC_SUBST([CONFIG_DEBUG])
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_MKDIR_P
+AC_PROG_INSTALL
+AC_PROG_LN_S
+
+# Checks for libraries.
+AC_CHECK_LIB([nl], [nl_socket_alloc], ,
+ AC_MSG_ERROR([No suitable version of libnl found]))
+
+AC_CHECK_LIB([nl-dect], [nl_dect_cluster_alloc], ,
+ AC_MSG_ERROR([No suitable version of libnl-dect found]))
+
+AC_CHECK_LIB([event], [event_init], ,
+ AC_MSG_ERROR([No suitable version of libevent found]))
+
+AC_CHECK_LIB([SDL], [SDL_OpenAudio], ,
+ AC_MSG_ERROR([No suitable version of libsdl found]))
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_HEADER_ASSERT
+AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h limits.h malloc.h \
+ stddef.h stdint.h stdlib.h string.h unistd.h], ,
+ AC_MSG_ERROR([Header file not found]))
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_TYPE_UID_T
+AC_TYPE_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_UINT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([memmove memset strchr strdup strerror strtoull])
+
+AC_CONFIG_FILES([Makefile Makefile.defs Makefile.rules])
+AC_CONFIG_FILES([include/Makefile])
+AC_CONFIG_FILES([src/Makefile])
+AC_CONFIG_FILES([example/Makefile])
+AC_CONFIG_FILES([doc/Makefile doc/Doxyfile])
+AC_OUTPUT