]> granicus.if.org Git - handbrake/commitdiff
Portability patches
authorjstebbins <jstebbins.hb@gmail.com>
Thu, 7 Jun 2012 23:18:40 +0000 (23:18 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Thu, 7 Jun 2012 23:18:40 +0000 (23:18 +0000)
gudev is only available on linux, so ifdef it out on all other systems.
also add some definitions to the make system for generic gnu and freebsd
systems.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4717 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/configure.ac
gtk/src/callbacks.c
libhb/ports.h
make/include/main.defs

index d2db300c4b1cdf93f872b4641c597db9dcb1ff37..94219c32d3406d10f2c68e1331e5348a999e93da 100644 (file)
@@ -94,10 +94,15 @@ case $host in
        mingw_flag=yes
     ;;
   *)
+    case "$host_os" in
+       linux*)
+         pkg_gudev="gudev-1.0"
+         ;;
+    esac
     if test "x$gst_disable" = "xyes" ; then
-           GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gio-2.0 libnotify dbus-glib-1 gudev-1.0"
+           GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gio-2.0 libnotify dbus-glib-1 $pkg_gudev"
     else
-           GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 libnotify dbus-glib-1 gudev-1.0"
+           GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 libnotify dbus-glib-1 $pkg_gudev"
     fi
        mingw_flag=no
     ;;
index 5173a6b299b2fda79f42ffdff35da1637a0be3b9..228375f33a983e3a2aceae2320f356978b61a567 100644 (file)
@@ -28,7 +28,9 @@
 #if !defined(_WIN32)
 #include <poll.h>
 #define G_UDEV_API_IS_SUBJECT_TO_CHANGE 1
+#if defined(__linux__)
 #include <gudev/gudev.h>
+#endif
 #include <dbus/dbus-glib.h>
 #include <dbus/dbus-glib-lowlevel.h>
 
@@ -49,6 +51,9 @@
 #endif
 
 #include <gdk/gdkx.h>
+#ifndef NOTIFY_CHECK_VERSION
+#define NOTIFY_CHECK_VERSION(x,y,z) 0
+#endif
 #else
 #define WINVER 0x0500
 #include <winsock2.h>
@@ -3942,14 +3947,14 @@ dvd_device_list()
        return dvd_devices;
 }
 
-#if !defined(_WIN32)
+#if defined(__linux__)
 static GUdevClient *udev_ctx = NULL;
 #endif
 
 gboolean
 ghb_is_cd(GDrive *gd)
 {
-#if !defined(_WIN32)
+#if defined(__linux__)
        gchar *device;
        GUdevDevice *udd;
 
@@ -3983,7 +3988,7 @@ ghb_is_cd(GDrive *gd)
 void
 ghb_udev_init()
 {
-#if !defined(_WIN32)
+#if defined(__linux__)
        udev_ctx = g_udev_client_new(NULL);
 #endif
 }
index c1cadf78513cac6f53978188237743ba7c783ae1..14800bfe5d60557d7e77a9c6eef73a7d58806a80 100644 (file)
@@ -51,7 +51,7 @@ typedef struct hb_thread_s hb_thread_t;
 #elif defined( SYS_DARWIN )
 #  define HB_LOW_PRIORITY    0
 #  define HB_NORMAL_PRIORITY 31
-#elif defined( SYS_LINUX ) || defined( SYS_FREEBSD ) || defined ( SYS_SunOS )
+#elif defined( SYS_LINUX ) || defined( SYS_FREEBSD ) || defined ( SYS_SunOS ) || defined ( __FreeBSD_kernel__ )
 #  define HB_LOW_PRIORITY    0
 #  define HB_NORMAL_PRIORITY 0
 #elif defined( SYS_CYGWIN )
index e68f679f7e1d66a4caa7e48c0f058beb99545eda..a210ececfa973d73c83af0e95bd5f5bf1e916325 100644 (file)
@@ -83,6 +83,11 @@ ifeq (1-linux,$(FEATURE.gtk)-$(BUILD.system))
     MODULES += gtk
 endif
 
+ifeq (1-gnu,$(FEATURE.gtk)-$(BUILD.system))
+    ## build gtk when gtk+gnu
+    MODULES += gtk
+endif
+
 ifeq (1,$(FEATURE.local_yasm))
     MODULES += contrib/yasm
 endif