Debian Codegraph @

rhino/testsrc/tests/config.sh

raw symbols SCIP
1 # -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*-
2 #
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7 # This file was adapted from mozilla/js/src/config.mk
8
9 # Set os+release dependent make variables
10 OS_ARCH="`uname -s | sed /\ /s//_/`"
11
12 # Attempt to differentiate between SunOS 5.4 and x86 5.4
13 OS_CPUARCH=`uname -m`
14
15 if [[ "$OS_CPUARCH" == "i86pc" ]]; then
16 OS_RELEASE="`uname -r`_$OS_CPUARCH"
17 elif [[ "$OS_ARCH" == "AIX" ]]; then
18 OS_RELEASE="`uname -v`.`uname -r`"
19 else
20 OS_RELEASE="`uname -r`"
21 fi
22
23 if [[ "$OS_ARCH" == "IRIX64" ]]; then
24 OS_ARCH="IRIX"
25 fi
26
27 # Handle output from win32 unames other than Netscape's version
28 if echo "Windows_95 Windows_98 CYGWIN_95-4.0 CYGWIN_98-4.10" | grep -iq "$OS_ARCH"; then
29 OS_ARCH="WIN95"
30 fi
31
32 if [[ "$OS_ARCH" == "WIN95" ]]; then
33 OS_ARCH="WINNT"
34 OS_RELEASE="4.0"
35 fi
36
37 if [[ "$OS_ARCH" == "Windows_NT" ]]; then
38 OS_ARCH="WINNT"
39 OS_MINOR_RELEASE="`uname -v`"
40
41 if [[ "$OS_MINOR_RELEASE" == "00" ]]; then
42 OS_MINOR_RELEASE=0
43 fi
44
45 OS_RELEASE="$OS_RELEASE.$OS_MINOR_RELEASE"
46 fi
47
48 if echo "$OS_ARCH" | grep -iq CYGWIN_NT; then
49 OS_RELEASE="`echo $OS_ARCH|sed 's/CYGWIN_NT-//'`"
50 OS_ARCH="WINNT"
51 fi
52
53 if [[ "$OS_ARCH" == "CYGWIN32_NT" ]]; then
54 OS_ARCH="WINNT"
55 fi
56
57 if echo "$OS_ARCH" | grep -iq MINGW32_NT; then
58 OS_RELEASE="`echo $OS_ARCH|sed 's/MINGW32_NT-//'`"
59 OS_ARCH="WINNT"
60 fi
61
62 if [[ "$OS_ARCH" == "MINGW32_NT" ]]; then
63 OS_ARCH="WINNT"
64 fi
65
66 # Virtually all Linux versions are identical.
67 # Any distinctions are handled in linux.h
68
69 case "$OS_ARCH" in
70 "Linux")
71 OS_CONFIG="Linux_All"
72 ;;
73 "dgux")
74 OS_CONFIG="dgux"
75 ;;
76 "Darwin")
77 OS_CONFIG="Darwin"
78 ;;
79 *)
80 OS_CONFIG="$OS_ARCH$OS_OBJTYPE$OS_RELEASE"
81 ;;
82 esac
83
84 case "$buildtype" in
85 "opt")
86 OBJDIR_TAG="_OPT"
87 ;;
88 "debug")
89 OBJDIR_TAG="_DBG"
90 ;;
91 *)
92 error "Unknown build type $buildtype"
93 esac
94
95
96
97 # Name of the binary code directories
98 if [[ -z "$OBJDIR_TAG" ]]; then
99 true
100 elif [[ -n "$BUILD_IDG" ]]; then
101 JS_OBJDIR="$OS_CONFIG$OBJDIR_TAG.OBJD"
102 else
103 JS_OBJDIR="$OS_CONFIG$OBJDIR_TAG.OBJ"
104 fi
105