pkgsrc/graphics/png/patches/patch-aa
fredb 75f1730606 Update to version 1.2.4. Two new functions since 1.2.1, png_malloc_warn()
and png_set_text_2(), call for a minor version bump in the shared library.
Update "BUILDLINK_DEPENDS" to current level. Also make the shared library
versions visible in the top-level "Makefile", and add a top-level "test"
target to invoke "pngtest" in ${WRKSRC}.

The following is culled from the extensive "CHANGES" file, ommitting
all make system and doc changes, and some bug fixes for bugs that weren't
present in 1.2.1. See "CHANGES" for complete details:

  Added setjmp() at the end of png_create_*_struct_2() in case user forgets
    to put one in their application.
  Exported png_zalloc(), png_zfree(), png_default_read(), png_default_write(),
    png_default_flush(), and png_push_fill_buffer() and included them in
    module definition files.
  Revised prototype for png_default_flush()
  Typos in *.def files (png_default_read|write -> png_default_read|write_data)
  Once more restored png_zalloc and png_zfree to regular nonexported form.
  Restored png_default_read|write_data, png_default_flush, png_read_fill_buffer
    to nonexported form, but with PNGAPI, and removed them from module def files.
  Removed "PNGAPI" from png_zalloc() and png_zfree() in png.c
  Plugged various memory leaks; added png_malloc_warn() and png_set_text_2()
    functions.
  Plugged memory leak of png_ptr->current_text (Matt Holgate).
  Check for buffer overflow before reading CRC in pngpread.c (Warwick Allison)
  Plugged memory leak of row_buf in pngtest.c when there is a png_error().
  Detect buffer overflow in pngpread.c when IDAT is corrupted with extra data.
  Changed png_warning() to png_error() when width is too large to process.
2002-07-19 14:33:08 +00:00

66 lines
1.9 KiB
Text

$NetBSD: patch-aa,v 1.19 2002/07/19 14:33:09 fredb Exp $
--- scripts/makefile.std.orig Thu May 23 08:29:59 2002
+++ scripts/makefile.std
@@ -4,7 +4,7 @@
# For conditions of distribution and use, see copyright notice in png.h
# where make install puts libpng.a and png.h
-prefix=/usr/local
+prefix=${PREFIX}
INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib
@@ -24,9 +24,9 @@
ZLIBLIB=../zlib
ZLIBINC=../zlib
-CC=cc
-CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
-LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
+CC=${LIBTOOL} --mode=compile $(REALCC)
+#CFLAGS+=-O # -g -DPNG_DEBUG=5
+#LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
#RANLIB=echo
RANLIB=ranlib
@@ -35,31 +35,20 @@
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
-all: libpng.a pngtest
+all: libpng.la pngtest
-libpng.a: $(OBJS)
- ar rc $@ $(OBJS)
- $(RANLIB) $@
+libpng.la: $(OBJS)
+ ${LIBTOOL} --mode=link $(REALCC) -o $@ ${OBJS:.o=.lo} -rpath $(LIBPATH) ${LDFLAGS} -lz -lm -version-info ${LIBPNG_SO_MAJOR}:${LIBPNG_SO_MINOR}
-pngtest: pngtest.o libpng.a
- $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
+pngtest: pngtest.o libpng.la
+ ${LIBTOOL} --mode=link $(REALCC) -o pngtest $(CFLAGS) pngtest.o ${LDFLAGS} libpng.la -lz -lm
test: pngtest
./pngtest
-install: libpng.a
- -@mkdir $(DESTDIR)$(INCPATH)
- -@mkdir $(DESTDIR)$(INCPATH)/libpng
- -@mkdir $(DESTDIR)$(LIBPATH)
- -@rm -f $(DESTDIR)$(INCPATH)/png.h
- -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
- cp png.h $(DESTDIR)$(INCPATH)/libpng
- cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
- (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
- cp libpng.a $(DESTDIR)$(LIBPATH)
- chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
+install: libpng.la
+ ${BSD_INSTALL_DATA} png.h pngconf.h $(INCPATH)
+ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} libpng.la $(LIBPATH)
clean:
rm -f *.o libpng.a pngtest pngout.png