/* Define to 1 to use IPv6 support in system and adns */
#undef CONFIG_IPV6
+/* Define to 1 if you have the `fmemopen' function. */
+#undef HAVE_FMEMOPEN
+
+/* Define to 1 if you have the `funopen' function. */
+#undef HAVE_FUNOPEN
+
/* Define to 1 if you have the `adns' library (-ladns). */
#undef HAVE_LIBADNS
+for ac_func in fmemopen funopen
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: Checking requirements for IPv6 support..." >&5
$as_echo "$as_me: Checking requirements for IPv6 support..." >&6;}
enable_ipv6=true
AC_CHECK_LIB(adns,adns_init)
REQUIRE_HEADER([adns.h])
+AC_CHECK_FUNCS([fmemopen funopen])
+
AC_MSG_NOTICE([Checking requirements for IPv6 support...])
enable_ipv6=true
m4_define(NO_IPV6,[enable_ipv6=false])
#include "osdep.h"
#include "secnet.h"
#include "util.h"
+
+#ifndef HAVE_FMEMOPEN
+# ifdef HAVE_FUNOPEN
+
+struct fmemopen_state {
+ const char *bufp;
+ size_t remain;
+};
+
+static int fmemopen_readfn(void *sst, char *out, int sz)
+{
+ struct fmemopen_state *st=sst;
+ assert(sz>=0);
+ int now=MIN((size_t)sz,st->remain);
+ memcpy(out,st->bufp,now);
+ st->remain-=now;
+ return now;
+}
+static int fmemopen_close(void *sst) { free(sst); return 0; }
+
+FILE *fmemopen(void *buf, size_t size, const char *mode)
+{
+ /* this is just a fake plastic imitation */
+ assert(!strcmp(mode,"r"));
+ struct fmemopen_state *st;
+ NEW(st);
+ st->bufp=buf;
+ st->remain=size;
+ FILE *f=funopen(st,fmemopen_readfn,0,0,fmemopen_close);
+ if (!f) free(st);
+ return f;
+}
+
+# else /* HAVE_FUNOPEN */
+# error no fmemopen, no funopen, cannot proceed
+# endif
+
+#endif /* HAVE_FMEMOPEN */