1 --- ./src/cheese-webcam.c.ori 2008-08-19 02:32:53.000000000 +0800 2 +++ ./src/cheese-webcam.c 2008-09-01 17:05:27.001865000 +0800 3 @@ -241,6 +241,10 @@ 4 * refers to a fake device so that resolution changing still 5 * works even if the computer doesn't have a webcam. */ 6 char **udis; 7 +#ifdef SOLARIS 8 + char *dev_name; 9 + struct stat s; 10 +#endif 11 DBusError error; 12 LibHalContext *hal_ctx; 13 14 @@ -287,6 +291,19 @@ 15 if (num_udis > 0) 16 priv->num_webcam_devices = num_devices = num_udis; 17 else 18 +#ifdef SOLARIS 19 + for (i = 0;;i++) 20 + { 21 + dev_name = g_strdup_printf("%s%d", "/dev/video", i); 22 + if (lstat(dev_name, &s) != 0) 23 + break; 24 + else 25 + priv->num_webcam_devices = num_devices = num_udis = 1; 26 + } 27 + if (num_udis >= 1 && i > 0) 28 + dev_name = g_strdup_printf("%s%d", "/dev/video", --i); 29 + else 30 +#endif 31 { 32 num_devices = 1; 33 priv->num_webcam_devices = num_udis; /* We don't have any real cameras-- 34 @@ -304,6 +321,7 @@ 35 36 for (i = 0; i < priv->num_webcam_devices; i++) 37 { 38 +#ifndef SOLARIS 39 char *device; 40 41 device = libhal_device_get_property_string (hal_ctx, udis[i], "video4linux.device", &error); 42 @@ -315,8 +333,14 @@ 43 } 44 priv->webcam_devices[i].video_device = g_strdup (device); 45 libhal_free_string (device); 46 +#else 47 + priv->webcam_devices[i].video_device = g_strdup (dev_name); 48 +#endif 49 } 50 libhal_free_string_array (udis); 51 +#ifdef SOLARIS 52 + libhal_free_string(dev_name); 53 +#endif 54 } 55 56 static void 57 --- ./configure.ac.ori 2008-09-01 17:01:24.368827000 +0800 58 +++ ./configure.ac 2008-09-01 17:04:02.005457000 +0800 59 @@ -15,7 +15,7 @@ 60 AC_HEADER_STDC 61 AM_PROG_LIBTOOL 62 63 -CFLAGS="${CFLAGS} -Wall" 64 +CFLAGS="${CFLAGS} -DSOLARIS" 65 66 GNOME_MAINTAINER_MODE_DEFINES 67 GNOME_COMPILE_WARNINGS 68 @@ -66,7 +66,7 @@ 69 GNOME_VFS_REQUIRED=2.18.0 70 LIBEBOOK_REQUIRED=1.12.0 71 DBUS_REQUIRED=1.0 72 -HAL_REQUIRED=0.5.9 73 +HAL_REQUIRED=0.5.8 74 DBUS_GLIB_REQUIRED=0.7 75 LIBRSVG_REQUIRED=2.18.0 76 PANGOCAIRO_REQUIRED=1.18.0 77