Be more precise about Carbon v. Cocoa.

This commit is contained in:
William Hua 2012-04-11 23:25:09 -04:00
parent ebe30ef463
commit 69d929e67f
4 changed files with 18 additions and 7 deletions

View File

@ -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 <Foundation/Foundation.h>
], 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])

View File

@ -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

View File

@ -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

View File

@ -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