Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 12 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,16 @@ include(GNUInstallDirs)

set(CPACK_INCLUDED TRUE)

if(NOT ZLIB_CONF_WRITTEN)
set(Z_PREFIX ${ZLIB_PREFIX})
set(CONF_OUT_FILE ${zlib_BINARY_DIR}/zconf.h.cmakein)
file(READ ${zlib_SOURCE_DIR}/zconf.h ZCONF_CONTENT LIMIT 245)
file(WRITE ${CONF_OUT_FILE} ${ZCONF_CONTENT})
file(APPEND ${CONF_OUT_FILE} "#cmakedefine Z_PREFIX 1\n")
file(APPEND ${CONF_OUT_FILE} "#cmakedefine HAVE_STDARG_H 1\n")
file(APPEND ${CONF_OUT_FILE} "#cmakedefine HAVE_UNISTD_H 1\n")
file(READ ${zlib_SOURCE_DIR}/zconf.h ZCONF_CONTENT OFFSET 244)
set(FIRST_ITEM TRUE)

foreach(item IN LISTS ZCONF_CONTENT)
if(FIRST_ITEM)
string(APPEND OUT_CONTENT ${item})
set(FIRST_ITEM FALSE)
else(FIRST_ITEM)
string(APPEND OUT_CONTENT "\;" ${item})
endif(FIRST_ITEM)
endforeach(item IN LISTS ${ZCONF_CONTENT})

file(APPEND ${CONF_OUT_FILE} ${OUT_CONTENT})
set(ZLIB_CONF_WRITTEN
TRUE
CACHE BOOL "zconf.h.cmakein was created")
mark_as_advanced(ZLIB_CONF_WRITTEN)
endif(NOT ZLIB_CONF_WRITTEN)
set(Z_PREFIX ${ZLIB_PREFIX})

file(READ ${zlib_SOURCE_DIR}/zconf.h zconf_content)
set(zconf_inc_guard "#define ZCONF_H\n")
string(CONCAT zconf_new_content
"#cmakedefine Z_PREFIX 1\n"
"#cmakedefine HAVE_STDARG_H 1\n"
"#cmakedefine HAVE_UNISTD_H 1\n")
string(REPLACE "${zconf_inc_guard}" "${zconf_inc_guard}\n${zconf_new_content}"
zconf_cmake_in "${zconf_content}")

#
# Check to see if we have large file support
Expand Down Expand Up @@ -123,7 +107,8 @@ else()
set(pc_libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
endif()
configure_file(${zlib_SOURCE_DIR}/zlib.pc.cmakein ${ZLIB_PC} @ONLY)
configure_file(${zlib_BINARY_DIR}/zconf.h.cmakein ${zlib_BINARY_DIR}/zconf.h)
string(CONFIGURE "${zconf_cmake_in}" zconf_configured)
file(GENERATE OUTPUT ${zlib_BINARY_DIR}/zconf.h CONTENT "${zconf_configured}")

# ============================================================================
# zlib
Expand Down
2 changes: 0 additions & 2 deletions adler32.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

/* @(#) $Id$ */

#include "zutil.h"

#define BASE 65521U /* largest prime smaller than 65536 */
Expand Down
2 changes: 0 additions & 2 deletions compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

/* @(#) $Id$ */

#define ZLIB_INTERNAL
#include "zlib.h"

Expand Down
2 changes: 0 additions & 2 deletions crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution.
*/

/* @(#) $Id$ */

/*
Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
protection on the static variables used to control the first-use generation
Expand Down
2 changes: 0 additions & 2 deletions deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
*
*/

/* @(#) $Id$ */

#include "deflate.h"

const char deflate_copyright[] =
Expand Down
2 changes: 0 additions & 2 deletions deflate.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
subject to change. Applications should only use zlib.h.
*/

/* @(#) $Id$ */

#ifndef DEFLATE_H
#define DEFLATE_H

Expand Down
2 changes: 0 additions & 2 deletions test/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

/* @(#) $Id$ */

#if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS)
# define _CRT_SECURE_NO_WARNINGS
#endif
Expand Down
2 changes: 0 additions & 2 deletions test/minigzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
* or in pipe mode.
*/

/* @(#) $Id$ */

#ifndef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 200112L
#endif
Expand Down
2 changes: 0 additions & 2 deletions trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
* Addison-Wesley, 1983. ISBN 0-201-06672-6.
*/

/* @(#) $Id$ */

/* #define GEN_TREES_H */

#include "deflate.h"
Expand Down
2 changes: 0 additions & 2 deletions uncompr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

/* @(#) $Id$ */

#define ZLIB_INTERNAL
#include "zlib.h"

Expand Down
2 changes: 0 additions & 2 deletions zconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

/* @(#) $Id$ */

#ifndef ZCONF_H
#define ZCONF_H

Expand Down
2 changes: 0 additions & 2 deletions zconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

/* @(#) $Id$ */

#ifndef ZCONF_H
#define ZCONF_H

Expand Down
2 changes: 0 additions & 2 deletions zutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

/* @(#) $Id$ */

#include "zutil.h"
#ifndef Z_SOLO
# include "gzguts.h"
Expand Down
2 changes: 0 additions & 2 deletions zutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
subject to change. Applications should only use zlib.h.
*/

/* @(#) $Id$ */

#ifndef ZUTIL_H
#define ZUTIL_H

Expand Down