[Mapserver-dev] Force Freetype1 problem, suggested change to configure.in

Eric L. Blevins eblevins at insight.rr.com
Sun Feb 2 14:52:08 EST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_0089_01C2CACA.A91ADDF0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

First I'll say that I am not very familiar with autoconf or even C =
programming.
I made some changes to the configure.in file that work much better for =
me and thought I would share them.

First I'll explain my particular problem and provide the solution that =
works on my system.

I am using FreeBSD 4.7
I have both freetype1 and freetype2 installed on my system from the =
freebsd ports.

the --enable-force-freetype1=3Dyes always detects that I have freetype2 =
and never sees freetype1

this part of the configure.in does not detect either library hence the =
reason it never finds freetype1 with --enable-force-freetype1

if test "$enable_force_freetype1" =3D "yes" ; then
    dnl check for freetype1 first
    AC_CHECK_LIB(ttf, TT_Init_FreeType, FT_LIB=3D"-lttf",
        AC_CHECK_LIB(freetype, FT_Init_FreeType, =
FT_LIB=3D"-lfreetype",,) )
  else
    dnl check for freetype2 first
    AC_CHECK_LIB(freetype, FT_Init_FreeType, FT_LIB=3D"-lfreetype",
        AC_CHECK_LIB(ttf, TT_Init_FreeType, FT_LIB=3D"-lttf",,) )
  fi

According to the autoconf documentation I read this should work but it =
does not for some strange reason.

So I did some copying and pasting in the configure.in and came up with =
these changes that do work for me.
now if I specify --enable-force-freetype1=3Dyes it detects freetype1 if =
I do not specify it it default to detecting freetype2

mapserver compiled fine and renders True Type fonts perfect with these =
changes.


FT_LIB=3D''
FT_BIN=3D''
FT_TYPE=3D''

+if test "$enable_force_freetype1" =3D "yes" ; then
+test -f $FT_DIR/lib/libttf.a -o -f $FT_DIR/lib/libttf.so -o -f =
$FT_DIR/lib/libttf.sl && FT_LIBDIR=3D"$FT_DIR/lib"
+  test -f $FT_DIR/libttf.a -o -f $FT_DIR/libttf.so -o -f =
$FT_DIR/libttf.sl && FT_LIBDIR=3D"$FT_DIR"
+  if test -n "$FT_LIBDIR" ; then
+    FT_TYPE=3D"-lttf"
+  fi
+
+else
test -x "$FT_DIR" -a "freetype-config" =3D "`basename $FT_DIR ''`" && =
FT_BIN=3D"$FT_DIR"



    if test -n "$FT_LIBDIR" ; then
        FT_TYPE=3D"-lttf"
    fi
  fi
fi
+fi

if test -n "$FT_LIBDIR" -a -z "$FT_BIN" ; then

--------------------------------------------------------
Eric L. Blevins    www.WiFiMaps.com
--------------------------------------------------------

------=_NextPart_000_0089_01C2CACA.A91ADDF0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2722.900" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>First I'll say that I am not very =
familiar with=20
autoconf or even C programming.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I made some changes to the configure.in =
file that=20
work much better for me and thought I would share them.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>First I'll explain my particular =
problem and=20
provide&nbsp;the solution that works on my system.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I am using FreeBSD 4.7</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I have both freetype1 and freetype2 =
installed on my=20
system from the freebsd ports.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>the --enable-force-freetype1=3Dyes =
always detects=20
that I have freetype2 and never sees freetype1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>this part of the configure.in does not =
detect=20
either library hence the reason it never finds freetype1 with=20
--enable-force-freetype1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>if test "$enable_force_freetype1" =3D =
"yes" ;=20
then<BR>&nbsp;&nbsp;&nbsp; dnl check for freetype1 =
first<BR>&nbsp;&nbsp;&nbsp;=20
AC_CHECK_LIB(ttf, TT_Init_FreeType,=20
FT_LIB=3D"-lttf",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
AC_CHECK_LIB(freetype, FT_Init_FreeType, FT_LIB=3D"-lfreetype",,) =
)<BR>&nbsp;=20
else<BR>&nbsp;&nbsp;&nbsp; dnl check for freetype2 =
first<BR>&nbsp;&nbsp;&nbsp;=20
AC_CHECK_LIB(freetype, FT_Init_FreeType,=20
FT_LIB=3D"-lfreetype",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
AC_CHECK_LIB(ttf, TT_Init_FreeType, FT_LIB=3D"-lttf",,) )<BR>&nbsp;=20
fi<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>According to the autoconf documentation =
I read this=20
should work but it does not for some strange reason.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>So I did some copying and pasting in =
the=20
configure.in and came up with these changes that do work for =
me.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>now if I specify =
--enable-force-freetype1=3Dyes it=20
detects freetype1 if I do not specify it it default to detecting=20
freetype2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>mapserver compiled fine and renders =
True Type fonts=20
perfect with these changes.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>FT_LIB=3D''<BR>FT_BIN=3D''<BR>FT_TYPE=3D''</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>+if test "$enable_force_freetype1" =3D =
"yes" ;=20
then<BR>+test -f $FT_DIR/lib/libttf.a -o -f $FT_DIR/lib/libttf.so -o -f=20
$FT_DIR/lib/libttf.sl &amp;&amp; FT_LIBDIR=3D"$FT_DIR/lib"<BR>+&nbsp; =
test -f=20
$FT_DIR/libttf.a -o -f $FT_DIR/libttf.so -o -f $FT_DIR/libttf.sl =
&amp;&amp;=20
FT_LIBDIR=3D"$FT_DIR"<BR>+&nbsp; if test -n "$FT_LIBDIR" ;=20
then<BR>+&nbsp;&nbsp;&nbsp; FT_TYPE=3D"-lttf"<BR>+&nbsp; fi</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>+</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>+else<BR>test -x "$FT_DIR" -a =
"freetype-config" =3D=20
"`basename $FT_DIR ''`" &amp;&amp; FT_BIN=3D"$FT_DIR"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if test -n =
"$FT_LIBDIR" ;=20
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
FT_TYPE=3D"-lttf"<BR>&nbsp;&nbsp;&nbsp; fi<BR>&nbsp; =
fi<BR>fi<BR>+fi</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>if test -n "$FT_LIBDIR" -a -z "$FT_BIN" =
;=20
then<BR></DIV></FONT>
<DIV><FONT face=3DArial=20
size=3D2>--------------------------------------------------------<BR>Eric=
 L.=20
Blevins&nbsp;&nbsp;&nbsp; <A=20
href=3D"http://www.WiFiMaps.com">www.WiFiMaps.com</A><BR>----------------=
----------------------------------------</FONT></DIV></BODY></HTML>

------=_NextPart_000_0089_01C2CACA.A91ADDF0--




More information about the mapserver-dev mailing list