671242f350d172e106580348e24bab66b0d7e6a5vboxsync# makefile for libpng on Solaris 2.x with gcc
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# Copyright (C) 2004 Glenn Randers-Pehrson
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# Contributed by William L. Sebok, based on makefile.linux
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# Copyright (C) 1998 Greg Roelofs
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# Copyright (C) 1996, 1997 Andreas Dilger
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# For conditions of distribution and use, see copyright notice in png.h
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# Where make install puts libpng.a, libpng12.so*, and png.h
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# Where the zlib library and include files are located
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# Changing these to ../zlib poses a security risk. If you want
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# to have zlib in an adjacent directory, specify the full path instead of "..".
671242f350d172e106580348e24bab66b0d7e6a5vboxsync#ZLIBLIB=../zlib
671242f350d172e106580348e24bab66b0d7e6a5vboxsync#ZLIBINC=../zlib
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncWARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -Wmissing-declarations -Wtraditional -Wcast-align \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncCFLAGS=-I$(ZLIBINC) -Wall -O \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync # $(WARNMORE) -g -DPNG_DEBUG=5
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncLDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm
671242f350d172e106580348e24bab66b0d7e6a5vboxsync#RANLIB=ranlib
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncPNGMIN = 1.2.8
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncPNGVER = $(PNGMAJ).$(PNGMIN)
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncLIBNAME = libpng12
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncINCPATH=$(prefix)/include
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncLIBPATH=$(prefix)/lib
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncMANPATH=$(prefix)/man
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncBINPATH=$(prefix)/bin
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# override DESTDIR= on the make install command line to easily support
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# installing into a temporary location. Example:
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# make install DESTDIR=/tmp/build/libpng
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# If you're going to install into a temporary location
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# you execute make install.
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncDB=$(DESTDIR)$(BINPATH)
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncDI=$(DESTDIR)$(INCPATH)
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncDL=$(DESTDIR)$(LIBPATH)
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncDM=$(DESTDIR)$(MANPATH)
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncOBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncOBJSDLL = $(OBJS:.o=.pic.o)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync.SUFFIXES: .c .o .pic.o
671242f350d172e106580348e24bab66b0d7e6a5vboxsync $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncall: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config
671242f350d172e106580348e24bab66b0d7e6a5vboxsync ar rc $@ $(OBJS)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync $(RANLIB) $@
671242f350d172e106580348e24bab66b0d7e6a5vboxsync cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
671242f350d172e106580348e24bab66b0d7e6a5vboxsynclibpng-config:
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo prefix=\"$(prefix)\"; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo cppflags=\"-DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE\"; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo L_opts=\"-L$(LIBPATH)\"; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo R_opts=\"-R$(LIBPATH)\"; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo libs=\"-lpng12 -lz -lm\"; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync cat scripts/libpng-config-body.in ) > libpng-config
671242f350d172e106580348e24bab66b0d7e6a5vboxsync chmod +x libpng-config
671242f350d172e106580348e24bab66b0d7e6a5vboxsync$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
671242f350d172e106580348e24bab66b0d7e6a5vboxsync$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync @case "`type ld`" in *ucb*) \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo '## WARNING:'; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo '## at all. If it is, things are likely to break because of'; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo '## the libucb dependency that is created.'; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync $(LD) -G -h $(LIBNAME).so.$(PNGMAJ) \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -o $(LIBNAME).so.$(PNGVER) $(OBJSDLL)
671242f350d172e106580348e24bab66b0d7e6a5vboxsynclibpng.so.3.$(PNGMIN): $(OBJS)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync $(LD) -G -h libpng.so.3 \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -o libpng.so.3.$(PNGMIN) $(OBJSDLL)
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncpngtest: pngtest.o $(LIBNAME).so
671242f350d172e106580348e24bab66b0d7e6a5vboxsync $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
671242f350d172e106580348e24bab66b0d7e6a5vboxsynctest: pngtest
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@if [ ! -d $(DI) ]; then mkdir $(DI); fi
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
671242f350d172e106580348e24bab66b0d7e6a5vboxsync chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@/bin/rm -f $(DI)/libpng
671242f350d172e106580348e24bab66b0d7e6a5vboxsync (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .)
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncinstall-static: install-headers libpng.a
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
671242f350d172e106580348e24bab66b0d7e6a5vboxsync cp libpng.a $(DL)/$(LIBNAME).a
671242f350d172e106580348e24bab66b0d7e6a5vboxsync chmod 644 $(DL)/$(LIBNAME).a
671242f350d172e106580348e24bab66b0d7e6a5vboxsync (cd $(DL); ln -f -s $(LIBNAME).a libpng.a)
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncinstall-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync cp $(LIBNAME).so.$(PNGVER) $(DL)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync cp libpng.so.3.$(PNGMIN) $(DL)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync chmod 755 $(DL)/libpng.so.3.$(PNGMIN)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync (cd $(DL); \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so; \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ))
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
671242f350d172e106580348e24bab66b0d7e6a5vboxsync cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
671242f350d172e106580348e24bab66b0d7e6a5vboxsync chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
671242f350d172e106580348e24bab66b0d7e6a5vboxsync (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc)
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncinstall-man: libpng.3 libpngpf.3 png.5
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@if [ ! -d $(DM) ]; then mkdir $(DM); fi
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
671242f350d172e106580348e24bab66b0d7e6a5vboxsync cp libpng.3 $(DM)/man3
671242f350d172e106580348e24bab66b0d7e6a5vboxsync cp libpngpf.3 $(DM)/man3
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
671242f350d172e106580348e24bab66b0d7e6a5vboxsync cp png.5 $(DM)/man5
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncinstall-config: libpng-config
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@if [ ! -d $(DB) ]; then mkdir $(DB); fi
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@/bin/rm -f $(DB)/libpng-config
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -@/bin/rm -f $(DB)/$(LIBNAME)-config
671242f350d172e106580348e24bab66b0d7e6a5vboxsync cp libpng-config $(DB)/$(LIBNAME)-config
671242f350d172e106580348e24bab66b0d7e6a5vboxsync chmod 755 $(DB)/$(LIBNAME)-config
671242f350d172e106580348e24bab66b0d7e6a5vboxsync (cd $(DB); ln -s -f $(LIBNAME)-config libpng-config)
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncinstall: install-static install-shared install-man install-config
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# If you installed in $(DESTDIR), test-installed won't work until you
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# move the library to its final location. Use test-dd to test it
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# before then.
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo Testing installed dynamic shared library in $(DL).
671242f350d172e106580348e24bab66b0d7e6a5vboxsync $(CC) -I$(DI) -I$(ZLIBINC) \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync `$(BINPATH)/libpng12-config --cflags` pngtest.c \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -o pngtestd `$(BINPATH)/libpng12-config --ldflags` \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL)
671242f350d172e106580348e24bab66b0d7e6a5vboxsynctest-installed:
671242f350d172e106580348e24bab66b0d7e6a5vboxsync echo Testing installed dynamic shared library.
671242f350d172e106580348e24bab66b0d7e6a5vboxsync $(CC) -I$(ZLIBINC) \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync `$(BINPATH)/libpng12-config --cflags` pngtest.c \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -o pngtesti `$(BINPATH)/libpng12-config --ldflags` \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync -L$(ZLIBLIB) -R$(ZLIBLIB)
671242f350d172e106580348e24bab66b0d7e6a5vboxsync /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \
671242f350d172e106580348e24bab66b0d7e6a5vboxsync libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
671242f350d172e106580348e24bab66b0d7e6a5vboxsyncDOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
671242f350d172e106580348e24bab66b0d7e6a5vboxsync chmod a-w *.[ch35] $(DOCS) scripts/*
671242f350d172e106580348e24bab66b0d7e6a5vboxsync# DO NOT DELETE THIS LINE -- make depend depends on it.