diff --git a/ChangeLog b/ChangeLog index 75f84434..0895703f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-03-29 Bob Friesenhahn + + * configure.ac: Applied patch by Brad Smith to improve pkg-config + static linking by adding -lm to Libs.private when needed. + 2013-03-05 Tom Lane * html/man/tiff2ps.1.html, html/man/tiffcp.1.html, diff --git a/configure b/configure index 8f27f01a..c3c7f1ab 100755 --- a/configure +++ b/configure @@ -16088,6 +16088,9 @@ fi AM_BACKSLASH='\' +tiff_libs_private= + + case "${host_os}" in cygwin* | mingw32* | beos* | darwin*) ;; @@ -16129,20 +16132,18 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 $as_echo "$ac_cv_lib_m_sin" >&6; } if test "x$ac_cv_lib_m_sin" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF - - LIBS="-lm $LIBS" - + libm_lib=yes +else + libm_lib=no fi + if test "x$libm_lib" = "xyes" ; then + LIBS="-lm $LIBS" + tiff_libs_private="-lm ${tiff_libs_private}" + fi ;; esac -tiff_libs_private= - - for ac_header in assert.h fcntl.h io.h limits.h malloc.h search.h sys/time.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` diff --git a/configure.ac b/configure.ac index e1b8d407..d4be12ac 100644 --- a/configure.ac +++ b/configure.ac @@ -154,18 +154,22 @@ LT_LANG([C++]) # Enable support for silent build rules AM_SILENT_RULES +tiff_libs_private= +AC_SUBST(tiff_libs_private) + dnl We don't need to add math library to all targets case "${host_os}" in cygwin* | mingw32* | beos* | darwin*) ;; *) - AC_CHECK_LIB(m,sin,,,) + AC_CHECK_LIB(m,sin,[libm_lib=yes], [libm_lib=no],) + if test "x$libm_lib" = "xyes" ; then + LIBS="-lm $LIBS" + tiff_libs_private="-lm ${tiff_libs_private}" + fi ;; esac -tiff_libs_private= -AC_SUBST(tiff_libs_private) - dnl Checks for header files. AC_CHECK_HEADERS([assert.h fcntl.h io.h limits.h malloc.h search.h sys/time.h unistd.h]) diff --git a/libtiff/tif_config.h.in b/libtiff/tif_config.h.in index b2cea354..72e3d3cb 100644 --- a/libtiff/tif_config.h.in +++ b/libtiff/tif_config.h.in @@ -79,9 +79,6 @@ /* Define to 1 if you have the `lfind' function. */ #undef HAVE_LFIND -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H