- added paths.py.in -> a template to generate paths.py with automake

- added ax_boost_program_options.m4 to detect boost library needed to utils
- print out at configure script end the build configuration
This commit is contained in:
Andreas Volz 2009-03-27 00:17:52 +00:00
parent 887518fc57
commit e04a9cddda
5 changed files with 208 additions and 9 deletions

View file

@ -5,7 +5,7 @@ SUBDIRS = src \
agg\
plugins\
include \
bindings
bindings
mapnikdocdir = ${prefix}/doc/mapnik

View file

@ -1,6 +1,6 @@
initdir = $(datadir)/pycentral/python-mapnik/site-packages/mapnik
init_PYTHON = __init__.py
init_PYTHON = __init__.py paths.py
SUBDIRS = \
ogcserver

View file

@ -0,0 +1,3 @@
mapniklibpath = @PACKAGE_LIB_DIR@
inputpluginspath = mapniklibpath + '/input'
fontscollectionpath = @SYSTEM_FONTS_DIR@/truetype/ttf-dejavu

View file

@ -0,0 +1,106 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_program_options.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_PROGRAM_OPTIONS
#
# DESCRIPTION
#
# Test for program options library from the Boost C++ libraries. The macro
# requires a preceding call to AX_BOOST_BASE. Further documentation is
# available at <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB)
#
# And sets:
#
# HAVE_BOOST_PROGRAM_OPTIONS
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
[
AC_ARG_WITH([boost-program-options],
AS_HELP_STRING([--with-boost-program-options@<:@=special-lib@:>@],
[use the program options library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-program-options=boost_program_options-gcc-mt-1_33_1 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_program_options_lib=""
else
want_boost="yes"
ax_boost_user_program_options_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
export want_boost
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK([whether the Boost::Program_Options library is available],
ax_cv_boost_program_options,
[AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/program_options.hpp>
]],
[[boost::program_options::options_description generic("Generic options");
return 0;]]),
ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no)
AC_LANG_POP([C++])
])
if test "$ax_cv_boost_program_options" = yes; then
AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_program_options_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;' -e 's;^lib\(boost_program_options.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
[link_program_options="no"])
done
if test "x$link_program_options" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_program_options*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;' -e 's;^\(boost_program_options.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
[link_program_options="no"])
done
fi
else
for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
[link_program_options="no"])
done
fi
if test "x$link_program_options" != "xyes"; then
AC_MSG_ERROR([Could not link against [$ax_lib] !])
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

View file

@ -109,6 +109,9 @@ if test "x$ax_cv_boost_iostreams" = "xno"; then
exit
fi
AX_BOOST_PROGRAM_OPTIONS
AM_CONDITIONAL(HAVE_BOOST_PROGRAM_OPTIONS, test "x$ax_cv_boost_program_options" = "xyes")
dnl check to build python bindings
AX_BOOST_PYTHON
@ -137,6 +140,9 @@ if test "x$GDAL_CONFIG" != "x"; then
GDAL_LIBS=`$GDAL_CONFIG --libs`
AC_SUBST(GDAL_CFLAGS)
AC_SUBST(GDAL_LIBS)
found_gdal="yes"
else
found_gdal="no"
fi
AM_CONDITIONAL(HAVE_GDAL, test "x$GDAL_CONFIG" != "x")
@ -164,6 +170,9 @@ fi
## test for optional sqlite3 support
AX_LIB_SQLITE3
if [ test "x$success" = "xyes"]; then
found_sqlite3="yes"
fi
AM_CONDITIONAL(HAVE_SQLITE3, test "x$success" = "xyes")
PKG_CHECK_MODULES(PNG, libpng)
@ -227,11 +236,74 @@ else
AC_MSG_RESULT(no)
fi
#dnl Set PACKAGE SOURCE DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
#dnl Set PACKAGE PREFIX
if test "x${prefix}" = "xNONE"; then
packageprefix=${ac_default_prefix}
else
packageprefix=${prefix}
fi
#dnl Set PACKAGE DIRS in config.h
packagedatadir=share/${PACKAGE}
packagedocdir=doc/${PACKAGE}
packagepixmapsdir=share/pixmaps/${PACKAGE}
packagelibdir=lib/${PACKAGE}
systemfontsdir=share/fonts
#dnl Subst PACKAGE_DATA_DIR.
NO_PREFIX_PACKAGE_DATA_DIR="${packagedatadir}"
AC_SUBST(NO_PREFIX_PACKAGE_DATA_DIR)
PACKAGE_DATA_DIR="${packageprefix}/${packagedatadir}"
AC_SUBST(PACKAGE_DATA_DIR)
dnl Subst PACKAGE_DOC_DIR.
NO_PREFIX_PACKAGE_DOC_DIR="${packagedocdir}"
AC_SUBST(NO_PREFIX_PACKAGE_DOC_DIR)
PACKAGE_DOC_DIR="${packageprefix}/${packagedocdir}"
AC_SUBST(PACKAGE_DOC_DIR)
dnl Subst PACKAGE_PIXMAPS_DIR.
NO_PREFIX_PACKAGE_PIXMAPS_DIR="${packagepixmapsdir}"
AC_SUBST(NO_PREFIX_PACKAGE_PIXMAPS_DIR)
PACKAGE_PIXMAPS_DIR="${packageprefix}/${packagepixmapsdir}"
AC_SUBST(PACKAGE_PIXMAPS_DIR)
dnl Subst PACKAGE_LIB_DIR
NO_PREFIX_PACKAGE_LIB_DIR="${packagelibmapsdir}"
AC_SUBST(NO_PREFIX_PACKAGE_LIB_DIR)
PACKAGE_LIB_DIR="${packageprefix}/${packagelibdir}"
AC_SUBST(PACKAGE_LIB_DIR)
dnl Subst SYSTEM_FONTS_DIR
NO_PREFIX_SYSTEM_FONTS_DIR="${systemfontsdir}"
AC_SUBST(NO_PREFIX_SYSTEM_FONTS_DIR)
SYSTEM_FONTS_DIR="${packageprefix}/${systemfontsdir}"
AC_SUBST(SYSTEM_FONTS_DIR)
AC_DEFINE_UNQUOTED(SYSTEM_FONTS_DIR, "${packageprefix}/${systemfontsdir}","")
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${packageprefix}/${packagelibdir}","")
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${packageprefix}/${packagedatadir}","")
AC_DEFINE_UNQUOTED(SYSTEM_DATA_DIR, "${packageprefix}/${systemdatadir}","")
AC_DEFINE_UNQUOTED(PACKAGE_DOC_DIR, "${packageprefix}/${packagedocdir}","")
AC_DEFINE_UNQUOTED(PACKAGE_PIXMAPS_DIR, "${packageprefix}/${packagepixmapsdir}","")
AC_DEFINE_UNQUOTED(SYSTEM_PIXMAPS_DIR, "${packageprefix}/${systempixmapsdir}","")
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}","")
AC_OUTPUT([
Makefile
include/Makefile
include/mapnik/Makefile
agg/Makefile
agg/src/Makefile
agg/include/Makefile
bindings/Makefile
bindings/python/Makefile
bindings/python/mapnik/Makefile
bindings/python/mapnik/ogcserver/Makefile
bindings/python/mapnik/paths.py
plugins/Makefile
plugins/input/Makefile
plugins/input/gdal/Makefile
@ -245,11 +317,29 @@ plugins/input/kismet/Makefile
src/Makefile
mapnik.pc
mapnik-uninstalled.pc
agg/Makefile
agg/src/Makefile
agg/include/Makefile
bindings/Makefile
bindings/python/Makefile
bindings/python/mapnik/Makefile
bindings/python/mapnik/ogcserver/Makefile
])
echo
echo "Build configuration:"
echo "--------------------"
echo
echo "Library support:"
echo "cairo ......................... $enable_cairo"
echo "build included agg library..... $enable_included_agg"
echo "libxml2 loader ................ $enable_libxml2"
echo
echo "Plugin support:"
echo "build plugin (input/postgis)... $found_postgresql"
echo "build plugin (input/gdal)...... $found_gdal"
echo "build plugin (input/ogr)....... $found_gdal"
echo "build plugin (input/osm)....... $enable_libxml2"
echo "build plugin (input/sqlite).... $found_sqlite3"
echo
echo "Debugging support:"
echo "debugger (gdb)................. $enable_debug"
echo "profiling (gprof).............. $enable_profiling"
echo "tracing (log output)........... $enable_tracing"
dnl echo "build shapeindex application... $ax_cv_boost_program_options"
echo