]> git.argeo.org Git - cc0/argeo-build.git/blobdiff - configure
Centralise repackage make instructions
[cc0/argeo-build.git] / configure
index 9b3e9804b04280910d6df08fd74ba0fe4cf4079c..e5031d7616aec131166349effffd5062559376c4 100755 (executable)
--- a/configure
+++ b/configure
@@ -3,18 +3,16 @@
 # We build where we are
 SDK_BUILD_BASE=$(pwd -P)/output
 
-# Source are located where this script is
-SDK_SRC_BASE="$(cd "$(dirname "$0")"; pwd -P)"
+if [ -z "$SDK_SRC_BASE" ]
+then
+SDK_SRC_BASE=$(pwd -P)
+echo "Script variable SDK_SRC_BASE not set, assuming Argeo Build is building itself and using the local directory"
+fi
 
 SDK_MK=$SDK_SRC_BASE/sdk.mk
 
-#echo SDK_BUILD_BASE=$SDK_BUILD_BASE
-#echo SDK_SRC_BASE=$SDK_SRC_BASE
-#echo SDK_MK=$SDK_MK
-
 if [ -f "$SDK_MK" ]; 
 then
-
 echo "File $SDK_MK already exists. Remove it in order to configure a new build location:"
 echo "rm $SDK_MK"
 exit 1
@@ -23,8 +21,8 @@ else
 
 if [ -z "$JAVA_HOME" ]
 then
-echo "Environment variable JAVA_HOME must be set"
-exit 1
+JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
+echo "Environment variable JAVA_HOME not set, using $JAVA_HOME of $(which java)"
 fi
 
 # Create build directory, so that it can be used right away
@@ -42,7 +40,8 @@ SDK_SRC_BASE := $SDK_SRC_BASE
 SDK_BUILD_BASE := $SDK_BUILD_BASE
 JAVA_HOME := $JAVA_HOME
 
-include \$(SDK_SRC_BASE)/branch.mk
+-include \$(SDK_SRC_BASE)/branch.mk
+-include \$(SDK_SRC_BASE)/sdk/branches/\$(BRANCH).bnd
 EOF