blob: 6f942207f70b787c1e5801ce0ecb28f4e5c17380 [file] [log] [blame]
Damjan Jovanovicca68acd2016-08-07 19:24:03 +00001#!/bin/sh
2###############################################################
3#
4# Licensed to the Apache Software Foundation (ASF) under one
5# or more contributor license agreements. See the NOTICE file
6# distributed with this work for additional information
7# regarding copyright ownership. The ASF licenses this file
8# to you under the Apache License, Version 2.0 (the
9# "License"); you may not use this file except in compliance
10# with the License. You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing,
15# software distributed under the License is distributed on an
16# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17# KIND, either express or implied. See the License for the
18# specific language governing permissions and limitations
19# under the License.
20#
21###############################################################
22
23# if no environment is set, try to find one, and source it
24# user can override auto-detection via SOLAR_SHELL_ENVIRONMENT
25# it is not currently possible to handle corner cases like you have an
26# AMD64 linux box, create configure environments for both x86 and x86_64,
27# and then expect to auto-detect both.
28# use SOLAR_SHELL_ENVIRONMENT in such cases.
29
30me=source_soenv.sh
31
32if test -n "${SOLARENV}"; then
33 echo "$me: error: only call this if you do not have an environment set!"
34 exit 1
35fi
36
37if test -n "${SOLAR_SHELL_ENVIRONMENT}"; then
38 if test -f "${SOLAR_SHELL_ENVIRONMENT}"; then
39 . "${SOLAR_SHELL_ENVIRONMENT}"
40 else
41 echo "$me: error: \$SOLAR_SHELL_ENVIRONMENT set, but the file does not exist"
42 exit 1
43 fi
44else
45 config_guess_result=`./config.guess`
46 case "${config_guess_result}" in
47 i[3456]86-*-solaris*)
48 . ./SolarisX86Env.Set.sh
49 ;;
50 sparc-*-solaris*)
51 . ./SolarisSparcEnv.Set.sh
52 ;;
53 i[3456]86-*-linux*)
54 . ./LinuxX86Env.Set.sh
55 ;;
56 x86_64-*-linux*)
57 . ./LinuxX86-64Env.Set.sh
58 ;;
59 ia64-*-linux*)
60 . ./LinuxIA64Env.Set.sh
61 ;;
62 sparc-*-linux*)
63 . ./LinuxSparcEnv.Set.sh
64 ;;
65 powerpc-*-linux*)
66 . ./LinuxPPCEnv.Set.sh
67 ;;
68 powerpc64-*-linux*)
69 . ./LinuxPPC64Env.Set.sh
70 ;;
71 s390-*-linux*)
72 . ./LinuxS390Env.Set.sh
73 ;;
74 s390x-*-linux*)
75 . ./LinuxS390XEnv.Set.sh
76 ;;
77 m68k-*-linux*)
78 . ./LinuxM68KEnv.Set.sh
79 ;;
80 hppa-*-linux*)
81 . ./LinuxHPPAEnv.Set.sh
82 ;;
83 alpha-*-linux*)
84 . ./LinuxAlphaEnv.Set.sh
85 ;;
86 arm*-*-linux*)
87 . ./LinuxARMEnv.Set.sh
88 ;;
89 mips-*-linux*)
90 . ./LinuxMIPSEnv.Set.sh
91 ;;
92 i386-*-freebsd*)
93 . ./FreeBSDX86Env.Set.sh
94 ;;
95 amd64-*-freebsd*|x86_64-*-freebsd*)
96 . ./FreeBSDAMDEnv.Set.sh
97 ;;
Pedro Giffuni3233dc02017-01-26 18:04:03 +000098 arm*-*-freebsd*)
99 . ./FreeBSDARMEnv.Set.sh
100 ;;
101 powerpc-*-freebsd*)
102 . ./FreeBSDPPCEnv.Set.sh
103 ;;
104 powerpc64-*-freebsd*)
105 . ./FreeBSDPPC64Env.Set.sh
106 ;;
Damjan Jovanovicca68acd2016-08-07 19:24:03 +0000107 # the result here (whether you get x86_64) seems to depend on $CC...
108 i[3456]86-*-darwin*|x86_64-*-darwin*)
Jim Jagielski10810252017-08-15 11:51:00 +0000109 . ./MacOSXX64Env.Set.sh
Damjan Jovanovicca68acd2016-08-07 19:24:03 +0000110 ;;
111 powerpc-*-darwin*)
112 . ./MacOSXPPCEnv.Set.sh
113 ;;
114 *-cygwin*)
115 . ./winenv.set.sh || . ./winmingw.set.sh
116 ;;
117 *)
118 echo "$me: error: unknown *Env.Set.sh for: ${config_guess_result}"
119 exit 1
120 ;;
121 esac
122fi
123if test -z "${SOLARENV}"; then
124 echo "$me: error: No environment set!"
125 exit 1
126fi
127