~ubuntu-branches/ubuntu/saucy/3depict/saucy

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Package Import Robot
  • Author(s): D Haley
  • Date: 2013-05-17 00:52:39 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130517005239-7bl4mnhkvrhc2ba6
Tags: 0.0.13-1
Upload to unstable 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
AC_INIT([3Depict], [0.0.10], [mycae@yahoo.com])
 
1
AC_INIT([3Depict], [0.0.13], [mycae@yahoo.com])
2
2
AM_INIT_AUTOMAKE([foreign])
3
3
AC_PROG_CXX
4
4
AC_PROG_CC
5
 
AM_CONFIG_HEADER([config.h])
 
5
AC_CONFIG_HEADERS([config.h])
6
6
AC_CONFIG_FILES([Makefile src/Makefile])
7
7
 
8
 
#Lets check if we have windres, and assume this only exists under
9
 
#Windows.
10
 
AM_CONDITIONAL(HAVE_WINDRES, which windres > /dev/null)
11
 
 
12
8
#Ok, lets try using gcc style precompiled headers.
13
9
AM_CONDITIONAL(USE_PRECOMPILED_HEADERS, 1)
14
10
 
36
32
])
37
33
fi
38
34
 
 
35
AM_CONDITIONAL(HAVE_WINDRES, which ${host_os}windres > /dev/null && which windres >> /dev/null)
 
36
 
39
37
#Append the --gl-libs flag
40
38
WX_LIBS="$WX_LIBS `$WX_CONFIG_PATH --gl-libs`"
 
39
 
 
40
case "${host_os}" in 
 
41
        *w64_mingw*)
 
42
                #wx-config is a little unreliable in cross-compile mode
 
43
                # Manually append -DUNICODE to cppflags/cxxflags
 
44
                WX_CXXFLAGS="$WX_CXXFLAGS -DUNICODE"
 
45
                WX_CPPFLAGS="$WX_CPPFLAGS -DUNICODE"
 
46
                ;;
 
47
        *)
 
48
        ;;
 
49
esac
 
50
 
 
51
 
41
52
AC_SUBST(WX_LIBS)
42
53
dnl ----------
43
54
 
201
212
if test x"$with_libpng_flags" != x"" ;
202
213
then
203
214
    PNG_CFLAGS="$with_libpng_flags"
204
 
else
205
 
    PKG_CHECK_MODULES(PNG, libpng >= 1.2)
206
215
fi
207
216
AC_SUBST(PNG_CFLAGS)
208
217
 
211
220
then
212
221
    PNG_LIBS="$with_libpng_link"
213
222
else
214
 
    PKG_CHECK_MODULES(PNG, libpng >= 1.2)
 
223
 
 
224
        AC_CHECK_LIB([png],[png_create_write_struct_2] , 
 
225
                [PNG_LIBS=-lpng], [PNG_USE_PKG_CFG=yes],-lm)
 
226
 
 
227
        if test x"$PNG_USE_PKG_CFG" == x"yes" ; then
 
228
                PKG_CHECK_MODULES(PNG, libpng >= 1.2)
 
229
        fi
215
230
fi
216
231
 
217
232
AC_SUBST(PNG_LIBS)
260
275
#Check for Mathgl
261
276
dnl ----------
262
277
CFLAGS_ORIG="$CFLAGS"
263
 
LIBS_ORIG="$LIBS"
 
278
LDFLAGS_ORIG="$LDFLAGS"
 
279
 
 
280
AC_ARG_ENABLE(mgl2,
 
281
  [  --enable-mgl2 Enable mathgl 2.x support])
264
282
 
265
283
AC_ARG_WITH(mgl-flags,
266
284
  [  --with-mgl-flags=PATH : specify compiler flags for mathgl])
267
285
if test x"$with_mgl_flags" != x"" ; then
268
 
        CFLAGS="$CFLAGS $with_mgl_flags"
269
 
        MGL_CFLAGS=$CFLAGS
 
286
        MGL_CFLAGS="$with_mgl_flags"
270
287
        AC_SUBST(MGL_CFLAGS)
271
288
fi
 
289
CFLAGS="$CFLAGS $MGL_CFLAGS"
272
290
 
273
291
AC_ARG_WITH(mgl-libs,
274
292
  [  --with-mgl-libs=PATH : specify linker flag (library) for mathgl])
275
293
if test x"$with_mgl_libs" != x"" ; then
276
 
        LIBS="$LDFLAGS $with_mgl_libs"
 
294
        MGL_LIBS="$with_mgl_libs"
277
295
else
278
 
        LIBS="$LDFLAGS -lmgl"
279
 
fi
280
 
        MGL_LIBS=$LIBS
281
 
        AC_SUBST(MGL_LIBS)
282
 
 
283
 
AC_CHECK_HEADER([mgl/mgl_c.h],[AC_DEFINE(HAVE_MGL_H,[],[Have got mathgl headers])],
284
 
        [AC_MSG_ERROR([Required MathGL headers not found (looking for mgl/mgl_c.h) - is mathgl developement scode installed?])])
 
296
        MGL_LIBS="-lmgl"
 
297
fi
 
298
AC_SUBST(MGL_LIBS)
 
299
LDFLAGS="$LDFLAGS $MGL_LIBS"
 
300
 
 
301
#mathgl 2, under linux (at least debian) installs headers 
 
302
#  into /usr/include/mgl2/
 
303
#Note:
 
304
#  mathgl1.x uses mgl_c.h as c functions. 
 
305
#  mathgl2.x uses mgl_cf.h for c functions.
 
306
MGL_HEADER_TESTFILE=mgl/mgl_c.h
 
307
 
 
308
if test x"${enable_mgl2}" == x"yes" ; then 
 
309
        AC_DEFINE(USE_MGL2, 1 , ["Enable mgl2 support"])
 
310
fi
 
311
 
 
312
case "${host_os}" in
 
313
        darwin*)
 
314
                ;;
 
315
        mingw*|windows*|winnt)
 
316
                ;;
 
317
        linux*)
 
318
                #if enable mgl2, substitute header
 
319
                if test -z "${enable_mgl2}"  ; then
 
320
                                AC_MSG_RESULT(["mathgl check: assuming mathgl 1.x"])
 
321
                else
 
322
                                #note file rename under mgl2 mgl_c->mgl_cf
 
323
                                MGL_HEADER_TESTFILE="mgl2/mgl_cf.h"
 
324
                fi
 
325
                ;;
 
326
        *)
 
327
                ;;
 
328
esac
 
329
 
 
330
#mgl2 is installed into different path (at least under debian)
 
331
AC_CHECK_HEADER([${MGL_HEADER_TESTFILE}],[AC_DEFINE(HAVE_MGL_H,[],[Have got mathgl headers])],
 
332
        [AC_MSG_ERROR([Required MathGL headers not found (looking for ${MGL_HEADER_TESTFILE}) - is mathgl development code installed?])])
 
333
AC_CHECK_LIB(mgl, mgl_set_def_param, [AC_DEFINE(HAVE_MGL,[],[MathGL compilation OK])] , AC_MSG_ERROR([Required MathGL libraries not found]), -lmgl)
 
334
 
285
335
CFLAGS="$CFLAGS_ORIG"
286
 
LIBS="$LIBS_ORIG"
 
336
LDFLAGS="$LDFLAGS_ORIG"
287
337
 
288
338
dnl -------
289
339
 
363
413
        then
364
414
                #Note that GLIBCXX_DEBUG cannot exist with GLIBCXX_PARALLEL
365
415
                DEBUG_FLAGS="-DDEBUG"
 
416
 
 
417
 
366
418
        else
367
419
                DEBUG_FLAGS="-DDEBUG -D_GLIBCXX_DEBUG"
368
420
        fi
 
421
 
369
422
        AC_SUBST(DEBUG_FLAGS)
 
423
 
 
424
        if test x"$GCC" = xyes; then
 
425
                # Strip optimsation flags from debug build
 
426
                changequote({,})
 
427
                CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9s]*//g'`
 
428
                CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/-O[0-9s]*//g'`
 
429
                changequote([,])
 
430
                CFLAGS="$CFLAGS -g"
 
431
                CXXFLAGS="$CXXFLAGS -g"
 
432
 
 
433
        fi
 
434
 
370
435
else 
371
436
        if test x"$enable_debug_checks" !=x"yes" ;
372
437
        then