# Check for stndard/system includes
#
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+check_include_file(stdarg.h HAVE_STDARG_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H)
check_include_file(sys/sdt.h HAVE_SYS_SDT_H)
-check_include_file(unistd.h Z_HAVE_UNISTD_H)
+check_include_file(unistd.h HAVE_UNISTD_H)
#
# Check to see if we have large file support
file(REMOVE ${output})
file(STRINGS ${input} _lines)
foreach(_line IN LISTS _lines)
- file(APPEND ${output} "${_line}\n")
-
- if(_line STREQUAL "#define ZCONF_H" OR _line STREQUAL "#define ZCONFNG_H")
- file(APPEND ${output} "#cmakedefine Z_HAVE_UNISTD_H\n")
- if(NOT HAVE_PTRDIFF_T)
- file(APPEND ${output} "#cmakedefine NEED_PTRDIFF_T\n")
- file(APPEND ${output} "#cmakedefine PTRDIFF_TYPE ${PTRDIFF_TYPE}\n")
- endif()
+ string(REGEX REPLACE "#ifdef HAVE_UNISTD_H.*" "@ZCONF_UNISTD_LINE@" _line "${_line}")
+ string(REGEX REPLACE "#ifdef HAVE_STDARG_H.*" "@ZCONF_STDARG_LINE@" _line "${_line}")
+ string(REGEX REPLACE "#ifdef NEED_PTRDIFF_T.*" "@ZCONF_PTRDIFF_LINE@" _line "${_line}")
+ if(NEED_PTRDIFF_T)
+ string(REGEX REPLACE "typedef PTRDIFF_TYPE" "typedef @PTRDIFF_TYPE@" _line "${_line}")
endif()
+ file(APPEND ${output} "${_line}\n")
endforeach()
endmacro(generate_cmakein)
endif()
endif()
+if(HAVE_STDARG_H)
+ SET(ZCONF_STDARG_LINE "#if 1 /* was set to #if 1 by configure/cmake/etc */")
+else()
+ SET(ZCONF_STDARG_LINE "#ifdef HAVE_STDARG_H /* may be set to #if 1 by configure/cmake/etc */")
+endif()
+if(HAVE_UNISTD_H)
+ SET(ZCONF_UNISTD_LINE "#if 1 /* was set to #if 1 by configure/cmake/etc */")
+else()
+ SET(ZCONF_UNISTD_LINE "#ifdef HAVE_UNISTD_H /* may be set to #if 1 by configure/cmake/etc */")
+endif()
+if(NEED_PTRDIFF_T)
+ SET(ZCONF_PTRDIFF_LINE "#if 1 /* was set to #if 1 by configure/cmake/etc */")
+else()
+ SET(ZCONF_PTRDIFF_LINE "#ifdef NEED_PTRDIFF_T /* may be set to #if 1 by configure/cmake/etc */")
+endif()
+
set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib${SUFFIX}.pc)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
${ZLIB_PC} @ONLY)
typedef void *voidpf;
typedef void *voidp;
-#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+#ifdef HAVE_UNISTD_H /* may be set to #if 1 by configure/cmake/etc */
# define Z_HAVE_UNISTD_H
#endif
-#ifdef NEED_PTRDIFF_T /* may be set to #if 1 by ./configure */
+#ifdef NEED_PTRDIFF_T /* may be set to #if 1 by configure/cmake/etc */
typedef PTRDIFF_TYPE ptrdiff_t;
#endif
typedef void *voidpf;
typedef void *voidp;
-#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+#ifdef HAVE_UNISTD_H /* may be set to #if 1 by configure/cmake/etc */
# define Z_HAVE_UNISTD_H
#endif
-#ifdef NEED_PTRDIFF_T /* may be set to #if 1 by ./configure */
+#ifdef NEED_PTRDIFF_T /* may be set to #if 1 by configure/cmake/etc */
typedef PTRDIFF_TYPE ptrdiff_t;
#endif