|
From: m s. <mw...@us...> - 2007-01-31 02:56:57
|
I'll try another approach to explaining what is broken with configure. I'm=
going use GD as the example case.
The configure help states the following:
--with-gd=3DDIR where to find Tom Boutell's gd library
This leads me to understand that a directory [DIR] can be specified. Howev=
er, examining the actual configure.in file reveals that the specified direc=
tory is never used when a version of GD is found in $PATH. From configure.=
in
> if test "$with_gd" !=3D no; then
> AC_PATH_PROG([GDLIB_CONFIG], [gdlib-config])
> if test -n "$GDLIB_CONFIG"; then
> libgd_CPPFLAGS=3D`gdlib-config --cflags`
> libgd_LDFLAGS=3D`gdlib-config --ldflags`
> elif test -d "$with_gd"; then
> libgd_CPPFLAGS=3D"-I$with_gd/include"
> libgd_LDFLAGS=3D"-L$with_gd/lib"
> fi
As you can see the first test is to try and find gdlib-config in $PATH. Th=
e elif branch checks the user specfied directory if and only if there is no=
other version of GD found in $PATH. This means that configure ignored my =
request to use a particular location for the GD library.
I spent some time examining the GD configure script since it can include a =
wide variety of external libraries. I found that GD does not properly loca=
te libpng when specified via --with-png. However, --with-freetype does wor=
k properly.
So here is the patch to configure.in that I propose. It will check the use=
r specified path first, then check $PATH. Here is the result of my change =
followed by a diff.
if test "$with_gd" !=3D no; then
if test -d "$with_gd"; then
if test -x "$with_gd/bin/gdlib-config"; then
GDLIB_CONFIG=3D"$with_gd/bin/gdlib-config"
else
libgd_CPPFLAGS=3D"-I$with_gd/include"
libgd_LDFLAGS=3D"-L$with_gd/lib"
fi
else
AC_PATH_PROG([GDLIB_CONFIG], [gdlib-config])
fi
if test -n "$GDLIB_CONFIG"; then
libgd_CPPFLAGS=3D`$GDLIB_CONFIG --cflags`
if test "$with_gd" =3D yes; then
libgd_LDFLAGS=3D`$GDLIB_CONFIG --ldflags`
else
libgd_LDFLAGS=3D"-L"`$GDLIB_CONFIG --libdir`" "`$GDLIB_CONFIG --ldfla=
gs`
fi
fi
diff -u -u -r1.213 configure.in
--- configure.in 24 Jan 2007 05:22:11 -0000 1.213
+++ configure.in 29 Jan 2007 04:36:21 -0000
@@ -401,15 +401,24 @@
with_gd=3Dyes)
=20
if test "$with_gd" !=3D no; then
- AC_PATH_PROG([GDLIB_CONFIG], [gdlib-config])
+ if test -d "$with_gd"; then
+ if test -x "$with_gd/bin/gdlib-config"; then
+ GDLIB_CONFIG=3D"$with_gd/bin/gdlib-config"
+ else
+ libgd_CPPFLAGS=3D"-I$with_gd/include"
+ libgd_LDFLAGS=3D"-L$with_gd/lib"
+ fi
+ else
+ AC_PATH_PROG([GDLIB_CONFIG], [gdlib-config])
+ fi
if test -n "$GDLIB_CONFIG"; then
- libgd_CPPFLAGS=3D`gdlib-config --cflags`
- libgd_LDFLAGS=3D`gdlib-config --ldflags`
- elif test -d "$with_gd"; then
- libgd_CPPFLAGS=3D"-I$with_gd/include"
- libgd_LDFLAGS=3D"-L$with_gd/lib"
+ libgd_CPPFLAGS=3D`$GDLIB_CONFIG --cflags`
+ if test "$with_gd" =3D yes; then
+ libgd_LDFLAGS=3D`$GDLIB_CONFIG --ldflags`
+ else
+ libgd_LDFLAGS=3D"-L"`$GDLIB_CONFIG --libdir`" "`$GDLIB_CONFIG --ldfl=
ags`
+ fi
fi
-
_cppflags=3D"$CPPFLAGS"
_ldflags=3D"$LDFLAGS"
CPPFLAGS=3D"$CPPFLAGS $libgd_CPPFLAGS"
@@ -461,7 +470,7 @@
])
=20
if test -n "$GDLIB_CONFIG"; then
- libgd_LIBS=3D`gdlib-config --libs`
+ libgd_LIBS=3D`$GDLIB_CONFIG --libs`
fi
=20
dnl piece it all together
-----
Mike Sutton
=3D
Ship Authentic Maryland Crabcakes Online
CrabcakeFactoryUSA.com is a purveyor of authentic Maryland Crabcakes. Made =
by hand in our Ocean City, Maryland location since 1996. Jumbo all lump Mar=
yland Crabcakes.
http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=3Dc09333e12b3785217b22d=
b24988dbc30
|