summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-09-23 13:07:46 +0200
committerAlexander Larsson <alexl@redhat.com>2009-09-23 13:07:46 +0200
commit0285e9ede48ff83aead882401e36e9d7ae25746f (patch)
treeff103efb620b4761540796eba8a58bb9e7d0d962
parent24041285e7392f5c83c8b98a017181983233d411 (diff)
downloadgvfs-0285e9ede48ff83aead882401e36e9d7ae25746f.tar.gz
FreeBSD support for gphoto2 backend
Here is a patch from Aurélien Jarno to enable the gphoto2 backend on FreeBSD and GNU/kFreeBSD.
-rw-r--r--configure.ac2
-rw-r--r--monitor/gphoto2/ggphoto2volumemonitor.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 5d21eb44..2db4dcfd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -372,7 +372,7 @@ if test "x$enable_gphoto2" != "xno" -a \( "x$msg_hal" = "xyes" -o "x$msg_gudev"
# Need OS tweaks in hal volume monitor backend
case "$host" in
- *-linux*)
+ *-linux* | *-freebsd* | *-kfreebsd*-gnu)
use_gphoto2=yes
;;
*)
diff --git a/monitor/gphoto2/ggphoto2volumemonitor.c b/monitor/gphoto2/ggphoto2volumemonitor.c
index a9f91227..8b870747 100644
--- a/monitor/gphoto2/ggphoto2volumemonitor.c
+++ b/monitor/gphoto2/ggphoto2volumemonitor.c
@@ -763,7 +763,13 @@ update_cameras (GGPhoto2VolumeMonitor *monitor,
continue;
usb_bus_num = hal_device_get_property_int (d, "usb.bus_number");
+#if defined(__linux__)
usb_device_num = hal_device_get_property_int (d, "usb.linux.device_number");
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ usb_device_num = hal_device_get_property_int (d, "freebsd.unit");
+#else
+# error "Need OS specific tweaks"
+#endif
store_heads = get_stores_for_camera (usb_bus_num, usb_device_num);
num_store_heads = g_list_length (store_heads);