check whether -lm is required -> enable crosscompile for windows
authorHans Ulrich Niedermann <hun@n-dimensional.de>
Wed, 9 Feb 2005 01:44:06 +0000 (02:44 +0100)
committerHans Ulrich Niedermann <hun@n-dimensional.de>
Wed, 9 Feb 2005 01:44:06 +0000 (02:44 +0100)
configure.in
libexif/Makefile.am

index f019da4..9be0bab 100644 (file)
@@ -38,6 +38,18 @@ AC_NEED_STDINT_H([libexif/_stdint.h])
 
 
 dnl ---------------------------------------------------------------------------
+dnl Whether -lm is required for our math functions
+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([
+*** Couldn't find sqrt
+]))])
+AC_SUBST(MATHLIBS)
+
+
+dnl ---------------------------------------------------------------------------
 dnl i18n support
 dnl ---------------------------------------------------------------------------
 GETTEXT_PACKAGE=${PACKAGE}-${LIBEXIF_CURRENT}
index 1a87b52..6154e85 100644 (file)
@@ -22,7 +22,8 @@ libexif_la_SOURCES =          \
        exif-tag.c              \
        exif-utils.c            \
        i18n.h
-libexif_la_LIBADD = -lm                \
+libexif_la_LIBADD =                    \
+       $(MATHLIBS)                     \
        $(LTLIBINTL)                    \
        canon/libmnote-canon.la         \
        olympus/libmnote-olympus.la     \