1#! /bin/bash 2# 3# %CopyrightBegin% 4# 5# Copyright Ericsson AB 2003-2016. All Rights Reserved. 6# 7# Licensed under the Apache License, Version 2.0 (the "License"); 8# you may not use this file except in compliance with the License. 9# You may obtain a copy of the License at 10# 11# http://www.apache.org/licenses/LICENSE-2.0 12# 13# Unless required by applicable law or agreed to in writing, software 14# distributed under the License is distributed on an "AS IS" BASIS, 15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16# See the License for the specific language governing permissions and 17# limitations under the License. 18# 19# %CopyrightEnd% 20# 21# Create a local init-file for erlang in the build environment. 22if [ -z "$1" ]; then 23 echo "error: $0: No rootdir given" 24 exit 1 25else 26 RDIR=$1 27fi 28if [ -z "$2" ]; then 29 echo "error: $0: No bindir given" 30 exit 1 31else 32 BDIR=$2 33fi 34 35DRDIR=`(cygpath -d $RDIR 2>/dev/null || cygpath -w $RDIR) | sed 's,\\\,\\\\\\\\,g'` 36DBDIR=`(cygpath -d $BDIR 2>/dev/null || cygpath -w $BDIR) | sed 's,\\\,\\\\\\\\,g'` 37 38 39cat > $RDIR/bin/erl.ini <<EOF 40[erlang] 41Bindir=$DBDIR 42Progname=erl 43Rootdir=$DRDIR 44EOF 45 46