author | anthony |
Wed, 16 May 2012 14:28:12 +0400 | |
changeset 12654 | 9c691a35d1da |
parent 12258 | 6ec26f6cc53e |
child 12801 | 948f8ad66ee7 |
permissions | -rw-r--r-- |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
1 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
2 |
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
4 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
10 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
15 |
# accompanied this code). |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
16 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
20 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
23 |
# questions. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
24 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
25 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
26 |
AC_DEFUN([CHECK_FIND_DELETE], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
27 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
28 |
# Test if find supports -delete |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
29 |
AC_MSG_CHECKING([if find supports -delete]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
30 |
FIND_DELETE="-delete" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
31 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
32 |
DELETEDIR=`mktemp -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
33 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
34 |
echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
35 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
36 |
TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
37 |
if test -f $DELETEDIR/TestIfFindSupportsDelete; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
38 |
# No, it does not. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
39 |
rm $DELETEDIR/TestIfFindSupportsDelete |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
40 |
FIND_DELETE="-exec rm \{\} \+" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
41 |
AC_MSG_RESULT([no]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
42 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
43 |
AC_MSG_RESULT([yes]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
44 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
45 |
rmdir $DELETEDIR |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
46 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
47 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
48 |
AC_DEFUN([CHECK_NONEMPTY], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
49 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
50 |
# Test that variable $1 is not empty. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
51 |
if test "" = "[$]$1"; then AC_ERROR(Could not find translit($1,A-Z,a-z) !); fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
52 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
53 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
54 |
AC_DEFUN([ADD_JVM_ARG_IF_OK], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
55 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
56 |
# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
57 |
# If so, then append $1 to $2 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
58 |
FOUND_WARN=`$3 $1 -version 2>&1 | grep -i warn` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
59 |
FOUND_VERSION=`$3 $1 -version 2>&1 | grep " version \""` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
60 |
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
61 |
$2="[$]$2 $1" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
62 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
63 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
64 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
65 |
AC_DEFUN([WHICHCMD], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
66 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
67 |
# Translate "gcc -E" into "`which gcc` -E" ie |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
68 |
# extract the full path to the binary and at the |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
69 |
# same time maintain any arguments passed to it. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
70 |
# The command MUST exist in the path, or else! |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
71 |
tmp="[$]$1" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
72 |
car="${tmp%% *}" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
73 |
tmp="[$]$1 EOL" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
74 |
cdr="${tmp#* }" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
75 |
# On windows we want paths without spaces. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
76 |
if test "x$BUILD_OS" = "xwindows"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
77 |
WHICHCMD_SPACESAFE(car) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
78 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
79 |
# "which" is not portable, but is used here |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
80 |
# because we know that the command exists! |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
81 |
car=`which $car` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
82 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
83 |
if test "x$cdr" != xEOL; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
84 |
$1="$car ${cdr% *}" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
85 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
86 |
$1="$car" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
87 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
88 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
89 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
90 |
AC_DEFUN([SPACESAFE], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
91 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
92 |
# Fail with message $2 if var $1 contains a path with no spaces in it. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
93 |
# Unless on Windows, where we can rewrite the path. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
94 |
HAS_SPACE=`echo "[$]$1" | grep " "` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
95 |
if test "x$HAS_SPACE" != x; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
96 |
if test "x$BUILD_OS" = "xwindows"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
97 |
$1=`$CYGPATH -s -m -a "[$]$1"` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
98 |
$1=`$CYGPATH -u "[$]$1"` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
99 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
100 |
AC_ERROR([You cannot have spaces in $2! "[$]$1"]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
101 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
102 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
103 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
104 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
105 |
AC_DEFUN([WHICHCMD_SPACESAFE], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
106 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
107 |
# Translate long cygdrive or C:\sdfsf path |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
108 |
# into a short mixed mode path that has no |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
109 |
# spaces in it. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
110 |
tmp="[$]$1" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
111 |
if test "x$BUILD_OS" = "xwindows"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
112 |
tmp=`$CYGPATH -u "[$]$1"` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
113 |
tmp=`which "$tmp"` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
114 |
# If file exists with .exe appended, that's the real filename |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
115 |
# and cygpath needs that to convert to short style path. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
116 |
if test -f "${tmp}.exe"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
117 |
tmp="${tmp}.exe" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
118 |
elif test -f "${tmp}.cmd"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
119 |
tmp="${tmp}.cmd" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
120 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
121 |
# Convert to C:/ mixed style path without spaces. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
122 |
tmp=`$CYGPATH -s -m "$tmp"` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
123 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
124 |
$1="$tmp" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
125 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
126 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
127 |
AC_DEFUN([REMOVE_SYMBOLIC_LINKS], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
128 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
129 |
if test "x$BUILD_OS" != xwindows; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
130 |
# Follow a chain of symbolic links. Use readlink |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
131 |
# where it exists, else fall back to horribly |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
132 |
# complicated shell code. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
133 |
AC_PATH_PROG(READLINK, readlink) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
134 |
if test "x$READLINK_TESTED" != yes; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
135 |
# On MacOSX there is a readlink tool with a different |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
136 |
# purpose than the GNU readlink tool. Check the found readlink. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
137 |
ISGNU=`$READLINK --help 2>&1 | grep GNU` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
138 |
if test "x$ISGNU" = x; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
139 |
# A readlink that we do not know how to use. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
140 |
# Are there other non-GNU readlinks out there? |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
141 |
READLINK_TESTED=yes |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
142 |
READLINK= |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
143 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
144 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
145 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
146 |
if test "x$READLINK" != x; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
147 |
$1=`$READLINK -f [$]$1` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
148 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
149 |
STARTDIR=$PWD |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
150 |
COUNTER=0 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
151 |
DIR=`dirname [$]$1` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
152 |
FIL=`basename [$]$1` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
153 |
while test $COUNTER -lt 20; do |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
154 |
ISLINK=`ls -l $DIR/$FIL | grep '\->' | sed -e 's/.*-> \(.*\)/\1/'` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
155 |
if test "x$ISLINK" == x; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
156 |
# This is not a symbolic link! We are done! |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
157 |
break |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
158 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
159 |
# The link might be relative! We have to use cd to travel safely. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
160 |
cd $DIR |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
161 |
cd `dirname $ISLINK` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
162 |
DIR=`pwd` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
163 |
FIL=`basename $ISLINK` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
164 |
let COUNTER=COUNTER+1 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
165 |
done |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
166 |
cd $STARTDIR |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
167 |
$1=$DIR/$FIL |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
168 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
169 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
170 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
171 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
172 |
AC_DEFUN([TESTFOR_PROG_CCACHE], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
173 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
174 |
AC_ARG_ENABLE([ccache], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
175 |
[AS_HELP_STRING([--disable-ccache], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
176 |
[use ccache to speed up recompilations @<:@enabled@:>@])], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
177 |
[ENABLE_CCACHE=${enable_ccache}], [ENABLE_CCACHE=yes]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
178 |
if test "x$ENABLE_CCACHE" = xyes; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
179 |
AC_PATH_PROG(CCACHE, ccache) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
180 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
181 |
AC_MSG_CHECKING([for ccache]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
182 |
AC_MSG_RESULT([explicitly disabled]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
183 |
CCACHE= |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
184 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
185 |
AC_SUBST(CCACHE) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
186 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
187 |
AC_ARG_WITH([ccache-dir], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
188 |
[AS_HELP_STRING([--with-ccache-dir], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
189 |
[where to store ccache files @<:@~/.ccache@:>@])]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
190 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
191 |
if test "x$with_ccache_dir" != x; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
192 |
# When using a non home ccache directory, assume the use is to share ccache files |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
193 |
# with other users. Thus change the umask. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
194 |
SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
195 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
196 |
CCACHE_FOUND="" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
197 |
if test "x$CCACHE" != x; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
198 |
SETUP_CCACHE_USAGE |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
199 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
200 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
201 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
202 |
AC_DEFUN([SETUP_CCACHE_USAGE], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
203 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
204 |
if test "x$CCACHE" != x; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
205 |
CCACHE_FOUND="true" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
206 |
# Only use ccache if it is 3.1.4 or later, which supports |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
207 |
# precompiled headers. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
208 |
AC_MSG_CHECKING([if ccache supports precompiled headers]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
209 |
HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.@<:@456789@:>@) 2> /dev/null` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
210 |
if test "x$HAS_GOOD_CCACHE" = x; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
211 |
AC_MSG_RESULT([no, disabling ccache]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
212 |
CCACHE= |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
213 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
214 |
AC_MSG_RESULT([yes]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
215 |
AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
216 |
PUSHED_FLAGS="$CXXFLAGS" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
217 |
CXXFLAGS="-fpch-preprocess $CXXFLAGS" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
218 |
AC_TRY_COMPILE([], [], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
219 |
CXXFLAGS="$PUSHED_FLAGS" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
220 |
if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
221 |
AC_MSG_RESULT([yes]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
222 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
223 |
AC_MSG_RESULT([no, disabling ccaching of precompiled headers]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
224 |
CCACHE= |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
225 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
226 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
227 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
228 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
229 |
if test "x$CCACHE" != x; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
230 |
CCACHE_SLOPPINESS=time_macros |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
231 |
CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
232 |
CCACHE_FLAGS=-fpch-preprocess |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
233 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
234 |
if test "x$SET_CCACHE_DIR" != x; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
235 |
mkdir -p $CCACHE_DIR > /dev/null 2>&1 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
236 |
chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
237 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
238 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
239 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
240 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
241 |
AC_DEFUN([EXTRACT_HOST_AND_BUILD_AND_LEGACY_VARS], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
242 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
243 |
# Expects $host_os $host_cpu $build_os and $build_cpu |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
244 |
# and $with_data_model to have been setup! |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
245 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
246 |
# Translate the standard triplet(quadruplet) definition |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
247 |
# of the host/build system into |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
248 |
# HOST_OS=aix,bsd,hpux,linux,macosx,solaris,windows |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
249 |
# HOST_OS_FAMILY=bsd,gnu,sysv,win32,wince |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
250 |
# HOST_OS_API=posix,winapi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
251 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
252 |
# HOST_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
253 |
# HOST_CPU_ARCH=x86,sparc,pcc,arm |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
254 |
# HOST_CPU_BITS=32,64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
255 |
# HOST_CPU_ENDIAN=big,little |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
256 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
257 |
# The same values are setup for BUILD_... |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
258 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
259 |
# And the legacy variables, for controlling the old makefiles. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
260 |
# LEGACY_HOST_CPU1=i586,amd64,sparc,sparcv9,arm,arm64... |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
261 |
# LEGACY_HOST_CPU2=i386,amd64,sparc,sparcv9,arm,arm64... |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
262 |
# LEGACY_HOST_CPU3=sparcv9,amd64 (but only on solaris) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
263 |
# LEGACY_HOST_OS_API=solaris,windows |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
264 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
265 |
# We also copy the autoconf trip/quadruplet |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
266 |
# verbatim to HOST and BUILD |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
267 |
AC_SUBST(HOST, ${host}) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
268 |
AC_SUBST(BUILD, ${build}) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
269 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
270 |
EXTRACT_VARS_FROM_OS_TO(HOST,$host_os) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
271 |
EXTRACT_VARS_FROM_CPU_TO(HOST,$host_cpu) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
272 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
273 |
EXTRACT_VARS_FROM_OS_TO(BUILD,$build_os) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
274 |
EXTRACT_VARS_FROM_CPU_TO(BUILD,$build_cpu) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
275 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
276 |
if test "x$HOST_OS" != xsolaris; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
277 |
LEGACY_HOST_CPU3="" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
278 |
LEGACY_BUILD_CPU3="" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
279 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
280 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
281 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
282 |
AC_DEFUN([EXTRACT_VARS_FROM_OS_TO], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
283 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
284 |
EXTRACT_VARS_FROM_OS($2) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
285 |
$1_OS="$VAR_OS" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
286 |
$1_OS_FAMILY="$VAR_OS_FAMILY" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
287 |
$1_OS_API="$VAR_OS_API" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
288 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
289 |
AC_SUBST($1_OS) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
290 |
AC_SUBST($1_OS_FAMILY) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
291 |
AC_SUBST($1_OS_API) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
292 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
293 |
if test "x$$1_OS_API" = xposix; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
294 |
LEGACY_$1_OS_API="solaris" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
295 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
296 |
if test "x$$1_OS_API" = xwinapi; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
297 |
LEGACY_$1_OS_API="windows" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
298 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
299 |
AC_SUBST(LEGACY_$1_OS_API) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
300 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
301 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
302 |
AC_DEFUN([EXTRACT_VARS_FROM_CPU_TO], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
303 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
304 |
EXTRACT_VARS_FROM_CPU($2) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
305 |
$1_CPU="$VAR_CPU" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
306 |
$1_CPU_ARCH="$VAR_CPU_ARCH" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
307 |
$1_CPU_BITS="$VAR_CPU_BITS" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
308 |
$1_CPU_ENDIAN="$VAR_CPU_ENDIAN" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
309 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
310 |
AC_SUBST($1_CPU) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
311 |
AC_SUBST($1_CPU_ARCH) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
312 |
AC_SUBST($1_CPU_BITS) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
313 |
AC_SUBST($1_CPU_ENDIAN) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
314 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
315 |
# Also store the legacy naming of the cpu. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
316 |
# Ie i586 and amd64 instead of ia32 and x64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
317 |
LEGACY_$1_CPU1="$VAR_LEGACY_CPU" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
318 |
AC_SUBST(LEGACY_$1_CPU1) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
319 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
320 |
# And the second legacy naming of the cpu. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
321 |
# Ie i386 and amd64 instead of ia32 and x64. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
322 |
LEGACY_$1_CPU2="$LEGACY_$1_CPU1" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
323 |
if test "x$LEGACY_$1_CPU1" = xi586; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
324 |
LEGACY_$1_CPU2=i386 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
325 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
326 |
AC_SUBST(LEGACY_$1_CPU2) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
327 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
328 |
# And the third legacy naming of the cpu. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
329 |
# Ie only amd64 or sparcv9, used for the ISA_DIR on Solaris. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
330 |
LEGACY_$1_CPU3="" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
331 |
if test "x$$1_CPU" = xx64; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
332 |
LEGACY_$1_CPU3=amd64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
333 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
334 |
if test "x$$1_CPU" = xsparcv9; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
335 |
LEGACY_$1_CPU3=sparvc9 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
336 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
337 |
AC_SUBST(LEGACY_$1_CPU3) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
338 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
339 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
340 |
AC_DEFUN([EXTRACT_VARS_FROM_CPU], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
341 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
342 |
# First argument is the cpu name from the trip/quad |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
343 |
case "$1" in |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
344 |
x86_64) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
345 |
VAR_CPU=x64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
346 |
VAR_CPU_ARCH=x86 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
347 |
VAR_CPU_BITS=64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
348 |
VAR_CPU_ENDIAN=little |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
349 |
VAR_LEGACY_CPU=amd64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
350 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
351 |
i?86) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
352 |
VAR_CPU=ia32 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
353 |
VAR_CPU_ARCH=x86 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
354 |
VAR_CPU_BITS=32 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
355 |
VAR_CPU_ENDIAN=little |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
356 |
VAR_LEGACY_CPU=i586 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
357 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
358 |
alpha*) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
359 |
VAR_CPU=alpha |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
360 |
VAR_CPU_ARCH=alpha |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
361 |
VAR_CPU_BITS=64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
362 |
VAR_CPU_ENDIAN=big |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
363 |
VAR_LEGACY_CPU=alpha |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
364 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
365 |
arm*) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
366 |
VAR_CPU=arm |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
367 |
VAR_CPU_ARCH=arm |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
368 |
VAR_CPU_BITS=3264 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
369 |
VAR_CPU_ENDIAN=big |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
370 |
VAR_LEGACY_CPU=arm |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
371 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
372 |
mips) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
373 |
VAR_CPU=mips |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
374 |
VAR_CPU_ARCH=mips |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
375 |
VAR_CPU_BITS=woot |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
376 |
VAR_CPU_ENDIAN=woot |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
377 |
VAR_LEGACY_CPU=mips |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
378 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
379 |
mipsel) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
380 |
VAR_CPU=mipsel |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
381 |
VAR_CPU_ARCH=mips |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
382 |
VAR_CPU_BITS=woot |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
383 |
VAR_CPU_ENDIAN=woot |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
384 |
VAR_LEGACY_CPU=mipsel |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
385 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
386 |
powerpc) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
387 |
VAR_CPU=ppc |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
388 |
VAR_CPU_ARCH=ppc |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
389 |
VAR_CPU_BITS=32 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
390 |
VAR_CPU_ENDIAN=big |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
391 |
VAR_LEGACY_CPU=ppc |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
392 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
393 |
powerpc64) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
394 |
VAR_CPU=ppc64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
395 |
VAR_CPU_ARCH=ppc |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
396 |
VAR_CPU_BITS=64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
397 |
VAR_CPU_ENDIAN=32 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
398 |
VAR_LEGACY_CPU=ppc64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
399 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
400 |
sparc) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
401 |
VAR_CPU=sparc |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
402 |
VAR_CPU_ARCH=sparc |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
403 |
VAR_CPU_BITS=32 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
404 |
VAR_CPU_ENDIAN=big |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
405 |
VAR_LEGACY_CPU=sparc |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
406 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
407 |
sparc64) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
408 |
VAR_CPU=sparcv9 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
409 |
VAR_CPU_ARCH=sparc |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
410 |
VAR_CPU_BITS=64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
411 |
VAR_CPU_ENDIAN=big |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
412 |
VAR_LEGACY_CPU=sparc_sparcv9 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
413 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
414 |
s390) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
415 |
VAR_CPU=s390 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
416 |
VAR_CPU_ARCH=s390 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
417 |
VAR_CPU_BITS=32 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
418 |
VAR_CPU_ENDIAN=woot |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
419 |
VAR_LEGACY_CPU=s390 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
420 |
VAR_LEGACY_CPU=s390 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
421 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
422 |
s390x) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
423 |
VAR_CPU=s390x |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
424 |
VAR_CPU_ARCH=s390 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
425 |
VAR_CPU_BITS=64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
426 |
VAR_CPU_ENDIAN=woot |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
427 |
VAR_LEGACY_CPU=s390x |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
428 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
429 |
*) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
430 |
AC_ERROR([unsupported cpu $1]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
431 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
432 |
esac |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
433 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
434 |
# Workaround cygwin not knowing about 64 bit. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
435 |
if test "x$VAR_OS" = "xwindows"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
436 |
if test "x$PROCESSOR_IDENTIFIER" != "x"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
437 |
PROC_ARCH=`echo $PROCESSOR_IDENTIFIER | $CUT -f1 -d' '` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
438 |
case "$PROC_ARCH" in |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
439 |
intel64|Intel64|INTEL64|em64t|EM64T|amd64|AMD64|8664|x86_64) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
440 |
VAR_CPU=x64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
441 |
VAR_CPU_BITS=64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
442 |
VAR_LEGACY_CPU=amd64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
443 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
444 |
esac |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
445 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
446 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
447 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
448 |
if test "x$VAR_CPU_ARCH" = "xx86"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
449 |
if test "x$with_data_model" = "x64"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
450 |
VAR_CPU=x64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
451 |
VAR_CPU_BITS=64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
452 |
VAR_LEGACY_CPU=amd64 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
453 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
454 |
if test "x$with_data_model" = "x32"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
455 |
VAR_CPU=ia32 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
456 |
VAR_CPU_BITS=32 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
457 |
VAR_LEGACY_CPU=i586 |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
458 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
459 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
460 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
461 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
462 |
AC_DEFUN([EXTRACT_VARS_FROM_OS], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
463 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
464 |
case "$1" in |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
465 |
*linux*) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
466 |
VAR_OS=linux |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
467 |
VAR_OS_API=posix |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
468 |
VAR_OS_FAMILY=gnu |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
469 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
470 |
*solaris*) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
471 |
VAR_OS=solaris |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
472 |
VAR_OS_API=posix |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
473 |
VAR_OS_FAMILY=sysv |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
474 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
475 |
*darwin*) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
476 |
VAR_OS=macosx |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
477 |
VAR_OS_API=posix |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
478 |
VAR_OS_FAMILY=bsd |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
479 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
480 |
*bsd*) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
481 |
VAR_OS=bsd |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
482 |
VAR_OS_API=posix |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
483 |
VAR_OS_FAMILY=bsd |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
484 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
485 |
*cygwin*|*windows*) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
486 |
VAR_OS=windows |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
487 |
VAR_OS_API=winapi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
488 |
VAR_OS_FAMILY=windows |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
489 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
490 |
*) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
491 |
AC_MSG_ERROR([unsupported host operating system $1]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
492 |
;; |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
493 |
esac |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
494 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
495 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
496 |
AC_DEFUN([CHECK_COMPILER_VERSION], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
497 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
498 |
# Test the compilers that their versions are new enough. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
499 |
# AC_MSG_CHECKING([version of GCC]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
500 |
gcc_ver=`${CC} -dumpversion` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
501 |
gcc_major_ver=`echo ${gcc_ver}|cut -d'.' -f1` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
502 |
gcc_minor_ver=`echo ${gcc_ver}|cut -d'.' -f2` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
503 |
# AM_CONDITIONAL(GCC_OLD, test ! ${gcc_major_ver} -ge 4 -a ${gcc_minor_ver} -ge 3) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
504 |
# AC_MSG_RESULT([${gcc_ver} (major version ${gcc_major_ver}, minor version ${gcc_minor_ver})]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
505 |
]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
506 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
507 |
# Fixes paths on windows hosts to be mixed mode short. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
508 |
AC_DEFUN([WIN_FIX_PATH], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
509 |
[ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
510 |
if test "x$BUILD_OS" = "xwindows"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
511 |
AC_PATH_PROG(CYGPATH, cygpath) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
512 |
tmp="[$]$1" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
513 |
# Convert to C:/ mixed style path without spaces. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
514 |
tmp=`$CYGPATH -s -m "$tmp"` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
515 |
$1="$tmp" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
516 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
517 |
]) |