From: Hans U. N. <hu...@us...> - 2005-04-24 09:01:13
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15727 Modified Files: configure.ac Log Message: make sqrt/libm detection work even in case of CPPFLAGS=-Werror Index: configure.ac =================================================================== RCS file: /cvsroot/libexif/libexif/configure.ac,v retrieving revision 1.5 retrieving revision 1.6 diff -u -p -d -r1.5 -r1.6 --- configure.ac 15 Apr 2005 21:51:41 -0000 1.5 +++ configure.ac 24 Apr 2005 09:01:05 -0000 1.6 @@ -49,10 +49,28 @@ dnl Whether -lm is required for our math dnl --------------------------------------------------------------------------- # we need sqrt and pow, but checking for sqrt should be sufficient -AC_CHECK_FUNC([sqrt],,[ -AC_CHECK_LIB([m],[sqrt],[MATHLIBS="-lm"],AC_MSG_ERROR([ +AC_ARG_VAR([MATHLIBS],[The libraries required for mathematical functions, e.g. -lm]) +if test "x$MATHLIBS" = "x"; then + # We must not compile with -Wall -Werror here: + # char *sqrt() conflicts with double sin(const double xx) in any case. + CFLAGS_save="$CPPFLAGS" + CPPFLAGS_save="$CPPFLAGS" + CPPFLAGS="" + CFLAGS="" + AC_CHECK_FUNC([sqrt],[ + MATHLIBS="" + ],[ + AC_CHECK_LIB([m],[sqrt],[ + MATHLIBS="-lm" + ],[ + AC_MSG_ERROR([ *** Could not find sqrt() function -]))]) +]) + ]) + ]) + CFLAGS="$CFLAGS_save" + CPPFLAGS="$CPPFLAGS_save" +fi AC_SUBST([MATHLIBS]) |