[if this reaches the autoconf list twice, I apologize; I
originally mistakenly assumed a [EMAIL PROTECTED]
address existed]

Hi,

when building sed 3.1.5 (cross-compiling from Linux,
but I expect it affects "native" mingw32 builds too) I ran
into the following problem: configure correctly detected
that mingw32 has alloca but no working alloca.h;
however, regex-internal.h simply includes alloca.h
unconditionally, breaking the build.  Replacing the
include by the code the alloca test in configure uses,
things compiled properly:

#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# ifdef _MSC_VER
#  include <malloc.h>
#  define alloca _alloca
# else
#  if HAVE_ALLOCA_H
#   include <alloca.h>
#  else
#   ifdef _AIX
#pragma alloca
#   else
#    ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
#    endif
#   endif
#  endif
# endif
#endif

I'm cc:ing the autoconf buglist, as this is something
that autoconf should perhaps provide; it could have
a macro that generated a header that was guaranteed
to declare alloca properly (i.e. included config.h and
the above code).  It does not make much sense to
require every package that uses alloca to replicate
this code.


Reply via email to