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

Eric L. Blevins eblevins at insight.rr.com
Tue Feb 4 14:07:56 EST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_0249_01C2CC56.D11A7120
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

on freebsd after installing X freetype2 was installed
So I end up with
/usr/local/lib/libfreetype.*
and
/usr/local/include/freetype2/*

I installed freetype1 from the freebsd ports /usr/ports/print/freetype
then I end up with
/usr/local/lib/libttf.*
and
/usr/local/include/freetype1/*

So now my system has both freetype1 and freetype2

but the configure script always detects freetype2 regardless of
using --enable-force-freetype1=yes

this code in the configure script never finds either library

AC_CHECK_LIB(ttf, TT_Init_FreeType, FT_LIB="-lttf",
AC_CHECK_LIB(freetype, FT_Init_FreeType, FT_LIB="-lfreetype",,)

Since the configure script first detects the presence of freetype2
which it finds.
then runs the above code if -enable-force-freetype1=yes

the script never finds freetype1 because the above code does not find
freetype1

This code does detect freetype1:

    dnl try freetype 1.x install lib name
    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

But the above code never gets ran if freetype2 is installed because it
detects freetype2 then jumps over this code.
If I uninstall freetype2 with no changes to the configure script the above
code does indeed find freetype1
I made a quick diry change that does work and only changes the way things
are detected if -enable-force-freetype1 is used.
I attached the diffs to this e-mail if that will help anyone.


--------------------------------------------------------
Eric L. Blevins    www.WiFiMaps.com
--------------------------------------------------------
----- Original Message -----
From: "Daniel Morissette" <morissette at dmsolutions.ca>
To: "Steve Lime" <steve.lime at dnr.state.mn.us>
Cc: <eblevins at insight.rr.com>; <mapserver-dev at lists.gis.umn.edu>
Sent: Tuesday, February 04, 2003 12:26 PM
Subject: Re: [Mapserver-dev] Force Freetype1 problem, suggested changeto
configure.in


> Steve Lime wrote:
> >
> > Can those familiar with autoconf handle this one?
> >
>
> I gave this a try yesterday and couldn't understand why this would work
> any better.  Then looking at the configure script I started to notice
> all sorts of potential problems and gave up thinking I needed some
> sleep.
>
> Not sure when, but I'll take care of this.
>
> Daniel
>
> > >>> "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
> > 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=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",,)
> > )
> >   else
> >     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",,) )
> >   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=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
> > changes.
> >
> > FT_LIB=''
> > FT_BIN=''
> > FT_TYPE=''
> >
> > +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
> > +
> > +else
> > test -x "$FT_DIR" -a "freetype-config" = "`basename $FT_DIR ''`" &&
> > FT_BIN="$FT_DIR"
> >
> >     if test -n "$FT_LIBDIR" ; then
> >         FT_TYPE="-lttf"
> >     fi
> >   fi
> > fi
> > +fi
> >
> > if test -n "$FT_LIBDIR" -a -z "$FT_BIN" ; then
> >
> > --------------------------------------------------------
> > Eric L. Blevins    www.WiFiMaps.com
> > --------------------------------------------------------
>

------=_NextPart_000_0249_01C2CC56.D11A7120
Content-Type: text/plain;
	name="configure.in.diffs.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="configure.in.diffs.txt"

--- configure.in.orig   =20
+++ configure.in=20
***************
*** 238,247 ****
--- 238,255 ----
  AC_CHECKING(where FreeType is installed...)
  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"
  test -x "$FT_DIR/freetype-config" && =
FT_BIN=3D"$FT_DIR/freetype-config"
  test -x "$FT_DIR/bin/freetype-config" && =
FT_BIN=3D"$FT_DIR/bin/freetype-config"

  if test "$with_freetype" =3D "yes" ; then
***************
*** 270,279 ****
--- 278,288 ----
      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
    fi
+ fi
  fi

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

    FT_LIB=3D"-L$FT_LIBDIR $FT_TYPE"

------=_NextPart_000_0249_01C2CC56.D11A7120--




More information about the mapserver-dev mailing list