Re: [GM-help] Weird configure quirk on FreeBSD
Swiss army knife of image processing
Brought to you by:
bfriesen
From: Bob F. <bfr...@si...> - 2005-05-23 21:26:55
|
On Mon, 23 May 2005 no...@no... wrote: > > Can anyone explain this? It took me forever to figure out that > to successfully configure GraphicsMagick on FreeBSD 5.3 I need > the following configure command: > ./configure --with-x=no CPPFLAGS=-I/usr/local/include > LDFLAGS='-L/usr/local/lib' > The reason this took me so long to figure out is that the configure > output reports that it appends "-L/usr/local/lib" to LDFLAG by default. How odd ... but there is an explanation. GraphicsMagick's configure script does not intentionally automatically add the install directory to the lib and include search paths even though the intial thought is that this is an obvious thing to do. While the configure script runs, configure executes FreeType's freetype-config script which produces output like: % freetype-config --libs -L/usr/local/lib -lfreetype -lz so GraphicsMagick adds the -L/usr/local/lib option to LDFLAGS. However, by the time it does this, several other libraries (e.g. libjpeg) have already been tested for. So the end result is that FreeType is found, -L/usr/local/lib is used in the final build options, but earlier tests which needed the option fail. The cure for this may be to break up the configure into one part which builds up the LDFLAGS/CPPFLAGS, and a second part which actually does the test. The drawback to this is if the test fails, then LDFLAGS/CPPFLAGS will still refer to the directory which failed. The reason why GraphicsMagick's configure script does not automatically add the install directory to the lib and include search paths is because this does not always work right. Sometimes the user needs a different search path in order for things to work right. The reason is that there may be two similar libraries, one of which is already installed in the prefix directory, but the user wants to use a different one in the build. So GraphicsMagick's configure script leaves it up to the user. Bob ====================================== Bob Friesenhahn bfr...@si..., http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ |