# HG changeset patch # User ali # Date 1327624091 0 # Node ID 2189044102317a21cbf66282ac1f92068d4e7989 # Parent ec364358631b7bdde14caa0ae27db4503d0c3a67 Add workaround for missing -framework Carbon diff -r ec364358631b -r 218904410231 configure.ac --- a/configure.ac Thu Jan 26 23:35:52 2012 +0000 +++ b/configure.ac Fri Jan 27 00:28:11 2012 +0000 @@ -79,6 +79,34 @@ # this pre-processor define only affects the behaviour of # libraries which use glib and we don't have any. +# Glib 2.30 (at least) doesn't include "-framework Carbon" in Libs.private +# which causes link to fail for static glib on Mac (gnome bug #668152). +# Test for this problem and implement a workaround. +AC_MSG_CHECKING([for Mac OS X Carbon support]) +AC_TRY_CPP([ +#include +#include +],[have_carbon=yes],[have_carbon=no]) +AC_MSG_RESULT([$have_carbon]) +AS_IF([test "$have_glib" != no -a "$have_carbon" = yes],[ + AC_MSG_CHECKING([whether -framework Carbon is needed]) + save_CFLAGS="$CFLAGS" + save_LIBS="$LIBS" + CFLAGS="$GLIB_CFLAGS" + LIBS="$GLIB_LIBS" + AC_TRY_LINK([ + #include + ],[ + return !g_get_user_special_dir(G_USER_DIRECTORY_DESKTOP); + ],[framework_carbon=no],[framework_carbon=yes]) + CFLAGS="$save_CFLAGS" + LIBS="$save_LIBS" + AC_MSG_RESULT([$framework_carbon]) + AS_IF([test "$framework_carbon" = yes],[ + GLIB_LIBS="$GLIB_LIBS -framework Carbon" + ]) +]) + ################################################## # Checks for library functions. ##################################################