Solaris compilation, freetype-config, custom libraries

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

Solaris compilation, freetype-config, custom libraries

Post by axelrose »

Hello all,

I have difficulties to link an ImageMagick build against my own delegate library builds.

Freetype seems to be particulary rebellious.
Dowloading freetype-2.3.9 and building with

Code: Select all

DIR=/data/install
./configure \
  CPPFLAGS=-I$DIR/include \
  LDFLAGS=-L$DIR/lib \
  --prefix=$DIR --enable-shared --disable-dependency-tracking
produces $DIR/lib/libfreetype.so.6.3.20 and $DIR/include/ft2build.h

Now

Code: Select all

cd ImageMagick-6.5.6-9
./configure \
  --prefix=$DIR \
  CPPFLAGS="-I$DIR/inlcude" LDFLAGS="-L$DIR/lib -R$DIR/lib" \
  --with-freetype=yes
reports

Code: Select all

...
LDFLAGS         = -Wl,-zlazyload -L/data/install/axel-imagemagick/install/lib -R/data/install/axel-imagemagick/install/lib -L/usr/openwin/lib -R/usr/openwin/lib -L/opt/csw/lib
MAGICK_LDFLAGS  = -L/data/install/axel-imagemagick/install/lib -Wl,-zlazyload -L/data/install/axel-imagemagick/install/lib -R/data/install/axel-imagemagick/install/lib -L/usr/openwin/lib -R/usr/openwin/lib -L/opt/csw/lib
LIBS            = -lMagickCore -llcms -ltiff -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lsocket -lnsl -lXt -lbz2 -lz -lm -lpthread 
...
"configure" found the system installation of libfreetype in /opt/csw/lib instead
of the freshly built libfreetype.

This breaks the further compilation

Code: Select all

ld: warning: symbol `tt_cmap2_class_rec' has differing sizes:
        (file /data/install/lib/libfreetype.so value=0x34; file /opt/csw/lib/libfreetype.so value=0x20);
        /data/install/lib/libfreetype.so definition taken
ld: fatal: recording name conflict: file `/data/install/lib/libfreetype.so' and file `/opt/csw/lib/libfreetype.so' provide identical dependency names: libfreetype.so.6  (possible multiple inclusion of the same file)
ld: fatal: File processing errors. No output written to magick/.libs/libMagickCore.so.2.0.0
collect2: ld returned 1 exit status
How can I resolve this? I found some references to
a FREETYPE_LIBS or freetype_config variable but couldn't get them to influence the build.

The question concerns other libraries as well (libtiff). What's the proper
way to enforce the IM build process to use specific libraries?


Thanks for any hints
Axel
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

Re: Solaris compilation, freetype-config, custom libraries

Post by axelrose »

(replying to myself)
It looks like the setting of LD_LIBRARY_PATH is disturbing.
If LD_LIBRARY_PATH points to preexisting library this one is taken by configure.sh
no matter how LD_OPTIONS, LDFLAGS, LIBS or other options are set.
Post Reply