-
Notifications
You must be signed in to change notification settings - Fork 71
/
configure.ac
112 lines (95 loc) · 2.87 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.62])
AC_INIT([signalbus], [0.1], [[email protected]])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/continuation.c])
AC_CONFIG_HEADERS([src/config.h])
AM_INIT_AUTOMAKE(1.10 gnu -Wall no-define)
AC_PROG_RANLIB
AC_GNU_SOURCE
AC_USE_SYSTEM_EXTENSIONS
AM_PROG_AR
AH_TOP([#define HAVE_CONFIGURED 1])
#### Determine host OS ####
os_is_linux=0
os_is_win32=0
os_is_darwin=0
AC_MSG_CHECKING([host operating system])
case "$host_os" in
linux*)
AC_MSG_RESULT([linux])
os_is_linux=1
;;
darwin*)
AC_MSG_RESULT([darwin])
os_is_darwin=1
AC_DEFINE([OS_IS_DARWIN], 1, [Build target is Darwin.])
;;
mingw*)
AC_MSG_RESULT([win32])
os_is_win32=1
AC_DEFINE([OS_IS_WIN32], 1, [Build target is Windows.])
;;
*)
AC_MSG_RESULT([unknown])
;;
esac
AM_CONDITIONAL(OS_IS_DARWIN, test "x$os_is_darwin" = "x1")
AM_CONDITIONAL(OS_IS_WIN32, test "x$os_is_win32" = "x1")
AC_SUBST([OS_IS_WIN32], [$os_is_win32])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
m4_pattern_allow([AM_PROG_AR], [AM_PROG_AR])
# Checks for libraries.
# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([inttypes.h limits.h malloc.h memory.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])
AC_CHECK_HEADER([boost/preprocessor/cat.hpp])
if test "$ac_cv_header_boost_preprocessor_cat_hpp" = "no"; then
AC_MSG_ERROR([*** boost preprocessor headers not found])
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_TYPES([ptrdiff_t])
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
# check pthread support
AX_PTHREAD([have_pthread=yes], [have_pthread=no])
AS_IF([test "x$have_pthread" = "xyes"], [AC_DEFINE([HAVE_PTHREAD], 1)])
AM_CONDITIONAL([HAVE_PTHREAD], [test "x$have_pthread" = "xyes"])
AM_CONDITIONAL([HAVE_SELECT], [test "x$have_pthread" = "xyes" -a "x$ac_cv_func_select" = "xyes"])
# gcc arch flag
AX_GCC_ARCHFLAG([no])
if test "x$GCC" != "xyes"; then
AC_MSG_CHECKING([for __builtin_return_address])
AC_TRY_LINK([], [
__builtin_return_address(0);
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_BUILTIN_RETURN_ADDRESS, 1,
[Whether we have __builtin_return_address])
AC_MSG_RESULT(no)
])
fi
AC_SUBST([PICFLAG])
# Doxygen options
DOCDIR="doc"
DX_DOXYGEN_FEATURE(ON)
DX_HTML_FEATURE(ON)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(OFF)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN([signalbus], [doxygen.cfg], [$(DOCDIR)])
AC_SUBST(DOCDIR)
AC_CONFIG_FILES([Doxyfile Makefile src/Makefile src/continuation/Makefile tests/Makefile \
pkgconfig/signalbus.pc pkgconfig/signalbus-uninstalled.pc
])
AC_OUTPUT