]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* aclang.m4 (_AC_PROG_CXX_EXIT_DECLARATION): New.
authorAkim Demaille <akim@epita.fr>
Thu, 11 Jan 2001 15:17:13 +0000 (15:17 +0000)
committerAkim Demaille <akim@epita.fr>
Thu, 11 Jan 2001 15:17:13 +0000 (15:17 +0000)
(AC_PROG_CC, AC_PROG_CXX): Use it.
(AC_PROG_CC_STDC): Be sure to remove tmp files.
* tests/compile.at (AC_TRY_LINK_FUNC): Don't use exit to test it,
since it produces a prototype which conflicts with the one
computed by _AC_PROG_CXX_EXIT_DECLARATION.
* tests/semantics.at (AC_CHECK_FUNCS, AC_HAVE_FUNCS): Likewise.
(AC_HAVE_FUNCS): Test AC_HAVE_FUNCS!

ChangeLog
TODO
aclang.m4
lib/autoconf/c.m4
lib/autoconf/fortran.m4
lib/autoconf/lang.m4
tests/compile.at
tests/semantics.at

index 3370612e7b97c051896b9c9a87a2d509f9e524cc..f5d3523f7d8c346f342b9df303476c16b824c348 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2001-01-11  Akim Demaille  <akim@epita.fr>
+
+       * aclang.m4 (_AC_PROG_CXX_EXIT_DECLARATION): New.
+       (AC_PROG_CC, AC_PROG_CXX): Use it.
+       (AC_PROG_CC_STDC): Be sure to remove tmp files.
+       * tests/compile.at (AC_TRY_LINK_FUNC): Don't use exit to test it,
+       since it produces a prototype which conflicts with the one
+       computed by _AC_PROG_CXX_EXIT_DECLARATION.
+       * tests/semantics.at (AC_CHECK_FUNCS, AC_HAVE_FUNCS): Likewise.
+       (AC_HAVE_FUNCS): Test AC_HAVE_FUNCS!
+
 2001-01-11  Kevin Ryde  <user42@zip.com.au>
 
        * autoconf.texi (Shellology): Fix an @end itemize, and a typo.
diff --git a/TODO b/TODO
index 2ef384c77e790b26c6eaba10260a7fd799ded0eb..3b301fbeb8cf8a115cbcdb61354215fe68241b9c 100644 (file)
--- a/TODO
+++ b/TODO
@@ -40,6 +40,12 @@ Write a test that checks that it honors the values set by the user.
 Chose a means to declare patterns to catch, means to escape the
 control, and document it.
 
+** AC_CHECK_FUNCS and AC_TRY_LINK_FUNC
+I have still not understood what's the difference  between the two
+which requires to have two different sources: AC_LANG_CALL and
+AC_LANG_FUNC_LINK_TRY (which names seem to be inappropriate).
+Wouldn't one be enough?
+
 * Autoconf 2.51 or so
 
 ** AC_FUNC_GETLOADAVG
index d60782df146f9979783f046c6836d1b34f4ffae9..58650bdb2759aad527ec351b5c6f5594fe426fb8 100644 (file)
--- a/aclang.m4
+++ b/aclang.m4
@@ -405,7 +405,7 @@ m4_define([AC_LANG_BOOL_COMPILE_TRY(C)],
 # We need `stdio.h' to open a `FILE', so the prologue defaults to the
 # inclusion of `stdio.h'.
 m4_define([AC_LANG_INT_SAVE(C)],
-[AC_LANG_PROGRAM([m4_default([$1], [@%:@include "stdio.h"])],
+[AC_LANG_PROGRAM([m4_default([$1], [@%:@include <stdio.h>])],
 [FILE *f = fopen ("conftestval", "w");
 if (!f)
   exit (1);
@@ -419,42 +419,31 @@ fclose (f);])])
 
 # AC_LANG_SOURCE(C++)(BODY)
 # -------------------------
-m4_define([AC_LANG_SOURCE(C++)],
-[#line __oline__ "configure"
-#include "confdefs.h"
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-$1])
+m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(C++)])
 
 
 # AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
 # ----------------------------------------
-# Same as C.
 m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(C++)])
 
 
 # AC_LANG_CALL(C++)(PROLOGUE, FUNCTION)
 # -------------------------------------
-# Same as C.
 m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(C++)])
 
 
 # AC_LANG_FUNC_LINK_TRY(C++)(FUNCTION)
 # ------------------------------------
-# Same as C.
 m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(C++)])
 
 
 # AC_LANG_BOOL_COMPILE_TRY(C++)(PROLOGUE, EXPRESSION)
 # ---------------------------------------------------
-# Same as C.
 m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(C++)])
 
 
 # AC_LANG_INT_SAVE(C++)(PROLOGUE, EXPRESSION)
 # -------------------------------------------
-# Same as C.
 m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(C++)])
 
 
@@ -879,6 +868,14 @@ GCC=`test $ac_compiler_gnu = yes && echo yes`
 AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
 AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CC_G
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+_AC_COMPILE_IFELSE([@%:@ifndef __cplusplus
+  choke me
+@%:@endif],
+                   [_AC_PROG_CXX_EXIT_DECLARATION])
 AC_LANG_POP
 ])# AC_PROG_CC
 
@@ -987,7 +984,6 @@ fi
 ])# AC_PROG_CC_C_O
 
 
-
 # ---------------------- #
 # 3c. The C++ compiler.  #
 # ---------------------- #
@@ -1076,6 +1072,7 @@ GXX=`test $ac_compiler_gnu = yes && echo yes`
 AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
 AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CXX_G
+_AC_PROG_CXX_EXIT_DECLARATION
 AC_LANG_POP
 ])# AC_PROG_CXX
 
@@ -1111,6 +1108,32 @@ fi[]dnl
 ])# _AC_PROG_CXX_G
 
 
+# _AC_PROG_CXX_EXIT_DECLARATION
+# -----------------------------
+# Find a valid prototype for exit and declare it in confdefs.h.
+m4_define([_AC_PROG_CXX_EXIT_DECLARATION],
+[for ac_declaration in \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);' \
+   ''
+do
+  _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <stdlib.h>
+$ac_declaration],
+                                      [exit (42);])],
+                     [],
+                     [continue])
+  _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration],
+                                      [exit (42);])],
+                     [break])
+done
+echo '#ifdef __cplusplus' >>confdefs.h
+echo $ac_declaration      >>confdefs.h
+echo '#endif'             >>confdefs.h
+])# _AC_PROG_CXX_EXIT_DECLARATION
+
 
 # ----------------------------- #
 # 3d. The Fortran 77 compiler.  #
@@ -1317,9 +1340,9 @@ do
   CC="$ac_save_CC $ac_arg"
   AC_COMPILE_IFELSE([],
                     [ac_cv_prog_cc_stdc=$ac_arg
-rm -f conftest.$ac_ext conftest.$ac_objext
 break])
 done
+rm -f conftest.$ac_ext conftest.$ac_objext
 CC=$ac_save_CC
 ])
 case "x$ac_cv_prog_cc_stdc" in
index d60782df146f9979783f046c6836d1b34f4ffae9..58650bdb2759aad527ec351b5c6f5594fe426fb8 100644 (file)
@@ -405,7 +405,7 @@ m4_define([AC_LANG_BOOL_COMPILE_TRY(C)],
 # We need `stdio.h' to open a `FILE', so the prologue defaults to the
 # inclusion of `stdio.h'.
 m4_define([AC_LANG_INT_SAVE(C)],
-[AC_LANG_PROGRAM([m4_default([$1], [@%:@include "stdio.h"])],
+[AC_LANG_PROGRAM([m4_default([$1], [@%:@include <stdio.h>])],
 [FILE *f = fopen ("conftestval", "w");
 if (!f)
   exit (1);
@@ -419,42 +419,31 @@ fclose (f);])])
 
 # AC_LANG_SOURCE(C++)(BODY)
 # -------------------------
-m4_define([AC_LANG_SOURCE(C++)],
-[#line __oline__ "configure"
-#include "confdefs.h"
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-$1])
+m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(C++)])
 
 
 # AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
 # ----------------------------------------
-# Same as C.
 m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(C++)])
 
 
 # AC_LANG_CALL(C++)(PROLOGUE, FUNCTION)
 # -------------------------------------
-# Same as C.
 m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(C++)])
 
 
 # AC_LANG_FUNC_LINK_TRY(C++)(FUNCTION)
 # ------------------------------------
-# Same as C.
 m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(C++)])
 
 
 # AC_LANG_BOOL_COMPILE_TRY(C++)(PROLOGUE, EXPRESSION)
 # ---------------------------------------------------
-# Same as C.
 m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(C++)])
 
 
 # AC_LANG_INT_SAVE(C++)(PROLOGUE, EXPRESSION)
 # -------------------------------------------
-# Same as C.
 m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(C++)])
 
 
@@ -879,6 +868,14 @@ GCC=`test $ac_compiler_gnu = yes && echo yes`
 AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
 AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CC_G
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+_AC_COMPILE_IFELSE([@%:@ifndef __cplusplus
+  choke me
+@%:@endif],
+                   [_AC_PROG_CXX_EXIT_DECLARATION])
 AC_LANG_POP
 ])# AC_PROG_CC
 
@@ -987,7 +984,6 @@ fi
 ])# AC_PROG_CC_C_O
 
 
-
 # ---------------------- #
 # 3c. The C++ compiler.  #
 # ---------------------- #
@@ -1076,6 +1072,7 @@ GXX=`test $ac_compiler_gnu = yes && echo yes`
 AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
 AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CXX_G
+_AC_PROG_CXX_EXIT_DECLARATION
 AC_LANG_POP
 ])# AC_PROG_CXX
 
@@ -1111,6 +1108,32 @@ fi[]dnl
 ])# _AC_PROG_CXX_G
 
 
+# _AC_PROG_CXX_EXIT_DECLARATION
+# -----------------------------
+# Find a valid prototype for exit and declare it in confdefs.h.
+m4_define([_AC_PROG_CXX_EXIT_DECLARATION],
+[for ac_declaration in \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);' \
+   ''
+do
+  _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <stdlib.h>
+$ac_declaration],
+                                      [exit (42);])],
+                     [],
+                     [continue])
+  _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration],
+                                      [exit (42);])],
+                     [break])
+done
+echo '#ifdef __cplusplus' >>confdefs.h
+echo $ac_declaration      >>confdefs.h
+echo '#endif'             >>confdefs.h
+])# _AC_PROG_CXX_EXIT_DECLARATION
+
 
 # ----------------------------- #
 # 3d. The Fortran 77 compiler.  #
@@ -1317,9 +1340,9 @@ do
   CC="$ac_save_CC $ac_arg"
   AC_COMPILE_IFELSE([],
                     [ac_cv_prog_cc_stdc=$ac_arg
-rm -f conftest.$ac_ext conftest.$ac_objext
 break])
 done
+rm -f conftest.$ac_ext conftest.$ac_objext
 CC=$ac_save_CC
 ])
 case "x$ac_cv_prog_cc_stdc" in
index d60782df146f9979783f046c6836d1b34f4ffae9..58650bdb2759aad527ec351b5c6f5594fe426fb8 100644 (file)
@@ -405,7 +405,7 @@ m4_define([AC_LANG_BOOL_COMPILE_TRY(C)],
 # We need `stdio.h' to open a `FILE', so the prologue defaults to the
 # inclusion of `stdio.h'.
 m4_define([AC_LANG_INT_SAVE(C)],
-[AC_LANG_PROGRAM([m4_default([$1], [@%:@include "stdio.h"])],
+[AC_LANG_PROGRAM([m4_default([$1], [@%:@include <stdio.h>])],
 [FILE *f = fopen ("conftestval", "w");
 if (!f)
   exit (1);
@@ -419,42 +419,31 @@ fclose (f);])])
 
 # AC_LANG_SOURCE(C++)(BODY)
 # -------------------------
-m4_define([AC_LANG_SOURCE(C++)],
-[#line __oline__ "configure"
-#include "confdefs.h"
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-$1])
+m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(C++)])
 
 
 # AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
 # ----------------------------------------
-# Same as C.
 m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(C++)])
 
 
 # AC_LANG_CALL(C++)(PROLOGUE, FUNCTION)
 # -------------------------------------
-# Same as C.
 m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(C++)])
 
 
 # AC_LANG_FUNC_LINK_TRY(C++)(FUNCTION)
 # ------------------------------------
-# Same as C.
 m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(C++)])
 
 
 # AC_LANG_BOOL_COMPILE_TRY(C++)(PROLOGUE, EXPRESSION)
 # ---------------------------------------------------
-# Same as C.
 m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(C++)])
 
 
 # AC_LANG_INT_SAVE(C++)(PROLOGUE, EXPRESSION)
 # -------------------------------------------
-# Same as C.
 m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(C++)])
 
 
@@ -879,6 +868,14 @@ GCC=`test $ac_compiler_gnu = yes && echo yes`
 AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
 AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CC_G
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+_AC_COMPILE_IFELSE([@%:@ifndef __cplusplus
+  choke me
+@%:@endif],
+                   [_AC_PROG_CXX_EXIT_DECLARATION])
 AC_LANG_POP
 ])# AC_PROG_CC
 
@@ -987,7 +984,6 @@ fi
 ])# AC_PROG_CC_C_O
 
 
-
 # ---------------------- #
 # 3c. The C++ compiler.  #
 # ---------------------- #
@@ -1076,6 +1072,7 @@ GXX=`test $ac_compiler_gnu = yes && echo yes`
 AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
 AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CXX_G
+_AC_PROG_CXX_EXIT_DECLARATION
 AC_LANG_POP
 ])# AC_PROG_CXX
 
@@ -1111,6 +1108,32 @@ fi[]dnl
 ])# _AC_PROG_CXX_G
 
 
+# _AC_PROG_CXX_EXIT_DECLARATION
+# -----------------------------
+# Find a valid prototype for exit and declare it in confdefs.h.
+m4_define([_AC_PROG_CXX_EXIT_DECLARATION],
+[for ac_declaration in \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);' \
+   ''
+do
+  _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <stdlib.h>
+$ac_declaration],
+                                      [exit (42);])],
+                     [],
+                     [continue])
+  _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration],
+                                      [exit (42);])],
+                     [break])
+done
+echo '#ifdef __cplusplus' >>confdefs.h
+echo $ac_declaration      >>confdefs.h
+echo '#endif'             >>confdefs.h
+])# _AC_PROG_CXX_EXIT_DECLARATION
+
 
 # ----------------------------- #
 # 3d. The Fortran 77 compiler.  #
@@ -1317,9 +1340,9 @@ do
   CC="$ac_save_CC $ac_arg"
   AC_COMPILE_IFELSE([],
                     [ac_cv_prog_cc_stdc=$ac_arg
-rm -f conftest.$ac_ext conftest.$ac_objext
 break])
 done
+rm -f conftest.$ac_ext conftest.$ac_objext
 CC=$ac_save_CC
 ])
 case "x$ac_cv_prog_cc_stdc" in
index d60782df146f9979783f046c6836d1b34f4ffae9..58650bdb2759aad527ec351b5c6f5594fe426fb8 100644 (file)
@@ -405,7 +405,7 @@ m4_define([AC_LANG_BOOL_COMPILE_TRY(C)],
 # We need `stdio.h' to open a `FILE', so the prologue defaults to the
 # inclusion of `stdio.h'.
 m4_define([AC_LANG_INT_SAVE(C)],
-[AC_LANG_PROGRAM([m4_default([$1], [@%:@include "stdio.h"])],
+[AC_LANG_PROGRAM([m4_default([$1], [@%:@include <stdio.h>])],
 [FILE *f = fopen ("conftestval", "w");
 if (!f)
   exit (1);
@@ -419,42 +419,31 @@ fclose (f);])])
 
 # AC_LANG_SOURCE(C++)(BODY)
 # -------------------------
-m4_define([AC_LANG_SOURCE(C++)],
-[#line __oline__ "configure"
-#include "confdefs.h"
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-$1])
+m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(C++)])
 
 
 # AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
 # ----------------------------------------
-# Same as C.
 m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(C++)])
 
 
 # AC_LANG_CALL(C++)(PROLOGUE, FUNCTION)
 # -------------------------------------
-# Same as C.
 m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(C++)])
 
 
 # AC_LANG_FUNC_LINK_TRY(C++)(FUNCTION)
 # ------------------------------------
-# Same as C.
 m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(C++)])
 
 
 # AC_LANG_BOOL_COMPILE_TRY(C++)(PROLOGUE, EXPRESSION)
 # ---------------------------------------------------
-# Same as C.
 m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(C++)])
 
 
 # AC_LANG_INT_SAVE(C++)(PROLOGUE, EXPRESSION)
 # -------------------------------------------
-# Same as C.
 m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(C++)])
 
 
@@ -879,6 +868,14 @@ GCC=`test $ac_compiler_gnu = yes && echo yes`
 AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
 AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CC_G
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+_AC_COMPILE_IFELSE([@%:@ifndef __cplusplus
+  choke me
+@%:@endif],
+                   [_AC_PROG_CXX_EXIT_DECLARATION])
 AC_LANG_POP
 ])# AC_PROG_CC
 
@@ -987,7 +984,6 @@ fi
 ])# AC_PROG_CC_C_O
 
 
-
 # ---------------------- #
 # 3c. The C++ compiler.  #
 # ---------------------- #
@@ -1076,6 +1072,7 @@ GXX=`test $ac_compiler_gnu = yes && echo yes`
 AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
 AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CXX_G
+_AC_PROG_CXX_EXIT_DECLARATION
 AC_LANG_POP
 ])# AC_PROG_CXX
 
@@ -1111,6 +1108,32 @@ fi[]dnl
 ])# _AC_PROG_CXX_G
 
 
+# _AC_PROG_CXX_EXIT_DECLARATION
+# -----------------------------
+# Find a valid prototype for exit and declare it in confdefs.h.
+m4_define([_AC_PROG_CXX_EXIT_DECLARATION],
+[for ac_declaration in \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);' \
+   ''
+do
+  _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <stdlib.h>
+$ac_declaration],
+                                      [exit (42);])],
+                     [],
+                     [continue])
+  _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration],
+                                      [exit (42);])],
+                     [break])
+done
+echo '#ifdef __cplusplus' >>confdefs.h
+echo $ac_declaration      >>confdefs.h
+echo '#endif'             >>confdefs.h
+])# _AC_PROG_CXX_EXIT_DECLARATION
+
 
 # ----------------------------- #
 # 3d. The Fortran 77 compiler.  #
@@ -1317,9 +1340,9 @@ do
   CC="$ac_save_CC $ac_arg"
   AC_COMPILE_IFELSE([],
                     [ac_cv_prog_cc_stdc=$ac_arg
-rm -f conftest.$ac_ext conftest.$ac_objext
 break])
 done
+rm -f conftest.$ac_ext conftest.$ac_objext
 CC=$ac_save_CC
 ])
 case "x$ac_cv_prog_cc_stdc" in
index 0adda3c99b53caa1bbcfabb2b432784fbaa5d1af..817ef1df8c8d74e4511849b9bd1a7c9800374533 100644 (file)
@@ -109,8 +109,8 @@ AT_CLEANUP
 ## ------------------ ##
 
 AT_CHECK_MACRO([AC_TRY_LINK_FUNC],
-[AC_TRY_LINK_FUNC(exit,,
-                  [AC_MSG_ERROR([cannot find `exit'])])
+[AC_TRY_LINK_FUNC(printf,,
+                  [AC_MSG_ERROR([cannot find `printf'])])
 AC_TRY_LINK_FUNC(Be_doomed_if_your_libc_has_a_function_named_like_this,
                  [AC_MSG_ERROR([found a nonexistent function])])])
 
index fd470e62e33f9df6b4df9ce2a54a7978d18a66e7..6d4adf80f38169f1afcb2a5cadc0ec2877eb4e88 100644 (file)
@@ -38,12 +38,12 @@ AT_CHECK_MACRO([AC_CHECK_DECLS],
 # AC_CHECK_FUNCS
 # --------------
 # Check that it performs the correct actions:
-# Must define HAVE_EXIT, but not HAVE_AUTOCONF_TIXE
+# Must define HAVE_PRINTF, but not HAVE_AUTOCONF_FTNIRP
 AT_CHECK_MACRO([AC_CHECK_FUNCS],
-[AC_CHECK_FUNCS(exit autoconf_tixe)],
+[AC_CHECK_FUNCS(printf autoconf_ftnirp)],
 [AT_CHECK_DEFINES(
-[/* #undef HAVE_AUTOCONF_TIXE */
-#define HAVE_EXIT 1
+[/* #undef HAVE_AUTOCONF_FTNIRP */
+#define HAVE_PRINTF 1
 ])])
 
 
@@ -52,10 +52,10 @@ AT_CHECK_MACRO([AC_CHECK_FUNCS],
 # This macro is an obsolete version of AC_CHECK_FUNCS.  Running this
 # test allows to check that AU_ALIAS'ed macros work properly.
 AT_CHECK_MACRO([AC_HAVE_FUNCS],
-[AC_CHECK_FUNCS(exit autoconf_tixe)],
+[AC_HAVE_FUNCS(printf autoconf_ftnirp)],
 [AT_CHECK_DEFINES(
-[/* #undef HAVE_AUTOCONF_TIXE */
-#define HAVE_EXIT 1
+[/* #undef HAVE_AUTOCONF_FTNIRP */
+#define HAVE_PRINTF 1
 ])])