]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Define PREAD_WRAPPERS if we're using GLIBC, not if we're using Linux.
authorTimo Sirainen <tss@iki.fi>
Mon, 10 May 2004 00:40:42 +0000 (03:40 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 10 May 2004 00:40:42 +0000 (03:40 +0300)
Removed a few ANSI-C header checks. Added strings.h check and include it
automatically if it's found, for strcasecmp().

--HG--
branch : HEAD

configure.in
src/lib/lib.h

index cc2c0b4cb5ce233e0c379f27e9173f21cd98b224..f42b5d4f9e21134ef9c8b4d7aee2e572866ec92a 100644 (file)
@@ -1,7 +1,7 @@
 AC_INIT(src)
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(dovecot, 1.0-test6)
+AM_INIT_AUTOMAKE(dovecot, 1.0-test7)
 
 AM_MAINTAINER_MODE
 
@@ -14,7 +14,7 @@ AC_ARG_PROGRAM
 AM_PROG_LIBTOOL
 AM_ICONV
 
-AC_CHECK_HEADERS(string.h stdlib.h stdint.h unistd.h dirent.h)
+AC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h)
 AC_CHECK_HEADERS(sys/uio.h sys/sysmacros.h sys/resource.h linux/mman.h)
 AC_CHECK_HEADERS(sys/select.h)
 
@@ -262,14 +262,21 @@ AC_TRY_COMPILE([
   AC_DEFINE(IOLOOP_NOTIFY_NONE,, No special notify support)
 ])
 
+dnl * GLIBC?
+AC_TRY_COMPILE([
+  #include <stdlib.h>
+  #ifdef __GLIBC__
+    we have glibc
+  #endif
+],,, [
+  AC_DEFINE(PREAD_WRAPPERS,, Define if pread/pwrite needs _XOPEN_SOURCE 500)
+])
+
 dnl * OS specific options
 case "$host_os" in
        hpux*)
                CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
                ;;
-       linux*)
-               AC_DEFINE(PREAD_WRAPPERS,, Define if pread/pwrite needs _XOPEN_SOURCE 500)
-               ;;
        *)
                ;;
 esac
index a0576e627e90d972e3905f7adfc5110a0f7f6f8f..fb7022040817657e5cc5434870e6ed0d928d9d90 100644 (file)
@@ -8,6 +8,9 @@
 
 /* default system includes - keep these at minimum.. */
 #include <string.h> /* strcmp() etc. */
+#ifdef HAVE_STRINGS_H
+#  include <strings.h> /* strcasecmp() etc. */
+#endif
 #include <stdarg.h> /* va_list is used everywhere */
 #include <limits.h> /* INT_MAX, etc. */
 #include <errno.h> /* error checking is good */