source: libpipi/trunk/configure.ac @ 2262

Last change on this file since 2262 was 2262, checked in by Sam Hocevar, 15 years ago
  • Checking in an old Rubik's cube dithering test.
File size: 3.3 KB
Line 
1# $Id$
2
3AC_INIT(libpipi, 0.0)
4AC_CONFIG_AUX_DIR(.auto)
5AM_INIT_AUTOMAKE([no-define tar-ustar])
6dnl AM_MAINTAINER_MODE
7
8AM_CONFIG_HEADER(config.h)
9
10AM_PROG_CC_C_O
11AC_PROG_CPP
12
13LT_MAJOR="0"
14LT_MINOR="99"
15LT_MICRO="13"
16AC_SUBST(LT_MAJOR)
17AC_SUBST(LT_MINOR)
18AC_SUBST(LT_MICRO)
19LT_VERSION="$LT_MAJOR:$LT_MINOR:$LT_MICRO"
20AC_SUBST(LT_VERSION)
21AC_LIBTOOL_WIN32_DLL
22AM_PROG_LIBTOOL
23AC_LIBTOOL_CXX
24
25AC_C_CONST
26AC_C_INLINE
27
28AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h)
29
30ac_cv_have_getopt_long="no"
31AC_CHECK_FUNCS(getopt_long,
32 [ac_cv_have_getopt_long="yes"],
33 [AC_CHECK_LIB(gnugetopt, getopt_long,
34   [ac_cv_have_getopt_long="yes"
35    GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
36if test "$ac_cv_have_getopt_long" != "no"; then
37  AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)
38fi
39AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
40AC_SUBST(GETOPT_LIBS)
41
42# Optimizations
43CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
44# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
45CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
46
47# Use DevIL?
48#AC_CHECK_HEADERS(IL/il.h,
49# [ac_cv_my_have_il="yes"],
50# [ac_cv_my_have_il="no"])
51#CPPFLAGS="${save_CPPFLAGS}"
52#AM_CONDITIONAL(USE_IL, test "${ac_cv_my_have_il}" = "yes")
53
54# Use Windows?
55#AC_CHECK_HEADERS(olectl.h,
56# [ac_cv_my_have_ole="yes"],
57# [ac_cv_my_have_ole="no"])
58#CPPFLAGS="${save_CPPFLAGS}"
59#AM_CONDITIONAL(USE_OLE, test "${ac_cv_my_have_ole}" = "yes")
60
61# Use SDL?
62ac_cv_my_have_sdl="no"
63save_CPPFLAGS="${CPPFLAGS}"
64AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
65if test "${SDL_CONFIG}" != "no"; then
66  CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`"
67fi
68AC_CHECK_HEADERS(SDL_image.h,
69 [ac_cv_my_have_sdl="yes"],
70 [ac_cv_my_have_sdl="no"])
71CPPFLAGS="${save_CPPFLAGS}"
72if test "${ac_cv_my_have_sdl}" != "no"; then
73  AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL_image)
74fi
75AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
76
77# Use OpenCV?
78ac_cv_my_have_opencv="no"
79save_CPPFLAGS="${CPPFLAGS}"
80AC_PATH_PROG(OPENCV_CONFIG, opencv-config, no)
81if test "${OPENCV_CONFIG}" != "no"; then
82  CPPFLAGS="${CPPFLAGS} `opencv-config --cflags`"
83fi
84AC_CHECK_HEADERS(cv.h,
85 [ac_cv_my_have_opencv="yes"],
86 [ac_cv_my_have_opencv="no"])
87CPPFLAGS="${save_CPPFLAGS}"
88if test "${ac_cv_my_have_opencv}" != "no"; then
89  AC_DEFINE(USE_OPENCV, 1, Define to 1 to use OpenCV)
90fi
91AM_CONDITIONAL(USE_OPENCV, test "${ac_cv_my_have_opencv}" = "yes")
92
93# Use Imlib2?
94ac_cv_my_have_imlib2="no"
95IMLIB2="no"
96PKG_CHECK_MODULES(IMLIB2, imlib2, [ac_cv_my_have_imlib2="yes"])
97AC_MSG_RESULT($ac_cv_my_have_imlib2)
98if test "${ac_cv_my_have_imlib2}" != "no"; then
99  AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
100fi
101AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
102
103if test "${ac_cv_my_have_il}" = "no" -a "${ac_cv_my_have_ole}" = "no" -a "${ac_cv_my_have_sdl}" = "no" -a "${ac_cv_my_have_imlib2}" = "no" -a "${ac_cv_my_have_opencv}" = "no"; then
104  AC_MSG_ERROR([[cannot find DevIL, OLE, SDL_Image, Imlib2 or OpenCV, please install one of them]])
105fi
106
107AC_CONFIG_FILES([
108  Makefile
109  pipi/Makefile
110  genethumb/Makefile
111  examples/Makefile
112])
113AC_CONFIG_FILES([
114  pipi/pipi.pc
115])
116
117AC_OUTPUT
118
Note: See TracBrowser for help on using the repository browser.