+ AC_COMPILE_IFELSE(
+[#include <stdio.h>
+#include <sys/types.h>
+#include <asm/types.h>
+#include <sys/socket.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+
+int main (void)
+{
+ int retval = TCA_STATS2;
+ return (retval);
+}],
+ [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
+ []);
+
+ AC_COMPILE_IFELSE(
+[#include <stdio.h>
+#include <sys/types.h>
+#include <asm/types.h>
+#include <sys/socket.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+
+int main (void)
+{
+ int retval = TCA_STATS;
+ return (retval);
+}],
+ [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
+ []);
+
+ CFLAGS="$SAVE_CFLAGS"
+fi
+if test "x$with_libnetlink" = "xyes"
+then
+ AC_CHECK_LIB(netlink, rtnl_open,
+ [with_libnetlink="yes"],
+ [with_libnetlink="no (symbol 'rtnl_open' not found)"],
+ [$with_libnetlink_libs])
+fi
+if test "x$with_libnetlink" = "xyes"
+then
+ BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
+ BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
+ AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
+ AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
+# }}}
+
+# --with-libnetsnmp {{{
+with_snmp_config="net-snmp-config"
+with_snmp_cflags=""
+with_snmp_libs=""
+AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
+[
+ if test "x$withval" = "xno"
+ then
+ with_libnetsnmp="no"
+ else if test "x$withval" = "xyes"
+ then
+ with_libnetsnmp="yes"
+ else
+ if test -x "$withval"
+ then
+ with_snmp_config="$withval"
+ with_libnetsnmp="yes"
+ else
+ with_snmp_config="$withval/bin/net-snmp-config"
+ with_libnetsnmp="yes"
+ fi
+ fi; fi
+],
+[with_libnetsnmp="yes"])
+if test "x$with_libnetsnmp" = "xyes"
+then
+ with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
+ snmp_config_status=$?
+
+ if test $snmp_config_status -ne 0
+ then
+ with_libnetsnmp="no ($with_snmp_config failed)"
+ else
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
+
+ AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
+
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ fi
+fi
+if test "x$with_libnetsnmp" = "xyes"
+then
+ with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
+ snmp_config_status=$?
+
+ if test $snmp_config_status -ne 0
+ then
+ with_libnetsnmp="no ($with_snmp_config failed)"
+ else
+ AC_CHECK_LIB(netsnmp, init_snmp,
+ [with_libnetsnmp="yes"],
+ [with_libnetsnmp="no (libnetsnmp not found)"],
+ [$with_snmp_libs])
+ fi
+fi
+if test "x$with_libnetsnmp" = "xyes"
+then
+ BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
+ BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
+ AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
+ AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
+# }}}
+
+# --with-liboconfig {{{
+with_own_liboconfig="no"
+liboconfig_LDFLAGS="$LDFLAGS"
+liboconfig_CPPFLAGS="$CPPFLAGS"
+AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
+[
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ then
+ if test -d "$withval/lib"
+ then
+ liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
+ fi
+ if test -d "$withval/include"
+ then
+ liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
+ fi
+ fi
+ if test "x$withval" = "xno"
+ then
+ AC_MSG_ERROR("liboconfig is required")
+ fi
+],
+[
+ with_liboconfig="yes"
+])
+
+save_LDFLAGS="$LDFLAGS"
+save_CPPFLAGS="$CPPFLAGS"
+LDFLAGS="$liboconfig_LDFLAGS"
+CPPFLAGS="$liboconfig_CPPFLAGS"
+AC_CHECK_LIB(oconfig, oconfig_parse_fh,
+[
+ with_liboconfig="yes"
+ with_own_liboconfig="no"
+],
+[
+ with_liboconfig="yes"
+ with_own_liboconfig="yes"
+ LDFLAGS="$save_LDFLAGS"
+ CPPFLAGS="$save_CPPFLAGS"
+])
+
+AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
+if test "x$with_own_liboconfig" = "xyes"
+then
+ with_liboconfig="yes (shipped version)"
+fi
+# }}}
+
+# --with-liboping {{{
+with_own_liboping="no"
+liboping_LDFLAGS="$LDFLAGS"
+liboping_CPPFLAGS="$CPPFLAGS"
+AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
+[
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ then
+ if test -d "$withval/lib"
+ then
+ liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
+ fi
+ if test -d "$withval/include"
+ then
+ liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
+ fi
+ fi
+ if test "x$withval" = "xno"
+ then
+ with_liboping="no"
+ with_own_liboping="no"
+ else if test "x$withval" = "xyes"
+ then
+ with_liboping="yes"
+ fi; fi
+],
+[
+ with_liboping="yes"
+])
+
+if test "x$with_liboping" = "xyes"
+then
+ save_LDFLAGS="$LDFLAGS"
+ save_CPPFLAGS="$CPPFLAGS"
+ LDFLAGS="$liboping_LDFLAGS"
+ CPPFLAGS="$liboping_CPPFLAGS"
+ AC_CHECK_LIB(oping, ping_construct,
+ [
+ with_liboping="yes"
+ with_own_liboping="no"
+ ],
+ [
+ with_liboping="yes"
+ with_own_liboping="yes"
+ LDFLAGS="$save_LDFLAGS"
+ CPPFLAGS="$save_CPPFLAGS"
+ ])
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
+AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
+# }}}
+
+# --with-oracle {{{
+with_oracle_cppflags=""
+with_oracle_libs=""
+AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
+[
+ if test "x$withval" = "xyes"
+ then
+ if test "x$ORACLE_HOME" = "x"
+ then
+ AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
+ fi
+ with_oracle="yes"
+ else if test "x$withval" = "xno"
+ then
+ with_oracle="no"
+ else
+ with_oracle="yes"
+ ORACLE_HOME="$withval"
+ fi; fi
+],
+[
+ if test "x$ORACLE_HOME" = "x"
+ then
+ with_oracle="no (ORACLE_HOME is not set)"
+ else
+ with_oracle="yes"
+ fi
+])
+if test "x$ORACLE_HOME" != "x"
+then
+ with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
+
+ if test -e "$ORACLE_HOME/lib/ldflags"
+ then
+ with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
+ fi
+ #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
+ with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
+fi
+if test "x$with_oracle" = "xyes"
+then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
+
+ AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
+
+ CPPFLAGS="$SAVE_CPPFLAGS"
+fi
+if test "x$with_oracle" = "xyes"
+then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ SAVE_LDFLAGS="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
+ LDFLAGS="$LDFLAGS $with_oracle_libs"
+
+ AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
+
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
+fi
+if test "x$with_oracle" = "xyes"
+then
+ BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
+ BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
+ AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
+ AC_SUBST(BUILD_WITH_ORACLE_LIBS)
+fi
+# }}}
+
+# --with-libowcapi {{{