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(libgps, [ --disable-libgps don't use libgps], USE_LIBGPS=$enableval, USE_LIBGPS=yes)
49 AC_ARG_ENABLE(garmin, [ --disable-garmin disable garmin support], USE_GARMIN=$enableval, USE_GARMIN=yes)
51 AC_ARG_ENABLE(samplemap, [ --disable-samplemap don't build the samplemap], samplemap=$enableval, samplemap=yes)
52 AM_CONDITIONAL(BUILD_SAMPLEMAP, [test "x$samplemap" = "xyes"])
54 AC_ARG_ENABLE(fastmath, [ --disable-fastmath don't build with fastmath], fastmath=$enableval, fastmath=yes)
55 AM_CONDITIONAL(FASTMATH, [test "x$fastmath" = "xyes"])
57 if test x"$fastmath" = xyes; then
58 if eval "test x$GCC = xyes"; then
59 CFLAGS="$CFLAGS -ffast-math"
63 X_CFLAGS="-I$x_includes"
64 X_LIBS="-L$ac_x_libraries"
66 PKG_CHECK_MODULES(NAVIT, [glib-2.0 gmodule-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]))
67 AC_SUBST(NAVIT_CFLAGS)
75 Define to 1 if you have the <zlib.h> header file.
78 AC_MSG_WARN([*** no zlib.h\ -- reduced functionality of osm2navit])
82 AC_ARG_ENABLE(gui-gtk, [ --disable-gui-gtk don't create gui gtk ], MODULE_GUI_GTK=$enableval, MODULE_GUI_GTK=yes)
83 if test "x$MODULE_GUI_GTK" = "xyes"; then
84 PKG_CHECK_MODULES(GTK2, [gtk+-2.0], [gtk2_pkgconfig=yes], [gtk2_pkgconfig=no])
85 if test "x$gtk2_pkgconfig" = "xyes"; then
86 AC_DEFINE(HAVE_GTK2, 1, [Define to 1 if you have imlib2])
90 GTK2_CFLAGS="$GTK2_CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
94 AM_CONDITIONAL(GUI_GTK, [test "x$gtk2_pkgconfig" = "xyes"])
95 AM_CONDITIONAL(GRAPHICS_GTK_DRAWING_AREA, [test "x$gtk2_pkgconfig" = "xyes"])
96 AM_CONDITIONAL(PLUGINS, [test "x$plugins" = "xyes"])
98 PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_pkgconfig=yes], [freetype2_pkgconfig=no])
99 if test "x$freetype2_pkgconfig" = "xyes"; then
100 AC_DEFINE(HAVE_FREETYPE2, 1, [Define to 1 if you have imlib2])
102 AC_SUBST(FREETYPE2_CFLAGS)
103 AC_SUBST(FREETYPE2_LIBS)
105 PKG_CHECK_MODULES(IMLIB2, [imlib2], [imlib2_pkgconfig=yes], [imlib2_pkgconfig=no])
106 if test "x$imlib2_pkgconfig" = "xyes"; then
107 AC_DEFINE(HAVE_IMLIB2, 1, [Define to 1 if you have imlib2])
109 AC_SUBST(IMLIB2_CFLAGS)
110 AC_SUBST(IMLIB2_LIBS)
113 AC_ARG_ENABLE(speech-speechd, [ --disable-speech-speechd don't create speech speechd ], MODULE_SPEECH_SPEECHD=$enableval, MODULE_SPEECH_SPEECHD=yes)
114 if test "x$MODULE_SPEECH_SPEECHD" = "xyes"; then
115 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]))
117 AC_SUBST(SPEECHD_CFLAGS)
118 AC_SUBST(SPEECHD_LIBS)
119 AM_CONDITIONAL(SPEECH_SPEECH_DISPATCHER, [test "x$speechd" = "xyes"])
122 AC_ARG_ENABLE(gui-sdl, [ --disable-gui-sdl don't create gui sdl ], MODULE_GUI_SDL=$enableval, MODULE_GUI_SDL=yes)
123 if test "x$MODULE_GUI_SDL" = "xyes"; then
129 Define to 1 if you have the <SDL/SDL.h> header file.
133 AC_MSG_WARN([*** no SDL/SDL.h -- SDL support disabled])
141 [CEGUI-OPENGL >= 0.5.0],
146 [Define to 1 if you have the @<:@CEGUI/CEGUI.h@:>@ header file.])
149 [AC_MSG_WARN([*** CEGUI not found -- SDL support disabled])]
157 Define to 1 if you have the <GL/gl.h> header file.
159 OPENGL_LIBS="$X_LIBS -lGL -lGLU"
161 AC_MSG_WARN([*** no GL/gl.h -- opengl and SDL support disabled])
169 Define to 1 if you have the <GL/glut.h> header file.
172 AC_MSG_WARN([*** no GL/glut.h -- opengl and SDL support disabled])
175 AC_SUBST(OPENGL_CFLAGS)
176 AC_SUBST(OPENGL_LIBS)
183 Define to 1 if you have the <GL/glc.h> header file.
187 AC_MSG_WARN([*** no GL/glc.h -- opengl and SDL support disabled])
192 if test x"$cegui" = xyes
194 # Save the LIBS into a temp var since AC_CHECK_LIB adds the lib into LIBS
195 # and we want just to check and use CEGUI_LIBS
197 # For CEGUI, we have to check the presence of some libraries.
198 # The following are mandatory (used by navit)
199 # If the user installed NavIt without, issue a warning and disable CEGUI
200 AC_CHECK_LIB(CEGUIBase, main,
203 echo "Error! Something is wrong with CEGUIBase. Do you have at least cegui-0.5?"
206 AC_CHECK_LIB(CEGUIOpenGLRenderer, main,
209 echo "Error! Something is wrong with CEGUIOpenGLRenderer. Do you have at least cegui-0.5? "
212 AC_CHECK_LIB(CEGUIFalagardWRBase, main,
215 echo "Error! Something is wrong with CEGUIFalagardWRBase. Do you have at least cegui-0.5?"
218 CEGUI_LIBS="-lCEGUIBase -lCEGUIOpenGLRenderer -lCEGUIFalagardWRBase"
220 # The following are optionnal, but we need to link against them if cegui was built with them
221 libssilly="$OPENGL_LIBS -lpng"
222 AC_CHECK_LIB(CEGUISILLYImageCodec, createImageCodec,
223 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUISILLYImageCodec"],
224 [echo "CEGUISILLYImageCodec not found/not working, disabled."],
228 AC_CHECK_LIB(CEGUIXercesParser, main,
229 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIXercesParser"],
230 [echo "CEGUIXercesParser not found/not working, disabled."],
234 AC_CHECK_LIB(CEGUIExpatParser, main,
235 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIExpatParser"],
236 [echo "CEGUIExpatParser not found/not working, disabled."],
240 AC_CHECK_LIB(CEGUILibxmlParser, main,
241 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUILibxmlParser"],
242 [echo "CEGUILibxmlParser not found/not working, disabled."],
246 AC_CHECK_LIB(CEGUITinyXMLParser, main,
247 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUITinyXMLParser"],
248 [echo "CEGUITinyXMLParser not found/not working, disabled."],
252 AC_CHECK_LIB(CEGUIDevILImageCodec, main,
253 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIDevILImageCodec"],
254 [echo "CEGUIDevILImageCodec not found/not working, disabled."],
258 AC_CHECK_LIB(CEGUITGAImageCodec, createImageCodec,
259 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUITGAImageCodec"],
260 [echo "GUITGAImageCodec not found/not working, disabled."],
265 echo "LIBS : $CEGUI_LIBS"
268 AC_SUBST(CEGUI_CFLAGS)
271 AM_CONDITIONAL(GUI_SDL, [test "x$sdl" = "xyes" -a "x$cegui" = "xyes" -a "x$opengl" = "xyes" -a "x$glc" = "xyes" ])
272 AM_CONDITIONAL(GRAPHICS_OPENGL, [test "x$opengl" = "xyes" -a "x$glc" = "xyes" ])
275 if test x"${USE_LIBGPS}" = xyes
277 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]))
279 AC_SUBST(GPSD_CFLAGS)
281 AM_CONDITIONAL(VEHICLE_GPSD, [test "x$gpsd" = "xyes"])
283 if test x"${USE_GARMIN}" = xyes
285 # check for libgarmin
286 PKG_CHECK_MODULES(LIBGARMIN, libgarmin, use_libgarmin=yes, use_libgarmin=no)
287 AC_SUBST(LIBGARMIN_CFLAGS)
288 AC_SUBST(LIBGARMIN_LIBS)
290 AM_CONDITIONAL(HAVELIBGARMIN, [test "x$use_libgarmin" = "xyes"])
293 AC_ARG_ENABLE(binding-python, [ --disable-binding-python don't create binding python ], MODULE_BINDING_PYTHON=$enableval, MODULE_BINDING_PYTHON=yes)
294 if test "$cross_compiling" = no; then
295 if test "x$MODULE_BINDING_PYTHON" = "xyes"; then
296 AC_PATH_PROG(_PATH_PYTHON,[python])
297 dnl Libraries and flags for embedded Python.
298 dnl FIXME: I wish there was a less icky way to get this.
299 if test x"$_PATH_PYTHON" != x ; then
300 AC_MSG_CHECKING(for Python linkage)
301 py_prefix=`$_PATH_PYTHON -c 'import sys; print sys.prefix'`
302 py_ver=`$_PATH_PYTHON -c 'import sys; print sys.version[[:3]]'`
303 py_libdir="${py_prefix}/lib/python${py_ver}"
304 PYTHON_CFLAGS="-I${py_prefix}/include/python${py_ver}"
305 if test -f $py_libdir/config/Makefile -a -f $py_prefix/include/python${py_ver}/Python.h; then
306 py_libs=`grep '^LIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
307 py_libc=`grep '^LIBC=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
308 py_libm=`grep '^LIBM=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
309 py_liblocalmod=`grep '^LOCALMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
310 py_libbasemod=`grep '^BASEMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
311 PYTHON_LIBS="-L$py_libdir/config $py_libs $py_libc $py_libm -lpython$py_ver $py_liblocalmod $py_libbasemod"
312 PYTHON_LIBS=`echo $PYTHON_LIBS | sed -e 's/[ \\t]*/ /g'`
313 AC_DEFINE(HAVE_PYTHON, 1, [Define to 1 if you have python])
315 AC_MSG_RESULT($py_libdir)
317 AC_MSG_WARN([$py_libdir/config/Makefile or $py_prefix/include/python${py_ver}/Python.h missing, support for python disabled])
322 AC_MSG_WARN([*** cross compiling, support for python disabled])
324 AC_SUBST(PYTHON_CFLAGS)
325 AC_SUBST(PYTHON_LIBS)
326 AM_CONDITIONAL(BINDING_PYTHON, [test "x$python" = "xyes"])
331 [ --disable-nls disable Native Language Support ( gettext/libintl )],
332 enable_nls=$enableval, enable_nls=yes)
340 if test x$enable_nls = xyes; then
342 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
343 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
346 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
347 AC_CHECK_PROG(MSGMERGE, msgmerge, msgmerge)
348 AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt)
350 if test "$XGETTEXT" != ""; then
351 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
352 echo "xgettext isn't GNU version"
357 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
359 if test "$LINGUAS" = ""; then
360 ling=` (cd $srcdir/po; /bin/ls *.po) `
362 lcode=`basename $l .po`
363 LINGUAS="$LINGUAS$lcode "
366 AC_DEFINE(ENABLE_NLS, [1], [NLS Please])
367 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
371 echo "xgettext and libintl.a don't both exist; will not build i18n support"
373 for lang in $LINGUAS; do
374 MOFILES="$MOFILES $lang.mo"
376 for lang in $LINGUAS; do
377 POFILES="$POFILES $lang.po"
385 AM_GNU_GETTEXT_VERSION
388 LIBS="$LIBS -lm -rdynamic"
391 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
392 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
400 src/binding/python/Makefile
403 src/data/textfile/Makefile
404 src/data/binfile/Makefile
405 src/data/garmin/Makefile
406 src/data/poi_geodownload/Makefile
407 src/data/poi_geodownload/libmdb/Makefile
408 src/data/poi_geodownload/libmdb/include/Makefile
410 src/graphics/Makefile
411 src/graphics/gtk_drawing_area/Makefile
412 src/graphics/opengl/Makefile
413 src/graphics/null/Makefile
417 src/gui/sdl/datafiles/Makefile
419 src/osd/core/Makefile
421 src/speech/cmdline/Makefile
422 src/speech/speech_dispatcher/Makefile
424 src/vehicle/file/Makefile
425 src/vehicle/gpsd/Makefile
426 src/vehicle/demo/Makefile
432 #src/data/garmin_img/Makefile
439 echo "Summary of your installation :"
440 if test x"$gtk2_pkgconfig" = xyes
442 echo "GTK gui : ENABLED"
444 echo "GTK gui : DISABLED : you are missing a dependency. To fix this install a package named gtk2-devel or libgtk2.0-dev"
446 # FIXME : maybe elaborate missing dependencies
447 if test x"$sdl" = xyes
449 if test x"$cegui" = xyes
451 if test x"$glut" = xyes
453 if test x"$glc" = xyes
455 echo "SDL gui : ENABLED, with $CEGUI_LIBS"
457 echo "SDL gui : DISABLED, you are missing quesoglc"
460 echo "SDL gui : DISABLED, your are missing glut"
463 echo "SDL gui : DISABLED : you are missing cegui-devel >= 0.5"
466 echo "SDL gui : DISABLED : you are missing a SDL dependency"
468 if test x"$gpsd" = xyes
470 echo "GPSD support: ENABLED"
472 echo "GPSD support: DISABLED"
474 if test x"$speechd" = xyes
476 echo "SPEECHD : ENABLED"
478 echo "SPEECHD : DISABLED"
480 if test x"${USE_GARMIN}" = xyes
482 if test "x$use_libgarmin" = "xyes"
484 echo "Garmin IMG : ENABLED"
486 echo "Garmin IMG : DISABLED (you don't have libgarmin)"
489 echo "Garmin IMG : DISABLED (you requested it)"
491 if test "x$samplemap" = "xyes"
493 echo "Samplemap : ENABLED"
495 echo "Samplemap : DISABLED"
497 if [ test x"$gtk2_pkgconfig" != xyes ] && [ test x"$sdl" != xyes ]
501 echo "*** WARNING! you have no gui that can be built! ***"
502 echo "Please install the dependency for at least gtk or sdl gui"
503 echo "For more details, see the wiki at http://navit.sf.net/wiki/"