diff -r c2f4c0285180 -r 218904410231 configure.ac --- a/configure.ac Tue Jan 24 23:54:05 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. ##################################################