[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CFLAGS for AC_COMPILE_IFELSE.
From: |
Edward Tomasz Napierala |
Subject: |
Re: CFLAGS for AC_COMPILE_IFELSE. |
Date: |
Tue, 13 May 2008 18:01:29 +0200 |
User-agent: |
Mutt/1.5.16 (2007-06-09) |
On 0512T0631, Ralf Corsepius wrote:
> > I need the configure script to figure out how many parameters one particular
> > library function requires, due to API change. I've found a macro to do
> > that,
> > it looks like this:
> >
> > AC_DEFUN([AC_JACK_MIDI_NFRAMES_CHECK], [
> > AC_MSG_CHECKING([whether JACK MIDI functions need nframes parameter])
> > AC_LANG_PUSH(C)
> > AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
> > #include <jack/jack.h>
> > #include <jack/midiport.h>
> > ]], [[
> > jack_midi_event_get(0, 0, 0, 0);
> > ]]), [jackmidi_nframes='yes'], [jackmidi_nframes='no'])
> > AC_MSG_RESULT([$jackmidi_nframes])
> > AC_LANG_POP()
> > ])
> >
> > Problem is, it does not work for me. Probable reason is this
> > (from config.log):
> >
> > configure:5138: checking whether JACK MIDI functions need nframes parameter
> > configure:5172: gcc -c -g -O2 conftest.c >&5
> > conftest.c:32:23: error: jack/jack.h: No such file or directory
> > conftest.c:33:27: error: jack/midiport.h: No such file or directory
> >
> > It does not work, because it does not use the proper CFLAGS - this
> > is FreeBSD, includes live in /usr/local/include and it's neccessary
> > to pass -I/usr/local/include.
> Are you saying, they modified their GCC in such a way that it doesn't
> look into /usr/local/include?
Yes, it seems so.
> GCC's default behavior is to
> use /usr/local/include implicitly, as part of GCC's system-include path,
> in a similar way it treats /usr/include.
What about systems that put external libraries somewhere under
/opt or /usr/pkg?
> > So, the question is, how to modify the above macro to use CFLAGS it got
> > (or should got) from pkg-config, for example?
> You should not do this. Instead, the user/installer is supposed to pass
> appropriate *FLAGS to configure.
>
> In your case (include-paths): ..../configure CPPFLAGS="-I<foo>/include"
I see. Anyway, I managed to work around that problem by checking for
the particular version of library using PKG_CHECK_MODULES. Thanks ;-)
--
If you cut off my head, what would I say? Me and my head, or me and my body?
Re: CFLAGS for AC_COMPILE_IFELSE., Brian Dessent, 2008/05/13