-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
153 lines (122 loc) · 4.32 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# dnl Copyright (C) 2018 Zhijin Li
# dnl All rights reserved.
# dnl Redistribution and use in source and binary forms, with or without
# dnl modification, are permitted provided that the following conditions are
# dnl met:
# dnl * Redistributions of source code must retain the above copyright
# dnl notice, this list of conditions and the following disclaimer.
# dnl * Redistributions in binary form must reproduce the above
# dnl copyright notice, this list of conditions and the following disclaimer
# dnl in the documentation and/or other materials provided with the
# dnl distribution.
# dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
## ---------------------------------------------------------------------------
##
## File: configure.ac for pasta
##
## Created by Zhijin Li
## E-mail: <[email protected]>
##
## Started on Fri Nov 2 16:57:16 2018 Zhijin Li
## Last update Mon Aug 22 14:12:51 2022 Zhijin Li
## ---------------------------------------------------------------------------
AC_PREREQ(2.59)
AC_INIT([Pasta Library], 0.1.0, [email protected], pasta)
AC_CONFIG_HEADER([libs/pasta/pasta/build_info.hh])
PASTA_API_VERSION_CURRENT=0
PASTA_API_VERSION_REV=1
PASTA_API_VERSION_AGE=0
AC_CONFIG_AUX_DIR([m4])
AC_CONFIG_SRCDIR([m4/pasta.m4])
AC_CONFIG_SRCDIR([m4/ax_cxx_compile_stdcxx.m4])
AM_INIT_AUTOMAKE([subdir-objects tar-pax foreign])
AC_CONFIG_MACRO_DIR([m4])
for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS CPP CXXFLAGS; do
eval isset=\${$var+set}
if test "$isset" = 'set' ; then
eval val=$`echo $var`
DISTCHECK_CONFIGURE_FLAGS="${DISTCHECK_CONFIGURE_FLAGS}'${var}=${val}' "
fi
done
# Require standard version C++17.
AX_CXX_COMPILE_STDCXX_17([noext],[mandatory])
# Compiler flags.
CXXFLAGS="-O3 -W -fomit-frame-pointer \
-Wall -Wextra -fopenmp -msse2 \
-Wno-deprecated-declarations \
-Wno-parentheses \
-DPASTA_BUILD"
# Checks for programs.
CXXFLAGS_SAVE="$CXXFLAGS"
AC_PROG_CXX
CXXFLAGS="$CXXFLAGS_SAVE"
AC_PROG_CC
AC_PROG_LIBTOOL
AC_SUBST([PASTA_API_VERSION_CURRENT])
AC_SUBST([PASTA_API_VERSION_AGE])
AC_SUBST([PASTA_API_VERSION_REV])
AC_VERSIONING
AC_CHECK_OPENMP
AC_CHECK_LIB_BOOST
AC_CHECK_LIB_EIGEN3
AC_STATIC_TOOLS
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
AC_SUBST(PROJS_PATH)
# Checks for header files.
AC_HEADER_DIRENT
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_CHECK_FUNCS([pow sqrt])
################# Host OS detection
# Auto add .exe extension for windows build.
AC_CANONICAL_HOST # AC_CANONICAL_HOST is needed to access the 'host_os' variable
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
# Create variable PLATFORM_EXT, pass it to automake
# to be referenced in Makefile.am
AM_CONDITIONAL([BUILD_WIN],[test "$build_windows" = "yes"])
AM_COND_IF([BUILD_WIN],
AC_SUBST(PLATFORM_EXT, .exe),
AC_SUBST(PLATFORM_EXT))
#################
AC_CONFIG_FILES([Makefile
libs/Makefile
libs/pasta/Makefile
Doxyfile
check/Makefile
check/libs/Makefile
check/libs/pasta/Makefile
check/libs/pasta/core/Makefile
check/libs/pasta/sanity/Makefile
])
AC_OUTPUT