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"
26 AC_ARG_ENABLE(avoid-unaligned, [ --enable-avoid-unaligned avoid unaligned accesses], AVOID_UNALIGNED=$enableval, AVOID_UNALIGNED=no)
27 test x"${AVOID_UNALIGNED}" = xyes && AC_DEFINE(AVOID_UNALIGNED,[],Define to avoid unaligned access)
29 AC_ARG_ENABLE(avoid-float, [ --enable-avoid-float avoid floating point calculations], AVOID_FLOAT=$enableval, AVOID_FLOAT=no)
30 test x"${AVOID_FLOAT}" = xyes && AC_DEFINE(AVOID_FLOAT,[],Define to avoid floating point)
32 AC_ARG_ENABLE(libgps, [ --disable-libgps don't use libgps], USE_LIBGPS=$enableval, USE_LIBGPS=yes)
34 AC_ARG_ENABLE(samplemap, [ --disable-samplemap don't build the samplemap], samplemap=$enableval, samplemap=yes)
35 AM_CONDITIONAL(BUILD_SAMPLEMAP, [test "x$samplemap" = "xyes"])
37 AC_ARG_ENABLE(fastmath, [ --disable-fastmath don't build with fastmath], fastmath=$enableval, fastmath=yes)
38 AM_CONDITIONAL(FASTMATH, [test "x$fastmath" = "xyes"])
40 if test x"$fastmath" = xyes; then
41 if eval "test x$GCC = xyes"; then
42 CFLAGS="$CFLAGS -ffast-math"
46 X_CFLAGS="-I$x_includes"
47 X_LIBS="-L$ac_x_libraries"
49 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]))
50 AC_SUBST(NAVIT_CFLAGS)
58 Define to 1 if you have the <zlib.h> header file.
61 AC_MSG_WARN([*** no zlib.h\ -- reduced functionality of osm2navit])
65 AC_ARG_ENABLE(gui-gtk, [ --disable-gui-gtk don't create gui gtk ], MODULE_GUI_GTK=$enableval, MODULE_GUI_GTK=yes)
66 if test "x$MODULE_GUI_GTK" = "xyes"; then
67 PKG_CHECK_MODULES(GTK2, [gtk+-2.0], [gtk2_pkgconfig=yes], [gtk2_pkgconfig=no])
68 if test "x$gtk2_pkgconfig" = "xyes"; then
69 AC_DEFINE(HAVE_GTK2, 1, [Define to 1 if you have imlib2])
73 GTK2_CFLAGS="$GTK2_CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
77 AM_CONDITIONAL(GUI_GTK, [test "x$gtk2_pkgconfig" = "xyes"])
78 AM_CONDITIONAL(GRAPHICS_GTK_DRAWING_AREA, [test "x$gtk2_pkgconfig" = "xyes"])
80 PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_pkgconfig=yes], [freetype2_pkgconfig=no])
81 if test "x$freetype2_pkgconfig" = "xyes"; then
82 AC_DEFINE(HAVE_FREETYPE2, 1, [Define to 1 if you have imlib2])
84 AC_SUBST(FREETYPE2_CFLAGS)
85 AC_SUBST(FREETYPE2_LIBS)
87 PKG_CHECK_MODULES(IMLIB2, [imlib2], [imlib2_pkgconfig=yes], [imlib2_pkgconfig=no])
88 if test "x$imlib2_pkgconfig" = "xyes"; then
89 AC_DEFINE(HAVE_IMLIB2, 1, [Define to 1 if you have imlib2])
91 AC_SUBST(IMLIB2_CFLAGS)
95 AC_ARG_ENABLE(speech-speechd, [ --disable-speech-speechd don't create speech speechd ], MODULE_SPEECH_SPEECHD=$enableval, MODULE_SPEECH_SPEECHD=yes)
96 if test "x$MODULE_SPEECH_SPEECHD" = "xyes"; then
97 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]))
99 AC_SUBST(SPEECHD_CFLAGS)
100 AC_SUBST(SPEECHD_LIBS)
101 AM_CONDITIONAL(SPEECH_SPEECH_DISPATCHER, [test "x$speechd" = "xyes"])
104 AC_ARG_ENABLE(gui-sdl, [ --disable-gui-sdl don't create gui sdl ], MODULE_GUI_SDL=$enableval, MODULE_GUI_SDL=yes)
105 if test "x$MODULE_GUI_SDL" = "xyes"; then
111 Define to 1 if you have the <SDL/SDL.h> header file.
115 AC_MSG_WARN([*** no SDL/SDL.h -- SDL support disabled])
123 [CEGUI-OPENGL >= 0.5.0],
128 [Define to 1 if you have the @<:@CEGUI/CEGUI.h@:>@ header file.])
131 [AC_MSG_WARN([*** CEGUI not found -- SDL support disabled])]
139 Define to 1 if you have the <GL/gl.h> header file.
141 OPENGL_LIBS="$X_LIBS -lGL -lGLU"
143 AC_MSG_WARN([*** no GL/gl.h -- opengl and SDL support disabled])
151 Define to 1 if you have the <GL/glut.h> header file.
154 AC_MSG_WARN([*** no GL/glut.h -- opengl and SDL support disabled])
157 AC_SUBST(OPENGL_CFLAGS)
158 AC_SUBST(OPENGL_LIBS)
165 Define to 1 if you have the <GL/glc.h> header file.
169 AC_MSG_WARN([*** no GL/glc.h -- opengl and SDL support disabled])
174 if test x"$cegui" = xyes
176 # Save the LIBS into a temp var since AC_CHECK_LIB adds the lib into LIBS
177 # and we want just to check and use CEGUI_LIBS
179 # For CEGUI, we have to check the presence of some libraries.
180 # The following are mandatory (used by navit)
181 # If the user installed NavIt without, issue a warning and disable CEGUI
182 AC_CHECK_LIB(CEGUIBase, main,
185 echo "Error! Something is wrong with CEGUIBase. Do you have at least cegui-0.5?"
188 AC_CHECK_LIB(CEGUIOpenGLRenderer, main,
191 echo "Error! Something is wrong with CEGUIOpenGLRenderer. Do you have at least cegui-0.5? "
194 AC_CHECK_LIB(CEGUIFalagardWRBase, main,
197 echo "Error! Something is wrong with CEGUIFalagardWRBase. Do you have at least cegui-0.5?"
200 CEGUI_LIBS="-lCEGUIBase -lCEGUIOpenGLRenderer -lCEGUIFalagardWRBase"
202 # The following are optionnal, but we need to link against them if cegui was built with them
203 libssilly="$OPENGL_LIBS -lpng"
204 AC_CHECK_LIB(CEGUISILLYImageCodec, createImageCodec,
205 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUISILLYImageCodec"],
206 [echo "CEGUISILLYImageCodec not found/not working, disabled."],
210 AC_CHECK_LIB(CEGUIXercesParser, main,
211 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIXercesParser"],
212 [echo "CEGUIXercesParser not found/not working, disabled."],
216 AC_CHECK_LIB(CEGUIExpatParser, main,
217 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIExpatParser"],
218 [echo "CEGUIExpatParser not found/not working, disabled."],
222 AC_CHECK_LIB(CEGUILibxmlParser, main,
223 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUILibxmlParser"],
224 [echo "CEGUILibxmlParser not found/not working, disabled."],
228 AC_CHECK_LIB(CEGUITinyXMLParser, main,
229 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUITinyXMLParser"],
230 [echo "CEGUITinyXMLParser not found/not working, disabled."],
234 AC_CHECK_LIB(CEGUIDevILImageCodec, main,
235 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIDevILImageCodec"],
236 [echo "CEGUIDevILImageCodec not found/not working, disabled."],
240 AC_CHECK_LIB(CEGUITGAImageCodec, createImageCodec,
241 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUITGAImageCodec"],
242 [echo "GUITGAImageCodec not found/not working, disabled."],
247 echo "LIBS : $CEGUI_LIBS"
250 AC_SUBST(CEGUI_CFLAGS)
253 AM_CONDITIONAL(GUI_SDL, [test "x$sdl" = "xyes" -a "x$cegui" = "xyes" -a "x$opengl" = "xyes" -a "x$glc" = "xyes" ])
254 AM_CONDITIONAL(GRAPHICS_OPENGL, [test "x$opengl" = "xyes" -a "x$glc" = "xyes" ])
257 if test x"${USE_LIBGPS}" = xyes
259 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]))
261 AC_SUBST(GPSD_CFLAGS)
263 AM_CONDITIONAL(VEHICLE_GPSD, [test "x$gpsd" = "xyes"])
265 # check for libgarmin
266 PKG_CHECK_MODULES(LIBGARMIN, libgarmin, use_libgarmin=yes, use_libgarmin=no)
267 AC_SUBST(LIBGARMIN_CFLAGS)
268 AC_SUBST(LIBGARMIN_LIBS)
269 AM_CONDITIONAL(HAVELIBGARMIN, [test "x$use_libgarmin" = "xyes"])
271 AC_ARG_ENABLE(binding-python, [ --disable-binding-python don't create binding python ], MODULE_BINDING_PYTHON=$enableval, MODULE_BINDING_PYTHON=yes)
272 if test "$cross_compiling" = no; then
273 if test "x$MODULE_BINDING_PYTHON" = "xyes"; then
274 AC_PATH_PROG(_PATH_PYTHON,[python])
275 dnl Libraries and flags for embedded Python.
276 dnl FIXME: I wish there was a less icky way to get this.
277 if test x"$_PATH_PYTHON" != x ; then
278 AC_MSG_CHECKING(for Python linkage)
279 py_prefix=`$_PATH_PYTHON -c 'import sys; print sys.prefix'`
280 py_ver=`$_PATH_PYTHON -c 'import sys; print sys.version[[:3]]'`
281 py_libdir="${py_prefix}/lib/python${py_ver}"
282 PYTHON_CFLAGS="-I${py_prefix}/include/python${py_ver}"
283 if test -f $py_libdir/config/Makefile -a -f $py_prefix/include/python${py_ver}/Python.h; then
284 py_libs=`grep '^LIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
285 py_libc=`grep '^LIBC=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
286 py_libm=`grep '^LIBM=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
287 py_liblocalmod=`grep '^LOCALMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
288 py_libbasemod=`grep '^BASEMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
289 PYTHON_LIBS="-L$py_libdir/config $py_libs $py_libc $py_libm -lpython$py_ver $py_liblocalmod $py_libbasemod"
290 PYTHON_LIBS=`echo $PYTHON_LIBS | sed -e 's/[ \\t]*/ /g'`
291 AC_DEFINE(HAVE_PYTHON, 1, [Define to 1 if you have python])
293 AC_MSG_RESULT($py_libdir)
295 AC_MSG_WARN([$py_libdir/config/Makefile or $py_prefix/include/python${py_ver}/Python.h missing, support for python disabled])
300 AC_MSG_WARN([*** cross compiling, support for python disabled])
302 AC_SUBST(PYTHON_CFLAGS)
303 AC_SUBST(PYTHON_LIBS)
304 AM_CONDITIONAL(BINDING_PYTHON, [test "x$python" = "xyes"])
309 [ --disable-nls disable Native Language Support ( gettext/libintl )],
310 enable_nls=$enableval, enable_nls=yes)
318 if test x$enable_nls = xyes; then
320 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
321 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
324 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
325 AC_CHECK_PROG(MSGMERGE, msgmerge, msgmerge)
326 AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt)
328 if test "$XGETTEXT" != ""; then
329 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
330 echo "xgettext isn't GNU version"
335 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
337 if test "$LINGUAS" = ""; then
338 ling=` (cd $srcdir/po; /bin/ls *.po) `
340 lcode=`basename $l .po`
341 LINGUAS="$LINGUAS$lcode "
344 AC_DEFINE(ENABLE_NLS, [1], [NLS Please])
345 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
349 echo "xgettext and libintl.a don't both exist; will not build i18n support"
351 for lang in $LINGUAS; do
352 MOFILES="$MOFILES $lang.mo"
354 for lang in $LINGUAS; do
355 POFILES="$POFILES $lang.po"
363 AM_GNU_GETTEXT_VERSION
366 LIBS="$LIBS -lm -rdynamic"
369 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
370 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
378 src/binding/python/Makefile
381 src/data/textfile/Makefile
382 src/data/binfile/Makefile
383 src/data/garmin/Makefile
384 src/data/poi_geodownload/Makefile
385 src/data/poi_geodownload/libmdb/Makefile
386 src/data/poi_geodownload/libmdb/include/Makefile
388 src/graphics/Makefile
389 src/graphics/gtk_drawing_area/Makefile
390 src/graphics/opengl/Makefile
391 src/graphics/null/Makefile
395 src/gui/sdl/datafiles/Makefile
397 src/osd/core/Makefile
399 src/speech/cmdline/Makefile
400 src/speech/speech_dispatcher/Makefile
402 src/vehicle/file/Makefile
403 src/vehicle/gpsd/Makefile
404 src/vehicle/demo/Makefile
410 #src/data/garmin_img/Makefile
417 echo "Summary of your installation :"
418 if test x"$gtk2_pkgconfig" = xyes
420 echo "GTK gui : ENABLED"
422 echo "GTK gui : DISABLED : you are missing a dependency. To fix this install a package named gtk2-devel or libgtk2.0-dev"
424 # FIXME : maybe elaborate missing dependencies
425 if test x"$sdl" = xyes
427 if test x"$cegui" = xyes
429 if test x"$glut" = xyes
431 if test x"$glc" = xyes
433 echo "SDL gui : ENABLED, with $CEGUI_LIBS"
435 echo "SDL gui : DISABLED, you are missing quesoglc"
438 echo "SDL gui : DISABLED, your are missing glut"
441 echo "SDL gui : DISABLED : you are missing cegui-devel >= 0.5"
444 echo "SDL gui : DISABLED : you are missing a SDL dependency"
446 if test x"$gpsd" = xyes
448 echo "GPSD support: ENABLED"
450 echo "GPSD support: DISABLED"
452 if test x"$speechd" = xyes
454 echo "SPEECHD : ENABLED"
456 echo "SPEECHD : DISABLED"
458 if test "x$use_libgarmin" = "xyes"
460 echo "Garmin IMG : ENABLED"
462 echo "Garmin IMG : DISABLED (you don't have libgarmin)"
464 if test "x$samplemap" = "xyes"
466 echo "Samplemap : ENABLED"
468 echo "Samplemap : DISABLED"
470 if [ test x"$gtk2_pkgconfig" != xyes ] && [ test x"$sdl" != xyes ]
474 echo "*** WARNING! you have no gui that can be built! ***"
475 echo "Please install the dependency for at least gtk or sdl gui"
476 echo "For more details, see the wiki at http://navit.sf.net/wiki/"