--- ext/gd/config.m4.orig	2014-01-08 04:15:20.000000000 -0600
+++ ext/gd/config.m4	2014-01-10 15:48:08.000000000 -0600
@@ -75,7 +75,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
 
@@ -101,7 +101,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
 
@@ -126,7 +126,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
 
@@ -157,7 +157,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/include/xpm.h && GD_XPM_DIR=$i && GD_XPM_INC=$i && break
       test -f $i/include/X11/xpm.h && GD_XPM_DIR=$i && GD_XPM_INC=$i/X11 && break
     done
@@ -184,7 +184,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"
@@ -212,7 +212,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
 
