0

I was going through this old post Compile ImageMagick from source with PNG support on OSX.

I did mostly all of what it says with minor changes. Libpng and Zlib are in the following paths

/usr/local/libpng
/usr/local/zlib

When trying to configure ImageMagick 7.0.5-7 I do it like

./configure --prefix=/usr/local/imagemagick
            CPPFLAGS='-I/usr/local/libpng/include -I/usr/local/zlib/include'
            LDFLAGS='-L/usr/local/libpng/lib -L/usr/local/zlib/lib'
            --enable-shared --enable-delegate-build

But still png and zlib are marked as

ZLIB              --with-zlib=yes       no
PNG               --with-png=yes        no

In some other website I read that I should add to the system variable PKG_CONFIG_PATH the path to the .pc files. So before running configure I tried also

export PKG_CONFIG_PATH=/usr/local/libpng/lib/pkgconfig:/usr/local/zlib/share/pkgconfig/

but still the libraries are not recognized. Anyone around that knows how to tell the configure script where to look for the libraries?

BRabbit27
  • 6,333
  • 17
  • 90
  • 161
  • Are you sure the compiles of both zlib and libpng worked properly. Look in the config.log files for each and see if there was an error? If they are fine, try using CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' – fmw42 May 24 '17 at 21:32
  • Maybe add `-Wl,-rpath,/usr/local/lib` to LDFLAGS – Glenn Randers-Pehrson May 24 '17 at 22:45
  • @GlennRanders-Pehrson nope i was missing pkg-config in my machine. Thanks. – BRabbit27 May 25 '17 at 18:25

1 Answers1

3

I got it working ! After exploring the configure file I figured out that what was missing was pkg-config tool. I just download it from this site installed it. Run the command above and it works fine now.

BRabbit27
  • 6,333
  • 17
  • 90
  • 161