aboutsummaryrefslogtreecommitdiff
path: root/sysutils/hal/files/patch-configure.in
blob: 84e12d18796b1d25975ec5f92d525ca25f4daccb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--- configure.in.orig	2009-05-10 15:43:52.000000000 -0400
+++ configure.in	2009-05-17 00:53:29.000000000 -0400
@@ -14,6 +14,7 @@ AM_MAINTAINER_MODE
 glib_module="glib-2.0 >= 2.10.0 gobject-2.0 > 2.10.0 dbus-glib-1 >= 0.61"
 dbus_module="dbus-1 >= 0.61"
 blkid_module="blkid >= 1.43"
+volume_id_module="libvolume_id >= 0.77"
 polkit_module="polkit >= 0.5"
 
 # libtool versioning - this applies to libhal and libhal-storage
@@ -477,6 +478,9 @@ if test "x$with_libpci" != xno ; then
 fi 
 AM_CONDITIONAL([HAVE_LIBPCI], [test "x$USE_LIBPCI" = "xyes"])
 
+USE_LIBUSB20=no
+USE_LIBUSB=no
+LIBUSB20_LIBS=""
 AC_ARG_WITH([backend],
 	    AS_HELP_STRING([--with-backend=<name>],
 	                   [backend to use (linux/solaris/freebsd/dummy)]),
@@ -504,6 +508,22 @@ AM_CONDITIONAL(HALD_COMPILE_LINUX, [test
 AM_CONDITIONAL(HALD_COMPILE_FREEBSD, [test x$HALD_BACKEND = xfreebsd], [Compiling for FreeBSD])
 AM_CONDITIONAL(HALD_COMPILE_SOLARIS, [test x$HALD_BACKEND = xsolaris], [Compiling for Solaris])
 AC_SUBST(HALD_BACKEND)
+if test "x$HALD_BACKEND" = "xfreebsd"; then
+    AC_CHECK_LIB([usb20], [libusb20_dev_get_info], [USE_LIBUSB20=yes], [USE_LIBUSB20=no])
+fi
+if test "x$USE_LIBUSB20" = "xno"; then
+    AC_CHECK_LIB([usb], [libusb20_dev_get_info], [USE_LIBUSB=yes], [USE_LIBUSB=no])
+fi
+AM_CONDITIONAL([HAVE_LIBUSB20],[test "x$USE_LIBUSB20" = "xyes"])
+AM_CONDITIONAL([HAVE_LIBUSB20],[test "x$USE_LIBUSB" = "xyes"])
+if test "x$USE_LIBUSB20" = "xyes"; then
+    AC_DEFINE(HAVE_LIBUSB20, 1, [Set if we need libusb20])
+    LIBUSB20_LIBS="-lusb20"
+elif test "x$USE_LIBUSB" = "xyes"; then
+    AC_DEFINE(HAVE_LIBUSB20, 1, [Set if we need libsub20])
+    LIBUSB20_LIBS="-lusb"
+fi
+AC_SUBST(LIBUSB20_LIBS)
 
 dnl DBUS API is subject to changes
 AC_DEFINE_UNQUOTED(DBUS_API_SUBJECT_TO_CHANGE, [], [DBUS API is subject to change])
@@ -685,8 +705,20 @@ else
 fi
 AC_MSG_RESULT($have_glib_2_14)
 
+case "$host" in
+*-*-freebsd*)
+	PKG_CHECK_MODULES(VOLUME_ID, [$volume_id_module])
+	AC_SUBST(VOLUME_ID_CFLAGS)
+	AC_SUBST(VOLUME_ID_LIBS)
+	;;
+*)
+	;;
+esac
+
 # blkid
 case "$host" in
+*-*-freebsd*)
+	;;
 *-*-solaris*)
 	;;
 *)