mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from libpng-1.4.0beta19.tar
This commit is contained in:
@@ -1,149 +1,212 @@
|
||||
project(PNG)
|
||||
|
||||
project(libpng)
|
||||
# Copyright (C) 2007 Glenn Randers-Pehrson
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
SET(PNG_VER_MAJOR 1)
|
||||
SET(PNG_VER_MINOR 4)
|
||||
SET(PNG_VER_PATCH 0)
|
||||
set(PNGLIB_MAJOR 1)
|
||||
set(PNGLIB_MINOR 4)
|
||||
set(PNGLIB_RELEASE 0)
|
||||
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
|
||||
|
||||
# needed packages
|
||||
find_package(ZLIB REQUIRED)
|
||||
if(NOT WIN32)
|
||||
find_library(M_LIBRARY
|
||||
NAMES m
|
||||
PATHS /usr/lib /usr/local/lib
|
||||
)
|
||||
if(NOT M_LIBRARY)
|
||||
message(STATUS
|
||||
"math library 'libm' not found - floating point support disabled")
|
||||
endif(NOT M_LIBRARY)
|
||||
else(NOT WIN32)
|
||||
# not needed on windows
|
||||
set(M_LIBRARY "")
|
||||
endif(NOT WIN32)
|
||||
|
||||
|
||||
# command line options
|
||||
# COMMAND LINE OPTIONS
|
||||
option(PNG_SHARED "Build shared lib" YES)
|
||||
option(PNG_STATIC "Build static lib" YES)
|
||||
option(PNG_TESTS "Build pngtest" YES)
|
||||
option(PNG_NO_CONSOLE_IO "FIXME" YES)
|
||||
option(PNG_NO_STDIO "FIXME" YES)
|
||||
option(PNG_DEBUG "Build with debug output" YES)
|
||||
option(PNGARG "FIXME" YES)
|
||||
#TODO:
|
||||
# PNG_NO_CONSOLE_IO
|
||||
# PNG_NO_STDIO
|
||||
# PNG_CONSOLE_IO_SUPPORTED
|
||||
# PNGARG
|
||||
# some others :)
|
||||
|
||||
# maybe needs improving, but currently I don't know when we can enable what :)
|
||||
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)
|
||||
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})
|
||||
|
||||
|
||||
# SET LIBNAME
|
||||
# msvc does not append 'lib' - do it here to have consistent name
|
||||
if(MSVC)
|
||||
set(PNG_LIB_NAME lib)
|
||||
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)
|
||||
set(PNG_LIB_NAME ${PNG_LIB_NAME}png${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||
|
||||
# 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
|
||||
# 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
|
||||
png.h
|
||||
pngconf.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
|
||||
pngtest.c
|
||||
)
|
||||
|
||||
# SOME NEEDED DEFINITIONS
|
||||
add_definitions(-DZLIB_DLL)
|
||||
|
||||
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
|
||||
)
|
||||
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
|
||||
)
|
||||
FILE(WRITE pngdefs.h "#define PNG_USE_PNGGCCRD\n")
|
||||
set(libpng_sources ${libpng_sources}
|
||||
pnggccrd.c
|
||||
)
|
||||
endif(MSVC)
|
||||
|
||||
if(NOT PNG_MMX)
|
||||
if(NOT MSVC)
|
||||
if(NOT PNG_MMX)
|
||||
FILE(APPEND pngdefs.h "#define PNG_NO_MMX_CODE\n")
|
||||
endif(NOT PNG_MMX)
|
||||
endif(NOT PNG_MMX)
|
||||
else(NOT MSVC)
|
||||
if(PNG_MMX)
|
||||
# maybe add this to pngconf.h ?
|
||||
FILE(APPEND pngdefs.h "#define PNG_MMX_MMX_CODE_SUPPORTED\n")
|
||||
endif(PNG_MMX)
|
||||
endif(NOT MSVC)
|
||||
|
||||
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_CONSOLE_IO_SUPPORTED)
|
||||
add_definitions(-DPNG_CONSOLE_IO_SUPPORTED)
|
||||
endif(PNG_CONSOLE_IO_SUPPORTED)
|
||||
|
||||
if(PNG_NO_CONSOLE_IO)
|
||||
add_definitions(-DPNG_NO_CONSOLE_IO)
|
||||
endif(PNG_NO_CONSOLE_IO)
|
||||
|
||||
if(PNG_NO_STDIO)
|
||||
add_definitions(-DPNG_NO_STDIO)
|
||||
endif(PNG_NO_STDIO)
|
||||
|
||||
if(PNG_DEBUG)
|
||||
add_definitions(-DPNG_DEBUG)
|
||||
endif(PNG_DEBUG)
|
||||
|
||||
if(NOT M_LIBRARY)
|
||||
add_definitions(-DPNG_NO_FLOATING_POINT_SUPPORTED)
|
||||
endif(NOT M_LIBRARY)
|
||||
|
||||
# NOW BUILD OUR TARGET
|
||||
include_directories(${PNG_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
|
||||
|
||||
if(PNG_SHARED)
|
||||
add_library(${PNG_LIB_NAME} SHARED ${libpng_sources})
|
||||
else(PNG_SHARED)
|
||||
add_library(STATIC ${libpng_sources})
|
||||
add_library(${PNG_LIB_NAME} SHARED ${libpng_sources})
|
||||
target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
endif(PNG_SHARED)
|
||||
if(PNG_STATIC)
|
||||
# does not work without changing name
|
||||
set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static)
|
||||
add_library(${PNG_LIB_NAME_STATIC} STATIC ${libpng_sources})
|
||||
endif(PNG_STATIC)
|
||||
|
||||
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)
|
||||
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)
|
||||
add_executable(pngtest ${pngtest_sources})
|
||||
target_link_libraries(pngtest ${PNG_LIB_NAME})
|
||||
# add_test(pngtest ${PNG_SOURCE_DIR}/pngtest.png)
|
||||
endif(PNG_TESTS)
|
||||
|
||||
|
||||
# install
|
||||
install_targets(/bin ${PNG_LIB_NAME})
|
||||
install(FILES libpng.so DESTINATION lib)
|
||||
# CREATE PKGCONFIG FILES
|
||||
# we use the same files like ./configure, so we have to set its vars
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
set(includedir ${CMAKE_INSTALL_PREFIX}/include)
|
||||
|
||||
configure_file(${PNG_SOURCE_DIR}/scripts/libpng.pc.in
|
||||
${PNG_BINARY_DIR}/libpng.pc)
|
||||
configure_file(${PNG_SOURCE_DIR}/scripts/libpng-config.in
|
||||
${PNG_BINARY_DIR}/libpng-config)
|
||||
configure_file(${PNG_SOURCE_DIR}/scripts/libpng.pc.in
|
||||
${PNG_BINARY_DIR}/${PNGLIB_NAME}.pc)
|
||||
configure_file(${PNG_SOURCE_DIR}/scripts/libpng-config.in
|
||||
${PNG_BINARY_DIR}/${PNGLIB_NAME}-config)
|
||||
|
||||
# SET UP LINKS
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
||||
# VERSION 0.${PNGLIB_RELEASE}.1.4.0beta19
|
||||
VERSION 0.${PNGLIB_RELEASE}.0
|
||||
SOVERSION 0
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES
|
||||
OUTPUT_NAME ${PNG_LIB_NAME}
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
|
||||
# INSTALL
|
||||
install_targets(/lib ${PNG_LIB_NAME} ${PNG_LIB_NAME_STATIC})
|
||||
install(FILES png.h pngconf.h pngpriv.h pngdefs.h DESTINATION include)
|
||||
install(FILES libpng.3 libpngpf.3 DESTINATION man/man3)
|
||||
install(FILES png.h pngconf.h pngpriv.h pngdefs.h DESTINATION include/${PNGLIB_NAME})
|
||||
install(FILES libpng.3 libpngpf.3 DESTINATION man/man3)
|
||||
install(FILES png.5 DESTINATION man/man5)
|
||||
install(FILES ${PNG_BINARY_DIR}/libpng.pc DESTINATION lib/pkgconfig)
|
||||
install(FILES ${PNG_BINARY_DIR}/libpng-config DESTINATION bin)
|
||||
install(FILES ${PNG_BINARY_DIR}/${PNGLIB_NAME}.pc DESTINATION lib/pkgconfig)
|
||||
install(FILES ${PNG_BINARY_DIR}/${PNGLIB_NAME}-config DESTINATION bin)
|
||||
|
||||
# what's with libpng.txt and all the extra files?
|
||||
|
||||
|
||||
# uninstall
|
||||
# UNINSTALL
|
||||
# do we need this?
|
||||
|
||||
|
||||
# dist
|
||||
# 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
# Modeled after libxml-config.
|
||||
|
||||
version=1.4.0beta18
|
||||
version=1.4.0beta19
|
||||
prefix=""
|
||||
libdir=""
|
||||
libs=""
|
||||
|
||||
@@ -12,9 +12,9 @@ version="@PNGLIB_VERSION@"
|
||||
prefix="@prefix@"
|
||||
exec_prefix="@exec_prefix@"
|
||||
libdir="@libdir@"
|
||||
includedir="@includedir@/libpng@PNGLIB_MAJOR@"
|
||||
libs="-lpng@PNGLIB_MAJOR@"
|
||||
all_libs="-lpng@PNGLIB_MAJOR@ -lz -lm"
|
||||
includedir="@includedir@/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@"
|
||||
libs="-lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@"
|
||||
all_libs="-lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ -lz -lm"
|
||||
I_opts="-I${includedir}"
|
||||
L_opts="-L${libdir}"
|
||||
R_opts=""
|
||||
|
||||
@@ -5,6 +5,6 @@ includedir=@includedir@/libpng14
|
||||
|
||||
Name: libpng
|
||||
Description: Loads and saves PNG files
|
||||
Version: 1.4.0beta18
|
||||
Version: 1.4.0beta19
|
||||
Libs: -L${libdir} -lpng14
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# Library name:
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# Library name:
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -20,7 +20,7 @@ LN_SF = ln -f -s
|
||||
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
prefix=/usr/local
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# Library name:
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -65,7 +65,7 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
CYGDLL = 14
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
SHAREDLIB=cygpng$(CYGDLL).dll
|
||||
|
||||
@@ -19,7 +19,7 @@ ZLIBINC=../zlib
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
# Library name:
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng14
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
@@ -106,7 +106,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config \
|
||||
pngconf.h pngdefs.h
|
||||
|
||||
# Use makefile.gcmmx if you don't want to use the MMX assembler code.
|
||||
# Use makefile.gcmmx if you want to use the MMX assembler code.
|
||||
# If you don't need thread safety you can uncomment the define.
|
||||
pngdefs.h:
|
||||
echo "/* pngdefs.h was built by makefile.gcmmx */" > pngdefs.h
|
||||
|
||||
@@ -18,7 +18,7 @@ ZLIBINC=/opt/zlib/include
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -18,7 +18,7 @@ ZLIBINC=/opt/zlib/include
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -62,7 +62,7 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
MINGDLL = 14
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
SHAREDLIB=libpng$(MINGDLL).dll
|
||||
|
||||
@@ -14,7 +14,7 @@ INCSDIR=${LOCALBASE}/include/libpng14
|
||||
|
||||
LIB= png14
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.4.0beta18
|
||||
SHLIB_MINOR= 1.4.0beta19
|
||||
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
|
||||
|
||||
@@ -13,7 +13,7 @@ INCSDIR=${LOCALBASE}/include/libpng
|
||||
|
||||
LIB= png
|
||||
SHLIB_MAJOR= 3
|
||||
SHLIB_MINOR= 1.4.0beta18
|
||||
SHLIB_MINOR= 1.4.0beta19
|
||||
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
|
||||
|
||||
266
scripts/makefile.nommx
Normal file
266
scripts/makefile.nommx
Normal file
@@ -0,0 +1,266 @@
|
||||
# makefile for libpng.a and libpng14.so on Linux ELF with gcc using MMX
|
||||
# assembler code
|
||||
# Copyright 2002, 2006 Greg Roelofs and Glenn Randers-Pehrson
|
||||
# Copyright 1998-2001 Greg Roelofs
|
||||
# Copyright 1996-1997 Andreas Dilger
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
# CAUTION: Do not use this makefile with gcc versions 2.7.2.2 and earlier.
|
||||
|
||||
# WARNING: The assembler code in pnggccrd.c may not be thread safe.
|
||||
|
||||
# NOTE: When testing MMX performance on a multitasking system, make sure
|
||||
# there are no floating-point programs (e.g., SETI@Home) running in
|
||||
# the background! Context switches between MMX and FPU are expensive.
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
LIBSO=$(LIBNAME).so
|
||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||
OLDSO=libpng.so
|
||||
|
||||
# Utilities:
|
||||
CC = gcc
|
||||
LD = $(CC)
|
||||
AR_RC = ar rc
|
||||
LN_SF = ln -sf
|
||||
MKDIR_P = mkdir -p
|
||||
RANLIB = ranlib
|
||||
RM_F = /bin/rm -f
|
||||
|
||||
# where "make install" puts libpng14.a, libpng14.so*,
|
||||
# libpng14/png.h and libpng14/pngconf.h
|
||||
# Prefix must be a full pathname.
|
||||
prefix=/usr/local
|
||||
exec_prefix=$(prefix)
|
||||
|
||||
# Where the zlib library and include files are located.
|
||||
#ZLIBLIB=/usr/local/lib
|
||||
#ZLIBINC=/usr/local/include
|
||||
ZLIBLIB=../zlib
|
||||
ZLIBINC=../zlib
|
||||
|
||||
ALIGN=
|
||||
# for i386:
|
||||
#ALIGN=-malign-loops=2 -malign-functions=2
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||
|
||||
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
||||
|
||||
CFLAGS= -I$(ZLIBINC) -Wall \
|
||||
-O3 $(ALIGN) -funroll-loops \
|
||||
-fomit-frame-pointer # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
### for gcc 2.95.2 on 686:
|
||||
#CFLAGS= -I$(ZLIBINC) -Wall -O3 \
|
||||
# -mcpu=i686 -malign-double -ffast-math -fstrict-aliasing \
|
||||
# $(ALIGN) -funroll-loops -funroll-all-loops -fomit-frame-pointer
|
||||
### for gcc 2.7.2.3 on 486 and up:
|
||||
#CFLAGS= -I$(ZLIBINC) -Wall -O3 \
|
||||
# -m486 -malign-double -ffast-math \
|
||||
# $(ALIGN) -funroll-loops -funroll-all-loops -fomit-frame-pointer
|
||||
|
||||
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng14 -lz -lm
|
||||
LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
|
||||
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(exec_prefix)/lib
|
||||
MANPATH=$(prefix)/man
|
||||
BINPATH=$(exec_prefix)/bin
|
||||
|
||||
# override DESTDIR= on the make install command line to easily support
|
||||
# installing into a temporary location. Example:
|
||||
#
|
||||
# make install DESTDIR=/tmp/build/libpng
|
||||
#
|
||||
# If you're going to install into a temporary location
|
||||
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||
# you execute make install.
|
||||
DESTDIR=
|
||||
|
||||
DB=$(DESTDIR)$(BINPATH)
|
||||
DI=$(DESTDIR)$(INCPATH)
|
||||
DL=$(DESTDIR)$(LIBPATH)
|
||||
DM=$(DESTDIR)$(MANPATH)
|
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||
pngwtran.o pngmem.o pngerror.o pngpread.o pnggccrd.o
|
||||
|
||||
OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config \
|
||||
pngconf.h pngdefs.h
|
||||
|
||||
# Use makefile.gcmmx if you want to use the MMX assembler code.
|
||||
pngdefs.h:
|
||||
echo "/* pngdefs.h was built by makefile.nommx */" > pngdefs.h
|
||||
echo "#define PNG_NO_MMX_CODE" >> pngdefs.h
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
$(AR_RC) $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.pc:
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||
|
||||
libpng-config:
|
||||
( cat scripts/libpng-config-head.in; \
|
||||
echo prefix=\"$(prefix)\"; \
|
||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||
echo cppflags=""; \
|
||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
||||
echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
|
||||
echo libs=\"-lpng14 -lz -lm\"; \
|
||||
cat scripts/libpng-config-body.in ) > libpng-config
|
||||
chmod +x libpng-config
|
||||
|
||||
pnggccrd.o: pnggccrd.c png.h pngconf.h
|
||||
$(CC) -c $(CFLAGS) -o $@ $*.c
|
||||
|
||||
pnggccrd.pic.o: pnggccrd.c png.h pngconf.h
|
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ pnggccrd.c
|
||||
|
||||
$(LIBSO): $(LIBSOMAJ)
|
||||
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
|
||||
|
||||
$(LIBSOMAJ): $(LIBSOVER)
|
||||
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ)
|
||||
|
||||
$(LIBSOVER): $(OBJSDLL)
|
||||
$(CC) -shared -Wl,-soname,$(LIBSOMAJ) \
|
||||
-o $(LIBSOVER) \
|
||||
$(OBJSDLL)
|
||||
|
||||
pngtest: pngtest.o $(LIBSO)
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
pngtest-static: pngtest.o libpng.a
|
||||
$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
|
||||
|
||||
test: pngtest pngtest-static
|
||||
@echo ""
|
||||
@echo " Running pngtest dynamically linked with $(LIBSO):"
|
||||
@echo ""
|
||||
./pngtest
|
||||
@echo ""
|
||||
@echo " Running pngtest statically linked with libpng.a:"
|
||||
@echo ""
|
||||
./pngtest-static
|
||||
|
||||
install-headers: png.h pngconf.h pngdefs.h
|
||||
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
|
||||
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h pngdefs.h $(DI)/$(LIBNAME)
|
||||
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h \
|
||||
$(DI)/$(LIBNAME)/pngdefs.h
|
||||
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pngdefs.h
|
||||
-@$(RM_F) $(DI)/libpng
|
||||
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
|
||||
cp libpng.a $(DL)/$(LIBNAME).a
|
||||
chmod 644 $(DL)/$(LIBNAME).a
|
||||
-@$(RM_F) $(DL)/libpng.a
|
||||
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
|
||||
|
||||
install-shared: install-headers $(LIBSOVER) libpng.pc
|
||||
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
|
||||
-@$(RM_F) $(DL)/$(LIBSOVER)* $(DL)/$(LIBSO)
|
||||
-@$(RM_F) $(DL)/$(LIBSOMAJ)
|
||||
-@$(RM_F) $(DL)/$(OLDSO)
|
||||
cp $(LIBSOVER) $(DL)
|
||||
chmod 755 $(DL)/$(LIBSOVER)
|
||||
(cd $(DL); \
|
||||
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ); \
|
||||
$(LN_SF) $(LIBSOMAJ) $(LIBSO); \
|
||||
$(LN_SF) $(OLDSO) $(LIBSO))
|
||||
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
|
||||
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
|
||||
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
|
||||
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
|
||||
|
||||
install-man: libpng.3 libpngpf.3 png.5
|
||||
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
|
||||
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
|
||||
-@$(RM_F) $(DM)/man3/libpng.3
|
||||
-@$(RM_F) $(DM)/man3/libpngpf.3
|
||||
cp libpng.3 $(DM)/man3
|
||||
cp libpngpf.3 $(DM)/man3
|
||||
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
|
||||
-@$(RM_F) $(DM)/man5/png.5
|
||||
cp png.5 $(DM)/man5
|
||||
|
||||
install-config: libpng-config
|
||||
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
|
||||
-@$(RM_F) $(DB)/libpng-config
|
||||
-@$(RM_F) $(DB)/$(LIBNAME)-config
|
||||
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||
chmod 755 $(DB)/$(LIBNAME)-config
|
||||
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
|
||||
|
||||
install: install-static install-shared install-man install-config
|
||||
|
||||
# If you installed in $(DESTDIR), test-installed won't work until you
|
||||
# move the library to its final location. Use test-dd to test it
|
||||
# before then.
|
||||
|
||||
test-dd:
|
||||
echo
|
||||
echo Testing installed dynamic shared library in $(DL).
|
||||
$(CC) -I$(DI) -I$(ZLIBINC) \
|
||||
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
|
||||
-L$(DL) -L$(ZLIBLIB) -Wl, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
|
||||
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
|
||||
./pngtestd pngtest.png
|
||||
|
||||
test-installed:
|
||||
$(CC) -I$(ZLIBINC) \
|
||||
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
|
||||
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
|
||||
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
|
||||
./pngtesti pngtest.png
|
||||
|
||||
clean:
|
||||
$(RM_F) *.o libpng.a pngtest pngout.png libpng-config pngdefs.h \
|
||||
$(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \
|
||||
libpng.pc
|
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||
writelock:
|
||||
chmod a-w *.[ch35] $(DOCS) scripts/*
|
||||
|
||||
png.o png.pic.o: png.h pngconf.h pngdefs.h pngpriv.h png.c
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngerror.c
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngrio.c
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngwio.c
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngmem.c
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngset.c
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngget.c
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngread.c
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngrtran.c
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngrutil.c
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngtrans.c
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngwrite.c
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngwtran.c
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngwutil.c
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngdefs.h pngpriv.h pngpread.c
|
||||
|
||||
pngtest.o: png.h pngconf.h pngdefs.h pngtest.c
|
||||
@@ -8,7 +8,7 @@ LIBDIR= ${PREFIX}/lib
|
||||
MANDIR= ${PREFIX}/man/cat
|
||||
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.4.0beta18
|
||||
SHLIB_MINOR= 1.4.0beta19
|
||||
|
||||
LIB= png
|
||||
SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# Library name:
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# Library name:
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
# Library name:
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng14
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta18
|
||||
PNGMIN = 1.4.0beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
; PNG.LIB module definition file for OS/2
|
||||
;----------------------------------------
|
||||
|
||||
; Version 1.4.0beta18
|
||||
; Version 1.4.0beta19
|
||||
|
||||
LIBRARY PNG
|
||||
DESCRIPTION "PNG image compression library for OS/2"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
LIBRARY
|
||||
|
||||
EXPORTS
|
||||
;Version 1.4.0beta18
|
||||
;Version 1.4.0beta19
|
||||
png_build_grayscale_palette
|
||||
png_chunk_error
|
||||
png_chunk_warning
|
||||
|
||||
Reference in New Issue
Block a user