diff --git a/legacy/eina/configure.ac b/legacy/eina/configure.ac index 04c9da0fba..2f9d8063eb 100644 --- a/legacy/eina/configure.ac +++ b/legacy/eina/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/legacy/eina/m4/ac_attribute.m4 b/legacy/eina/m4/ac_attribute.m4 index 34bb4dbf2f..053ea55008 100644 --- a/legacy/eina/m4/ac_attribute.m4 +++ b/legacy/eina/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