From 8d3cd7339d88495948195fb1fd706ce3cf36409e Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Wed, 2 Nov 2011 18:16:23 +0000 Subject: [PATCH] Ecore: fix Cocoa stuff detection on FreeBSD and Mac OS X, clean up ipv6 detection SVN revision: 64652 --- legacy/ecore/configure.ac | 76 +++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 26 deletions(-) diff --git a/legacy/ecore/configure.ac b/legacy/ecore/configure.ac index 3127d1d875..aefabb36f6 100644 --- a/legacy/ecore/configure.ac +++ b/legacy/ecore/configure.ac @@ -1157,16 +1157,36 @@ AC_CHECK_HEADER([linux/fb.h], # Cocoa header files (ecore_cocoa) -cocoa_ldflags=""; +cocoa_ldflags="" have_cocoa="no" m4_ifdef([AC_PROG_OBJC], [ if test "x${have_gnu_objc}" = "xyes" ; then AC_LANG_PUSH([Objective C]) - AC_CHECK_HEADER([Cocoa/Cocoa.h], + 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) + styleMask:(NSTitledWindowMask) + backing:NSBackingStoreBuffered + 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 ]) @@ -1330,32 +1350,36 @@ have_curl="no" have_gnutls="no" have_openssl="no" have_cares="no" +want_ipv6="yes" +have_ipv6="no" + +AC_ARG_ENABLE([ipv6], + [AC_HELP_STRING([--disable-ipv6], + [disable ipv6 functionality @<:@default=detect@:>@])], + [ + if test "x${enableval}" = "xyes" ; then + want_ipv6="yes" + else + want_ipv6="no" + fi], + [want_ipv6="auto"]) + if test "x${have_ecore_con}" = "xyes" ; then # Verify IPV6 availability in headers - want_ipv6="yes" - have_ipv6="no" - AC_ARG_ENABLE([ipv6], - [AC_HELP_STRING([--disable-ipv6], - [disable ipv6 functionality @<:@default=detect@:>@])], - [ - if test "x${enableval}" = "xyes" ; then - want_ipv6="yes" - else - want_ipv6="no" - fi], - [want_ipv6=auto]) - if test "x${want_ipv6}" != "xno" ; then - AC_CHECK_TYPES([struct ipv6_mreq], [have_ipv6="yes"], [have_ipv6="no"], - [[ - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_WS2TCPIP_H - # include - #endif - ]]) - fi + if test "x${want_ipv6}" != "xno" ; then + AC_CHECK_TYPES([struct ipv6_mreq], + [have_ipv6="yes"], + [have_ipv6="no"], + [[ +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_WS2TCPIP_H +# include +#endif + ]]) + fi if test "x${have_ipv6}" = "xyes" ; then AC_DEFINE(HAVE_IPV6, 1, [Define if IPV6 is supported])