X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c6b71bffdf1c57371b048e2b0be04bf88b9e4b3e..47e59154157bb013ce255a4efa7a615574c974f7:/src/png/scripts/makefile.darwin diff --git a/src/png/scripts/makefile.darwin b/src/png/scripts/makefile.darwin index 217eb8219c..935eb98f41 100644 --- a/src/png/scripts/makefile.darwin +++ b/src/png/scripts/makefile.darwin @@ -1,5 +1,5 @@ # makefile for libpng on Darwin / Mac OS X -# Copyright (C) 2002 Glenn Randers-Pehrson +# Copyright (C) 2002,2004 Glenn Randers-Pehrson # Copyright (C) 2001 Christoph Pfisterer # derived from makefile.linux: # Copyright (C) 1998, 1999 Greg Roelofs @@ -23,7 +23,7 @@ LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz RANLIB=ranlib PNGMAJ = 0 -PNGMIN = 1.2.4 +PNGMIN = 1.2.7 PNGVER = $(PNGMAJ).$(PNGMIN) LIBNAME = libpng12 @@ -71,9 +71,8 @@ libpng.pc: libpng-config: ( cat scripts/libpng-config-head.in; \ echo prefix=\"$(prefix)\"; \ - echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo cflags=\"\"; \ - echo ldflags=\"-L$(LIBPATH)\"; \ + echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ + echo L_opts=\"-L$(LIBPATH)\"; \ echo libs=\"-lpng12 -lz\"; \ cat scripts/libpng-config-body.in ) > libpng-config chmod +x libpng-config @@ -86,11 +85,18 @@ $(LIBNAME).$(PNGMAJ).dylib: $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGVER).dylib: $(OBJSDLL) $(CC) -dynamiclib \ - -install_name $(DL)/$(LIBNAME).$(PNGMAJ).dylib \ - -current_version $(PNGMIN) -compatibility_version $(PNGMIN) \ + -install_name $(LIBPATH)/$(LIBNAME).$(PNGMAJ).dylib \ + -current_version $(PNGVER) -compatibility_version $(PNGVER) \ -o $(LIBNAME).$(PNGVER).dylib \ $(OBJSDLL) -L$(ZLIBLIB) -lz +libpng.3.$(PNGMIN).dylib: $(OBJSDLL) + $(CC) -dynamiclib \ + -install_name $(LIBPATH)/libpng.3.dylib \ + -current_version 3 -compatibility_version 3 \ + -o libpng.3.$(PNGMIN).dylib \ + $(OBJSDLL) -L$(ZLIBLIB) -lz + pngtest: pngtest.o $(LIBNAME).dylib $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) @@ -110,22 +116,26 @@ install-static: install-headers libpng.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi cp libpng.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).a + $(RANLIB) $(DL)/$(LIBNAME).a -@/bin/rm -f $(DL)/libpng.a (cd $(DL); ln -sf $(LIBNAME).a libpng.a) -install-shared: install-headers $(LIBNAME).dylib libpng.pc +install-shared: install-headers $(LIBNAME).dylib libpng.pc \ + libpng.3.$(PNGMIN).dylib -@if [ ! -d $(DL) ]; then mkdir $(DL); fi + -@/bin/rm -f $(DL)/$(LIBNAME).$(PNGVER)*.dylib -@/bin/rm -f $(DL)/$(LIBNAME).$(PNGMAJ)*.dylib -@/bin/rm -f $(DL)/$(LIBNAME).dylib -@/bin/rm -f $(DL)/libpng.dylib -@/bin/rm -f $(DL)/libpng.3.dylib - -@/bin/rm -f $(DL)/libpng.3.*.dylib + -@/bin/rm -f $(DL)/libpng.3.$(PNGMIN)*.dylib cp $(LIBNAME).$(PNGVER).dylib $(DL) + cp libpng.3.$(PNGMIN).dylib $(DL) chmod 755 $(DL)/$(LIBNAME).$(PNGVER).dylib + chmod 755 $(DL)/libpng.3.$(PNGMIN).dylib (cd $(DL); \ - ln -sf $(LIBNAME).$(PNGVER).dylib libpng.dylib; \ - ln -sf $(LIBNAME).$(PNGVER).dylib libpng.3.dylib; \ - ln -sf $(LIBNAME).$(PNGVER).dylib libpng.3.$(PNGMIN).dylib; \ + ln -sf libpng.3.$(PNGMIN).dylib libpng.3.dylib; \ + ln -sf libpng.3.dylib libpng.dylib; \ ln -sf $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib; \ ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi @@ -157,18 +167,29 @@ install-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. +# 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)/libpng12-config --cflags` pngtest.c \ + -L$(DL) -L$(ZLIBLIB) \ + -o pngtestd `$(BINPATH)/libpng12-config --ldflags` + ./pngtestd pngtest.png test-installed: $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cppflags --cflags` pngtest.c \ + `$(BINPATH)/libpng12-config --cflags` pngtest.c \ -L$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags --libs` + -o pngtesti `$(BINPATH)/libpng12-config --ldflags` ./pngtesti pngtest.png clean: - rm -f *.o libpng.a pngtest pngout.png libpng.pc libpng-config \ - $(LIBNAME).*dylib pngtesti + rm -f *.o libpng.a pngtest pngout.png libpng-config \ + libpng.3.$(PNGMIN).dylib \ + libpng.pc $(LIBNAME).*dylib pngtesti DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: