source: pwntcha/trunk/configure.ac @ 414

Last change on this file since 414 was 407, checked in by Sam Hocevar, 16 years ago
  • src/image.c: SDL_image support.
File size: 1.7 KB
Line 
1# $Id: configure.ac 253 2004-08-09 20:08:52Z sam $
2
3AC_INIT(src/main.c)
4
5AC_PREREQ(2.50)
6AC_CONFIG_AUX_DIR(autotools)
7AC_CANONICAL_SYSTEM
8
9AM_INIT_AUTOMAKE(pwntcha, 0.2)
10AM_CONFIG_HEADER(config.h)
11
12AC_PROG_CC
13AM_PROG_CC_C_O
14AC_PROG_CXX
15AC_STDC_HEADERS
16
17AC_C_CONST
18AC_C_INLINE
19AC_TYPE_SIZE_T
20
21AC_CHECK_FUNCS(getopt_long)
22
23# Use SDL?
24ac_cv_my_have_sdl="no"
25save_CPPFLAGS="${CPPFLAGS}"
26AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
27if test "${SDL_CONFIG}" != "no"; then
28  CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`"
29fi
30AC_CHECK_HEADERS(SDL_image.h,
31 [ac_cv_my_have_sdl="yes"],
32 [ac_cv_my_have_sdl="no"])
33CPPFLAGS="${save_CPPFLAGS}"
34AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
35
36# Use OpenCV?
37ac_cv_my_have_opencv="no"
38save_CPPFLAGS="${CPPFLAGS}"
39AC_PATH_PROG(OPENCV_CONFIG, opencv-config, no)
40if test "${OPENCV_CONFIG}" != "no"; then
41  CPPFLAGS="${CPPFLAGS} `opencv-config --cflags`"
42fi
43AC_CHECK_HEADERS(cv.h,
44 [ac_cv_my_have_opencv="yes"],
45 [ac_cv_my_have_opencv="no"])
46CPPFLAGS="${save_CPPFLAGS}"
47AM_CONDITIONAL(USE_OPENCV, test "${ac_cv_my_have_opencv}" = "yes")
48
49# Use Imlib2?
50ac_cv_my_have_imlib2="no"
51save_CPPFLAGS="${CPPFLAGS}"
52AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no)
53if test "${IMLIB2_CONFIG}" != "no"; then
54  CPPFLAGS="${CPPFLAGS} `imlib2-config --cflags` -DX_DISPLAY_MISSING=1"
55fi
56AC_CHECK_HEADERS(Imlib2.h,
57 [ac_cv_my_have_imlib2="yes"],
58 [ac_cv_my_have_imlib2="no"])
59CPPFLAGS="${save_CPPFLAGS}"
60AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
61
62if test "${ac_cv_my_have_sdl}" = "yes" -a "${ac_cv_my_have_imlib2}" = "no" -a "${ac_cv_my_have_opencv}" = "no"; then
63  AC_MSG_ERROR([[cannot find SDL_Image, Imlib2 or OpenCV, please install one of them]])
64fi
65
66AC_OUTPUT([
67  Makefile
68  src/Makefile
69  extras/Makefile
70  testsuite/Makefile
71])
72
Note: See TracBrowser for help on using the repository browser.