Blame SOURCES/autoconf-2.13-c++exit.patch

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