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

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