You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/09/23 11:16:59 UTC
svn commit: r818012 - in /commons/sandbox/runtime/trunk: build.properties.in
configure
Author: mturk
Date: Wed Sep 23 09:16:58 2009
New Revision: 818012
URL: http://svn.apache.org/viewvc?rev=818012&view=rev
Log:
Add simple configure for build.properties:
It helps configuring builds according to the version specified inside version.h
Added:
commons/sandbox/runtime/trunk/build.properties.in (with props)
commons/sandbox/runtime/trunk/configure (with props)
Added: commons/sandbox/runtime/trunk/build.properties.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/build.properties.in?rev=818012&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/build.properties.in (added)
+++ commons/sandbox/runtime/trunk/build.properties.in Wed Sep 23 09:16:58 2009
@@ -0,0 +1,43 @@
+# -----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# -----------------------------------------------------------------------------
+# build.properties.in
+#
+# This is an example "build.properties" file, used to customize building
+# Runtime for your local environment. It defines the location of all external
+# modules that Runtime depends on. Copy this file to "build.properties"
+# in the top-level source directory, and customize it as needed.
+#
+# -----------------------------------------------------------------------------
+
+# ----- Vesion Control Flags --------------------------------------------------
+version.major=@vmajor@
+version.minor=@vminor@
+version.patch=@vpatch@
+version.suffix=@devsfx@
+
+# ----- Default Compile options -----------------------------------------------
+compile.source=1.@compile_source@
+compile.target=1.@compile_target@
+compile.debug=@debug@
+compile.optimize=@optimize@
+compile.deprecation=@deprecate@
+
+# ----- Change Cross Compile target -------------------------------------------
+systemid.os=@host@
+systemid.cpu=@cpu@
+systemid.so=@ext@
Propchange: commons/sandbox/runtime/trunk/build.properties.in
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/runtime/trunk/configure
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/configure?rev=818012&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/configure (added)
+++ commons/sandbox/runtime/trunk/configure Wed Sep 23 09:16:58 2009
@@ -0,0 +1,224 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ====================================================================
+#
+# configure Simple configure script with no dependency on
+# GNU autoconf tools.
+#
+# Important environment variables
+#
+# TOPDIR Top directory defaults to .
+# JAVA_HOME Home of the Java SDK
+# Overridable by --with-java-home option
+#
+# ====================================================================
+#
+
+name=commons-runtime
+topdir="${TOPDIR:=.}"
+java_home="`echo $JAVA_HOME | tr '\\' '/' 2>/dev/null`"
+
+compile_source=5
+compile_target=5
+has_64_bit=no
+has_maintainer_mode=off
+has_debug=off
+has_optimize=on
+has_deprecation=on
+host=""
+mach=""
+
+for o
+do
+ case "$o" in
+ --enable-*)
+ a=`echo "$o" | sed -e 's/--enable-//' -e 's/-/_/'`
+ case "$a" in
+ *=* )
+ v=`echo "$a" | sed 's/^[_a-zA-Z0-9]*=//'`
+ a=`echo "$a" | sed 's/=.*//'`
+ ;;
+ * )
+ v='yes'
+ ;;
+ esac
+ eval has_$a=$v
+ eval has_$a_set=on
+ shift
+ continue
+ ;;
+ --disable-*)
+ a=`echo "$o" | sed -e 's/--disable-//' -e 's/-/_/'`
+ case "$a" in
+ *=* )
+ a=`echo "$a" | sed 's/=.*//'`
+ ;;
+ esac
+ eval has_$a=no
+ eval has_$a_set=off
+ shift
+ continue
+ ;;
+ *=*) a=`echo "$o" | sed 's/^[-_a-zA-Z0-9]*=//'`
+ ;;
+ *) a=''
+ ;;
+ esac
+ case "$o" in
+ --name=* )
+ name="$a"
+ shift
+ ;;
+ --with-java-home=* )
+ java_home="$a"
+ shift
+ ;;
+ --with-java-version=* )
+ compile_source="$a"
+ compile_target="$a"
+ shift
+ ;;
+ --with-java-source=* )
+ compile_source="$a"
+ shift
+ ;;
+ --with-java-target=* )
+ compile_target="$a"
+ shift
+ ;;
+ --with-host=* )
+ host=`tolower "$a"`
+ shift
+ ;;
+ --with-cpu=* )
+ host=`tolower "$a"`
+ shift
+ ;;
+ * )
+ cat 1>&2 << EOH
+Usage: ./configure [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Usage: configure [options]
+
+Optional features:
+ --with-java-home=DIR Path to the Java SDK
+ [\$JAVA_HOME environment variable]
+ --with-java-source=VER Compile for Java source VER
+ [Default 5]
+ --with-java-target=VER Compile for Java target VER
+ [Default 5]
+ --with-host=NAME Configure for native HOST
+ [Default current host]
+ --with-cpu=NAME Configure for native CPU
+ [Default current machine]
+
+EOH
+ exit 1
+ ;;
+ esac
+done
+
+toupper()
+{
+ echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+}
+
+tolower()
+{
+ echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'
+}
+
+major_sed='/#define.*ACR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p'
+minor_sed='/#define.*ACR_MINOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p'
+patch_sed='/#define.*ACR_PATCH_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p'
+devel_sed='/#define.*ACR_IS_DEV_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p'
+vmajor="`sed -n $major_sed $topdir/src/main/native/include/acr_version.h`"
+vminor="`sed -n $minor_sed $topdir/src/main/native/include/acr_version.h`"
+vpatch="`sed -n $patch_sed $topdir/src/main/native/include/acr_version.h`"
+vdevel="`sed -n $devel_sed $topdir/src/main/native/include/acr_version.h`"
+
+
+if [ "$vdelel" = ".0" ]; then
+ devsfx=""
+else
+ devsfx="-dev"
+fi
+
+mach=`uname -m 2>/dev/null | tr '[A-Z]' '[a-z]'` || mach="unknown"
+host=`uname -s 2>/dev/null | tr '[A-Z]' '[a-z]'` || host="unknown"
+
+soext="so"
+case "$host" in
+ hp-ux )
+ host=hpux
+ ;;
+ sunos )
+ host=solaris
+ ;;
+ cygwin* )
+ host=windows
+ ext="dll"
+ ;;
+ mingw* )
+ host=windows
+ soext="dll"
+ ;;
+ * )
+ host=`tolower "$host"`
+ ;;
+esac
+
+case "$mach" in
+ amd64 )
+ mach=x86_64
+ ;;
+ i[3-7]86 )
+ mach=x86
+ ;;
+ i86pc )
+ mach=x86
+ ;;
+ sun4* )
+ mach=sparc
+ ;;
+ 9000/[678][0-9][0-9] )
+ mach=parisc
+ soext="sl"
+ ;;
+esac
+
+sed -e "s;=@name@;=$name;g" \
+ -e "s;=@vmajor@;=$vmajor;g" \
+ -e "s;=@vminor@;=$vminor;g" \
+ -e "s;=@vpatch@;=$vpatch;g" \
+ -e "s;=@devsfx@;=$devsfx;g" \
+ -e "s;@compile_source@;$compile_source;g" \
+ -e "s;@compile_target@;$compile_target;g" \
+ -e "s;=@debug@;=$has_debug;g" \
+ -e "s;=@optimize@;=$has_optimize;g" \
+ -e "s;=@deprecate@;=$has_deprecation;g" \
+ -e "s;@host@;$host;g" \
+ -e "s;@cpu@;$mach;g" \
+ -e "s;@ext@;$soext;g" \
+ build.properties.in > build.properties
+
+echo ""
+echo "Configured for java 1.$compile_target."
+echo ""
Propchange: commons/sandbox/runtime/trunk/configure
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/runtime/trunk/configure
------------------------------------------------------------------------------
svn:executable = *