5
# Copyright Ericsson AB 1997-2011. All Rights Reserved.
7
# The contents of this file are subject to the Erlang Public License,
8
# Version 1.1, (the "License"); you may not use this file except in
9
# compliance with the License. You should have received a copy of the
10
# Erlang Public License along with this software. If not, it can be
11
# retrieved online at http://www.erlang.org/.
13
# Software distributed under the License is distributed on an "AS IS"
14
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15
# the License for the specific language governing rights and limitations
25
# vxworks_ppc860 vxworks_ppc603 vxworks_ppc603_longcall vxworks_cpu32 vxworks_sparc
26
# vxworks_ppc750 vxworks_simso
30
*) echo "usage: configure.vxworks host-configuration"; exit 1 ;;
38
vxworks_ppc603_nolongcall) ;;
43
*) echo "usage: configure.vxworks TARGET";
44
echo "where TARGET is one of vxworks_cpu32, vxworks_ppc750, vxworks_ppc860, vxworks_ppc603, vxworks_ppc603_nolongcall, vxworks_sparc, vxworks_simso, vxworks_simlinux, vxworks_ppc32"; exit 1;;
47
if [ "x$ERL_TOP" = x ]; then
48
echo "You need to set ERL_TOP!"
55
# Find out the HOST and WIND_BASE environment
56
HOST_TYPE=${HOST_TYPE:=sun4-solaris2}
58
vxworks_ppc750) VXTOP=Tornado2.2 ;;
59
vxworks_simso) VXTOP=WindRiver ;;
60
vxworks_simlinux) VXTOP=WindRiver ;;
61
vxworks_ppc32) VXTOP=WindRiver ;;
65
WIND_BASE=${WIND_BASE:=`ypmatch tornado passwd | awk -F: '{print $6}'`/$VXTOP}
67
# These are created by autoconf.
68
MKDIRS="${ERL_TOP}/lib/os_mon/priv/bin/$target
69
${ERL_TOP}/lib/os_mon/priv/obj/$target
70
${ERL_TOP}/lib/orber/priv/obj/$target
71
${ERL_TOP}/lib/orber/priv/bin/$target
72
${ERL_TOP}/lib/ic/priv/lib/$target
73
${ERL_TOP}/lib/ic/priv/obj/$target
74
${ERL_TOP}/lib/asn1/priv/lib/$target
75
${ERL_TOP}/lib/asn1/priv/obj/$target
76
${ERL_TOP}/lib/erl_interface/obj/$target
77
${ERL_TOP}/lib/erl_interface/obj.debug/$target
78
${ERL_TOP}/lib/erl_interface/bin/$target
79
${ERL_TOP}/lib/runtime_tools/priv/lib/$target
80
${ERL_TOP}/lib/runtime_tools/priv/obj/$target
81
${ERL_TOP}/erts/obj/$target
82
${ERL_TOP}/erts/obj.debug/$target
83
${ERL_TOP}/bin/$target"
85
for dir in $MKDIRS; do
86
test ! -d "$dir" && mkdir -p "$dir"
90
# Create Makefiles for vxWorks.
92
my_root=${ERL_TOP}/erts/emulator
93
emu_test=$my_root/test
95
erts_lib_src=${ERL_TOP}/erts/lib_src
96
erts_incl=${ERL_TOP}/erts/include
97
erts_incl_intrnl=${ERL_TOP}/erts/include/internal
98
etcdir=${ERL_TOP}/erts/etc/common
99
erlint_dir=${ERL_TOP}/lib/erl_interface/src
100
epmd_dir=${ERL_TOP}/erts/epmd/src
101
os_mon_dir=${ERL_TOP}/lib/os_mon/c_src
102
orber_dir=${ERL_TOP}/lib/orber/c_src
103
ic_dir=${ERL_TOP}/lib/ic/c_src
104
asn1_dir=${ERL_TOP}/lib/asn1/c_src
105
internal_tools_dir=${ERL_TOP}
106
libdir=${ERL_TOP}/lib
107
tsdir=$libdir/test_server/src
108
zlibdir=${ERL_TOP}/erts/emulator/zlib
109
runtime_tools_dir=${ERL_TOP}/lib/runtime_tools/c_src
110
tools_dir=${ERL_TOP}/lib/tools/c_src
112
CONFIG_FILES="${ERL_TOP}/erts/emulator/$host/Makefile
113
$erts_lib_src/$host/Makefile
114
$erts_incl/$host/erl_int_sizes_config.h
115
$erts_incl_intrnl/$host/ethread.mk
116
$erts_incl_intrnl/$host/ethread_header_config.h
117
$etcdir/$host/Makefile
118
$erlint_dir/$host/Makefile
119
$erlint_dir/$host/eidefs.mk
120
$epmd_dir/$host/Makefile
121
$internal_tools_dir/make/$host/otp.mk
122
$os_mon_dir/$host/Makefile
123
$zlibdir/$host/Makefile
124
$ic_dir/$host/Makefile
125
$asn1_dir/$host/Makefile
126
$runtime_tools_dir/$host/Makefile
127
$tools_dir/$host/Makefile
128
$orber_dir/$host/Makefile"
130
for file in $CONFIG_FILES; do
131
new_name=`echo $file|sed "s%/$host/%/$target/%"`
132
dir=`echo $new_name|sed 's%/[^/][^/]*$%%'`
133
if test "$dir" != "$new_name" && test "$dir" != .; then
134
test ! -d "$dir" && mkdir "$dir"
137
sole_name=`echo $file|sed "s%.*$target/%%"`
138
in_file=`echo $dir|sed "s%/[^/][^/]*$%/$sole_name.in%"`
139
echo "creating $new_name"
140
sed -f vxworks/sed.$target -f vxworks/sed.general \
141
-e "s,@HOST_TYPE@,$HOST_TYPE,g" \
142
-e "s,@WIND_BASE@,$WIND_BASE,g" \
143
-e "s,@TARGET@,$target,g" \