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

Steve Lime steve.lime at dnr.state.mn.us
Tue Feb 4 12:21:51 EST 2003

Can those familiar with autoconf handle this one?

>>> "Eric L. Blevins" <eblevins at insight.rr.com> 02/02/03 01:52PM >>>
First I'll say that I am not very familiar with autoconf or even C
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=yes 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" = "yes" ; then
    dnl check for freetype1 first
    AC_CHECK_LIB(ttf, TT_Init_FreeType, FT_LIB="-lttf",
        AC_CHECK_LIB(freetype, FT_Init_FreeType, FT_LIB="-lfreetype",,)
    dnl check for freetype2 first
    AC_CHECK_LIB(freetype, FT_Init_FreeType, FT_LIB="-lfreetype",
        AC_CHECK_LIB(ttf, TT_Init_FreeType, FT_LIB="-lttf",,) )

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=yes 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


+if test "$enable_force_freetype1" = "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="$FT_DIR/lib"
+  test -f $FT_DIR/libttf.a -o -f $FT_DIR/libttf.so -o -f
$FT_DIR/libttf.sl && FT_LIBDIR="$FT_DIR"
+  if test -n "$FT_LIBDIR" ; then
+    FT_TYPE="-lttf"
+  fi
test -x "$FT_DIR" -a "freetype-config" = "`basename $FT_DIR ''`" &&

    if test -n "$FT_LIBDIR" ; then

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

Eric L. Blevins    www.WiFiMaps.com 

More information about the mapserver-dev mailing list