mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
Enable building gcocoanotification only if OS X min version >= 10.9
This changes the configure checks to check for what is actually required to build this code. https://bugzilla.gnome.org/show_bug.cgi?id=747146
This commit is contained in:
parent
0c6c39428c
commit
d1a03bc728
19
configure.ac
19
configure.ac
@ -223,22 +223,19 @@ AS_IF([test "x$glib_have_carbon" = "xyes"], [
|
|||||||
], [CARBON_LIBS=""])
|
], [CARBON_LIBS=""])
|
||||||
|
|
||||||
AC_SUBST([CARBON_LIBS])
|
AC_SUBST([CARBON_LIBS])
|
||||||
|
ac_cv_have_os_x_9_or_later="no"
|
||||||
AS_IF([test "x$glib_have_cocoa" = "xyes"], [
|
AS_IF([test "x$glib_have_cocoa" = "xyes"], [
|
||||||
AC_DEFINE(HAVE_COCOA, 1, [define to 1 if Cocoa is available])
|
AC_DEFINE(HAVE_COCOA, 1, [define to 1 if Cocoa is available])
|
||||||
COCOA_LIBS="-Wl,-framework,Foundation"
|
COCOA_LIBS="-Wl,-framework,Foundation"
|
||||||
LDFLAGS="$LDFLAGS $COCOA_LIBS"
|
LDFLAGS="$LDFLAGS $COCOA_LIBS"
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
osx_version=`sw_vers -productVersion`
|
#include <AvailabilityMacros.h>
|
||||||
osx_min_version="10.9.0"
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
|
||||||
AC_MSG_CHECKING([OSX version >= $osx_min_version])
|
#error Compiling for minimum OS X version before 10.9
|
||||||
AS_VERSION_COMPARE([$osx_version], [$osx_min_version], [
|
#endif
|
||||||
AC_MSG_RESULT([no])
|
]])],[ac_cv_have_os_x_9_or_later="yes"])
|
||||||
AC_MSG_ERROR([OSX version is too old!])
|
|
||||||
])
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
], [COCOA_LIBS=""])
|
], [COCOA_LIBS=""])
|
||||||
|
AM_CONDITIONAL([MAC_OS_X_9], [test "x$ac_cv_have_os_x_9_or_later" = xyes])
|
||||||
AC_SUBST([COCOA_LIBS])
|
AC_SUBST([COCOA_LIBS])
|
||||||
|
|
||||||
dnl declare --enable-* args and collect ac_help strings
|
dnl declare --enable-* args and collect ac_help strings
|
||||||
|
@ -281,8 +281,10 @@ unix_sources = \
|
|||||||
appinfo_sources += $(unix_appinfo_sources)
|
appinfo_sources += $(unix_appinfo_sources)
|
||||||
|
|
||||||
if OS_COCOA
|
if OS_COCOA
|
||||||
|
if MAC_OS_X_9
|
||||||
unix_sources += gcocoanotificationbackend.c
|
unix_sources += gcocoanotificationbackend.c
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
giounixincludedir=$(includedir)/gio-unix-2.0/gio
|
giounixincludedir=$(includedir)/gio-unix-2.0/gio
|
||||||
giounixinclude_HEADERS = \
|
giounixinclude_HEADERS = \
|
||||||
|
@ -47,6 +47,10 @@
|
|||||||
#include "gdesktopappinfo.h"
|
#include "gdesktopappinfo.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_COCOA
|
||||||
|
#include <AvailabilityMacros.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:giomodule
|
* SECTION:giomodule
|
||||||
* @short_description: Loadable GIO Modules
|
* @short_description: Loadable GIO Modules
|
||||||
@ -918,7 +922,7 @@ extern GType g_proxy_resolver_portal_get_type (void);
|
|||||||
extern GType g_network_monitor_portal_get_type (void);
|
extern GType g_network_monitor_portal_get_type (void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_COCOA
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
|
||||||
extern GType g_cocoa_notification_backend_get_type (void);
|
extern GType g_cocoa_notification_backend_get_type (void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1121,7 +1125,7 @@ _g_io_modules_ensure_loaded (void)
|
|||||||
g_type_ensure (g_network_monitor_portal_get_type ());
|
g_type_ensure (g_network_monitor_portal_get_type ());
|
||||||
g_type_ensure (g_proxy_resolver_portal_get_type ());
|
g_type_ensure (g_proxy_resolver_portal_get_type ());
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_COCOA
|
#ifdef HAVE_MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
|
||||||
g_type_ensure (g_cocoa_notification_backend_get_type ());
|
g_type_ensure (g_cocoa_notification_backend_get_type ());
|
||||||
#endif
|
#endif
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
|
Loading…
Reference in New Issue
Block a user