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