--- ext/gd/config.m4.orig	2014-01-07 20:57:08.000000000 -0600
+++ ext/gd/config.m4	2014-01-10 15:46:18.000000000 -0600
@@ -76,7 +76,7 @@
 AC_DEFUN([PHP_GD_VPX],[
   if test "$PHP_VPX_DIR" != "no"; then
 
-    for i in $PHP_VPX_DIR /usr/local /usr; do
+    for i in $PHP_VPX_DIR; do
       test -f $i/include/vpx_codec.h || test -f $i/include/vpx/vpx_codec.h && GD_VPX_DIR=$i && break
     done
 
@@ -102,7 +102,7 @@
 AC_DEFUN([PHP_GD_JPEG],[
   if test "$PHP_JPEG_DIR" != "no"; then
 
-    for i in $PHP_JPEG_DIR /usr/local /usr; do
+    for i in $PHP_JPEG_DIR; do
       test -f $i/include/jpeglib.h && GD_JPEG_DIR=$i && break
     done
 
@@ -127,7 +127,7 @@
 AC_DEFUN([PHP_GD_PNG],[
   if test "$PHP_PNG_DIR" != "no"; then
 
-    for i in $PHP_PNG_DIR /usr/local /usr; do
+    for i in $PHP_PNG_DIR; do
       test -f $i/include/png.h && GD_PNG_DIR=$i && break
     done
 
@@ -158,7 +158,7 @@
 AC_DEFUN([PHP_GD_XPM],[
   if test "$PHP_XPM_DIR" != "no"; then
 
-    for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do
+    for i in $PHP_XPM_DIR; do
       test -f $i/$PHP_LIBDIR/libXpm.$SHLIB_SUFFIX_NAME || test -f $i/$PHP_LIBDIR/libXpm.a && GD_XPM_DIR=$i && break
     done
 
@@ -192,7 +192,7 @@
 AC_DEFUN([PHP_GD_FREETYPE2],[
   if test "$PHP_FREETYPE_DIR" != "no"; then
 
-    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
+    for i in $PHP_FREETYPE_DIR; do
       if test -f "$i/bin/freetype-config"; then
         FREETYPE2_DIR=$i
         FREETYPE2_CONFIG="$i/bin/freetype-config"
@@ -220,7 +220,7 @@
 AC_DEFUN([PHP_GD_T1LIB],[
   if test "$PHP_T1LIB" != "no"; then
 
-    for i in $PHP_T1LIB /usr/local /usr; do
+    for i in $PHP_T1LIB; do
       test -f "$i/include/t1lib.h" && GD_T1_DIR=$i && break
     done
 
