timjencar / mscgen

Automatically exported from code.google.com/p/mscgen
GNU General Public License v2.0
0 stars 0 forks source link

[Patch] When building without png support, do not require libgd. #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi

Since mscgen only uses libgd for png support, it should not require this
library, when png support is disabled.

I have added a patch to the build system based on revision 75 that enables
"--with-png/--without-png" switches to enable/disable png support
(respectively) - defaulting to "--with-png".

When --without-png is used, configure will not check for gd and the build
system will not link against it either. This allowed me to discover that
svg_out.c requires -lm (for sin or cos), so in this patch mscgen always
links directly against said library instead of relying on libgd linking
against it.

Other changes in this patch: I also added "--with-libgd=$DIR" as a
short-cut for adding "-I$DIR/include" and "-L$DIR/lib", except configure
will bail if either dir does not exist - also if given, configure will
never fall back to using the convenience library[1]. This is a convenience
switch for people, who have libgd installed in a non-standard dir. It does
however not add an "RPATH" flag, so unless this is manually given in
LDFLAGS, mscgen will need to be run with LD_LIBRARY_PATH/RUNPATH/etc. set
correctly.

Also, I moved the macro functions to acinclude.m4 (which is automatically
checked by aclocal) - I felt it made configure.ac more readable. It should
noted however that autoconf/autoreconf is unable to spot if macros are
spelled wrong (by default at least), when they are placed in acinclude.m4,
in case more macro functions are added in the future.

~Niels

[1] Odds are, that if the user bothered to tell us where libgd is
installed, he/she does not want to use the convenience library.

Original issue reported on code.google.com by NThykier@gmail.com on 27 Jul 2009 at 7:35

Attachments:

GoogleCodeExporter commented 9 years ago
Thankyou for the patch.  I started with this, but then found examples where
pkg-config can be used to do something similar, so I've tried that - see r80.

In the case that --without-png is not specified, this tries to use pkg-config to
'find' libgd.  The user can also override this by setting GDLIB_CFLAGS/LIBS 
directly,
and it's documented automatically under configure --help!

Original comment by Michael....@gmail.com on 2 Aug 2009 at 5:35