-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
250 lines (207 loc) · 6.85 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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
AC_INIT([nvc], [0.1],
[Nick Gasson <[email protected]>],
[nvc])
dnl Automake 1.11 does not support the serial-tests option
dnl Remove this when 1.11 no longer in common use
m4_define([serial_tests], [
m4_esyscmd([
automake --version |
head -1 |
awk '{split ($NF,a,"."); if (a[1] == 1 && a[2] >= 12) { print "serial-tests" }}'
])
])
m4_include([m4/autoconf-2.63_compat.m4])
AM_INIT_AUTOMAKE([1.11 -Wall -Wno-extra-portability color-tests
foreign subdir-objects] serial_tests)
AM_SILENT_RULES([yes])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AM_PROG_LEX
AC_PROG_RANLIB
AC_EXEEXT
AC_C_INLINE
AC_C_RESTRICT
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_PID_T
AC_FUNC_MMAP
AC_FUNC_ALLOCA
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_FORK
AC_FUNC_FSEEKO
AC_FUNC_STRTOD
AC_CHECK_FUNCS([strdup mkdir realpath rmdir strerror strcasecmp \
memset strchr strrchr strstr setenv])
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([limits.h stddef.h fcntl.h libintl.h malloc.h \
sys/socket.h execinfo.h sys/ptrace.h sys/sysctl.h \
sys/prctl.h])
AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec])
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec])
AX_CHECK_LINK_FLAG([-rdynamic],
[RDYNAMIC_FLAG="-rdynamic"],
[RDYNAMIC_FLAG=""])
AC_SUBST(RDYNAMIC_FLAG)
AX_CHECK_COMPILE_FLAG([-fPIC],
[PIC_FLAG="-fPIC"],
[PIC_FLAG=""],
[-Werror])
AC_SUBST(PIC_FLAG)
AX_PROG_FLEX([], [AC_MSG_ERROR(GNU Flex not found)])
case $host_os in
openbsd*)
# Need -pthread for TCL on OpenBSD
AX_PTHREAD
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS"
# Need to link libexecinfo explicitly
AC_SEARCH_LIBS([backtrace_symbols], [execinfo], [],
[AC_MSG_ERROR(libexecinfo not found)], [])
;;
*cygwin*)
# LLVM on Cygwin needs libffi and curses
AX_WITH_CURSES
if test "x$ax_cv_curses" != xyes; then
AC_MSG_ERROR([LLVM on Cygwin requires curses])
fi
AC_SEARCH_LIBS([ffi_call], [ffi], [],
[AC_MSG_ERROR(LLVM on Cygwin requires libffi)], [])
;;
esac
AC_SEARCH_LIBS([dlopen], [dl dld], [], [
AC_MSG_ERROR([unable to find the dlopen() function])
])
AC_CHECK_HEADERS([tcl.h tcl/tcl.h], [have_tcl=yes; break], [])
AC_SEARCH_LIBS([Tcl_CreateInterp], [tcl tcl86], [],
[AC_MSG_ERROR(TCL library not found)], [])
if test ! x$have_tcl = xyes ; then
AC_MSG_ERROR(TCL header file not found)
fi
AX_LIB_READLINE
if test "x$ax_cv_lib_readline" = xno ; then
AC_MSG_WARN(terminal line editing will not be supported)
fi
AC_CHECK_LIB([z], [deflate], [], [AC_MSG_ERROR(zlib not found)])
# fst/fstapi.c can use pthread to write FST in parallel if HAVE_LIBPTHREAD
# and FST_WRITER_PARALLEL is defined.
# FIXME: -lpthread may be in LLVM_LDFLAGS already.
AC_ARG_ENABLE([fst_pthread],
[AS_HELP_STRING([--enable-fst-pthread],
[Use pthread to write FST in parallel])],
[enable_fst_pthread=$enableval],
[enable_fst_pthread=no])
if test x$enable_fst_pthread = xyes ; then
AX_PTHREAD([], [AC_MSG_ERROR([pthread not found])])
if test x$ax_pthread_ok = xyes ; then
AC_DEFINE_UNQUOTED([HAVE_LIBPTHREAD], [1],
[Preprequisite definition of GTKWave for parallel FST writer])
AC_DEFINE_UNQUOTED([FST_WRITER_PARALLEL], [1],
[Internal definition of GTKWave for parallel FST writer])
fi
fi
AM_CONDITIONAL([FST_WRITER_PARALLEL], [test x$ax_pthread_ok = xyes])
# fst/fstapi.c can use Judy instead of builtin Jenkins if _WAVE_HAVE_JUDY is defined.
AC_ARG_ENABLE([fst_judy],
[AS_HELP_STRING([--enable-fst-judy],
[Use Judy instead of builtin Jenkins for FST])],
[enable_fst_judy=$enableval],
[enable_fst_judy=no])
if test x$enable_fst_judy = xyes ; then
AC_CHECK_LIB([Judy], [JudyHSIns], [], [AC_MSG_ERROR(Judy not found)])
AC_DEFINE_UNQUOTED([_WAVE_HAVE_JUDY], [1], [Internal definition of GTKWave for Judy])
fi
AX_LLVM_C([engine bitreader bitwriter ipo linker])
AM_CONDITIONAL([FORCE_CXX_LINK], [test ! x$ax_cv_llvm_shared = xyes])
PKG_CHECK_EXISTS([check],
[PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [], [])],
[AC_MSG_WARN(libcheck not found - unit tests will not run)])
AX_DEFINE_DIR([DATADIR], [datadir/nvc], [Installation data directory])
AX_DEFINE_DIR([LIBDIR], [libdir], [Installation library directory])
AX_DEFINE_DIR([TESTDIR], [srcdir/test], [Location of testcases])
# CC may constain unwanted -std=... option.
AC_DEFINE_UNQUOTED([SYSTEM_CC], ["$(which ${CC%% *})"], [System compiler])
AC_ARG_ENABLE([native],
[AS_HELP_STRING([--enable-native],
[Enable native code generation])],
[enable_native=$enableval],
[enable_native=yes])
if test x$enable_native = xyes ; then
AC_DEFINE_UNQUOTED([ENABLE_NATIVE], [1], [Enable native code generation])
case $host_os in
*cygwin*) implib_required=yes ;;
esac
if test x$implib_required = xyes ; then
AC_DEFINE_UNQUOTED([IMPLIB_REQUIRED], [1], [Import library required])
fi
fi
AM_CONDITIONAL([ENABLE_NATIVE], [test x$enable_native = xyes])
AM_CONDITIONAL([IMPLIB_REQUIRED], [test x$implib_required = xyes])
AC_ARG_ENABLE([vhpi],
[AS_HELP_STRING([--enable-vhpi],
[Enable VHPI plugins])],
[enable_vhpi=$enableval],
[enable_vhpi=no])
AM_CONDITIONAL([ENABLE_VHPI], [test x$enable_vhpi = xyes])
if test x$enable_vhpi = xyes; then
AC_DEFINE_UNQUOTED([ENABLE_VHPI], [1], [VHPI is enabled])
case $host_os in
darwin*)
VHPI_LDFLAGS="-flat_namespace -undefined dynamic_lookup"
;;
esac
AC_SUBST(VHPI_LDFLAGS)
fi
AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--enable-werror], [Treat warnings as errors])],
[enable_werror=$enableval]
[])
if test x$enable_werror = xyes ; then
WERROR_CFLAGS="-Werror"
fi
AC_SUBST(WERROR_CFLAGS)
# AC_PC_FROM_UCONTEXT doesn't accept []-quoted argument.
AC_PC_FROM_UCONTEXT(AC_MSG_WARN(no way to access program counter - stack trace is disabled))
if test x$pc_field_found = xfalse ; then
AC_DEFINE_UNQUOTED([NO_STACK_TRACE], [1], [Disable stack trace support])
fi
# Turn on silent make when using the GNU version
AX_CHECK_GNU_MAKE
if ! test x$_cv_gnu_make_command = x ; then
MAKEFLAGS='$(if $(V),,-s)'
fi
AC_SUBST(MAKEFLAGS)
# Optional code coverage statistics
AC_ARG_ENABLE([gcov],
[AS_HELP_STRING([--enable-gcov],
[Instrument compiler with gcov (for development only)])],
[enable_gcov=$enableval],
[])
if test x$enable_gcov = xyes ; then
COV_CFLAGS="--coverage --no-inline -Og"
COV_LDFLAGS="--coverage"
AC_MSG_WARN([code coverage with gcov is for use in development only])
fi
AC_SUBST(COV_CFLAGS)
AC_SUBST(COV_LDFLAGS)
AM_CONDITIONAL([ENABLE_GCOV], [test x$enable_gcov = xyes])
AC_CHECK_PROG([RONN], [ronn], [1])
AM_CONDITIONAL([HAVE_RONN], [test -n "$RONN"])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT