-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
executable file
·87 lines (64 loc) · 2.1 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
# Information about project
AC_PREREQ(2.59)
AC_INIT([dem-grain-gen],[0.0.1],[[email protected]])
# Check for main file
AC_CONFIG_SRCDIR([src/main.cc])
# Check for automake for minimal API version 1.9
AM_INIT_AUTOMAKE([subdir-objects])
# Specify Macro Directory
#AC_CONFIG_MACRO_DIR([m4])
# Check for C++ Compilers and libraries
AC_PROG_CXX
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
# use the C++ compiler for the following checks
AC_LANG([C++])
# Use to enable C++11 Standard in the compiler
AX_CXX_COMPILE_STDCXX_11([ext],[mandatory])
# OpenMP Check
#AC_OPENMP
# BOOST Library Check
#BOOST_REQUIRE([1.40.0])
# Enable silent rules for build
AM_SILENT_RULES([yes])
# Checks for header files and functions.
AC_HEADER_STDC
AC_CHECK_HEADERS([algorithm])
AC_CHECK_HEADERS([cstdlib])
AC_CHECK_HEADERS([cassert])
AC_CHECK_HEADERS([memory])
AC_CHECK_HEADERS([string])
AC_CHECK_HEADERS([vector])
AC_CHECK_FUNCS([mkdir])
AC_CHECK_FUNCS([pow])
AC_CHECK_FUNCS([sqrt])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
# distribute additional compiler and linker flags
# --> set these variables instead of CXXFLAGS or LDFLAGS
AC_SUBST([ACLOCAL_AMFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_SUBST([LIBS])
##########################################################################
# debug compilation support
##########################################################################
AC_MSG_CHECKING([whether to build with debug information])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debug data generation (def=no)])],
[debugit="$enableval"],
[debugit=no])
AC_MSG_RESULT([$debugit])
if test x"$debugit" = x"yes"; then
AC_DEFINE([DEBUG],[],[Debug Mode])
AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -Werror -Wno-uninitialized -O0"
else
AC_DEFINE([NDEBUG],[],[No-debug Mode])
AM_CXXFLAGS="$AM_CXXFLAGS -g -O3 -std=c++11 -fPIC -Wall -Wno-uninitialized"
fi
##########################################################################
# Files to generate via autotools specify source file location
AC_CONFIG_FILES([Makefile])
# Generate the final Makefile
AC_OUTPUT