-
Notifications
You must be signed in to change notification settings - Fork 25
/
configure.ac
226 lines (195 loc) · 6.06 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# Force autoconf to be at least this version number:
#AC_PREREQ([2.68])
# AC_INIT([package], [version], [bug-report], [tarname], [url])
AC_INIT([DtCraft], [0.2.3], [[email protected]],
[DtCraft], [http://dtcraft.web.engr.illinois.edu/])
# Project-specific macros.
AC_DEFINE_UNQUOTED([DTC_HOME], ["`pwd`"], ["Home directory of DtCraft"])
# Safety check - list a source file that wouldn't be in other directories:
#AC_CONFIG_SRCDIR([src/hello.c])
# Put autotools auxiliary files in a subdir, so they don't clutter top dir:
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
# Check for which host we are on and setup a few host-specific things
AC_CANONICAL_HOST
case $host_os in
*linux*)
# Do something specific for linux
;;
*)
#Default Case
AC_MSG_ERROR([
-------------------------------------------------------------------------------
Linux platform is required.
-------------------------------------------------------------------------------])
;;
esac
# Substitute variables.
AC_SUBST(TEST_LIBS)
# Enable "automake" to simplify creating makefiles:
AM_INIT_AUTOMAKE([subdir-objects tar-ustar])
# Enable "libtool" to simplify creating makefiles:
#LT_PREREQ([2.2])
LT_INIT
LT_LANG([C++])
# Enable "pkg-config" tto simplify creating package linking/flags.
#PKG_PROG_PKG_CONFIG([0.22])
# Specify where the Makefile should be produced.
# These are the same locations as your Makefile.in's, but named as Makefile only.
# We need to do this because both Autoconf and Automake read this file and produce
# Makefiles from this list.
AC_CONFIG_FILES([Makefile])
AC_CONFIG_HEADERS([include/dtc/config.hpp])
# Language configuration.
AC_LANG(C++)
# Program configuration.
AC_PROG_CXX
AC_PROG_YACC
AC_PROG_AWK
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
# Check for the compiler
AX_COMPILER_VENDOR
AX_COMPILER_VERSION
AS_CASE($ax_cv_cxx_compiler_vendor,
[gnu], [
AX_COMPARE_VERSION(
[$ax_cv_cxx_compiler_version],
[ge],
[7.2],
[is_ge_gxx_7_2=yes],
[is_ge_gxx_7_2=no]
)
if [[ $is_ge_gxx_7_2 != "yes" ]]; then
AC_MSG_ERROR(
[GCC 7 (with c++17) or higher required (found $ax_cv_cxx_compiler_version)]
)
fi
], [
AC_MSG_ERROR([$ax_cv_cxx_compiler_vendor is an unsupported compiler])
]
)
# Check the cpu count
AX_COUNT_CPUS([],[CPU_COUNT=1])
AC_SUBST(CPU_COUNT)
# Check the Python module
#AM_PATH_PYTHON([3.2],,[AC_MSG_ERROR([DtCraft requires Python >= 3.2])])
#
#AC_ARG_VAR([PYTHON_CPPFLAGS], [Include flags for python])
#AC_ARG_VAR([PYTHON_LDFLAGS], [Library flags for python])
#AC_ARG_VAR([PYTHON_LIBS], [Library flags for python])
#AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
#AC_PATH_PROGS([PYTHON_CONFIG], [python$PYTHON_VERSION-config python-config], [no])
##AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON])])
#
#if test "x$PYTHON_CONFIG" = "xno"; then
# AC_MSG_ERROR([cannot find python-config for $PYTHON])
#else
# PYTHON_CPPFLAGS=`$PYTHON_CONFIG --includes`
# PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags`
# PYTHON_LIBS=`$PYTHON_CONFIG --libs`
#fi
# Library, header check, so we can easily #include them:
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([sys/devpoll.h])
AC_CHECK_HEADERS([sys/epoll.h])
AC_CHECK_HEADERS([sys/poll.h])
AC_CHECK_HEADERS([sys/select.h])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([sys/event.h])
AC_CHECK_HEADERS([sys/eventfd.h])
AC_CHECK_HEADERS([sys/signalfd.h])
AC_CHECK_HEADERS([sys/stat.h])
# Type check.
AC_CHECK_TYPES([fd_mask], , ,)
# Func check.
AC_CHECK_FUNCS(inotify_init)
AC_CHECK_FUNCS(epoll_ctl)
AC_CHECK_FUNCS(kqueue)
AC_CHECK_FUNCS(port_create)
AC_CHECK_FUNCS(poll)
AC_CHECK_FUNCS(select)
AC_CHECK_FUNCS(eventfd)
AC_CHECK_FUNCS(signalfd)
AC_CHECK_FUNCS(getloadavg)
# Check for 3rd-party libraries.
#AC_SEARCH_LIBS([shm_open], [rt], [], [AC_MSG_ERROR([shm_open not found in librt])])
AX_PTHREAD([have_pthread=yes], [AC_MSG_ERROR([pthread library is required])])
#AX_LEVELDB(
# [],
# [],
# [AC_MSG_ERROR([
#-------------------------------------------------------------------------------
#LevelDB is required
#Please download the package at https://github.com/google/leveldb
#-------------------------------------------------------------------------------])]
#)
#AX_GTEST(
# [],
# [],
# [AC_MSG_ERROR([
#-------------------------------------------------------------------------------
#gtest is required
#
#Please use the following instructions to install the google test.
#
#1. Go to the google test framework
#
# $ wget https://github.com/google/googletest/archive/release-1.7.0.tar.gz
#
#2. Unpack and build google test
#
# $ tar xf release-1.7.0.tar.gz
# $ cd googletest-release-1.7.0
# $ cmake -DBUILD_SHARED_LIBS=ON .
# $ make
#
#3. "Install" the headers and libs on your system.
#
# $ sudo cp -a include/gtest /usr/include
# $ sudo cp -a libgtest_main.so libgtest.so /usr/lib/
#
#4. Update the cache of the linker
#
# $ sudo ldconfig -v | grep gtest
#-------------------------------------------------------------------------------])]
#)
#AX_LIBSTATGRAB(
# [],
# [],
# [AC_MSG_ERROR([
#-------------------------------------------------------------------------------
#Libstatgrab is required
#Please download the package at https://www.i-scream.org/libstatgrab/
#-------------------------------------------------------------------------------])]
#)
#BOOST_REQUIRE(
# [1.5],
# [AC_MSG_ERROR([
#-------------------------------------------------------------------------------
#Boost library > 1.5 is required
#Please download the package at http://www.boost.org/
#-------------------------------------------------------------------------------])]
#)
#
#BOOST_VARIANT
# Do final output.
AC_OUTPUT
LT_OUTPUT
AC_OUTPUT
echo
echo "DtCraft configuration summary:"
echo
echo " - Package version (major.minor.micro): $PACKAGE_VERSION"
echo " - Library version (current:revision:age): $LIB_VERSION"
echo " - Prefix: $prefix"
echo " - Building on: $build"
echo " - Building for: $host"
echo " - CXX: $CXX"
echo " - CXXFLAGS: $CXXFLAGS"
echo " - CPPFLAGS: $CPPFLAGS"
echo " - LDFLAGS: $LDFLAGS"
echo " - LIBS: $LIBS"
echo