Update:Gui:Removing deprecated gui
[navit-package] / configure.in
index 8894e2c..647da0a 100644 (file)
@@ -1,4 +1,4 @@
-AC_INIT(navit, 0.1.0)
+AC_INIT(navit, 0.1.1)
 SOURCE_MODE=svn
 
 AM_INIT_AUTOMAKE
@@ -37,6 +37,7 @@ postgresql=yes; postgresql_reason=default
 samplemap=yes; samplemap_reason=default
 binding_dbus=yes; binding_dbus_reason=default
 binding_python=yes; binding_python_reason=default
+font_freetype=yes; font_freetype_reason=default
 gui_gtk=no; gui_gtk_reason=default
 gui_win32=no; gui_win32_reason=default
 gui_internal=yes; gui_internal_reason=default
@@ -66,7 +67,7 @@ AM_PROG_CC_C_O
 
 AC_PROG_CXX
 if eval "test x$GXX = xyes"; then
-        CXXFLAGS="$CXXFLAGS -Wall -Wcast-align -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE"
+        CXXFLAGS="$CXXFLAGS -Wall -Wcast-align -Wpointer-arith -Wreturn-type -D_GNU_SOURCE"
 fi
 
 PKG_CHECK_EXISTS
@@ -84,18 +85,28 @@ AC_SUBST(cross_compiling)
 AC_SUBST(CC_FOR_BUILD)
 AC_SUBST(CCLD_FOR_BUILD)
 
+AC_ARG_ENABLE(variant, [  --enable-variant=something          set variant], NAVIT_VARIANT=$enableval)
+AC_SUBST(NAVIT_VARIANT)
+
 AC_ARG_ENABLE(avoid-unaligned, [  --enable-avoid-unaligned          avoid unaligned accesses], AVOID_UNALIGNED=$enableval, AVOID_UNALIGNED=no)
 test x"${AVOID_UNALIGNED}" = xyes && AC_DEFINE(AVOID_UNALIGNED,[],Define to avoid unaligned access)
 
 AC_ARG_ENABLE(avoid-float, [  --enable-avoid-float              avoid floating point calculations], AVOID_FLOAT=$enableval, AVOID_FLOAT=no)
 test x"${AVOID_FLOAT}" = xyes && AC_DEFINE(AVOID_FLOAT,[],Define to avoid floating point)
 
-AC_ARG_ENABLE(hildon, [  --enable-hildon              build with maemo/hildon support], enable_hildon=$enableval, enable_hildon=no)
+AC_ARG_ENABLE(hildon, [  --disable-hildon              build without maemo/hildon support], enable_hildon=$enableval, enable_hildon=yes)
 if test "x${enable_hildon}" = "xyes" ; then
-       PKG_CHECK_MODULES(enable_hildon, hildon-libs >= 0.12.24, , [
+       PKG_CHECK_MODULES(HILDON, hildon-1 >= 0.9.9, , [
                AC_MSG_RESULT(no)
                enable_hildon=no
        ])
+       PKG_CHECK_MODULES(GPSBT, gpsbt, [
+               AC_DEFINE(HAVE_GPSBT, 1, [Have the gpsbt library])
+               AC_SUBST(GPSBT_CFLAGS)
+               AC_SUBST(GPSBT_LIBS)
+               ], [
+               AC_MSG_RESULT(no)
+       ])
        if test x"${enable_hildon}" = xyes ; then
                AC_DEFINE(USE_HILDON, 1, [Build with maemo/hildon support])
                AC_SUBST(HILDON_CFLAGS)
@@ -126,7 +137,11 @@ fi
 X_CFLAGS="-I$x_includes"
 AS_IF([test -n "$ac_x_libraries"], [X_LIBS="-L$ac_x_libraries"])
 
-PKG_CHECK_MODULES(GLIB, [glib-2.0 gthread-2.0], [glib=yes],[glib=no])
+# glib
+AC_ARG_ENABLE(glib, [  --disable-glib             don't build with external glib], glib=$enableval, glib=yes)
+if test x"${glib}" = "xyes"; then
+       PKG_CHECK_MODULES(GLIB, [glib-2.0 gthread-2.0], [glib=yes],[glib=no])
+fi
 if test "x${glib}" = "xyes"; then
        AC_DEFINE(HAVE_GLIB, 1, [Define to 1 if you have (external) glib library])
 else
@@ -135,7 +150,10 @@ else
 fi
 
 # gmodule
-PKG_CHECK_MODULES(GMODULE, [gmodule-2.0], [gmodule=yes], [gmodule=no])
+AC_ARG_ENABLE(gmodule, [  --disable-gmodule             don't build with gmodule], gmodule=$enableval, gmodule=yes)
+if test x"${gmodule}" = "xyes"; then
+       PKG_CHECK_MODULES(GMODULE, [gmodule-2.0], [gmodule=yes], [gmodule=no])
+fi
 if test "x${gmodule}" = "xyes"; then
        AC_DEFINE(HAVE_GMODULE, 1, [Define to 1 if you have gmodule])
 else
@@ -164,7 +182,7 @@ AC_PROG_LIBTOOL
 AM_CONDITIONAL(EVENT_GLIB, [test "x$glib" = "xyes"])
 AM_CONDITIONAL(SUPPORT_GLIB, [test "x$glib" = "xno"])
 AM_CONDITIONAL(SUPPORT_EZXML, [test "x$glib" = "xno"])
-AM_CONDITIONAL(DATA_POI_GEODOWNLOAD, [test "x$glib" = "xyes"])
+AM_CONDITIONAL(MAP_POI_GEODOWNLOAD, [test "x$glib" = "xyes"])
 
 AC_CHECK_HEADER(
        zlib.h,
@@ -273,14 +291,15 @@ if test "x${postgresql}" = "xyes" ; then
                fi 
 fi
 AM_CONDITIONAL(HAVE_POSTGRESQL, test "x${postgresql}" = "xyes")
-
-PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_pkgconfig=yes], [freetype2_pkgconfig=no])
-if test "x$freetype2_pkgconfig" = "xyes"; then
-   AC_DEFINE(HAVE_FREETYPE2, 1, [Define to 1 if you have freetype2])
+# font
+# freetype
+AC_ARG_ENABLE(font-freetype, [  --disable-font-freetype             don't add freetype support], font_freetype=$enableval;font_freetype_reason="configure parameter")
+if test "x${font_freetype}" = "xyes" -a "x${FREETYPE2_CFLAGS}" = "x" -a "x${FREETYPE2_LIBS}" = "x"; then
+       PKG_CHECK_MODULES(FREETYPE2, [freetype2], , [font_freetype=no;font_freetype_reason="Package freetype2 missing"])
 fi
 AC_SUBST(FREETYPE2_CFLAGS)
 AC_SUBST(FREETYPE2_LIBS)
-AM_CONDITIONAL(FONT_FREETYPE, test "x${freetype2_pkgconfig}" = "xyes")
+AM_CONDITIONAL(FONT_FREETYPE, test "x${font_freetype}" = "xyes")
 
 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig], [fontconfig_pkgconfig=yes], [fontconfig_pkgconfig=no])
 if test "x$fontconfig_pkgconfig" = "xyes"; then
@@ -289,6 +308,8 @@ fi
 AC_SUBST(FONTCONFIG_CFLAGS)
 AC_SUBST(FONTCONFIG_LIBS)
 
+AM_CONDITIONAL(FONTS, test "x${font_freetype}" = "xyes" -a "x$fontconfig_pkgconfig" != "xyes")
+
 PKG_CHECK_MODULES(IMLIB2, [imlib2], [imlib2_pkgconfig=yes], [imlib2_pkgconfig=no])
 if test "x$imlib2_pkgconfig" = "xyes"; then
    AC_DEFINE(HAVE_IMLIB2, 1, [Define to 1 if you have imlib2])
@@ -313,19 +334,6 @@ if test "x$MODULE_GUI_SDL" = "xyes"; then
        )
 fi
 
-PKG_CHECK_MODULES(
-        [CEGUI],
-        [CEGUI-OPENGL >= 0.5.0],
-        [
-                AC_DEFINE(
-                        [HAVE_CEGUI],
-                        [],
-                        [Define to 1 if you have the @<:@CEGUI/CEGUI.h@:>@ header file.])
-                cegui=yes
-        ],
-        [AC_MSG_WARN([*** CEGUI not found -- SDL support disabled])]
-)
-
 AC_CHECK_HEADER(
         X11/Xmu/Xmu.h,
         AC_DEFINE(
@@ -381,108 +389,9 @@ AC_SUBST(GLC_CFLAGS)
 AC_SUBST(GLC_LIBS)
 fi
 
-if test x"$cegui" = xyes        
-               then     
-        # Save the LIBS into a temp var since AC_CHECK_LIB adds the lib into LIBS       
-        # and we want just to check and use CEGUI_LIBS          
-        libstemp="$LIBS"        
-        # For CEGUI, we have to check the presence of some libraries.   
-        # The following are mandatory (used by navit)   
-        # If the user installed NavIt without, issue a warning and disable CEGUI        
-        AC_CHECK_LIB(CEGUIBase, main,   
-                 [],    
-                 [      
-                echo "Error! Something is wrong with CEGUIBase. Do you have at least cegui-0.5?"        
-                ])      
-        AC_CHECK_LIB(CEGUIOpenGLRenderer, main,         
-                 [],    
-                 [      
-                echo "Error! Something is wrong with CEGUIOpenGLRenderer. Do you have at least cegui-0.5? "     
-                ], $OPENGL_LIBS )       
-        AC_CHECK_LIB(CEGUIFalagardWRBase, main,         
-                 [],    
-                 [      
-                echo "Error! Something is wrong with CEGUIFalagardWRBase. Do you have at least cegui-0.5?"      
-                ], $OPENGL_LIBS)        
-        CEGUI_LIBS="-lCEGUIBase -lCEGUIOpenGLRenderer -lCEGUIFalagardWRBase"    
-                
-        # The following are optional, but we need to link against them if cegui was built with them     
-        AC_CHECK_LIB(CEGUIXercesParser, main,   
-                 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIXercesParser"],        
-                 [echo "CEGUIXercesParser not found/not working, disabled."],   
-                 $OPENGL_LIBS   
-        )       
-                
-        AC_CHECK_LIB(CEGUIExpatParser, main,    
-                 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIExpatParser"],         
-                 [echo "CEGUIExpatParser not found/not working, disabled."],    
-                 $OPENGL_LIBS   
-        )       
-                
-        AC_CHECK_LIB(CEGUILibxmlParser, main,   
-                 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUILibxmlParser"],        
-                 [echo "CEGUILibxmlParser not found/not working, disabled."],   
-                 $OPENGL_LIBS   
-        )       
-                
-        AC_CHECK_LIB(CEGUITinyXMLParser, main,          
-                 [CEGUI_LIBS="$CEGUI_LIBS -lCEGUITinyXMLParser"],       
-                 [echo "CEGUITinyXMLParser not found/not working, disabled."],          
-                 $OPENGL_LIBS   
-        )       
-                
-        AC_CHECK_LIB(CEGUIDevILImageCodec, main,        
-                 [
-                       CEGUI_LIBS="$CEGUI_LIBS -lCEGUIDevILImageCodec"
-                        AC_DEFINE([HAVE_LIBCEGUIDEVILIMAGECODEC],[1],Define to 1 to use DevIL codec)
-                 ],
-                 [echo "CEGUIDevILImageCodec not found/not working, disabled."],        
-                 $OPENGL_LIBS   
-        )       
-                
-        AC_CHECK_LIB(CEGUITGAImageCodec, createImageCodec,      
-                 [
-                         CEGUI_LIBS="$CEGUI_LIBS -lCEGUITGAImageCodec"
-                         AC_DEFINE(HAVE_LIBCEGUITGAIMAGECODEC,[1],Define to 1 to use the TGA codec)
-                 ],
-                 [echo "GUITGAImageCodec not found/not working, disabled."],    
-                 $OPENGL_LIBS   
-        )       
-                
-        libssilly="$OPENGL_LIBS -lpng"          
-        AC_CHECK_LIB(CEGUISILLYImageCodec, createImageCodec,    
-                 [
-                        CEGUI_LIBS="$CEGUI_LIBS -lCEGUISILLYImageCodec"
-                        AC_DEFINE([HAVE_LIBCEGUISILLYIMAGECODEC],[1],Define to 1 to use SILLY codec)
-                 ],
-                 [echo "CEGUISILLYImageCodec not found/not working, disabled."],        
-                 $libssilly     
-        )       
-        # Restore the libs
-        LIBS="$libstemp"        
-        echo "CEGUI_LIBS : $CEGUI_LIBS"         
-        fi
-
-AC_SUBST(CEGUI_CFLAGS)
-AC_SUBST(CEGUI_LIBS)
-
-AM_CONDITIONAL(GUI_SDL, [test "x$sdl" = "xyes" -a "x$cegui" = "xyes" -a "x$opengl" = "xyes" -a "x$glc" = "xyes" -a "x$xmu" = "xyes" ])
+AM_CONDITIONAL(GUI_SDL, [test "x$sdl" = "xyes" -a "x$opengl" = "xyes" -a "x$glc" = "xyes" -a "x$xmu" = "xyes" ])
 AM_CONDITIONAL(GRAPHICS_OPENGL, [test "x$glut" = "xyes" - "x$opengl" = "xyes" -a "x$glc" = "xyes" ])
 
-AC_ARG_ENABLE(gui-clutter, [  --disable-gui-clutter             don't create gui clutter ], MODULE_GUI_CLUTTER=$enableval, MODULE_GUI_CLUTTER=yes)
-if test "x$MODULE_GUI_CLUTTER" = "xyes"; then
-       PKG_CHECK_MODULES(CLUTTER, [clutter-0.8], [clutter_pkgconfig=yes], [clutter_pkgconfig=no])
-       if test "x$clutter_pkgconfig" = "xyes"; then
-               AC_DEFINE(HAVE_CLUTTER, 1, [Define to 1 if you have clutter])
-       fi
-fi
-
-AC_SUBST(CLUTTER_CFLAGS)
-AC_SUBST(CLUTTER_LIBS)
-AM_CONDITIONAL(GUI_CLUTTER, [test "x$clutter_pkgconfig" = "xyes" -a "x$glc" = "xyes" ])
-       
-
-
 
 if test x"${USE_GARMIN}" = xyes
 then
@@ -504,7 +413,8 @@ if test "x${binding_python}" = "xyes"; then
                AC_MSG_CHECKING(for Python linkage)
                py_prefix=`$_PATH_PYTHON -c 'import sys; print sys.prefix'`
                py_ver=`$_PATH_PYTHON -c 'import sys; print sys.version[[:3]]'`
-               py_libdir="${py_prefix}/lib/python${py_ver}"
+               py_lib=`$_PATH_PYTHON -c 'import sys; print sys.lib'`
+               py_libdir="${py_prefix}/${py_lib}/python${py_ver}"
                PYTHON_CFLAGS="-I${py_prefix}/include/python${py_ver}"
                if test -f $py_libdir/config/Makefile -a -f $py_prefix/include/python${py_ver}/Python.h; then
                        py_libs=`grep '^LIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
@@ -549,12 +459,21 @@ AC_ARG_ENABLE(svg2png, [  --disable-svg2png        disable conversion of svgs to
 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")
 AC_ARG_ENABLE(svg2png-scaling-flag, [  --enable-svg2png-scaling-flag   enable conversion of flag svgs to pngs with specified sizes], SVG2PNG_SCALES_FLAG=$enableval, SVG2PNG_SCALES_FLAG="")
 AC_ARG_ENABLE(svg2png-scaling-nav, [  --enable-svg2png-scaling-nav   enable conversion of nav svgs to pngs with specified sizes], SVG2PNG_SCALES_NAV=$enableval, SVG2PNG_SCALES_NAV="")
+AC_ARG_WITH(svg2png-use-convert, [  --with-svg2png-use-convert   use imagemagick's convert for png creation], SVG2PNG_CONVERTER="convert")
+AC_ARG_WITH(svg2png-use-rsvg-convert, [  --with-svg2png-use-rsvg-convert   use librsvg's rsvg-convert for png creation], SVG2PNG_CONVERTER="rsvg-convert")
+AC_ARG_WITH(svg2png-use-inkscape, [  --with-svg2png-use-inkscape   use inkscapes internal convert routines for png creation], SVG2PNG_CONVERTER="inkscape")
+AC_ARG_WITH(svg2png-use-ksvgtopng4, [  --with-svg2png-use-ksvgtopng4   use kde4's ksvgtopng4 for png creation], SVG2PNG_CONVERTER="ksvgtopng4")
+AC_ARG_WITH(svg2png-use-ksvgtopng, [  --with-svg2png-use-ksvgtopng   use kde3's convert for png creation], SVG2PNG_CONVERTER="ksvgtopng")
 if test "x${enable_svg2png}" = "xyes" ; then
-       AC_PATH_PROG([KSVGTOPNG], [ksvgtopng], [])
-       if test ! -x "$KSVGTOPNG"; then
-           enable_svg2png="no"
-        fi
+    if test "x${SVG2PNG_CONVERTER}" = "x"; then
+        SVG2PNG_CONVERTER="ksvgtopng ksvgtopng4 rsvg-convert inkscape convert"
+    fi
+    AC_PATH_PROGS([SVG2PNG], "${SVG2PNG_CONVERTER}", [none])
+    if test "x${SVG2PNG}" = "xnone"; then
+        enable_svg2png="no"
+    fi
 fi
+AC_SUBST(SVG2PNG)
 AC_SUBST(SVG2PNG_SCALES)
 AC_SUBST(SVG2PNG_SCALES_FLAG)
 AC_SUBST(SVG2PNG_SCALES_NAV)
@@ -574,6 +493,7 @@ AC_ARG_ENABLE(nls,
 INTLIBS=""
 MOFILES=""
 POFILES=""
+POIFILES=""
 LINGUAS=""
 
 if test "x$enable_nls" = "xyes"; then
@@ -616,10 +536,14 @@ if test "x$enable_nls" = "xyes"; then
  for lang in $LINGUAS; do
     POFILES="$POFILES $lang.po"
  done
+ for lang in $LINGUAS; do
+    POIFILES="$POIFILES $lang.po.in"
+ done
 
 AC_SUBST(INTLIBS)
 AC_SUBST(MOFILES)
 AC_SUBST(POFILES)
+AC_SUBST(POIFILES)
 AM_GNU_GETTEXT_VERSION
 AM_GNU_GETTEXT(no-libtool, need-ngettext, \$(top_builddir)/intl/)
 AC_SUBST(LIBINTL)
@@ -764,6 +688,7 @@ AM_CONDITIONAL(VEHICLE_DEMO, test "x${vehicle_demo}" = "xyes")
 AC_ARG_ENABLE(vehicle-file, [  --disable-vehicle-file              disable vehicle type file], vehicle_file=$enableval;vehicle_file_reason="configure parameter")
 AM_CONDITIONAL(VEHICLE_FILE, test "x${vehicle_file}" = "xyes")
 # gpsd
+AC_ARG_ENABLE(vehicle-gpsd, [  --disable-vehicle-gpsd              disable vehicle type gpsd], vehicle_gpsd=$enableval;vehicle_gpsd_reason="configure parameter")
 if test "x${vehicle_gpsd}" = xyes
 then
        AC_CHECK_HEADER(gps.h, AC_DEFINE([HAVE_LIBGPS],[],Define to 1 if you have the <gps.h> header file.) GPSD_LIBS="-lgps", vehicle_gpsd=no; vehicle_gpsd_reason="no gps.h" )
@@ -796,17 +721,19 @@ navit/Makefile
 navit/binding/Makefile
 navit/binding/python/Makefile
 navit/binding/dbus/Makefile
-navit/data/Makefile
-navit/data/mg/Makefile
-navit/data/textfile/Makefile
-navit/data/binfile/Makefile
-navit/data/garmin/Makefile
-navit/data/poi_geodownload/Makefile
-navit/data/poi_geodownload/libmdb/Makefile
-navit/data/poi_geodownload/libmdb/include/Makefile
+navit/map/Makefile
+navit/map/mg/Makefile
+navit/map/textfile/Makefile
+navit/map/shapefile/Makefile
+navit/map/binfile/Makefile
+navit/map/garmin/Makefile
+navit/map/poi_geodownload/Makefile
+navit/map/poi_geodownload/libmdb/Makefile
+navit/map/poi_geodownload/libmdb/include/Makefile
 navit/fib-1.1/Makefile
 navit/font/Makefile
 navit/font/freetype/Makefile
+navit/fonts/Makefile
 navit/graphics/Makefile
 navit/graphics/gd/Makefile
 navit/graphics/gtk_drawing_area/Makefile
@@ -820,9 +747,6 @@ navit/graphics/win32/Makefile
 navit/gui/Makefile
 navit/gui/gtk/Makefile
 navit/gui/internal/Makefile
-navit/gui/clutter/Makefile
-navit/gui/cegui/Makefile
-navit/gui/cegui/datafiles/Makefile
 navit/gui/directfb/Makefile
 navit/gui/win32/Makefile
 navit/osd/Makefile
@@ -873,10 +797,6 @@ if test x"$glc" != xyes
         then
         sdl_failures=$sdl_failures"quesoglc "
 fi
-if test x"$cegui" != xyes
-        then
-        sdl_failures=$sdl_failures"cegui-devel >= 0.5 "
-fi
 if test -z "$sdl_failures"
         then
         echo "OpenGL gui  : ENABLED, with $CEGUI_LIBS"
@@ -889,12 +809,6 @@ if test x"$directfb_pkgconfig" = xyes
        else
        echo "DIRECTFB    : DISABLED"
 fi
-if test x"$clutter_pkgconfig" = xyes
-       then
-       echo "Clutter gui : ENABLED"
-       else 
-       echo "Clutter gui : DISABLED"
-fi
 if test x"$enable_hildon" = xyes
        then
         echo "Maemo/Hildon: ENABLED"
@@ -921,7 +835,9 @@ fi
 echo "Plugins:             $plugins ($plugins_reason)"
 echo "Postgresql:          $postgresql ($postgresql_reason)"
 echo "Samplemap:           $samplemap ($samplemap_reason)"
-echo "NLS Support:         $enable_nls($nls_libs)"
+echo "NLS Support:         $enable_nls ($nls_libs)"
+echo "Font renderers:"
+echo "  freetype:          $font_freetype ($font_freetype_reason)"
 echo "Graphics types:"
 echo "  gtk_drawing_area:  $graphics_gtk_drawing_area ($graphics_gtk_drawing_area_reason)"
 echo "  qt_qpainter:       $graphics_qt_qpainter ($graphics_qt_qpainter_reason)"
@@ -934,6 +850,10 @@ echo "  gtk:               $gui_gtk ($gui_gtk_reason)"
 echo "  internal:          $gui_internal ($gui_internal_reason)"
 echo "  win32:             $gui_win32 ($gui_win32_reason)"
 
+echo "Bindings:"
+echo "  dbus:              $binding_dbus ($binding_dbus_reason)"
+echo "  python:            $binding_python ($binding_python_reason)"
+
 echo "Speech types:"
 echo "  cmdline:           $speech_cmdline ($speech_cmdline_reason)"
 echo "  speech_dispatcher: $speech_speech_dispatcher ($speech_speech_dispatcher_reason)"