--- configure.orig	Wed Jan 21 18:25:37 2004
+++ configure	Wed Jan 21 18:27:07 2004
@@ -5647,7 +5647,7 @@
 		echo 'FATAL: You need libungif to use gif images.  pass proper LIBS to configure.'
 		exit 1
 	fi
-	for i in /usr/pkg /usr/local /usr; do
+	for i in ${LOCALPREFIX} /usr/pkg /usr/local /usr; do
 		if test -f $i/include/gif_lib.h; then
 			gif_h_ok=yes
 			OPTFLAGS="$OPTFLAGS -I$i/include"
