Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4758a2b8
Commit
4758a2b8
authored
Aug 30, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portability fix in BUILD/* for solaris
parent
739243bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
179 additions
and
176 deletions
+179
-176
BUILD/check-cpu
BUILD/check-cpu
+179
-176
No files found.
BUILD/check-cpu
View file @
4758a2b8
...
@@ -3,9 +3,9 @@
...
@@ -3,9 +3,9 @@
# Check cpu of current machine and find the
# Check cpu of current machine and find the
# best compiler optimization flags for gcc
# best compiler optimization flags for gcc
#
#
#
if
test
-r
/proc/cpuinfo
;
then
check_cpu
()
{
if
test
-r
/proc/cpuinfo
;
then
# on Linux (and others?) we can get detailed CPU information out of /proc
# on Linux (and others?) we can get detailed CPU information out of /proc
cpuinfo
=
"cat /proc/cpuinfo"
cpuinfo
=
"cat /proc/cpuinfo"
...
@@ -31,7 +31,7 @@ if test -r /proc/cpuinfo ; then
...
@@ -31,7 +31,7 @@ if test -r /proc/cpuinfo ; then
for
flag
in
`
$cpuinfo
|
grep
'^flags'
|
sed
-e
's/^flags.*: //'
`
;
do
for
flag
in
`
$cpuinfo
|
grep
'^flags'
|
sed
-e
's/^flags.*: //'
`
;
do
eval
cpu_flag_
$flag
=
yes
eval
cpu_flag_
$flag
=
yes
done
done
else
else
# Fallback when there is no /proc/cpuinfo
# Fallback when there is no /proc/cpuinfo
case
"
`
uname
-s
`
"
in
case
"
`
uname
-s
`
"
in
FreeBSD|OpenBSD
)
FreeBSD|OpenBSD
)
...
@@ -47,12 +47,12 @@ else
...
@@ -47,12 +47,12 @@ else
model_name
=
`
uname
-p
`
;
model_name
=
`
uname
-p
`
;
;;
;;
esac
esac
fi
fi
# detect CPU shortname as used by gcc options
# detect CPU shortname as used by gcc options
# this list is not complete, feel free to add further entries
# this list is not complete, feel free to add further entries
cpu_arg
=
""
cpu_arg
=
""
case
"
$cpu_family
--
$model_name
"
in
case
"
$cpu_family
--
$model_name
"
in
# DEC Alpha
# DEC Alpha
Alpha
*
EV6
*
)
Alpha
*
EV6
*
)
cpu_arg
=
"ev6"
;
cpu_arg
=
"ev6"
;
...
@@ -110,27 +110,27 @@ case "$cpu_family--$model_name" in
...
@@ -110,27 +110,27 @@ case "$cpu_family--$model_name" in
*
)
*
)
cpu_arg
=
""
;
cpu_arg
=
""
;
;;
;;
esac
esac
if
test
-z
"
$cpu_arg
"
;
then
if
test
-z
"
$cpu_arg
"
;
then
echo
"BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using."
echo
"BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using."
>
&2
check_cpu_cflags
=
""
check_cpu_cflags
=
""
return
return
fi
fi
# different compiler versions have different option names
# different compiler versions have different option names
# for CPU specific command line options
# for CPU specific command line options
if
test
-z
"
$CC
"
;
then
if
test
-z
"
$CC
"
;
then
cc
=
"gcc"
;
cc
=
"gcc"
;
else
else
cc
=
$CC
cc
=
$CC
fi
fi
cc_ver
=
`
$cc
--version
|
sed
1q
`
cc_ver
=
`
$cc
--version
|
sed
1q
`
cc_verno
=
`
echo
$cc_ver
|
sed
-e
's/[^0-9. ]//g; s/^ *//g; s/ .*//g'
`
cc_verno
=
`
echo
$cc_ver
|
sed
-e
's/[^0-9. ]//g; s/^ *//g; s/ .*//g'
`
case
"
$cc_ver
--
$cc_verno
"
in
case
"
$cc_ver
--
$cc_verno
"
in
*
GCC
*
)
*
GCC
*
)
# different gcc backends (and versions) have different CPU flags
# different gcc backends (and versions) have different CPU flags
case
`
gcc
-dumpmachine
`
in
case
`
gcc
-dumpmachine
`
in
...
@@ -161,22 +161,23 @@ case "$cc_ver--$cc_verno" in
...
@@ -161,22 +161,23 @@ case "$cc_ver--$cc_verno" in
check_cpu_cflags
=
""
check_cpu_cflags
=
""
return
return
;;
;;
esac
esac
# now we check whether the compiler really understands the cpu type
# now we check whether the compiler really understands the cpu type
touch
__test.c
touch
__test.c
while
[
"
$cpu_arg
"
]
;
do
while
[
"
$cpu_arg
"
]
;
do
echo
-n
testing
$cpu_arg
"... "
# FIXME: echo -n isn't portable - see contortions autoconf goes through
echo
-n
testing
$cpu_arg
"... "
>
&2
# compile check
# compile check
check_cpu_cflags
=
`
eval echo
$check_cpu_args
`
check_cpu_cflags
=
`
eval echo
$check_cpu_args
`
if
$cc
-c
$check_cpu_cflags
__test.c 2>/dev/null
;
then
if
$cc
-c
$check_cpu_cflags
__test.c 2>/dev/null
;
then
echo
ok
echo
ok
>
&2
break
;
break
;
fi
fi
echo
failed
echo
failed
>
&2
check_cpu_cflags
=
""
check_cpu_cflags
=
""
# if compile failed: check whether it supports a predecessor of this CPU
# if compile failed: check whether it supports a predecessor of this CPU
...
@@ -199,7 +200,9 @@ while [ "$cpu_arg" ] ; do
...
@@ -199,7 +200,9 @@ while [ "$cpu_arg" ] ; do
*
)
cpu_arg
=
""
;;
*
)
cpu_arg
=
""
;;
esac
esac
done
done
rm
__test.
*
rm
__test.
*
}
check_cpu
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment