From xemacs-m  Tue Jul 29 16:43:36 1997
Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1])
	by xemacs.org (8.8.5/8.8.5) with SMTP id QAA02968
	for <xemacs-beta@xemacs.org>; Tue, 29 Jul 1997 16:43:35 -0500 (CDT)
Received: from Eng.Sun.COM ([129.146.1.13]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id OAA23509 for <xemacs-beta@xemacs.org>; Tue, 29 Jul 1997 14:43:06 -0700
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id OAA29362; Tue, 29 Jul 1997 14:43:04 -0700
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id OAA19882; Tue, 29 Jul 1997 14:43:02 -0700
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id OAA22771; Tue, 29 Jul 1997 14:43:02 -0700
Date: Tue, 29 Jul 1997 14:43:02 -0700
Message-Id: <199707292143.OAA22771@xemacs.eng.sun.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: XEmacs Beta Test <xemacs-beta@xemacs.org>
Subject: HPUX 9 + cc + alloca + libPW
X-Mailer: VM 6.33 under 20.3 "Vienna" XEmacs  Lucid (beta14)
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>

Here is the relevant section from the Autoconf 2.12 documentation:

(Again, I offer to fix this if given access to a HPUX 9 system with cc 
installed)

 - Macro: AC_FUNC_ALLOCA
     Check how to get `alloca'.  Tries to get a builtin version by
     checking for `alloca.h' or the predefined C preprocessor macros
     `__GNUC__' and `_AIX'.  If this macro finds `alloca.h', it defines
     `HAVE_ALLOCA_H'.

     If those attempts fail, it looks for the function in the standard C
     library.  If any of those methods succeed, it defines
     `HAVE_ALLOCA'.  Otherwise, it sets the output variable `ALLOCA' to
     `alloca.o' and defines `C_ALLOCA' (so programs can periodically
     call `alloca(0)' to garbage collect).  This variable is separate
     from `LIBOBJS' so multiple programs can share the value of
     `ALLOCA' without needing to create an actual library, in case only
     some of them use the code in `LIBOBJS'.

     This macro does not try to get `alloca' from the System V R3
     `libPW' or the System V R4 `libucb' because those libraries
     contain some incompatible functions that cause trouble.  Some
     versions do not even contain `alloca' or contain a buggy version.
     If you still want to use their `alloca', use `ar' to extract
     `alloca.o' from them instead of compiling `alloca.c'.

     Source files that use `alloca' should start with a piece of code
     like the following, to declare it properly.  In some versions of
     AIX, the declaration of `alloca' must precede everything else
     except for comments and preprocessor directives.  The `#pragma'
     directive is indented so that pre-ANSI C compilers will ignore it,
     rather than choke on it.

          /* AIX requires this to be the first thing in the file.  */
          #ifdef __GNUC__
          # define alloca __builtin_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

