--- src/scripts/gcc.mak.in.orig	2009-05-18 04:14:00.000000000 +0400
+++ src/scripts/gcc.mak.in	2010-07-16 23:46:42.994207283 +0400
@@ -7,13 +7,13 @@
 prefix=/usr/local
 exec_prefix=$(prefix)
 bindir=$(exec_prefix)/bin
-mandir=$(prefix)/man
+mandir=$(prefix)/share/man
 man1dir=$(mandir)/man1
 
 CC = gcc
 LD = $(CC)
-CFLAGS  = -O2 -W -Wall
-LDFLAGS = -s
+CFLAGS  = ${SPELL_CFLAGS} -W -Wall
+LDFLAGS = ${SPELL_LDFLAGS}
 
 OPTIPNG = optipng$(EXE)
 ZLIB    = libz.a
--- lib/pngxtern/scripts/gcc.mak.in.orig	2008-06-18 03:29:00.000000000 +0400
+++ lib/pngxtern/scripts/gcc.mak.in	2010-07-16 23:48:30.962207545 +0400
@@ -16,8 +16,8 @@
 
 CDEBUG = -g
 LDDEBUG =
-CRELEASE = -O2
-LDRELEASE = -s
+CRELEASE = ${SPELL_CFLAGS}
+LDRELEASE = ${SPELL_LDFLAGS}
 CFLAGS = -W -Wall $(CRELEASE)
 LDFLAGS = $(LDRELEASE)
 INCS = -I$(ZDIR) -I$(PNGDIR)
--- Makefile.in.orig	2008-07-21 06:28:00.000000000 +0400
+++ Makefile.in	2010-07-16 23:56:38.089209138 +0400
@@ -2,7 +2,7 @@
 
 all:
 	cd src; \
-	${MAKE} -f @MAKEFILE@ CC="${CC}"; \
+	${MAKE} -f @MAKEFILE@ CC="${CC}" SPELL_CFLAGS="${CFLAGS}" SPELL_LDFLAGS+="${LDFLAGS}"; \
 	cd ..
 
 install:
