autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: checking Mac OS X headers


From: Vincent Torri
Subject: Re: checking Mac OS X headers
Date: Mon, 14 Dec 2009 20:53:57 +0100 (CET)



On Mon, 14 Dec 2009, Ralf Wildenhues wrote:

* Vincent Torri wrote on Mon, Dec 14, 2009 at 10:54:24AM CET:

I can maybe execute that code if the host is darwin, but it is not
the standard way of checking features, iirc

that is, something like:

if test "x${ac_cv_objc_compiler_gnu}" = "xyes" ; then
   AC_LANG_PUSH([Objective C])
   AC_CHECK_HEADER([Cocoa/Cocoa.h],
      [
       have_quartz="yes"
       evas_engine_[]$1[]_libs="-framework Cocoa"
      ],
      [have_quartz="no"])
   AC_LANG_POP([Objective C])
fi

is good enough ?

That looks ok to me, at a glance.  I haven't tested it on Darwin though.

tried, and failed with the same error message :/ I don't know why. I used directly almost the same code in configure.ac (no m4 macro) in another lib and it works. So using the code in an m4 macro seems the problem.

In configure.ac:

[code]

want_evas_engine_quartz="no"
EVAS_CHECK_ENGINE([quartz], [${want_evas_engine_quartz}], [no], [Quartz])

[/code]

In a .m4 file, the macro EVAS_CHECK_ENGINE is defined as (i know that the m4 and shell code can be improved, but it's not my purpose right now) :

[code]

AC_DEFUN([EVAS_CHECK_ENGINE],
[

m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl

want_engine="$2"
want_static_engine="no"
have_engine="no"
have_evas_engine_[]DOWN="no"

AC_ARG_ENABLE([$1],
   [AC_HELP_STRING([--enable-$1], [enable $4 rendering backend])],
   [
    if test "x${enableval}" = "xyes" ; then
       want_engine="yes"
    else
       if test "x${enableval}" = "xstatic" ; then
          want_engine="static"
       else
          want_engine="no"
       fi
    fi
   ])

AC_MSG_CHECKING([whether to enable $4 rendering backend])
AC_MSG_RESULT([${want_engine}])

if test "x${want_engine}" = "xyes" -o "x${want_engine}" = "xstatic" -o "x${want_engine}" 
= "xauto" ; then
   m4_default([EVAS_CHECK_ENGINE_DEP_]m4_defn([UP]))(DOWN, $3, ${want_engine}, 
[have_engine="yes"], [have_engine="no"])
fi

if test "x${have_engine}" = "xno" -a "x${want_engine}" = "xyes" -a "x${use_strict}" = 
"xyes" ; then
   AC_MSG_ERROR([$4 dependencies not found (strict dependencies checking)])
fi

AC_MSG_CHECKING([whether $4 rendering backend will be built])
AC_MSG_RESULT([${have_engine}])

if test "x${have_engine}" = "xyes" ; then
   if test "x${want_engine}" = "xstatic" ; then
      have_evas_engine_[]DOWN="static"
      want_static_engine="yes"
   else
      have_evas_engine_[]DOWN="yes"
   fi
fi

if test "x${have_engine}" = "xyes" ; then
   AC_DEFINE(BUILD_ENGINE_[]UP, [1], [$4 rendering backend])
fi

AM_CONDITIONAL(BUILD_ENGINE_[]UP, [test "x${have_engine}" = "xyes"])

if test "x${want_static_engine}" = "xyes" ; then
   AC_DEFINE(EVAS_STATIC_BUILD_[]UP, [1], [Build $1 engine inside libevas])
   have_static_module="yes"
fi

AM_CONDITIONAL(EVAS_STATIC_BUILD_[]UP, [test "x${want_static_engine}" = "xyes"])

m4_popdef([UP])
m4_popdef([DOWN])

])

[/code]

So it calls the macro EVAS_CHECK_ENGINE_DEP_QUARTZ :

[code]

AC_DEFUN([EVAS_CHECK_ENGINE_DEP_QUARTZ],
[

have_dep="no"
evas_engine_[]$1[]_cflags=""
evas_engine_[]$1[]_libs=""

if test "x${ac_cv_objc_compiler_gnu}" = "xyes" ; then

   AC_LANG_PUSH([Objective C])

AC_CHECK_HEADERS([/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h],
      [
       have_dep="yes"
       evas_engine_[]$1[]_libs="-framework Cocoa"
      ],
      [have_dep="no"])
   AC_LANG_POP([Objective C])
fi

AC_SUBST([evas_engine_$1_cflags])
AC_SUBST([evas_engine_$1_libs])

if test "x${have_dep}" = "xyes" ; then
  m4_default([$4], [:])
else
  m4_default([$5], [:])
fi

])

[/code]

So even with the test, I have the error:

checking how to run the Objective C preprocessor... /lib/cpp
configure: error: in `/home/torri/svnroot/evas':
configure: error: Objective C preprocessor "/lib/cpp" fails sanity check

do you see the problem here ?

thank you

Vincent Torri




reply via email to

[Prev in Thread] Current Thread [Next in Thread]