1bd39d
--- autoconf-2.13/acgeneral.m4~	Tue Jun 26 17:00:28 2001
1bd39d
+++ autoconf-2.13/acgeneral.m4	Tue Jun 26 17:00:28 2001
1bd39d
@@ -1817,10 +1817,6 @@
1bd39d
 [cat > conftest.$ac_ext <
1bd39d
 [#]line __oline__ "configure"
1bd39d
 #include "confdefs.h"
1bd39d
-ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
1bd39d
-extern "C" void exit(int);
1bd39d
-#endif
1bd39d
-])dnl
1bd39d
 [$1]
1bd39d
 EOF
1bd39d
 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1bd39d
--- autoconf-2.13/acspecific.m4~	Tue Jun 26 17:04:34 2001
1bd39d
+++ autoconf-2.13/acspecific.m4		Tue Jun 26 17:04:34 2001
1bd39d
@@ -152,8 +152,41 @@
1bd39d
     CXXFLAGS=
1bd39d
   fi
1bd39d
 fi
1bd39d
+
1bd39d
+AC_PROG_CXX_EXIT_DECLARATION
1bd39d
 ])
1bd39d
 
1bd39d
+
1bd39d
+# AC_PROG_CXX_EXIT_DECLARATION
1bd39d
+# -----------------------------
1bd39d
+# Find a valid prototype for exit and declare it in confdefs.h.
1bd39d
+AC_DEFUN(AC_PROG_CXX_EXIT_DECLARATION,
1bd39d
+[for ac_declaration in \
1bd39d
+   ''\
1bd39d
+   '#include <stdlib.h>' \
1bd39d
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
1bd39d
+   'extern "C" void std::exit (int); using std::exit;' \
1bd39d
+   'extern "C" void exit (int) throw ();' \
1bd39d
+   'extern "C" void exit (int);' \
1bd39d
+   'void exit (int);'
1bd39d
+do
1bd39d
+  AC_TRY_COMPILE([#include <stdlib.h>
1bd39d
+$ac_declaration], 
1bd39d
+                 [exit (42);],
1bd39d
+                 [],
1bd39d
+                 [continue])
1bd39d
+  AC_TRY_COMPILE([$ac_declaration],
1bd39d
+                 [exit (42);],
1bd39d
+                 [break])
1bd39d
+done
1bd39d
+if test -n "$ac_declaration"; then
1bd39d
+  echo '#ifdef __cplusplus' >>confdefs.h
1bd39d
+  echo $ac_declaration      >>confdefs.h
1bd39d
+  echo '#endif'             >>confdefs.h
1bd39d
+fi
1bd39d
+])# AC_PROG_CXX_EXIT_DECLARATION
1bd39d
+
1bd39d
+
1bd39d
 dnl Determine a Fortran 77 compiler to use.  If `F77' is not already set
1bd39d
 dnl in the environment, check for `g77', `f77' and `f2c', in that order.
1bd39d
 dnl Set the output variable `F77' to the name of the compiler found.