source: libpipi/trunk/configure.ac @ 3071

Last change on this file since 3071 was 3071, checked in by Jean-Yves Lamoureux, 12 years ago
  • Added stub USE_GDIPLUS definition to make the whole stuff compilable again
File size: 6.4 KB
Line 
1# $Id$
2
3AC_INIT(libpipi, 0.0)
4AC_PREREQ(2.50)
5AC_CONFIG_AUX_DIR(.auto)
6AC_CANONICAL_SYSTEM
7AM_INIT_AUTOMAKE([no-define tar-ustar])
8dnl AM_MAINTAINER_MODE
9
10AM_CONFIG_HEADER(config.h)
11
12LT_MAJOR="0"
13LT_MINOR="0"
14LT_MICRO="0"
15AC_SUBST(LT_MAJOR)
16AC_SUBST(LT_MINOR)
17AC_SUBST(LT_MICRO)
18LT_VERSION="$LT_MAJOR:$LT_MINOR:$LT_MICRO"
19AC_SUBST(LT_VERSION)
20
21AM_PROG_CC_C_O
22AC_PROG_CPP
23AC_PROG_OBJC
24_AM_DEPENDENCIES([OBJC])
25OBJC="${CC}"
26AC_SUBST(OBJC)
27AC_SUBST(OBJCFLAGS)
28
29AC_LIBTOOL_WIN32_DLL
30AM_PROG_LIBTOOL
31AC_LIBTOOL_CXX
32
33AC_C_CONST
34AC_C_INLINE
35
36dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
37dnl now otherwise it might be set in an obscure if statement. Same thing for
38dnl PKG_PROG_PKG_CONFIG which needs to be called first.
39AC_EGREP_CPP(yes, foo)
40PKG_PROG_PKG_CONFIG()
41m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
42if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then
43  export PKG_CONFIG_LIBDIR=/dev/null
44fi
45
46AC_MSG_CHECKING(for library suffix)
47LT_SUFFIX="`./libtool -n --tag CC --mode=link gcc -o libTEST.la -no-undefined -version-number 123:666:999 -rpath / | xargs -n 1 | sed -ne 's/.*libTEST\(@<:@^, ()0-9@:>@*\)123\(@<:@^, ()0-9@:>@*\).*/\1'$LT_MAJOR'\2/p' | grep -v '\.$' | head -n 1`"
48if test "$LT_SUFFIX" = ""; then
49  LT_SUFFIX=".so.$LT_MAJOR"
50  AC_MSG_RESULT([unknown, defaulting to $LT_SUFFIX])
51else
52  AC_MSG_RESULT($LT_SUFFIX)
53fi
54AC_SUBST(LT_SUFFIX)
55
56AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h)
57
58ac_cv_have_getopt_long="no"
59AC_CHECK_FUNCS(getopt_long,
60 [ac_cv_have_getopt_long="yes"],
61 [AC_CHECK_LIB(gnugetopt, getopt_long,
62   [ac_cv_have_getopt_long="yes"
63    GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
64if test "$ac_cv_have_getopt_long" != "no"; then
65  AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)
66fi
67AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
68AC_SUBST(GETOPT_LIBS)
69
70# How to get the C99 types. See pipi/pipi_types.h.in for details about
71# the PIPI_TYPES variable
72if test "${ac_cv_my_have_vga}" = "yes"; then
73  PIPI_TYPES=0
74else
75  AC_CHECK_HEADERS(stdint.h,
76    [PIPI_TYPES=1],
77    [AC_CHECK_HEADERS(inttypes.h,
78      [PIPI_TYPES=2],
79      [AC_CHECK_HEADERS(windows.h,
80        [PIPI_TYPES=3],
81        [PIPI_TYPES=0])])])
82fi
83AC_SUBST(PIPI_TYPES)
84
85# Optimizations
86CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
87# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
88CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
89
90
91AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
92
93# Use DevIL?
94#AC_CHECK_HEADERS(IL/il.h,
95# [ac_cv_my_have_il="yes"],
96# [ac_cv_my_have_il="no"])
97#CPPFLAGS="${save_CPPFLAGS}"
98#AM_CONDITIONAL(USE_IL, test "${ac_cv_my_have_il}" = "yes")
99
100# Use Windows?
101#AC_CHECK_HEADERS(olectl.h,
102# [ac_cv_my_have_ole="yes"],
103# [ac_cv_my_have_ole="no"])
104#CPPFLAGS="${save_CPPFLAGS}"
105#AM_CONDITIONAL(USE_OLE, test "${ac_cv_my_have_ole}" = "yes")
106
107# Use SDL?
108ac_cv_my_have_sdl="no"
109save_CPPFLAGS="${CPPFLAGS}"
110AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
111if test "${SDL_CONFIG}" != "no"; then
112  CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`"
113fi
114AC_CHECK_HEADERS(SDL_image.h,
115 [ac_cv_my_have_sdl="yes"],
116 [ac_cv_my_have_sdl="no"])
117CPPFLAGS="${save_CPPFLAGS}"
118if test "${ac_cv_my_have_sdl}" != "no"; then
119  AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL_image)
120fi
121AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
122
123# Use OpenCV?
124ac_cv_my_have_opencv="no"
125OPENCV="no"
126PKG_CHECK_MODULES(OPENCV, opencv, [ac_cv_my_have_opencv="yes"], [:])
127if test "${ac_cv_my_have_opencv}" != "no"; then
128  AC_DEFINE(USE_OPENCV, 1, Define to 1 to use OpenCV)
129fi
130AM_CONDITIONAL(USE_OPENCV, test "${ac_cv_my_have_opencv}" = "yes")
131
132# Use Imlib2?
133ac_cv_my_have_imlib2="no"
134IMLIB2="no"
135PKG_CHECK_MODULES(IMLIB2, imlib2, [ac_cv_my_have_imlib2="yes"], [:])
136if test "${ac_cv_my_have_imlib2}" != "no"; then
137  AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
138fi
139AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
140
141# Use Windows GDI?
142ac_cv_my_have_gdi="no"
143GDI="no"
144AC_CHECK_HEADERS(windows.h,
145 [ac_cv_my_have_gdi="yes"],
146 [ac_cv_my_have_gdi="no"])
147if test "${ac_cv_my_have_gdi}" != "no"; then
148  AC_DEFINE(USE_GDI, 1, Define to 1 to use GDI)
149fi
150AM_CONDITIONAL(USE_GDI, test "${ac_cv_my_have_gdi}" = "yes")
151AM_CONDITIONAL(USE_GDIPLUS, test "${ac_cv_my_have_gdi}" = "yes")
152
153# Use Cocoa?
154ac_cv_my_have_cocoa="no"
155AC_CHECK_HEADERS(/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h,
156[
157 MACOSX_SDK_FRAMEWORKS="-F${MACOSX_SDK}/System/Library/Frameworks"
158 CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS} -I/Developer//SDKs/MacOSX10.5.sdk/System/Library/Frameworks/QuartzCore.framework/Versions/A/Headers/"
159 CFLAGS="${CFLAGS} ${MACOSX_SDK_CFLAGS} -I/Developer//SDKs/MacOSX10.5.sdk/System/Library/Frameworks/QuartzCore.framework/Versions/A/Headers/"
160 CXXFLAGS="${CXXFLAGS} ${MACOSX_SDK_CXXFLAGS}"
161 OBJCFLAGS="${OBJCFLAGS} ${MACOSX_SDK_CFLAGS}"
162 LDFLAGS="${ARCH} ${MACOSX_SDK_LDFLAGS} ${LDFLAGS}"
163 AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver)
164#    CACA_LIBS="${CACA_LIBS} -Wl,-syslibroot,${MACOSX_SDK},-framework,Cocoa"
165#    CACA_DRIVERS="${CACA_DRIVERS} cocoa"
166 ac_cv_my_have_cocoa="yes"],
167 [ac_cv_my_have_cocoa="no"]
168 )
169AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" = "yes")
170
171
172if 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" -a "${ac_cv_my_have_cocoa}" = "no"; then
173  AC_MSG_ERROR([[cannot find DevIL, OLE, SDL_Image, Imlib2, Cocoa, or OpenCV, please install one of them]])
174fi
175
176AC_SUBST(MATH_LIBS)
177
178# Build pipi-sharp?
179AC_PATH_PROG(GMCS, gmcs, no)
180AC_PATH_PROG(GACUTIL, gacutil, no)
181AM_CONDITIONAL(USE_CSHARP, test "${GMCS}" != "no" -a "${GACUTIL}" != "no")
182
183# Build The Pimp?
184ac_cv_my_have_gtksharp=yes
185PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0], [:], [ac_cv_my_have_gtksharp=no])
186PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0], [:], [ac_cv_my_have_gtksharp=no])
187AM_CONDITIONAL(USE_GTKSHARP, test "${ac_cv_my_have_gtksharp}" != no)
188
189AC_CONFIG_FILES([
190  Makefile
191  pipi/Makefile
192  src/Makefile
193  genethumb/Makefile
194  examples/Makefile
195  test/Makefile
196  pipi-sharp/Makefile
197  ThePimp/Makefile
198  win32/Makefile
199])
200AC_CONFIG_FILES([
201  pipi/pipi_types.h
202  pipi/pipi.pc
203  pipi-sharp/pipi-sharp.pc
204  pipi-sharp/pipi-sharp.dll.config
205])
206AC_CONFIG_FILES([ThePimp/pimp], [chmod +x ThePimp/pimp])
207
208AC_OUTPUT
209
Note: See TracBrowser for help on using the repository browser.