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

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