AS_IF([test -n "$HAVE_LIBCURL"], [ : ], [
LIBCURL_CHECK_CONFIG("yes", "7.21.3", [ HAVE_LIBCURL=y ], [ HAVE_LIBCURL=n ])
])
+ AM_CONDITIONAL([HAVE_LIBCURL], [test "$HAVE_LIBCURL" = "y"])
])
sillyrecords.cc \
sstuff.hh \
statbag.cc \
- unix_utility.cc \
- minicurl.cc minicurl.hh
+ unix_utility.cc
-sdig_LDADD = $(LIBCRYPTO_LIBS) $(LIBCURL)
+sdig_LDADD = $(LIBCRYPTO_LIBS)
sdig_LDFLAGS = $(AM_LDFLAGS) $(LIBCRYPTO_LDFLAGS)
+if HAVE_LIBCURL
+sdig_SOURCES += minicurl.cc minicurl.hh
+sdig_LDADD += $(LIBCURL)
+endif
+
calidns_SOURCES = \
base32.cc \
base64.cc base64.hh \
#include "statbag.hh"
#include <boost/array.hpp>
#include "ednssubnet.hh"
+
+#ifdef HAVE_LIBCURL
#include "minicurl.hh"
+#endif
+
StatBag S;
bool hidettl=false;
string reply;
string question(packet.begin(), packet.end());
ComboAddress dest;
- if(*argv[1]=='h')
+ if(*argv[1]=='h') {
doh = true;
- else
+ }
+ else {
dest = ComboAddress(argv[1] + (*argv[1]=='@'), atoi(argv[2]));
+ }
if(doh) {
+#ifdef HAVE_LIBCURL
MiniCurl mc;
MiniCurl::MiniCurlHeaders mch;
mch.insert(std::make_pair("Content-Type", "application/dns-message"));
mch.insert(std::make_pair("Accept", "application/dns-message"));
reply = mc.postURL(argv[1], question, mch);
+#else
+ throw PDNSException("please link sdig against libcurl for DoH support");
+#endif
}
else if(tcp) {
Socket sock(dest.sin4.sin_family, SOCK_STREAM);