revert switch to libtool, use "cc -shared" to create shared libraries

This commit is contained in:
brad 2000-09-16 11:44:22 +00:00
parent 382dcecb78
commit 107abfb98e
9 changed files with 134 additions and 192 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.27 2000/07/01 02:00:52 brad Exp $
# $OpenBSD: Makefile,v 1.28 2000/09/16 11:44:22 brad Exp $
DISTNAME= bzip2-1.0.1
CATEGORIES= archivers
@ -15,13 +15,16 @@ PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
USE_LIBTOOL= Yes
MAKE_FLAGS= PREFIX="${PREFIX}" CC="${CC}" \
CFLAGS="${CFLAGS} -Wall -Winline -fomit-frame-pointer \
-fno-strength-reduce"
FAKE_FLAGS= PREFIX="${PREFIX}" DESTDIR="${WRKINST}"
MAKE_FLAGS= CC="${CC}" CFLAGS="${CFLAGS} -Wall -Winline \
-fomit-frame-pointer -fno-strength-reduce"
FAKE_FLAGS+= ${MAKE_FLAGS} PREFIX="${PREFIX}" DESTDIR="${WRKINST}"
test: build
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} -f ${MAKE_FILE} test
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} LD_LIBRARY_PATH="${WRKSRC}" \
${MAKE} ${MAKE_FLAGS} -f ${MAKE_FILE} test
.include <bsd.port.mk>
.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes"
MAKE_ENV= NO_SHARED_LIBS=Yes
.endif

View File

@ -1,42 +1,38 @@
--- Makefile.orig Fri Jun 23 16:34:47 2000
+++ Makefile Thu Sep 14 09:42:55 2000
@@ -3,6 +3,7 @@
CC=gcc
+++ Makefile Sat Sep 16 06:15:02 2000
@@ -4,6 +4,8 @@
BIGFILES=-D_FILE_OFFSET_BITS=64
CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES)
+LIBTOOL=libtool --quiet
+SHLIB= libbz2.so.10.1
+
OBJS= blocksort.o \
huffman.o \
@@ -12,86 +13,73 @@
crctable.o \
@@ -11,10 +13,17 @@
compress.o \
decompress.o \
bzlib.o
+SHOBJS= $(OBJS:.o=.so)
-all: libbz2.a bzip2 bzip2recover test
+all: libbz2.la bzip2 bzip2recover
+.SUFFIXES: .o .so
-bzip2: libbz2.a bzip2.o
- $(CC) $(CFLAGS) -o bzip2 bzip2.o -L. -lbz2
+bzip2: libbz2.la bzip2.o
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o bzip2 bzip2.lo libbz2.la
+.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes"
+all: libbz2.a bzip2 bzip2recover
bzip2: libbz2.a bzip2.o
+.else
+all: libbz2.a $(SHLIB) bzip2 bzip2recover
+bzip2: libbz2.a $(SHLIB) bzip2.o
+.endif
$(CC) $(CFLAGS) -o bzip2 bzip2.o -L. -lbz2
bzip2recover: bzip2recover.o
- $(CC) $(CFLAGS) -o bzip2recover bzip2recover.o
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o bzip2recover bzip2recover.lo
@@ -29,49 +38,50 @@
ranlib libbz2.a ; \
fi
-libbz2.a: $(OBJS)
- rm -f libbz2.a
- ar cq libbz2.a $(OBJS)
- @if ( test -f /usr/bin/ranlib -o -f /bin/ranlib -o \
- -f /usr/ccs/bin/ranlib ) ; then \
- echo ranlib libbz2.a ; \
- ranlib libbz2.a ; \
- fi
+libbz2.la: $(OBJS)
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o libbz2.la $(OBJS:.o=.lo) \
+ -version-info 10:1:0 -rpath $(PREFIX)/lib
test: bzip2
-test: bzip2
- @cat words1
- ./bzip2 -1 < sample1.ref > sample1.rb2
- ./bzip2 -2 < sample2.ref > sample2.rb2
@ -51,8 +47,11 @@
- cmp sample2.tst sample2.ref
- cmp sample3.tst sample3.ref
- @cat words3
-
+$(SHLIB): $(SHOBJS)
+ $(CC) -shared -o $(SHLIB) $(SHOBJS)
-PREFIX=/usr
+test: bzip2
+ ./bzip2 -1 < sample1.ref > sample1.rb2 || exit 1
+ ./bzip2 -2 < sample2.ref > sample2.rb2 || exit 1
+ ./bzip2 -3 < sample3.ref > sample3.rb2 || exit 1
@ -91,51 +90,28 @@
+ if ( test ! -d $(DESTDIR)$(PREFIX)/man ) ; then $(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(PREFIX)/man ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/man/man1 ) ; then $(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(PREFIX)/man/man1 ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/include ) ; then $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(PREFIX)/include ; fi
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) bzip2 $(DESTDIR)$(PREFIX)/bin
+ $(BSD_INSTALL_PROGRAM) bzip2 $(DESTDIR)$(PREFIX)/bin
+ @cd $(DESTDIR)$(PREFIX)/bin; ln -fs bzip2 bunzip2; \
+ ln -fs bzip2 bzcat
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) bzip2recover $(DESTDIR)$(PREFIX)/bin
+ $(BSD_INSTALL_PROGRAM) bzip2recover $(DESTDIR)$(PREFIX)/bin
+ $(BSD_INSTALL_MAN) bzip2.1 $(DESTDIR)$(PREFIX)/man/man1
+ $(BSD_INSTALL_MAN) bzip2.1 $(DESTDIR)$(PREFIX)/man/man1/bunzip2.1
+ $(BSD_INSTALL_MAN) bzip2.1 $(DESTDIR)$(PREFIX)/man/man1/bzcat.1
+ $(BSD_INSTALL_MAN) bzip2.1 $(DESTDIR)$(PREFIX)/man/man1/bzip2recover.1
+ $(BSD_INSTALL_DATA) bzlib.h $(DESTDIR)$(PREFIX)/include
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_DATA) libbz2.la $(DESTDIR)$(PREFIX)/lib
+ $(BSD_INSTALL_DATA) libbz2.a $(DESTDIR)$(PREFIX)/lib
+ @if [ -f $(SHLIB) ]; then \
+ $(BSD_INSTALL_DATA) $(SHLIB) $(DESTDIR)$(PREFIX)/lib; \
+ fi
clean:
- rm -f *.o libbz2.a bzip2 bzip2recover \
+ rm -f *.o *.lo libbz2.a libbz2.so.* bzip2 bzip2recover \
+ rm -f *.o *.so libbz2.a $(SHLIB) bzip2 bzip2recover \
sample1.rb2 sample2.rb2 sample3.rb2 \
sample1.tst sample2.tst sample3.tst
+
+.c.so:
+ $(CC) $(CFLAGS) -fpic -DPIC -c $? -o $@
blocksort.o: blocksort.c
@cat words0
- $(CC) $(CFLAGS) -c blocksort.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c blocksort.c
huffman.o: huffman.c
- $(CC) $(CFLAGS) -c huffman.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c huffman.c
crctable.o: crctable.c
- $(CC) $(CFLAGS) -c crctable.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c crctable.c
randtable.o: randtable.c
- $(CC) $(CFLAGS) -c randtable.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c randtable.c
compress.o: compress.c
- $(CC) $(CFLAGS) -c compress.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c compress.c
decompress.o: decompress.c
- $(CC) $(CFLAGS) -c decompress.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c decompress.c
bzlib.o: bzlib.c
- $(CC) $(CFLAGS) -c bzlib.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c bzlib.c
bzip2.o: bzip2.c
- $(CC) $(CFLAGS) -c bzip2.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c bzip2.c
bzip2recover.o: bzip2recover.c
- $(CC) $(CFLAGS) -c bzip2recover.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c bzip2recover.c
DISTNAME=bzip2-1.0.1
tarfile:

View File

@ -1,11 +1,10 @@
@comment $OpenBSD: PLIST,v 1.10 2000/06/25 03:56:58 brad Exp $
@comment $OpenBSD: PLIST,v 1.11 2000/09/16 11:44:23 brad Exp $
bin/bunzip2
bin/bzcat
bin/bzip2
bin/bzip2recover
include/bzlib.h
lib/libbz2.a
lib/libbz2.la
%%SHARED%%
man/man1/bunzip2.1
man/man1/bzcat.1

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.25 2000/09/08 21:32:55 brad Exp $
# $OpenBSD: Makefile,v 1.26 2000/09/16 11:44:47 brad Exp $
# $FreeBSD: Makefile,v 1.5 1998/06/25 03:13:16 vanilla Exp $
DISTNAME= gd-1.8.3
@ -19,7 +19,6 @@ PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
USE_LIBTOOL= Yes
MAKE_FLAGS= COMPILER="${CC}" prefix="${PREFIX}"
FAKE_FLAGS= DESTDIR="${WRKINST}"
@ -28,17 +27,17 @@ FLAVOR?=
.if ${FLAVOR:L} == "no_x11"
MAKE_FLAGS+= CFLAGS="${CFLAGS} -DHAVE_JPEG" \
LIBS="libgd.la -lm -lpng -ljpeg -lz" \
INCLUDEDIRS="-I. -I/usr/local/include" \
LIBDIRS="-L/usr/local/lib"
INCLUDEDIRS="-I. -I${LOCALBASE}/include" \
LIBS="-lgd -lm -lpng -ljpeg -lz" \
LIBDIRS="-L. -L${LOCALBASE}/lib"
FAKE_FLAGS+= ${MAKE_FLAGS}
.else
LIB_DEPENDS+= ttf.1.3::print/freetype
USE_X11= Yes
MAKE_FLAGS+= CFLAGS="${CFLAGS} -DHAVE_XPM -DHAVE_JPEG -DHAVE_LIBTTF" \
LIBS="libgd.la -lm -lpng -lz -ljpeg -lttf -lXpm -lX11" \
INCLUDEDIRS="-I. -I/usr/local/include -I/usr/X11R6/include -I/usr/X11R6/include/X11" \
LIBDIRS="-L/usr/local/lib -L/usr/X11R6/lib"
INCLUDEDIRS="-I. -I${LOCALBASE}/include -I${X11BASE}/include -I${X11BASE}/include/X11" \
LIBS="-lgd -lm -lpng -lz -ljpeg -lttf -lXpm -lX11" \
LIBDIRS="-L. -L${LOCALBASE}/lib -L${X11BASE}/lib"
FAKE_FLAGS+= ${MAKE_FLAGS}
.endif
@ -49,3 +48,7 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/index.html ${PREFIX}/share/examples/gd
.include <bsd.port.mk>
.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes"
MAKE_ENV= NO_SHARED_LIBS=Yes
.endif

View File

@ -1,5 +1,5 @@
--- Makefile.orig Sat Jun 3 15:26:12 2000
+++ Makefile Thu Sep 14 09:55:01 2000
+++ Makefile Sat Sep 16 06:47:35 2000
@@ -51,13 +51,13 @@
LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib
@ -17,21 +17,16 @@
#
#
@@ -69,77 +69,75 @@
CC=$(COMPILER) $(INCLUDEDIRS)
LINK=$(CC) $(LIBDIRS) $(LIBS)
+LIBTOOL=libtool --quiet
PROGRAMS=$(BIN_PROGRAMS) $(TEST_PROGRAMS)
@@ -75,26 +75,35 @@
BIN_PROGRAMS=pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng
TEST_PROGRAMS=gdtest gddemo gd2time gdtestttf
-all: libgd.a $(PROGRAMS)
+all: libgd.la $(PROGRAMS)
+SHLIB= libgd.so.18.3
-install: libgd.a $(BIN_PROGRAMS)
+.if defined(NO_SHARED_LIB) && ${NO_SHARED_LIB:L} == "yes"
+all: libgd.a $(PROGRAMS)
install: libgd.a $(BIN_PROGRAMS)
- sh ./install-item 644 libgd.a $(INSTALL_LIB)/libgd.a
- sh ./install-item 755 pngtogd $(INSTALL_BIN)/pngtogd
- sh ./install-item 755 pngtogd2 $(INSTALL_BIN)/pngtogd2
@ -49,43 +44,22 @@
- sh ./install-item 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
- sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
- sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
-
-gddemo: gddemo.o libgd.a
- $(CC) gddemo.o -o gddemo $(LIBDIRS) $(LIBS)
-
-pngtogd: pngtogd.o libgd.a
- $(CC) pngtogd.o -o pngtogd $(LIBDIRS) $(LIBS)
-
-webpng: webpng.o libgd.a
- $(CC) webpng.o -o webpng $(LIBDIRS) $(LIBS)
-
-pngtogd2: pngtogd2.o libgd.a
- $(CC) pngtogd2.o -o pngtogd2 $(LIBDIRS) $(LIBS)
-
-gdtopng: gdtopng.o libgd.a
- $(CC) gdtopng.o -o gdtopng $(LIBDIRS) $(LIBS)
-
-gd2topng: gd2topng.o libgd.a
- $(CC) gd2topng.o -o gd2topng $(LIBDIRS) $(LIBS)
-
-gd2copypal: gd2copypal.o libgd.a
- $(CC) gd2copypal.o -o gd2copypal $(LIBDIRS) $(LIBS)
-
-gdparttopng: gdparttopng.o libgd.a
- $(CC) gdparttopng.o -o gdparttopng $(LIBDIRS) $(LIBS)
-
-gdtest: gdtest.o libgd.a
- $(CC) gdtest.o -o gdtest $(LIBDIRS) $(LIBS)
+install: libgd.la $(BIN_PROGRAMS)
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_DATA) libgd.la $(DESTDIR)$(INSTALL_LIB)
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) pngtogd $(DESTDIR)$(INSTALL_BIN)
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) pngtogd2 $(DESTDIR)$(INSTALL_BIN)
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) gdtopng $(DESTDIR)$(INSTALL_BIN)
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) gd2topng $(DESTDIR)$(INSTALL_BIN)
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) gd2copypal $(DESTDIR)$(INSTALL_BIN)
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) gdparttopng $(DESTDIR)$(INSTALL_BIN)
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) webpng $(DESTDIR)$(INSTALL_BIN)
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) bdftogd $(DESTDIR)$(INSTALL_BIN)
+.else
+all: libgd.a $(SHLIB) $(PROGRAMS)
+install: libgd.a $(SHLIB) $(BIN_PROGRAMS)
+.endif
+ $(BSD_INSTALL_DATA) libgd.a $(DESTDIR)$(INSTALL_LIB)
+ @if [ -f $(SHLIB) ]; then \
+ $(BSD_INSTALL_DATA) $(SHLIB) $(DESTDIR)$(INSTALL_LIB); \
+ fi
+ $(BSD_INSTALL_PROGRAM) pngtogd $(DESTDIR)$(INSTALL_BIN)
+ $(BSD_INSTALL_PROGRAM) pngtogd2 $(DESTDIR)$(INSTALL_BIN)
+ $(BSD_INSTALL_PROGRAM) gdtopng $(DESTDIR)$(INSTALL_BIN)
+ $(BSD_INSTALL_PROGRAM) gd2topng $(DESTDIR)$(INSTALL_BIN)
+ $(BSD_INSTALL_PROGRAM) gd2copypal $(DESTDIR)$(INSTALL_BIN)
+ $(BSD_INSTALL_PROGRAM) gdparttopng $(DESTDIR)$(INSTALL_BIN)
+ $(BSD_INSTALL_PROGRAM) webpng $(DESTDIR)$(INSTALL_BIN)
+ $(BSD_INSTALL_PROGRAM) bdftogd $(DESTDIR)$(INSTALL_BIN)
+ $(BSD_INSTALL_DATA) gd.h $(DESTDIR)$(INSTALL_INCLUDE)
+ $(BSD_INSTALL_DATA) gdcache.h $(DESTDIR)$(INSTALL_INCLUDE)
+ $(BSD_INSTALL_DATA) gd_io.h $(DESTDIR)$(INSTALL_INCLUDE)
@ -94,46 +68,15 @@
+ $(BSD_INSTALL_DATA) gdfontmb.h $(DESTDIR)$(INSTALL_INCLUDE)
+ $(BSD_INSTALL_DATA) gdfonts.h $(DESTDIR)$(INSTALL_INCLUDE)
+ $(BSD_INSTALL_DATA) gdfontt.h $(DESTDIR)$(INSTALL_INCLUDE)
+
+gddemo: gddemo.o libgd.la
+ $(LIBTOOL) --mode=link $(CC) gddemo.lo -o gddemo $(LIBDIRS) $(LIBS)
+
+pngtogd: pngtogd.o libgd.la
+ $(LIBTOOL) --mode=link $(CC) pngtogd.lo -o pngtogd $(LIBDIRS) $(LIBS)
+
+webpng: webpng.o libgd.la
+ $(LIBTOOL) --mode=link $(CC) webpng.lo -o webpng $(LIBDIRS) $(LIBS)
+
+pngtogd2: pngtogd2.o libgd.la
+ $(LIBTOOL) --mode=link $(CC) pngtogd2.lo -o pngtogd2 $(LIBDIRS) $(LIBS)
+
+gdtopng: gdtopng.o libgd.la
+ $(LIBTOOL) --mode=link $(CC) gdtopng.lo -o gdtopng $(LIBDIRS) $(LIBS)
+
+gd2topng: gd2topng.o libgd.la
+ $(LIBTOOL) --mode=link $(CC) gd2topng.lo -o gd2topng $(LIBDIRS) $(LIBS)
+
+gd2copypal: gd2copypal.o libgd.la
+ $(LIBTOOL) --mode=link $(CC) gd2copypal.lo -o gd2copypal $(LIBDIRS) $(LIBS)
+
+gdparttopng: gdparttopng.o libgd.la
+ $(LIBTOOL) --mode=link $(CC) gdparttopng.lo -o gdparttopng $(LIBDIRS) $(LIBS)
+
+gdtest: gdtest.o libgd.la
+ $(LIBTOOL) --mode=link $(CC) gdtest.lo -o gdtest $(LIBDIRS) $(LIBS)
-gd2time: gd2time.o libgd.a
- $(CC) gd2time.o -o gd2time $(LIBDIRS) $(LIBS)
+gd2time: gd2time.o libgd.la
+ $(LIBTOOL) --mode=link $(CC) gd2time.lo -o gd2time $(LIBDIRS) $(LIBS)
-gdtestttf: gdtestttf.o libgd.a
- $(CC) gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
+gdtestttf: gdtestttf.o libgd.la
+ $(LIBTOOL) --mode=link $(CC) gdtestttf.lo -o gdtestttf $(LIBDIRS) $(LIBS)
gddemo: gddemo.o libgd.a
$(CC) gddemo.o -o gddemo $(LIBDIRS) $(LIBS)
@@ -129,17 +138,21 @@
gdtestttf: gdtestttf.o libgd.a
$(CC) gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
-libgd.a: gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
+libgd.la: gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
+OBJS= gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o \
- gdfontg.o gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o \
- gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h gdfontg.h
@ -144,12 +87,19 @@
- gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o
- -ranlib libgd.a
+ gdfontg.o gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o libgd.la $(.ALLSRC:.o=.lo) \
+ -version-info 18:3:0 -rpath $(INSTALL_LIB)
+SHOBJS= $(OBJS:.o=.so)
+
+.SUFFIXES: .o .so
+
+libgd.a: $(OBJS)
+ $(AR) rc libgd.a $(OBJS)
+$(SHLIB): $(SHOBJS)
+ $(CC) -shared -o $(SHLIB) $(SHOBJS)
+
clean:
- rm -f *.o *.a ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp
+ rm -f *.o *.lo ${PROGRAMS} libgd.a test/gdtest.jpg test/gdtest.wbmp
+ rm -f *.o *.so ${PROGRAMS} libgd.a $(SHLIB) test/gdtest.jpg test/gdtest.wbmp
+.c.o:
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $(.IMPSRC)
+.c.so:
+ $(CC) $(CFLAGS) -fpic -DPIC -c $? -o $@

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.8 2000/06/22 06:18:39 brad Exp $
@comment $OpenBSD: PLIST,v 1.9 2000/09/16 11:44:48 brad Exp $
bin/bdftogd
bin/pngtogd
bin/pngtogd2
@ -16,7 +16,6 @@ include/gdfontmb.h
include/gdfontl.h
include/gdfontg.h
lib/libgd.a
lib/libgd.la
%%SHARED%%
share/examples/gd/demoin.png
share/examples/gd/demoout.png

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.24 2000/07/25 08:56:14 brad Exp $
# $OpenBSD: Makefile,v 1.25 2000/09/16 11:45:25 brad Exp $
DISTNAME= libpng-1.0.8
PKGNAME= png-1.0.8
@ -17,8 +17,8 @@ PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
USE_LIBTOOL= Yes
MAKE_FLAGS= CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="libpng.la -lz -lm"
MAKE_FLAGS= CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="-L. -lpng -lz -lm"
FAKE_FLAGS+= ${MAKE_FLAGS}
MAKE_FILE= scripts/makefile.std
@ -33,3 +33,7 @@ test: build
@cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} -f ${MAKE_FILE} test
.include <bsd.port.mk>
.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes"
MAKE_ENV= NO_SHARED_LIBS=Yes
.endif

View File

@ -1,6 +1,6 @@
--- scripts/makefile.std.orig Wed Dec 8 18:44:40 1999
+++ scripts/makefile.std Thu Sep 14 05:32:12 2000
@@ -8,12 +8,11 @@
+++ scripts/makefile.std Sat Sep 16 07:36:49 2000
@@ -8,8 +8,6 @@
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
@ -9,33 +9,35 @@
CC=cc
CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
+LIBTOOL=libtool --quiet
#RANLIB=echo
RANLIB=ranlib
@@ -22,30 +21,29 @@
@@ -21,31 +19,45 @@
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
+SHOBJS = $(OBJS:.o=.so)
+.c.o:
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $(.IMPSRC)
-all: libpng.a pngtest
+.SUFFIXES: .o .so
+
all: libpng.a pngtest
+.c.so:
+ $(CC) $(CFLAGS) -fpic -DPIC -c $? -o $@
+
+SHLIB= libpng.so.1.8
libpng.a: $(OBJS)
- ar rc $@ $(OBJS)
- $(RANLIB) $@
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o libpng.la $(OBJS:.o=.lo) \
+ -version-info 1:8:0 -rpath $(prefix)/lib
ar rc $@ $(OBJS)
$(RANLIB) $@
+$(SHLIB): $(SHOBJS)
+ $(CC) -shared -o $(SHLIB) $(SHOBJS)
+
pngtest: pngtest.o libpng.a
- $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
+ $(LIBTOOL) --mode=link $(CC) -o pngtest $(CFLAGS) pngtest.lo $(LDFLAGS)
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
test: pngtest
./pngtest
+.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes"
+all: libpng.a pngtest
install: libpng.a
- -@mkdir $(prefix)/include
- -@mkdir $(prefix)/lib
@ -45,14 +47,21 @@
- chmod 644 $(prefix)/include/pngconf.h
- cp libpng.a $(prefix)/lib
- chmod 644 $(prefix)/lib/libpng.a
+.else
+all: libpng.a $(SHLIB) pngtest
+install: libpng.a $(SHLIB)
+.endif
+ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(prefix)/include
+ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(prefix)/lib
+ ${BSD_INSTALL_DATA} png.h pngconf.h $(DESTDIR)$(prefix)/include
+ $(LIBTOOL) --mode=install ${BSD_INSTALL_DATA} libpng.la $(DESTDIR)$(prefix)/lib
+ ${BSD_INSTALL_DATA} libpng.a $(DESTDIR)$(prefix)/lib
+ @if [ -f $(SHLIB) ]; then \
+ ${BSD_INSTALL_DATA} $(SHLIB) $(DESTDIR)$(prefix)/lib; \
+ fi
clean:
- rm -f *.o libpng.a pngtest pngout.png
+ rm -f *.o *.lo libpng.a libpng.so.* pngtest pngout.png
+ rm -f *.o *.so libpng.a $(SHLIB) pngtest pngout.png
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
writelock:

View File

@ -1,8 +1,7 @@
@comment $OpenBSD: PLIST,v 1.10 2000/07/03 09:14:27 brad Exp $
@comment $OpenBSD: PLIST,v 1.11 2000/09/16 11:45:26 brad Exp $
include/png.h
include/pngconf.h
lib/libpng.a
lib/libpng.la
%%SHARED%%
man/man3/libpng.3
man/man3/libpngpf.3