[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info-beta
Subject:    Re: configure.in and libgd
From:       Allin Cottrell <cottrell () wfu ! edu>
Date:       2009-02-09 15:33:50
Message-ID: Pine.A41.4.58.0902091031220.266526 () f1n11 ! sp2net ! wfu ! edu
[Download RAW message or body]

On Mon, 9 Feb 2009, Allin Cottrell wrote:

> There's something wrong with the handling of the linker line for
> libgd in gnuplot's configure.in...
>
> I'm not sure exactly what's the best fix here, but it seems that
> adding "-lpng" should somehow be made conditional on
> the libgd_LIBS variable not already including a directive to link
> to (some variant of) libpng.

Here's a stab at a patch.  Probably could be more elegant.

Allin Cottrell
["configure.in.diff" (TEXT/PLAIN)]

--- configure.in.orig	2009-02-09 10:30:08.000000000 -0500
+++ configure.in	2009-02-09 10:30:40.000000000 -0500
@@ -488,11 +488,18 @@
        libgd_LIBS="$libgd_LIBS -lfreetype"
      fi
 
-     LIBS="$_libs $libgd_LIBS -lpng"
+     if ! echo $libgd_LIBS | grep '\-lpng' > /dev/null 2>&1; then
+         pnglink=no
+         LIBS="$_libs $libgd_LIBS -lpng"
+     fi
      dnl png support in libgd
-     AC_CHECK_LIB(gd,gdImagePng,
-       [AC_DEFINE(HAVE_GD_PNG,1,[ Define if libgd supports png. ])
-        libgd_LIBS="$libgd_LIBS -lpng"])
+     AC_CHECK_LIB(gd,gdImagePng,[have_png=yes])
+     if test "$have_png" = yes; then
+         AC_DEFINE(HAVE_GD_PNG,1,[ Define if libgd supports png. ])
+	 if test "$pnglink" = no; then
+	     libgd_LIBS="$libgd_LIBS -lpng"
+	 fi
+     fi  
      LIBS="$_libs"
 
     ],[dnl gd library not found


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com

_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic