3 AM_CONFIG_HEADER(config.h)
7 m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],
8 [AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], [AC_GNU_SOURCE])])
10 AC_USE_SYSTEM_EXTENSIONS
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"
17 if eval "test x$GXX = xyes"; then
18 CXXFLAGS="$CXXFLAGS -Wall -Wcast-align -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE"
23 AC_ARG_ENABLE(plugins, [ --disable-plugins disable plugins],
35 Define to 1 if you have plugins.
42 AC_ARG_ENABLE(avoid-unaligned, [ --enable-avoid-unaligned avoid unaligned accesses], AVOID_UNALIGNED=$enableval, AVOID_UNALIGNED=no)
43 test x"${AVOID_UNALIGNED}" = xyes && AC_DEFINE(AVOID_UNALIGNED,[],Define to avoid unaligned access)
45 AC_ARG_ENABLE(avoid-float, [ --enable-avoid-float avoid floating point calculations], AVOID_FLOAT=$enableval, AVOID_FLOAT=no)
46 test x"${AVOID_FLOAT}" = xyes && AC_DEFINE(AVOID_FLOAT,[],Define to avoid floating point)
48 AC_ARG_ENABLE(hildon, [ --enable-hildon build with maemo/hildon support], enable_hildon=$enableval, enable_hildon=no)
49 if test "x${enable_hildon}" = "xyes" ; then
50 PKG_CHECK_MODULES(enable_hildon, hildon-libs >= 0.12.24, , [
54 if test x"${enable_hildon}" = xyes ; then
55 AC_DEFINE(USE_HILDON, 1, [Build with maemo/hildon support])
56 AC_SUBST(HILDON_CFLAGS)
60 AM_CONDITIONAL(USE_HILDON, test "${enable_hildon}" = "xyes")
62 AC_ARG_ENABLE(libgps, [ --disable-libgps don't use libgps], USE_LIBGPS=$enableval, USE_LIBGPS=yes)
63 AC_ARG_ENABLE(garmin, [ --disable-garmin disable garmin support], USE_GARMIN=$enableval, USE_GARMIN=yes)
65 AC_ARG_ENABLE(samplemap, [ --disable-samplemap don't build the samplemap], samplemap=$enableval, samplemap=yes)
66 AM_CONDITIONAL(BUILD_SAMPLEMAP, [test "x$samplemap" = "xyes"])
68 AC_ARG_ENABLE(fastmath, [ --disable-fastmath don't build with fastmath], fastmath=$enableval, fastmath=yes)
69 AM_CONDITIONAL(FASTMATH, [test "x$fastmath" = "xyes"])
71 if test x"$fastmath" = xyes; then
72 if eval "test x$GCC = xyes"; then
73 CFLAGS="$CFLAGS -ffast-math"
77 X_CFLAGS="-I$x_includes"
78 X_LIBS="-L$ac_x_libraries"
80 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]))
81 AC_SUBST(NAVIT_CFLAGS)
89 Define to 1 if you have the <zlib.h> header file.
92 AC_MSG_WARN([*** no zlib.h\ -- reduced functionality of osm2navit])
96 AC_ARG_ENABLE(gui-gtk, [ --disable-gui-gtk don't create gui gtk ], MODULE_GUI_GTK=$enableval, MODULE_GUI_GTK=yes)
97 if test "x$MODULE_GUI_GTK" = "xyes"; then
98 PKG_CHECK_MODULES(GTK2, [gtk+-2.0], [gtk2_pkgconfig=yes], [gtk2_pkgconfig=no])
99 if test "x$gtk2_pkgconfig" = "xyes"; then
100 AC_DEFINE(HAVE_GTK2, 1, [Define to 1 if you have gtk2])
104 GTK2_CFLAGS="$GTK2_CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
106 AC_SUBST(GTK2_CFLAGS)
108 AM_CONDITIONAL(GUI_GTK, [test "x$gtk2_pkgconfig" = "xyes"])
109 AM_CONDITIONAL(GRAPHICS_GTK_DRAWING_AREA, [test "x$gtk2_pkgconfig" = "xyes"])
110 AM_CONDITIONAL(PLUGINS, [test "x$plugins" = "xyes"])
112 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)
113 if test "x${enable_graphics_qt_qpainter}" = "xyes" ; then
114 PKG_CHECK_MODULES(QT_GUI, [QtGui QtCore], ,enable_graphics_qt_qpainter=no);
116 if test "x${enable_graphics_qt_qpainter}" = "xyes" ; then
117 AC_DEFINE(USE_GRAPICS_QT_QPAINTER, 1, [Build with graphics qt_qpainter])
118 AC_SUBST(QT_GUI_CFLAGS)
119 AC_SUBST(QT_GUI_LIBS)
121 AM_CONDITIONAL(USE_GRAPHICS_QT_QPAINTER, test "x${enable_graphics_qt_qpainter}" = "xyes")
123 PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_pkgconfig=yes], [freetype2_pkgconfig=no])
124 if test "x$freetype2_pkgconfig" = "xyes"; then
125 AC_DEFINE(HAVE_FREETYPE2, 1, [Define to 1 if you have freetype2])
127 AC_SUBST(FREETYPE2_CFLAGS)
128 AC_SUBST(FREETYPE2_LIBS)
130 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig], [fontconfig_pkgconfig=yes], [fontconfig_pkgconfig=no])
131 if test "x$fontconfig_pkgconfig" = "xyes"; then
132 AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if you have fontconfig])
134 AC_SUBST(FONTCONFIG_CFLAGS)
135 AC_SUBST(FONTCONFIG_LIBS)
137 PKG_CHECK_MODULES(IMLIB2, [imlib2], [imlib2_pkgconfig=yes], [imlib2_pkgconfig=no])
138 if test "x$imlib2_pkgconfig" = "xyes"; then
139 AC_DEFINE(HAVE_IMLIB2, 1, [Define to 1 if you have imlib2])
141 AC_SUBST(IMLIB2_CFLAGS)
142 AC_SUBST(IMLIB2_LIBS)
145 AC_ARG_ENABLE(speech-speechd, [ --disable-speech-speechd don't create speech speechd ], MODULE_SPEECH_SPEECHD=$enableval, MODULE_SPEECH_SPEECHD=yes)
146 if test "x$MODULE_SPEECH_SPEECHD" = "xyes"; then
147 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]))
149 AC_SUBST(SPEECHD_CFLAGS)
150 AC_SUBST(SPEECHD_LIBS)
151 AM_CONDITIONAL(SPEECH_SPEECH_DISPATCHER, [test "x$speechd" = "xyes"])
154 AC_ARG_ENABLE(gui-sdl, [ --disable-gui-sdl don't create gui sdl ], MODULE_GUI_SDL=$enableval, MODULE_GUI_SDL=yes)
155 if test "x$MODULE_GUI_SDL" = "xyes"; then
161 Define to 1 if you have the <SDL/SDL.h> header file.
165 AC_MSG_WARN([*** no SDL/SDL.h -- SDL support disabled])
173 [CEGUI-OPENGL >= 0.5.0],
178 [Define to 1 if you have the @<:@CEGUI/CEGUI.h@:>@ header file.])
181 [AC_MSG_WARN([*** CEGUI not found -- SDL support disabled])]
189 Define to 1 if you have the <X11/Xmu/Xmu.h> header file.
192 AC_MSG_WARN([*** no X11/Xmu/Xmu.h -- opengl and SDL support disabled])
200 Define to 1 if you have the <GL/gl.h> header file.
202 OPENGL_LIBS="$X_LIBS -lGL -lGLU"
204 AC_MSG_WARN([*** no GL/gl.h -- opengl and SDL support disabled])
212 Define to 1 if you have the <GL/glut.h> header file.
215 AC_MSG_WARN([*** no GL/glut.h -- opengl and SDL support disabled])
218 AC_SUBST(OPENGL_CFLAGS)
219 AC_SUBST(OPENGL_LIBS)
226 Define to 1 if you have the <GL/glc.h> header file.
230 AC_MSG_WARN([*** no GL/glc.h -- opengl and SDL support disabled])
235 if test x"$cegui" = xyes
237 # Save the LIBS into a temp var since AC_CHECK_LIB adds the lib into LIBS
238 # and we want just to check and use CEGUI_LIBS
240 # For CEGUI, we have to check the presence of some libraries.
241 # The following are mandatory (used by navit)
242 # If the user installed NavIt without, issue a warning and disable CEGUI
243 AC_CHECK_LIB(CEGUIBase, main,
246 echo "Error! Something is wrong with CEGUIBase. Do you have at least cegui-0.5?"
248 AC_CHECK_LIB(CEGUIOpenGLRenderer, main,
251 echo "Error! Something is wrong with CEGUIOpenGLRenderer. Do you have at least cegui-0.5? "
253 AC_CHECK_LIB(CEGUIFalagardWRBase, main,
256 echo "Error! Something is wrong with CEGUIFalagardWRBase. Do you have at least cegui-0.5?"
258 CEGUI_LIBS="-lCEGUIBase -lCEGUIOpenGLRenderer -lCEGUIFalagardWRBase"
260 # The following are optional, but we need to link against them if cegui was built with them
261 AC_CHECK_LIB(CEGUIXercesParser, main,
262 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIXercesParser"],
263 [echo "CEGUIXercesParser not found/not working, disabled."],
267 AC_CHECK_LIB(CEGUIExpatParser, main,
268 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIExpatParser"],
269 [echo "CEGUIExpatParser not found/not working, disabled."],
273 AC_CHECK_LIB(CEGUILibxmlParser, main,
274 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUILibxmlParser"],
275 [echo "CEGUILibxmlParser not found/not working, disabled."],
279 AC_CHECK_LIB(CEGUITinyXMLParser, main,
280 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUITinyXMLParser"],
281 [echo "CEGUITinyXMLParser not found/not working, disabled."],
285 AC_CHECK_LIB(CEGUIDevILImageCodec, main,
287 CEGUI_LIBS="$CEGUI_LIBS -lCEGUIDevILImageCodec"
288 AC_DEFINE([HAVE_LIBCEGUIDEVILIMAGECODEC],[1],Define to 1 to use DevIL codec)
290 [echo "CEGUIDevILImageCodec not found/not working, disabled."],
294 AC_CHECK_LIB(CEGUITGAImageCodec, createImageCodec,
296 CEGUI_LIBS="$CEGUI_LIBS -lCEGUITGAImageCodec"
297 AC_DEFINE(HAVE_LIBCEGUITGAIMAGECODEC,[1],Define to 1 to use the TGA codec)
299 [echo "GUITGAImageCodec not found/not working, disabled."],
303 libssilly="$OPENGL_LIBS -lpng"
304 AC_CHECK_LIB(CEGUISILLYImageCodec, createImageCodec,
306 CEGUI_LIBS="$CEGUI_LIBS -lCEGUISILLYImageCodec"
307 AC_DEFINE([HAVE_LIBCEGUISILLYIMAGECODEC],[1],Define to 1 to use SILLY codec)
309 [echo "CEGUISILLYImageCodec not found/not working, disabled."],
314 echo "CEGUI_LIBS : $CEGUI_LIBS"
317 AC_SUBST(CEGUI_CFLAGS)
320 AM_CONDITIONAL(GUI_SDL, [test "x$sdl" = "xyes" -a "x$cegui" = "xyes" -a "x$opengl" = "xyes" -a "x$glc" = "xyes" -a "x$xmu" = "xyes" ])
321 AM_CONDITIONAL(GRAPHICS_OPENGL, [test "x$opengl" = "xyes" -a "x$glc" = "xyes" ])
324 if test x"${USE_LIBGPS}" = xyes
326 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]))
328 AC_SUBST(GPSD_CFLAGS)
330 AM_CONDITIONAL(VEHICLE_GPSD, [test "x$gpsd" = "xyes"])
332 if test x"${USE_GARMIN}" = xyes
334 # check for libgarmin
335 PKG_CHECK_MODULES(LIBGARMIN, libgarmin, use_libgarmin=yes, use_libgarmin=no)
336 AC_SUBST(LIBGARMIN_CFLAGS)
337 AC_SUBST(LIBGARMIN_LIBS)
339 AM_CONDITIONAL(HAVELIBGARMIN, [test "x$use_libgarmin" = "xyes"])
343 AC_ARG_ENABLE(binding-python, [ --disable-binding-python don't create binding python], enable_binding_python=$enableval, enable_binding_python=yes)
344 if test "x${enable_binding_python}" = "xyes" ; then
345 if test "x${cross_compiling}" = "xyes" ; then
346 AC_MSG_WARN([*** cross compiling, support for python disabled])
347 enable_binding_python="no"
350 if test "x${enable_binding_python}" = "xyes"; then
351 AC_PATH_PROG(_PATH_PYTHON,[python])
352 dnl Libraries and flags for embedded Python.
353 dnl FIXME: I wish there was a less icky way to get this.
354 if test "x${_PATH_PYTHON}" != "x" ; then
355 AC_MSG_CHECKING(for Python linkage)
356 py_prefix=`$_PATH_PYTHON -c 'import sys; print sys.prefix'`
357 py_ver=`$_PATH_PYTHON -c 'import sys; print sys.version[[:3]]'`
358 py_libdir="${py_prefix}/lib/python${py_ver}"
359 PYTHON_CFLAGS="-I${py_prefix}/include/python${py_ver}"
360 if test -f $py_libdir/config/Makefile -a -f $py_prefix/include/python${py_ver}/Python.h; then
361 py_libs=`grep '^LIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
362 py_libc=`grep '^LIBC=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
363 py_libm=`grep '^LIBM=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
364 py_liblocalmod=`grep '^LOCALMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
365 py_libbasemod=`grep '^BASEMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
366 PYTHON_LIBS="-L$py_libdir/config $py_libs $py_libc $py_libm -lpython$py_ver $py_liblocalmod $py_libbasemod"
367 PYTHON_LIBS=`echo $PYTHON_LIBS | sed -e 's/[ \\t]*/ /g'`
368 AC_MSG_RESULT($py_libdir)
370 AC_MSG_WARN([$py_libdir/config/Makefile or $py_prefix/include/python${py_ver}/Python.h missing, support for python disabled])
371 enable_binding_python="no"
374 AC_MSG_WARN([no python found, support for python disabled])
375 enable_binding_python="no"
378 if test "x${enable_binding_python}" = xyes ; then
379 AC_DEFINE(USE_BINDING_PYTHON, 1, [Build with binding python])
380 AC_SUBST(PYTHON_CFLAGS)
381 AC_SUBST(PYTHON_LIBS)
383 AM_CONDITIONAL(USE_BINDING_PYTHON, test "x${enable_binding_python}" = "xyes")
386 AC_ARG_ENABLE(binding-dbus, [ --disable-binding-dbus don't create binding dbus], enable_binding_dbus=$enableval, enable_binding_dbus=yes)
387 if test "x${enable_binding_dbus}" = "xyes" ; then
388 PKG_CHECK_MODULES(DBUS, [dbus-glib-1], ,enable_binding_dbus=no);
390 if test "x${enable_binding_dbus}" = "xyes" ; then
391 AC_DEFINE(USE_BINDING_DBUS, 1, [Build with binding dbus])
392 AC_SUBST(DBUS_CFLAGS)
395 AM_CONDITIONAL(USE_BINDING_DBUS, test "x${enable_binding_dbus}" = "xyes")
400 [ --disable-nls disable Native Language Support ( gettext/libintl )],
401 enable_nls=$enableval, enable_nls=yes)
409 if test x$enable_nls = xyes; then
411 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
412 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
415 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
416 AC_CHECK_PROG(MSGMERGE, msgmerge, msgmerge)
417 AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt)
419 if test "$XGETTEXT" != ""; then
420 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
421 echo "xgettext isn't GNU version"
426 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
428 if test "$LINGUAS" = ""; then
429 ling=` (cd $srcdir/po; /bin/ls *.po) `
431 lcode=`basename $l .po`
432 LINGUAS="$LINGUAS$lcode "
435 AC_DEFINE(ENABLE_NLS, [1], [NLS Please])
436 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
440 echo "xgettext and libintl.a don't both exist; will not build i18n support"
442 for lang in $LINGUAS; do
443 MOFILES="$MOFILES $lang.mo"
445 for lang in $LINGUAS; do
446 POFILES="$POFILES $lang.po"
454 AM_GNU_GETTEXT_VERSION
457 LIBS="$LIBS -lm -rdynamic"
460 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
461 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
468 navit/binding/Makefile
469 navit/binding/python/Makefile
470 navit/binding/dbus/Makefile
472 navit/data/mg/Makefile
473 navit/data/textfile/Makefile
474 navit/data/binfile/Makefile
475 navit/data/garmin/Makefile
476 navit/data/poi_geodownload/Makefile
477 navit/data/poi_geodownload/libmdb/Makefile
478 navit/data/poi_geodownload/libmdb/include/Makefile
479 navit/fib-1.1/Makefile
480 navit/graphics/Makefile
481 navit/graphics/gtk_drawing_area/Makefile
482 navit/graphics/opengl/Makefile
483 navit/graphics/null/Makefile
484 navit/graphics/qt_qpainter/Makefile
486 navit/gui/gtk/Makefile
487 navit/gui/internal/Makefile
488 navit/gui/sdl/Makefile
489 navit/gui/sdl/datafiles/Makefile
491 navit/osd/core/Makefile
492 navit/speech/Makefile
493 navit/speech/cmdline/Makefile
494 navit/speech/speech_dispatcher/Makefile
495 navit/vehicle/Makefile
496 navit/vehicle/file/Makefile
497 navit/vehicle/gpsd/Makefile
498 navit/vehicle/demo/Makefile
504 #src/data/garmin_img/Makefile
511 echo "Summary of your installation :"
512 if test x"$gtk2_pkgconfig" = xyes
514 echo "GTK gui : ENABLED"
516 echo "GTK gui : DISABLED : you are missing a dependency. To fix this install a package named gtk2-devel or libgtk2.0-dev"
518 # FIXME : maybe elaborate missing dependencies
519 if test x"$sdl" != xyes
521 sdl_failures="(libsdl maybe?) "
523 if test x"$xmu" != xyes
525 sdl_failures=$sdl_failures"libxmu "
527 if test x"$glut" != xyes
529 sdl_failures=$sdl_failures"glut "
531 if test x"$glc" != xyes
533 sdl_failures=$sdl_failures"quesoglc "
535 if test x"$cegui" != xyes
537 sdl_failures=$sdl_failures"cegui-devel >= 0.5 "
539 if test -z "$sdl_failures"
541 echo "OpenGL gui : ENABLED, with $CEGUI_LIBS"
543 echo "OpenGL gui : DISABLED : you are missing $sdl_failures"
545 if test x"$enable_hildon" = xyes
547 echo "Maemo/Hildon: ENABLED"
549 echo "Maemo/Hildon: DISABLED"
552 if test x"$gpsd" = xyes
554 echo "GPSD support: ENABLED"
556 echo "GPSD support: DISABLED"
558 if test x"$speechd" = xyes
560 echo "SPEECHD : ENABLED"
562 echo "SPEECHD : DISABLED"
564 if test x"${USE_GARMIN}" = xyes
566 if test "x$use_libgarmin" = "xyes"
568 echo "Garmin IMG : ENABLED"
570 echo "Garmin IMG : DISABLED (you don't have libgarmin)"
573 echo "Garmin IMG : DISABLED (you requested it)"
575 if test "x$samplemap" = "xyes"
577 echo "Samplemap : ENABLED"
579 echo "Samplemap : DISABLED"
581 if [ test x"$gtk2_pkgconfig" != xyes ] && [ test x"$sdl" != xyes ]
585 echo "*** WARNING! you have no gui that can be built! ***"
586 echo "Please install the dependency for at least gtk or sdl gui"
587 echo "For more details, see the wiki at http://wiki.navit-project.org/"