To fix the problem you need:
1. Use c++17 when mapnik is enabled
2. Add "pkg-config --cflags libmapnik" to the configure command looking for mapnikL
3. AC_CHECK_HEADER([mapnik/map.hpp],[],[AC_MSG_ERROR([mapnik/map.hpp is needed but not found - you will need to install package 'libmapnik-dev' or similar. The feature can be disabled with --disable-mapnik])])
config.log has this:
configure:12858: c++ -c -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -isystem /usr/local/include -std=c++11 -I/usr/local/include/mapnik -DLIBICONV_PLUG -isystem /usr/local/include -I/usr/local/include conftest.cpp >&5
In file included from conftest.cpp:142:
In file included from /usr/local/include/mapnik/map.hpp:32:
In file included from /usr/local/include/mapnik/params.hpp:28:
/usr/local/include/mapnik/value/types.hpp:144:41: error: no template named 'decay_t' in namespace 'std'
144 | template<typename t,="" typename="" dt="std::decay_t\<T">>
| ~~~~~^
/usr/local/include/mapnik/value/types.hpp:146:8: error: no template named 'conditional_t' in namespace 'std'
146 | std::conditional_t<std::is_same\<dt, bool="">::value,
| ~~~~~^
/usr/local/include/mapnik/value/types.hpp:148:27: error: no member named 'conditional_t' in namespace 'std'
148 | std::conditional_t\<std::is_integral\<dt>::value,
| ~~~~~^
/usr/local/include/mapnik/value/types.hpp:150:88: error: expected ';' after alias declaration
150 | std::conditional_t\<std::is_floating_point\<dt>::value, value_double, T&&>>>;
| ^
In file included from conftest.cpp:142:
In file included from /usr/local/include/mapnik/map.hpp:32:
/usr/local/include/mapnik/params.hpp:70:10: error: no template named 'optional' in namespace 'std'
70 | std::optional<t> get(std::string const& key) const;
| ~~~~~^
/usr/local/include/mapnik/params.hpp:72:10: error: no template named 'optional' in namespace 'std'
72 | std::optional<t> get(std::string const& key, T const& default_opt_value) const;
| ~~~~~^</t></t></std::is_floating_point\<dt></std::is_integral\<dt></std::is_same\<dt,></typename>
I believe this also fixed in: #443fe78cb097ae2196517fc726595b57cb9418c4
https://sourceforge.net/p/viking/code/ci/443fe78cb097ae2196517fc726595b57cb9418c4/
Viking uses
configure.ac
, so ATM explicitly sets the CXXFLAGS before attempting trying the use of mapnik - as opposed to some kind of pkg-config method PKG_CHECK_MODULES - which may have issue/cause side effects when used in an optional section.