+AC_CHECK_DECLS([struct in6_ifreq], [], [], [[#include <linux/if_tun.h>]])
+
+
+
+# should the build process be building the documentation?
+AC_MSG_CHECKING(whether to build documentation)
+AC_ARG_ENABLE([documentation],
+ [AS_HELP_STRING([--disable-documentation], [do not build the documentation])],
+ [documentation=${enableval}],
+ [documentation=yes])
+AC_MSG_RESULT($documentation)
+if test "x$documentation" = "xyes"
+then
+ AM_CONDITIONAL([DOCUMENTATION],true)
+ AC_DEFINE([DOCUMENTATION],[1],[Building the documentation])
+else
+ AM_CONDITIONAL([DOCUMENTATION],false)
+ AC_DEFINE([DOCUMENTATION],[0],[Not building the documentation])
+fi
+
+# FIXME: Something is wrong about this in the output of ./configure runs
+AC_MSG_CHECKING(wether to include generated texi2mdoc output in installation)
+AC_ARG_ENABLE([texi2mdoc-generation],
+ [AS_HELP_STRING([--enable-texi2mdoc-generation], [include generated texi2mdoc output in installation])],
+ [texi2mdoc_generation=${enableval}],
+ [texi2mdoc_generation=no])
+AC_MSG_RESULT($texi2mdoc_generation)
+if test "x$texi2mdoc_generation" = "xyes"
+then
+ if test "$texi2mdoc" = 0
+ then
+ AC_MSG_WARN([ERROR: mdoc output currently requires texi2mdoc.])
+ AC_MSG_WARN([ERROR: texi2mdoc can be obtained via your Operating System])
+ AC_MSG_WARN([ERROR: package manager or from https://mandoc.bsd.lv/texi2mdoc/])
+ else
+ AM_CONDITIONAL([TEXI2MDOC_GENERATION],true)
+ AC_DEFINE([TEXI2MDOC_GENERATION],[1],[Building section 7 mdoc output])
+ fi
+else
+ AM_CONDITIONAL([TEXI2MDOC_GENERATION],false)
+ AC_DEFINE([TEXI2MDOC_GENERATION],[0],[Not building section 7 mdoc output])
+fi
+
+# should the build process be building only the documentation?
+AC_MSG_CHECKING(whether to build only documentation)
+AC_ARG_ENABLE([documentation-only],
+ [AS_HELP_STRING([--enable-documentation-only], [build only the documentation])],
+ [documentation_only=${enableval}],
+ [documentation_only=no])
+AC_MSG_RESULT($documentation_only)
+if test "x$documentation_only" = "xyes"
+then
+ AM_CONDITIONAL([DOCUMENTATION_ONLY],true)
+ AC_DEFINE([DOCUMENTATION_ONLY],[1],[Building only the documentation])
+else
+ AM_CONDITIONAL([DOCUMENTATION_ONLY],false)
+ AC_DEFINE([DOCUMENTATION_ONLY],[0],[Not building only the documentation])
+fi
+
+# should the build process be including the manpages? (default: yes)
+AC_MSG_CHECKING(whether to include man pages)
+AC_ARG_ENABLE([include-manpages],
+ [AS_HELP_STRING([--disable-include-manpages], [Do not include the man pages in build and installation])],
+ [include_manpages=${enableval}],
+ [include_manpages=yes])
+AC_MSG_RESULT($include_manpages)
+if test "x$include_manpages" = "xyes"
+then
+ AM_CONDITIONAL([INCLUDE_MANPAGES],true)
+ AC_DEFINE([INCLUDE_MANPAGES],[1],[Including the man pages in the build and installation])
+else
+ AM_CONDITIONAL([INCLUDE_MANPAGES],false)
+ AC_DEFINE([INCLUDE_MANPAGES],[0],[Not including the man pages in the build and installation])
+fi