Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use inflateInit2() so that gzip header is read by default, and allow
consumers of this library to specify a windowSize. Also, change the build system to use cmake in the hopes that this will actually compile on other platforms (only tested OS-X).
- Loading branch information
Brian Maher
committed
Jan 29, 2010
1 parent
93c0eb9
commit 5002717
Showing
8 changed files
with
81 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright (C) 2007-2009 LuaDist. | ||
# Submitted by David Manura | ||
# Redistribution and use of this file is allowed according to the | ||
# terms of the MIT license. | ||
# For details see the COPYRIGHT file distributed with LuaDist. | ||
# Please note that the package source code is licensed under its own | ||
# license. | ||
|
||
PROJECT(lua-zlib C) | ||
CMAKE_MINIMUM_REQUIRED (VERSION 2.6) | ||
|
||
# Basic configurations | ||
SET(INSTALL_CMOD share/lua/cmod CACHE PATH "Directory to install Lua binary modules (configure lua via LUA_CPATH)") | ||
# / configs | ||
|
||
# Find zlib | ||
FIND_PACKAGE(ZLIB REQUIRED) | ||
# / Find zlib | ||
|
||
# Find lua | ||
FIND_PACKAGE(Lua51 REQUIRED) | ||
# / Find lua | ||
|
||
# Define how to build zlib.so: | ||
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS} ${LUA_INCLUDE_DIR}) | ||
ADD_LIBRARY(cmod_zlib MODULE | ||
lua_zlib.c zlib.def) | ||
SET_TARGET_PROPERTIES(cmod_zlib PROPERTIES PREFIX "") | ||
SET_TARGET_PROPERTIES(cmod_zlib PROPERTIES OUTPUT_NAME zlib) | ||
TARGET_LINK_LIBRARIES(cmod_zlib ${LUA_LIBRARIES} ${ZLIB_LIBRARIES}) | ||
# / build zlib.so | ||
|
||
# Define how to test zlib.so: | ||
INCLUDE(CTest) | ||
FIND_PROGRAM(LUA NAMES lua lua.bat) | ||
ADD_TEST(basic ${LUA} ${CMAKE_CURRENT_SOURCE_DIR}/test.lua ${CMAKE_CURRENT_SOURCE_DIR}/ ${CMAKE_CURRENT_BINARY_DIR}/) | ||
# / test zlib.so | ||
|
||
# Where to install stuff | ||
INSTALL (TARGETS cmod_zlib DESTINATION ${INSTALL_CMOD}) | ||
# / Where to install. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
local os = require("os") | ||
module(..., package.seeall) | ||
|
||
local counter = 1 | ||
local failed = false | ||
|
||
function ok(assert_true, desc) | ||
local msg = ( assert_true and "ok " or "not ok " ) .. counter | ||
if ( not assert_true ) then | ||
failed = true | ||
end | ||
if ( desc ) then | ||
msg = msg .. " - " .. desc | ||
end | ||
print(msg) | ||
counter = counter + 1 | ||
end | ||
|
||
function exit() | ||
os.exit(failed and 1 or 0) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
EXPORTS | ||
luaopen_zlib |