1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
|
From 3fcf096870bffa7d21fceecb56ba26e925073ecb Mon Sep 17 00:00:00 2001
From: John Ellson <ellson@research.att.com>
Date: Tue, 14 Jun 2016 01:18:18 -0400
Subject: [PATCH] use gdlib.pc, if abvailable, and thereby supress deprecated
warnings during configure
---
configure.ac | 109 +++++++++++++++++++++++++-------------------
contrib/diffimg/Makefile.am | 4 +-
plugin/gd/Makefile.am | 4 +-
tclpkg/gdtclft/Makefile.am | 4 +-
tclpkg/tcldot/Makefile.am | 4 +-
6 files changed, 70 insertions(+), 56 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7afaa09..34664d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2714,15 +2714,52 @@ if test "x$with_libgd" != "xyes"; then
fi
if test "x$use_gd" = "x"; then
+ PKG_CHECK_MODULES(GTK, [gdlib >= 2.0.33],[
+ have_gdlib=1
+# FIXME - why no features in the gdlib.pc?
+ GD_FEATURES="GD_PNG GD_JPEG GD_XPM GD_FONTCONFIG GD_FREETYPE GD_GIF GD_GIFANIM GD_OPENPOLYGON"
+ ],[
AC_PATH_PROG(GDLIB_CONFIG,gdlib-config)
if test -n "$GDLIB_CONFIG"; then
- GD_INCLUDES=`$GDLIB_CONFIG --includes`
- GD_LDFLAGS=`$GDLIB_CONFIG --ldflags | sed 's/-xarch=[^ ]* //'`
- GD_LIBS=`$GDLIB_CONFIG --libs`
- GD_MAJORVERSION=`$GDLIB_CONFIG --majorversion`
- GD_MINORVERSION=`$GDLIB_CONFIG --minorversion`
- GD_REVISION=`$GDLIB_CONFIG --revision`
- for f in `$GDLIB_CONFIG --features` ; do
+ have_gdlib=1
+ GDLIB_CFLAGS=`$GDLIB_CONFIG --includes`
+ GDLIB_LIBS=`$GDLIB_CONFIG --libs`
+ GDLIB_VERSION=`$GDLIB_CONFIG --version 2>/dev/null`
+ GD_LDFLAGS=`$GDLIB_CONFIG --ldflags | sed 's/-xarch=[^ ]* //'`
+ GD_FEATURES=`$GDLIB_CONFIG --features`
+
+ # GD version check >= 2.0.33 -- centos-5.8 has gd-2.0.33
+ GDLIB_VERSION_MAJOR=`echo $GDLIB_VERSION | cut -d '.' -f 1`
+ GDLIB_VERSION_MINOR=`echo $GDLIB_VERSION | cut -d '.' -f 2`
+ GDLIB_VERSION_MICRO=`echo $GDLIB_VERSION | cut -d '.' -f 3`
+ REQ_GDLIB_VERSION_MAJOR=2
+ REQ_GDLIB_VERSION_MINOR=0
+ REQ_GDLIB_VERSION_MICRO=33
+ if test $GDLIB_VERSION_MAJOR -lt $REQ_GDLIB_VERSION_MAJOR; then
+ use_gd="No (major version too old)"
+ else
+ if test $GDLIB_VERSION_MAJOR -eq $REQ_GDLIB_VERSION_MAJOR; then
+ if test $GDLIB_VERSION_MINOR -lt $REQ_GDLIB_VERSION_MINOR; then
+ use_gd="No (minor version too old)"
+ else
+ if test $GDLIB_VERSION_MINOR -eq $REQ_GDLIB_VERSION_MINOR; then
+ if test $GDLIB_VERSION_MICRO -lt $REQ_GDLIB_VERSION_MICRO; then
+ use_gd="No (revision too old)"
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test "x$use_gd" != "x"; then
+ AC_MSG_WARN(GD library version $GDLIB_VERSION_MAJOR.$GDLIB_VERSION_MINOR.$GDLIB_VERSION_MICRO < $REQ_GDLIB_VERSION_MAJOR.$REQ_GDLIB_VERSION_MINOR.$REQ_GDLIB_VERSION_MICRO)
+ fi
+ else
+ AC_MSG_WARN(GD neither gdlib pkgconfig nor gdlib-config was found)
+ fi
+ ])
+ if test "x$have_gdlib" != "x"; then
+ AC_DEFINE_UNQUOTED(HAVE_GDLIB,1,[Define if you have the gdlib library])
+ for f in $GD_FEATURES ; do
if test "$f" = "GD_PNG"; then
AC_DEFINE_UNQUOTED(HAVE_GD_PNG,1,[Define if the GD library supports PNG])
fi
@@ -2733,12 +2770,12 @@ if test "x$use_gd" = "x"; then
AC_DEFINE_UNQUOTED(HAVE_GD_XPM,1,[Define if the GD library supports XPM])
fi
if test "$f" = "GD_FONTCONFIG"; then
- HAVE_GD_FONTCONFIG=1
AC_DEFINE_UNQUOTED(HAVE_GD_FONTCONFIG,1,[Define if the GD library supports FONTCONFIG])
+ have_gd_fontconfig=1
fi
if test "$f" = "GD_FREETYPE"; then
- HAVE_GD_FREETYPE=1
AC_DEFINE_UNQUOTED(HAVE_GD_FREETYPE,1,[Define if the GD library supports FREETYPE])
+ have_gd_freetype=1
fi
if test "$f" = "GD_GIF"; then
AC_DEFINE_UNQUOTED(HAVE_GD_GIF,1,[Define if the GD library supports GIF])
@@ -2749,43 +2786,19 @@ if test "x$use_gd" = "x"; then
if test "$f" = "GD_OPENPOLYGON"; then
AC_DEFINE_UNQUOTED(HAVE_GD_OPENPOLYGON,1,[Define if the GD library supports OPENPOLYGON])
fi
- done
+ done
- if test "x$HAVE_GD_FONTCONFIG" = "x"; then
- AC_MSG_WARN(Your libgd was not built with freetype support. This may result in problems displaying fonts.)
+ if test "x$have_gd_fontconfig" = "x"; then
+ AC_MSG_WARN(Your libgd was not built with fontconfig support. This may result in problems displaying fonts.)
fi
- if test "x$HAVE_GD_FREETYPE" = "x"; then
- AC_MSG_WARN(Your libgd was not built with fontconfig support. This may result in problems resolving fonts.)
- fi
+ if test "x$have_gd_freetype" = "x"; then
+ AC_MSG_WARN(Your libgd was not built with freetype support. This may result in problems resolving fonts.)
+ fi
+ fi
- # GD version check >= 2.0.33 -- centos-5.8 has gd-2.0.33
- REQ_GD_MAJORVERSION=2
- REQ_GD_MINORVERSION=0
- REQ_GD_REVISION=33
- if test $GD_MAJORVERSION -lt $REQ_GD_MAJORVERSION; then
- use_gd="No (major version too old)"
- else
- if test $GD_MAJORVERSION -eq $REQ_GD_MAJORVERSION; then
- if test $GD_MINORVERSION -lt $REQ_GD_MINORVERSION; then
- use_gd="No (minor version too old)"
- else
- if test $GD_MINORVERSION -eq $REQ_GD_MINORVERSION; then
- if test $GD_REVISION -lt $REQ_GD_REVISION; then
- use_gd="No (revision too old)"
- fi
- fi
- fi
- fi
- fi
- if test "x$use_gd" != "x"; then
- AC_MSG_WARN(GD library version < $REQ_GD_MAJORVERSION.$REQ_GD_MINORVERSION.$REQ_GD_REVISION)
- fi
- else
- AC_MSG_WARN(GD gdlib-config not found)
- fi
# prevent explicit use of -I/usr/include as it breaks mingw cross-compiles
- if test "x$GD_INCLUDES" = "x-I/usr/include"; then
- GD_INCLUDES="";
+ if test "x$GDLIB_CFLAGS" = "x-I/usr/include"; then
+ GDLIB_CFLAGS="";
fi
# prevent explicit use of -L/usr/lib or -L/usr/lib64, unnecessary clutter
if test "x$GD_LDFLAGS" = "x-L/usr/lib"; then
@@ -2802,13 +2815,13 @@ if test "x$use_gd" = "x"; then
save_LDFLAGS=$LDFLAGS
AC_ARG_WITH(gdincludedir,
[AS_HELP_STRING([--with-gdincludedir=DIR],[use GD includes from DIR])],
- GD_INCLUDES="-I$withval")
- CPPFLAGS="$CPPFLAGS $GD_INCLUDES"
+ GDLIB_CFLAGS="-I$withval")
+ CPPFLAGS="$CPPFLAGS $GDLIB_CFLAGS"
AC_ARG_WITH(gdlibdir,
[AS_HELP_STRING([--with-gdlibdir=DIR],[use GD libraries from DIR])],
[GD_LDFLAGS="-L$withval"])
- GD_LIBS="$GD_LDFLAGS -lgd $GD_LIBS"
- LDFLAGS="$LDFLAGS $GD_LIBS"
+ GDLIB_LIBS="$GD_LDFLAGS -lgd $GDLIB_LIBS"
+ LDFLAGS="$LDFLAGS $GDLIB_LIBS"
AC_CHECK_HEADER(gd.h,,[
AC_MSG_WARN(Optional GD library not available - no gd.h)
use_gd="No (gd headers not found)"
@@ -2828,8 +2841,8 @@ if test "x$use_gd" = "x"; then
CPPFLAGS=$save_CPPFLAGS
fi
fi
- AC_SUBST([GD_INCLUDES])
- AC_SUBST([GD_LIBS])
+ AC_SUBST([GDLIB_CFLAGS])
+ AC_SUBST([GDLIB_LIBS])
fi
AM_CONDITIONAL(WITH_LIBGD, [test "x$with_libgd" = "xyes"])
diff --git a/contrib/diffimg/Makefile.am b/contrib/diffimg/Makefile.am
index 4db8970..cc39692 100644
--- a/contrib/diffimg/Makefile.am
+++ b/contrib/diffimg/Makefile.am
@@ -3,7 +3,7 @@
VERSION=0.2
-AM_CPPFLAGS = @GD_INCLUDES@
+AM_CPPFLAGS = @GDLIB_CFLAGS@
pdfdir = $(pkgdatadir)/doc/pdf
@@ -16,7 +16,7 @@ endif
diffimg_SOURCES = diffimg.c
-diffimg_LDADD = @GD_LIBS@ @MATH_LIBS@
+diffimg_LDADD = @GDLIB_LIBS@ @MATH_LIBS@
diffimg.1.pdf: $(srcdir)/diffimg.1
- $(GROFF) -Tps -man $(srcdir)/diffimg.1 | $(PS2PDF) - - >diffimg.1.pdf
diff --git a/plugin/gd/Makefile.am b/plugin/gd/Makefile.am
index 97e0e1a..6f76f12 100644
--- a/plugin/gd/Makefile.am
+++ b/plugin/gd/Makefile.am
@@ -8,7 +8,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/lib/gvc \
-I$(top_srcdir)/lib/cgraph \
-I$(top_srcdir)/lib/cdt \
- $(PANGOCAIRO_CFLAGS) $(GD_INCLUDES) $(LIBGVC_CFLAGS)
+ $(PANGOCAIRO_CFLAGS) $(GDLIB_CFLAGS) $(LIBGVC_CFLAGS)
if WITH_LIBGD
noinst_LTLIBRARIES = libgvplugin_gd_C.la
@@ -35,7 +35,7 @@ if WITH_LIBGD
libgvplugin_gd_la_LIBADD = \
$(top_builddir)/lib/gvc/libgvc.la \
$(top_builddir)/lib/cgraph/libcgraph.la \
- $(top_builddir)/lib/cdt/libcdt.la @PANGOCAIRO_LIBS@ @GD_LIBS@ @MATH_LIBS@
+ $(top_builddir)/lib/cdt/libcdt.la @PANGOCAIRO_LIBS@ @GDLIB_LIBS@ @MATH_LIBS@
libgvplugin_gd_la_DEPENDENCIES = $(top_builddir)/lib/gvc/libgvc.la
if WITH_WIN32
diff --git a/tclpkg/gdtclft/Makefile.am b/tclpkg/gdtclft/Makefile.am
index 279f20e..0eb06c3 100644
--- a/tclpkg/gdtclft/Makefile.am
+++ b/tclpkg/gdtclft/Makefile.am
@@ -9,7 +9,7 @@ pkgtcldir = $(pkglibdir)/tcl
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/tclpkg/tclhandle \
- @GD_INCLUDES@ @TCL_INCLUDES@
+ @GDLIB_CFLAGS@ @TCL_INCLUDES@
LIBS = @LIBS@ -lc
@@ -34,7 +34,7 @@ if WITH_LIBGD
libgdtclft_la_LIBADD = \
$(top_builddir)/tclpkg/tclhandle/libtclhandle_C.la \
$(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la \
- $(GD_LIBS)
+ $(GDLIB_LIBS)
if WITH_TCL
all-local: pkgIndex.tcl
diff --git a/tclpkg/tcldot/Makefile.am b/tclpkg/tcldot/Makefile.am
index 3dc3ae4..c615361 100644
--- a/tclpkg/tcldot/Makefile.am
+++ b/tclpkg/tcldot/Makefile.am
@@ -18,7 +18,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/lib/common \
-I$(top_srcdir)/lib/cgraph \
-I$(top_srcdir)/lib/cdt \
- -I$(top_srcdir)/lib/pathplan $(TCLHANDLE_INCLUDES) $(GD_INCLUDES) $(TCL_INCLUDES)
+ -I$(top_srcdir)/lib/pathplan $(TCLHANDLE_INCLUDES) $(GDLIB_CFLAGS) $(TCL_INCLUDES)
LIBS = -lc
@@ -64,7 +64,7 @@ libtcldot_la_DEPENDENCIES = $(top_builddir)/lib/gvc/libgvc.la
# GDTCLFT requires gd libs to be builtin
if WITH_LIBGD
-libtcldot_la_LIBADD += $(GD_LIBS)
+libtcldot_la_LIBADD += $(GDLIB_LIBS)
endif
libtcldot_la_LIBADD += $(LIBGEN_LIBS) $(MATH_LIBS)
|