-
Notifications
You must be signed in to change notification settings - Fork 14
/
configure.ac
175 lines (140 loc) · 4.44 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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([ABC],[1.0],[[email protected]],[abc],[https://github.com/vlab-cs-ucsb/ABC])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_LIBOBJ_DIR([lib])
AM_MAINTAINER_MODE([enable])
# Check for NDEBUG flag
AC_MSG_CHECKING([whether to build with debug information])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debug data generation (defult=yes)])],
[debugit="$enableval"],
[debugit=yes])
AC_MSG_RESULT([$debugit])
AX_CHECK_ENABLE_DEBUG([$debugit],,,)
#if test x"$debugit" = x"yes"; then
# AX_CHECK_ENABLE_DEBUG(,,,[$debugit])
#else
# AX_CHECK_ENABLE_DEBUG(,,,[$debugit])
#fi
# lib building
AC_ENABLE_SHARED
AC_DISABLE_STATIC
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([subdir-objects])
case $host_os in
darwin* )
JAVA_HEADERS="-I/System/Library/Frameworks/JavaVM.framework/Headers"
OS="darwin"
;;
linux*)
JAVA_HEADERS=
OS="linux"
;;
*BSD*)
JAVA_HEADERS=
OS=""
;;
*)
#Default Case
AC_MSG_ERROR([Your platform is not currently supported])
;;
esac
AC_SUBST([JAVA_HEADERS])
AC_SUBST([OS])
# Check for programs
AC_LANG([C++])
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_14([noext])
AX_CHECK_COMPILE_FLAG([-Wall -Wextra -Wno-uninitialized -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter],\
[CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wno-uninitialized -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter"])
#if test x"$debugit" = x"yes"; then
# AC_DEFINE([DEBUG],[],[Debug Mode])
# AX_CHECK_ENABLE_DEBUG(,,,[$debugit])
#else
# AC_DEFINE([NDEBUG],[],[No-debug Mode])
#fi
AM_PROG_LEX
AC_PROG_YACC
# Check for libraries
#LT_INIT([disable-shared])
LT_INIT
AC_HAVE_LIBRARY([glog], [LIBGLOG=-lglog], AC_MSG_ERROR(Glog logging library not found))
AC_SUBST([LIBGLOG])
AC_DEFINE(GLOG_USE_GLOG_EXPORT)
AC_CHECK_LIB([monadfa], [dfaFree], [LIBMONADFA=-lmonadfa], AC_MSG_ERROR(MONA DFA library not found))
AC_SUBST([LIBMONADFA])
AC_CHECK_LIB([monabdd], [bdd_size], [LIBMONABDD=-lmonabdd], AC_MSG_ERROR(MONA BDD library not found))
AC_SUBST([LIBMONABDD])
AC_CHECK_LIB([monamem], [mem_alloc], [LIBMONAMEM=-lmonamem], AC_MSG_ERROR(MONA MEM library not found))
AC_SUBST([LIBMONAMEM])
#AC_LINK_IFELSE(
# [AC_LANG_PROGRAM([#include <boost/multiprecision/cpp_int.hpp>],
# [boost::multiprecision::cpp_int dummy])],
# [],
# [AC_MSG_ERROR([Please install boost multiprecision big number headers])])
AC_CHECK_LIB([m], [floor],[LIBM=-lm], AC_MSG_ERROR(c math library m not found))
AC_SUBST([LIBM])
# Define gmock variables
GMOCK_VERSION="1.7.0"
if test "x$have_pthread" = "xyes"; then
GMOCK_CPPFLAGS="-DGMOCK_HAS_PTHREAD=1"
GMOCK_CXXFLAGS="$PTHREAD_CFLAGS"
GMOCK_LDFLAGS=
GMOCK_LIBS="$PTHREAD_LIBS"
else
GMOCK_CPPFLAGS="-DGMOCK_HAS_PTHREAD=0"
GMOCK_CXXFLAGS=
GMOCK_LDFLAGS=
GMOCK_LIBS=
fi
AC_SUBST([GMOCK_VERSION])
AC_SUBST([GMOCK_CPPFLAGS])
AC_SUBST([GMOCK_CXXFLAGS])
AC_SUBST([GMOCK_LDFLAGS])
AC_SUBST([GMOCK_LIBS])
LIBGTEST=-lgtest
LIBGMOCK=-lgmock
LIBGMOCKMAIN=-lgmock_main
AC_SUBST([LIBGTEST])
AC_SUBST([LIBGMOCK])
AC_SUBST([LIBGMOCKMAIN])
# Define Paths
ABC_PATH=`readlink -f $srcdir`
ABC_CXXFLAGS="-D__ABC_PATH__=$ABC_PATH"
AC_SUBST([ABC_CXXFLAGS])
# TODO remove dependencies that is not needed by cpp later on
# TODO improve library check here
# Check for headers
# Check for functions
AC_DEFUN([FUNCTION_MISSING], [AC_MSG_ERROR(required library function not found)])
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_CHECK_FUNCS(memset localeconv,,FUNCTION_MISSING)
# Check for environment variables
AC_MSG_CHECKING([if JAVA_HOME environment variable is set])
AC_SUBST([JAVA_HOME])
AM_CONDITIONAL([JAVA_HOME_VALID], [test ! -z "$JAVA_HOME"])
AM_COND_IF([JAVA_HOME_VALID],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no, JNI interface will not be loaded. Please set JAVA_HOME path to install JNI support and to make ABC available for JAVA programs.])])
# set global compiler options
# Create Makefile files
AC_CONFIG_FILES([ \
Makefile \
src/Makefile \
src/smt/Makefile \
src/parser/Makefile \
src/utils/Makefile \
src/theory/Makefile \
src/solver/Makefile \
src/interface/Makefile \
test/Makefile \
test/helper/Makefile])
#AC_CONFIG_SUBDIRS([lib/googletest/googletest lib/googletest/googlemock])
#AC_CONFIG_SUBDIRS([external/glog external/LibStranger])
AC_OUTPUT