Fail at configure time rather than build time when missing a library.
[radsecproxy.git] / lib / configure.ac
1 # -*- Autoconf -*- script for libradsec.
2
3 AC_PREREQ([2.65])
4 AC_INIT([libradsec], [0.0.1-dev], [linus+libradsec@nordu.net])
5 AC_CONFIG_MACRO_DIR([m4])
6 AM_INIT_AUTOMAKE
7 AC_CONFIG_SRCDIR([radsec.c])
8 AC_CONFIG_HEADERS([config.h])
9 AC_PROG_LIBTOOL
10
11 # Checks for programs.
12 AC_PROG_CC
13
14 # Checks for libraries.
15 AC_CHECK_LIB([confuse], [cfg_init],,
16     AC_MSG_ERROR([required library libconfuse not found]))
17 AC_CHECK_LIB([event_core], [event_get_version],,
18     AC_MSG_ERROR([required library libevent_core not found]))
19 AC_CHECK_LIB([freeradius-radius], [rad_alloc],,
20     AC_MSG_ERROR([required library libfreeradius-radius not found]))
21
22 # Checks for header files.
23 AC_CHECK_HEADERS([netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h unistd.h])
24
25 # Checks for typedefs, structures, and compiler characteristics.
26 AC_TYPE_SIZE_T
27 AC_TYPE_SSIZE_T
28 AC_TYPE_UINT8_T
29
30 # Checks for library functions.
31 AC_FUNC_MALLOC
32 AC_FUNC_REALLOC
33 AC_CHECK_FUNCS([memset socket strdup strerror strrchr])
34
35 AC_CONFIG_FILES([Makefile
36                  include/Makefile
37                  examples/Makefile])
38 AC_OUTPUT