-
Notifications
You must be signed in to change notification settings - Fork 24
/
configure.ac
53 lines (44 loc) · 1.74 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([fort],[1.6.4],[[email protected]])
AC_CONFIG_SRCDIR([src/main.c])
AM_INIT_AUTOMAKE([subdir-objects])
# Checks for programs.
AC_PROG_CC
# Create src/configure_ac.h, put some useful macros there.
AC_CONFIG_HEADERS([src/configure_ac.h])
# Checks for header files.
AC_CHECK_HEADERS([netinet/in.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_CHECK_HEADER_STDBOOL
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset socket])
AC_SEARCH_LIBS([pthread_create], [pthread], [],
[AC_MSG_ERROR([unable to find the pthread() function])]
)
AC_SEARCH_LIBS([X509_get_version], [crypto], [],
[AC_MSG_ERROR([unable to find the X509_get_version() function])]
)
AC_SEARCH_LIBS([backtrace],[execinfo],
[have_backtrace="yes"],
[have_backtrace="no"]
)
AM_CONDITIONAL([BACKTRACE_ENABLED], [test "x$have_backtrace" != "xno"])
# Dependencies managed by pkg-config
# By the way: Apparently PKG_CHECK_MODULES is poor practice now. I can't tell;
# it's always the same guy complaining about it in Stack Overflow.
# (Main one: https://stackoverflow.com/questions/10220946)
# But I couldn't make check work with AC_SEARCH_LIBS, probably because of some
# obscure autotools reasoning.
PKG_CHECK_MODULES([JANSSON], [jansson])
PKG_CHECK_MODULES([CURL], [libcurl])
PKG_CHECK_MODULES([XML2], [libxml-2.0])
PKG_CHECK_MODULES([CHECK], [check], [usetests=yes], [usetests=no])
AM_CONDITIONAL([USE_TESTS], [test "x$usetests" = "xyes"])
# Spit out the makefiles.
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile test/Makefile])
AC_OUTPUT