X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c6b71bffdf1c57371b048e2b0be04bf88b9e4b3e..a20a357d928b6da93bc8b92193471f51a71127ba:/src/png/scripts/makefile.cygwin?ds=sidebyside diff --git a/src/png/scripts/makefile.cygwin b/src/png/scripts/makefile.cygwin index 250d12d1a4..f780d04cad 100644 --- a/src/png/scripts/makefile.cygwin +++ b/src/png/scripts/makefile.cygwin @@ -3,8 +3,8 @@ # of the library, and builds two copies of pngtest: one # statically linked and one dynamically linked. # -# Copyright (C) 2002 Soren Anderson, Charles Wilson, and Glenn Randers-Pehrson -# based on makefile for linux-elf w/mmx by: +# Copyright (C) 2002, 2006-2008 Soren Anderson, Charles Wilson, +# and Glenn Randers-Pehrson, based on makefile for linux-elf w/mmx by: # Copyright (C) 1998-2000 Greg Roelofs # Copyright (C) 1996, 1997 Andreas Dilger # For conditions of distribution and use, see copyright notice in png.h @@ -31,10 +31,6 @@ endif DESTDIR= -# To enable assembler optimizations, add '-DPNG_USE_PNGGCCRD' to -# $CFLAGS, and include pnggccrd.o in $OBJS, below, and in the dependency -# list at the bottom of this makefile. - CC=gcc ifdef MINGW MINGW_CCFLAGS=-mno-cygwin -I/usr/include/mingw @@ -46,6 +42,7 @@ ifndef prefix prefix=/usr $(warning You haven't specified a 'prefix=' location. Defaulting to "/usr") endif +exec_prefix=$(prefix) # Where the zlib library and include files are located ZLIBLIB= /usr/lib @@ -61,28 +58,26 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ -Wmissing-declarations -Wtraditional -Wcast-align \ -Wstrict-prototypes -Wmissing-prototypes #-Wconversion -### if you use the asm, add pnggccrd.o to the OBJS list -### ### if you don't need thread safety, but want the asm accel -#CFLAGS= $(strip $(MINGW_CCFLAGS) -DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD \ -# $(addprefix -I,$(ZLIBINC)) -Wall -O3 $(ALIGN) -funroll-loops \ +#CFLAGS= $(strip $(MINGW_CCFLAGS) -DPNG_THREAD_UNSAFE_OK \ +# $(addprefix -I,$(ZLIBINC)) -W -Wall -O $(ALIGN) -funroll-loops \ # -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5 ### if you need thread safety and want (minimal) asm accel -#CFLAGS= $(strip $(MINGW_CCFLAGS) -DPNG_USE_PNGGCCRD $(addprefix -I,$(ZLIBINC)) \ -# -Wall -O3 $(ALIGN) -funroll-loops \ +#CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \ +# -W -Wall -O $(ALIGN) -funroll-loops \ # -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5 ### Normal (non-asm) compilation CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \ - -Wall -O3 $(ALIGN) -funroll-loops \ + -W -Wall -O3 $(ALIGN) -funroll-loops -DPNG_NO_MMX_CODE \ -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5 LIBNAME = libpng12 PNGMAJ = 0 -PNGDLL = 13 -PNGMIN = 1.2.4 +CYGDLL = 12 +PNGMIN = 1.2.34 PNGVER = $(PNGMAJ).$(PNGMIN) -SHAREDLIB=cygpng$(PNGDLL).dll +SHAREDLIB=cygpng$(CYGDLL).dll STATLIB=libpng.a IMPLIB=libpng.dll.a SHAREDDEF=libpng.def @@ -93,14 +88,14 @@ LDFLAGS=$(strip -L. $(MINGW_LDFLAGS) -lpng $(addprefix -L,$(ZLIBLIB)) -lz) LDSFLAGS=$(strip -shared -L. $(MINGW_LDFLAGS) -Wl,--export-all) LDEXTRA=-Wl,--out-implib=$(IMPLIB) $(addprefix -L,$(ZLIBLIB)) -lz -MKDIR=/bin/mkdir -pv +MKDIR_P=/bin/mkdir -pv RANLIB=ranlib #RANLIB=echo INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib +LIBPATH=$(exec_prefix)/lib -BINPATH=$(prefix)/bin +BINPATH=$(exec_prefix)/bin MANPATH=$(prefix)/man MAN3PATH=$(MANPATH)/man3 MAN5PATH=$(MANPATH)/man5 @@ -114,7 +109,7 @@ DL =$(D)$(LIBPATH) 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 # pnggccrd.o + pngwtran.o pngmem.o pngerror.o pngpread.o OBJSDLL = $(OBJS:.o=.pic.o) @@ -139,18 +134,20 @@ buildsetup-tell: libpng.pc: scripts/libpng.pc.in @echo -e Making pkg-config file for this libpng installation..'\n' \ using PREFIX=\"$(prefix)\"'\n' - cat $(S)/scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \ - sed -e s/-lm// > libpng.pc + cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \ + -e s!@exec_prefix@!$(exec_prefix)! \ + -e s!@libdir@!$(LIBPATH)! \ + -e s!@includedir@!$(INCPATH)! \ + -e s!-lpng12!-lpng12\ -lz! > libpng.pc libpng-config: scripts/libpng-config-head.in scripts/libpng-config-body.in @echo -e Making $(LIBNAME) libpng-config file for this libpng \ installation..'\n' using PREFIX=\"$(prefix)\"'\n' ( cat $(S)/scripts/libpng-config-head.in; \ echo prefix=\"$(prefix)\"; \ - echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo cflags=\"\"; \ - echo ldflags=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng$(PNGMAJ) -lz\"; \ + echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ + echo L_opts=\"-L$(LIBPATH)\"; \ + echo libs=\"-lpng$(CYGDLL) -lz\"; \ cat $(S)/scripts/libpng-config-body.in ) > libpng-config chmod +x libpng-config @@ -159,25 +156,11 @@ shared: all-shared all-static: $(STATLIB) pngtest-stat$(EXE) all-shared: $(SHAREDLIB) pngtest$(EXE) -pnggccrd.o: pnggccrd.c png.h pngconf.h - @echo "" - @echo ' You can ignore the "control reaches end of non-void function"' - @echo ' warning and " defined but not used" warnings:' - @echo "" - $(CC) -c $(CFLAGS) -o $@ $< - -pnggccrd.pic.o: pnggccrd.c png.h pngconf.h - @echo "" - @echo ' You can ignore the "control reaches end of non-void function"' - @echo ' warning and " defined but not used" warnings:' - @echo "" - $(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ $< - $(STATLIB): $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ -$(SHAREDDEF): projects/msvc/png32ms.def +$(SHAREDDEF): scripts/pngw32.def cat $< | sed -e '1{G;s/^\(.*\)\(\n\)/EXPORTS/;};2,/^EXPORTS/d' | \ sed -e 's/\([^;]*\);/;/' > $@ @@ -205,15 +188,15 @@ test-shared: pngtest$(EXE) ./pngtest $(S)/pngtest.png install-static: $(STATLIB) install-headers install-man - -@if [ ! -d $(DL) ]; then $(MKDIR) $(DL); fi + -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi install -m 644 $(STATLIB) $(DL)/$(LIBNAME).a -@rm -f $(DL)/$(STATLIB) (cd $(DL); ln -sf $(LIBNAME).a $(STATLIB)) install-shared: $(SHAREDLIB) libpng.pc libpng-config install-headers install-man - -@if [ ! -d $(DL) ]; then $(MKDIR) $(DL); fi - -@if [ ! -d $(DB) ]; then $(MKDIR) $(DB); fi - -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR) $(DL)/pkgconfig; fi + -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi + -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi + -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc -@/bin/rm -f $(DL)/pkgconfig/libpng.pc install -m 644 $(IMPLIB) $(DL)/$(LIBNAME).dll.a @@ -224,8 +207,8 @@ install-shared: $(SHAREDLIB) libpng.pc libpng-config install-headers install-man (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) install-headers: - -@if [ ! -d $(DI) ]; then $(MKDIR) $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR) $(DI)/$(LIBNAME); fi + -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi + -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi -@rm -f $(DI)/png.h -@rm -f $(DI)/pngconf.h install -m 644 $(S)/png.h $(S)/pngconf.h $(DI)/$(LIBNAME) @@ -233,13 +216,13 @@ install-headers: (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) install-man: - -@if [ ! -d $(D)$(MAN3PATH) ]; then $(MKDIR) $(D)$(MAN3PATH); fi - -@if [ ! -d $(D)$(MAN5PATH) ]; then $(MKDIR) $(D)$(MAN5PATH); fi + -@if [ ! -d $(D)$(MAN3PATH) ]; then $(MKDIR_P) $(D)$(MAN3PATH); fi + -@if [ ! -d $(D)$(MAN5PATH) ]; then $(MKDIR_P) $(D)$(MAN5PATH); fi install -m 644 $(S)/libpngpf.3 $(S)/libpng.3 $(D)$(MAN3PATH) install -m 644 $(S)/png.5 $(D)$(MAN5PATH) install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi + -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi -@/bin/rm -f $(DB)/libpng-config -@/bin/rm -f $(DB)/$(LIBNAME)-config cp libpng-config $(DB)/$(LIBNAME)-config @@ -261,13 +244,23 @@ test-config-install: $(DB)/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) $(CFLAGS) \ + `$(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$(EXE) `$(BINPATH)/libpng12-config --ldflags --libs` + -o pngtesti$(EXE) `$(BINPATH)/libpng12-config --ldflags` ./pngtesti$(EXE) pngtest.png clean: