[jbossreflex-commits] JBossReflex SVN: r54 - trunk/php.

jbossreflex-commits at lists.jboss.org jbossreflex-commits at lists.jboss.org
Thu Jul 19 07:03:45 EDT 2007


Author: jfrederic.clere at jboss.com
Date: 2007-07-19 07:03:45 -0400 (Thu, 19 Jul 2007)
New Revision: 54

Modified:
   trunk/php/buildphp.sh
Log:
Improve the GNUMAKE/MAKE detection.


Modified: trunk/php/buildphp.sh
===================================================================
--- trunk/php/buildphp.sh	2007-07-19 10:18:31 UTC (rev 53)
+++ trunk/php/buildphp.sh	2007-07-19 11:03:45 UTC (rev 54)
@@ -53,8 +53,6 @@
 LZVER=1.2.3
 LZURL=http://www.gzip.org/zlib/zlib-${LZVER}.tar.gz
 
-MAKE=make
-
 # Platfrom directory and cache
 OS=`uname -s`
 case $OS in
@@ -271,6 +269,36 @@
 }
 
 #
+# Locate a GNU make in $PATH
+# $1 : The PATH already transformed. (list of directories).
+search_make()
+{
+  search="$*"
+  for d in $search; do
+    file=$d/make
+    $file --version 2>/dev/null | grep GNU >/dev/null
+    if [ $? -eq 0 ]; then
+      echo "Using $file as GNUMAKE"
+      GNUMAKE=$file
+      MAKE=$file
+      export GNUMAKE
+      export MAKE
+      break
+    fi
+    file=$d/gmake
+    $file --version 2>/dev/null | grep GNU >/dev/null
+    if [ $? -eq 0 ]; then
+      echo "Using $file as GNUMAKE"
+      GNUMAKE=$file
+      MAKE=$file
+      export GNUMAKE
+      export MAKE
+      break
+    fi
+  done
+}
+
+#
 # Allow to parameters to the build
 while [ "x" != "x$1" ]
 do
@@ -373,6 +401,13 @@
           "
 fi
 
+# Set MAKE and GNUMAKE
+make --version 2>/dev/null | grep GNU >/dev/null
+if [ $? -ne 0 ]; then
+  LOC=`echo "$PATH" | sed 's/:/ /g'`
+  search_make $LOC
+fi
+
 ADDCONF="$ADDCONF --with-t1lib=no"
 case ${OS} in
   Linux)     
@@ -444,7 +479,6 @@
     fi
     ;;
 esac
-export MAKE
 
 #
 # build libz if required.




More information about the jbossreflex-commits mailing list