[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gnulib needed in AC_CHECK_HEADERS
From: |
Bruno Haible |
Subject: |
Re: Gnulib needed in AC_CHECK_HEADERS |
Date: |
Sat, 13 Oct 2007 22:12:00 +0200 |
User-agent: |
KMail/1.5.4 |
Sylvain Beucler wrote:
> I'm cross-compiling an SDL application for i586-mingw32mscv. I
> imported the alloca module from Gnulib, as a dependency of strcasestr.
You mean the 'alloca-opt' module, I guess?
> When checking for SDL.h,
>
> AC_CHECK_HEADERS(SDL.h SDL_rotozoom.h SDL_framerate.h SDL_image.h,
> [], AC_MSG_ERROR([Could not find necessary SDL libs headers]))
>
> ../configure fails checking for SDL.h, because SDL.h (more exactly
> SDL_stdinc.h), seeing HAVE_ALLOCA set, tries to include <alloca.h>,
> and fails (mingw doesn't have alloca.h).
SDL-1.2.10/include/SDL_stdinc.h has
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void *alloca (unsigned);
# else
char *alloca ();
# endif
#endif
So I think you mean HAVE_ALLOCA_H.
> How would you deal with this?
Indeed gnulib defines HAVE_ALLOCA_H always:
2004-05-16 Paul Eggert <address@hidden>
* m4/alloca.m4 (gl_FUNC_ALLOCA): Define HAVE_ALLOCA_H always,
for backward compatibility with older code.
I think this is right. There are so many places in code which test
HAVE_ALLOCA_H.
SDL_stdinc.h is also right: It can be used without or with gnulib.
It would be very ugly if it #included different files at configure time
than later, at build time.
Therefore I agree with you that adding some temporary -I options to
CPPFLAGS while testing for SDL.h is the best workaround.
Bruno