source: libpipi/trunk/configure.ac @ 2844

Last change on this file since 2844 was 2839, checked in by Sam Hocevar, 12 years ago

Detect Windows GDI at configuration time.

File size: 3.8 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
28dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
29dnl now otherwise it might be set in an obscure if statement. Same thing for
30dnl PKG_PROG_PKG_CONFIG which needs to be called first.
31AC_EGREP_CPP(yes, foo)
32PKG_PROG_PKG_CONFIG()
33m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
34if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then
35  export PKG_CONFIG_LIBDIR=/dev/null
36fi
37
38AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h)
39
40ac_cv_have_getopt_long="no"
41AC_CHECK_FUNCS(getopt_long,
42 [ac_cv_have_getopt_long="yes"],
43 [AC_CHECK_LIB(gnugetopt, getopt_long,
44   [ac_cv_have_getopt_long="yes"
45    GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
46if test "$ac_cv_have_getopt_long" != "no"; then
47  AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)
48fi
49AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
50AC_SUBST(GETOPT_LIBS)
51
52# Optimizations
53CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
54# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
55CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
56
57# Use DevIL?
58#AC_CHECK_HEADERS(IL/il.h,
59# [ac_cv_my_have_il="yes"],
60# [ac_cv_my_have_il="no"])
61#CPPFLAGS="${save_CPPFLAGS}"
62#AM_CONDITIONAL(USE_IL, test "${ac_cv_my_have_il}" = "yes")
63
64# Use Windows?
65#AC_CHECK_HEADERS(olectl.h,
66# [ac_cv_my_have_ole="yes"],
67# [ac_cv_my_have_ole="no"])
68#CPPFLAGS="${save_CPPFLAGS}"
69#AM_CONDITIONAL(USE_OLE, test "${ac_cv_my_have_ole}" = "yes")
70
71# Use SDL?
72ac_cv_my_have_sdl="no"
73save_CPPFLAGS="${CPPFLAGS}"
74AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
75if test "${SDL_CONFIG}" != "no"; then
76  CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`"
77fi
78AC_CHECK_HEADERS(SDL_image.h,
79 [ac_cv_my_have_sdl="yes"],
80 [ac_cv_my_have_sdl="no"])
81CPPFLAGS="${save_CPPFLAGS}"
82if test "${ac_cv_my_have_sdl}" != "no"; then
83  AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL_image)
84fi
85AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
86
87# Use OpenCV?
88ac_cv_my_have_opencv="no"
89OPENCV="no"
90PKG_CHECK_MODULES(OPENCV, opencv, [ac_cv_my_have_opencv="yes"], [:])
91if test "${ac_cv_my_have_opencv}" != "no"; then
92  AC_DEFINE(USE_OPENCV, 1, Define to 1 to use OpenCV)
93fi
94AM_CONDITIONAL(USE_OPENCV, test "${ac_cv_my_have_opencv}" = "yes")
95
96# Use Imlib2?
97ac_cv_my_have_imlib2="no"
98IMLIB2="no"
99PKG_CHECK_MODULES(IMLIB2, imlib2, [ac_cv_my_have_imlib2="yes"], [:])
100if test "${ac_cv_my_have_imlib2}" != "no"; then
101  AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
102fi
103AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
104
105# Use Windows GDI?
106ac_cv_my_have_gdi="no"
107GDI="no"
108AC_CHECK_HEADERS(windows.h,
109 [ac_cv_my_have_gdi="yes"],
110 [ac_cv_my_have_gdi="no"])
111if test "${ac_cv_my_have_gdi}" != "no"; then
112  AC_DEFINE(USE_GDI, 1, Define to 1 to use GDI)
113fi
114AM_CONDITIONAL(USE_GDI, test "${ac_cv_my_have_gdi}" = "yes")
115
116if 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
117  AC_MSG_ERROR([[cannot find DevIL, OLE, SDL_Image, Imlib2 or OpenCV, please install one of them]])
118fi
119
120AC_CONFIG_FILES([
121  Makefile
122  pipi/Makefile
123  src/Makefile
124  genethumb/Makefile
125  examples/Makefile
126  test/Makefile
127])
128AC_CONFIG_FILES([
129  pipi/pipi.pc
130])
131
132AC_OUTPUT
133
Note: See TracBrowser for help on using the repository browser.