John Stamp, 2009-08-29 11:46:11 -0700 :

> Argyll embeds an old version of yajl (0.3.0) in its source code.  Now
> that yajl is in Debian, I'm attaching a patch that lets it compile
> against the system yajl instead.

Great idea, thanks for the package and the patch :-)

> Note: Argyll modified yajl's API so argyll's jcnf can save comments.
> But from what I can see, ucmm/ucmm.c is the only file that uses jcnf,
> and it doesn't take advantage of that feature.  So even though the
> patch comments out a bit of argyll's code, it shouldn't affect its
> functionality.

  I'm less enthusiastic about that part.  I did replace the embedded and
patched libusb, but the local patches weren't adding functionality.  In
this case, you're removing functionality from argyll even though it
appears not to be used currently.  Since I try to stick to upstream as
much as I can, I'd rather not go this way.  I'd much prefer the patch to
be included in yajl, preferably upstream.

  I updated your patch so the system yajl library is detected by the
configure script and only used if present (attached for reference).  I
also committed it into a separate branch for now, but I will pull it
into the integration branch and update the package accordingly as soon
as the above problem is fixed.

=== modified file 'Makefile.shared'
--- Makefile.shared	2009-05-29 17:02:43 +0000
+++ Makefile.shared	2009-08-30 11:30:46 +0000
@@ -6,7 +6,7 @@
     -I$(top_srcdir)/numlib -I$(top_srcdir)/plot -I$(top_srcdir)/profile	\
     -I$(top_srcdir)/render -I$(top_srcdir)/rspl -I$(top_srcdir)/spectro	\
     -I$(top_srcdir)/target -I$(top_srcdir)/ucmm -I$(top_srcdir)/xicc	\
-    $(TIFF_CFLAGS) $(ICC_CFLAGS)
+    $(TIFF_CFLAGS) $(ICC_CFLAGS) $(YAJL_CFLAGS)
 
 # Build libs in other dirs when required
 ../%.la:

=== modified file 'configure.ac'
--- configure.ac	2009-07-03 11:56:39 +0000
+++ configure.ac	2009-08-30 11:30:46 +0000
@@ -28,6 +28,18 @@
 AC_SUBST([ICC_CFLAGS])
 AC_SUBST([ICC_SUBDIRS])
 
+AC_CHECK_LIB(yajl, yajl_free, HAVE_YAJL="true", , -lm)
+if test "$HAVE_YAJL" = "true" ; then
+   YAJL_LIBS="-lyajl"
+else
+   YAJL_LIBS='$(top_srcdir)/jcnf/yajl/libyajl.la'
+   YAJL_CFLAGS='-I$(top_srcdir)/jcnf/yajl'
+   YAJL_SUBDIRS='yajl'
+fi
+AC_SUBST([YAJL_LIBS])
+AC_SUBST([YAJL_CFLAGS])
+AC_SUBST([YAJL_SUBDIRS])
+
 AC_CHECK_LIB(X11, XOpenDisplay, X_LIBS="$X_LIBS -lX11")
 AC_CHECK_LIB(Xext, XextFindDisplay, X_LIBS="$X_LIBS -lXext",,-lX11)
 AC_CHECK_LIB(Xss, XScreenSaverSuspend, X_LIBS="$X_LIBS -lXss",,-lXext -lX11)

=== modified file 'jcnf/Makefile.am'
--- jcnf/Makefile.am	2009-05-13 15:10:14 +0000
+++ jcnf/Makefile.am	2009-08-30 11:30:46 +0000
@@ -2,15 +2,15 @@
 
 include $(top_srcdir)/Makefile.shared
 
-SUBDIRS = yajl
+SUBDIRS = $(YAJL_SUBDIRS)
 
 privatelib_LTLIBRARIES = libjcnf.la
 privatelibdir = $(pkglibdir)
 
 libjcnf_la_SOURCES = jcnf.h jcnf.c
-libjcnf_la_LIBADD = yajl/libyajl.la
+libjcnf_la_LIBADD = $(YAJL_LIBS)
 
-LDADD = ./libjcnf.la yajl/libyajl.la
+LDADD = ./libjcnf.la $(YAJL_LIBS)
 
 check_PROGRAMS = test
 

=== modified file 'jcnf/jcnf.c'
--- jcnf/jcnf.c	2008-11-16 13:45:00 +0000
+++ jcnf/jcnf.c	2009-08-30 11:30:46 +0000
@@ -42,9 +42,9 @@
 #include <string.h>
 #include <math.h>
 
-#include "yajl/yajl_common.h"
-#include "yajl/yajl_gen.h"
-#include "yajl/yajl_parse.h"
+#include <yajl/yajl_common.h>
+#include <yajl/yajl_gen.h>
+#include <yajl/yajl_parse.h>
 
 #include "jcnf.h"
 

=== modified file 'spectro/Makefile.am'
--- spectro/Makefile.am	2009-05-29 17:02:43 +0000
+++ spectro/Makefile.am	2009-08-30 11:30:46 +0000
@@ -22,7 +22,7 @@
 	../numlib/libargyllnum.la ./libinst.la ../libargyll.la
 
 LDADD = ./libinsttypes.la ./libdisp.la ./libinst.la ../ucmm/libucmm.la	\
-	../jcnf/libjcnf.la ../jcnf/yajl/libyajl.la ../xicc/libxicc.la	\
+	../jcnf/libjcnf.la $(YAJL_LIBS) ../xicc/libxicc.la	\
 	../xicc/libxcolorants.la $(ICC_LIBS) ../cgats/libcgats.la	\
 	../rspl/librspl.la ../gamut/libgamut.la ../target/libtarget.la	\
 	../plot/libplot.la ../numlib/libargyllnum.la $(X_LIBS) -lusb

  Thanks,

Roland.
-- 
Roland Mas

Qu'est-ce qui est jaune, qui pèse deux cents kilos et qui chante ?
Un sumotori dans sa salle de bains.

Reply via email to