In regard to: Re: libtool C++ link bug with -lm functions with Sun Workshop...:
On Wed, 19 Mar 2008, Tim Mooney wrote:
That means that doing something like
AC_INIT(lttest, 0.60.5)
AC_CONFIG_SRCDIR(configure.ac)
AC_PROG_CXX
AC_LANG([C++])
AC_CHECK_FUNCS(sqrt)
AC_OUTPUT
will always detect sqrt(), because the C++ compiler added `-lm -lc'
behind the scenes.
Then it seems like you did something wrong and libtool is not to blame.
I don't think so. I discovered the problem with GNU aspell. The snippet
I show above is just to illustrate the problem.
Perhaps it is not best to run most of your configure script using the C++
compiler. Only run the C++ compiler to test C++ things.
I don't disagree, but at the same time, if everything a project is going
to build is going to be compiled by the C++ compiler, doesn't it make
sense for the C++ compiler to actually do the tests? If it's the C++
compiler that needs to see the prototype for sqrt(), and it's the C++
compiler that's going to initiate the link, it doesn't make a lot of
sense for the tests to be conducted by the C compiler. That's hardly a
good test; there are several reasons why what the C compiler can see for
prototypes or test link might differ from what the C++ compiler would.
There are projects out there, beyond GNU aspell, that are using the C++
compiler for many of the configure tests. Are they all wrong to do so?
Tim
--
Tim Mooney [EMAIL PROTECTED]
Information Technology Services (701) 231-1076 (Voice)
Room 242-J6, IACC Building (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool