Patch installed for autoconf cleanup (part 1)
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Mon Apr 24 10:54:00 GMT 2000
A while back I submitted a patch to cleanup some autoconf
issues, got approval, but never installed it. (Sorry, my bad.)
http://gcc.gnu.org/ml/gcc-patches/1999-09n/msg01114.html
http://gcc.gnu.org/ml/gcc-patches/1999-10n/msg00426.html
Anyway, I've resolved to update it, split into chunks and install it.
This is the first piece.
Autoconf does some sanity checks on configure.in WRT macros, but it
relies on the macro name containing "AC_". I originally renamed
everything to AC_GCC_ but have since learned that the convention is of
the form gcc_AC_ so that's what I used.
Also in the process I found a macro with EGCS_ in it which I fixed.
The patch below was installed. The other pieces of the original patch
will follow soon.
--Kaveh
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ChangeLog,v
retrieving revision 1.6330
diff -u -p -r1.6330 ChangeLog
--- ChangeLog 2000/04/24 17:24:44 1.6330
+++ ChangeLog 2000/04/24 17:43:09
@@ -1,3 +1,17 @@
+2000-04-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * aclocal.m4: (GCC_HEADER_STRING, GCC_NEED_DECLARATION,
+ GCC_NEED_DECLARATIONS, GCC_FUNC_VFPRINTF_DOPRNT,
+ GCC_FUNC_PRINTF_PTR, GCC_PROG_LN_S, GCC_PROG_LN, GCC_C_VOLATILE,
+ AC_GCC_C_LONG_DOUBLE, GCC_FUNC_MKDIR_TAKES_ONE_ARG,
+ EGCS_PROG_INSTALL): Rename autoconf macros with prefix gcc_AC_.
+
+ * configure.in (AC_GCC_C_LONG_DOUBLE, GCC_PROG_LN, GCC_PROG_LN_S,
+ GCC_C_VOLATILE, EGCS_PROG_INSTALL, GCC_HEADER_STRING,
+ GCC_FUNC_VFPRINTF_DOPRNT, GCC_FUNC_PRINTF_PTR,
+ GCC_NEED_DECLARATIONS, GCC_FUNC_MKDIR_TAKES_ONE_ARG): Invoke with
+ new macros names.
+
2000-04-24 Mumit Khan <khan@xraylith.wisc.edu>
* c-pragma.c (push_alignment): Use BITS_PER_UNIT macro.
Index: aclocal.m4
===================================================================
RCS file: /cvs/gcc/egcs/gcc/aclocal.m4,v
retrieving revision 1.22
diff -u -p -r1.22 aclocal.m4
--- aclocal.m4 2000/04/17 17:25:55 1.22
+++ aclocal.m4 2000/04/24 17:43:10
@@ -1,5 +1,5 @@
dnl See whether we can include both string.h and strings.h.
-AC_DEFUN(GCC_HEADER_STRING,
+AC_DEFUN(gcc_AC_HEADER_STRING,
[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
gcc_cv_header_string,
[AC_TRY_COMPILE([#include <string.h>
@@ -10,8 +10,8 @@ fi
])
dnl See whether we need a declaration for a function.
-dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
-AC_DEFUN(GCC_NEED_DECLARATION,
+dnl gcc_AC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
+AC_DEFUN(gcc_AC_NEED_DECLARATION,
[AC_MSG_CHECKING([whether $1 must be declared])
AC_CACHE_VAL(gcc_cv_decl_needed_$1,
[AC_TRY_COMPILE([
@@ -57,17 +57,17 @@ fi
])dnl
dnl Check multiple functions to see whether each needs a declaration.
-dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
-AC_DEFUN(GCC_NEED_DECLARATIONS,
+dnl gcc_AC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
+AC_DEFUN(gcc_AC_NEED_DECLARATIONS,
[for ac_func in $1
do
-GCC_NEED_DECLARATION($ac_func, $2)
+gcc_AC_NEED_DECLARATION($ac_func, $2)
done
])
dnl Check if we have vprintf and possibly _doprnt.
dnl Note autoconf checks for vprintf even though we care about vfprintf.
-AC_DEFUN(GCC_FUNC_VFPRINTF_DOPRNT,
+AC_DEFUN(gcc_AC_FUNC_VFPRINTF_DOPRNT,
[AC_FUNC_VPRINTF
vfprintf=
doprint=
@@ -82,7 +82,7 @@ AC_SUBST(doprint)
])
dnl See if the printf functions in libc support %p in format strings.
-AC_DEFUN(GCC_FUNC_PRINTF_PTR,
+AC_DEFUN(gcc_AC_FUNC_PRINTF_PTR,
[AC_CACHE_CHECK(whether the printf functions support %p,
gcc_cv_func_printf_ptr,
[AC_TRY_RUN([#include <stdio.h>
@@ -103,7 +103,7 @@ fi
])
dnl See if symbolic links work and if not, try to substitute either hard links or simple copy.
-AC_DEFUN(GCC_PROG_LN_S,
+AC_DEFUN(gcc_AC_PROG_LN_S,
[AC_MSG_CHECKING(whether ln -s works)
AC_CACHE_VAL(gcc_cv_prog_LN_S,
[rm -f conftestdata_t
@@ -135,7 +135,7 @@ AC_SUBST(LN_S)dnl
])
dnl See if hard links work and if not, try to substitute either symbolic links or simple copy.
-AC_DEFUN(GCC_PROG_LN,
+AC_DEFUN(gcc_AC_PROG_LN,
[AC_MSG_CHECKING(whether ln works)
AC_CACHE_VAL(gcc_cv_prog_LN,
[rm -f conftestdata_t
@@ -167,7 +167,7 @@ AC_SUBST(LN)dnl
])
dnl See whether the stage1 host compiler accepts the volatile keyword.
-AC_DEFUN(GCC_C_VOLATILE,
+AC_DEFUN(gcc_AC_C_VOLATILE,
[AC_CACHE_CHECK([for volatile], gcc_cv_c_volatile,
[AC_TRY_COMPILE(, [volatile int foo;],
gcc_cv_c_volatile=yes, gcc_cv_c_volatile=no)])
@@ -178,7 +178,7 @@ fi
dnl Check whether long double is supported. This differs from the
dnl built-in autoconf test in that it works for cross compiles.
-AC_DEFUN(AC_GCC_C_LONG_DOUBLE,
+AC_DEFUN(gcc_AC_C_LONG_DOUBLE,
[AC_CACHE_CHECK(for long double, gcc_cv_c_long_double,
[if test "$GCC" = yes; then
gcc_cv_c_long_double=yes
@@ -197,7 +197,7 @@ fi
dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
dnl of the usual 2.
-AC_DEFUN(GCC_FUNC_MKDIR_TAKES_ONE_ARG,
+AC_DEFUN(gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG,
[AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg,
[AC_TRY_COMPILE([
#include <sys/types.h>
@@ -216,7 +216,7 @@ if test $gcc_cv_mkdir_takes_one_arg = ye
fi
])
-AC_DEFUN(EGCS_PROG_INSTALL,
+AC_DEFUN(gcc_AC_PROG_INSTALL,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/configure.in,v
retrieving revision 1.357
diff -u -p -r1.357 configure.in
--- configure.in 2000/04/18 22:34:09 1.357
+++ configure.in 2000/04/24 17:43:12
@@ -287,7 +287,7 @@ AC_CANONICAL_SYSTEM
# Find the native compiler
AC_PROG_CC
-AC_GCC_C_LONG_DOUBLE
+gcc_AC_C_LONG_DOUBLE
# If the native compiler is GCC, we can enable warnings even in stage1.
# That's useful for people building cross-compilers, or just running a
@@ -326,16 +326,16 @@ fi
# Find some useful tools
AC_PROG_AWK
AC_PROG_LEX
-GCC_PROG_LN
-GCC_PROG_LN_S
-GCC_C_VOLATILE
+gcc_AC_PROG_LN
+gcc_AC_PROG_LN_S
+gcc_AC_C_VOLATILE
AC_PROG_RANLIB
AC_PROG_YACC
-EGCS_PROG_INSTALL
+gcc_AC_PROG_INSTALL
AC_HEADER_STDC
AC_HEADER_TIME
-GCC_HEADER_STRING
+gcc_AC_HEADER_STRING
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \
fcntl.h unistd.h stab.h sys/file.h sys/time.h \
@@ -397,8 +397,8 @@ AC_CHECK_FUNCS(strtoul bsearch putenv po
# Make sure wchar_t is available
#AC_CHECK_TYPE(wchar_t, unsigned int)
-GCC_FUNC_VFPRINTF_DOPRNT
-GCC_FUNC_PRINTF_PTR
+gcc_AC_FUNC_VFPRINTF_DOPRNT
+gcc_AC_FUNC_PRINTF_PTR
case "${host}" in
*-*-uwin*)
@@ -412,17 +412,17 @@ AC_FUNC_VFORK
AC_FUNC_MMAP_ANYWHERE
AC_FUNC_MMAP_FILE
-GCC_NEED_DECLARATIONS(bcopy bzero bcmp \
+gcc_AC_NEED_DECLARATIONS(bcopy bzero bcmp \
index rindex getenv atol sbrk abort atof getcwd getwd \
strsignal putc_unlocked fputs_unlocked strstr environ)
-GCC_NEED_DECLARATIONS(malloc realloc calloc free, [
+gcc_AC_NEED_DECLARATIONS(malloc realloc calloc free, [
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
])
-GCC_NEED_DECLARATIONS(getrlimit setrlimit getrusage, [
+gcc_AC_NEED_DECLARATIONS(getrlimit setrlimit getrusage, [
#include <sys/types.h>
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
@@ -430,7 +430,7 @@ GCC_NEED_DECLARATIONS(getrlimit setrlimi
])
# mkdir takes a single argument on some systems.
-GCC_FUNC_MKDIR_TAKES_ONE_ARG
+gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
# File extensions
manext='.1'
Index: configure
===================================================================
RCS file: /cvs/gcc/egcs/gcc/configure,v
retrieving revision 1.353
diff -u -p -r1.353 configure
--- configure 2000/04/18 22:34:08 1.353
+++ configure 2000/04/24 17:43:19
@@ -6734,7 +6734,7 @@ else
int main() {
/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x = {0,0};
+typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
@@ -6809,7 +6809,7 @@ for ac_kw in inline __inline__ __inline;
#include "confdefs.h"
int main() {
-} int $ac_kw foo() {
+} $ac_kw foo() {
; return 0; }
EOF
if { (eval echo configure:6816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
@@ -6915,7 +6915,7 @@ else
#include "confdefs.h"
#include <alloca.h>
int main() {
-void *p = alloca(2 * sizeof(int));
+char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:6922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
More information about the Gcc-patches
mailing list