3 AM_CONFIG_HEADER(config.h)
7 AC_USE_SYSTEM_EXTENSIONS
10 if eval "test x$GCC = xyes"; then
11 CFLAGS="$CFLAGS -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE"
14 if eval "test x$GXX = xyes"; then
15 CXXFLAGS="$CXXFLAGS -Wall -Wcast-align -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE"
23 AC_ARG_ENABLE(avoid-unaligned, [ --enable-avoid-unaligned avoid unaligned accesses], AVOID_UNALIGNED=$enableval, AVOID_UNALIGNED=no)
24 test x"${AVOID_UNALIGNED}" = xyes && AC_DEFINE(AVOID_UNALIGNED,[],Define to avoid unaligned access)
26 AC_ARG_ENABLE(avoid-float, [ --enable-avoid-float avoid floating point calculations], AVOID_FLOAT=$enableval, AVOID_FLOAT=no)
27 test x"${AVOID_FLOAT}" = xyes && AC_DEFINE(AVOID_FLOAT,[],Define to avoid floating point)
29 AC_ARG_ENABLE(libgps, [ --disable-libgps don't use libgps], USE_LIBGPS=$enableval, USE_LIBGPS=yes)
31 AC_ARG_ENABLE(samplemap, [ --disable-samplemap don't build the samplemap], samplemap=$enableval, samplemap=yes)
32 AM_CONDITIONAL(BUILD_SAMPLEMAP, [test "x$samplemap" = "xyes"])
34 AC_ARG_ENABLE(fastmath, [ --disable-fastmath don't build with fastmath], fastmath=$enableval, fastmath=yes)
35 AM_CONDITIONAL(FASTMATH, [test "x$fastmath" = "xyes"])
37 if test x"$fastmath" = xyes; then
38 if eval "test x$GCC = xyes"; then
39 CFLAGS="$CFLAGS -ffast-math"
43 X_CFLAGS="-I$x_includes"
44 X_LIBS="-L$ac_x_libraries"
46 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]))
47 AC_SUBST(NAVIT_CFLAGS)
55 Define to 1 if you have the <zlib.h> header file.
58 AC_MSG_WARN([*** no zlib.h\ -- reduced functionality of osm2navit])
62 AC_ARG_ENABLE(gui-gtk, [ --disable-gui-gtk don't create gui gtk ], MODULE_GUI_GTK=$enableval, MODULE_GUI_GTK=yes)
63 if test "x$MODULE_GUI_GTK" = "xyes"; then
64 PKG_CHECK_MODULES(GTK2, [gtk+-2.0], [gtk2_pkgconfig=yes], [gtk2_pkgconfig=no])
65 if test "x$gtk2_pkgconfig" = "xyes"; then
66 AC_DEFINE(HAVE_GTK2, 1, [Define to 1 if you have imlib2])
70 GTK2_CFLAGS="$GTK2_CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
74 AM_CONDITIONAL(GUI_GTK, [test "x$gtk2_pkgconfig" = "xyes"])
75 AM_CONDITIONAL(GRAPHICS_GTK_DRAWING_AREA, [test "x$gtk2_pkgconfig" = "xyes"])
77 PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_pkgconfig=yes], [freetype2_pkgconfig=no])
78 if test "x$freetype2_pkgconfig" = "xyes"; then
79 AC_DEFINE(HAVE_FREETYPE2, 1, [Define to 1 if you have imlib2])
81 AC_SUBST(FREETYPE2_CFLAGS)
82 AC_SUBST(FREETYPE2_LIBS)
84 PKG_CHECK_MODULES(IMLIB2, [imlib2], [imlib2_pkgconfig=yes], [imlib2_pkgconfig=no])
85 if test "x$imlib2_pkgconfig" = "xyes"; then
86 AC_DEFINE(HAVE_IMLIB2, 1, [Define to 1 if you have imlib2])
88 AC_SUBST(IMLIB2_CFLAGS)
92 AC_ARG_ENABLE(speech-speechd, [ --disable-speech-speechd don't create speech speechd ], MODULE_SPEECH_SPEECHD=$enableval, MODULE_SPEECH_SPEECHD=yes)
93 if test "x$MODULE_SPEECH_SPEECHD" = "xyes"; then
94 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]))
96 AC_SUBST(SPEECHD_CFLAGS)
97 AC_SUBST(SPEECHD_LIBS)
98 AM_CONDITIONAL(SPEECH_SPEECH_DISPATCHER, [test "x$speechd" = "xyes"])
101 AC_ARG_ENABLE(gui-sdl, [ --disable-gui-sdl don't create gui sdl ], MODULE_GUI_SDL=$enableval, MODULE_GUI_SDL=yes)
102 if test "x$MODULE_GUI_SDL" = "xyes"; then
108 Define to 1 if you have the <SDL/SDL.h> header file.
112 AC_MSG_WARN([*** no SDL/SDL.h -- SDL support disabled])
120 [CEGUI-OPENGL >= 0.5.0],
125 [Define to 1 if you have the @<:@CEGUI/CEGUI.h@:>@ header file.])
128 [AC_MSG_WARN([*** CEGUI not found -- SDL support disabled])]
136 Define to 1 if you have the <GL/gl.h> header file.
138 OPENGL_LIBS="$X_LIBS -lGL -lGLU"
140 AC_MSG_WARN([*** no GL/gl.h -- opengl and SDL support disabled])
148 Define to 1 if you have the <GL/glut.h> header file.
151 AC_MSG_WARN([*** no GL/glut.h -- opengl and SDL support disabled])
154 AC_SUBST(OPENGL_CFLAGS)
155 AC_SUBST(OPENGL_LIBS)
162 Define to 1 if you have the <GL/glc.h> header file.
166 AC_MSG_WARN([*** no GL/glc.h -- opengl and SDL support disabled])
171 if test x"$cegui" = xyes
173 # Save the LIBS into a temp var since AC_CHECK_LIB adds the lib into LIBS
174 # and we want just to check and use CEGUI_LIBS
176 # For CEGUI, we have to check the presence of some libraries.
177 # The following are mandatory (used by navit)
178 # If the user installed NavIt without, issue a warning and disable CEGUI
179 AC_CHECK_LIB(CEGUIBase, main,
182 echo "Error! Something is wrong with CEGUIBase. Do you have at least cegui-0.5?"
185 AC_CHECK_LIB(CEGUIOpenGLRenderer, main,
188 echo "Error! Something is wrong with CEGUIOpenGLRenderer. Do you have at least cegui-0.5? "
191 AC_CHECK_LIB(CEGUIFalagardWRBase, main,
194 echo "Error! Something is wrong with CEGUIFalagardWRBase. Do you have at least cegui-0.5?"
197 CEGUI_LIBS="-lCEGUIBase -lCEGUIOpenGLRenderer -lCEGUIFalagardWRBase"
199 # The following are optionnal, but we need to link against them if cegui was built with them
200 libssilly="$OPENGL_LIBS -lpng"
201 AC_CHECK_LIB(CEGUISILLYImageCodec, createImageCodec,
202 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUISILLYImageCodec"],
203 [echo "CEGUISILLYImageCodec not found/not working, disabled."],
207 AC_CHECK_LIB(CEGUIXercesParser, main,
208 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIXercesParser"],
209 [echo "CEGUIXercesParser not found/not working, disabled."],
213 AC_CHECK_LIB(CEGUIExpatParser, main,
214 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIExpatParser"],
215 [echo "CEGUIExpatParser not found/not working, disabled."],
219 AC_CHECK_LIB(CEGUILibxmlParser, main,
220 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUILibxmlParser"],
221 [echo "CEGUILibxmlParser not found/not working, disabled."],
225 AC_CHECK_LIB(CEGUITinyXMLParser, main,
226 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUITinyXMLParser"],
227 [echo "CEGUITinyXMLParser not found/not working, disabled."],
231 AC_CHECK_LIB(CEGUIDevILImageCodec, main,
232 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIDevILImageCodec"],
233 [echo "CEGUIDevILImageCodec not found/not working, disabled."],
237 AC_CHECK_LIB(CEGUITGAImageCodec, createImageCodec,
238 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUITGAImageCodec"],
239 [echo "GUITGAImageCodec not found/not working, disabled."],
244 echo "LIBS : $CEGUI_LIBS"
247 AC_SUBST(CEGUI_CFLAGS)
250 AM_CONDITIONAL(GUI_SDL, [test "x$sdl" = "xyes" -a "x$cegui" = "xyes" -a "x$opengl" = "xyes" -a "x$glc" = "xyes" ])
251 AM_CONDITIONAL(GRAPHICS_OPENGL, [test "x$opengl" = "xyes" -a "x$glc" = "xyes" ])
254 if test x"${USE_LIBGPS}" = xyes
256 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]))
258 AC_SUBST(GPSD_CFLAGS)
260 AM_CONDITIONAL(VEHICLE_GPSD, [test "x$gpsd" = "xyes"])
262 # check for libgarmin
263 PKG_CHECK_MODULES(LIBGARMIN, libgarmin, use_libgarmin=yes, use_libgarmin=no)
264 AC_SUBST(LIBGARMIN_CFLAGS)
265 AC_SUBST(LIBGARMIN_LIBS)
266 AM_CONDITIONAL(HAVELIBGARMIN, [test "x$use_libgarmin" = "xyes"])
268 AC_ARG_ENABLE(binding-python, [ --disable-binding-python don't create binding python ], MODULE_BINDING_PYTHON=$enableval, MODULE_BINDING_PYTHON=yes)
269 if test "$cross_compiling" = no; then
270 if test "x$MODULE_BINDING_PYTHON" = "xyes"; then
271 AC_PATH_PROG(_PATH_PYTHON,[python])
272 dnl Libraries and flags for embedded Python.
273 dnl FIXME: I wish there was a less icky way to get this.
274 if test x"$_PATH_PYTHON" != x ; then
275 AC_MSG_CHECKING(for Python linkage)
276 py_prefix=`$_PATH_PYTHON -c 'import sys; print sys.prefix'`
277 py_ver=`$_PATH_PYTHON -c 'import sys; print sys.version[[:3]]'`
278 py_libdir="${py_prefix}/lib/python${py_ver}"
279 PYTHON_CFLAGS="-I${py_prefix}/include/python${py_ver}"
280 if test -f $py_libdir/config/Makefile -a -f $py_prefix/include/python${py_ver}/Python.h; then
281 py_libs=`grep '^LIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
282 py_libc=`grep '^LIBC=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
283 py_libm=`grep '^LIBM=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
284 py_liblocalmod=`grep '^LOCALMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
285 py_libbasemod=`grep '^BASEMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
286 PYTHON_LIBS="-L$py_libdir/config $py_libs $py_libc $py_libm -lpython$py_ver $py_liblocalmod $py_libbasemod"
287 PYTHON_LIBS=`echo $PYTHON_LIBS | sed -e 's/[ \\t]*/ /g'`
288 AC_DEFINE(HAVE_PYTHON, 1, [Define to 1 if you have python])
290 AC_MSG_RESULT($py_libdir)
292 AC_MSG_WARN([$py_libdir/config/Makefile or $py_prefix/include/python${py_ver}/Python.h missing, support for python disabled])
297 AC_MSG_WARN([*** cross compiling, support for python disabled])
299 AC_SUBST(PYTHON_CFLAGS)
300 AC_SUBST(PYTHON_LIBS)
301 AM_CONDITIONAL(BINDING_PYTHON, [test "x$python" = "xyes"])
306 [ --disable-nls disable Native Language Support ( gettext/libintl )],
307 enable_nls=$enableval, enable_nls=yes)
315 if test x$enable_nls = xyes; then
317 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
318 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
321 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
322 AC_CHECK_PROG(MSGMERGE, msgmerge, msgmerge)
323 AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt)
325 if test "$XGETTEXT" != ""; then
326 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
327 echo "xgettext isn't GNU version"
332 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
334 if test "$LINGUAS" = ""; then
335 ling=` (cd $srcdir/po; /bin/ls *.po) `
337 lcode=`basename $l .po`
338 LINGUAS="$LINGUAS$lcode "
341 AC_DEFINE(ENABLE_NLS, [1], [NLS Please])
342 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
346 echo "xgettext and libintl.a don't both exist; will not build i18n support"
348 for lang in $LINGUAS; do
349 MOFILES="$MOFILES $lang.mo"
351 for lang in $LINGUAS; do
352 POFILES="$POFILES $lang.po"
360 AM_GNU_GETTEXT_VERSION
363 LIBS="$LIBS -lm -rdynamic"
366 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
367 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
375 src/binding/python/Makefile
378 src/data/textfile/Makefile
379 src/data/binfile/Makefile
380 src/data/garmin/Makefile
381 src/data/poi_geodownload/Makefile
382 src/data/poi_geodownload/libmdb/Makefile
383 src/data/poi_geodownload/libmdb/include/Makefile
385 src/graphics/Makefile
386 src/graphics/gtk_drawing_area/Makefile
387 src/graphics/opengl/Makefile
388 src/graphics/null/Makefile
392 src/gui/sdl/datafiles/Makefile
394 src/osd/core/Makefile
396 src/speech/cmdline/Makefile
397 src/speech/speech_dispatcher/Makefile
399 src/vehicle/file/Makefile
400 src/vehicle/gpsd/Makefile
401 src/vehicle/demo/Makefile
407 #src/data/garmin_img/Makefile
414 echo "Summary of your installation :"
415 if test x"$gtk2_pkgconfig" = xyes
417 echo "GTK gui : ENABLED"
419 echo "GTK gui : DISABLED : you are missing a dependency. To fix this install a package named gtk2-devel or libgtk2.0-dev"
421 # FIXME : maybe elaborate missing dependencies
422 if test x"$sdl" = xyes
424 if test x"$cegui" = xyes
426 if test x"$glut" = xyes
428 if test x"$glc" = xyes
430 echo "SDL gui : ENABLED, with $CEGUI_LIBS"
432 echo "SDL gui : DISABLED, you are missing quesoglc"
435 echo "SDL gui : DISABLED, your are missing glut"
438 echo "SDL gui : DISABLED : you are missing cegui-devel >= 0.5"
441 echo "SDL gui : DISABLED : you are missing a SDL dependency"
443 if test x"$gpsd" = xyes
445 echo "GPSD support: ENABLED"
447 echo "GPSD support: DISABLED"
449 if test x"$speechd" = xyes
451 echo "SPEECHD : ENABLED"
453 echo "SPEECHD : DISABLED"
455 if test "x$use_libgarmin" = "xyes"
457 echo "Garmin IMG : ENABLED"
459 echo "Garmin IMG : DISABLED (you don't have libgarmin)"
461 if test "x$samplemap" = "xyes"
463 echo "Samplemap : ENABLED"
465 echo "Samplemap : DISABLED"
467 if [ test x"$gtk2_pkgconfig" != xyes ] && [ test x"$sdl" != xyes ]
471 echo "*** WARNING! you have no gui that can be built! ***"
472 echo "Please install the dependency for at least gtk or sdl gui"
473 echo "For more details, see the wiki at http://navit.sf.net/wiki/"