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