/* Define to 1 if you have the `waitpid' function. */
#undef HAVE_WAITPID
-/* Define to 1 if you the `zlib' library. */
-#undef HAVE_ZLIB
+/* Define to 1 if you have the <zlib.h> header file. */
+#undef HAVE_ZLIB_H
/* Define to 1 if you have the `_getpty' function. */
#undef HAVE__GETPTY
# Check whether --enable-zlib was given.
if test "${enable_zlib+set}" = set; then :
enableval=$enable_zlib; case "$enableval" in
- yes) $as_echo "#define HAVE_ZLIB 1" >>confdefs.h
+ yes) $as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h
ZLIB="-lz"
;;
no) ;;
- *) $as_echo "#define HAVE_ZLIB 1" >>confdefs.h
+ *) $as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h
CPPFLAGS="${CPPFLAGS} -I${enableval}/include"
$as_echo "$ac_cv_lib_z_gzdopen" >&6; }
if test "x$ac_cv_lib_z_gzdopen" = x""yes; then :
- $as_echo "#define HAVE_ZLIB 1" >>confdefs.h
+ for ac_header in zlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
+ ZLIB="-lz"
+fi
+
+done
- ZLIB="-lz"
fi
-
-
AC_ARG_ENABLE(zlib,
[AS_HELP_STRING([--enable-zlib[[=PATH]]], [Whether to enable or disable zlib])],
[ case "$enableval" in
- yes) AC_DEFINE(HAVE_ZLIB)
+ yes) AC_DEFINE(HAVE_ZLIB_H)
ZLIB="-lz"
;;
no) ;;
- *) AC_DEFINE(HAVE_ZLIB)
+ *) AC_DEFINE(HAVE_ZLIB_H)
CPPFLAGS="${CPPFLAGS} -I${enableval}/include"
SUDO_APPEND_LIBPATH(ZLIB, [$enableval/lib])
ZLIB="${ZLIB} -lz"
])
if test X"$enable_zlib" = X""; then
AC_CHECK_LIB(z, gzdopen, [
- AC_DEFINE(HAVE_ZLIB)
- ZLIB="-lz"
+ AC_CHECK_HEADERS(zlib.h, [ZLIB="-lz"])
])
fi
], [
AH_TEMPLATE(sig_atomic_t, [Define to `int' if <signal.h> does not define.])
AH_TEMPLATE(__signed, [Define to `signed' or nothing if compiler does not support a signed type qualifier.])
AH_TEMPLATE(USING_NONUNIX_GROUPS, [Define to 1 if using a non-Unix group lookup implementation.])
-AH_TEMPLATE(HAVE_ZLIB, [Define to 1 if you the `zlib' library.])
dnl
dnl Bits to copy verbatim into config.h.in
def_timestamp_timeout = TIMEOUT;
def_passwd_timeout = PASSWORD_TIMEOUT;
def_passwd_tries = TRIES_FOR_PASSWORD;
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
def_compress_io = TRUE;
#endif
#include <signal.h>
#include <pwd.h>
#include <grp.h>
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
# include <zlib.h>
#endif
union io_fd {
FILE *f;
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
gzFile g;
#endif
void *v;
fd = open(pathbuf, O_CREAT|O_EXCL|O_WRONLY, S_IRUSR|S_IWUSR);
if (fd != -1) {
fcntl(fd, F_SETFD, FD_CLOEXEC);
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
if (docompress)
vfd = gzdopen(fd, "w");
else
for (i = 0; i < IOFD_MAX; i++) {
if (io_fds[i].v == NULL)
continue;
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
if (def_compress_io)
gzclose(io_fds[i].g);
else
sigprocmask(SIG_BLOCK, &ttyblock, &omask);
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
if (def_compress_io)
gzwrite(io_fds[idx].g, buf, len);
else
delay.tv_sec = now.tv_sec;
delay.tv_usec = now.tv_usec;
timevalsub(&delay, &last_time);
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
if (def_compress_io)
gzprintf(io_fds[IOFD_TIMING].g, "%d %f %d\n", idx,
delay.tv_sec + ((double)delay.tv_usec / 1000000), len);
#ifdef HAVE_REGCOMP
# include <regex.h>
#endif
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
# include <zlib.h>
#endif
#include <signal.h>
union io_fd {
FILE *f;
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
gzFile g;
#endif
void *v;
/*
* Timing file consists of line of the format: "%f %d\n"
*/
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
while (gzgets(io_fds[IOFD_TIMING].g, buf, sizeof(buf)) != NULL) {
#else
while (fgets(buf, sizeof(buf), io_fds[IOFD_TIMING].f) != NULL) {
len = sizeof(buf);
else
len = nbytes;
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
nread = gzread(io_fds[idx].g, buf, len);
#else
nread = fread(buf, 1, len, io_fds[idx].f);
path[len] = '\0';
strlcat(path, suffix, PATH_MAX);
-#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
return gzopen(path, "r");
#else
return fopen(path, "r");