From 2acd478bb60ea8a9b7030fd8452fd37dc3a54e34 Mon Sep 17 00:00:00 2001 From: Cristy Date: Wed, 11 Sep 2019 08:08:02 -0400 Subject: [PATCH] Update to latest autoconf/automake configuration files --- Makefile.in | 1 + config/config.h.in | 9 ++- configure | 133 +++++++++++++++++++++++++++++++++++++++++---- configure.ac | 50 +++++++++++++++-- 4 files changed, 174 insertions(+), 19 deletions(-) diff --git a/Makefile.in b/Makefile.in index 775ee356d..b6f1d0d19 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3281,6 +3281,7 @@ SVGDecodeDelegate = @SVGDecodeDelegate@ SYSCONF_DIR = @SYSCONF_DIR@ ShowImageDelegate = @ShowImageDelegate@ TAR = @TAR@ +TCMALLOC_LIBS = @TCMALLOC_LIBS@ THREAD_LIBS = @THREAD_LIBS@ TIFF_LIBS = @TIFF_LIBS@ TraceEncodeDelegate = @TraceEncodeDelegate@ diff --git a/config/config.h.in b/config/config.h.in index b061b73aa..0253fc7be 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -575,6 +575,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H +/* Define if you have tcmalloc library */ +#undef HAVE_TCMALLOC + /* Define to 1 if you have the `telldir' function. */ #undef HAVE_TELLDIR @@ -628,6 +631,9 @@ /* Define to 1 if you have the `ulltostr' function. */ #undef HAVE_ULLTOSTR +/* Define if you have umem memory allocation library */ +#undef HAVE_UMEM + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H @@ -724,9 +730,6 @@ /* Define if you have jemalloc memory allocation library */ #undef HasJEMALLOC -/* Define if you have umem memory allocation library */ -#undef HasUMEM - /* Directory where ImageMagick architecture headers live. */ #undef INCLUDEARCH_PATH diff --git a/configure b/configure index 1985cc5aa..b3726f917 100755 --- a/configure +++ b/configure @@ -896,10 +896,13 @@ XMKMF BZLIB_LIBS BZLIB_DELEGATE_FALSE BZLIB_DELEGATE_TRUE +TCMALLOC_LIBS +HAVE_TCMALLOC_FALSE +HAVE_TCMALLOC_TRUE CCMALLOCDelegate UMEM_LIBS -HasUMEM_FALSE -HasUMEM_TRUE +HAVE_UMEM_FALSE +HAVE_UMEM_TRUE JEMALLOC_LIBS HasJEMALLOC_FALSE HasJEMALLOC_TRUE @@ -1194,6 +1197,7 @@ enable_maintainer_mode enable_hugepages enable_ccmalloc enable_efence +with_tcmalloc enable_prof enable_gprof enable_gcov @@ -2003,6 +2007,7 @@ Optional Packages: --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-modules enable building dynamically loadable modules + --with-tcmalloc enable 'tcmalloc' memory debug support --with-method-prefix=PREFIX prefix MagickCore API methods --with-utilities enable building command-line utilities (default yes) @@ -4571,7 +4576,7 @@ MAGICK_PATCHLEVEL_VERSION=65 MAGICK_VERSION=7.0.8-65 -MAGICK_GIT_REVISION=16093:031d3202e:20190908 +MAGICK_GIT_REVISION=16115:55abbb402:20190911 # Substitute library versioning @@ -22889,6 +22894,19 @@ else fi +# Enable use of tcmalloc library. + +# Check whether --with-tcmalloc was given. +if test "${with_tcmalloc+set}" = set; then : + withval=$with_tcmalloc; with_tcmalloc=$withval +else + with_tcmalloc='no' +fi + +if test "$with_tcmalloc" != 'no' ; then + DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tcmalloc=$with_tcmalloc " +fi + # Enable prof-based profiling support # Check whether --enable-prof was given. if test "${enable_prof+set}" = set; then : @@ -28317,7 +28335,7 @@ $as_echo "no -- some components failed test" >&6; } UMEM_LIBS='-lumem' LIBS="$UMEM_LIBS $LIBS" -$as_echo "#define HasUMEM 1" >>confdefs.h +$as_echo "#define HAVE_UMEM 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -28329,11 +28347,11 @@ $as_echo "no" >&6; } fi fi if test "$have_umem" = 'yes'; then - HasUMEM_TRUE= - HasUMEM_FALSE='#' + HAVE_UMEM_TRUE= + HAVE_UMEM_FALSE='#' else - HasUMEM_TRUE='#' - HasUMEM_FALSE= + HAVE_UMEM_TRUE='#' + HAVE_UMEM_FALSE= fi @@ -28458,6 +28476,91 @@ if test "$enable_efence" = 'yes'; then LIBS="$EFENCE_LIBS $LIBS" fi +# +# Check for tcmalloc library +# +have_tcmalloc='no' +TCMALLOC_LIBS='' +OLIBS="$LIBS" +if test "$have_threads" = 'yes' -a "$with_tcmalloc" != 'no'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking tcmalloc library support " >&5 +$as_echo_n "checking tcmalloc library support ... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } + failed=0 + passed=0 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mallinfo in -ltcmalloc_minimal" >&5 +$as_echo_n "checking for mallinfo in -ltcmalloc_minimal... " >&6; } +if ${ac_cv_lib_tcmalloc_minimal_mallinfo+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltcmalloc_minimal $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mallinfo (); +int +main () +{ +return mallinfo (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tcmalloc_minimal_mallinfo=yes +else + ac_cv_lib_tcmalloc_minimal_mallinfo=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tcmalloc_minimal_mallinfo" >&5 +$as_echo "$ac_cv_lib_tcmalloc_minimal_mallinfo" >&6; } +if test "x$ac_cv_lib_tcmalloc_minimal_mallinfo" = xyes; then : + passed=`expr $passed + 1` +else + failed=`expr $failed + 1` +fi + + + if test $passed -gt 0; then + if test $failed -gt 0; then + have_tcmalloc='no (some components failed test)' + else + TCMALLOC_LIBS=-ltcmalloc_minimal + LIBS="$TCMALLOC_LIBS $LIBS" + CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" + +$as_echo "#define HAVE_TCMALLOC 1" >>confdefs.h + + have_tcmalloc='yes' + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if tcmalloc memory allocation library is complete " >&5 +$as_echo_n "checking if tcmalloc memory allocation library is complete ... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_tcmalloc" >&5 +$as_echo "$have_tcmalloc" >&6; } +fi + if test "$have_tcmalloc" = 'yes'; then + HAVE_TCMALLOC_TRUE= + HAVE_TCMALLOC_FALSE='#' +else + HAVE_TCMALLOC_TRUE='#' + HAVE_TCMALLOC_FALSE= +fi + + + # # Check for BZLIB @@ -36978,9 +37081,9 @@ fi # if test "$build_modules" != 'no'; then - MAGICK_DEP_LIBS="$USER_LIBS $LCMS_LIBS $FREETYPE_LIBS $RAQM_LIBS $LQR_LIBS $FFTW_LIBS $XML_LIBS $FLIF_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $WS2_32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS" + MAGICK_DEP_LIBS="$USER_LIBS $LCMS_LIBS $FREETYPE_LIBS $RAQM_LIBS $LQR_LIBS $FFTW_LIBS $XML_LIBS $FLIF_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $WS2_32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS" else - MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $RAQM_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FLIF_LIBS $FPX_LIBS $FONTCONFIG_LIBS $HEIF_LIBS $WEBPMUX_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIBS $PANGO_LIBS $RAW_R_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $WS2_32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS" + MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $RAQM_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FLIF_LIBS $FPX_LIBS $FONTCONFIG_LIBS $HEIF_LIBS $WEBPMUX_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIBS $PANGO_LIBS $RAW_R_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $WS2_32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS" fi MAGICK_EXTRA_DEP_LIBS="$GOMP_LIBS" @@ -37258,8 +37361,12 @@ if test -z "${HasJEMALLOC_TRUE}" && test -z "${HasJEMALLOC_FALSE}"; then as_fn_error $? "conditional \"HasJEMALLOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HasUMEM_TRUE}" && test -z "${HasUMEM_FALSE}"; then - as_fn_error $? "conditional \"HasUMEM\" was never defined. +if test -z "${HAVE_UMEM_TRUE}" && test -z "${HAVE_UMEM_FALSE}"; then + as_fn_error $? "conditional \"HAVE_UMEM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_TCMALLOC_TRUE}" && test -z "${HAVE_TCMALLOC_FALSE}"; then + as_fn_error $? "conditional \"HAVE_TCMALLOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BZLIB_DELEGATE_TRUE}" && test -z "${BZLIB_DELEGATE_FALSE}"; then @@ -40050,6 +40157,7 @@ matches your expectations. RAQM --with-raqm=$with_raqm $have_raqm RAW --with-raw=$with_raw $have_raw RSVG --with-rsvg=$with_rsvg $have_rsvg + TCMalloc --with-tcmalloc=$with_tcmalloc $have_tcmalloc TIFF --with-tiff=$with_tiff $have_tiff WEBP --with-webp=$with_webp $have_webp WMF --with-wmf=$with_wmf $have_wmf @@ -40142,6 +40250,7 @@ matches your expectations. RAQM --with-raqm=$with_raqm $have_raqm RAW --with-raw=$with_raw $have_raw RSVG --with-rsvg=$with_rsvg $have_rsvg + TCMalloc --with-tcmalloc=$with_tcmalloc $have_tcmalloc TIFF --with-tiff=$with_tiff $have_tiff WEBP --with-webp=$with_webp $have_webp WMF --with-wmf=$with_wmf $have_wmf diff --git a/configure.ac b/configure.ac index 9ac2856f7..effce28f8 100644 --- a/configure.ac +++ b/configure.ac @@ -731,6 +731,16 @@ AC_ARG_ENABLE([efence], [enable_efence=$enableval], [enable_efence='no']) +# Enable use of tcmalloc library. +AC_ARG_WITH(tcmalloc, + AS_HELP_STRING([--with-tcmalloc], + [enable 'tcmalloc' memory debug support]), + [with_tcmalloc=$withval], + [with_tcmalloc='no']) +if test "$with_tcmalloc" != 'no' ; then + DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tcmalloc=$with_tcmalloc " +fi + # Enable prof-based profiling support AC_ARG_ENABLE([prof], [AC_HELP_STRING([--enable-prof], @@ -1494,7 +1504,7 @@ if test "$with_umem" != 'no'; then else UMEM_LIBS='-lumem' LIBS="$UMEM_LIBS $LIBS" - AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library) + AC_DEFINE(HAVE_UMEM,1,Define if you have umem memory allocation library) AC_MSG_RESULT(yes) have_umem='yes' fi @@ -1502,7 +1512,7 @@ if test "$with_umem" != 'no'; then AC_MSG_RESULT(no) fi fi -AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes') +AM_CONDITIONAL(HAVE_UMEM, test "$have_umem" = 'yes') AC_SUBST(UMEM_LIBS) # @@ -1543,6 +1553,37 @@ if test "$enable_efence" = 'yes'; then LIBS="$EFENCE_LIBS $LIBS" fi +# +# Check for tcmalloc library +# +have_tcmalloc='no' +TCMALLOC_LIBS='' +OLIBS="$LIBS" +if test "$have_threads" = 'yes' -a "$with_tcmalloc" != 'no'; then + AC_MSG_CHECKING([tcmalloc library support ]) + AC_MSG_RESULT([]) + failed=0 + passed=0 + + AC_CHECK_LIB([tcmalloc_minimal],[mallinfo],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[]) + + if test $passed -gt 0; then + if test $failed -gt 0; then + have_tcmalloc='no (some components failed test)' + else + TCMALLOC_LIBS=-ltcmalloc_minimal + LIBS="$TCMALLOC_LIBS $LIBS" + CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" + AC_DEFINE([HAVE_TCMALLOC],[1],[Define if you have tcmalloc library]) + have_tcmalloc='yes' + fi + fi + AC_MSG_CHECKING([if tcmalloc memory allocation library is complete ]) + AC_MSG_RESULT([$have_tcmalloc]) +fi +AM_CONDITIONAL([HAVE_TCMALLOC], [test "$have_tcmalloc" = 'yes']) +AC_SUBST([TCMALLOC_LIBS]) + dnl =========================================================================== # @@ -3924,9 +3965,9 @@ fi # if test "$build_modules" != 'no'; then - MAGICK_DEP_LIBS="$USER_LIBS $LCMS_LIBS $FREETYPE_LIBS $RAQM_LIBS $LQR_LIBS $FFTW_LIBS $XML_LIBS $FLIF_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $WS2_32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS" + MAGICK_DEP_LIBS="$USER_LIBS $LCMS_LIBS $FREETYPE_LIBS $RAQM_LIBS $LQR_LIBS $FFTW_LIBS $XML_LIBS $FLIF_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $WS2_32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS" else - MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $RAQM_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FLIF_LIBS $FPX_LIBS $FONTCONFIG_LIBS $HEIF_LIBS $WEBPMUX_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIBS $PANGO_LIBS $RAW_R_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $WS2_32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS" + MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $RAQM_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FLIF_LIBS $FPX_LIBS $FONTCONFIG_LIBS $HEIF_LIBS $WEBPMUX_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIBS $PANGO_LIBS $RAW_R_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $WS2_32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS" fi MAGICK_EXTRA_DEP_LIBS="$GOMP_LIBS" AC_SUBST(MAGICK_DEP_LIBS) @@ -4093,6 +4134,7 @@ matches your expectations. RAQM --with-raqm=$with_raqm $have_raqm RAW --with-raw=$with_raw $have_raw RSVG --with-rsvg=$with_rsvg $have_rsvg + TCMalloc --with-tcmalloc=$with_tcmalloc $have_tcmalloc TIFF --with-tiff=$with_tiff $have_tiff WEBP --with-webp=$with_webp $have_webp WMF --with-wmf=$with_wmf $have_wmf -- 2.40.0