-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfigure.in
308 lines (250 loc) · 8.62 KB
/
configure.in
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
AC_PREREQ([2.59])
AC_INIT([sedflux],[2.0.81],[[email protected]])
AC_CONFIG_HEADERS(config.h:config-h.in)
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.9.6 foreign])
AC_PROG_LIBTOOL
AC_PROG_CC
AC_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_PROGS(DPKG, dpkg )
if test x$DPKG != x ; then
DPKG_ARCHITECTURE=`$DPKG --print-installation-architecture`
else
DPKG_ARCHITECTURE=`uname -s`-`uname -p`
fi
AC_CHECK_HEADERS(ieeefp.h)
AC_CHECK_HEADERS(omp.h)
m4_define([glib_required_version],[2.12.0])
m4_define([gtk_required_version],[2.2.0])
m4_define([check_required_version],[0.9.4])
###
### Check for pkg-config. If it's not found... well lets just hope that
### it's found.
###
PKG_PROG_PKG_CONFIG([0.20])
###
### Check for the required version of GLIB-2.0
###
#PKG_CHECK_MODULES(GLIB,[glib-2.0 >= glib_required_version])
AC_ARG_VAR(LIBINTL_DIR,[Path to libintl])
AC_ARG_WITH(libintl-dir,
AC_HELP_STRING([--with-libintl-dir=PATH], [path to libintl]))
if test x$with_libintl_dir != x ; then
GLIB_ADD_TO_VAR(LIBS, -L${with_libintl_dir} , -L${with_libintl_dir})
else
if test x${LIBINTL_DIR} != x ; then
GLIB_ADD_TO_VAR(LIBS, -L${LIBINTL_DIR} , -L${LIBINTL_DIR})
fi
fi
#AC_CHECK_LIB(intl,[main],,AC_MSG_ERROR([Failed to find -lintl required by glib-2.0 in ${with_libintl_dir} : ${LIBS}]) )
AM_PATH_GLIB_2_0( glib_required_version , :,
AC_MSG_ERROR([
*** GLIB glib_required_version or better is required. The latest version of
*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]),
gobject gmodule-no-export gthread)
FLEX_VERSION="not installed"
DOXYGEN_VERSION="not installed"
CHECK_VERSION="not installed"
GTK_VERSION="not installed"
###
### libcheck
### --enable-check turns on unit testing with check
### --with-check-path turns on unit testing and gives the location of check
###
AC_ARG_ENABLE(check,
AC_HELP_STRING([--enable-check], [Use check unit tests]),,
[enable_check=no])
AC_ARG_WITH(check-dir,
AC_HELP_STRING([--with-check-dir=PATH], [path to check]))
if test x$enable_check != xno -a x$with_check_dir == x ; then
PKG_CHECK_MODULES(CHECK,[check >= check_required_version],
CHECK=check,
AC_MSG_ERROR([
*** Checks for check failed. You can build without it by passing
*** --disable-check to configure.]) )
CHECK_VERSION=`$PKG_CONFIG --modversion check`,
fi
save_libs=$LIBS
LIBS=-L$with_check_dir/lib
if test x$enable_check != xno -o x$with_check_dir != x ; then
AC_CHECK_LIB(check,[srunner_create],[CHECK=check])
fi
if test x$with_check_dir != x ; then
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$with_check_dir/lib/pkgconfig
if test x$CHECK != x ; then
CHECK_LIBS=`$PKG_CONFIG --libs check`
CHECK_CFLAGS=`$PKG_CONFIG --cflags check`
#CHECK_LIBS="-L$with_check_dir/lib -lcheck"
#CHECK_CFLAGS="-I$with_check_dir/include -DENABLE_CHECK"
else
AC_MSG_ERROR([*** Failed to find CHECK library in $with_check_dir/lib.])
fi
CHECK_VERSION=`$PKG_CONFIG --modversion check`
fi
LIBS=$save_libs
AC_SUBST(CHECK_LIBS)
AC_SUBST(CHECK_CFLAGS)
AM_CONDITIONAL(ENABLE_CHECK, test x$CHECK != x )
###
### If --enable-libgtk was passed, look for GTK libraries and set
### ENABLE_GTK so that the appropriate files are compiled.
###
AC_ARG_ENABLE(libgtk,
AC_HELP_STRING([--enable-libgtk], [compile GUI using GTK+-2.0]), ,
[enable_libgtk=no])
if test x$enable_libgtk != xno ; then
PKG_CHECK_MODULES(GTK,[gtk+-2.0 >= gtk_required_version],
GTK=gtk,
AC_MSG_ERROR([
*** Checks for GTK+-2.0 failed. You can build without it by passing
*** --disable-libgtk to configure but some programs using GTK+ will
*** not work properly.]) )
GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`,
fi
AM_CONDITIONAL(ENABLE_GTK, test x$GTK != x )
###
### BLAS/LAPACK
### --enable-blas turns on the BLAS libraries.
### --with-blas-path turns on the BLAS libraries but also points to their
### base directory
###
AC_ARG_ENABLE(blas,
AC_HELP_STRING([--enable-blas], [Use BLAS/LAPACK]),,
[enable_blas=no])
AC_ARG_WITH(blas-dir,
AC_HELP_STRING([--with-blas-dir=PATH], [path to BLAS/LAPACK]))
if test x$enable_blas != xno -a x$with_blas_dir == x ; then
PKG_CHECK_MODULES(BLAS,[blas >= blas_required_version],
BLAS=blas,
AC_MSG_ERROR([
*** Checks for BLAS failed. You can build without it by passing
*** --disable-blas to configure.]) )
BLAS_VERSION=`$PKG_CONFIG --modversion blas`,
fi
save_libs=$LIBS
LIBS=-L$with_blas_dir/lib
AC_CHECK_LIB(cblas,[cblas_dscal],[BLAS=blas],,[-latlas])
if test x$with_blas_dir != x ; then
if test x$BLAS != x ; then
BLAS_LIBS="-L$with_blas_dir/lib -lcblas -latlas"
BLAS_CFLAGS="-I$with_blas_dir/include -DENABLE_BLAS"
else
AC_MSG_ERROR([*** Failed to find BLAS library in $with_blas_dir/lib.])
fi
fi
LIBS=$save_libs
AC_SUBST(BLAS_LIBS)
AC_SUBST(BLAS_CFLAGS)
AM_CONDITIONAL(ENABLE_BLAS, test x$BLAS != x )
###
### --with-html-dir specifies the path to install HTML docs into
### should we build documentation.
###
AC_ARG_WITH(html-dir,
AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
[with_html_dir='${datadir}/ew-doc/html'])
HTML_DIR="$with_html_dir"
AC_SUBST(HTML_DIR)
###
### If --enable-doxygen then the documentation will be built using the
### Doxygen program.
###
AC_ARG_ENABLE(doxygen,
AC_HELP_STRING([--enable-doxygen],
[use doxygen to build documentation [default=no]]),,
[enable_doxygen=no])
if test x$enable_doxygen != xno ; then
AC_CHECK_PROGS(DOXYGEN, doxygen )
if test x$DOXYGEN != x ; then
DOXYGEN_VERSION=`$DOXYGEN --version`
else
AC_MSG_ERROR([
*** Program Doxygen was not found. If you don't need to generate documentaion,
*** use the --disable-doxygen option when configuring. Otherwise, if you
*** have doxygen, make sure it is in your path. ])
fi
AC_CHECK_LIB(fl,[main])
if test x$HAVE_LIBFL != x ; then
AC_CHECK_PROGS( FLEX , flex )
if test x$FLEX != x ; then
FLEX_VERSION=`$FLEX --version`
enable_flex=yes
fi
fi
fi
AM_CONDITIONAL(ENABLE_DOXYGEN, test x$enable_doxygen = xyes )
AM_CONDITIONAL(ENABLE_FLEX, test x$enable_flex = xyes )
AC_CHECK_FUNCS( log2 , [GLIB_ADD_TO_VAR(CFLAGS,-DHAVE_LOG2,-DHAVE_LOG2)])
AC_CHECK_FUNCS( fgetln , [GLIB_ADD_TO_VAR(CFLAGS,-DHAVE_FGETLN,-DHAVE_FGETLN)])
AC_CHECK_FUNCS( getline , [GLIB_ADD_TO_VAR(CFLAGS,-DHAVE_GETLINE,-DHAVE_GETLINE)])
# Since moving to Leopard, I have to add this
GLIB_ADD_TO_VAR(CFLAGS,-DG_IMPLEMENT_INLINES,-DG_IMPLEMENT_INLINES)
cflags_set="$CFLAGS"
###
### Add the GLIB flags to CFLAGS
###
GLIB_ADD_TO_VAR(CFLAGS, ${GLIB_CFLAGS} , ${GLIB_CFLAGS} )
GLIB_ADD_TO_VAR(LIBS, ${GLIB_LIBS} , ${GLIB_LIBS} )
GLIB_ADD_TO_VAR(LIBS, -lm , -lm )
AC_SUBST( GLIB_LIBS )
AC_SUBST( GLIB_CFLAGS )
AC_SUBST( GTK_LIBS )
AC_SUBST( GTK_CFLAGS )
AC_SUBST( CHECK_LIBS )
AC_SUBST( CHECK_CFLAGS )
AC_SUBST( DPKG_ARCHITECTURE )
AC_CONFIG_FILES([ ew/utils/utils.pc ])
AC_CONFIG_FILES([ ew/sed/sedflux.pc ])
AC_CONFIG_FILES([Makefile \
ew/Makefile \
ew/utils/Makefile \
ew/sed/Makefile \
ew/avulsion/Makefile \
ew/bing/Makefile \
ew/bio/Makefile \
ew/compact/Makefile \
ew/diffusion/Makefile \
ew/failure/Makefile \
ew/flow/Makefile \
ew/inflow/Makefile \
ew/muds/Makefile \
ew/plume/Makefile \
ew/quake/Makefile \
ew/sakura/Makefile \
ew/squall/Makefile \
ew/subside/Makefile \
ew/xshore/Makefile \
ew/sedflux/Makefile \
ew/hydrotrend/Makefile \
ew/sedutils/Makefile \
ew/sedflux/runsedflux \
ew/sedflux/sedflux-run-batch \
docs/sedflux-doxyfile \
docs/Makefile \
deb/Makefile deb/control \
rpm/Makefile rpm/sedflux.spec ])
AC_OUTPUT
echo \
"------------------------------------------------------------------------
Configuration:
Source code location: ${srcdir}
Compiler: ${CC}
Compiler flags: ${cflags_set}
Host System Type: ${host}
Installation architecture: ${DPKG_ARCHITECTURE}
Install path: ${prefix}
With gtk+-2.0: ${GTK_VERSION}
With check: ${CHECK_VERSION}
With doxygen: ${DOXYGEN_VERSION}
With flex: ${FLEX_VERSION}
HTML path: ${HTML_DIR}
BLAS path: ${with_blas_dir}
BLAS LIBS: ${BLAS_LIBS}
BLAS CFLAGS: ${BLAS_CFLAGS}
See config.h for further configuration information.
------------------------------------------------------------------------"