Use <bsd.lib.mk>

Submitted by:	ru
This commit is contained in:
Andrey A. Chernov 2002-05-17 12:39:49 +00:00
parent 7446953ac7
commit a66792d6db
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=59335
3 changed files with 55 additions and 38 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= png
PORTVERSION= 1.2.2
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= graphics
MASTER_SITES= http://www.libpng.org/pub/png/src/ \
ftp://swrinde.nde.swri.edu/pub/png/src/ \
@ -29,6 +29,7 @@ PLIST_SUB= SHLIB_VER="${SHLIB_VER}"
MAN3= libpng.3 libpngpf.3
MAN5= png.5
MANCOMPRESSED= maybe
.include <bsd.port.pre.mk>
@ -36,4 +37,10 @@ post-extract:
# Please don't delete the following line - this link used by ghostscript* ports
@${LN} -sf ${WRKSRC} ${WRKDIR}/libpng
post-patch:
${CP} ${FILESDIR}/makefile.freebsd ${WRKSRC}/scripts/
pre-install:
@[ -d ${PREFIX}/include/libpng ] || ${MKDIR} ${PREFIX}/include/libpng
.include <bsd.port.post.mk>

View File

@ -0,0 +1,47 @@
# makefile for libpng under FreeBSD
# Copyright (C) 2002 Glenn Randers-Pehrson and Andrey A. Chernov
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# For conditions of distribution and use, see copyright notice in png.h
PREFIX?= /usr/local
SHLIB_VER?= 5
LIB= png
SHLIB_MAJOR= ${SHLIB_VER}
SHLIB_MINOR= 0
NOPROFILE= YES
NOOBJ= YES
# where make install puts libpng.a and png.h
DESTDIR= ${PREFIX}
LIBDIR= /lib
INCS= png.h pngconf.h
INCSDIR= /include/libpng
INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk
MAN= libpng.3 libpngpf.3 png.5
MANDIR= /man/man
SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \
libpng/pngconf.h ${INCSDIR}/../pngconf.h
CFLAGS+= -I. -DPNG_USE_PNGGCCRD
.if (${ARCH} != "i386")
CFLAGS+= -DPNG_NO_ASSEMBLER_CODE
.endif
SRCS= 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 pnggccrd.c
pngtest: pngtest.o libpng.a
${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lpng -lz -lm
CLEANFILES= pngtest pngtest.o pngout.png
test: pngtest
./pngtest
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
writelock:
chmod a-w *.[ch35] $(DOCS) scripts/*
.include <bsd.lib.mk>

View File

@ -1,37 +0,0 @@
--- scripts/makefile.freebsd.orig Mon Apr 15 18:11:36 2002
+++ scripts/makefile.freebsd Sun Apr 21 20:03:05 2002
@@ -3,11 +3,13 @@
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# For conditions of distribution and use, see copyright notice in png.h
+.include <bsd.own.mk>
+
# where make install puts libpng.a and png.h
-prefix=/usr/local
+prefix=${PREFIX}
-PNGMAJ= 5
-.if (${OBJFORMAT} == "elf")
+PNGMAJ= $(SHLIB_VER)
+.if (${PORTOBJFORMAT} == "elf")
PNGVER= $(PNGMAJ)
.else
PNGMIN= 0
@@ -15,7 +17,7 @@
.endif
CFLAGS+= -I. -DPNG_USE_PNGGCCRD
-.if (${MACHINE_ARCH} != "i386")
+.if (${ARCH} != "i386")
CFLAGS+= -DPNG_NO_ASSEMBLER_CODE
.endif
LDFLAGS+=-L. -lpng -lz -lm -static
@@ -36,7 +38,7 @@
$(RANLIB) $@
libpng.so.${PNGVER}: $(OBJS:S/o$/so/g)
-.if (${OBJFORMAT} == "elf")
+.if (${PORTOBJFORMAT} == "elf")
${CC} -shared -Wl,-x,-soname,$@ -o $@ $(OBJS:S/o$/so/g) -lz -lm
.else
${CC} -shared -Wl,-x -o $@ $(OBJS:S/o$/so/g) -lz -lm