diff --git a/configure.ac b/configure.ac index 14b144b7f..0b92480eb 100644 --- a/configure.ac +++ b/configure.ac @@ -399,6 +399,9 @@ PKG_PROG_PKG_CONFIG # Checks for header files. AC_CHECK_HEADERS([stdarg.h stdbool.h netinet/in.h netinet/tcp.h sys/param.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h sys/endian.h libkern/OSByteOrder.h sys/ipc.h sys/shm.h],,, [AC_INCLUDES_DEFAULT]) +# Check for Apple header. This uncovers TARGET_OS_IPHONE, TARGET_OS_TV or TARGET_OS_WATCH +AC_CHECK_HEADERS([TargetConditionals.h]) + # check for types. # Using own tests for int64* because autoconf builtin only give 32bit. AC_CHECK_TYPE(int8_t, signed char) diff --git a/smallapp/unbound-control.c b/smallapp/unbound-control.c index 4843a9b31..ce13ad392 100644 --- a/smallapp/unbound-control.c +++ b/smallapp/unbound-control.c @@ -74,6 +74,10 @@ #include #endif +#ifdef HAVE_TARGETCONDITIONAL_H +#include +#endif + static void usage(void) ATTR_NORETURN; static void ssl_err(const char* s) ATTR_NORETURN; static void ssl_path_err(const char* s, const char *path) ATTR_NORETURN; @@ -879,11 +883,16 @@ int main(int argc, char* argv[]) if(argc == 0) usage(); if(argc >= 1 && strcmp(argv[0], "start")==0) { +#if defined(TARGET_OS_TV) || defined(TARGET_OS_WATCH) + fatal_exit("could not exec unbound: %s", + strerror(ENOSYS)); +#else if(execlp("unbound", "unbound", "-c", cfgfile, (char*)NULL) < 0) { fatal_exit("could not exec unbound: %s", strerror(errno)); } +#endif } if(argc >= 1 && strcmp(argv[0], "stats_shm")==0) { print_stats_shm(cfgfile);