Fix:Core:Cleanup of configure.in and binding Makefile.am
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 18 Feb 2008 17:03:13 +0000 (17:03 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 18 Feb 2008 17:03:13 +0000 (17:03 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@884 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/configure.in
navit/src/binding/Makefile.am

index 7f62c28..4ec56ea 100644 (file)
@@ -81,10 +81,6 @@ PKG_CHECK_MODULES(NAVIT, [glib-2.0 gmodule-2.0], [], AC_MSG_ERROR([glib-2.0 or g
 AC_SUBST(NAVIT_CFLAGS)
 AC_SUBST(NAVIT_LIBS)
 
-PKG_CHECK_MODULES(DBUS, [dbus-glib-1], [dbus_pkgconfig=yes], [dbus_pkgconfig=no])
-AC_SUBST(DBUS_CFLAGS)
-AC_SUBST(DBUS_LIBS)
-
 AC_CHECK_HEADER(
        zlib.h,
        AC_DEFINE(
@@ -332,40 +328,61 @@ fi
        AM_CONDITIONAL(HAVELIBGARMIN, [test "x$use_libgarmin" = "xyes"])
 
 
-AC_ARG_ENABLE(binding-python, [  --disable-binding-python             don't create binding python ], MODULE_BINDING_PYTHON=$enableval, MODULE_BINDING_PYTHON=yes)
-if test "$cross_compiling" = no; then
-       if test "x$MODULE_BINDING_PYTHON" = "xyes"; then
-               AC_PATH_PROG(_PATH_PYTHON,[python])
-               dnl Libraries and flags for embedded Python.
-               dnl FIXME: I wish there was a less icky way to get this.
-               if test x"$_PATH_PYTHON" != x ; 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}"
-                       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/^.*=//'`
-                               py_libc=`grep '^LIBC=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
-                               py_libm=`grep '^LIBM=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
-                               py_liblocalmod=`grep '^LOCALMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
-                               py_libbasemod=`grep '^BASEMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
-                               PYTHON_LIBS="-L$py_libdir/config $py_libs $py_libc $py_libm -lpython$py_ver $py_liblocalmod $py_libbasemod"
-                               PYTHON_LIBS=`echo $PYTHON_LIBS | sed -e 's/[ \\t]*/ /g'`
-                               AC_DEFINE(HAVE_PYTHON, 1, [Define to 1 if you have python])
-                               python=yes
-                               AC_MSG_RESULT($py_libdir)
-                       else
-                               AC_MSG_WARN([$py_libdir/config/Makefile or $py_prefix/include/python${py_ver}/Python.h missing, support for python disabled])
-                       fi
+# binding python
+AC_ARG_ENABLE(binding-python, [  --disable-binding-python             don't create binding python], enable_binding_python=$enableval, enable_binding_python=yes)
+if test "x${enable_binding_python}" = "xyes" ; then
+       if test "x${cross_compiling}" = "xyes" ; then
+               AC_MSG_WARN([*** cross compiling, support for python disabled])
+               enable_binding_python="no"
+       fi
+fi
+if test "x${enable_binding_python}" = "xyes"; then
+       AC_PATH_PROG(_PATH_PYTHON,[python])
+       dnl Libraries and flags for embedded Python.
+       dnl FIXME: I wish there was a less icky way to get this.
+       if test "x${_PATH_PYTHON}" != "x" ; 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}"
+               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/^.*=//'`
+                       py_libc=`grep '^LIBC=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
+                       py_libm=`grep '^LIBM=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
+                       py_liblocalmod=`grep '^LOCALMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
+                       py_libbasemod=`grep '^BASEMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
+                       PYTHON_LIBS="-L$py_libdir/config $py_libs $py_libc $py_libm -lpython$py_ver $py_liblocalmod $py_libbasemod"
+                       PYTHON_LIBS=`echo $PYTHON_LIBS | sed -e 's/[ \\t]*/ /g'`
+                       AC_DEFINE(HAVE_PYTHON, 1, [Define to 1 if you have python])
+                       python=yes
+                       AC_MSG_RESULT($py_libdir)
+               else
+                       AC_MSG_WARN([$py_libdir/config/Makefile or $py_prefix/include/python${py_ver}/Python.h missing, support for python disabled])
                fi
+       else
+               AC_MSG_WARN([no python found, support for python disabled])
+               enable_binding_python="no"
        fi
-else
-       AC_MSG_WARN([*** cross compiling, support for python disabled])
 fi
-AC_SUBST(PYTHON_CFLAGS)
-AC_SUBST(PYTHON_LIBS)
-AM_CONDITIONAL(BINDING_PYTHON, [test "x$python" = "xyes"])
+if test "x${enable_binding_python}" = xyes ; then
+       AC_DEFINE(USE_BINDING_PYTHON, 1, [Build with binding python])
+       AC_SUBST(PYTHON_CFLAGS)
+       AC_SUBST(PYTHON_LIBS)
+fi
+AM_CONDITIONAL(USE_BINDING_PYTHON, test "x${enable_binding_python}" = "xyes")
+
+# binding dbus
+AC_ARG_ENABLE(binding-dbus,   [  --disable-binding-dbus               don't create binding dbus], enable_binding_dbus=$enableval, enable_binding_dbus=yes)
+if test "x${enable_binding_dbus}" = "xyes" ; then
+       PKG_CHECK_MODULES(DBUS, [dbus-glib-1], ,enable_binding_dbus=no);
+fi
+if test "x${enable_binding_dbus}" = "xyes" ; then
+       AC_DEFINE(USE_BINDING_DBUS, 1, [Build with binding dbus])
+       AC_SUBST(DBUS_CFLAGS)
+       AC_SUBST(DBUS_LIBS)
+fi
+AM_CONDITIONAL(USE_BINDING_DBUS, test "x${enable_binding_dbus}" = "xyes")
 
 # NLS
 
index b33d16a..540a233 100644 (file)
@@ -1,7 +1,10 @@
 SUBDIRS=
-if BINDING_PYTHON
+if USE_BINDING_PYTHON
   SUBDIRS+=python
 endif
+if USE_BINDING_DBUS
+  SUBDIRS+=dbus
+endif
 
-DIST_SUBDIRS=python
+DIST_SUBDIRS=python dbus