checking Mac OS X headers

View: New views
7 Messages — Rating Filter:   Alert me  

checking Mac OS X headers

by Vincent Torri-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hey,

I would like to check if some Mac OS X headers are available. So I first
set the Objective C compiler with AC_LANG_PUSH, only if there is an
Objective C compiler:

# Check compilers

m4_ifdef([AC_PROG_OBJC],
    [
     AC_PROG_OBJC
     _AM_DEPENDENCIES(OBJC)
    ],
    [
     AC_CHECK_TOOL([OBJC], [gcc])
     AC_SUBST([OBJC])
     AC_SUBST([OBJCFLAGS])
    ]
)
AC_PROG_CXX
AC_PROG_CC

# check header

m4_ifdef([AC_PROG_OBJC], [AC_LANG_PUSH([Objective C])], [])
AC_CHECK_HEADERS([/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h],
    [have_dep="yes"],
    [have_dep="no"])
m4_ifdef([AC_PROG_OBJC], [AC_LANG_POP([Objective C])], [])

But the configure script fails:

configure: error: in `/home/torri/svnroot/evas':
configure: error: Objective C preprocessor "/lib/cpp" fails sanity check

I have looked at config.log but it does not help a lot.

Does someone see where I'm wrong ?

thank you

Vincent Torri


_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf

Re: checking Mac OS X headers

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Vincent,

* Vincent Torri wrote on Mon, Nov 09, 2009 at 07:45:32PM CET:

> I would like to check if some Mac OS X headers are available. So I
> first set the Objective C compiler with AC_LANG_PUSH, only if there
> is an Objective C compiler:
>
> # Check compilers
>
> m4_ifdef([AC_PROG_OBJC],
>    [
>     AC_PROG_OBJC
>     _AM_DEPENDENCIES(OBJC)

Is this to support Automake versions before 1.10?  Because with 1.10 or
newer, you should not need to add _AM_DEPENDENCIES(OBJC).

>    ],
>    [
>     AC_CHECK_TOOL([OBJC], [gcc])
>     AC_SUBST([OBJC])
>     AC_SUBST([OBJCFLAGS])
>    ]
> )
[...]
> But the configure script fails:
>
> configure: error: in `/home/torri/svnroot/evas':
> configure: error: Objective C preprocessor "/lib/cpp" fails sanity check
>
> I have looked at config.log but it does not help a lot.

Will you allow us to have a look at it?
(IOW, please post it.)

Thanks,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf

Re: checking Mac OS X headers

by Vincent Torri-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hey,

> * Vincent Torri wrote on Mon, Nov 09, 2009 at 07:45:32PM CET:
>> I would like to check if some Mac OS X headers are available. So I
>> first set the Objective C compiler with AC_LANG_PUSH, only if there
>> is an Objective C compiler:
>>
>> # Check compilers
>>
>> m4_ifdef([AC_PROG_OBJC],
>>    [
>>     AC_PROG_OBJC
>>     _AM_DEPENDENCIES(OBJC)
>
> Is this to support Automake versions before 1.10?  Because with 1.10 or
> newer, you should not need to add _AM_DEPENDENCIES(OBJC).
Exactly. It is you who gave me that tip, btw :)

>>    ],
>>    [
>>     AC_CHECK_TOOL([OBJC], [gcc])
>>     AC_SUBST([OBJC])
>>     AC_SUBST([OBJCFLAGS])
>>    ]
>> )
> [...]
>> But the configure script fails:
>>
>> configure: error: in `/home/torri/svnroot/evas':
>> configure: error: Objective C preprocessor "/lib/cpp" fails sanity check
>>
>> I have looked at config.log but it does not help a lot.
>
> Will you allow us to have a look at it?
> (IOW, please post it.)
I have attached it.

Vincent Torri

_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf

config.log.bz2 (15K) Download Attachment

Re: checking Mac OS X headers

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Vincent Torri wrote on Sat, Nov 14, 2009 at 05:21:00PM CET:
> >>m4_ifdef([AC_PROG_OBJC],
> >>   [
> >>    AC_PROG_OBJC
> >>    _AM_DEPENDENCIES(OBJC)
> >
> >Is this to support Automake versions before 1.10?  Because with 1.10 or
> >newer, you should not need to add _AM_DEPENDENCIES(OBJC).
>
> Exactly. It is you who gave me that tip, btw :)

That may well be.  I tend to forget issues that have been dealt with
(alas also quite a few that haven't been dealt with ...)

> >>configure: error: in `/home/torri/svnroot/evas':
> >>configure: error: Objective C preprocessor "/lib/cpp" fails sanity check
> >>
> >>I have looked at config.log but it does not help a lot.
> >
> >Will you allow us to have a look at it?
> >(IOW, please post it.)
>
> I have attached it.

Here's the clue:

> configure:11850: checking whether we are using the GNU Objective C compiler
> configure:11869: gcc -c   conftest.m >&5
> gcc: error trying to exec 'cc1obj': execvp: No such file or directory
> configure:11869: $? = 1

Your compiler doesn't speak Objective C.  Solution is to install the
respective frontend.

Cheers,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf

Re: checking Mac OS X headers

by Vincent Torri-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Sat, 14 Nov 2009, Ralf Wildenhues wrote:

> Here's the clue:
>
>> configure:11850: checking whether we are using the GNU Objective C compiler
>> configure:11869: gcc -c   conftest.m >&5
>> gcc: error trying to exec 'cc1obj': execvp: No such file or directory
>> configure:11869: $? = 1
>
> Your compiler doesn't speak Objective C.  Solution is to install the
> respective frontend.

i don't have it and i don't want to install it. I would like to check the
Mac OS X header only if an Objective C compiler is present, as i have to
use an objective c compiler (hance the AC_LANG_PUSH in the code). But it
seems that the use of m4_ifdef is not sufficient.

do you have an idea of how to do that ?

Vincent Torri


_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf

Re: checking Mac OS X headers

by Peter O'Gorman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11/14/2009 01:20 PM, Vincent Torri wrote:

>
> do you have an idea of how to do that ?

I'd be inclined to just

AC_CHECK_HEADERS([Cocoa/Cocoa.h])

Framework style includes like that should work with all Mac OS X compilers.

Peter
--
Peter O'Gorman
http://pogma.com


_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf

Re: checking Mac OS X headers

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Vincent,

* Vincent Torri wrote on Sat, Nov 14, 2009 at 08:20:12PM CET:

> On Sat, 14 Nov 2009, Ralf Wildenhues wrote:
> >>configure:11850: checking whether we are using the GNU Objective C compiler
> >>configure:11869: gcc -c   conftest.m >&5
> >>gcc: error trying to exec 'cc1obj': execvp: No such file or directory
> >>configure:11869: $? = 1
> >
> >Your compiler doesn't speak Objective C.  Solution is to install the
> >respective frontend.
>
> i don't have it and i don't want to install it. I would like to
> check the Mac OS X header only if an Objective C compiler is
> present, as i have to use an objective c compiler (hance the
> AC_LANG_PUSH in the code). But it seems that the use of m4_ifdef is
> not sufficient.
>
> do you have an idea of how to do that ?

Besides the answer Peter already gave you, which is probably the right
thing for you, finding out whether the Objective C compiler can compile
and link code should be possible as follows (untested):

  AC_LANG_PUSH([Objective C])
  AC_MSG_CHECKING([whether then Objective C compiler works])
  AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
    [AC_MSG_RESULT([yes])],
    [AC_MSG_RESULT([no])])
  AC_LANG_POP([Objective C])

Similar with AC_RUN_IFELSE if you require a run test (but take care of
the cross-compile scenario in that case).

Cheers,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf