autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ fix and test


From: Pavel Roskin
Subject: Re: C++ fix and test
Date: Tue, 19 Dec 2000 07:41:49 -0500 (EST)

Hello, Akim!

> Unless you know for sure a simple include will break things, I'd
> rather go for the simple solution, and make it complex later if
> needed.  No extern "C", no test.

I was going to suggest exactly that. And the test should be added, of
course.

ChangeLog:
        * aclang.m4: (AC_LANG_SOURCE(C++)): Include stdlib.h instead
        of declaring exit().
        * tests/compile.at: (AC_CHECK_LIB, C++): Test for AC_CHECK_LIB
        when the current language is C++.

Regards,
Pavel Roskin

________________________
Index: aclang.m4
--- aclang.m4
+++ aclang.m4
@@ -423,7 +423,8 @@
 [#line __oline__ "configure"
 #include "confdefs.h"
 #ifdef __cplusplus
-extern "C" void exit (int);
+/* Make sure that exit() is declared */
+#include <stdlib.h>
 #endif
 $1])

Index: tests/compile.at
--- tests/compile.at
+++ tests/compile.at
@@ -116,6 +116,24 @@



+## -------------- ##
+## C++ Compiler.  ##
+## -------------- ##
+
+
+# AC_CHECK_LIB, C++
+# -----------------
+# `cos' should be either in libc or in libm.
+# The compiler can issue warnings about `cos' being defined differently,
+# but configure should find it.
+AT_CHECK_MACRO([AC_CHECK_LIB, C++],
+[AC_LANG(C++)
+AC_TRY_LINK_FUNC(cos, [AS_EXIT(0)])
+AC_CHECK_LIB(m, cos,,
+             [AC_MSG_ERROR([cannot find `cos'])])])
+
+
+
 ## --------------------- ##
 ## Fortran 77 Compiler.  ##
 ## --------------------- ##
________________________





reply via email to

[Prev in Thread] Current Thread [Next in Thread]