-
Notifications
You must be signed in to change notification settings - Fork 162
/
configure.ac
102 lines (81 loc) · 2.68 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
AC_PREREQ([2.69])
AC_INIT([test], [0.0.1], [[email protected]])
AC_CONFIG_SRCDIR([src/app.c])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE([disable])
# added mannually into the output of autoscan
AC_CONFIG_AUX_DIR([ac_aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
#
# AC_ARG_ENABLE(option-name, help-string, action-if-present, action-if-not-present)
# AC_ARG_WITH([polycover], AS_HELP_STRING([--without-foo], [Ignore presence of foo and disable it]))
#
AC_ARG_WITH([polycover],
[AS_HELP_STRING([--with-polycover], [polycover; needs c++ and its stdlib dependencies])],
[],
[with_polycover=no])
# add an option
AS_IF([test "x$with_polycover" != "xno"],
[ AM_CONDITIONAL(WITH_POLYCOVER, true) ],
[ AM_CONDITIONAL(WITH_POLYCOVER, false) ])
###############################################################
# AC_CANONICAL_HOST is needed to access the 'host_os' variable
###############################################################
AC_CANONICAL_HOST
build_linux=no
build_windows=no
build_mac=no
# Detect the target system
case "${host_os}" in
linux*)
build_linux=yes ;;
cygwin*|mingw*)
build_windows=yes ;;
darwin*)
build_mac=yes ;;
*)
AC_MSG_ERROR(["OS $host_os is not supported"]) ;;
esac
AM_CONDITIONAL([LINUX], [test "$build_linux" = "yes"])
AM_CONDITIONAL([OSX], [test "$build_mac" = "yes"])
AM_CONDITIONAL([WINDOWS], [test "$build_windows" = "yes"])
# echo "........................OS: $build_linux"
# Checks for programs.
CFLAGS="$CFLAGS -std=gnu11"
AC_PROG_CC
AM_PROG_CC_C_O
# the macro AC_PROG_CPP seems to find the default compiler (gcc or clang)
#AC_PROG_CPP
AM_PROG_AR
# AC_ENABLE_SHARED
# AC_DISABLE_STATIC
# AC_PROG_LIBTOOL
# LT_LIB_DLLOAD
# LT_INIT([dlopen])
# LT_INIT
# echo "****************************************** --with-polycover=$with_polycover"
# include this only if the --with-polycover option is set
# AM_COND_IF([WITH_POLYCOVER], [AC_PROG_CXX AC_LANG([C++]) AX_CXX_COMPILE_STDCXX_11(noext)], [])
# AS_IF([test "x$with_polycover" != "xno"], [ ], [ ])
CXXFLAGS="$CXXFLAGS -std=c++11"
AC_PROG_CXX
AC_PROG_RANLIB
AC_LANG([C++])
# AX_CHECK_COMPILE_FLAG([-std=c++11], [ CXXFLAGS="$CXXFLAGS -std=c++11"])
# AX_CXX_COMPILE_STDCXX_11(noext)
AC_LANG([C])
# AX_CHECK_COMPILE_FLAG([-std=gnu11], [ CXXFLAGS="$CXXFLAGS -std=c++11"])
# AC_PROG_LIBTOOL
# AC_DISABLE_SHARED
# AC_ENABLE_STATIC
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([limits.h malloc.h stddef.h stdlib.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset sqrt])
AC_CONFIG_FILES([Makefile web/Makefile])
AC_OUTPUT