2019-09-16 21:17:09 +00:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
RUNTIME_PREFIX=$(cd -- "${BASH_SOURCE%"${BASH_SOURCE##*/}"}.." && pwd)
|
|
|
|
|
|
|
|
## CONFIG variables substituted from build script
|
|
|
|
|
|
|
|
CONFIG_MAPNIK_NAME="mapnik"
|
|
|
|
CONFIG_MAPNIK_VERSION="unknown"
|
|
|
|
CONFIG_MAPNIK_VERSION_STRING="unknown"
|
|
|
|
CONFIG_GIT_REVISION="N/A"
|
|
|
|
CONFIG_GIT_DESCRIBE="${CONFIG_MAPNIK_VERSION_STRING}"
|
|
|
|
|
|
|
|
CONFIG_PREFIX="/usr/local"
|
|
|
|
CONFIG_LIBDIR_SCHEMA="lib"
|
|
|
|
CONFIG_LIB_DIR_NAME="mapnik"
|
|
|
|
CONFIG_MAPNIK_LIB_BASE="${CONFIG_PREFIX}/${CONFIG_LIBDIR_SCHEMA}"
|
|
|
|
CONFIG_MAPNIK_LIB_DIR="${CONFIG_MAPNIK_LIB_BASE}/${CONFIG_LIB_DIR_NAME}"
|
|
|
|
CONFIG_MAPNIK_INPUT_PLUGINS="${CONFIG_MAPNIK_LIB_DIR}/input"
|
|
|
|
CONFIG_MAPNIK_FONTS="${CONFIG_MAPNIK_LIB_DIR}/fonts"
|
|
|
|
|
|
|
|
CONFIG_CXX="c++"
|
|
|
|
CONFIG_CXXFLAGS=
|
|
|
|
CONFIG_DEFINES=
|
|
|
|
CONFIG_LDFLAGS=
|
|
|
|
CONFIG_DEP_INCLUDES=
|
|
|
|
CONFIG_DEP_LIBS=
|
|
|
|
CONFIG_QUERIED_GDAL_DATA=
|
|
|
|
CONFIG_QUERIED_PROJ_LIB=
|
|
|
|
CONFIG_QUERIED_ICU_DATA=
|
|
|
|
|
|
|
|
## D.R.Y. variables
|
|
|
|
|
2019-09-20 18:15:53 +00:00
|
|
|
DRY_INCLUDES="-I${RUNTIME_PREFIX}/include -I${RUNTIME_PREFIX}/include/mapnik/agg -I${RUNTIME_PREFIX}/include/mapnik/deps"
|
2019-09-16 21:17:09 +00:00
|
|
|
DRY_CFLAGS="${DRY_INCLUDES} ${CONFIG_DEP_INCLUDES} ${CONFIG_DEFINES} ${CONFIG_CXXFLAGS}"
|
|
|
|
DRY_LIBS="-L${RUNTIME_PREFIX}/${CONFIG_LIBDIR_SCHEMA} -l${CONFIG_MAPNIK_NAME}"
|
2011-08-13 17:07:05 +00:00
|
|
|
|
|
|
|
## program below
|
|
|
|
|
2010-07-18 21:34:08 +00:00
|
|
|
usage()
|
|
|
|
{
|
|
|
|
cat <<EOF
|
|
|
|
Usage: mapnik-config [OPTION]
|
|
|
|
|
|
|
|
Known values for OPTION are:
|
|
|
|
|
2013-03-14 02:49:59 +00:00
|
|
|
-h --help display this help and exit
|
2013-05-10 20:45:18 +00:00
|
|
|
-v --version version information (MAPNIK_VERSION_STRING)
|
2013-05-21 21:09:49 +00:00
|
|
|
--version-number version number (MAPNIK_VERSION) (new in 2.2.0)
|
2013-03-14 02:49:59 +00:00
|
|
|
--git-revision git hash from "git rev-list --max-count=1 HEAD"
|
2013-05-21 21:09:49 +00:00
|
|
|
--git-describe git decribe output (new in 2.2.0)
|
2013-03-14 02:49:59 +00:00
|
|
|
--fonts default fonts directory
|
|
|
|
--input-plugins default input plugins directory
|
2013-05-21 21:09:49 +00:00
|
|
|
--defines pre-processor defines for Mapnik build (new in 2.2.0)
|
2013-03-14 02:49:59 +00:00
|
|
|
--prefix Mapnik prefix [default $CONFIG_PREFIX]
|
|
|
|
--lib-name Mapnik library name
|
|
|
|
--libs library linking information
|
|
|
|
--dep-libs library linking information for Mapnik dependencies
|
|
|
|
--ldflags library paths (-L) information
|
2013-05-21 21:09:49 +00:00
|
|
|
--includes include paths (-I) for Mapnik headers (new in 2.2.0)
|
|
|
|
--dep-includes include paths (-I) for Mapnik dependencies (new in 2.2.0)
|
|
|
|
--cxxflags c++ compiler flags and pre-processor defines (new in 2.2.0)
|
2013-03-19 07:15:04 +00:00
|
|
|
--cflags all include paths, compiler flags, and pre-processor defines (for back-compatibility)
|
2013-05-21 21:09:49 +00:00
|
|
|
--cxx c++ compiler used to build mapnik (new in 2.2.0)
|
|
|
|
--all-flags all compile and link flags (new in 2.2.0)
|
2017-09-10 15:19:04 +00:00
|
|
|
--gdal-data path to GDAL_DATA directory, if detected at build time (new in 3.0.16)
|
|
|
|
--proj-lib path to PROJ_LIB directory, if detected at build time (new in 3.0.16)
|
|
|
|
--icu-data path to ICU_DATA directory, if detected at build time (new in 3.0.16)
|
2010-07-18 21:34:08 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
exit $1
|
|
|
|
}
|
|
|
|
|
|
|
|
if test $# -eq 0; then
|
|
|
|
usage 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
while test $# -gt 0; do
|
|
|
|
case "$1" in
|
|
|
|
|
2019-09-16 21:17:09 +00:00
|
|
|
-h| --help)
|
2013-03-14 02:49:59 +00:00
|
|
|
usage 0
|
2010-07-18 21:34:08 +00:00
|
|
|
;;
|
|
|
|
|
2019-09-16 21:17:09 +00:00
|
|
|
-v| --version)
|
2013-05-10 20:45:18 +00:00
|
|
|
echo ${CONFIG_MAPNIK_VERSION_STRING}
|
|
|
|
;;
|
|
|
|
|
|
|
|
--version-number)
|
|
|
|
echo ${CONFIG_MAPNIK_VERSION}
|
2011-08-13 17:07:05 +00:00
|
|
|
;;
|
|
|
|
|
2011-10-18 22:22:47 +00:00
|
|
|
--git-revision)
|
|
|
|
echo ${CONFIG_GIT_REVISION}
|
|
|
|
;;
|
|
|
|
|
2013-03-14 02:49:59 +00:00
|
|
|
--git-describe)
|
|
|
|
echo ${CONFIG_GIT_DESCRIBE}
|
2010-07-18 21:34:08 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
--fonts)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${CONFIG_MAPNIK_FONTS/#"$CONFIG_PREFIX"/$RUNTIME_PREFIX}"
|
2010-07-18 21:34:08 +00:00
|
|
|
;;
|
|
|
|
|
2010-11-15 22:14:43 +00:00
|
|
|
--input-plugins)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${CONFIG_MAPNIK_INPUT_PLUGINS/#"$CONFIG_PREFIX"/$RUNTIME_PREFIX}"
|
2010-07-18 21:34:08 +00:00
|
|
|
;;
|
2011-10-18 22:22:47 +00:00
|
|
|
|
2013-03-14 02:49:59 +00:00
|
|
|
--defines)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${CONFIG_DEFINES}"
|
2010-07-18 21:34:08 +00:00
|
|
|
;;
|
|
|
|
|
2013-03-14 02:49:59 +00:00
|
|
|
--prefix)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${RUNTIME_PREFIX}"
|
2013-03-14 02:49:59 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
--lib-name)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${CONFIG_MAPNIK_NAME}"
|
2013-03-03 04:17:03 +00:00
|
|
|
;;
|
|
|
|
|
2010-07-18 21:34:08 +00:00
|
|
|
--libs)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${DRY_LIBS}"
|
2011-08-13 17:07:05 +00:00
|
|
|
;;
|
|
|
|
|
2013-03-14 02:49:59 +00:00
|
|
|
--dep-libs)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${CONFIG_DEP_LIBS}"
|
2013-03-14 02:49:59 +00:00
|
|
|
;;
|
|
|
|
|
2011-08-13 17:07:05 +00:00
|
|
|
--ldflags)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${CONFIG_LDFLAGS}"
|
2011-08-13 17:07:05 +00:00
|
|
|
;;
|
|
|
|
|
2013-03-14 02:49:59 +00:00
|
|
|
--includes)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${DRY_INCLUDES}"
|
2011-08-13 17:07:05 +00:00
|
|
|
;;
|
|
|
|
|
2013-03-14 02:49:59 +00:00
|
|
|
--dep-includes)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${CONFIG_DEP_INCLUDES}"
|
2013-03-14 02:49:59 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
--cxxflags)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${CONFIG_CXXFLAGS}"
|
2013-03-14 02:49:59 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
--cflags)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${DRY_CFLAGS}"
|
2010-07-18 21:34:08 +00:00
|
|
|
;;
|
|
|
|
|
2013-05-10 20:24:41 +00:00
|
|
|
--cxx)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${CONFIG_CXX}"
|
2013-05-10 20:24:41 +00:00
|
|
|
;;
|
|
|
|
|
2013-05-10 20:27:44 +00:00
|
|
|
--all-flags)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf '%s\n' "${DRY_CFLAGS} ${DRY_LIBS} ${CONFIG_LDFLAGS} ${CONFIG_DEP_LIBS}"
|
2013-05-10 20:27:44 +00:00
|
|
|
;;
|
|
|
|
|
2015-04-27 23:02:41 +00:00
|
|
|
--gdal-data)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf "%s${CONFIG_QUERIED_GDAL_DATA:+\\n}" "${CONFIG_QUERIED_GDAL_DATA}"
|
2015-04-27 23:02:41 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
--proj-lib)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf "%s${CONFIG_QUERIED_PROJ_LIB:+\\n}" "${CONFIG_QUERIED_PROJ_LIB}"
|
2015-04-27 23:02:41 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
--icu-data)
|
2019-09-16 21:17:09 +00:00
|
|
|
printf "%s${CONFIG_QUERIED_ICU_DATA:+\\n}" "${CONFIG_QUERIED_ICU_DATA}"
|
2015-04-27 23:02:41 +00:00
|
|
|
;;
|
|
|
|
|
2010-07-18 21:34:08 +00:00
|
|
|
*)
|
2019-09-16 21:17:09 +00:00
|
|
|
# push to stderr any invalid options
|
|
|
|
echo "unknown option $1" >&2
|
|
|
|
;;
|
2010-07-18 21:34:08 +00:00
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|