From f4e7a2e7274c70492dd0cd01d12f16e26baa3426 Mon Sep 17 00:00:00 2001 From: Roland Mas Date: Sun, 24 Jan 2010 23:12:26 +0100 Subject: [PATCH] Use local copy of libusb rather than the one shipped by the OS since Argyll depends on the local patches --- Makefile.am | 14 +++++++++++++- Makefile.shared | 4 ++-- configure.ac | 32 +++++++++++++++++++++++++++++--- profile/Makefile.am | 2 +- spectro/Makefile.am | 6 +++--- xicc/Makefile.am | 2 +- 6 files changed, 49 insertions(+), 11 deletions(-) diff --git a/Makefile.am b/Makefile.am index f5797f2..f648c8c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/Makefile.shared -privatelib_LTLIBRARIES = libargyll.la +privatelib_LTLIBRARIES = libargyll.la libargyllusb.la privatelibdir = $(pkglibdir) libargyll_la_SOURCES = xicc/xicc.c xicc/xicc.h xicc/xcam.c xicc/xcam.h \ @@ -13,6 +13,18 @@ libargyll_la_SOURCES = xicc/xicc.c xicc/xicc.h xicc/xcam.c xicc/xcam.h \ libargyll_la_LIBADD = ./rspl/librspl.la $(ICC_LIBS) \ ./numlib/libargyllnum.la ./cgats/libcgats.la +if LINUX_API +LIBUSB_OS_SUPPORT = libusb/linux.c libusb/linux.h +else +if BSD_API +LIBUSB_OS_SUPPORT = libusb/bsd.c +endif +endif + +libargyllusb_la_SOURCES = libusb/usb.c libusb/usbi.h libusb/error.c \ + libusb/error.h libusb/descriptors.c $(LIBUSB_OS_SUPPORT) +libargyllusb_la_CFLAGS = -I $(top_srcdir)/libusb + SUBDIRS = h doc ref numlib cgats plot rspl $(ICC_SUBDIRS) jcnf ucmm \ render . gamut spectro xicc target link tweak profile scanin \ imdi diff --git a/Makefile.shared b/Makefile.shared index 9ea9670..9823f01 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -1,8 +1,8 @@ # -*- mode: Makefile -*- # Common CFLAGS for Argyll components -AM_CFLAGS = -DUNIX -I $(top_srcdir)/cgats -I$(top_srcdir)/gamut \ - -I$(top_srcdir)/h -I$(top_srcdir)/jcnf \ +AM_CFLAGS = -DUNIX -I$(top_srcdir)/cgats -I$(top_srcdir)/gamut \ + -I$(top_srcdir)/h -I$(top_srcdir)/jcnf -I$(top_srcdir)/libusb \ -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 \ diff --git a/configure.ac b/configure.ac index e944d3a..60596e2 100644 --- a/configure.ac +++ b/configure.ac @@ -36,8 +36,32 @@ AC_CHECK_LIB(Xinerama, XineramaQueryScreens, X_LIBS="$X_LIBS -lXinerama",,-LXext AC_CHECK_LIB(Xxf86vm, XF86VidModeGetGamma, X_LIBS="$X_LIBS -lXxf86vm",,-lXext -lX11) AC_SUBST([X_LIBS]) -AC_CHECK_LIB(usb, usb_open, USB_LIBS="-lusb", , -lusb) -AC_SUBST([USB_LIBS]) +AC_SUBST(LINUX_API) +AC_SUBST(BSD_API) +case $host in + *-linux*) + LINUX_API=1 + BSD_API=0 + ;; + *-freebsd*|*-kfreebsd*-gnu|*-openbsd*|*-netbsd*) + LINUX_API=0 + BSD_API=1 + ;; + *) + LINUX_API=0 + BSD_API=0 + ;; +esac +AM_CONDITIONAL([LINUX_API], [case $host in *-linux*) true ;; *) false ;; esac]) +AM_CONDITIONAL([BSD_API], [case $host in *-freebsd*|*-kfreebsd*-gnu|*-openbsd*|*-netbsd*) true ;; *) false ;; esac]) + +AC_C_BIGENDIAN +if test "$ac_cv_c_bigendian" = "yes"; then + BIGENDIAN="1" +else + BIGENDIAN="0" +fi +AC_SUBST(BIGENDIAN) AC_CONFIG_FILES([Makefile h/Makefile @@ -60,6 +84,8 @@ AC_CONFIG_FILES([Makefile imdi/Makefile jcnf/Makefile jcnf/yajl/Makefile - ucmm/Makefile]) + ucmm/Makefile + libusb/usb.h]) + AC_OUTPUT diff --git a/profile/Makefile.am b/profile/Makefile.am index cf2afa8..c309214 100644 --- a/profile/Makefile.am +++ b/profile/Makefile.am @@ -16,7 +16,7 @@ LDADD = ./libprof.la ../xicc/libxutils.la ../spectro/libinst.la \ ../gamut/libgamut.la ../gamut/libgammap.la ../plot/libvrml.la \ ../plot/libplot.la ../rspl/librspl.la \ ../numlib/libargyllnum.la $(ICC_LIBS) ../cgats/libcgats.la \ - ../libargyll.la $(TIFF_LIBS) -lusb + ../libargyll.la $(TIFF_LIBS) ../libargyllusb.la bin_PROGRAMS = simpprof kodak2cgats cb2cgats logo2cgats splitcgats \ profcheck invprofcheck mpprof mppcheck verify colprof printcal \ diff --git a/spectro/Makefile.am b/spectro/Makefile.am index 0dd1733..f9ee20e 100644 --- a/spectro/Makefile.am +++ b/spectro/Makefile.am @@ -15,7 +15,7 @@ libinst_la_SOURCES = inst.h inst.c insttypes.c dtp20.c dtp20.h dtp22.c \ spyd2.c spyd2.h spyd2setup.h spyd2PLD.h huey.c huey.h unixio.c \ usbio.c hidio.c pollem.c pollem.h icoms.h conv.h usbio.h \ hidio.h -libinst_la_LIBADD = -lusb $(ICC_LIBS) ../numlib/libargyllnum.la \ +libinst_la_LIBADD = ../libargyllusb.la $(ICC_LIBS) ../numlib/libargyllnum.la \ ../libargyll.la ../rspl/librspl.la libconv.la libdisp_la_SOURCES = dispsup.c dispwin.c dispwin.h dispsup.h @@ -29,8 +29,8 @@ LDADD = ./libinsttypes.la ./libdisp.la ./libinst.la ./libconv.la \ ../ucmm/libucmm.la ../jcnf/libjcnf.la ../jcnf/yajl/libyajl.la \ ../xicc/libxicc.la $(ICC_LIBS) ../cgats/libcgats.la \ ../rspl/librspl.la ../gamut/libgamut.la ../target/libtarget.la \ - ../plot/libplot.la ../numlib/libargyllnum.la $(X_LIBS) -lusb \ - ../libargyll.la + ../plot/libplot.la ../numlib/libargyllnum.la $(X_LIBS) \ + ../libargyllusb.la ../libargyll.la bin_PROGRAMS = synthcal dispwin dispread dispcal fakeread synthread \ chartread spotread spec2cie average spyd2en diff --git a/xicc/Makefile.am b/xicc/Makefile.am index 729a941..72cae8b 100644 --- a/xicc/Makefile.am +++ b/xicc/Makefile.am @@ -20,7 +20,7 @@ LDADD = ./libxicc.la ./libxutils.la ../rspl/librspl.la \ ../numlib/libargyllnum.la ../gamut/libgamut.la \ ../gamut/libgammap.la ../spectro/libinsttypes.la $(ICC_LIBS) \ ../cgats/libcgats.la ../plot/libvrml.la ../plot/libplot.la \ - $(TIFF_LIBS) $(X_LIBS) -lusb ../libargyll.la + $(TIFF_LIBS) $(X_LIBS) ../libargyll.la ../libargyllusb.la bin_PROGRAMS = fakeCMY iccgamut mpplu revfix tiffgamut xicclu \ extracticc extractttag specplot ccttest -- 1.6.6.1