Fix:directfb:fixed Makefile.am and configure.in
[navit-package] / configure.in
1 AC_INIT(navit, 0.1.0)
2 AM_INIT_AUTOMAKE
3 AM_CONFIG_HEADER(config.h)
4 AM_MAINTAINER_MODE
5
6
7 m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],
8         [AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], [AC_GNU_SOURCE])])
9
10 AC_USE_SYSTEM_EXTENSIONS
11
12 AC_PROG_CC
13 if eval "test x$GCC = xyes"; then
14         CFLAGS="$CFLAGS -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE"
15 fi
16 AM_PROG_CC_C_O
17
18 AC_PROG_CXX
19 if eval "test x$GXX = xyes"; then
20         CXXFLAGS="$CXXFLAGS -Wall -Wcast-align -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE"
21 fi
22
23 PKG_CHECK_EXISTS
24
25 AC_ARG_ENABLE(plugins,  [  --disable-plugins          disable plugins], 
26                         [
27                                 AC_DISABLE_SHARED
28                                 AC_ENABLE_STATIC
29                                 plugins=$enableval
30                         ],
31                         [
32                                 AC_ENABLE_SHARED
33                                 AC_DISABLE_STATIC
34                                 AC_DEFINE(
35                                         [USE_PLUGINS],
36                                         [],
37                                         Define to 1 if you have plugins.
38                                 )
39                                 plugins=yes
40                         ]
41 )
42 AC_PROG_LIBTOOL
43
44 AC_ARG_ENABLE(avoid-unaligned, [  --enable-avoid-unaligned          avoid unaligned accesses], AVOID_UNALIGNED=$enableval, AVOID_UNALIGNED=no)
45 test x"${AVOID_UNALIGNED}" = xyes && AC_DEFINE(AVOID_UNALIGNED,[],Define to avoid unaligned access)
46
47 AC_ARG_ENABLE(avoid-float, [  --enable-avoid-float              avoid floating point calculations], AVOID_FLOAT=$enableval, AVOID_FLOAT=no)
48 test x"${AVOID_FLOAT}" = xyes && AC_DEFINE(AVOID_FLOAT,[],Define to avoid floating point)
49
50 AC_ARG_ENABLE(hildon, [  --enable-hildon              build with maemo/hildon support], enable_hildon=$enableval, enable_hildon=no)
51 if test "x${enable_hildon}" = "xyes" ; then
52         PKG_CHECK_MODULES(enable_hildon, hildon-libs >= 0.12.24, , [
53                 AC_MSG_RESULT(no)
54                 enable_hildon=no
55         ])
56         if test x"${enable_hildon}" = xyes ; then
57                 AC_DEFINE(USE_HILDON, 1, [Build with maemo/hildon support])
58                 AC_SUBST(HILDON_CFLAGS)
59                 AC_SUBST(HILDON_LIBS)
60         fi
61 fi
62 AM_CONDITIONAL(USE_HILDON, test "${enable_hildon}" = "xyes")
63
64 AC_ARG_ENABLE(libgps, [  --disable-libgps             don't use libgps], USE_LIBGPS=$enableval, USE_LIBGPS=yes)
65 AC_ARG_ENABLE(gypsy, [  --disable-gypsy             don't use gypsy], USE_GYPSY=$enableval, USE_GYPSY=yes)
66 AC_ARG_ENABLE(garmin, [  --disable-garmin             disable garmin support], USE_GARMIN=$enableval, USE_GARMIN=yes)
67
68 AC_ARG_ENABLE(samplemap, [  --disable-samplemap             don't build the samplemap], samplemap=$enableval, samplemap=yes)
69 AM_CONDITIONAL(BUILD_SAMPLEMAP, [test "x$samplemap" = "xyes"])
70
71 AC_ARG_ENABLE(fastmath, [  --disable-fastmath             don't build with fastmath], fastmath=$enableval, fastmath=yes)
72 AM_CONDITIONAL(FASTMATH, [test "x$fastmath" = "xyes"])
73
74 if test x"$fastmath" = xyes; then
75         if eval "test x$GCC = xyes"; then
76                 CFLAGS="$CFLAGS -ffast-math"
77         fi
78 fi
79
80 X_CFLAGS="-I$x_includes"
81 X_LIBS="-L$ac_x_libraries"
82
83 PKG_CHECK_MODULES(NAVIT, [glib-2.0 gmodule-2.0 gthread-2.0], [], AC_MSG_ERROR([glib-2.0 or gmodule-2.0 not found. Usually you need to install a package named glib2-devel or libglib2.0-dev]))
84 AC_SUBST(NAVIT_CFLAGS)
85 AC_SUBST(NAVIT_LIBS)
86
87 AC_CHECK_HEADER(
88         zlib.h,
89         AC_DEFINE(
90                 [HAVE_ZLIB],
91                 [],
92                 Define to 1 if you have the <zlib.h> header file.
93                 )
94                 ZLIB_LIBS="-lz",
95         AC_MSG_WARN([*** no zlib.h\ -- reduced functionality of osm2navit])
96         )
97 AC_SUBST(ZLIB_LIBS)
98
99 AC_ARG_ENABLE(gui-gtk, [  --disable-gui-gtk             don't create gui gtk ], MODULE_GUI_GTK=$enableval, MODULE_GUI_GTK=yes)
100 if test "x$MODULE_GUI_GTK" = "xyes"; then
101         PKG_CHECK_MODULES(GTK2, [gtk+-2.0], [gtk2_pkgconfig=yes], [gtk2_pkgconfig=no])
102         if test "x$gtk2_pkgconfig" = "xyes"; then
103                 AC_DEFINE(HAVE_GTK2, 1, [Define to 1 if you have gtk2])
104         fi
105 fi
106
107 GTK2_CFLAGS="$GTK2_CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
108
109 AC_SUBST(GTK2_CFLAGS)
110 AC_SUBST(GTK2_LIBS)
111 AM_CONDITIONAL(GUI_GTK, [test "x$gtk2_pkgconfig" = "xyes"])
112 AM_CONDITIONAL(GRAPHICS_GTK_DRAWING_AREA, [test "x$gtk2_pkgconfig" = "xyes"])
113 AM_CONDITIONAL(PLUGINS, [test "x$plugins" = "xyes"])
114
115 AC_ARG_ENABLE(gui-directfb, [  --disable-gui-directfb             don't create gui directfb ], MODULE_GUI_DIRECTFB=$enableval, MODULE_GUI_DIRECTFB=yes)
116
117 if test "x$MODULE_GUI_DIRECTFB" = "xyes"; then
118         PKG_CHECK_MODULES(DIRECTFB, [directfb], [directfb_pkgconfig=yes], [directfb_pkgconfig=no])
119         if test "x$directfb_pkgconfig" = "xyes"; then
120                 AC_DEFINE(HAVE_DIRECTFB, 1, [Define to 1 if you have directfb])
121         fi
122 fi
123
124 DIRECTFB_CFLAGS="$DIRECTFB_CFLAGS"
125
126 #DIRECTFB_CFLAGS="-D_REENTRANT -I/data/oe/tmp/staging/arm-angstrom-linux-gnueabi/usr/include/directfb/"
127 #DIRECTFB_LIBS="-L/data/oe/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib/ -ldirectfb -lfusion -ldirect -lpthread"
128
129 AC_SUBST(DIRECTFB_CFLAGS)
130 AC_SUBST(DIRECTFB_LIBS)
131 AM_CONDITIONAL(GUI_DIRECTFB, [test "x$directfb_pkgconfig" = "xyes"])
132 AM_CONDITIONAL(GRAPHICS_DIRECTFB, [test "x$directfb_pkgconfig" = "xyes"])
133
134 AC_ARG_ENABLE(graphics-qt-qpainter, [  --disable-graphics-qt-qpainter             don't create graphics qt-qpainter], enable_graphics_qt_qpainter=$enableval, enable_graphics_qt_qpainter=yes)
135 if test "x${enable_graphics_qt_qpainter}" = "xyes" ; then
136         PKG_CHECK_MODULES(QT_GUI, [QtGui QtCore], ,enable_graphics_qt_qpainter=no)
137 fi
138 if test "x${enable_graphics_qt_qpainter}" = "xyes" ; then
139         AC_DEFINE(USE_GRAPICS_QT_QPAINTER, 1, [Build with graphics qt_qpainter])
140         AC_SUBST(QT_GUI_CFLAGS)
141         AC_SUBST(QT_GUI_LIBS)
142 fi
143 AM_CONDITIONAL(USE_GRAPHICS_QT_QPAINTER, test "x${enable_graphics_qt_qpainter}" = "xyes")
144
145 AC_ARG_ENABLE(graphics-sdl, [  --disable-graphics-sdl             don't create graphics sdl], enable_graphics_sdl=$enableval, enable_graphics_sdl=yes)
146 if test "x${enable_graphics_sdl}" = "xyes" ; then
147         if test -z "$SDL_CONFIG"; then
148             AC_PATH_PROG([SDL_CONFIG], [sdl-config], [])
149         fi
150 fi
151 if test "x${enable_graphics_sdl}" = "xyes" ; then
152         AC_MSG_CHECKING([for SDL libraries with $SDL_CONFIG])
153         if test ! -x "$SDL_CONFIG"; then
154             enable_graphics_sdl = "no"
155             AC_MSG_RESULT([no])
156         else
157             SDL_CFLAGS="`$SDL_CONFIG --cflags`"
158             SDL_LIBS="`$SDL_CONFIG --libs`"
159             AC_SUBST(SDL_CFLAGS)
160             AC_SUBST(SDL_LIBS)
161             AC_MSG_RESULT([yes])
162         fi 
163 fi
164 if test "x${enable_graphics_sdl}" = "xyes" ; then
165         save_CPPFLAGS=$CPPFLAGS
166         CPPFLAGS="$($SDL_CONFIG --cflags) $CPPFLAGS"
167         AC_CHECK_HEADER(SDL_image.h,SDL_IMAGE_LIBS=-lSDL_image,enable_graphics_sdl=no)
168         AC_SUBST(SDL_IMAGE_LIBS)
169         CPPFLAGS=$save_CPPFLAGS
170 fi
171 if test "x${enable_graphics_sdl}" = "xyes" ; then
172         AC_DEFINE(USE_GRAPICS_SDL, 1, [Build with graphics sdl])
173 fi
174 AM_CONDITIONAL(USE_GRAPHICS_SDL, test "x${enable_graphics_sdl}" = "xyes")
175
176 AC_ARG_ENABLE(postgresql, [  --disable-postgresql             don't add postgresql support to osm2navit], enable_postgresql=$enableval, enable_postgresql=yes)
177 if test "x${enable_postgresql}" = "xyes" ; then
178         if test -z "$PG_CONFIG"; then
179             AC_PATH_PROG([PG_CONFIG], [pg_config], [])
180         fi
181         AC_MSG_CHECKING([for PostgreSQL libraries with $PG_CONFIG])
182         if test ! -x "$PG_CONFIG"; then
183             enable_postgresql = "no"
184             AC_MSG_RESULT([no])
185         else
186             POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
187             POSTGRESQL_LIBS="-L`$PG_CONFIG --libdir` -lpq"
188             AC_DEFINE(HAVE_POSTGRESQL, 1, [Postgresql libraries available])
189             AC_SUBST(POSTGRESQL_CFLAGS)
190             AC_SUBST(POSTGRESQL_LIBS)
191             AC_MSG_RESULT([yes])
192         fi 
193 fi
194 AM_CONDITIONAL(HAVE_POSTGRESQL, test "x${enable_postgresql}" = "xyes")
195
196 PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_pkgconfig=yes], [freetype2_pkgconfig=no])
197 if test "x$freetype2_pkgconfig" = "xyes"; then
198    AC_DEFINE(HAVE_FREETYPE2, 1, [Define to 1 if you have freetype2])
199 fi
200 AC_SUBST(FREETYPE2_CFLAGS)
201 AC_SUBST(FREETYPE2_LIBS)
202
203 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig], [fontconfig_pkgconfig=yes], [fontconfig_pkgconfig=no])
204 if test "x$fontconfig_pkgconfig" = "xyes"; then
205    AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if you have fontconfig])
206 fi
207 AC_SUBST(FONTCONFIG_CFLAGS)
208 AC_SUBST(FONTCONFIG_LIBS)
209
210 PKG_CHECK_MODULES(IMLIB2, [imlib2], [imlib2_pkgconfig=yes], [imlib2_pkgconfig=no])
211 if test "x$imlib2_pkgconfig" = "xyes"; then
212    AC_DEFINE(HAVE_IMLIB2, 1, [Define to 1 if you have imlib2])
213 fi
214 AC_SUBST(IMLIB2_CFLAGS)
215 AC_SUBST(IMLIB2_LIBS)
216
217
218 AC_ARG_ENABLE(speech-speechd, [  --disable-speech-speechd             don't create speech speechd ], MODULE_SPEECH_SPEECHD=$enableval, MODULE_SPEECH_SPEECHD=yes)
219 if test "x$MODULE_SPEECH_SPEECHD" = "xyes"; then
220         AC_CHECK_HEADER(libspeechd.h, AC_DEFINE([HAVE_LIBSPEECHD],[],Define to 1 if you have the <libspeechd.h> header file.) SPEECHD_LIBS="-lspeechd" speechd=yes,  AC_MSG_WARN([*** no libspeechd.h -- Speech output disabled]))
221 fi
222 AC_SUBST(SPEECHD_CFLAGS)
223 AC_SUBST(SPEECHD_LIBS)
224 AM_CONDITIONAL(SPEECH_SPEECH_DISPATCHER, [test "x$speechd" = "xyes"])
225
226
227 AC_ARG_ENABLE(gui-sdl, [  --disable-gui-sdl             don't create gui sdl ], MODULE_GUI_SDL=$enableval, MODULE_GUI_SDL=yes)
228 if test "x$MODULE_GUI_SDL" = "xyes"; then
229         AC_CHECK_HEADER(
230                 SDL/SDL.h,
231                 AC_DEFINE(
232                         [HAVE_LIBSDL],
233                         [],
234                         Define to 1 if you have the <SDL/SDL.h> header file.
235                         )
236                         SDL_LIBS="-lSDL"
237                         sdl=yes,
238                 AC_MSG_WARN([*** no SDL/SDL.h -- SDL support disabled])
239         )
240 fi
241
242 PKG_CHECK_MODULES(
243         [CEGUI],
244         [CEGUI-OPENGL >= 0.5.0],
245         [
246                 AC_DEFINE(
247                         [HAVE_CEGUI],
248                         [],
249                         [Define to 1 if you have the @<:@CEGUI/CEGUI.h@:>@ header file.])
250                 cegui=yes
251         ],
252         [AC_MSG_WARN([*** CEGUI not found -- SDL support disabled])]
253 )
254
255 AC_CHECK_HEADER(
256         X11/Xmu/Xmu.h,
257         AC_DEFINE(
258                 [HAVE_XMU],
259                 [],
260                 Define to 1 if you have the <X11/Xmu/Xmu.h> header file.
261                 )
262                 xmu=yes,
263         AC_MSG_WARN([*** no X11/Xmu/Xmu.h -- opengl and SDL support disabled])
264 )
265
266 AC_CHECK_HEADER(
267         GL/gl.h,
268         AC_DEFINE(
269                 [HAVE_OPENGL],
270                 [],
271                 Define to 1 if you have the <GL/gl.h> header file.
272                 )
273                 OPENGL_LIBS="$X_LIBS -lGL -lGLU"
274                 opengl=yes,
275         AC_MSG_WARN([*** no GL/gl.h -- opengl and SDL support disabled])
276 )
277
278 AC_CHECK_HEADER(
279         GL/glut.h,
280         AC_DEFINE(
281                 [HAVE_GLUT],
282                 [],
283                 Define to 1 if you have the <GL/glut.h> header file.
284                 )
285                 glut=yes,
286         AC_MSG_WARN([*** no GL/glut.h -- opengl and SDL support disabled])
287 )
288
289 AC_SUBST(OPENGL_CFLAGS)
290 AC_SUBST(OPENGL_LIBS)
291
292 AC_CHECK_HEADER(
293         GL/glc.h,
294         AC_DEFINE(
295                 [HAVE_GLC],
296                 [],
297                 Define to 1 if you have the <GL/glc.h> header file.
298                 )
299                 GLC_LIBS="-lGLC"
300                 glc=yes,
301         AC_MSG_WARN([*** no GL/glc.h -- opengl and SDL support disabled])
302 )
303 AC_SUBST(GLC_CFLAGS)
304 AC_SUBST(GLC_LIBS)
305
306 if test x"$cegui" = xyes         
307                 then     
308          # Save the LIBS into a temp var since AC_CHECK_LIB adds the lib into LIBS       
309          # and we want just to check and use CEGUI_LIBS          
310          libstemp="$LIBS"        
311          # For CEGUI, we have to check the presence of some libraries.   
312          # The following are mandatory (used by navit)   
313          # If the user installed NavIt without, issue a warning and disable CEGUI        
314          AC_CHECK_LIB(CEGUIBase, main,   
315                   [],    
316                   [      
317                  echo "Error! Something is wrong with CEGUIBase. Do you have at least cegui-0.5?"        
318                  ])      
319          AC_CHECK_LIB(CEGUIOpenGLRenderer, main,         
320                   [],    
321                   [      
322                  echo "Error! Something is wrong with CEGUIOpenGLRenderer. Do you have at least cegui-0.5? "     
323                  ], $OPENGL_LIBS )       
324          AC_CHECK_LIB(CEGUIFalagardWRBase, main,         
325                   [],    
326                   [      
327                  echo "Error! Something is wrong with CEGUIFalagardWRBase. Do you have at least cegui-0.5?"      
328                  ], $OPENGL_LIBS)        
329          CEGUI_LIBS="-lCEGUIBase -lCEGUIOpenGLRenderer -lCEGUIFalagardWRBase"    
330                  
331          # The following are optional, but we need to link against them if cegui was built with them     
332          AC_CHECK_LIB(CEGUIXercesParser, main,   
333                   [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIXercesParser"],        
334                   [echo "CEGUIXercesParser not found/not working, disabled."],   
335                   $OPENGL_LIBS   
336          )       
337                  
338          AC_CHECK_LIB(CEGUIExpatParser, main,    
339                   [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIExpatParser"],         
340                   [echo "CEGUIExpatParser not found/not working, disabled."],    
341                   $OPENGL_LIBS   
342          )       
343                  
344          AC_CHECK_LIB(CEGUILibxmlParser, main,   
345                   [CEGUI_LIBS="$CEGUI_LIBS -lCEGUILibxmlParser"],        
346                   [echo "CEGUILibxmlParser not found/not working, disabled."],   
347                   $OPENGL_LIBS   
348          )       
349                  
350          AC_CHECK_LIB(CEGUITinyXMLParser, main,          
351                   [CEGUI_LIBS="$CEGUI_LIBS -lCEGUITinyXMLParser"],       
352                   [echo "CEGUITinyXMLParser not found/not working, disabled."],          
353                   $OPENGL_LIBS   
354          )       
355                  
356          AC_CHECK_LIB(CEGUIDevILImageCodec, main,        
357                   [
358                         CEGUI_LIBS="$CEGUI_LIBS -lCEGUIDevILImageCodec"
359                          AC_DEFINE([HAVE_LIBCEGUIDEVILIMAGECODEC],[1],Define to 1 to use DevIL codec)
360                   ],
361                   [echo "CEGUIDevILImageCodec not found/not working, disabled."],        
362                   $OPENGL_LIBS   
363          )       
364                  
365          AC_CHECK_LIB(CEGUITGAImageCodec, createImageCodec,      
366                   [
367                           CEGUI_LIBS="$CEGUI_LIBS -lCEGUITGAImageCodec"
368                           AC_DEFINE(HAVE_LIBCEGUITGAIMAGECODEC,[1],Define to 1 to use the TGA codec)
369                   ],
370                   [echo "GUITGAImageCodec not found/not working, disabled."],    
371                   $OPENGL_LIBS   
372          )       
373                  
374          libssilly="$OPENGL_LIBS -lpng"          
375          AC_CHECK_LIB(CEGUISILLYImageCodec, createImageCodec,    
376                   [
377                          CEGUI_LIBS="$CEGUI_LIBS -lCEGUISILLYImageCodec"
378                          AC_DEFINE([HAVE_LIBCEGUISILLYIMAGECODEC],[1],Define to 1 to use SILLY codec)
379                   ],
380                   [echo "CEGUISILLYImageCodec not found/not working, disabled."],        
381                   $libssilly     
382          )       
383          # Restore the libs
384          LIBS="$libstemp"        
385          echo "CEGUI_LIBS : $CEGUI_LIBS"         
386          fi
387
388 AC_SUBST(CEGUI_CFLAGS)
389 AC_SUBST(CEGUI_LIBS)
390
391 AM_CONDITIONAL(GUI_SDL, [test "x$sdl" = "xyes" -a "x$cegui" = "xyes" -a "x$opengl" = "xyes" -a "x$glc" = "xyes" -a "x$xmu" = "xyes" ])
392 AM_CONDITIONAL(GRAPHICS_OPENGL, [test "x$opengl" = "xyes" -a "x$glc" = "xyes" ])
393
394 AC_ARG_ENABLE(gui-clutter, [  --disable-gui-clutter             don't create gui clutter ], MODULE_GUI_CLUTTER=$enableval, MODULE_GUI_CLUTTER=yes)
395 if test "x$MODULE_GUI_CLUTTER" = "xyes"; then
396         PKG_CHECK_MODULES(CLUTTER, [clutter-0.8], [clutter_pkgconfig=yes], [clutter_pkgconfig=no])
397         if test "x$clutter_pkgconfig" = "xyes"; then
398                 AC_DEFINE(HAVE_CLUTTER, 1, [Define to 1 if you have clutter])
399         fi
400 fi
401
402 AC_SUBST(CLUTTER_CFLAGS)
403 AC_SUBST(CLUTTER_LIBS)
404 AM_CONDITIONAL(GUI_CLUTTER, [test "x$clutter_pkgconfig" = "xyes" -a "x$glc" = "xyes" ])
405         
406
407 if test x"${USE_GYPSY}" = xyes
408 then
409         PKG_CHECK_MODULES(GYPSY, gypsy, use_gypsy=yes, use_gypsy=no)
410         AC_SUBST(GYPSY_CFLAGS)
411         AC_SUBST(GYPSY_LIBS)
412 fi
413 AM_CONDITIONAL(VEHICLE_GYPSY, [test "x$use_gypsy" = "xyes"])
414
415 if test x"${USE_LIBGPS}" = xyes
416 then
417         AC_CHECK_HEADER(gps.h, AC_DEFINE([HAVE_LIBGPS],[],Define to 1 if you have the <gps.h> header file.) GPSD_LIBS="-lgps" gpsd=yes,  AC_MSG_WARN([*** no gps.h -- gpsd support disabled]))
418 fi
419 AC_SUBST(GPSD_CFLAGS)
420 AC_SUBST(GPSD_LIBS)
421 AM_CONDITIONAL(VEHICLE_GPSD, [test "x$gpsd" = "xyes"])
422
423 if test x"${USE_GARMIN}" = xyes
424 then
425         # check for libgarmin
426         PKG_CHECK_MODULES(LIBGARMIN, libgarmin, use_libgarmin=yes, use_libgarmin=no)
427         AC_SUBST(LIBGARMIN_CFLAGS)
428         AC_SUBST(LIBGARMIN_LIBS)
429 fi
430         AM_CONDITIONAL(HAVELIBGARMIN, [test "x$use_libgarmin" = "xyes"])
431
432
433 # binding python
434 AC_ARG_ENABLE(binding-python, [  --disable-binding-python             don't create binding python], enable_binding_python=$enableval, enable_binding_python=yes)
435 if test "x${enable_binding_python}" = "xyes" ; then
436         if test "x${cross_compiling}" = "xyes" ; then
437                 AC_MSG_WARN([*** cross compiling, support for python disabled])
438                 enable_binding_python="no"
439         fi
440 fi
441 if test "x${enable_binding_python}" = "xyes"; then
442         AC_PATH_PROG(_PATH_PYTHON,[python])
443         dnl Libraries and flags for embedded Python.
444         dnl FIXME: I wish there was a less icky way to get this.
445         if test "x${_PATH_PYTHON}" != "x" ; then
446                 AC_MSG_CHECKING(for Python linkage)
447                 py_prefix=`$_PATH_PYTHON -c 'import sys; print sys.prefix'`
448                 py_ver=`$_PATH_PYTHON -c 'import sys; print sys.version[[:3]]'`
449                 py_libdir="${py_prefix}/lib/python${py_ver}"
450                 PYTHON_CFLAGS="-I${py_prefix}/include/python${py_ver}"
451                 if test -f $py_libdir/config/Makefile -a -f $py_prefix/include/python${py_ver}/Python.h; then
452                         py_libs=`grep '^LIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
453                         py_libc=`grep '^LIBC=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
454                         py_libm=`grep '^LIBM=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
455                         py_liblocalmod=`grep '^LOCALMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
456                         py_libbasemod=`grep '^BASEMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
457                         PYTHON_LIBS="-L$py_libdir/config $py_libs $py_libc $py_libm -lpython$py_ver $py_liblocalmod $py_libbasemod"
458                         PYTHON_LIBS=`echo $PYTHON_LIBS | sed -e 's/[ \\t]*/ /g'`
459                         AC_MSG_RESULT($py_libdir)
460                 else
461                         AC_MSG_WARN([$py_libdir/config/Makefile or $py_prefix/include/python${py_ver}/Python.h missing, support for python disabled])
462                         enable_binding_python="no"
463                 fi
464         else
465                 AC_MSG_WARN([no python found, support for python disabled])
466                 enable_binding_python="no"
467         fi
468 fi
469 if test "x${enable_binding_python}" = xyes ; then
470         AC_DEFINE(USE_BINDING_PYTHON, 1, [Build with binding python])
471         AC_SUBST(PYTHON_CFLAGS)
472         AC_SUBST(PYTHON_LIBS)
473 fi
474 AM_CONDITIONAL(USE_BINDING_PYTHON, test "x${enable_binding_python}" = "xyes")
475
476 # binding dbus
477 AC_ARG_ENABLE(binding-dbus,   [  --disable-binding-dbus               don't create binding dbus], enable_binding_dbus=$enableval, enable_binding_dbus=yes)
478 if test "x${enable_binding_dbus}" = "xyes" ; then
479         PKG_CHECK_MODULES(DBUS, [dbus-glib-1], ,enable_binding_dbus=no)
480 fi
481 if test "x${enable_binding_dbus}" = "xyes" ; then
482         AC_DEFINE(USE_BINDING_DBUS, 1, [Build with binding dbus])
483         AC_SUBST(DBUS_CFLAGS)
484         AC_SUBST(DBUS_LIBS)
485 fi
486 AM_CONDITIONAL(USE_BINDING_DBUS, test "x${enable_binding_dbus}" = "xyes")
487
488 # svg
489 AC_ARG_ENABLE(svg, [  --disable-svg        disable Scalable Vector Graphics], enable_svg=$enableval, enable_svg=yes)
490 AC_ARG_ENABLE(svg2png, [  --disable-svg2png        disable conversion of svgs to pngs], enable_svg2png=$enableval, enable_svg2png=yes)
491 AC_ARG_ENABLE(svg2png_scaling, [  --enable-svg2png-scaling   enable conversion of svgs to pngs with specified sizes], SVG2PNG_SCALES=$enableval, SVG2PNG_SCALES="8 16 32 48 96")
492 if test "x${enable_svg2png}" = "xyes" ; then
493         AC_PATH_PROG([KSVGTOPNG], [ksvgtopng], [])
494         if test ! -x "$KSVGTOPNG"; then
495             enable_svg2png="no"
496         fi
497 fi
498 AC_SUBST(SVG2PNG_SCALES)
499 AM_CONDITIONAL(USE_SVG2PNG_SCALES, test "x${SVG2PNG_SCALES}" != "xyes" -a "x${SVG2PNG_SCALES}" != "x")
500 AM_CONDITIONAL(USE_SVG2PNG, test "x${enable_svg2png}" = "xyes")
501 AM_CONDITIONAL(USE_SVG, test "x${enable_svg}" = "xyes")
502
503 # NLS
504
505 AC_ARG_ENABLE(nls,
506   [  --disable-nls        disable Native Language Support ( gettext/libintl )],
507    enable_nls=$enableval, enable_nls=yes)
508
509
510 INTLIBS=""
511 MOFILES=""
512 POFILES=""
513 LINGUAS=""
514
515 if test x$enable_nls = xyes; then
516
517   AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"], 
518              AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
519                          INTLIBS="" ))
520
521   AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
522   AC_CHECK_PROG(MSGMERGE, msgmerge, msgmerge)
523   AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt)
524
525   if test "$XGETTEXT" != ""; then 
526     if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
527         echo "xgettext isn't GNU version"
528         XGETTEXT=""
529     fi
530   fi
531
532   if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
533      PO=""
534      if test "$LINGUAS" = ""; then
535            ling=` (cd $srcdir/po; /bin/ls *.po) `
536            for l in $ling; do
537                 lcode=`basename $l .po`
538                 LINGUAS="$LINGUAS$lcode "
539            done
540     fi
541     AC_DEFINE(ENABLE_NLS, [1], [NLS Please])
542     echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
543   else
544    LINGUAS=""
545    PO=""
546    echo "xgettext and libintl.a don't both exist; will not build i18n support"
547  fi
548  for lang in $LINGUAS; do
549     MOFILES="$MOFILES $lang.mo"
550  done
551  for lang in $LINGUAS; do
552     POFILES="$POFILES $lang.po"
553  done
554 fi
555
556
557 AC_SUBST(INTLIBS)
558 AC_SUBST(MOFILES)
559 AC_SUBST(POFILES)
560 AM_GNU_GETTEXT_VERSION
561 AM_GNU_GETTEXT
562
563 LIBS="$LIBS -lm -rdynamic"
564
565 PACKAGE=navit
566 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
567 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
568 AC_SUBST(PACKAGE)
569 AC_SUBST(VERSION)
570
571 if test "x${cross_compiling}" = "xyes"; then
572   AC_MSG_CHECKING([for a C compiler for build tools])
573   AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc)
574 else
575   CC_FOR_BUILD=$CC
576 fi
577 CCLD_FOR_BUILD="$CC_FOR_BUILD"
578
579 AC_SUBST(cross_compiling)
580 AC_SUBST(CC_FOR_BUILD)
581 AC_SUBST(CCLD_FOR_BUILD)
582
583 AC_CONFIG_FILES([
584 Makefile
585 navit/Makefile
586 navit/binding/Makefile
587 navit/binding/python/Makefile
588 navit/binding/dbus/Makefile
589 navit/data/Makefile
590 navit/data/mg/Makefile
591 navit/data/textfile/Makefile
592 navit/data/binfile/Makefile
593 navit/data/garmin/Makefile
594 navit/data/poi_geodownload/Makefile
595 navit/data/poi_geodownload/libmdb/Makefile
596 navit/data/poi_geodownload/libmdb/include/Makefile
597 navit/fib-1.1/Makefile
598 navit/graphics/Makefile
599 navit/graphics/gtk_drawing_area/Makefile
600 navit/graphics/directfb/Makefile
601 navit/graphics/cogl/Makefile
602 navit/graphics/opengl/Makefile
603 navit/graphics/null/Makefile
604 navit/graphics/sdl/Makefile
605 navit/graphics/qt_qpainter/Makefile
606 navit/gui/Makefile
607 navit/gui/gtk/Makefile
608 navit/gui/internal/Makefile
609 navit/gui/clutter/Makefile
610 navit/gui/cegui/Makefile
611 navit/gui/cegui/datafiles/Makefile
612 navit/gui/directfb/Makefile
613 navit/osd/Makefile
614 navit/osd/core/Makefile
615 navit/speech/Makefile
616 navit/speech/cmdline/Makefile
617 navit/speech/speech_dispatcher/Makefile
618 navit/vehicle/Makefile
619 navit/vehicle/file/Makefile
620 navit/vehicle/gpsd/Makefile
621 navit/vehicle/gypsy/Makefile
622 navit/vehicle/demo/Makefile
623 navit/xpm/Makefile
624 navit/maps/Makefile
625 intl/Makefile
626 po/Makefile
627 ])
628 #src/data/garmin_img/Makefile
629
630 AC_OUTPUT
631
632
633 echo ""
634 echo ""
635 echo "Summary of your installation :"
636 if test x"$gtk2_pkgconfig" = xyes
637         then
638         echo "GTK gui     : ENABLED"
639         else
640         echo "GTK gui     : DISABLED : you are missing a dependency. To fix this install a package named gtk2-devel or libgtk2.0-dev"
641 fi
642 # FIXME : maybe elaborate missing dependencies
643 if test x"$sdl" != xyes
644         then
645         sdl_failures="(libsdl maybe?) "
646 fi
647 if test x"$xmu" != xyes
648         then                
649         sdl_failures=$sdl_failures"libxmu "
650 fi        
651 if test x"$glut" != xyes
652        then
653         sdl_failures=$sdl_failures"glut "
654 fi
655 if test x"$glc" != xyes
656         then
657         sdl_failures=$sdl_failures"quesoglc "
658 fi
659 if test x"$cegui" != xyes
660         then
661         sdl_failures=$sdl_failures"cegui-devel >= 0.5 "
662 fi
663 if test -z "$sdl_failures"
664         then
665         echo "OpenGL gui  : ENABLED, with $CEGUI_LIBS"
666         else
667                  echo "OpenGL gui  : DISABLED : you are missing $sdl_failures"
668 fi
669 if test x"$directfb_pkgconfig" = xyes
670         then
671         echo "DIRECTFB    : ENABLED"
672         else
673         echo "DIRECTFB    : DISABLED"
674 fi
675 if test x"$clutter_pkgconfig" = xyes
676         then
677         echo "Clutter gui : ENABLED"
678         else 
679         echo "Clutter gui : DISABLED"
680 fi
681 if test x"$enable_hildon" = xyes
682         then
683         echo "Maemo/Hildon: ENABLED"
684         else
685         echo "Maemo/Hildon: DISABLED"
686 fi
687
688 if test x"$use_gypsy" = xyes
689         then
690         echo "Gypsy support: ENABLED"
691         else
692         echo "Gypsy support: DISABLED"
693 fi
694 if test x"$gpsd" = xyes
695         then
696         echo "GPSD support: ENABLED"
697         else
698         echo "GPSD support: DISABLED"
699 fi
700 if test x"$speechd" = xyes
701         then
702         echo "SPEECHD     : ENABLED"
703         else
704         echo "SPEECHD     : DISABLED"
705 fi
706 if test x"${USE_GARMIN}" = xyes
707         then
708         if test "x$use_libgarmin" = "xyes"
709                 then
710                 echo "Garmin IMG  : ENABLED"
711                 else
712                 echo "Garmin IMG  : DISABLED (you don't have libgarmin)"
713         fi
714         else 
715                 echo "Garmin IMG  : DISABLED (you requested it)"
716 fi
717 if test "x$samplemap" = "xyes"
718         then
719         echo "Samplemap   : ENABLED"
720         else
721         echo "Samplemap   : DISABLED"
722 fi
723 if  [ test x"$gtk2_pkgconfig" != xyes ] && [ test x"$sdl" != xyes ] && [ test x"$directfb_pkgconfig" != xyes ]
724         then
725         echo ""
726         echo "" 
727         echo "*** WARNING! you have no gui that can be built! ***"
728         echo "Please install the dependency for at least gtk or sdl gui"
729         echo "For more details, see the wiki at http://wiki.navit-project.org/"
730         echo "" 
731         exit 1
732 fi