diff --git a/configure.ac b/configure.ac index cf24f39f1..5e0cf62f0 100644 --- a/configure.ac +++ b/configure.ac @@ -175,11 +175,20 @@ AC_TRY_CPP([ AC_MSG_RESULT([$glib_have_carbon]) +glib_have_cocoa=no +AC_MSG_CHECKING([for Mac OS X Cocoa support]) +AC_TRY_CPP([ +#include +], glib_have_cocoa=yes) + +AC_MSG_RESULT([$glib_have_cocoa]) + AM_CONDITIONAL(OS_WIN32, [test "$glib_native_win32" = "yes"]) AM_CONDITIONAL(OS_WIN32_X64, [test "$LIB_EXE_MACHINE_FLAG" = "X64"]) AM_CONDITIONAL(OS_UNIX, [test "$glib_native_win32" != "yes"]) AM_CONDITIONAL(OS_LINUX, [test "$glib_os_linux" = "yes"]) AM_CONDITIONAL(OS_CARBON, [test "$glib_have_carbon" = "yes"]) +AM_CONDITIONAL(OS_COCOA, [test "$glib_have_cocoa" = "yes"]) if test "$glib_native_win32" = "yes"; then AC_CHECK_TOOL(WINDRES, windres, no) @@ -210,6 +219,11 @@ if test "x$glib_have_carbon" = "xyes"; then LDFLAGS="$LDFLAGS -framework Carbon" fi +if test "x$glib_have_cocoa" = "xyes"; then + AC_DEFINE(HAVE_COCOA, 1, [define to 1 if Cocoa is available]) + LDFLAGS="$LDFLAGS -framework Foundation" +fi + gl_GLIBC21 if test "x$GLIBC21" = "xyes"; then AC_DEFINE([_GNU_SOURCE], 1, [Make all glibc extensions visible]) diff --git a/gio/Makefile.am b/gio/Makefile.am index 106a18335..b0ae4de97 100644 --- a/gio/Makefile.am +++ b/gio/Makefile.am @@ -124,9 +124,7 @@ settings_sources += \ gregistrysettingsbackend.c endif -if OS_CARBON -AM_CPPFLAGS += -DG_OS_CARBON - +if OS_COCOA settings_sources += \ gnextstepsettingsbackend.c endif @@ -488,8 +486,7 @@ libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -export-dynamic $(no_undefined) $(export_symbols) -# This condition is misnamed. It's really checking for Cocoa, not Carbon -if OS_CARBON +if OS_COCOA # This is dumb. The ObjC source file should be properly named .m libgio_2_0_la_CFLAGS = -xobjective-c libgio_2_0_la_LDFLAGS += -framework Foundation diff --git a/gio/giomodule.c b/gio/giomodule.c index 4afdeddf9..480f2f0e8 100644 --- a/gio/giomodule.c +++ b/gio/giomodule.c @@ -918,7 +918,7 @@ _g_io_modules_ensure_loaded (void) g_win32_directory_monitor_get_type (); g_registry_backend_get_type (); #endif -#ifdef G_OS_CARBON +#ifdef HAVE_CARBON g_nextstep_settings_backend_get_type (); #endif #ifdef G_OS_UNIX diff --git a/gio/gsettingsbackendinternal.h b/gio/gsettingsbackendinternal.h index 5837dcc02..368c54b61 100644 --- a/gio/gsettingsbackendinternal.h +++ b/gio/gsettingsbackendinternal.h @@ -100,7 +100,7 @@ GType g_null_settings_backend_get_type (void); G_GNUC_INTERNAL GType g_memory_settings_backend_get_type (void); -#ifdef G_OS_CARBON +#ifdef HAVE_COCOA G_GNUC_INTERNAL GType g_nextstep_settings_backend_get_type (void); #endif