427e67d8499d23c8758c06f546a830535094269f
[movit] / configure.ac
1 AC_CONFIG_MACRO_DIR([m4])
2 AC_INIT(movit, git)
3 LT_INIT
4 PKG_PROG_PKG_CONFIG
5
6 CXXFLAGS="$CXXFLAGS -std=gnu++11"
7
8 AC_CONFIG_SRCDIR(effect.cpp)
9 AC_CONFIG_AUX_DIR(.)
10
11 AC_PROG_CC
12 AC_PROG_CXX
13 PKG_CHECK_MODULES([Eigen3], [eigen3])
14 PKG_CHECK_MODULES([epoxy], [epoxy])
15 PKG_CHECK_MODULES([FFTW3], [fftw3])
16
17 # Needed for unit tests and the demo app. We prefer SDL2 if possible,
18 # but can also use classic SDL.
19 with_SDL2=no
20 with_demo_app=yes
21 PKG_CHECK_MODULES([SDL2], [sdl2], [with_SDL2=yes], [
22   PKG_CHECK_MODULES([SDL], [sdl])
23 ])
24
25 # These are only needed for the demo app.
26 if test $with_SDL2 = "yes"; then
27   PKG_CHECK_MODULES([SDL2_image], [SDL2_image], [], [with_demo_app=no; AC_MSG_WARN([SDL2_image not found, demo program will not be built])])
28 else
29   PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])])
30 fi
31 PKG_CHECK_MODULES([libpng], [libpng], [], [with_demo_app=no; AC_MSG_WARN([libpng not found, demo program will not be built])])
32
33 # This is only needed for microbenchmarks, so optional.
34 PKG_CHECK_MODULES([benchmark], [benchmark], [with_benchmark=yes], [with_benchmark=no; AC_MSG_WARN([Google microbenchmark framework not found, microbenchmarks will not be built])])
35
36 AC_SUBST([with_demo_app])
37 AC_SUBST([with_benchmark])
38 AC_SUBST([with_SDL2])
39
40 with_coverage=no
41 AC_ARG_ENABLE([coverage], [  --enable-coverage       build with information needed to compute test coverage], [with_coverage=yes])
42 AC_SUBST([with_coverage])
43
44 AC_CONFIG_FILES([Makefile movit.pc])
45 AC_OUTPUT