+dnl ########################
+dnl
+dnl {check for libnl
+dnl
+
+ensc_have_libnl=yes
+LIBNL_ROOT=`readlink -f ../libnl*/`
+if test -d "$LIBNL_ROOT"; then
+ CFLAGS="$CFLAGS -I ${LIBNL_ROOT}/include"
+ LDFLAGS="$LDFLAGS -L${LIBNL_ROOT}/lib"
+fi
+
+if test x"$ensc_have_libnl" = xyes; then
+ AC_CHECK_HEADERS([asm/types.h stdint.h], [ : ],
+ [ ensc_have_libnl=no ])
+ for b in 8 16 32 64; do
+ for s in s u; do
+ ensc_libnl_stdint_type=
+ if test x"$s" = xu; then
+ ensc_libnl_stdint_type=u
+ fi
+ ensc_libnl_stdint_type="${ensc_libnl_stdint_type}int${b}_t"
+ AC_CHECK_TYPES([__${s}${b}], [ : ],
+ [AC_DEFINE_UNQUOTED([__${s}${b}],
+ [$ensc_libnl_stdint_type],
+ [__${s}${b} type])],
+ [AC_INCLUDES_DEFAULT()
+#ifdef HAVE_ASM_TYPES_H
+# include <asm/types.h>
+#endif]
+ )
+ done
+ done
+fi
+
+if test x"$ensc_have_libnl" = xyes; then
+ AC_CHECK_HEADERS([netlink/netlink.h netlink/route/addr.h], [ : ],
+ [ ensc_have_libnl=no ], [AC_INCLUDES_DEFAULT()
+#ifdef HAVE_ASM_TYPES_H
+# include <asm/types.h>
+#endif]
+ )
+fi
+
+if test x"$ensc_have_libnl" = xyes; then
+ AC_CHECK_LIB(nl, rtnl_addr_alloc, [ : ],
+ [ ensc_have_libnl=no ])
+fi
+
+if test x"$ensc_have_libnl" != xyes; then
+ AC_MSG_WARN([
+****
+**** 'libnl' could not be found;
+**** this will disable the build of 'vip6-autod'
+****])
+fi
+
+AM_CONDITIONAL(ENSC_HAVE_LIBNL, test x"$ensc_have_libnl" = xyes)
+
+dnl
+dnl libnl stuff ends here}
+dnl
+dnl #######################
+
+
+dnl Check what distro this is, use Gentoo initscripts if appropriate
+AC_MSG_CHECKING([for host initscripts])
+AC_ARG_WITH(initscripts, AC_HELP_STRING([--with-initscripts=TYPE], [force host initscripts; valid values are 'gentoo' and 'sysv' (default: guess)]), [
+ case "$withval" in
+ gentoo) ensc_with_init=gentoo;;
+ sysv) ensc_with_init=sysv;;
+ *) AC_MSG_ERROR([invalid initscripts value, only gentoo and sysv are supported]);;
+ esac
+ ], [
+ if test -e /etc/gentoo-release; then
+ ensc_with_init=gentoo
+ else
+ ensc_with_init=sysv
+ fi
+ ])
+AC_MSG_RESULT([$ensc_with_init])
+AM_CONDITIONAL(HAVE_GENTOO_INIT, test x"$ensc_with_init" = xgentoo)
+AM_CONDITIONAL(HAVE_SYSV_INIT, test x"$ensc_with_init" = xsysv)
+