File: configure.ac

package info (click to toggle)
mathgl 1.11.2-17
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 12,928 kB
  • sloc: cpp: 40,613; sh: 11,033; ansic: 554; makefile: 326; python: 56; pascal: 52
file content (407 lines) | stat: -rw-r--r-- 14,191 bytes parent folder | download
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
AC_INIT([mathgl], [1.11.2], [mathgl.abalakin@gmail.com])

MGL_RELEASE=1.11.2
AC_SUBST(MGL_RELEASE)

AC_CONFIG_MACRO_DIR([config])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(mgl)
AC_CONFIG_HEADER(include/mgl/config.h)
AC_LANG([C++])

#MGL_RELEASE=1.4
#AC_SUBST(MGL_RELEASE)

# LT Version numbers, remember to change them just *before* a release.
#   (Interfaces removed:    CURRENT++, AGE=0, REVISION=0)
#   (Interfaces added:      CURRENT++, AGE++, REVISION=0)
#   (No interfaces changed:                   REVISION++)
MGL_CURRENT=5
MGL_REVISION=0
MGL_AGE=0
AC_SUBST(MGL_CURRENT)
AC_SUBST(MGL_REVISION)
AC_SUBST(MGL_AGE)

AM_INIT_AUTOMAKE

AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL

AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL

AC_ARG_ENABLE(double,
[  --enable-double    Turn on double precision in MathGL library],
[case "${enableval}" in
  yes) double=true ;;
  no)  double=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-double) ;;
esac],[double=false])

if (test x$double = xtrue) ;then
    AC_DEFINE([MGL_USE_DOUBLE],1,[This define enables double precision in MathGL])
else
    AC_DEFINE([MGL_USE_DOUBLE],0,[This define enables double precision in MathGL])
fi

AC_ARG_ENABLE(all,
[  --enable-all    Turn on all features],
[case "${enableval}" in
  yes) all=true ;;
  no)  all=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-all) ;;
esac],[all=false])

AC_ARG_ENABLE(langall,
[  --enable-langall    Turn on all language interfaces],
[case "${enableval}" in
  yes) langall=true ;;
  no)  langall=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-langall) ;;
esac],[langall=false])

AC_ARG_ENABLE(pthread,
[  --enable-pthread    Turn on pthread support in MathGL library],
[case "${enableval}" in
  yes) pthread=true ;;
  no)  pthread=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-pthread) ;;
esac],[pthread=true])
AC_CHECK_HEADER(pthread.h,[(test x$all = xtrue || test x$pthread = xtrue) && PTHREAD_FLAGS=-DHAVE_PTHREAD AC_SUBST(PTHREAD_FLAGS)],
    [(test x$all = xtrue || test x$pthread = xtrue) && echo "Please install posix threads headers" && exit])

AC_CHECK_LIB([pthread], [main], [(test x$all = xtrue || test x$pthread = xtrue) && PTHREAD_LIBS=-lpthread AC_SUBST(PTHREAD_LIBS)], 
    [(test x$all = xtrue || test x$pthread = xtrue) && echo "Please install posix threads library" && exit])
AM_CONDITIONAL(USE_PTHREAD, test x$pthread = xtrue)

AC_ARG_ENABLE(gsl,
[  --enable-gsl    Turn on gsl functions],
[case "${enableval}" in
  yes) gsl=true ;;
  no)  gsl=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-gsl) ;;
esac],[gsl=true])

if (test x$all = xtrue || test x$gsl = xtrue) ;then
    GSL_PROG=gsl-config
    AC_CHECK_PROG(GSL_FLAGS,$GSL_PROG,`$GSL_PROG --cflags`)
    AC_CHECK_PROG(GSL_LIBS,$GSL_PROG,`$GSL_PROG --libs`)
    if test "$GSL_LIBS" ;then
	test_gsl=true
    else
	echo "Please install gsl headers and libraries and make sure that \
	path to $GSL_PROG exist in your PATH"
	exit
    fi
else
    GSL_FLAGS=-DNO_GSL
    AC_SUBST(GSL_FLAGS)
fi
AM_CONDITIONAL(USE_GSL, test x$test_gsl = xtrue)

AC_ARG_ENABLE(glut,
[  --enable-glut    Turn on glut],
[case "${enableval}" in
  yes) glut=true ;;
  no)  glut=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-glut) ;;
esac],[glut=false])

case "${host}" in
  *darwin*)
	GL_LIBS="-framework OpenGL"
	AC_SUBST(GL_LIBS)
	if (test x$all = xtrue || test x$glut = xtrue) ;then
	    GLUT_LIBS="-framework GLUT -framework OpenGL"
	    AC_SUBST(GLUT_LIBS)
	fi
       ;;

  *w32*)
	GL_LIBS=opengl32
	AC_CHECK_HEADER([GL/gl.h],,[echo "Please install OpenGL headers (GL/gl.h)"; exit])
	AC_CHECK_LIB([${GL_LIBS}], [main], [GL_LIBS=-l${GL_LIBS} AC_SUBST(GL_LIBS)], 
	    [echo "Please install OpenGL library (lib${GL_LIBS}.a)"; exit])
	GLUT_LIBS=glut32
	AC_CHECK_HEADER([GL/glut.h],[(test x$all = xtrue || test x$glut = xtrue) && GLUT_FLAGS=-DHAVE_GLUT AC_SUBST(GLUT_FLAGS)],
	    [(test x$all = xtrue || test x$glut = xtrue) && (echo "Please install FreeGLUT headers (GL/glut.h)" && exit)])
	AC_CHECK_LIB([${GLUT_LIBS}], [main], [(test x$all = xtrue || test x$glut = xtrue) && GLUT_LIBS=-l${GLUT_LIBS} AC_SUBST(GLUT_LIBS)],
	    [(test x$all = xtrue || test x$glut = xtrue) && echo "Please install FreeGLUT library (lib${GLUT_LIBS}.a)" && exit])
       ;;

       *)
	GL_LIBS=GL
	AC_CHECK_HEADER(GL/gl.h,,[echo "Please install OpenGL headers (GL/gl.h)"; exit])
	AC_CHECK_LIB([${GL_LIBS}], [main], [GL_LIBS=-l${GL_LIBS} AC_SUBST(GL_LIBS)], 
	    [echo "Please install OpenGL library (lib${GL_LIBS}.a)"; exit])
	GLUT_LIBS=glut
	AC_CHECK_HEADER(GL/glut.h,[(test x$all = xtrue || test x$glut = xtrue) && GLUT_FLAGS=-DHAVE_GLUT AC_SUBST(GLUT_FLAGS)],
	    [(test x$all = xtrue || test x$glut = xtrue) && (echo "Please install FreeGLUT headers (GL/glut.h)" && exit)])
	AC_CHECK_LIB([${GLUT_LIBS}], [main], [(test x$all = xtrue || test x$glut = xtrue) && GLUT_LIBS=-l${GLUT_LIBS} AC_SUBST(GLUT_LIBS)],
	    [(test x$all = xtrue || test x$glut = xtrue) && echo "Please install FreeGLUT library (lib${GLUT_LIBS}.a)" && exit])
       ;;

esac
AM_CONDITIONAL(USE_GLUT, (test x$all = xtrue || test x$glut = xtrue))

case "${host}" in
  *linux*)
       ADDON_FLAGS=-DNO_COLOR_ARRAY
       ;;

       *)
       ;;
esac

AC_ARG_ENABLE(hdf5,
[  --enable-hdf5    Turn on hdf5],
[case "${enableval}" in
  yes) hdf5=true ;;
  no)  hdf5=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-hdf5) ;;
esac],[hdf5=false])
AC_ARG_ENABLE(hdf5_18,
[  --enable-hdf5_18    Turn on hdf5 version 1.8],
[case "${enableval}" in
  yes) hdf5_18=true ;;
  no)  hdf5_18=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-hdf5_18) ;;
esac],[hdf5_18=false])
#AC_CHECK_HEADER(hdf5.h,[(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_FLAGS=-DHAVE_HDF5 AC_SUBST(HDF5_FLAGS)],
AC_CHECK_HEADER(hdf5.h,[(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_FLAGS=-DHAVE_HDF5 ],
    [(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && echo "Please install hdf5 headers" && exit])
if ((test x$all = xtrue || test x$hdf5 = xtrue) && test x$hdf5_18 = xfalse) ;then
    HDF5_FLAGS="$HDF5_FLAGS -DH5_USE_16_API"
    AC_SUBST(HDF5_FLAGS)
fi
AC_CHECK_LIB([hdf5], [main], [(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_LIBS=-lhdf5 AC_SUBST(HDF5_LIBS)], 
    [(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && echo "Please install hdf5 library" && exit])
AM_CONDITIONAL(USE_HDF5, (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue))


AC_ARG_ENABLE(hdf4,
[  --enable-hdf4    Turn on hdf4],
[case "${enableval}" in
  yes) hdf4=true ;;
  no)  hdf4=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-hdf4) ;;
esac],[hdf4=false])
AC_CHECK_HEADER(hdf/mfhdf.h,[(test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_FLAGS=-DHAVE_HDF4 ],
    [(test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 headers" && exit])
    AC_SUBST(HDF4_FLAGS)
AC_CHECK_LIB([df], [main], [(test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_LIBS="-lmfhdf -ldf" AC_SUBST(HDF4_LIBS)], 
    [(test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 library" && exit])
AM_CONDITIONAL(USE_HDF4, (test x$all = xtrue || test x$hdf4 = xtrue))

AC_ARG_ENABLE(gif,
[  --enable-gif    Turn on gif],
[case "${enableval}" in
  yes) gif=true ;;
  no)  gif=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-gif) ;;
esac],[gif=false])
AC_CHECK_HEADER(gif_lib.h,[(test x$all = xtrue || test x$gif = xtrue) && GIF_FLAGS=-DHAVE_GIF AC_SUBST(GIF_FLAGS)],
    [(test x$all = xtrue || test x$gif = xtrue) && echo "Please install gif headers" && exit])

AC_CHECK_LIB([gif], [main], [(test x$all = xtrue || test x$gif = xtrue) && GIF_LIBS=-lgif AC_SUBST(GIF_LIBS)], 
    [(test x$all = xtrue || test x$gif = xtrue) && echo "Please install gif library" && exit])
AM_CONDITIONAL(USE_GIF, (test x$all = xtrue || test x$gif = xtrue))

AC_CHECK_HEADER(png.h,,[echo "Please install png headers" && exit])

AC_CHECK_LIB([png], [main], [PNG_LIBS=-lpng AC_SUBST(PNG_LIBS)],
    [echo "Please install png library" && exit])

AC_ARG_ENABLE(jpeg,
[  --enable-jpeg    Turn on jpeg],
[case "${enableval}" in
  yes) jpeg=true ;;
  no)  jpeg=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-jpeg) ;;
esac],[jpeg=false])
AC_CHECK_HEADER(jpeglib.h,[(test x$all = xtrue || test x$jpeg = xtrue) && JPEG_FLAGS=-DHAVE_JPEG AC_SUBST(JPEG_FLAGS)],
    [(test x$all = xtrue || test x$jpeg = xtrue) && echo "Please install jpeg headers" && exit])

AC_CHECK_LIB([jpeg], [main], [(test x$all = xtrue || test x$jpeg = xtrue) && JPEG_LIBS=-ljpeg AC_SUBST(JPEG_LIBS)], 
    [(test x$all = xtrue || test x$jpeg = xtrue) && echo "Please install jpeg library" && exit])
AM_CONDITIONAL(USE_JPEG, (test x$all = xtrue || test x$jpeg = xtrue))

AC_ARG_ENABLE(u3d,
[  --enable-u3d    Turn on u3d functions],
[case "${enableval}" in
  yes) u3d=true ;;
  no)  u3d=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-u3d) ;;
esac],[u3d=false])
AC_ARG_ENABLE(pdf,
[  --enable-pdf    Turn on u3d and pdf functions],
[case "${enableval}" in
  yes) pdf=true; u3d=true ;;
  no)  pdf=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-pdf) ;;
esac],[pdf=false])
AS_IF([test "x$pdf" == xtrue],
  [AC_CHECK_LIB([hpdf], [main],
   [],
   [AC_MSG_FAILURE(
   [--enable-pdf was given, but test for libharu or libhpdf failed])]
  )])
AS_IF([test "x$pdf" == xtrue],
  [AC_CHECK_HEADERS([hpdf.h], [],
  [AC_MSG_FAILURE(
  [--enable-pdf was given, but test for libharu or libhpdf headers failed])]
  )])
AM_CONDITIONAL(USE_PDF, test x$pdf = xtrue)

AS_IF([test "x$u3d" == xtrue],
  [AC_CHECK_LIB([IDTF], [main],
  [AC_SUBST([U3D_LIBS], ["-lIDTF -lm -ldl"])
  AC_DEFINE([HAVE_U3D], [1],
  [Define if you have libIDTF])
  ],
  [AC_MSG_FAILURE(
  [--enable-u3d was given, but test for libIDTF failed])],
  [-lm -ldl])])
AS_IF([test "x$u3d" == xtrue],
  [AC_CHECK_HEADERS([u3d/SceneConverterLib.h], [],
  [AC_MSG_FAILURE(
  [--enable-u3d was given, but test for headers failed])]
  )])
AM_CONDITIONAL(USE_U3D, test x$u3d = xtrue)

AC_ARG_ENABLE(fltk,
[  --enable-fltk    Turn on fltk],
[case "${enableval}" in
  yes) fltk=true ;;
  no)  fltk=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-fltk) ;;
esac],[fltk=false])
if (test x$all = xtrue || test x$fltk = xtrue) ;then
    FLTK_PROG=fltk-config
    AC_CHECK_PROG(FLTK_FLAGS,$FLTK_PROG,`$FLTK_PROG --cxxflags`)
    AC_CHECK_PROG(FLTK_LIBS,$FLTK_PROG,`$FLTK_PROG --ldflags`)
    if test "$FLTK_FLAGS" && test "$FLTK_LIBS" ;then
	test_fltk=true
    else
	echo "Please install FLTK headers and libraries and make sure that \
	            path to $FLTK_PROG exist in your PATH"
	exit
    fi 
fi
AM_CONDITIONAL(USE_FLTK, test x$test_fltk = xtrue)

AC_ARG_ENABLE(wx,
[  --enable-wx    Turn on wxWidget],
[case "${enableval}" in
  yes) wx=true ;;
  no)  wx=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-wx) ;;
esac],[wx=false])
if (test x$all = xtrue || test x$wx = xtrue) ;then
#if (test x$wx = xtrue) ;then
    WX_PROG=wx-config
    AC_CHECK_PROG(WX_FLAGS,$WX_PROG,`$WX_PROG --cflags`)
    AC_CHECK_PROG(WX_LIBS,$WX_PROG,`$WX_PROG --libs`)
    if test "$WX_FLAGS" && test "$WX_LIBS" ;then
	test_wx=true
    else
	echo "Please install wxwidget headers and libraries and make sure that \
	            path to $WX_PROG exist in your PATH"
	exit
    fi 
fi
AM_CONDITIONAL(USE_WX, test x$test_wx = xtrue)

AC_ARG_ENABLE(qt,
[  --enable-qt    Turn on Qt],
[case "${enableval}" in
  yes) qt=true ;;
  no)  qt=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt) ;;
esac],[qt=false])
if (test x$all = xtrue || test x$qt = xtrue) ;then
    AT_WITH_QT
    AT_REQUIRE_QT_VERSION(4.3)
    test_qt=true
fi
AM_CONDITIONAL(USE_QT, test x$test_qt = xtrue)

AC_ARG_ENABLE(python,
[  --enable-python    Turn on interface to python],
[case "${enableval}" in
  yes) python=true ;;
  no)  python=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
esac],[python=false])
if (test x$langall = xtrue || test x$python = xtrue) ;then
    AC_CHECK_PROG(PYTHON_HEADERS,python-config,`python-config --cflags`)
    AC_CHECK_PROG(HAVE_SWIG,swig$EXEEXT,true)
    if (test "$PYTHON_HEADERS" && test "$HAVE_SWIG") ;then
	test_python=true
	AM_PATH_PYTHON()
    else
	echo Please install python-dev and swig packages
	exit
    fi 
fi
AM_CONDITIONAL(USE_PYTHON, test x$test_python = xtrue )

AC_ARG_ENABLE(octave,
[  --enable-octave    Turn on interface to octave],
[case "${enableval}" in
  yes) octave=true ;;
  no)  octave=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-octave) ;;
esac],[octave=false])
if (test x$langall = xtrue || test x$octave = xtrue) ;then
    AC_CHECK_PROG([OCTAVE],[octave-config],[octave-config])
# find Octave arch
    AC_MSG_CHECKING([for Octave arch])
    OCTAVE_ARCH=`$OCTAVE -p CANONICAL_HOST_TYPE`-`$OCTAVE -p API_VERSION`
    OCTINCLUDEDIR="`$OCTAVE -p OCTINCLUDEDIR`"
    OCTAVE_INCFLAGS="-I$OCTINCLUDEDIR -I$OCTINCLUDEDIR/.."
    AC_MSG_RESULT([$OCTAVE_ARCH])
    AC_SUBST(OCTAVE_ARCH,[$OCTAVE_ARCH])
    AC_SUBST(OCTAVE_INCFLAGS,[$OCTAVE_INCFLAGS])
    test_octave=true
fi
AM_CONDITIONAL(USE_OCTAVE, test x$test_octave = xtrue )

AC_ARG_ENABLE(testio,
[  --enable-testio    Turn on testio],
[case "${enableval}" in
  yes) testio=true ;;
  no)  testio=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-testio) ;;
esac],[testio=false])
AM_CONDITIONAL(USE_TESTIO, test x$testio = xtrue )

AC_ARG_ENABLE(docs,
[  --enable-docs    Turn on documentation building],
[case "${enableval}" in
  yes) docs=true ;;
  no)  docs=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-docs) ;;
esac],[docs=false])
if (test x$docs = xtrue || test x$all = xtrue) ;then
	AC_CONFIG_FILES([texinfo/Makefile texinfo/png/Makefile])
fi
AM_CONDITIONAL(USE_DOCS, (test x$docs = xtrue || test x$all = xtrue) )

AM_CXXFLAGS="$AM_CXXFLAGS -Wall $GSL_FLAGS"
AC_SUBST(AM_CXXFLAGS)

AC_CONFIG_FILES([
Makefile
mgl/Makefile
examples/Makefile
include/Makefile
lang/Makefile
utils/Makefile
widgets/Makefile
])
AC_OUTPUT