[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
11-fyi-ac-link-ifelse.patch
From: |
Akim Demaille |
Subject: |
11-fyi-ac-link-ifelse.patch |
Date: |
Sat, 04 Aug 2001 15:12:56 +0200 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* lib/autoconf/functions.m4 (AC_FUNC_ALLOCA, AC_FUNC_ERROR_AT_LINE)
(AC_FUNC_FSEEKO, AC_FUNC_OBSTACK): Use AC_LANG_IFELSE, not
AC_TRY_LINK.
* lib/autoconf/headers.m4 (AC_HEADER_MAJOR): Likewise.
* lib/autoconf/fortran.m4 (_AC_LANG_PROGRAM_C_F77_HOOKS)
(AC_F77_MAIN): Likewise.
Index: lib/autoconf/functions.m4
--- lib/autoconf/functions.m4 Fri, 27 Jul 2001 20:21:13 +0200 akim
+++ lib/autoconf/functions.m4 Sat, 04 Aug 2001 14:04:13 +0200 akim
@@ -202,9 +202,11 @@ AC_DEFUN([AC_FUNC_ALLOCA],
[# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
AC_CACHE_CHECK([for working alloca.h], ac_cv_working_alloca_h,
-[AC_TRY_LINK(address@hidden:@include <alloca.h>],
- [char *p = (char *) alloca (2 * sizeof (int));],
- ac_cv_working_alloca_h=yes, ac_cv_working_alloca_h=no)])
+[AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(address@hidden:@include <alloca.h>]],
+ [[char *p = (char *) alloca (2 * sizeof (int));]])],
+ [ac_cv_working_alloca_h=yes],
+ [ac_cv_working_alloca_h=no])])
if test $ac_cv_working_alloca_h = yes; then
AC_DEFINE(HAVE_ALLOCA_H, 1,
[Define if you have <alloca.h> and it should be used
@@ -212,8 +214,8 @@ AC_DEFUN([AC_FUNC_ALLOCA],
fi
AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works,
-[AC_TRY_LINK(
-[#ifdef __GNUC__
+[AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# ifdef _MSC_VER
@@ -233,8 +235,9 @@ AC_DEFUN([AC_FUNC_ALLOCA],
# endif
# endif
#endif
-], [char *p = (char *) alloca (1);],
- ac_cv_func_alloca_works=yes, ac_cv_func_alloca_works=no)])
+]], [[char *p = (char *) alloca (1);]])],
+ [ac_cv_func_alloca_works=yes],
+ [ac_cv_func_alloca_works=no])])
if test $ac_cv_func_alloca_works = yes; then
AC_DEFINE(HAVE_ALLOCA, 1,
@@ -316,9 +319,9 @@ AC_DEFUN([AC_FUNC_CLOSEDIR_VOID],
AC_DEFUN([AC_FUNC_ERROR_AT_LINE],
[AC_LIBSOURCES([error.h, error.c])dnl
AC_CACHE_CHECK([for error_at_line], ac_cv_lib_error_at_line,
-[AC_TRY_LINK([],[error_at_line (0, 0, "", 0, "");],
- [ac_cv_lib_error_at_line=yes],
- [ac_cv_lib_error_at_line=no])])
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([],[error_at_line (0, 0, "", 0, "");])],
+ [ac_cv_lib_error_at_line=yes],
+ [ac_cv_lib_error_at_line=no])])
if test $ac_cv_lib_error_at_line = no; then
AC_LIBOBJ(error)
fi
@@ -375,10 +378,10 @@ AC_DEFUN([AC_FUNC_FSEEKO],
# in glibc 2.1.3, but that breaks too many other things.
# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
AC_CACHE_CHECK([for fseeko], [ac_cv_func_fseeko],
- [AC_TRY_LINK(address@hidden:@include <stdio.h>],
- [return fseeko && fseeko (stdin, 0, 0);],
- [ac_cv_func_fseeko=yes],
- [ac_cv_func_fseeko=no])])
+[AC_LINK_IFELSE([AC_LANG_PROGRAM(address@hidden:@include <stdio.h>],
+ [[return fseeko && fseeko (stdin, 0, 0);]])],
+ [ac_cv_func_fseeko=yes],
+ [ac_cv_func_fseeko=no])])
if test $ac_cv_func_fseeko = yes; then
AC_DEFINE(HAVE_FSEEKO, 1,
[Define if fseeko (and presumably ftello) exists and is declared.])
@@ -1091,10 +1094,11 @@ AC_DEFUN([AC_FUNC_MMAP],
AC_DEFUN([AC_FUNC_OBSTACK],
[AC_LIBSOURCES([obstack.h, obstack.c])dnl
AC_CACHE_CHECK([for obstacks], ac_cv_func_obstack,
-[AC_TRY_LINK(address@hidden:@include "obstack.h"],
- [struct obstack *mem; obstack_free(mem,(char *) 0)],
- [ac_cv_func_obstack=yes],
- [ac_cv_func_obstack=no])])
+[AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(address@hidden:@include "obstack.h"]],
+ [[struct obstack *mem; obstack_free(mem,(char *) 0)]])],
+ [ac_cv_func_obstack=yes],
+ [ac_cv_func_obstack=no])])
if test $ac_cv_func_obstack = yes; then
AC_DEFINE(HAVE_OBSTACK, 1, [Define if libc includes obstacks.])
else
Index: lib/autoconf/headers.m4
--- lib/autoconf/headers.m4 Sun, 01 Jul 2001 18:52:17 +0200 akim
+++ lib/autoconf/headers.m4 Sat, 04 Aug 2001 14:08:49 +0200 akim
@@ -169,10 +169,11 @@ AC_DEFUN([AC_HEADER_DIRENT],
# ---------------
AC_DEFUN([AC_HEADER_MAJOR],
[AC_CACHE_CHECK(whether sys/types.h defines makedev,
- ac_cv_header_sys_types_h_makedev,
-[AC_TRY_LINK([#include <sys/types.h>
-], [return makedev(0, 0);],
- ac_cv_header_sys_types_h_makedev=yes, ac_cv_header_sys_types_h_makedev=no)
+ ac_cv_header_sys_types_h_makedev,
+[AC_LINK_IFELSE([AC_LANG_PROGRAM(address@hidden:@include <sys/types.h>]],
+ [[return makedev(0, 0);]])],
+ [ac_cv_header_sys_types_h_makedev=yes],
+ [ac_cv_header_sys_types_h_makedev=no])
])
if test $ac_cv_header_sys_types_h_makedev = no; then
Index: lib/autoconf/fortran.m4
--- lib/autoconf/fortran.m4 Fri, 27 Jul 2001 20:56:43 +0200 akim
+++ lib/autoconf/fortran.m4 Sat, 04 Aug 2001 14:06:48 +0200 akim
@@ -522,14 +522,14 @@ m4_define([_AC_LANG_PROGRAM_C_F77_HOOKS]
LIBS="$LIBS $FLIBS"
# First, try linking without a dummy main:
- AC_TRY_LINK([], [],
- ac_cv_f77_dummy_main=none,
- ac_cv_f77_dummy_main=unknown)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+ [ac_cv_f77_dummy_main=none],
+ [ac_cv_f77_dummy_main=unknown])
if test $ac_cv_f77_dummy_main = unknown; then
for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do
- AC_TRY_LINK(address@hidden:@define F77_DUMMY_MAIN $ac_func],
- [], [ac_cv_f77_dummy_main=$ac_func; break])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(address@hidden:@define F77_DUMMY_MAIN
$ac_func]])],
+ [ac_cv_f77_dummy_main=$ac_func; break])
done
fi
rm -f conftest*
@@ -567,8 +567,9 @@ AC_DEFUN([AC_F77_MAIN],
ac_cv_f77_main="main" # default entry point name
for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do
- AC_TRY_LINK([#undef F77_DUMMY_MAIN
address@hidden:@define main $ac_func], [], [ac_cv_f77_main=$ac_func; break])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(address@hidden:@undef F77_DUMMY_MAIN
address@hidden:@define main $ac_func])],
+ [ac_cv_f77_main=$ac_func; break])
done
rm -f conftest*
LIBS=$ac_f77_m_save_LIBS
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 11-fyi-ac-link-ifelse.patch,
Akim Demaille <=