Not marking our symbols visible by default allows the compiler to do
better optimizations, especially with Link-Time Optimizations that
several distributions are now enabling by default.
The most obvious optimization comes from dead code removal because
the compiler now knows that it cannot be used by an external shared
object, but better inlining might also occur.
Even without LTO, it reduces the final size of stripped binaries and
might improve loading times a bit.
Note that we already mark the symbols that we want to export with the
'default' visibilty, for example for Lua FFI.
LT_PREREQ([2.2.2])
LT_INIT([disable-static])
-CFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter $CFLAGS"
-CXXFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations -Wredundant-decls $CXXFLAGS"
+CFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -fvisibility=hidden $CFLAGS"
+CXXFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations -Wredundant-decls -fvisibility=hidden $CXXFLAGS"
PDNS_WITH_LIBSODIUM
PDNS_CHECK_DNSTAP([auto])