+ added GNU autotools build environment

+ raster and gdal input isn't tested. Not working currently...
+ *-input.so plugins created. Change loader in source or link plugin to correct place
+ use pkg-config uninstalled feature
  -> define project root to PKG_CONFIG_PATH to use mapnik without installation
+ added various library checks
+ don't install fonts
+ don't use included AGG
  -> check for a installed libagg
+ Added Makefile for c++ demo
+ don't build any python wrapper stuff
  -> this follows if all other building works
+ added Anjuta file
  -> not needed to build anything, but helps much if you use Anjuta
This commit is contained in:
Andreas Volz 2007-09-14 23:07:16 +00:00
parent b835bac9ba
commit d38dedad68
27 changed files with 1299 additions and 1 deletions

29
Makefile.am Normal file
View file

@ -0,0 +1,29 @@
## Process this file with automake to produce Makefile.in
## Created by Anjuta
SUBDIRS = src \
agg\
plugins\
include
mapnikdocdir = ${prefix}/doc/mapnik
mapnikdoc_DATA = \
README\
COPYING\
AUTHORS\
ChangeLog\
INSTALL\
NEWS
EXTRA_DIST = $(mapnikdoc_DATA) \
$(fonts_DATA)\
$(includes_HEADERS)
# Copy all the spec files. Of cource, only one is actually used.
dist-hook:
for specfile in *.spec; do \
if test -f $$specfile; then \
cp -p $$specfile $(distdir); \
fi \
done

3
autogen.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/sh
./bootstrap && ./configure $@

75
bootstrap Normal file
View file

@ -0,0 +1,75 @@
#!/bin/sh
# Run this to bootstrap the files
PACKAGE=mapnik
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
DIE=0
# check if configure.ac is there
(test -f $srcdir/configure.ac) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level package directory"
exit 1
}
# check for autoconf
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
# check for libtool
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed."
echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
# check for automake
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed."
echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
DIE=1
NO_AUTOMAKE=yes
}
# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed doesn't appear recent enough."
echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
echo "Running libtoolize..."
libtoolize --force --copy
aclocalinclude="$ACLOCAL_FLAGS -I config"
echo "Running aclocal $aclocalinclude ..."
aclocal $aclocalinclude
echo "Running autoheader..."
autoheader
echo "Running automake..."
automake --add-missing --foreign $am_opt
echo "Running autoconf ..."
autoconf
echo "You could now exec ./configure --help to see available options"

186
config/ax_boost_base.m4 Normal file
View file

@ -0,0 +1,186 @@
dnl @synopsis AX_BOOST([MINIMUM-VERSION])
dnl
dnl Test for the Boost C++ libraries of a particular version (or newer)
dnl
dnl If no path to the installed boost library is given the macro
dnl searchs under /usr, /usr/local, and /opt, and evaluates the
dnl $BOOST_ROOT environment variable. Further documentation is
dnl available at <http://randspringer.de/boost/index.html>.
dnl
dnl This macro calls:
dnl
dnl AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
dnl
dnl And sets:
dnl
dnl HAVE_BOOST
dnl
dnl @category InstalledPackages
dnl @category Cxx
dnl @author Thomas Porschberg <thomas@randspringer.de>
dnl @version 2006-06-15
dnl @license AllPermissive
AC_DEFUN([AX_BOOST_BASE],
[
AC_ARG_WITH([boost],
AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is Yes) - it is possible to specify the root directory for boost (optional)]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ac_boost_path=""
else
want_boost="yes"
ac_boost_path="$withval"
fi
],
[want_boost="yes"])
if test "x$want_boost" = "xyes"; then
boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
if test "x$boost_lib_version_req_sub_minor" = "x" ; then
boost_lib_version_req_sub_minor="0"
fi
WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
succeeded=no
dnl first we check the system location for boost libraries
dnl this location ist chosen if boost libraries are installed with the --layout=system option
dnl or if you install boost with RPM
if test "$ac_boost_path" != ""; then
BOOST_LDFLAGS="-L$ac_boost_path/lib"
BOOST_CPPFLAGS="-I$ac_boost_path/include"
else
for ac_boost_path_tmp in /usr /usr/local /opt ; do
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
break;
fi
done
fi
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
dnl if we found no boost with system layout we search for boost libraries
dnl built and installed without the --layout=system option or for a staged(not installed) version
if test "x$succeeded" != "xyes"; then
_version=0
if test "$ac_boost_path" != ""; then
BOOST_LDFLAGS="-L$ac_boost_path/lib"
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
fi
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
done
fi
else
for ac_boost_path in /usr /usr/local /opt ; do
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
best_path=$ac_boost_path
fi
done
fi
done
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
BOOST_LDFLAGS="-L$best_path/lib"
if test "x$BOOST_ROOT" != "x"; then
if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
V_CHECK=`expr $stage_version_shorten \>\= $_version`
if test "$V_CHECK" = "1" ; then
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
BOOST_CPPFLAGS="-I$BOOST_ROOT"
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
fi
fi
fi
fi
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
fi
if test "$succeeded" != "yes" ; then
if test "$_version" = "0" ; then
AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
else
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
fi
else
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

View file

@ -0,0 +1,89 @@
dnl @synopsis AX_BOOST_FILESYSTEM
dnl
dnl Test for Filesystem library from the Boost C++ libraries. The macro
dnl requires a preceding call to AX_BOOST_BASE. Further documentation
dnl is available at <http://randspringer.de/boost/index.html>.
dnl
dnl This macro calls:
dnl
dnl AC_SUBST(BOOST_FILESYSTEM_LIB)
dnl
dnl And sets:
dnl
dnl HAVE_BOOST_FILESYSTEM
dnl
dnl @category InstalledPackages
dnl @category Cxx
dnl @author Thomas Porschberg <thomas@randspringer.de>
dnl @author Michael Tindal <mtindal@paradoxpoint.com>
dnl @version 2006-06-15
dnl @license AllPermissive
AC_DEFUN([AX_BOOST_FILESYSTEM],
[
AC_ARG_WITH([boost-filesystem],
AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@],
[use the Filesystem library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_filesystem_lib=""
else
want_boost="yes"
ax_boost_user_filesystem_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::Filesystem library is available,
ax_cv_boost_filesystem,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],
[[using namespace boost::filesystem;
path my_path( "foo/bar/data.txt" );
return 0;]]),
ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_filesystem" = "xyes"; then
AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
BN=boost_filesystem
if test "x$ax_boost_user_filesystem_lib" = "x"; then
for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \
lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \
$BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_FILESYSTEM_LIB="-l$ax_lib" AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes" break],
[link_filesystem="no"])
done
else
for ax_lib in $ax_boost_user_filesystem_lib $BN-$ax_boost_user_filesystem_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_FILESYSTEM_LIB="-l$ax_lib" AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes" break],
[link_filesystem="no"])
done
fi
if test "x$link_filesystem" = "xno"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

86
config/ax_boost_regex.m4 Normal file
View file

@ -0,0 +1,86 @@
dnl @synopsis AX_BOOST_REGEX
dnl
dnl Test for Regex library from the Boost C++ libraries. The macro
dnl requires a preceding call to AX_BOOST_BASE. Further documentation
dnl is available at <http://randspringer.de/boost/index.html>.
dnl
dnl This macro calls:
dnl
dnl AC_SUBST(BOOST_REGEX_LIB)
dnl
dnl And sets:
dnl
dnl HAVE_BOOST_REGEX
dnl
dnl @category InstalledPackages
dnl @category Cxx
dnl @author Thomas Porschberg <thomas@randspringer.de>
dnl @author Michael Tindal <mtindal@paradoxpoint.com>
dnl @version 2006-06-15
dnl @license AllPermissive
AC_DEFUN([AX_BOOST_REGEX],
[
AC_ARG_WITH([boost-regex],
AS_HELP_STRING([--with-boost-regex@<:@=special-lib@:>@],
[use the Regex library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_regex_lib=""
else
want_boost="yes"
ax_boost_user_regex_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::Regex library is available,
ax_cv_boost_regex,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/regex.hpp>
]],
[[boost::regex r(); return 0;]]),
ax_cv_boost_regex=yes, ax_cv_boost_regex=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_regex" = "xyes"; then
AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
BN=boost_regex
if test "x$ax_boost_user_regex_lib" = "x"; then
for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \
lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \
$BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do
AC_CHECK_LIB($ax_lib, main, [BOOST_REGEX_LIB="-l$ax_lib" AC_SUBST(BOOST_REGEX_LIB) link_regex="yes" break],
[link_regex="no"])
done
else
for ax_lib in $ax_boost_user_regex_lib $BN-$ax_boost_user_regex_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_REGEX_LIB="-l$ax_lib" AC_SUBST(BOOST_REGEX_LIB) link_regex="yes" break],
[link_regex="no"])
done
fi
if test "x$link_regex" = "xno"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

108
config/ax_boost_thread.m4 Normal file
View file

@ -0,0 +1,108 @@
dnl @synopsis AX_BOOST_THREAD
dnl
dnl Test for Thread library from the Boost C++ libraries. The macro
dnl requires a preceding call to AX_BOOST_BASE. Further documentation
dnl is available at <http://randspringer.de/boost/index.html>.
dnl
dnl This macro calls:
dnl
dnl AC_SUBST(BOOST_THREAD_LIB)
dnl
dnl And sets:
dnl
dnl HAVE_BOOST_THREAD
dnl
dnl @category InstalledPackages
dnl @category Cxx
dnl @author Thomas Porschberg <thomas@randspringer.de>
dnl @author Michael Tindal <mtindal@paradoxpoint.com>
dnl @version 2006-06-15
dnl @license AllPermissive
AC_DEFUN([AX_BOOST_THREAD],
[
AC_ARG_WITH([boost-thread],
AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@],
[use the Thread library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-thread=boost_thread-gcc-mt ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_thread_lib=""
else
want_boost="yes"
ax_boost_user_thread_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::Thread library is available,
ax_cv_boost_thread,
[AC_LANG_PUSH([C++])
CXXFLAGS_SAVE=$CXXFLAGS
if test "x$build_os" = "xsolaris" ; then
CXXFLAGS="-pthreads $CXXFLAGS"
elif test "x$build_os" = "xming32" ; then
CXXFLAGS="-mthreads $CXXFLAGS"
else
CXXFLAGS="-pthread $CXXFLAGS"
fi
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]],
[[boost::thread_group thrds;
return 0;]]),
ax_cv_boost_thread=yes, ax_cv_boost_thread=no)
CXXFLAGS=$CXXFLAGS_SAVE
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_thread" = "xyes"; then
if test "x$build_os" = "xsolaris" ; then
BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
elif test "x$build_os" = "xming32" ; then
BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
else
BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
fi
AC_SUBST(BOOST_CPPFLAGS)
AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Date_Time library is available])
BN=boost_thread
if test "x$ax_boost_user_thread_lib" = "x"; then
for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \
lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \
$BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do
AC_CHECK_LIB($ax_lib, main, [BOOST_THREAD_LIB="-l$ax_lib" AC_SUBST(BOOST_THREAD_LIB) link_thread="yes" break],
[link_thread="no"])
done
else
for ax_lib in $ax_boost_user_thread_lib $BN-$ax_boost_user_thread_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_THREAD_LIB="-l$ax_lib" AC_SUBST(BOOST_THREAD_LIB) link_thread="yes" break],
[link_thread="no"])
done
fi
if test "x$link_thread" = "xno"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

136
config/ax_lib_postgresql.m4 Normal file
View file

@ -0,0 +1,136 @@
dnl @synopsis AX_LIB_POSTGRESQL([MINIMUM-VERSION])
dnl
dnl This macro provides tests of availability of PostgreSQL 'libpq'
dnl library of particular version or newer.
dnl
dnl AX_LIB_POSTGRESQL macro takes only one argument which is optional.
dnl If there is no required version passed, then macro does not run
dnl version test.
dnl
dnl The --with-postgresql option takes one of three possible values:
dnl
dnl no - do not check for PostgreSQL client library
dnl
dnl yes - do check for PostgreSQL library in standard locations
dnl (pg_config should be in the PATH)
dnl
dnl path - complete path to pg_config utility, use this option if
dnl pg_config can't be found in the PATH
dnl
dnl This macro calls:
dnl
dnl AC_SUBST(POSTGRESQL_CFLAGS)
dnl AC_SUBST(POSTGRESQL_LDFLAGS)
dnl AC_SUBST(POSTGRESQL_VERSION)
dnl
dnl And sets:
dnl
dnl HAVE_POSTGRESQL
dnl
dnl @category InstalledPackages
dnl @category Cxx
dnl @author Mateusz Loskot <mateusz@loskot.net>
dnl @version 2006-07-16
dnl @license AllPermissive
AC_DEFUN([AX_LIB_POSTGRESQL],
[
AC_ARG_WITH([postgresql],
AC_HELP_STRING([--with-postgresql=@<:@ARG@:>@],
[use PostgreSQL library @<:@default=yes@:>@, optionally specify path to pg_config]
),
[
if test "$withval" = "no"; then
want_postgresql="no"
elif test "$withval" = "yes"; then
want_postgresql="yes"
else
want_postgresql="yes"
PG_CONFIG="$withval"
fi
],
[want_postgresql="yes"]
)
POSTGRESQL_CFLAGS=""
POSTGRESQL_LDFLAGS=""
POSTGRESQL_POSTGRESQL=""
dnl
dnl Check PostgreSQL libraries (libpq)
dnl
if test "$want_postgresql" = "yes"; then
if test -z "$PG_CONFIG" -o test; then
AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
fi
if test "$PG_CONFIG" != "no"; then
AC_MSG_CHECKING([for PostgreSQL libraries])
POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'`
AC_DEFINE([HAVE_POSTGRESQL], [1],
[Define to 1 if PostgreSQL libraries are available])
found_postgresql="yes"
AC_MSG_RESULT([yes])
else
found_postgresql="no"
AC_MSG_RESULT([no])
fi
fi
dnl
dnl Check if required version of PostgreSQL is available
dnl
postgresql_version_req=ifelse([$1], [], [], [$1])
if test "$found_postgresql" = "yes" -a -n "$postgresql_version_req"; then
AC_MSG_CHECKING([if PostgreSQL version is >= $postgresql_version_req])
dnl Decompose required version string of PostgreSQL
dnl and calculate its number representation
postgresql_version_req_major=`expr $postgresql_version_req : '\([[0-9]]*\)'`
postgresql_version_req_minor=`expr $postgresql_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
postgresql_version_req_micro=`expr $postgresql_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
if test "x$postgresql_version_req_micro" = "x"; then
postgresql_version_req_micro="0"
fi
postgresql_version_req_number=`expr $postgresql_version_req_major \* 1000000 \
\+ $postgresql_version_req_minor \* 1000 \
\+ $postgresql_version_req_micro`
dnl Decompose version string of installed PostgreSQL
dnl and calculate its number representation
postgresql_version_major=`expr $POSTGRESQL_VERSION : '\([[0-9]]*\)'`
postgresql_version_minor=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.\([[0-9]]*\)'`
postgresql_version_micro=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
if test "x$postgresql_version_micro" = "x"; then
postgresql_version_micro="0"
fi
postgresql_version_number=`expr $postgresql_version_major \* 1000000 \
\+ $postgresql_version_minor \* 1000 \
\+ $postgresql_version_micro`
postgresql_version_check=`expr $postgresql_version_number \>\= $postgresql_version_req_number`
if test "$postgresql_version_check" = "1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
AC_SUBST([POSTGRESQL_VERSION])
AC_SUBST([POSTGRESQL_CFLAGS])
AC_SUBST([POSTGRESQL_LDFLAGS])
])

27
config/ax_libjpeg.m4 Normal file
View file

@ -0,0 +1,27 @@
AC_DEFUN([AX_CHECK_JPEG],
[
dnl libjpeg check function
AC_CHECK_LIB(jpeg,
jpeg_set_defaults,
[JPEG_LIBS="-ljpeg" link_jpeg="yes"],
[link_jpeg="no"]
)
if test "x$link_jpeg" != "xno"; then
AC_CHECK_HEADER(jpeglib.h,
[JPEG_CFLAGS="" link_jpeg="yes"],
[link_jpeg="no"]
)
fi
if test "x$link_jpeg" = "xno"; then
AC_MSG_ERROR(Could not link against libjpeg !)
fi
AC_SUBST(JPEG_LIBS)
AC_SUBST(JPEG_CFLAGS)
])dnl

27
config/ax_libltdl.m4 Normal file
View file

@ -0,0 +1,27 @@
AC_DEFUN([AX_CHECK_LTDL],
[
dnl libjpeg check function
AC_CHECK_LIB(ltdl,
lt_dlopen,
[LTDL_LIBS="-lltdl" link_ltdl="ltdl"],
[link_jpeg="no"]
)
if test "x$link_ltdl" != "xno"; then
AC_CHECK_HEADER(ltdl.h,
[LTDL_CFLAGS="" link_ltdl="ltdl"],
[link_ltdl="no"]
)
fi
if test "x$link_ltdl" = "xno"; then
AC_MSG_ERROR(Could not link against libltdl !)
fi
AC_SUBST(LTDL_LIBS)
AC_SUBST(LTDL_CFLAGS)
])dnl

27
config/ax_libproj.m4 Normal file
View file

@ -0,0 +1,27 @@
AC_DEFUN([AX_CHECK_PROJ],
[
dnl libjpeg check function
AC_CHECK_LIB(proj,
pj_init_plus,
[PROJ_LIBS="-lproj" link_proj="yes"],
[link_proj="no"]
)
if test "x$link_proj" != "xno"; then
AC_CHECK_HEADER(proj_api.h,
[PROJ_CFLAGS="" link_proj="yes"],
[link_proj="no"]
)
fi
if test "x$link_proj" = "xno"; then
AC_MSG_ERROR(Could not link against libproj !)
fi
AC_SUBST(PROJ_LIBS)
AC_SUBST(PROJ_CFLAGS)
])dnl

27
config/ax_libtiff.m4 Normal file
View file

@ -0,0 +1,27 @@
AC_DEFUN([AX_CHECK_TIFF],
[
dnl libtiff check function
AC_CHECK_LIB(tiff,
TIFFClose,
[TIFF_LIBS="-ltiff" link_tiff="yes"],
[link_tiff="no"]
)
if test "x$link_tiff" != "xno"; then
AC_CHECK_HEADER(tiff.h,
[TIFF_CFLAGS="" link_tiff="yes"],
[link_tiff="no"]
)
fi
if test "x$link_tiff" = "xno"; then
AC_MSG_ERROR(Could not link against libtiff !)
fi
AC_SUBST(TIFF_LIBS)
AC_SUBST(TIFF_CFLAGS)
])dnl

107
configure.ac Normal file
View file

@ -0,0 +1,107 @@
dnl Process this file with autoconf to produce a configure script.
dnl Created by Anjuta application wizard.
AC_INIT(mapnik, 0.4.0)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_ISC_POSIX
AC_PROG_CXX
AM_PROG_CC_STDC
AC_HEADER_STDC
AM_PROG_LIBTOOL
dnl Check for option to enable debug
AC_MSG_CHECKING(whether to enable debugging)
AC_ARG_ENABLE(debug,
[ --enable-debug=[no/yes] enables debug build (default=no)],,
enable_debug=no)
dnl Checks for libraries
if [ ! test "x$enable_debug" != "xyes"]; then
AC_DEFINE(DEBUG, 1, [Define to enable debug build])
CXXFLAGS="${CXXFLAGS} -g -DDEBUG -DMAPNIK_DEBUG"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
dnl Check for boost
AX_BOOST_BASE
if test "$succeeded" != "yes" ; then
exit
fi
AX_BOOST_THREAD
if test "x$link_thread" = "xno"; then
exit
fi
AX_BOOST_FILESYSTEM
if test "x$link_filesystem" = "xno"; then
exit
fi
AX_BOOST_REGEX
if test "x$link_regex" = "xno"; then
exit
fi
dnl only for postgis plugin
AX_LIB_POSTGRESQL
AM_CONDITIONAL(BUILD_POSTGRESQL, test "x$found_postgresql" = "xyes")
AX_CHECK_TIFF
if test "x$link_tiff" = "xno"; then
exit
fi
AX_CHECK_JPEG
if test "x$link_jpeg" = "xno"; then
exit
fi
AX_CHECK_PROJ
if test "x$link_proj" = "xno"; then
exit
fi
AX_CHECK_LTDL
if test "x$link_ltdl" = "xno"; then
exit
fi
PKG_CHECK_MODULES(PNG, libpng)
AC_SUBST(PNG_CFLAGS)
AC_SUBST(PNG_LIBS)
PKG_CHECK_MODULES(FREETYPE2, freetype2)
AC_SUBST(FREETYPE2_CFLAGS)
AC_SUBST(FREETYPE2_LIBS)
PKG_CHECK_MODULES(AGG, libagg)
AC_SUBST(AGG_CFLAGS)
AC_SUBST(AGG_LIBS)
AC_OUTPUT([
Makefile
agg/Makefile
agg/src/Makefile
agg/include/Makefile
include/Makefile
include/mapnik/Makefile
plugins/Makefile
plugins/input/Makefile
plugins/input/gdal/Makefile
plugins/input/postgis/Makefile
plugins/input/raster/Makefile
plugins/input/shape/Makefile
src/Makefile
mapnik.pc
mapnik-uninstalled.pc
])

28
demo/c++/Makefile Normal file
View file

@ -0,0 +1,28 @@
CXX = g++
INCLUDE = `pkg-config --cflags mapnik freetype2`
LIBDIR = `pkg-config --libs mapnik freetype2`
DEFINES =
CXXFLAGS = $(DEFINES) $(INCLUDE) -Wall
LIBS = $(LIBDIR)
OBJ = rundemo.o
BIN = rundemo
all : $(BIN)
$(BIN) : $(OBJ)
libtool $(CXX) $(OBJ) $(LIBS) -o $@
.c.o :
$(CXX) -c $(CXXFLAGS) $<
.PHONY : clean
clean:
rm -f $(OBJ)
rm -f $(BIN)

View file

@ -42,7 +42,7 @@ int main ( int argc , char** argv)
std::cout << " running demo ... \n";
using namespace mapnik;
datasource_cache::instance()->register_datasources(argv[1]);
freetype_engine::instance()->register_font("/usr/local/lib/mapnik/fonts/DejaVuSans.ttf");
freetype_engine::instance()->register_font("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf");
Map m(800,600);
m.set_background(color_factory::from_string("white"));

6
include/Makefile.am Normal file
View file

@ -0,0 +1,6 @@
SUBDIRS = \
mapnik
## File created by the gnome-build tools

View file

@ -0,0 +1,98 @@
libmapnikdir = $(pkgincludedir)
libmapnik_HEADERS = \
agg_renderer.hpp\
attribute.hpp \
attribute_collector.hpp \
attribute_descriptor.hpp \
color.hpp \
color_factory.hpp \
comparison.hpp \
config.hpp \
coord.hpp \
coord_array.hpp \
css_color_parser.hpp \
ctrans.hpp \
datasource.hpp \
datasource_cache.hpp \
distance.hpp \
ellipsoid.hpp \
envelope.hpp \
expression.hpp \
factory.hpp \
feature.hpp \
feature_factory.hpp \
feature_layer_desc.hpp \
feature_style_processor.hpp \
feature_type_style.hpp \
fill.hpp \
filter.hpp \
filter_expression.hpp \
filter_factory.hpp \
filter_featureset.hpp \
filter_parser.hpp \
filter_parser_ast.hpp \
filter_visitor.hpp \
font_engine_freetype.hpp \
gamma.hpp \
geometry.hpp \
geom_util.hpp \
global.hpp \
graphics.hpp \
hit_test_filter.hpp \
image_data.hpp \
image_reader.hpp \
image_util.hpp \
image_view.hpp \
label_collision_detector.hpp \
label_placement.hpp \
layer.hpp \
line_pattern_symbolizer.hpp \
line_symbolizer.hpp \
load_map.hpp \
local_datasource.hpp \
logical.hpp \
map.hpp \
math_expr.hpp \
memory.hpp \
memory_datasource.hpp \
memory_featureset.hpp \
params.hpp \
placement_finder.hpp \
plugin.hpp \
point_symbolizer.hpp \
polygon_pattern_symbolizer.hpp \
polygon_symbolizer.hpp \
pool.hpp \
projection.hpp \
proj_transform.hpp \
quad_tree.hpp \
query.hpp \
raster.hpp \
raster_symbolizer.hpp \
regex_filter.hpp \
rule.hpp \
save_map.hpp \
scale_denominator.hpp \
shield_symbolizer.hpp \
spatial.hpp \
stroke.hpp \
style.hpp \
style_factory.hpp \
symbolizer.hpp \
text_path.hpp \
text_symbolizer.hpp \
unicode.hpp \
utils.hpp \
value.hpp \
vertex.hpp \
vertex_transform.hpp \
vertex_vector.hpp \
wkb.hpp
EXTRA_DIST = \
$(libmapnik_HEADERS)
## File created by the gnome-build tools

13
mapnik-uninstalled.pc.in Normal file
View file

@ -0,0 +1,13 @@
prefix=
exec_prefix=
libdir=src
includedir=include
Name: @PACKAGE@
Description: Free Toolkit for developing mapping applications, Not Installed
Version: @VERSION@
Requires:
Conflicts:
Libs: ${pcfiledir}/${libdir}/libmapnik.la
Cflags: -I${pcfiledir}/${includedir}

44
mapnik.anjuta Normal file
View file

@ -0,0 +1,44 @@
<?xml version="1.0"?>
<anjuta>
<plugin name="GBF Project Manager"
url="http://anjuta.org/plugins/"
mandatory="yes">
<require group="Anjuta Plugin"
attribute="Interfaces"
value="IAnjutaProjectManager"/>
<require group="Project"
attribute="Supported-Project-Types"
value="automake"/>
</plugin>
<plugin name="Symbol Browser"
url="http://anjuta.org/plugins/"
mandatory="yes">
<require group="Anjuta Plugin"
attribute="Location"
value="anjuta-symbol-browser:SymbolBrowserPlugin"/>
</plugin>
<plugin name="Make Build System"
url="http://anjuta.org/plugins/"
mandatory="yes">
<require group="Anjuta Plugin"
attribute="Interfaces"
value="IAnjutaBuildable"/>
<require group="Build"
attribute="Supported-Build-Types"
value="make"/>
</plugin>
<plugin name="Task Manager"
url="http://anjuta.org/plugins/"
mandatory="no">
<require group="Anjuta Plugin"
attribute="Interfaces"
value="IAnjutaTodo"/>
</plugin>
<plugin name="Debug Manager"
url="http://anjuta.org/plugins/"
mandatory="no">
<require group="Anjuta Plugin"
attribute="Interfaces"
value="IAnjutaDebuggerManager"/>
</plugin>
</anjuta>

13
mapnik.pc.in Normal file
View file

@ -0,0 +1,13 @@
prefix=@prefix@
exec_prefix=@prefix@
libdir=@exec_prefix@/lib
includedir=@prefix@/include
Name: @PACKAGE@
Description: Free Toolkit for developing mapping applications
Version: @VERSION@
Requires:
Conflicts:
Libs: -L${libdir} -lmapnik
Cflags: -I${includedir}

6
plugins/Makefile.am Normal file
View file

@ -0,0 +1,6 @@
SUBDIRS = \
input
## File created by the gnome-build tools

View file

@ -0,0 +1,8 @@
SUBDIRS = \
postgis\
gdal \
raster \
shape
## File created by the gnome-build tools

View file

@ -0,0 +1,16 @@
pkglib_LTLIBRARIES = \
gdal.input.la
gdal_input_la_SOURCES = \
gdal_datasource.cpp\
gdal_featureset.cpp
gdal_input_la_CXXFLAGS = \
-I../../../include
gdal_input_la_LDFLAGS = \
-module \
-avoid-version
## File created by the gnome-build tools

View file

@ -0,0 +1,24 @@
if BUILD_POSTGRESQL
pkglib_LTLIBRARIES = \
postgis.input.la
postgis_input_la_SOURCES = \
postgis.cpp \
postgisfs.cpp
postgis_input_la_LIBADD = \
${POSTGRESQL_LDFLAGS}
postgis_input_la_CXXFLAGS = \
${POSTGRESQL_CFLAGS} \
-I../../../include
postgis_input_la_LDFLAGS = \
-module \
-avoid-version
endif
## File created by the gnome-build tools

View file

@ -0,0 +1,18 @@
pkglib_LTLIBRARIES = \
raster.input.la
raster_input_la_SOURCES = \
raster_datasource.cpp\
raster_featureset.cpp\
raster_info.cpp
raster_input_la_CXXFLAGS = \
-I../../../include
raster_input_la_LDFLAGS = \
-module \
-avoid-version
## File created by the gnome-build tools

View file

@ -0,0 +1,23 @@
pkglib_LTLIBRARIES = \
shape.input.la
shape_input_la_SOURCES = \
dbffile.cpp \
dbf_test.cpp \
shape.cpp \
shape_featureset.cpp \
shapefile.cpp \
shape_index_featureset.cpp \
shape_io.cpp \
shp_index.cpp
shape_input_la_CXXFLAGS = \
-I../../../include
shape_input_la_LDFLAGS = \
-module \
-avoid-version
## File created by the gnome-build tools

74
src/Makefile.am Normal file
View file

@ -0,0 +1,74 @@
## Process this file with automake to produce Makefile.in
## Created by Anjuta
INCLUDES = \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
-DPACKAGE_DATA_DIR=\""$(datadir)"\"
AM_CXXFLAGS =\
-Wall \
-g
lib_LTLIBRARIES = \
libmapnik.la
libmapnik_la_SOURCES = \
agg_renderer.cpp\
datasource_cache.cpp \
distance.cpp \
envelope.cpp \
filter_factory.cpp \
font_engine_freetype.cpp \
graphics.cpp \
image_reader.cpp \
image_util.cpp \
layer.cpp \
line_pattern_symbolizer.cpp \
load_map.cpp \
map.cpp \
memory.cpp \
memory_datasource.cpp \
params.cpp \
placement_finder.cpp \
plugin.cpp \
png_reader.cpp \
point_symbolizer.cpp \
polygon_pattern_symbolizer.cpp \
projection.cpp \
proj_transform.cpp \
save_map.cpp \
scale_denominator.cpp \
shield_symbolizer.cpp \
text_symbolizer.cpp \
tiff_reader.cpp \
wkb.cpp
libmapnik_la_LIBADD = \
${PNG_LIBS} \
${FREETYPE2_LIBS} \
${AGG_LIBS} \
${BOOST_LDFLAGS} \
${BOOST_THREAD_LIB} \
${BOOST_REGEX_LIB} \
${BOOST_FILESYSTEM_LIB} \
${JPEG_LIBS} \
${TIFF_LIBS} \
${PROJ_LIBS} \
${LTDL_LIBS}
libmapnik_la_CXXFLAGS = \
-I../include \
${PNG_CFLAGS} \
${FREETYPE2_CFLAGS} \
${AGG_CFLAGS} \
${JPEG_CFLAGS} \
${TIFF_CFLAGS} \
${PROJ_CFLAGS} \
${LTDL_CFLAGS} \
${BOOST_CPPFLAGS}