2011-08-13 19:07:05 +02:00
|
|
|
|
|
|
|
## program below
|
|
|
|
|
2011-12-15 00:51:57 +01:00
|
|
|
CONFIG_JSON="{
|
|
|
|
\"prefix\": \"${CONFIG_PREFIX}\",
|
|
|
|
\"mapnik_libname\": \"${CONFIG_MAPNIK_LIBNAME}\",
|
|
|
|
\"mapnik_include\": \"${CONFIG_MAPNIK_INCLUDE}\",
|
|
|
|
\"mapnik_lib\": \"${CONFIG_MAPNIK_LIB}\",
|
|
|
|
\"version\": \"${CONFIG_MAPNIK_VERSION}\",
|
|
|
|
\"ldflags\": \"${CONFIG_MAPNIK_LDFLAGS}\",
|
|
|
|
\"dep_libs\": \"${CONFIG_DEP_LIBS}\",
|
|
|
|
\"other_includes\": \"${CONFIG_OTHER_INCLUDES}\",
|
|
|
|
\"fonts\": \"${CONFIG_FONTS}\",
|
|
|
|
\"input_plugins\": \"${CONFIG_INPUT_PLUGINS}\",
|
|
|
|
\"git_revision\": \"${CONFIG_GIT_REVISION}\"
|
|
|
|
}"
|
|
|
|
|
2010-07-18 23:34:08 +02:00
|
|
|
usage()
|
|
|
|
{
|
|
|
|
cat <<EOF
|
|
|
|
Usage: mapnik-config [OPTION]
|
|
|
|
|
|
|
|
Known values for OPTION are:
|
|
|
|
|
2012-08-24 18:47:59 +02:00
|
|
|
--prefix display Mapnik prefix [default $CONFIG_PREFIX]
|
|
|
|
--prefix=DIR change Mapnik prefix [default $CONFIG_PREFIX]
|
2010-07-18 23:34:08 +02:00
|
|
|
--libs print library linking information
|
2012-08-24 18:47:59 +02:00
|
|
|
--dep-libs print library linking information for Mapnik dependencies
|
2011-08-13 19:07:05 +02:00
|
|
|
--ldflags print library paths (-L) information
|
2013-03-03 05:17:03 +01:00
|
|
|
--cxxflags print pre-processor and compiler flags
|
|
|
|
--cflags print pre-processor and compiler flags (same as cxxflags, for back-compatibility)
|
2010-07-18 23:34:08 +02:00
|
|
|
--fonts print default fonts directory
|
2010-11-15 23:14:43 +01:00
|
|
|
--input-plugins print default input plugins directory
|
2011-08-13 19:07:05 +02:00
|
|
|
--json print all config options as json object
|
2010-07-18 23:34:08 +02:00
|
|
|
--help display this help and exit
|
2010-11-17 20:43:03 +01:00
|
|
|
-v --version output version information
|
2011-10-19 00:22:47 +02:00
|
|
|
--git-revision output git hash
|
2010-07-18 23:34:08 +02:00
|
|
|
EOF
|
|
|
|
|
|
|
|
exit $1
|
|
|
|
}
|
|
|
|
|
|
|
|
if test $# -eq 0; then
|
|
|
|
usage 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
while test $# -gt 0; do
|
|
|
|
case "$1" in
|
|
|
|
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
|
|
|
*) optarg= ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$1" in
|
2011-10-19 00:22:47 +02:00
|
|
|
|
2010-07-18 23:34:08 +02:00
|
|
|
--prefix=*)
|
|
|
|
prefix=$optarg
|
2011-08-13 19:07:05 +02:00
|
|
|
includedir=$CONFIG_PREFIX/include
|
|
|
|
CONFIG_MAPNIK_LIB=$CONFIG_PREFIX/lib
|
2010-07-18 23:34:08 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
--prefix)
|
2011-08-13 19:07:05 +02:00
|
|
|
echo $CONFIG_PREFIX
|
2010-07-18 23:34:08 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
-v)
|
2011-10-19 00:13:38 +02:00
|
|
|
echo $CONFIG_MAPNIK_VERSION
|
2010-07-18 23:34:08 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
--version)
|
2011-10-19 00:13:38 +02:00
|
|
|
echo $CONFIG_MAPNIK_VERSION
|
2011-08-13 19:07:05 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
--json)
|
|
|
|
echo $CONFIG_JSON
|
2010-07-18 23:34:08 +02:00
|
|
|
;;
|
|
|
|
|
2011-10-19 00:22:47 +02:00
|
|
|
--git-revision)
|
|
|
|
echo ${CONFIG_GIT_REVISION}
|
|
|
|
;;
|
|
|
|
|
2010-07-18 23:34:08 +02:00
|
|
|
--help)
|
|
|
|
usage 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
--fonts)
|
2011-10-19 00:22:47 +02:00
|
|
|
echo ${CONFIG_FONTS}
|
2010-07-18 23:34:08 +02:00
|
|
|
;;
|
|
|
|
|
2010-11-15 23:14:43 +01:00
|
|
|
--input-plugins)
|
2011-10-19 00:22:47 +02:00
|
|
|
echo ${CONFIG_INPUT_PLUGINS}
|
2010-07-18 23:34:08 +02:00
|
|
|
;;
|
2011-10-19 00:22:47 +02:00
|
|
|
|
2013-02-27 15:48:41 +01:00
|
|
|
--cxxflags)
|
2012-08-28 03:45:04 +02:00
|
|
|
echo -I${CONFIG_MAPNIK_INCLUDE} -I${CONFIG_MAPNIK_AGG_INCLUDE} ${CONFIG_OTHER_INCLUDES}
|
2010-07-18 23:34:08 +02:00
|
|
|
;;
|
|
|
|
|
2013-03-03 05:17:03 +01:00
|
|
|
--cflags)
|
|
|
|
echo -I${CONFIG_MAPNIK_INCLUDE} -I${CONFIG_MAPNIK_AGG_INCLUDE} ${CONFIG_OTHER_INCLUDES}
|
|
|
|
;;
|
|
|
|
|
2010-07-18 23:34:08 +02:00
|
|
|
--libs)
|
2011-08-13 19:07:05 +02:00
|
|
|
echo -L${CONFIG_MAPNIK_LIB} -l${CONFIG_MAPNIK_LIBNAME}
|
|
|
|
;;
|
|
|
|
|
|
|
|
--ldflags)
|
|
|
|
echo ${CONFIG_MAPNIK_LDFLAGS}
|
|
|
|
;;
|
|
|
|
|
|
|
|
--lib-name)
|
|
|
|
echo ${CONFIG_MAPNIK_LIBNAME}
|
|
|
|
;;
|
|
|
|
|
|
|
|
--dep-libs)
|
|
|
|
echo ${CONFIG_DEP_LIBS}
|
2010-07-18 23:34:08 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2011-01-05 21:52:08 +01:00
|
|
|
# if no matches, return 'usage 1' meaning usage + 1 (error return type)
|
|
|
|
usage 1
|
2010-07-18 23:34:08 +02:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|