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    if [ -z $ERL_TOP ]; then
24	echo "error: $0: No rootdir available"
25 	exit 1
26    else
27	RDIR=$ERL_TOP
28    fi
29else
30    RDIR=$1
31fi
32
33DDIR=`msys2win_path.sh $RDIR | sed 's,\\\,\\\\\\\\,g'`
34
35
36cat > $RDIR/bin/erl.ini <<EOF
37[erlang]
38Bindir=$DDIR\\\\bin\\\\win32
39Progname=erl
40Rootdir=$DDIR
41EOF
42
43