You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.sh 1.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # https://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # OS specific support. $var _must_ be set to either true or false.
  17. cygwin=false
  18. darwin=false
  19. case "`uname`" in
  20. CYGWIN*)
  21. cygwin=true
  22. ;;
  23. Darwin*)
  24. darwin=true
  25. if [ -z "$JAVA_HOME" ]; then
  26. if [ -x '/usr/libexec/java_home' ]; then
  27. JAVA_HOME=`/usr/libexec/java_home`
  28. elif [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" ]; then
  29. JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
  30. fi
  31. fi
  32. ;;
  33. esac
  34. REALANTHOME=$ANT_HOME
  35. if [ -z "$PWD" ]; then
  36. ANT_HOME=./bootstrap
  37. else
  38. ANT_HOME="$PWD"/bootstrap
  39. fi
  40. export ANT_HOME
  41. if test ! -f bootstrap/lib/ant.jar -o ! -x bootstrap/bin/ant -o ! -x bootstrap/bin/antRun; then
  42. /bin/sh ./bootstrap.sh
  43. fi
  44. if test ! -f bootstrap/lib/ant.jar -o ! -x bootstrap/bin/ant -o ! -x bootstrap/bin/antRun; then
  45. echo Bootstrap FAILED
  46. exit 1
  47. fi
  48. if [ "$REALANTHOME" != "" ]; then
  49. if $cygwin; then
  50. REALANTHOME=`cygpath --windows "$REALANTHOME"`
  51. fi
  52. ANT_INSTALL="-Dant.install=$REALANTHOME"
  53. else
  54. ANT_INSTALL="-emacs"
  55. fi
  56. bootstrap/bin/ant -nouserlib -lib lib/optional "$ANT_INSTALL" $*