support explict enable and disable of ntrack bindings

Bug #654221 reported by Alexander Sack
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ntrack
Fix Released
Wishlist
Alexander Sack

Bug Description

atm, ntrack bindings get automatically enabled/disabled if the needed build dependencies are available/unavailable on target.

This is not the best approach for all cases; hence it was proposed in bug 653882 to add --with-<binding> options to configure.

Default behaviour will preserve current behaviour. --with-<binding> will force the build of the giving binding and will cause configure to fail if required prerequisites are not available.

Related branches

Alexander Sack (asac)
Changed in ntrack:
importance: Undecided → Wishlist
status: New → Triaged
milestone: none → 009
description: updated
Changed in ntrack:
assignee: nobody → Alexander Sack (asac)
Revision history for this message
Alexander Sack (asac) wrote :
Download full text (4.3 KiB)

------------------------------------------------------------
revno: 207
fixes bug(s): https://launchpad.net/bugs/654221
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Sun 2010-10-03 20:45:55 +0200
message:
  add explicit ./configure flag for with/without-<binding> - see lp:654221
diff:
=== modified file 'Makefile.am'
--- Makefile.am 2010-01-10 21:35:49 +0000
+++ Makefile.am 2010-10-03 18:45:55 +0000
@@ -21,12 +21,20 @@

 ACLOCAL_AMFLAGS = -I m4

-SUBDIRS = common glib qt4
+SUBDIRS = common
+
+if HAVE_GLIB2
+SUBDIRS += glib
+endif

 if HAVE_GOBJECT
 SUBDIRS += gobject
 endif

+if HAVE_QT4
+SUBDIRS +=qt4
+endif
+
 dist_doc_DATA = AUTHORS NEWS README

 dump-bzr-changelog:

=== modified file 'configure.ac'
--- configure.ac 2010-07-27 22:47:22 +0000
+++ configure.ac 2010-10-03 18:45:55 +0000
@@ -36,33 +36,91 @@

 dnl Checks for libraries.

-PKG_CHECK_MODULES(GLIB, glib-2.0)
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
-
-PKG_CHECK_MODULES(GOBJECT, gobject-2.0, ac_have_gobject=1, ac_have_gobject=0)
-AC_SUBST(GOBJECT_CFLAGS)
-AC_SUBST(GOBJECT_LIBS)
+AC_ARG_WITH([glib2],
+ [AS_HELP_STRING([--with-glib2],
+ [support glib2 binding @<:@default=check@:>@])],
+ [],
+ [with_glib2=check])
+
+AC_ARG_WITH([gobject],
+ [AS_HELP_STRING([--with-gobject],
+ [support gobject binding @<:@default=check@:>@])],
+ [],
+ [with_gobject=check])
+
+AC_ARG_WITH([pygobject],
+ [AS_HELP_STRING([--with-pygobject],
+ [support gobject binding @<:@default=check@:>@])],
+ [],
+ [with_pygobject=check])
+
+AC_ARG_WITH([qt4],
+ [AS_HELP_STRING([--with-qt4],
+ [support qt4 binding @<:@default=check@:>@])],
+ [],
+ [with_qt4=check])
+
+##
+# parameter consistency check
+
+AS_IF([test "x$with_gobject" = xyes -a "x$with_glib2" = "xno"],
+ [AC_MSG_ERROR([--with-gobject is impossible --without-glib2])])
+
+AS_IF([test "x$with_pygobject" = xyes -a "x$with_glib2" = "xno"],
+ [AC_MSG_ERROR([--with-pygobject is impossible --without-glib2])])
+
+AS_IF([test "x$with_pygobject" = xyes -a "x$with_gobject" = "xno"],
+ [AC_MSG_ERROR([--with-pygobject is impossible --without-gobject])])
+
+##
+# gather c and ld flags
+
+ac_have_glib2=check
+AS_IF([test "x$with_glib2" != xno],
+ [PKG_CHECK_MODULES(GLIB, glib-2.0, ac_have_glib2=1, ac_have_glib2=0)
+ AC_SUBST(GLIB_CFLAGS)
+ AC_SUBST(GLIB_LIBS)])
+AM_CONDITIONAL(HAVE_GLIB2, test $ac_have_glib2 = 1)
+
+ac_have_gobject=check
+if test $ac_have_glib2 = 1; then
+ AS_IF([test "x$with_gobject" != xno],
+ [PKG_CHECK_MODULES(GOBJECT, gobject-2.0, ac_have_gobject=1, ac_have_gobject=0)
+ AC_SUBST(GOBJECT_CFLAGS)
+ AC_SUBST(GOBJECT_LIBS)])
+fi
 AM_CONDITIONAL(HAVE_GOBJECT, test $ac_have_gobject = 1)

-PKG_CHECK_MODULES(PYGOBJECT, pygobject-2.0, ac_have_pygobject=1, ac_have_pygobject=0)
-AC_SUBST(PYGOBJECT_CFLAGS)
-AC_SUBST(PYGOBJECT_LIBS)
+ac_have_pygobject=check
+if test $ac_h...

Read more...

Changed in ntrack:
status: Triaged → Fix Committed
Revision history for this message
Alexander Sack (asac) wrote :

Now that this is committed, maybe check if the latest lp:ntrackk gives you the expected behaviour. Thanks!

Revision history for this message
Alexander Sack (asac) wrote :
Changed in ntrack:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.