Skip to content

Commit e41fda1

Browse files
committed
gdb: use AC_PROG_CC_STDC instead of AM_PROG_CC_STDC
`autoconf -Wall` notes that AM_PROG_CC_STDC is obsolete: Fixes this autoconf warning: configure.ac:40: warning: 'AM_PROG_CC_STDC': this macro is obsolete. configure.ac:40: You should simply use the 'AC_PROG_CC' macro instead. configure.ac:40: Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', configure.ac:40: but upon 'ac_cv_prog_cc_stdc'. aclocal.m4:770: AM_PROG_CC_STDC is expanded from... configure.ac:40: the top level Since we build with a C++ compiler now, I don't think this is relevant. If you look at the messages removed from gdbsupport/aclocal.m4, it says that this functionality is now integrated in AC_PROG_CC, which we already call. So it might not even make a difference. We had a local version of AM_PROG_CC_STDC, in gdb/acinclude.m4 (only used by gdb/configure.ac), remove it. gdb/ChangeLog: * acinclude.m4 (AM_PROG_CC_STDC): Remove. * configure: Re-generate. * configure.ac: Remove AM_PROG_CC_STDC. gdbsupport/ChangeLog: * aclocal.m4: Re-generate. * configure: Re-generate. * configure.ac: Remove AM_PROG_CC_STDC. Change-Id: Ic824393598805d4f78cda9d119f8af46096e9c73
1 parent 91e1a0e commit e41fda1

File tree

8 files changed

+13
-953
lines changed

8 files changed

+13
-953
lines changed

gdb/ChangeLog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2020-10-31 Simon Marchi <[email protected]>
2+
3+
* acinclude.m4 (AM_PROG_CC_STDC): Remove.
4+
* configure: Re-generate.
5+
* configure.ac: Remove AM_PROG_CC_STDC.
6+
17
2020-10-31 Simon Marchi <[email protected]>
28

39
* configure.ac: Use AC_CANONICAL_{BUILD,HOST,TARGET} instead of

gdb/acinclude.m4

-108
Original file line numberDiff line numberDiff line change
@@ -78,114 +78,6 @@ m4_include(ax_cxx_compile_stdcxx.m4)
7878

7979
m4_include([../config/ax_pthread.m4])
8080

81-
## ----------------------------------------- ##
82-
## ANSIfy the C compiler whenever possible. ##
83-
## From Franc,ois Pinard ##
84-
## ----------------------------------------- ##
85-
86-
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
87-
88-
# This program is free software; you can redistribute it and/or modify
89-
# it under the terms of the GNU General Public License as published by
90-
# the Free Software Foundation; either version 2, or (at your option)
91-
# any later version.
92-
93-
# This program is distributed in the hope that it will be useful,
94-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
95-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96-
# GNU General Public License for more details.
97-
98-
# You should have received a copy of the GNU General Public License
99-
# along with this program; if not, see <http://www.gnu.org/licenses/>.
100-
101-
# serial 1
102-
103-
# @defmac AC_PROG_CC_STDC
104-
# @maindex PROG_CC_STDC
105-
# @ovindex CC
106-
# If the C compiler in not in ANSI C mode by default, try to add an option
107-
# to output variable @code{CC} to make it so. This macro tries various
108-
# options that select ANSI C on some system or another. It considers the
109-
# compiler to be in ANSI C mode if it handles function prototypes correctly.
110-
#
111-
# If you use this macro, you should check after calling it whether the C
112-
# compiler has been set to accept ANSI C; if not, the shell variable
113-
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
114-
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
115-
# program @code{ansi2knr}, which comes with Ghostscript.
116-
# @end defmac
117-
118-
AC_DEFUN([AM_PROG_CC_STDC],
119-
[AC_REQUIRE([AC_PROG_CC])
120-
AC_BEFORE([$0], [AC_C_INLINE])
121-
AC_BEFORE([$0], [AC_C_CONST])
122-
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
123-
dnl a magic option to avoid problems with ANSI preprocessor commands
124-
dnl like #elif.
125-
dnl FIXME: can't do this because then AC_AIX won't work due to a
126-
dnl circular dependency.
127-
dnl AC_BEFORE([$0], [AC_PROG_CPP])
128-
AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
129-
AC_CACHE_VAL(am_cv_prog_cc_stdc,
130-
[am_cv_prog_cc_stdc=no
131-
ac_save_CC="$CC"
132-
# Don't try gcc -ansi; that turns off useful extensions and
133-
# breaks some systems' header files.
134-
# AIX -qlanglvl=ansi
135-
# Ultrix and OSF/1 -std1
136-
# HP-UX 10.20 and later -Ae
137-
# HP-UX older versions -Aa -D_HPUX_SOURCE
138-
# SVR4 -Xc -D__EXTENSIONS__
139-
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
140-
do
141-
CC="$ac_save_CC $ac_arg"
142-
AC_TRY_COMPILE(
143-
[#include <stdarg.h>
144-
#include <stdio.h>
145-
#include <sys/types.h>
146-
#include <sys/stat.h>
147-
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
148-
struct buf { int x; };
149-
FILE * (*rcsopen) (struct buf *, struct stat *, int);
150-
static char *e (p, i)
151-
char **p;
152-
int i;
153-
{
154-
return p[i];
155-
}
156-
static char *f (char * (*g) (char **, int), char **p, ...)
157-
{
158-
char *s;
159-
va_list v;
160-
va_start (v,p);
161-
s = g (p, va_arg (v,int));
162-
va_end (v);
163-
return s;
164-
}
165-
int test (int i, double x);
166-
struct s1 {int (*f) (int a);};
167-
struct s2 {int (*f) (double a);};
168-
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
169-
int argc;
170-
char **argv;
171-
], [
172-
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
173-
],
174-
[am_cv_prog_cc_stdc="$ac_arg"; break])
175-
done
176-
CC="$ac_save_CC"
177-
])
178-
if test -z "$am_cv_prog_cc_stdc"; then
179-
AC_MSG_RESULT([none needed])
180-
else
181-
AC_MSG_RESULT([$am_cv_prog_cc_stdc])
182-
fi
183-
case "x$am_cv_prog_cc_stdc" in
184-
x|xno) ;;
185-
*) CC="$CC $am_cv_prog_cc_stdc" ;;
186-
esac
187-
])
188-
18981
dnl written by Guido Draheim <[email protected]>, original by Alexandre Oliva
19082
dnl Version 1.3 (2001/03/02)
19183
dnl source http://www.gnu.org/software/ac-archive/Miscellaneous/ac_define_dir.html

gdb/configure

-82
Original file line numberDiff line numberDiff line change
@@ -5024,88 +5024,6 @@ rm -rf conftest*
50245024
fi
50255025

50265026

5027-
5028-
5029-
5030-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${CC-cc} option to accept ANSI C" >&5
5031-
$as_echo_n "checking for ${CC-cc} option to accept ANSI C... " >&6; }
5032-
if ${am_cv_prog_cc_stdc+:} false; then :
5033-
$as_echo_n "(cached) " >&6
5034-
else
5035-
am_cv_prog_cc_stdc=no
5036-
ac_save_CC="$CC"
5037-
# Don't try gcc -ansi; that turns off useful extensions and
5038-
# breaks some systems' header files.
5039-
# AIX -qlanglvl=ansi
5040-
# Ultrix and OSF/1 -std1
5041-
# HP-UX 10.20 and later -Ae
5042-
# HP-UX older versions -Aa -D_HPUX_SOURCE
5043-
# SVR4 -Xc -D__EXTENSIONS__
5044-
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
5045-
do
5046-
CC="$ac_save_CC $ac_arg"
5047-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5048-
/* end confdefs.h. */
5049-
#include <stdarg.h>
5050-
#include <stdio.h>
5051-
#include <sys/types.h>
5052-
#include <sys/stat.h>
5053-
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
5054-
struct buf { int x; };
5055-
FILE * (*rcsopen) (struct buf *, struct stat *, int);
5056-
static char *e (p, i)
5057-
char **p;
5058-
int i;
5059-
{
5060-
return p[i];
5061-
}
5062-
static char *f (char * (*g) (char **, int), char **p, ...)
5063-
{
5064-
char *s;
5065-
va_list v;
5066-
va_start (v,p);
5067-
s = g (p, va_arg (v,int));
5068-
va_end (v);
5069-
return s;
5070-
}
5071-
int test (int i, double x);
5072-
struct s1 {int (*f) (int a);};
5073-
struct s2 {int (*f) (double a);};
5074-
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
5075-
int argc;
5076-
char **argv;
5077-
5078-
int
5079-
main ()
5080-
{
5081-
5082-
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
5083-
5084-
;
5085-
return 0;
5086-
}
5087-
_ACEOF
5088-
if ac_fn_c_try_compile "$LINENO"; then :
5089-
am_cv_prog_cc_stdc="$ac_arg"; break
5090-
fi
5091-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5092-
done
5093-
CC="$ac_save_CC"
5094-
5095-
fi
5096-
5097-
if test -z "$am_cv_prog_cc_stdc"; then
5098-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5099-
$as_echo "none needed" >&6; }
5100-
else
5101-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_stdc" >&5
5102-
$as_echo "$am_cv_prog_cc_stdc" >&6; }
5103-
fi
5104-
case "x$am_cv_prog_cc_stdc" in
5105-
x|xno) ;;
5106-
*) CC="$CC $am_cv_prog_cc_stdc" ;;
5107-
esac
5108-
51095027
# Expand $ac_aux_dir to an absolute path.
51105028
am_aux_dir=`cd "$ac_aux_dir" && pwd`
51115029

gdb/configure.ac

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ AC_PROG_CXX
2929

3030
AC_USE_SYSTEM_EXTENSIONS
3131
ACX_LARGEFILE
32-
AM_PROG_CC_STDC
3332
AM_PROG_INSTALL_STRIP
3433

3534
AC_CONFIG_AUX_DIR(..)

gdbsupport/ChangeLog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2020-10-31 Simon Marchi <[email protected]>
2+
3+
* aclocal.m4: Re-generate.
4+
* configure: Re-generate.
5+
* configure.ac: Remove AM_PROG_CC_STDC.
6+
17
2020-10-31 Simon Marchi <[email protected]>
28

39
* configure.ac: Use AC_CANONICAL_{BUILD,HOST,TARGET} instead of

gdbsupport/aclocal.m4

-29
Original file line numberDiff line numberDiff line change
@@ -751,35 +751,6 @@ else
751751
fi
752752
])
753753

754-
# -*- Autoconf -*-
755-
# Obsolete and "removed" macros, that must however still report explicit
756-
# error messages when used, to smooth transition.
757-
#
758-
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
759-
#
760-
# This file is free software; the Free Software Foundation
761-
# gives unlimited permission to copy and/or distribute it,
762-
# with or without modifications, as long as this notice is preserved.
763-
764-
AC_DEFUN([AM_CONFIG_HEADER],
765-
[AC_DIAGNOSE([obsolete],
766-
['$0': this macro is obsolete.
767-
You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl
768-
AC_CONFIG_HEADERS($@)])
769-
770-
AC_DEFUN([AM_PROG_CC_STDC],
771-
[AC_PROG_CC
772-
am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
773-
AC_DIAGNOSE([obsolete],
774-
['$0': this macro is obsolete.
775-
You should simply use the 'AC][_PROG_CC' macro instead.
776-
Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
777-
but upon 'ac_cv_prog_cc_stdc'.])])
778-
779-
AC_DEFUN([AM_C_PROTOTYPES],
780-
[AC_FATAL([automatic de-ANSI-fication support has been removed])])
781-
AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
782-
783754
# Helper functions for option handling. -*- Autoconf -*-
784755

785756
# Copyright (C) 2001-2017 Free Software Foundation, Inc.

0 commit comments

Comments
 (0)