building MS5+AGG

Gregor Mosheh gregor at HOSTGIS.COM
Wed Sep 19 11:05:36 PDT 2007


Hi, all.
I was disappointed in the lack of help with my compile issue, but 
considering what I pay you all, I can't reasonably complain. :) The 
excellent news is that we got MS5+AGG working, and boy are we impressed. 
Between "minfeaturesize auto" and the new line rendering, it's like a 
whole new app, smooth order from jagged chaos.

Anyway, I wanted to share how I built AGG so that it compiled smoothly 
into Mapserver, since the procedure described in ticket 2215 just wasn't 
producing anything that would like. This is for Slamd64 (64-bit 
SLackware), but aside from the prerequisite packages it should work for 
other Linux-based OSs as well if you're not fortunate enough to have AGG 
available as a package.


For 64-bit, these are a good general rule and don't hurt;
export CPPFLAGS="-D_FILE_OFFSET_BITS=64"
export CXXFLAGS="-fPIC -D_FILE_OFFSET_BITS=64"
export CFLAGS="-fPIC -D_FILE_OFFSET_BITS=64"


To get AGG running smoothly, one must have SDL installed. On Slack, this 
means having the X11 base installed as well.
    l/sdl-1.2.11-*.tgz
    x/x11-6.9.0-*.tgz
For 64-bit, also the X11 32-bit compat:
    c/32x11-6.9.0-x86_64-2.tgz


Apply this patch to the source (watch the linewrap!) using "patch -b -p1 
< this.patch"

diff -ru agg-2.5.orig/font_freetype/Makefile.am 
agg-2.5/font_freetype/Makefile.am
--- agg-2.5.orig/font_freetype/Makefile.am      2005-10-18 
11:45:40.000000000 +0100
+++ agg-2.5/font_freetype/Makefile.am   2006-07-10 15:11:55.000000000 +0100
@@ -4,8 +4,9 @@
  agginclude_HEADERS = agg_font_freetype.h
  lib_LTLIBRARIES = libaggfontfreetype.la

-libaggfontfreetype_la_LDFLAGS = -version-info @AGG_LIB_VERSION@ 
@FREETYPE_LIBS@
+libaggfontfreetype_la_LDFLAGS = -version-info @AGG_LIB_VERSION@ 
@FREETYPE_LIBS@
  libaggfontfreetype_la_SOURCES = agg_font_freetype.cpp
  libaggfontfreetype_la_CXXFLAGS = -I$(top_srcdir)/include @FREETYPE_CFLAGS@
+libaggfontfreetype_la_LIBADD = ../src/libagg.la
  endif

diff -ru agg-2.5.orig/src/platform/sdl/Makefile.am 
agg-2.5/src/platform/sdl/Makefile.am
--- agg-2.5.orig/src/platform/sdl/Makefile.am   2005-10-17 
23:49:35.000000000 +0100
+++ agg-2.5/src/platform/sdl/Makefile.am        2006-07-10 
15:11:55.000000000 +0100
@@ -5,6 +5,6 @@
  libaggplatformsdl_la_LDFLAGS = -version-info @AGG_LIB_VERSION@
  libaggplatformsdl_la_SOURCES = agg_platform_support.cpp
  libaggplatformsdl_la_CXXFLAGS = -I$(top_srcdir)/include @SDL_CFLAGS@
-libaggplatformsdl_la_LIBADD = @SDL_LIBS@
+libaggplatformsdl_la_LIBADD = @SDL_LIBS@ ../../libagg.la
  endif

diff -ru agg-2.5.orig/src/platform/X11/Makefile.am 
agg-2.5/src/platform/X11/Makefile.am
--- agg-2.5.orig/src/platform/X11/Makefile.am   2005-10-19 
19:11:35.000000000 +0100
+++ agg-2.5/src/platform/X11/Makefile.am        2006-07-10 
15:11:55.000000000 +0100
@@ -4,5 +4,5 @@
  libaggplatformX11_la_LDFLAGS = -version-info @AGG_LIB_VERSION@ 
-L at x_libraries@
  libaggplatformX11_la_SOURCES = agg_platform_support.cpp
  libaggplatformX11_la_CXXFLAGS =  -I$(top_srcdir)/include @x_includes@
-libaggplatformX11_la_LIBADD = -lX11
+libaggplatformX11_la_LIBADD = -lX11 ../../libagg.la
  endif


Then a simple make and install:
sh ./autogen.sh --disable-gpc
make
make install



Hopefully, this will save other Slackers a few hours.

-- 
Gregor Mosheh / Greg Allensworth
System Administrator, HostGIS cartographic development & hosting services
http://www.HostGIS.com/

"Remember that no one cares if you can back up,
  only if you can restore." - AMANDA



More information about the MapServer-users mailing list