"Fossies" - the Fresh Open Source Software Archive

Member "libgd-2.3.2/configure.ac" (4 Mar 2021, 10630 Bytes) of package /linux/www/libgd-2.3.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 2.3.1_vs_2.3.2.

    1 # Process this file with autoconf to produce a configure script.
    2 # Configure template for gd library
    3 
    4 AC_PREREQ(2.64)
    5 
    6 # We extract version numbers from src/versions.h
    7 define([gv],[perl config/getver.pl ]$1)
    8 
    9 m4_define([gd_MAJOR],esyscmd(gv(MAJOR)))dnl
   10 m4_define([gd_MINOR],esyscmd(gv(MINOR)))dnl
   11 m4_define([gd_REVISION],esyscmd(gv(RELEASE)))dnl
   12 m4_define([gd_EXTRA],esyscmd(gv(EXTRA)))dnl
   13 m4_define([gd_PKG_VERSION],[gd_MAJOR.gd_MINOR.gd_REVISION]gd_EXTRA)]dnl
   14 
   15 AC_INIT([GD], gd_PKG_VERSION, [https://github.com/libgd/libgd/issues], [libgd], [http://lib.gd])
   16 AC_CONFIG_SRCDIR([src/gd.c])
   17 AC_CONFIG_AUX_DIR(config)
   18 AC_CONFIG_MACRO_DIR([m4])
   19 AC_CANONICAL_HOST
   20 
   21 dnl Keep the libtool version details in an external script so cmake can
   22 dnl access the values too.
   23 define([lt_gv], [config/getlib.sh ]$1)
   24 m4_define([gd_LT_CURRENT], esyscmd(lt_gv(CURRENT)))
   25 m4_define([gd_LT_REVISION], esyscmd(lt_gv(REVISION)))
   26 m4_define([gd_LT_AGE], esyscmd(lt_gv(AGE)))
   27 
   28 GDLIB_LT_CURRENT=gd_LT_CURRENT
   29 GDLIB_LT_REVISION=gd_LT_REVISION
   30 GDLIB_LT_AGE=gd_LT_AGE
   31 
   32 AC_SUBST(GDLIB_LT_CURRENT)
   33 AC_SUBST(GDLIB_LT_REVISION)
   34 AC_SUBST(GDLIB_LT_AGE)
   35 
   36 AC_SUBST(LIBS_PRIVATES)
   37 AC_SUBST(PKG_REQUIRES_PRIVATES)
   38 
   39 AM_INIT_AUTOMAKE([1.11 foreign dist-xz -Wall -Werror subdir-objects])
   40 AC_CONFIG_HEADERS([src/config.h:src/config.hin])
   41 
   42 AM_PROG_AR
   43 AC_PROG_CC_STDC
   44 AM_PROG_CC_C_O
   45 AC_PROG_INSTALL
   46 AC_PROG_LIBTOOL
   47 AC_PROG_LN_S
   48 AC_PROG_MAKE_SET
   49 LT_INIT([win32-dll])
   50 PKG_PROG_PKG_CONFIG
   51 
   52 dnl may be required for freetype and Xpm
   53 AC_PATH_X
   54 
   55 if test -n "$x_includes" && test "x$x_includes" != xNONE ; then
   56   CFLAGS="$CFLAGS -I$x_includes"
   57 fi
   58 if test -n "$x_libraries" && test "x$x_libraries" != xNONE ; then
   59   LDFLAGS="$LDFLAGS -L$x_libraries"
   60 fi
   61 
   62 dnl Keep in sync with cmake/modules/AC_HEADER_STDC.cmake.
   63 AC_HEADER_STDC
   64 AC_CHECK_HEADERS_ONCE(m4_flatten([
   65 	dirent.h
   66 	inttypes.h
   67 	stdint.h
   68 	strings.h
   69 	unistd.h
   70 	sys/stat.h
   71 	sys/types.h
   72 ]))
   73 
   74 dnl if we're configuring on a system w/out gettext, don't fall over
   75 m4_ifndef([AM_ICONV],[m4_define([AM_ICONV],[:])])
   76 AM_ICONV
   77 # if test -n "$LIBICONV" ; then
   78 #   LIBS="$LIBS $LIBICONV"
   79 # fi
   80 
   81 AC_CHECK_HEADERS(iconv.h,
   82   [AC_MSG_CHECKING(whether iconv.h defines iconv_t)
   83    AC_EGREP_HEADER([typedef.*iconv_t],iconv.h,
   84      [AC_MSG_RESULT(yes)
   85       AC_DEFINE(HAVE_ICONV_T_DEF, 1,
   86                 [Define if <iconv.h> defines iconv_t.])],
   87       AC_MSG_RESULT(no))])
   88 
   89 # Checks for typedefs, structures, and compiler characteristics.
   90 #AC_TYPE_SIZE_T
   91 
   92 # Checks for library functions.
   93 #AC_FUNC_ERROR_AT_LINE
   94 #AC_FUNC_MALLOC
   95 #AC_FUNC_REALLOC
   96 #AC_CHECK_FUNCS([floor memset sqrt strchr strdup strtol])
   97 
   98 dnl do we need to specify -lm explicitly?
   99 AC_CHECK_FUNC(sin,,[AC_CHECK_LIB(m,sin)])
  100 
  101 AX_PTHREAD()
  102 AX_OPENMP()
  103 
  104 dnl We should default this to off in future releases.
  105 AC_MSG_CHECKING([whether to support gd image formats])
  106 AC_ARG_ENABLE([gd-formats],
  107   [AS_HELP_STRING([--disable-gd-formats], [Disable support for the legacy/testing gd image formats])],
  108   [gd_enable_gd_formats=$enableval],
  109   [gd_enable_gd_formats=yes])
  110 AC_MSG_RESULT([$gd_enable_gd_formats])
  111 if test "$gd_enable_gd_formats" = yes; then
  112   gd_ac_value=1
  113 else
  114   gd_ac_value=0
  115 fi
  116 AC_DEFINE_UNQUOTED([ENABLE_GD_FORMATS], [$gd_ac_value], [Whether to support gd image formats])
  117 AM_CONDITIONAL([ENABLE_GD_FORMATS], test "$gd_enable_gd_formats" = yes)
  118 
  119 dnl Helper macro for working with external libraries.
  120 dnl GD_LIB_CHECK([SYM], [FEATURE], [name], [...test...])
  121 dnl $1 - upper case symbol
  122 dnl $2 - GD feature name to track
  123 dnl $3 - lower case name for user
  124 dnl $4 - test for the feature
  125 dnl The test code should set gd_found_lib=yes to indicate success.
  126 m4_define([GD_LIB_CHECK], [dnl
  127   dnl Export the flag for the user to leverage.  No other logic here.
  128   AC_MSG_CHECKING([whether to support $3])
  129   AC_ARG_WITH([$3],
  130     [AS_HELP_STRING([--with-$3@<:@=DIR@:>@], [Support $3 (optionally in DIR)])],
  131     [gd_with_lib=$withval],
  132     [gd_with_lib=auto])
  133   AC_MSG_RESULT([$gd_with_lib])
  134 
  135   gd_found_lib=no
  136   gd_require_pkg_name=""
  137   if test "$gd_with_lib" != "no"; then
  138     save_CPPFLAGS=$CPPFLAGS
  139     save_LDFLAGS=$LDFLAGS
  140     dnl Set up default libs/cflags vars based on the path if user gave us one.
  141     gd_lib_ldflags=
  142     gd_lib_cflags=
  143     case $gd_with_lib in
  144     yes|no|auto|"") ;;
  145     *)
  146       if test -d "$gd_with_lib/lib"; then
  147         gd_lib_ldflags="-L$gd_with_lib/lib"
  148         AS_VAR_APPEND([LDFLAGS], [" $gd_lib_ldflags"])
  149       fi
  150       if test -d "$gd_with_lib/include"; then
  151         gd_lib_cflags="-I$gd_with_lib/include"
  152         AS_VAR_APPEND([CPPFLAGS], [" $gd_lib_cflags"])
  153       fi
  154       ;;
  155     esac
  156     dnl Run the test for this feature.
  157     $4
  158     CPPFLAGS=$save_CPPFLAGS
  159     LDFLAGS=$save_LDFLAGS
  160 
  161     if test "$gd_found_lib" = "yes"; then
  162       AC_DEFINE([HAVE_$1], [1], [Define if you have $3])
  163       dnl Merge the flags into the main LIBS/CPPFLAGS.
  164       $1][_LIBS="$gd_lib_ldflags $][$1][_LIBS"
  165       $1][_CFLAGS="$gd_lib_cflags $][$1][_CFLAGS"
  166       AS_VAR_APPEND([LIBS], [" $][$1][_LIBS"])
  167       AS_VAR_APPEND([CPPFLAGS], [" $][$1][_CFLAGS"])
  168       if test -z "$gd_require_pkg_name"; then
  169         AS_VAR_APPEND([LIBS_PRIVATES], [" $][$1][_LIBS"])
  170       else
  171         AS_VAR_APPEND([PKG_REQUIRES_PRIVATES], ["  $gd_require_pkg_name"])
  172       fi
  173     elif test "$gd_with_lib" = "yes"; then
  174       AC_MSG_ERROR([$3 requested but not found])
  175     else
  176       AC_MSG_NOTICE([Disabling support for $3])
  177     fi
  178   fi
  179   AM_CONDITIONAL([HAVE_$1], test "$gd_found_lib" = yes)
  180   gd_with_$1=$gd_found_lib
  181 ])
  182 
  183 dnl Helper macro for working with external libraries with pkg-config support.
  184 dnl GD_LIB_PKG_CHECK([SYM], [FEATURE], [name], [pkg-config module], [...fallback test...])
  185 dnl $1 - upper case symbol
  186 dnl $2 - GD feature name to track
  187 dnl $3 - lower case name for user
  188 dnl $4 - pkg-config module to look for
  189 dnl $5 - fallback test for the feature
  190 m4_define([GD_LIB_PKG_CHECK], [dnl
  191   GD_LIB_CHECK([$1], [$2], [$3], [dnl
  192     PKG_CHECK_MODULES([$1], [$4], [gd_found_lib=yes gd_require_pkg_name="$4"], [$5])
  193   ])
  194 ])
  195 
  196 dnl Check for zlib support.
  197 GD_LIB_PKG_CHECK([LIBZ], [ZLIB], [zlib], [zlib], [dnl
  198   AC_CHECK_LIB([z], [deflate], [dnl
  199     AS_VAR_APPEND([LIBZ_LIBS], [" -lz"])
  200     gd_found_lib=yes
  201   ])
  202 ])
  203 
  204 dnl Check for libpng support.
  205 GD_LIB_PKG_CHECK([LIBPNG], [PNG], [png], [libpng], [
  206   LIBPNG_CONFIG=$gd_with_lib/bin/libpng-config
  207   if test -e "$LIBPNG_CONFIG"; then
  208     LIBPNG_CFLAGS=`$LIBPNG_CONFIG --cflags`
  209     LIBPNG_LIBS=`$LIBPNG_CONFIG --ldflags`
  210     gd_found_lib=yes
  211   fi
  212 ])
  213 
  214 dnl Check for FreeType support.
  215 GD_LIB_PKG_CHECK([LIBFREETYPE], [FREETYPE], [freetype], [freetype2 >= 9.8.3], [
  216   FREETYPE_CONFIG=$gd_with_lib/bin/freetype-config
  217   if test -e "$FREETYPE_CONFIG"; then
  218     LIBFREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
  219     LIBFREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
  220     gd_found_lib=yes
  221   fi
  222 ])
  223 if test "$gd_with_LIBFREETYPE" = "yes"; then
  224   AC_DEFINE([HAVE_FT2BUILD_H], [1], [Define if you have the ft2build.h header.])
  225 fi
  226 
  227 dnl Check for Raqm support.
  228 GD_LIB_PKG_CHECK([LIBRAQM], [RAQM], [raqm], [raqm], [
  229   AC_CHECK_LIB([raqm], [raqm_create], [dnl
  230     AS_VAR_APPEND([LIBRAQM_LIBS], [" -lraqm -lfreetype"])
  231     gd_found_lib=yes
  232   ])
  233 ])
  234 
  235 dnl Check for fontconfig support.
  236 GD_LIB_PKG_CHECK([LIBFONTCONFIG], [FONTCONFIG], [fontconfig], [fontconfig], [
  237   AC_CHECK_LIB([fontconfig], [FcInit], [dnl
  238     AS_VAR_APPEND([LIBFONTCONFIG_LIBS], [" -lfontconfig"])
  239     gd_found_lib=yes
  240   ])
  241 ])
  242 
  243 dnl Check for jpeg support.
  244 GD_LIB_PKG_CHECK([LIBJPEG], [JPEG], [jpeg], [libjpeg], [
  245   AC_CHECK_LIB([jpeg], [jpeg_set_defaults], [dnl
  246     AS_VAR_APPEND([LIBJPEG_LIBS], [" -ljpeg"])
  247     gd_found_lib=yes
  248   ])
  249 ])
  250 
  251 dnl Check for libimagequant support.
  252 GD_LIB_CHECK([LIBIMAGEQUANT], [LIQ], [liq], [
  253   AC_CHECK_HEADER([libimagequant.h], [
  254     save_CFLAGS=$CFLAGS
  255     CFLAGS="$CFLAGS $OPENMP_CFLAGS"
  256     AC_CHECK_LIB([imagequant], [liq_attr_create_with_allocator], [dnl
  257       AS_VAR_APPEND([LIBIMAGEQUANT_LIBS], [" -limagequant $OPENMP_CFLAGS"])
  258       gd_found_lib=yes
  259     ])
  260     CFLAGS=$save_CFLAGS
  261   ])
  262 ])
  263 
  264 dnl Check for xpm support.
  265 GD_LIB_PKG_CHECK([LIBXPM], [XPM], [xpm], [xpm], [
  266   AC_CHECK_LIB([Xpm], [XpmReadFileToXpmImage], [dnl
  267     AS_VAR_APPEND([LIBXPM_LIBS], [" -lXpm"])
  268     gd_found_lib=yes
  269   ])
  270 ])
  271 
  272 dnl Check for tiff support.
  273 GD_LIB_PKG_CHECK([LIBTIFF], [TIFF], [tiff], [libtiff-4], [
  274   AC_CHECK_LIB([tiff], [TIFFClientOpen], [dnl
  275     AS_VAR_APPEND([LIBTIFF_LIBS], [" -ltiff"])
  276     gd_found_lib=yes
  277   ])
  278 ])
  279 
  280 dnl Check for webp support.
  281 GD_LIB_PKG_CHECK([LIBWEBP], [WEBP], [webp], [libwebp], [
  282   AC_CHECK_LIB([webp], [WebPGetInfo], [dnl
  283     AS_VAR_APPEND([LIBWEBP_LIBS], [" -lwebp"])
  284     gd_found_lib=yes
  285   ])
  286 ])
  287 
  288 dnl Check for heif support.
  289 GD_LIB_PKG_CHECK([LIBHEIF], [HEIF], [heif], [libheif >= 1.7.0], [
  290   AC_CHECK_LIB([heif], [heif_get_version], [dnl
  291     AS_VAR_APPEND([LIBHEIF_LIBS], [" -lheif"])
  292   ])
  293 ])
  294 
  295 dnl Check for avif support.
  296 GD_LIB_PKG_CHECK([LIBAVIF], [AVIF], [avif], [libavif >= 0.8.2], [
  297   AC_CHECK_LIB([avif], [avifVersion], [dnl
  298     AS_VAR_APPEND([LIBAVIF_LIBS], [" -lavif"])
  299     gd_found_lib=yes
  300   ])
  301 ])
  302 
  303 gl_VISIBILITY()
  304 CFLAGS="$CFLAGS $CFLAG_VISIBILITY"
  305 
  306 MINGW_AC_WIN32_NATIVE_HOST()
  307 
  308 if test "$mingw_cv_win32_host" = yes; then
  309 AC_DEFINE([BGDWIN32], [], [Define is you are building for Win32 API])
  310 fi
  311 
  312 dnl Enable -Wall if possible.  Do it after all other tests.
  313 AX_CFLAGS_WARN_ALL
  314 
  315 dnl Enable -Werror if possible.  Do it after all other tests.
  316 AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [treat compile warnings as errors])])
  317 if test "$enable_werror" = "yes" || \
  318    test "$GCC" = "yes" -a "$enable_werror" != "no" -a -d "$srcdir/.git"; then
  319   CFLAGS="-Werror $CFLAGS"
  320   CXXFLAGS="-Werror $CXXFLAGS"
  321 fi
  322 
  323 dnl report configuration
  324 AC_MSG_RESULT([
  325 ** Configuration summary for $PACKAGE $VERSION:
  326 
  327    Support for gd/gd2 images:        $gd_enable_gd_formats
  328    Support for Zlib:                 $gd_with_LIBZ
  329    Support for PNG library:          $gd_with_LIBPNG
  330    Support for JPEG library:         $gd_with_LIBJPEG
  331    Support for WebP library:         $gd_with_LIBWEBP
  332    Support for HEIF library:         $gd_with_LIBHEIF
  333    Support for AVIF library:         $gd_with_LIBAVIF
  334    Support for TIFF library:         $gd_with_LIBTIFF
  335    Support for Freetype 2.x library: $gd_with_LIBFREETYPE
  336    Support for Fontconfig library:   $gd_with_LIBFONTCONFIG
  337    Support for Xpm library:          $gd_with_LIBXPM
  338    Support for liq library:          $gd_with_LIBIMAGEQUANT
  339    Support for complex text:         $gd_with_LIBRAQM
  340    Support for pthreads:             $ax_pthread_ok
  341 ])
  342 
  343 AC_CONFIG_FILES([Makefile
  344                 src/Makefile
  345                 tests/Makefile
  346                 config/Makefile
  347                 config/gdlib.pc])
  348 
  349 AC_OUTPUT