[commit] r2133 - properly convey --src and --CFLAGS from configure to cmake

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] r2133 - properly convey --src and --CFLAGS from configure to cmake

commits-3
 
Author: piumarta
Date: 2009-09-16 14:12:41 -0700 (Wed, 16 Sep 2009)
New Revision: 2133

Modified:
   trunk/platforms/unix/ChangeLog
   trunk/platforms/unix/cmake/configure
Log:
properly convey --src and --CFLAGS from configure to cmake

Modified: trunk/platforms/unix/ChangeLog
===================================================================
--- trunk/platforms/unix/ChangeLog 2009-09-14 21:25:16 UTC (rev 2132)
+++ trunk/platforms/unix/ChangeLog 2009-09-16 21:12:41 UTC (rev 2133)
@@ -1,3 +1,7 @@
+2009-09-16  Ian Piumarta  <com -dot- gmail -at- piumarta (backwards)>
+
+ * cmake/configure: Properly convey --src --CFLAGS values to cmake.
+
 2009-09-14    <[hidden email]>
 
  * vm-sound-pulse: Pulse Audio driver added, thanks to Derek

Modified: trunk/platforms/unix/cmake/configure
===================================================================
--- trunk/platforms/unix/cmake/configure 2009-09-14 21:25:16 UTC (rev 2132)
+++ trunk/platforms/unix/cmake/configure 2009-09-16 21:12:41 UTC (rev 2133)
@@ -1,7 +1,9 @@
 #!/bin/sh
 
-# Last edited: 2009-08-31 13:23:58 by piumarta on ubuntu.piumarta.com
+# Last edited: 2009-09-16 14:06:55 by piumarta on emilia-2.local
 
+RELEASE_TAG=""
+
 help() {
     cat <<EOF
 Usage: $0 [options...]
@@ -36,14 +38,10 @@
 unix="`dirname \"${config}\"`"
 guess=`"${config}"/config.guess`
 host=`"${config}"/config.sub ${guess}`
+src="${unix}/src"
 
-vmmversion="`tr '\015 ' '\012\012' < \"${unix}/src/vm/interp.h\" | sed '1,/VMMaker/d;q'`"
-svnversion=`svn info "${unix}/ChangeLog" | fgrep Revision: | awk '{print $2}'`
-
-VM_VERSION="${vmmversion}-${svnversion}"alpha
-
 stop=false
-debug_configure=false
+cflags=""
 
 error () {
     echo "$*" >&2
@@ -54,14 +52,24 @@
     echo "unix       = ${unix}"
     echo "config     = ${config}"
     echo "host       = ${host}"
+    echo "src        = ${src}"
     echo "args       = ${args}"
     stop=true
 }
 
 while [ $# -gt 0 ]; do
-    case $1 in
+    case "$1" in
  --help) help; exit 0;;
  --debug-configure) dump;;
+ --src=*) rel="`echo \"$1\" | sed 's/\-\-src=//'`"
+ if test -d "${rel}"; then
+    src="`(cd \"${rel}\";  pwd)`"
+ else
+    src="${rel}"
+ fi
+ args="${args} --DOPT--src=${src}";;
+ --CFLAGS=*) cflags="`echo \"$1\" | sed 's/\-\-CFLAGS=//'`";;
+ -CFLAGS=*) cflags="`echo \"$1\" | sed 's/\-CFLAGS=//'`";;
  --*=*) args="${args} -DOPT${1}";;
  --*) args="${args} -DOPT${1}=1";;
  -*) args="${args} ${1}";;
@@ -70,13 +78,29 @@
     shift
 done
 
+interp_h="${src}/vm/interp.h"
+
+if test ! -f "${interp_h}"; then
+    echo "problem locating generated source file: ${interp_h}"
+    echo "use --src=<directory> to locate sources relative to ${unix}"
+    echo "current value is: --src=\"${src}\""
+    exit 1
+fi
+
+vmmversion="`tr '\015 ' '\012\012' < \"${interp_h}\" | sed '1,/VMMaker/d;q'`"
+svnversion=`svn info "${unix}/ChangeLog" | fgrep Revision: | awk '{print $2}'`
+
+VM_VERSION="${vmmversion}-${svnversion}${RELEASE_TAG}"
+
 if ${stop}; then
     exit 1
 fi
 
 echo "-- Configuring squeak ${VM_VERSION} for ${host}"
+echo "-- Using source directory ${src}"
 
-cmake ${unix} \
-  -DVM_HOST="${host}" \
-  -DVM_VERSION="${VM_VERSION}" \
-  $args "$@"
+if test -n "${cflags}"; then
+    cmake "${unix}" -DVM_HOST="${host}" -DVM_VERSION="${VM_VERSION}" -DOPT--CFLAGS="${cflags}" ${args}
+else
+    cmake "${unix}" -DVM_HOST="${host}" -DVM_VERSION="${VM_VERSION}"                           ${args}
+fi