]> granicus.if.org Git - graphviz/commitdiff
use gdlib.pc, if abvailable, and thereby supress deprecated warnings during configure
authorJohn Ellson <ellson@research.att.com>
Tue, 14 Jun 2016 05:18:18 +0000 (01:18 -0400)
committerJohn Ellson <ellson@research.att.com>
Tue, 14 Jun 2016 05:18:18 +0000 (01:18 -0400)
.gitignore
configure.ac
contrib/diffimg/Makefile.am
plugin/gd/Makefile.am
tclpkg/gdtclft/Makefile.am
tclpkg/tcldot/Makefile.am

index c4ef8f9b98a76f02f557f47ab9b0a014bbdc85b1..8e321452e627aa4f11a0b94ce1c4ab21b48a7f69 100644 (file)
@@ -4,6 +4,7 @@ syntax: glob
 *.a
 graphviz*.tar.gz*
 rtest*.tar.gz*
+*.ih
 *.la
 *.lai
 *.lo
index 7afaa0950d63b13aed57ee413a2c4cfa2f1e0728..34664d15eed26193577a315e84bf291071d1dc5d 100644 (file)
@@ -2677,15 +2677,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
@@ -2696,12 +2733,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])
@@ -2712,43 +2749,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
@@ -2765,13 +2778,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)"
@@ -2791,8 +2804,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"])
 
index 4db8970dd2d240bd7ee572736f5a5ef6b5fab99b..cc39692797440e03c02a78528f2f9cfa6f75c0c8 100644 (file)
@@ -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
index 97e0e1a9948b24543cd9aa9a641903cba19e2d78..6f76f12e33a38db3632e84518cde3574fde8db1f 100644 (file)
@@ -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
index 279f20ea7b585e876ccd4e42c0a075bb0512f7e2..0eb06c390d6b131a373cb8b22361995a20d04da9 100644 (file)
@@ -8,7 +8,7 @@ pkgtcldir = $(pkglibdir)/tcl
 
 AM_CPPFLAGS = \
         -I$(top_srcdir) \
-       @GD_INCLUDES@ @TCL_INCLUDES@
+       @GDLIB_CFLAGS@ @TCL_INCLUDES@
 
 LIBS = @LIBS@ -lc
 
@@ -32,7 +32,7 @@ libgdtclft_la_LDFLAGS = -no-undefined
 if WITH_LIBGD
 libgdtclft_la_LIBADD = \
        $(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la \
-       $(GD_LIBS)
+       $(GDLIB_LIBS)
 
 if WITH_TCL
 all-local: pkgIndex.tcl
index 3dc3ae48dbf7c077bbd3d85edbc98e054fe64054..c61536142e1e40cdc7efcaa8fe03b5cba72aa6e6 100644 (file)
@@ -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)