Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/libiberty/aclocal.m4

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    4848  p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
    4949                     MAP_ANON|MAP_PRIVATE, dev_zero, 0);
     50  if (p == (char *)-1)
     51    p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
     52                       MAP_ANON|MAP_PRIVATE, -1, 0);
    5053  if (p == (char *)-1)
    5154    exit (2);
     
    8487fi
    8588])
     89
     90dnl See whether we need a declaration for a function.
     91AC_DEFUN(libiberty_NEED_DECLARATION,
     92[AC_MSG_CHECKING([whether $1 must be declared])
     93AC_CACHE_VAL(libiberty_cv_decl_needed_$1,
     94[AC_TRY_COMPILE([
     95#include "confdefs.h"
     96#include <stdio.h>
     97#ifdef HAVE_STRING_H
     98#include <string.h>
     99#else
     100#ifdef HAVE_STRINGS_H
     101#include <strings.h>
     102#endif
     103#endif
     104#ifdef HAVE_STDLIB_H
     105#include <stdlib.h>
     106#endif
     107#ifdef HAVE_UNISTD_H
     108#include <unistd.h>
     109#endif],
     110[char *(*pfn) = (char *(*)) $1],
     111libiberty_cv_decl_needed_$1=no, libiberty_cv_decl_needed_$1=yes)])
     112AC_MSG_RESULT($libiberty_cv_decl_needed_$1)
     113if test $libiberty_cv_decl_needed_$1 = yes; then
     114  AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
     115            [Define if $1 is not declared in system header files.])
     116fi
     117])dnl
    86118
    87119# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
     
    135167EOF
    136168])
     169
     170# We always want a C version of alloca() compiled into libiberty,
     171# because native-compiler support for the real alloca is so !@#$%
     172# unreliable that GCC has decided to use it only when being compiled
     173# by GCC.  This is the part of AC_FUNC_ALLOCA that calculates the
     174# information alloca.c needs.
     175AC_DEFUN(libiberty_AC_FUNC_C_ALLOCA,
     176[AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray,
     177[AC_EGREP_CPP(webecray,
     178[#if defined(CRAY) && ! defined(CRAY2)
     179webecray
     180#else
     181wenotbecray
     182#endif
     183], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
     184if test $ac_cv_os_cray = yes; then
     185  for ac_func in _getb67 GETB67 getb67; do
     186    AC_CHECK_FUNC($ac_func,
     187      [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
     188  [Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP
     189   systems. This function is required for alloca.c support on those
     190   systems.])  break])
     191  done
     192fi
     193
     194AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
     195[AC_TRY_RUN([find_stack_direction ()
     196{
     197  static char *addr = 0;
     198  auto char dummy;
     199  if (addr == 0)
     200    {
     201      addr = &dummy;
     202      return find_stack_direction ();
     203    }
     204  else
     205    return (&dummy > addr) ? 1 : -1;
     206}
     207main ()
     208{
     209  exit (find_stack_direction() < 0);
     210}],
     211  ac_cv_c_stack_direction=1,
     212  ac_cv_c_stack_direction=-1,
     213  ac_cv_c_stack_direction=0)])
     214AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction,
     215  [Define if you know the direction of stack growth for your system;
     216   otherwise it will be automatically deduced at run-time.
     217        STACK_DIRECTION > 0 => grows toward higher addresses
     218        STACK_DIRECTION < 0 => grows toward lower addresses
     219        STACK_DIRECTION = 0 => direction of growth unknown])
     220])
Note: See TracChangeset for help on using the changeset viewer.