2002-03-27 Daniel Jacobowitz <drow@mvista.com>
[deliverable/binutils-gdb.git] / gdb / gdbserver / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13
14 # serial 1
15
16 # @defmac AC_PROG_CC_STDC
17 # @maindex PROG_CC_STDC
18 # @ovindex CC
19 # If the C compiler in not in ANSI C mode by default, try to add an option
20 # to output variable @code{CC} to make it so. This macro tries various
21 # options that select ANSI C on some system or another. It considers the
22 # compiler to be in ANSI C mode if it handles function prototypes correctly.
23 #
24 # If you use this macro, you should check after calling it whether the C
25 # compiler has been set to accept ANSI C; if not, the shell variable
26 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
27 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
28 # program @code{ansi2knr}, which comes with Ghostscript.
29 # @end defmac
30
31 AC_DEFUN(AM_PROG_CC_STDC,
32 [AC_REQUIRE([AC_PROG_CC])
33 AC_BEFORE([$0], [AC_C_INLINE])
34 AC_BEFORE([$0], [AC_C_CONST])
35 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
36 dnl a magic option to avoid problems with ANSI preprocessor commands
37 dnl like #elif.
38 dnl FIXME: can't do this because then AC_AIX won't work due to a
39 dnl circular dependency.
40 dnl AC_BEFORE([$0], [AC_PROG_CPP])
41 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
42 AC_CACHE_VAL(am_cv_prog_cc_stdc,
43 [am_cv_prog_cc_stdc=no
44 ac_save_CC="$CC"
45 # Don't try gcc -ansi; that turns off useful extensions and
46 # breaks some systems' header files.
47 # AIX -qlanglvl=ansi
48 # Ultrix and OSF/1 -std1
49 # HP-UX -Aa -D_HPUX_SOURCE
50 # SVR4 -Xc -D__EXTENSIONS__
51 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
52 do
53 CC="$ac_save_CC $ac_arg"
54 AC_TRY_COMPILE(
55 [#include <stdarg.h>
56 #include <stdio.h>
57 #include <sys/types.h>
58 #include <sys/stat.h>
59 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
60 struct buf { int x; };
61 FILE * (*rcsopen) (struct buf *, struct stat *, int);
62 static char *e (p, i)
63 char **p;
64 int i;
65 {
66 return p[i];
67 }
68 static char *f (char * (*g) (char **, int), char **p, ...)
69 {
70 char *s;
71 va_list v;
72 va_start (v,p);
73 s = g (p, va_arg (v,int));
74 va_end (v);
75 return s;
76 }
77 int test (int i, double x);
78 struct s1 {int (*f) (int a);};
79 struct s2 {int (*f) (double a);};
80 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
81 int argc;
82 char **argv;
83 ], [
84 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
85 ],
86 [am_cv_prog_cc_stdc="$ac_arg"; break])
87 done
88 CC="$ac_save_CC"
89 ])
90 if test -z "$am_cv_prog_cc_stdc"; then
91 AC_MSG_RESULT([none needed])
92 else
93 AC_MSG_RESULT($am_cv_prog_cc_stdc)
94 fi
95 case "x$am_cv_prog_cc_stdc" in
96 x|xno) ;;
97 *) CC="$CC $am_cv_prog_cc_stdc" ;;
98 esac
99 ])
100
This page took 0.034413 seconds and 4 git commands to generate.