-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
292 lines (231 loc) · 7.45 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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
dnl Process this file with autoconf to produce a configure script.
# glib style versioning
#
# Making releases:
# vsg_micro_version += 1;
# vsg_interface_age += 1;
# vsg_binary_age += 1;
# if any functions have been added, set vsg_interface_age to 0.
# if backwards compatibility has been broken,
# set vsg_binary_age _and_ vsg_interface_age to 0.
#
m4_define([vsg_major_version], [0])
m4_define([vsg_minor_version], [4])
m4_define([vsg_micro_version], [0])
m4_define([vsg_interface_age], [0])
m4_define([vsg_binary_age],
[m4_eval(100 * vsg_minor_version + vsg_micro_version)])
m4_define([vsg_version],
[vsg_major_version.vsg_minor_version.vsg_micro_version])
# libtool version related macros
m4_define([vsg_lt_release], [vsg_major_version.vsg_minor_version])
m4_define([vsg_lt_current],
[m4_eval(100 * vsg_minor_version + vsg_micro_version - vsg_interface_age)])
m4_define([vsg_lt_revision], [vsg_interface_age])
m4_define([vsg_lt_age], [m4_eval(vsg_binary_age - vsg_interface_age)])
m4_define([vsg_lt_current_minus_age],
[m4_eval(vsg_lt_current - vsg_lt_age)])
AC_INIT(vsg, [vsg_version])
AC_CONFIG_SRCDIR([src/vsg.c])
VSG_MAJOR_VERSION=vsg_major_version
VSG_MINOR_VERSION=vsg_minor_version
VSG_MICRO_VERSION=vsg_micro_version
VSG_INTERFACE_AGE=vsg_interface_age
VSG_BINARY_AGE=vsg_binary_age
VSG_VERSION=vsg_version
AC_SUBST(VSG_MAJOR_VERSION)
AC_SUBST(VSG_MINOR_VERSION)
AC_SUBST(VSG_MICRO_VERSION)
AC_SUBST(VSG_VERSION)
AC_SUBST(VSG_INTERFACE_AGE)
AC_SUBST(VSG_BINARY_AGE)
AC_DEFINE(VSG_MAJOR_VERSION, [vsg_major_version],
[Define to the VSG major version])
AC_DEFINE(VSG_MINOR_VERSION, [vsg_minor_version],
[Define to the VSG minor version])
AC_DEFINE(VSG_MICRO_VERSION, [vsg_micro_version],
[Define to the VSG micro version])
AC_DEFINE(VSG_INTERFACE_AGE, [vsg_interface_age],
[Define to the VSG interface age])
AC_DEFINE(VSG_BINARY_AGE, [vsg_binary_age],
[Define to the VSG binary age])
# libtool versioning
LT_RELEASE=vsg_lt_release
LT_CURRENT=vsg_lt_current
LT_REVISION=vsg_lt_revision
LT_AGE=vsg_lt_age
LT_CURRENT_MINUS_AGE=vsg_lt_current_minus_age
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_SUBST(LT_CURRENT_MINUS_AGE)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(vsg, vsg_version, [no-define])
AM_CONFIG_HEADER(vsg-config.h)
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug], [turns on debugging])],
[enable_debug=yes])
if test "x$enable_debug" = "xyes"; then
case " $CFLAGS " in
*[[\ \ ]]-g[[\ \ ]]*) ;;
*) CFLAGS="$CFLAGS -g" ;;
esac
fi
AC_ARG_ENABLE(check-params,
[AC_HELP_STRING([--enable-check-params],
[turns on function parameters checking])],
[AC_DEFINE(VSG_CHECK_PARAMS, 1, [function parameters checking])])
AC_ARG_ENABLE(msg-trace,
[AC_HELP_STRING([--enable-msg-trace],
[turns on MPI message trace])],
[AC_DEFINE(VSG_PACKED_MSG_TRACE, 1, [turns on MPI packed message trace (for debugging prurpose only)])])
AC_ARG_ENABLE(timings,
[AC_HELP_STRING([--enable-timings],
[turns on some timing messages])],
[AC_DEFINE(VSG_TIMING_OUTPUT, 1, [turns on some timing messages])])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_ISC_POSIX
AM_PROG_LIBTOOL
AM_MISSING_PROG([AUTOM4TE], [autom4te])
AM_PATH_PYTHON(2.2)
VL_PROG_CC_WARNINGS
dnl language choice
AC_LANG_C
dnl Checks for libraries.
AC_CHECK_LIB(m, cos)
PKG_CHECK_MODULES(BASE_DEPENDENCIES, [glib-2.0 >= 2.0.0 gobject-2.0 >= 2.0.0])
CFLAGS="$BASE_DEPENDENCIES_CFLAGS $CFLAGS"
LIBS="$BASE_DEPENDENCIES_LIBS $LIBS "
AC_SUBST(CFLAGS)
AC_SUBST(LIBS)
##################################################
# Check for gtk-doc.
##################################################
AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
if test "x$with_html_dir" = "x" ; then
HTML_DIR='${datadir}/gtk-doc/html'
else
HTML_DIR=$with_html_dir
fi
AC_SUBST(HTML_DIR)
AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
gtk_doc_min_version=0.6
if $GTKDOC ; then
gtk_doc_version=`gtkdoc-mkdb --version`
AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
if perl <<EOF ; then
exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
EOF
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
GTKDOC=false
fi
fi
dnl Let people disable the gtk-doc stuff.
AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
if test x$enable_gtk_doc = xauto ; then
if test x$GTKDOC = xtrue ; then
enable_gtk_doc=yes
else
enable_gtk_doc=no
fi
fi
AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
##################################################
# Check for pygtk.
##################################################
PKG_CHECK_MODULES(PYGTK, pygtk-2.0 ,
[have_pygtk="yes"],
[have_pygtk="no"])
if test x$have_pygtk = xyes ; then
AC_CHECK_PROG(PYGTK, pygtk-codegen-2.0, true, false)
dnl Let people disable python bindings.
AC_ARG_ENABLE(pygtk, [ --enable-pygtk Use pygtk to build Python bindings [default=auto]], enable_pygtk="$enableval", enable_pygtk=auto)
if test x$enable_pygtk = xauto ; then
if test x$PYGTK = xtrue ; then
enable_pygtk=yes
else
enable_pygtk=no
fi
fi
else
enable_pygtk=no
fi
if test x$enable_pygtk = xyes ; then
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
fi
AM_CONDITIONAL(ENABLE_PYGTK, test x$enable_pygtk = xyes)
AC_SUBST(PYGTK_CFLAGS)
AC_SUBST(PYGTK_LIBS)
###############################################################################
# check for MPI parallel libraries.
###############################################################################
dnl Let people disable parallel features.
ACX_MPI_PATHS
if test $MPI_ENABLED = 1; then
have_mpi=yes
VSG_DEFINE_HAVE_MPI="#define VSG_HAVE_MPI"
else
have_mpi=no
VSG_DEFINE_HAVE_MPI="#undef VSG_HAVE_MPI /* Vsg Configured without MPI support */"
fi
AC_SUBST(VSG_DEFINE_HAVE_MPI)
# define automake conditional
AM_CONDITIONAL(VSG_HAVE_MPI, test x$have_mpi = xyes)
# check for MPI_UNSIGNED_LONG_LONG
if test x$have_mpi = xyes; then
AC_LANG_PUSH(C)
orig_CFLAGS="${CFLAGS}"
CFLAGS="${MPI_CFLAGS} ${CFLAGS}"
AC_MSG_CHECKING(if MPI have MPI_UNSIGNED_LONG_LONG)
AC_TRY_COMPILE([#include <mpi.h>],
[MPI_Datatype type; type = MPI_UNSIGNED_LONG_LONG; ],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT([no. Replacing with MPI_LONG_LONG_INT.])
AC_DEFINE(MPI_UNSIGNED_LONG_LONG,MPI_LONG_LONG_INT,
[Replace missing MPI_UNSIGNED_LONG_LONG])])
CFLAGS="${orig_CFLAGS}"
AC_LANG_POP()
fi
dnl Checks for header files.
AC_HEADER_STDC
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_C_INLINE
dnl Checks for library functions.
# Testsuite configuration.
AC_CONFIG_TESTDIR(tests)
# Generate files.
AC_OUTPUT([
vsgd.pc
vsgf.pc
vsg.pc
Makefile
src/Makefile
src/vsgmpi.h
build/Makefile
build/vsg/Makefile
gencode/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/version.xml
tests/Makefile
tests/atlocal
bindings/Makefile
bindings/python/Makefile
bindings/python/examples/Makefile
bindings/python/docs/Makefile
bindings/python/docs/images/Makefile
m4/Makefile
] )