-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
235 lines (188 loc) · 5.75 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
# Process this file with autoconf to produce a configure script.
# glib style versioning
#
# Making releases:
# aran_micro_version += 1;
# aran_interface_age += 1;
# aran_binary_age += 1;
# if any functions have been added, set aran_interface_age to 0.
# if backwards compatibility has been broken,
# set aran_binary_age _and_ aran_interface_age to 0.
#
m4_define([aran_major_version], [0])
m4_define([aran_minor_version], [4])
m4_define([aran_micro_version], [0])
m4_define([aran_interface_age], [0])
m4_define([aran_binary_age],
[m4_eval(100 * aran_minor_version + aran_micro_version)])
m4_define([aran_version],
[aran_major_version.aran_minor_version.aran_micro_version])
# libtool version related macros
m4_define([aran_lt_release], [aran_major_version.aran_minor_version])
m4_define([aran_lt_current],
[m4_eval(100 * aran_minor_version + aran_micro_version - aran_interface_age)])
m4_define([aran_lt_revision], [aran_interface_age])
m4_define([aran_lt_age], [m4_eval(aran_binary_age - aran_interface_age)])
m4_define([aran_lt_current_minus_age],
[m4_eval(aran_lt_current - aran_lt_age)])
AC_INIT(aran, [aran_version])
AC_CONFIG_SRCDIR([aran/aran.c])
ARAN_MAJOR_VERSION=aran_major_version
ARAN_MINOR_VERSION=aran_minor_version
ARAN_MICRO_VERSION=aran_micro_version
ARAN_INTERFACE_AGE=aran_interface_age
ARAN_BINARY_AGE=aran_binary_age
ARAN_VERSION=aran_version
AC_SUBST(ARAN_MAJOR_VERSION)
AC_SUBST(ARAN_MINOR_VERSION)
AC_SUBST(ARAN_MICRO_VERSION)
AC_SUBST(ARAN_VERSION)
AC_SUBST(ARAN_INTERFACE_AGE)
AC_SUBST(ARAN_BINARY_AGE)
AC_DEFINE(ARAN_MAJOR_VERSION, [aran_major_version],
[Define to the ARAN major version])
AC_DEFINE(ARAN_MINOR_VERSION, [aran_minor_version],
[Define to the ARAN minor version])
AC_DEFINE(ARAN_MICRO_VERSION, [aran_micro_version],
[Define to the ARAN micro version])
AC_DEFINE(ARAN_INTERFACE_AGE, [aran_interface_age],
[Define to the ARAN interface age])
AC_DEFINE(ARAN_BINARY_AGE, [aran_binary_age],
[Define to the ARAN binary age])
# libtool versioning
LT_RELEASE=aran_lt_release
LT_CURRENT=aran_lt_current
LT_REVISION=aran_lt_revision
LT_AGE=aran_lt_age
LT_CURRENT_MINUS_AGE=aran_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(aran, aran_version, [no-define])
AM_CONFIG_HEADER(aran-config.h)
# Checks for programs.
AC_PROG_CC
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_ISC_POSIX
AM_PROG_LEX
AC_PROG_YACC
AM_PROG_LIBTOOL
AM_MISSING_PROG([AUTOM4TE], [autom4te])
AC_CHECK_PROG(INDENT, indent, indent)
AM_PATH_PYTHON(2.2)
VL_PROG_CC_WARNINGS
# language choice
AC_LANG_C
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(timings,
[AC_HELP_STRING([--enable-timings],
[turns on some timing messages])],
[AC_DEFINE(VSG_TIMING_OUTPUT, 1, [turns on some timing messages])])
# Checks for libraries.
AC_CHECK_LIB(m, cos)
# Check for variable length array support
ARAN_C_VARIABLE_ARRAY
# We need libmingwex.a for complex numbers support on cygwin
case $host in
*-*-mingw32* | *-*-cygwin*)
mingw_include="-I/usr/include/mingw"
mingw_ldflags="-L/usr/lib/mingw"
mingw_libadd="-lcrtdll -lmingwex"
CFLAGS="$CFLAGS $mingw_include"
CXXFLAGS="$CXXFLAGS $mingw_include"
LDFLAGS="$LDLFAGS $mingw_ldflags"
AC_CHECK_LIB([crtdll], [_fopen])
AC_CHECK_LIB([mingwex], [cexp])
;;
*)
AC_CHECK_LIB([m],[cexp])
;;
esac
# subst for pkg-config files
AC_SUBST(mingw_include)
AC_SUBST(mingw_ldflags)
AC_SUBST(mingw_libadd)
# Check for CC complex numbers support
ARAN_C_COMPLEX
# Check for C complex numbers support with C++
ARAN_CXX_CCOMPLEX
PKG_CHECK_MODULES(BASE_DEPENDENCIES, [glib-2.0 >= 2.0.0 gobject-2.0 >= 2.0.0
gmodule-2.0 >= 2.0.0 vsgd >= 0.2.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
# 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)
# Checks for header files.
AC_HEADER_STDC
#
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_C_INLINE
# Checks for library functions.
# Testsuite configuration.
AC_CONFIG_TESTDIR(tests)
# Generate files.
AC_OUTPUT([
aran.pc
Makefile
gencode/Makefile
aran/Makefile
aran/aranccomplex.h
m4/Makefile
tests/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/version.xml
] )