* More work on fake resolver
authorArt Cancro <ajc@citadel.org>
Sat, 18 Jan 2003 06:03:06 +0000 (06:03 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 18 Jan 2003 06:03:06 +0000 (06:03 +0000)
citadel/acconfig.h
citadel/configure.ac
citadel/domain.c

index f69e1231744a78ca0677852bae4e93aa9a8e7c87..63e4752083b8ec2334bbf358c0377652c9f5ac74 100644 (file)
@@ -33,3 +33,6 @@
 
 /* define this if you have the libical calendaring library available */
 #undef HAVE_LIBICAL
+
+/* define this if you have the resolv.h header file. */
+#undef HAVE_RESOLV_H
index ff0248f4ebf5949070949e4282d3a34a72189666..be9985a6b30a86440bfb26ec9776a707d4509c65 100644 (file)
@@ -434,7 +434,7 @@ if test "x$with_ncurses" != xno; then
        AC_CHECK_HEADERS(ncurses.h,,,[ ])
 fi
 
-AC_CHECK_HEADER(resolv.h,,,
+AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H),,
 [#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -445,8 +445,6 @@ AC_CHECK_HEADER(resolv.h,,,
 #include <arpa/nameser.h>
 #endif])
 
-AC_SUBST(SMTP)
-AC_SUBST(DOMAIN)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
index f16f0814f97d3aa017a99b8c1095b28f02e9fb5f..6dcbcafc32d5b89d7219158d2bc55a315faea752 100644 (file)
 #include <string.h>
 #include <netinet/in.h>
 #include <stdio.h>
+
+#ifdef HAVE_RESOLV_H
 #include <arpa/nameser.h>
 #include <resolv.h>
+#endif
+
 #include "sysdep_decls.h"
 #include "citadel.h"
 #include "domain.h"
@@ -110,10 +114,14 @@ void sort_mxrecs(struct mx *mxrecs, int num_mxrecs) {
  *
  */
 int getmx(char *mxbuf, char *dest) {
+
+#ifdef HAVE_RESOLV_H
        union {
                        u_char bytes[1024];
                        HEADER header;
     } answer;
+#endif
+
        int ret;
        unsigned char *startptr, *endptr, *ptr;
        char expanded_buf[1024];
@@ -137,7 +145,7 @@ int getmx(char *mxbuf, char *dest) {
         * No smart-host?  Look up the best MX for a site.
         */
 
-#ifdef __CYGWIN__
+#ifndef HAVE_RESOLV_H
 
        /*
         * On systems with b0rken or non-standard resolver libraries, learn
@@ -153,7 +161,7 @@ int getmx(char *mxbuf, char *dest) {
        pclose(fp);
        return(0);      /* FIXME */
 
-#else /* __CYGWIN__ */
+#else /* HAVE_RESOLV_H */
 
        /*
         * Make a call to the standard resolver library.
@@ -230,7 +238,7 @@ int getmx(char *mxbuf, char *dest) {
                        }
                }
        }
-#endif /* __CYGWIN__ */
+#endif /* HAVE_RESOLV_H */
 
        sort_mxrecs(mxrecs, num_mxrecs);