Re: Compiling GM on Debian 8 with libpng16

[email protected]
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
----- Bob Friesenhahn <[email protected]> wrote:
> On Fri, 15 May 2015, Matthias Schmitt wrote:

> Using a different libpng than the system natively provides can be a 
> bit of work.

The simplest workaround that I've found is to build my own libpng
with a prefix, so it can coexist with a system libpng.  For example,
I have libpng12 as the "system" library that was installed by Ubuntu,
but want to use libpng16 (compiled withASAN) in an ASAN build of
GraphicsMagick.

So I configure libpng with

  CC=gcc \
  CPPFLAGS="-I/home/asan/bin/include" \
  CFLAGS="-g -fsanitize=address -fno-omit-frame-pointer" \
  LDFLAGS="-fsanitize=address -L/home/glennrp/asan/lib \
           -Wl,-rpath,/home/glennrp/asan/lib" \
  ./configure --prefix=/home/glennrp/asan \
            --with-libpng-prefix=LIBPNG_ASAN_ \

and GraphicsMagick with

  CC=gcc \
  CFLAGS="-g -I/home/glennrp/asan/include \
          -fsanitize=address -fno-omit-frame-pointer" \
  CPPFLAGS="-I/home/glennrp/asan/include" \
  LDFLAGS="-fsanitize=address -L/home/glennrp/asan/lib \
           -Wl,-rpath,/home/glennrp/asan/lib"

This way, freetype looks for functions named "png_set_something"
and finds them in the system libpng12, while GraphicsMagick looks
for things like  "LIBPNG_ASAN_png_set_something" and finds them in
my asan/lib/libpng16.

Glenn

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.