Ecore: detect Cocoa options only if we want ecore-cocoa.

Build can fail if Cocoa options are passed and gnustep-gui has been installed

Nicolas: can you please test on your Mac OS X ?


SVN revision: 65031
This commit is contained in:
Vincent Torri 2011-11-10 18:18:39 +00:00
parent d103ed2551
commit 73b4db74b0
1 changed files with 27 additions and 25 deletions

View File

@ -385,7 +385,6 @@ m4_ifdef([AC_PROG_OBJC],
]) ])
m4_ifndef([am__fastdepOBJC], [ m4_ifndef([am__fastdepOBJC], [
AM_CONDITIONAL([am__fastdepOBJC], [false]) AM_CONDITIONAL([am__fastdepOBJC], [false])
AC_SUBST([cocoa_ldflags])
]) ])
AC_PROG_CXX AC_PROG_CXX
@ -1204,19 +1203,21 @@ AC_CHECK_HEADER([linux/fb.h],
# Cocoa header files (ecore_cocoa) # Cocoa header files (ecore_cocoa)
cocoa_ldflags="" if test "x${want_ecore_cocoa}" = "xyes" ; then
have_cocoa="no" cocoa_ldflags=""
m4_ifdef([AC_PROG_OBJC], [ have_cocoa="no"
if test "x${have_gnu_objc}" = "xyes" ; then m4_ifdef([AC_PROG_OBJC],
AC_LANG_PUSH([Objective C]) [
LIBS_save="$LIBS" if test "x${have_gnu_objc}" = "xyes" ; then
LIBS="$LIBS -framework Cocoa" AC_LANG_PUSH([Objective C])
AC_LINK_IFELSE( LIBS_save="$LIBS"
[AC_LANG_PROGRAM( LIBS="$LIBS -framework Cocoa"
[[ AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <Cocoa/Cocoa.h> #include <Cocoa/Cocoa.h>
]], ]],
[[ [[
NSWindow *window; NSWindow *window;
window = [[NSWindow alloc] window = [[NSWindow alloc]
initWithContentRect:NSMakeRect(0, 0, 1, 1) initWithContentRect:NSMakeRect(0, 0, 1, 1)
@ -1225,18 +1226,19 @@ window = [[NSWindow alloc]
defer:NO defer:NO
screen:nil screen:nil
]; ];
]])], ]])],
[ [
have_cocoa="yes" have_cocoa="yes"
cocoa_ldflags="-framework Cocoa" cocoa_ldflags="-framework Cocoa"
], ],
[have_cocoa="no"]) [have_cocoa="no"])
LIBS="$LIBS_save" LIBS="$LIBS_save"
AC_MSG_CHECKING([whether Cocoa framework is supported]) AC_MSG_CHECKING([whether Cocoa framework is supported])
AC_MSG_RESULT([${have_cocoa}]) AC_MSG_RESULT([${have_cocoa}])
AC_LANG_POP([Objective C]) AC_LANG_POP([Objective C])
fi fi
]) ])
fi
AC_SUBST(cocoa_ldflags) AC_SUBST(cocoa_ldflags)
want_epoll=yes want_epoll=yes