From: caro Date: Sun, 11 Jan 2009 09:25:47 +0000 (+0000) Subject: mac os x port of gcc has problems with __attribute__ and thinks that X-Git-Tag: 2.0_alpha~70^2~1056 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84e4822029ab4a4929486eb7936241c442cb61d0;p=framework%2Fuifw%2Feina.git mac os x port of gcc has problems with __attribute__ and thinks that there are nested functions. -fnested-functions must be passed to the compiler to allow the compilation on that platform. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@38544 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/configure.ac b/configure.ac index 04c9da0..2f9d806 100644 --- a/configure.ac +++ b/configure.ac @@ -273,6 +273,9 @@ case "${host_os}" in mingw*) EINA_CFLAGS="${EINA_CFLAGS} ${EVIL_CFLAGS}" ;; + darwin*) + EINA_CFLAGS="${EINA_CFLAGS} -fnested-functions" + ;; esac if test "x$enable_coverage" = "xyes" ; then diff --git a/m4/ac_attribute.m4 b/m4/ac_attribute.m4 index 34bb4db..053ea55 100644 --- a/m4/ac_attribute.m4 +++ b/m4/ac_attribute.m4 @@ -17,6 +17,14 @@ AC_DEFUN([AC_C___ATTRIBUTE__], AC_MSG_CHECKING([for __attribute__]) +dnl On mac os x, error of compilation without -fnested-functions +case "${host_os}" in + darwin*) + CFLAGS_SAVE=${CFLAGS} + CFLAGS="${CFLAGS} -fnested-functions" + ;; +esac + AC_CACHE_VAL([ac_cv___attribute__], [AC_TRY_COMPILE( [ @@ -34,6 +42,12 @@ int foo(int x __attribute__ ((unused))) )] ) +case "${host_os}" in + darwin*) + CFLAGS=${CFLAGS_SAVE} + ;; +esac + AC_MSG_RESULT($ac_cv___attribute__) if test "x${ac_cv___attribute__}" = "xyes" ; then