74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz#!/bin/ksh93
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz#
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz###########################################################################
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz#
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz#
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz# Permission is hereby granted, free of charge, to any person obtaining a
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz# copy of this software and associated documentation files (the "Software"),
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz# to deal in the Software without restriction, including without limitation
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz# the rights to use, copy, modify, merge, publish, distribute, sublicense,
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz# and/or sell copies of the Software, and to permit persons to whom the
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz# Software is furnished to do so, subject to the following conditions:
23d859f2ce09c04ed802cb4912cc9c50f512f0a2bgk#
23d859f2ce09c04ed802cb4912cc9c50f512f0a2bgk# The above copyright notice and this permission notice (including the next
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz# paragraph) shall be included in all copies or substantial portions of the
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz# Software.
8c39cbeab9949a0a7d6ae66b768a7352019e42f8johanengelen#
8c39cbeab9949a0a7d6ae66b768a7352019e42f8johanengelen# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
072916d0ef7dccd696b59381f50bcf776abccefbjohanengelen# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
072916d0ef7dccd696b59381f50bcf776abccefbjohanengelen# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
add2ffae3c4686b50d888775bbdf083a4726a210johanengelen# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
add2ffae3c4686b50d888775bbdf083a4726a210johanengelen# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz# DEALINGS IN THE SOFTWARE.
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz#
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz###########################################################################
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz#
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz#
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruzprogname="$0"
c8989ca0e1ce9fee100d698aa9c4540d5df4b7e3johanengelenfunction fatal_error
c8989ca0e1ce9fee100d698aa9c4540d5df4b7e3johanengelen{
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz print -u2 "${progname}: ERROR: $*"
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruz exit 1
0a75b58e47d3de42550c4f7960e253ea3befc09ajohanengelen}
0a75b58e47d3de42550c4f7960e253ea3befc09ajohanengelen
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruzCLOBBER=0
74ed5bd66f5d8a1465b69bd0450f2af030b638f0joncruzWGET='/usr/bin/wget'
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelenXMAKE="$(pwd)/open-src/util/build-tools/xmake ${VERBOSE_FLAGS} -k"
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen# Make sure Solaris make, not GNU make, is first in the $PATH
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelenexport PATH=/usr/bin:${PATH}
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen
c169f6cddd2da06cfb761339f445bbd8866f72a8buliabyakset -- $(getopt cn $*)
c169f6cddd2da06cfb761339f445bbd8866f72a8buliabyakif [[ $? != 0 ]] ; then
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen echo USAGE: $0 [-c] [-n]
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen exit 2
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelenfi
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen
c169f6cddd2da06cfb761339f445bbd8866f72a8buliabyakfor i in $* ; do
c169f6cddd2da06cfb761339f445bbd8866f72a8buliabyak case $i in
c169f6cddd2da06cfb761339f445bbd8866f72a8buliabyak -c) CLOBBER=1; shift;;
c169f6cddd2da06cfb761339f445bbd8866f72a8buliabyak -n) WGET="echo $WGET"; MAKE_FLAGS="$MAKE_FLAGS -n" ; shift;;
c169f6cddd2da06cfb761339f445bbd8866f72a8buliabyak esac
8d9f5d586a04809427ce1df284a5720112177991cilixdone
70eb1fc448cb08acf3468f80fa2296c03b32afd2cilix
70eb1fc448cb08acf3468f80fa2296c03b32afd2cilix${XMAKE} setup || fatal_error "make setup failed: cannot continue"
b0c42c0dfcd02cc05126371948489a5a88b2e4b3cilix
76db360f5f052775326e6d406b9e1e9e2966e11acilixset -v
76db360f5f052775326e6d406b9e1e9e2966e11acilix
3d0482af18ffb591c1d8ddecf516629e1bcd2ae4cilixcd open-src
64aee804a6a47424f7994e60558351b8cf2ea4dbcilixif [[ $CLOBBER == 1 ]] ; then
64aee804a6a47424f7994e60558351b8cf2ea4dbcilix rm -rf tarballs
b320a8d186114a5122ddc3afbe95110eb6cb10cecilixfi
b320a8d186114a5122ddc3afbe95110eb6cb10cecilixif [[ ! -d tarballs ]] ; then
044d712d4d03f8354962d54e47cfac2346a69ccccilix mkdir tarballs
044d712d4d03f8354962d54e47cfac2346a69ccccilixfi
61cfd957cd023c4f432ea0c7307784a56bf978e9cilix${XMAKE} download
61cfd957cd023c4f432ea0c7307784a56bf978e9cilixcd ../..
2f5c0701b333a695eedb1680beb1adf95c0723dacilix
2f5c0701b333a695eedb1680beb1adf95c0723dacilix