patch-configure_ac 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. --- glib-2.48.0.orig/configure.ac 2016-03-22 16:16:50.000000000 +0100
  2. +++ glib-2.48.0/configure.ac 2016-04-07 21:29:21.000000000 +0200
  3. @@ -172,32 +172,10 @@ AC_MSG_RESULT([$glib_native_android])
  4. AC_SUBST(LIB_EXE_MACHINE_FLAG)
  5. -glib_have_carbon=no
  6. -AC_MSG_CHECKING([for Mac OS X Carbon support])
  7. -AC_TRY_CPP([
  8. -#include <Carbon/Carbon.h>
  9. -#include <CoreServices/CoreServices.h>
  10. -], glib_have_carbon=yes)
  11. -
  12. -AC_MSG_RESULT([$glib_have_carbon])
  13. -
  14. -glib_have_cocoa=no
  15. -AC_MSG_CHECKING([for Mac OS X Cocoa support])
  16. -AC_TRY_CPP([
  17. -#include <Cocoa/Cocoa.h>
  18. -#ifdef GNUSTEP_BASE_VERSION
  19. -#error "Detected GNUstep, not Cocoa"
  20. -#endif
  21. -], glib_have_cocoa=yes)
  22. -
  23. -AC_MSG_RESULT([$glib_have_cocoa])
  24. -
  25. AM_CONDITIONAL(OS_WIN32, [test "$glib_native_win32" = "yes"])
  26. AM_CONDITIONAL(OS_WIN32_X64, [test "$LIB_EXE_MACHINE_FLAG" = "X64"])
  27. AM_CONDITIONAL(OS_UNIX, [test "$glib_native_win32" != "yes"])
  28. AM_CONDITIONAL(OS_LINUX, [test "$glib_os_linux" = "yes"])
  29. -AM_CONDITIONAL(OS_CARBON, [test "$glib_have_carbon" = "yes"])
  30. -AM_CONDITIONAL(OS_COCOA, [test "$glib_have_cocoa" = "yes"])
  31. AS_IF([test "$glib_native_win32" = "yes"], [
  32. AC_CHECK_TOOL(WINDRES, windres, no)
  33. @@ -214,19 +192,58 @@ AS_IF([test "$glib_native_win32" = "yes"
  34. ])
  35. AM_CONDITIONAL(MS_LIB_AVAILABLE, [test x$ms_librarian = xyes])
  36. -AS_IF([test "x$glib_have_carbon" = "xyes"], [
  37. +AC_ARG_ENABLE(carbon,
  38. + [AC_HELP_STRING([--disable-carbon],
  39. + [disable Max OS X Carbon support])],,
  40. + [enable_carbon=yes])
  41. +
  42. +glib_have_carbon=no
  43. +if test "x${enable_carbon}" = "xyes"; then
  44. + AC_MSG_RESULT([yes])
  45. + AC_MSG_CHECKING([for Mac OS X Carbon support])
  46. + AC_TRY_CPP([
  47. +#include <Carbon/Carbon.h>
  48. +#include <CoreServices/CoreServices.h>
  49. + ], glib_have_carbon=yes)
  50. + AC_MSG_RESULT([$glib_have_carbon])
  51. +else
  52. + AC_MSG_RESULT([no])
  53. +fi
  54. +AM_CONDITIONAL(OS_CARBON, [test "$glib_have_carbon" = "yes"])
  55. +
  56. +if test "x$glib_have_carbon" = "xyes"; then
  57. AC_DEFINE(HAVE_CARBON, 1, [define to 1 if Carbon is available])
  58. CARBON_LIBS="-Wl,-framework,Carbon"
  59. LDFLAGS="$LDFLAGS $CARBON_LIBS"
  60. -], [CARBON_LIBS=""])
  61. -
  62. +fi
  63. AC_SUBST([CARBON_LIBS])
  64. -AS_IF([test "x$glib_have_cocoa" = "xyes"], [
  65. +dnl Check cocoa
  66. +AC_ARG_ENABLE(cocoa,
  67. + [AC_HELP_STRING([--disable-cocoa],
  68. + [disable Max OS X Cocoa support])],,
  69. + [enable_cocoa=yes])
  70. +
  71. +glib_have_cocoa=no
  72. +if test "x${enable_cocoa}" = "xyes"; then
  73. + AC_MSG_RESULT([yes])
  74. + AC_MSG_CHECKING([for Mac OS X Carbon support])
  75. + AC_TRY_CPP([
  76. +#include <Cocoa/Cocoa.h>
  77. +#ifdef GNUSTEP_BASE_VERSION
  78. +#error "Detected GNUstep, not Cocoa"
  79. +#endif
  80. + ], glib_have_cocoa=yes)
  81. + AC_MSG_RESULT([$glib_have_cocoa])
  82. +else
  83. + AC_MSG_RESULT([no])
  84. +fi
  85. +AM_CONDITIONAL(OS_COCOA, [test "$glib_have_cocoa" = "yes"])
  86. +
  87. +if test "x$glib_have_cocoa" = "xyes"; then
  88. AC_DEFINE(HAVE_COCOA, 1, [define to 1 if Cocoa is available])
  89. COCOA_LIBS="-Wl,-framework,Foundation"
  90. LDFLAGS="$LDFLAGS $COCOA_LIBS"
  91. -
  92. osx_version=`sw_vers -productVersion`
  93. osx_min_version="10.9.0"
  94. AC_MSG_CHECKING([OSX version >= $osx_min_version])
  95. @@ -235,7 +252,7 @@ AS_IF([test "x$glib_have_cocoa" = "xyes"
  96. AC_MSG_ERROR([OSX version is too old!])
  97. ])
  98. AC_MSG_RESULT([yes])
  99. -], [COCOA_LIBS=""])
  100. +fi
  101. AC_SUBST([COCOA_LIBS])