From: caro Date: Thu, 10 Nov 2011 18:18:39 +0000 (+0000) Subject: Ecore: detect Cocoa options only if we want ecore-cocoa. X-Git-Tag: 2.0_alpha~122^2~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0389802c348502e2b8e4e842a069b87a8997a766;p=framework%2Fuifw%2Fecore.git 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 ? git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@65031 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/configure.ac b/configure.ac index 3721fb5..2cd9fe2 100644 --- a/configure.ac +++ b/configure.ac @@ -385,7 +385,6 @@ m4_ifdef([AC_PROG_OBJC], ]) m4_ifndef([am__fastdepOBJC], [ AM_CONDITIONAL([am__fastdepOBJC], [false]) - AC_SUBST([cocoa_ldflags]) ]) AC_PROG_CXX @@ -1204,19 +1203,21 @@ AC_CHECK_HEADER([linux/fb.h], # Cocoa header files (ecore_cocoa) -cocoa_ldflags="" -have_cocoa="no" -m4_ifdef([AC_PROG_OBJC], [ - if test "x${have_gnu_objc}" = "xyes" ; then - AC_LANG_PUSH([Objective C]) - LIBS_save="$LIBS" - LIBS="$LIBS -framework Cocoa" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[ +if test "x${want_ecore_cocoa}" = "xyes" ; then + cocoa_ldflags="" + have_cocoa="no" + m4_ifdef([AC_PROG_OBJC], + [ + if test "x${have_gnu_objc}" = "xyes" ; then + AC_LANG_PUSH([Objective C]) + LIBS_save="$LIBS" + LIBS="$LIBS -framework Cocoa" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ #include - ]], - [[ + ]], + [[ NSWindow *window; window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1) @@ -1225,18 +1226,19 @@ window = [[NSWindow alloc] defer:NO screen:nil ]; - ]])], - [ - have_cocoa="yes" - cocoa_ldflags="-framework Cocoa" - ], - [have_cocoa="no"]) - LIBS="$LIBS_save" - AC_MSG_CHECKING([whether Cocoa framework is supported]) - AC_MSG_RESULT([${have_cocoa}]) - AC_LANG_POP([Objective C]) - fi -]) + ]])], + [ + have_cocoa="yes" + cocoa_ldflags="-framework Cocoa" + ], + [have_cocoa="no"]) + LIBS="$LIBS_save" + AC_MSG_CHECKING([whether Cocoa framework is supported]) + AC_MSG_RESULT([${have_cocoa}]) + AC_LANG_POP([Objective C]) + fi + ]) +fi AC_SUBST(cocoa_ldflags) want_epoll=yes