configure.ac
changeset 4 218904410231
parent 0 c2f4c0285180
child 5 f600b0d1fc5d
     1.1 --- a/configure.ac	Tue Jan 24 23:54:05 2012 +0000
     1.2 +++ b/configure.ac	Fri Jan 27 00:28:11 2012 +0000
     1.3 @@ -79,6 +79,34 @@
     1.4  # this pre-processor define only affects the behaviour of
     1.5  # libraries which use glib and we don't have any.
     1.6  
     1.7 +# Glib 2.30 (at least) doesn't include "-framework Carbon" in Libs.private
     1.8 +# which causes link to fail for static glib on Mac (gnome bug #668152).
     1.9 +# Test for this problem and implement a workaround.
    1.10 +AC_MSG_CHECKING([for Mac OS X Carbon support])
    1.11 +AC_TRY_CPP([
    1.12 +#include <Carbon/Carbon.h>
    1.13 +#include <CoreServices/CoreServices.h>
    1.14 +],[have_carbon=yes],[have_carbon=no])
    1.15 +AC_MSG_RESULT([$have_carbon])
    1.16 +AS_IF([test "$have_glib" != no -a "$have_carbon" = yes],[
    1.17 +  AC_MSG_CHECKING([whether -framework Carbon is needed])
    1.18 +  save_CFLAGS="$CFLAGS"
    1.19 +  save_LIBS="$LIBS"
    1.20 +  CFLAGS="$GLIB_CFLAGS"
    1.21 +  LIBS="$GLIB_LIBS"
    1.22 +  AC_TRY_LINK([
    1.23 +  #include <glib.h>
    1.24 +  ],[
    1.25 +  return !g_get_user_special_dir(G_USER_DIRECTORY_DESKTOP);
    1.26 +  ],[framework_carbon=no],[framework_carbon=yes])
    1.27 +  CFLAGS="$save_CFLAGS"
    1.28 +  LIBS="$save_LIBS"
    1.29 +  AC_MSG_RESULT([$framework_carbon])
    1.30 +  AS_IF([test "$framework_carbon" = yes],[
    1.31 +    GLIB_LIBS="$GLIB_LIBS -framework Carbon"
    1.32 +  ])
    1.33 +])
    1.34 +
    1.35  ##################################################
    1.36  # Checks for library functions.
    1.37  ##################################################