gnuplot/gnuplot-gd.patch

105 lines
3.8 KiB
Diff
Raw Normal View History

Index: gnuplot-5.2.2/configure.ac
===================================================================
---
gnuplot-5.4.3/configure.ac | 76 +++++-------------------------------------
gnuplot-5.4.3/src/Makefile.am | 2 -
2 files changed, 11 insertions(+), 67 deletions(-)
--- gnuplot-5.4.3/configure.ac
+++ gnuplot-5.4.3/configure.ac 2022-01-10 09:30:11.836241429 +0000
@@ -526,73 +526,17 @@ AC_ARG_WITH(gd,dnl
if test "$with_gd" != no; then
PKG_CHECK_MODULES_NOFAIL(libgd, [gdlib])
- AC_PATH_PROG([GDLIB_CONFIG], [gdlib-config])
-
- # If pkg-config did return libgd configuration then
- # libgd_{CFLAGS,LDFLAGS,LIBS} is set
- # If gdlib-config executable is found then GDLIB_CONFIG is set
- if test $pkg_failed = no && test -n "$GDLIB_CONFIG"; then
- # If pkg-config did succeed and we have gdlib-config then the later takes
- # priority
- libgd_CFLAGS=`$GDLIB_CONFIG --cflags`
- libgd_LDFLAGS=`$GDLIB_CONFIG --ldflags`
- libgd_LIBS=`$GDLIB_CONFIG --libs`
- elif test -d "$with_gd"; then
- # pkg-config did NOT succeed, we do NOT have gdlib-config but user
- # specified --with-gd=
- libgd_CFLAGS="-I$with_gd/include"
- libgd_LDFLAGS="-L$with_gd/lib"
- libgd_LIBS="-ljpeg -lpng -lfreetype -lz"
- fi
-
- # Verify that libgd works, but backup the previous compilation variables to
- # be able to revert in the case that libgd is not functional
- _cppflags="$CPPFLAGS"
- _ldflags="$LDFLAGS"
- _libs="$LIBS"
- CPPFLAGS="$CPPFLAGS $libgd_CFLAGS"
- LDFLAGS="$LDFLAGS $libgd_LDFLAGS"
- LIBS="$LIBS $libgd_LIBS"
-
- AC_CHECK_LIB(gd,gdImageCreateTrueColor,
- [dnl found gd library
+ PKG_CHECK_MODULES([GD], [gdlib], [
+ ac_cv_lib_gd_gdImageJpeg=yes
+ ac_cv_lib_gd_gdImagePng=yes
+ ac_cv_lib_gd_gdImageGif=yes
+ ac_cv_lib_gd_gdImageGifAnimBegin=yes
AC_DEFINE(HAVE_LIBGD,1,[ Define if you have gd library. ])
- AC_CHECK_HEADERS(gd.h,,
- AC_MSG_WARN([please add path to gd.h to CPPFLAGS in Makefile]))
-
- dnl gif support in libgd
- AC_CHECK_LIB(gd,gdImageGif,
- [AC_DEFINE(HAVE_GD_GIF,1,[ Define if libgd supports gif. ])])
- AC_CHECK_LIB(gd,gdImageGifAnimBegin,
- [AC_DEFINE(GIF_ANIMATION,1,[ Define if libgd supports animated gifs. ])])
-
- dnl jpeg support in libgd
- AC_CHECK_LIB(gd,gdImageJpeg,
- [AC_DEFINE(HAVE_GD_JPEG,1,[ Define if libgd supports jpeg. ])])
-
- dnl freetype support in libgd
- AC_CHECK_LIB(gd,gdImageStringFT,
- AC_DEFINE(HAVE_GD_TTF,1,
- [ Define if libgd supports TrueType fonts through libfreetype. ]))
-
- dnl png support in libgd
- AC_CHECK_LIB(gd,gdImagePng,
- [AC_DEFINE(HAVE_GD_PNG,1,[ Define if libgd supports png. ])])
-
- ],[dnl gd library not found
- AC_MSG_WARN([libgd not found or too old, version >= 2.0 is required])
- with_gd=no
- ])
-
- dnl piece it all together
- if test "$with_gd" = no; then
- CPPFLAGS="$_cppflags"
- LDFLAGS="$_ldflags"
- LIBS="$_libs"
- else
- LIBS="$_libs"
- TERMLIBS="$TERMLIBS -lgd $libgd_LIBS"
- fi
+ AC_DEFINE(HAVE_GD_GIF,1,[ Define if libgd supports gif. ])
+ AC_DEFINE(GIF_ANIMATION,1,[ Define if libgd supports animated gifs. ])
+ AC_DEFINE(HAVE_GD_JPEG,1,[ Define if libgd supports jpeg. ])
+ AC_DEFINE(HAVE_GD_TTF,1, [ Define if libgd supports TrueType fonts through libfreetype. ])
+ AC_DEFINE(HAVE_GD_PNG,1,[ Define if libgd supports png. ])])
fi
dnl end gd
--- gnuplot-5.4.3/src/Makefile.am
+++ gnuplot-5.4.3/src/Makefile.am 2022-01-10 08:51:05.936921975 +0000
@@ -60,7 +60,7 @@ term_api.h term.c term.h time.c unset.c
util3d.c util3d.h variable.c variable.h version.c version.h \
voxelgrid.c voxelgrid.h vplot.c vplot.h marching_cubes.h xdg.c xdg.h
-gnuplot_LDADD = $(TERMLIBS) $(TERMXLIBS) $(WX_LIBS) $(QT_LIBS)
+gnuplot_LDADD = $(GD_LIBS) $(TERMLIBS) $(TERMXLIBS) $(WX_LIBS) $(QT_LIBS)
pkglibexec_PROGRAMS =