Imported from libpng-1.4.0beta17.tar

This commit is contained in:
Glenn Randers-Pehrson
2006-12-07 19:16:44 -06:00
parent 701dbaa81e
commit 7edd45814c
45 changed files with 279 additions and 101 deletions

149
scripts/CMakeLists.txt Normal file
View File

@@ -0,0 +1,149 @@
project(libpng)
SET(PNG_VER_MAJOR 1)
SET(PNG_VER_MINOR 4)
SET(PNG_VER_PATCH 0)
# needed packages
find_package(ZLIB REQUIRED)
# command line options
option(PNG_SHARED "Build shared lib" YES)
option(PNG_TESTS "Build pngtest" YES)
#TODO:
# PNG_NO_CONSOLE_IO
# PNG_NO_STDIO
# PNG_CONSOLE_IO_SUPPORTED
# PNGARG
# some others :)
set(png_asm_tmp "OFF")
if(NOT WIN32)
find_program(uname_executable NAMES uname PATHS /bin /usr/bin /usr/local/bin)
if(uname_executable)
EXEC_PROGRAM(${uname_executable} ARGS --machine OUTPUT_VARIABLE uname_output)
if("uname_output" MATCHES "^.*i[1-9]86.*$")
set(png_asm_tmp "ON")
else("uname_output" MATCHES "^.*i[1-9]86.*$")
set(png_asm_tmp "OFF")
endif("uname_output" MATCHES "^.*i[1-9]86.*$")
endif(uname_executable)
endif(NOT WIN32)
option(PNG_MMX "Use MMX assembler code (x86 only)" ${png_asm_tmp})
# msvc does not append 'lib' - do it here to have consistent name
if(MSVC)
set(PNG_LIB_NAME lib)
endif(MSVC)
#set(PNG_LIB_NAME ${PNG_LIB_NAME}png-${PNG_VER_MAJOR}.${PNG_VER_MINOR})
set(PNG_LIB_NAME ${PNG_LIB_NAME}png)
# to distinguish between debug and release lib
set(CMAKE_DEBUG_POSTFIX "d")
# append _static to static lib
if(NOT PNG_SHARED)
set(PNG_LIB_NAME ${PNG_LIB_NAME}_static)
endif(NOT PNG_SHARED)
# our sources
set(libpng_sources
png.h
pngconf.h
pngdefs.h
pngpriv.h
png.c
pngerror.c
pngget.c
pngmem.c
pngpread.c
pngread.c
pngrio.c
pngrtran.c
pngrutil.c
pngset.c
pngtrans.c
pngwio.c
pngwrite.c
pngwtran.c
pngwutil.c
)
set(pngtest_sources
pngtest.c
)
if(MSVC)
add_definitions(-DPNG_NO_MODULEDEF -D_CRT_SECURE_NO_DEPRECATE)
FILE(WRITE pngdefs.h "#define PNG_USE_PNGVCRD\n")
set(libpng_sources ${libpng_sources}
pngvcrd.c
)
else(MSVC)
FILE(WRITE pngdefs.h "#define PNG_USE_PNGGCCRD\n")
FILE(APPEND pngdefs.h "#define PNG_USE_GLOBAL_ARRAYS\n")
set(libpng_sources ${libpng_sources}
pnggccrd.c
)
endif(MSVC)
if(NOT PNG_MMX)
FILE(APPEND pngdefs.h "#define PNG_NO_MMX_CODE\n")
endif(NOT PNG_MMX)
if(NOT WIN32)
find_library(M_LIBRARY
NAMES m
PATHS /usr/lib /usr/local/lib
)
endif(NOT WIN32)
# now build our target
include_directories(${CMAKE_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
if(PNG_SHARED)
add_library(${PNG_LIB_NAME} SHARED ${libpng_sources})
else(PNG_SHARED)
add_library(STATIC ${libpng_sources})
endif(PNG_SHARED)
target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY})
if(PNG_SHARED AND WIN32)
set_target_properties(${PNG_LIB_NAME} PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
endif(PNG_SHARED AND WIN32)
if(PNG_TESTS)
# does not work with msvc due to png_lib_ver issue
add_executable(pngtest ${pngtest_sources})
target_link_libraries(pngtest ${PNG_LIB_NAME})
# add_test(pngtest ${CMAKE_SOURCE_DIR}/pngtest.png)
endif(PNG_TESTS)
# install
install_targets(/bin ${PNG_LIB_NAME})
install(FILES libpng.so DESTINATION lib)
install(FILES png.h pngconf.h pngpriv.h pngdefs.h DESTINATION include)
install(FILES libpng.3 libpngpf.3 DESTINATION man/man3)
# what's with libpng.txt and all the extra files?
# uninstall
# do we need this?
# dist
# do we need this?
# to create msvc import lib for mingw compiled shared lib
# pexports libpng.dll > libpng.def
# lib /def:libpng.def /machine:x86

View File

@@ -8,7 +8,7 @@
# Modeled after libxml-config.
version=1.4.0beta16
version=1.4.0beta17
prefix=""
libdir=""
libs=""

View File

@@ -5,6 +5,6 @@ includedir=@includedir@/libpng14
Name: libpng
Description: Loads and saves PNG files
Version: 1.4.0beta16
Version: 1.4.0beta17
Libs: -L${libdir} -lpng14
Cflags: -I${includedir}

View File

@@ -8,7 +8,7 @@
# Library name:
LIBNAME=libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -8,7 +8,7 @@
# Library name:
LIBNAME=libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -20,7 +20,7 @@ LN_SF = ln -f -s
LIBNAME=libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
prefix=/usr/local

View File

@@ -8,7 +8,7 @@
# Library name:
LIBNAME=libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -65,7 +65,7 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
LIBNAME = libpng14
PNGMAJ = 1
CYGDLL = 14
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
SHAREDLIB=cygpng$(CYGDLL).dll

View File

@@ -19,7 +19,7 @@ ZLIBINC=../zlib
# Library name:
LIBNAME = libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -5,7 +5,7 @@
# Library name:
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
LIBNAME = libpng14

View File

@@ -12,7 +12,7 @@
# Library name:
LIBNAME = libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -16,7 +16,7 @@
# Library name:
LIBNAME = libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -18,7 +18,7 @@ ZLIBINC=/opt/zlib/include
# Library name:
LIBNAME = libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -8,7 +8,7 @@
# Library name:
LIBNAME = libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -18,7 +18,7 @@ ZLIBINC=/opt/zlib/include
# Library name:
LIBNAME = libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -6,7 +6,7 @@
# Library name:
LIBNAME = libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -62,7 +62,7 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
LIBNAME = libpng14
PNGMAJ = 1
MINGDLL = 14
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
SHAREDLIB=libpng$(MINGDLL).dll

View File

@@ -14,7 +14,7 @@ INCSDIR=${LOCALBASE}/include/libpng14
LIB= png14
SHLIB_MAJOR= 0
SHLIB_MINOR= 1.4.0beta16
SHLIB_MINOR= 1.4.0beta17
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c

View File

@@ -13,7 +13,7 @@ INCSDIR=${LOCALBASE}/include/libpng
LIB= png
SHLIB_MAJOR= 3
SHLIB_MINOR= 1.4.0beta16
SHLIB_MINOR= 1.4.0beta17
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c

View File

@@ -8,7 +8,7 @@ LIBDIR= ${PREFIX}/lib
MANDIR= ${PREFIX}/man/cat
SHLIB_MAJOR= 0
SHLIB_MINOR= 1.4.0beta16
SHLIB_MINOR= 1.4.0beta17
LIB= png
SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \

View File

@@ -9,7 +9,7 @@
# Library name:
LIBNAME = libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -6,7 +6,7 @@
# Library name:
LIBNAME=libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -6,7 +6,7 @@
# Library name:
LIBNAME=libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -8,7 +8,7 @@
# Library name:
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
LIBNAME = libpng14

View File

@@ -8,7 +8,7 @@
# Library name:
LIBNAME = libpng14
PNGMAJ = 1
PNGMIN = 1.4.0beta16
PNGMIN = 1.4.0beta17
PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names:

View File

@@ -2,7 +2,7 @@
; PNG.LIB module definition file for OS/2
;----------------------------------------
; Version 1.4.0beta16
; Version 1.4.0beta17
LIBRARY PNG
DESCRIPTION "PNG image compression library for OS/2"

View File

@@ -5,7 +5,7 @@
LIBRARY
EXPORTS
;Version 1.4.0beta16
;Version 1.4.0beta17
png_build_grayscale_palette
png_chunk_error
png_chunk_warning