Build fails on macos 10.14.3
Building v0.36 source fails when compiling vncdisplaykeymap.c
on macos 10.14.3 -- can be fixed by adding -ObjC
to CFLAGS
in configure.ac
.
Reference: https://www.mail-archive.com/spice-devel@lists.freedesktop.org/msg40085.html
Error observed:
In file included from vncdisplaykeymap.c:95:
In file included from /usr/local/Cellar/gtk+3/3.24.5/include/gtk-3.0/gdk/gdkquartz.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:512:1: error: expected identifier or '('
@class NSString, Protocol;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:514:9: error: unknown type name 'NSString'; did you mean 'GString'?
typedef NSString * NSExceptionName NS_EXTENSIBLE_STRING_ENUM;
^
/usr/local/Cellar/glib/2.58.3/include/glib-2.0/glib/gstring.h:39:33: note: 'GString' declared here
typedef struct _GString GString;
^
Patch applied (extra changes to spice-deps.m4
added so I could run autoreconf
with autoconf
>= 2.63):
diff --git a/configure.ac b/configure.ac
index 2f63422..8e90314 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,6 +63,7 @@ AC_MSG_CHECKING([for native macOS])
case "$host_os" in
*darwin*)
os_mac=yes
+ CFLAGS="${CFLAGS} -ObjC"
;;
*)
os_mac=no
diff --git a/subprojects/spice-common/m4/spice-deps.m4 b/subprojects/spice-common/m4/spice-deps.m4
index 0281625..d6348b5 100644
--- a/subprojects/spice-common/m4/spice-deps.m4
+++ b/subprojects/spice-common/m4/spice-deps.m4
@@ -1,11 +1,3 @@
-# For autoconf < 2.63
-m4_ifndef([AS_VAR_APPEND],
- AC_DEFUN([AS_VAR_APPEND], $1=$$1$2))
-m4_ifndef([AS_VAR_COPY],
- [m4_define([AS_VAR_COPY],
- [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])])
-
-
# SPICE_WARNING(warning)
# SPICE_PRINT_MESSAGES
# ----------------------