forked from wbhart/bsdnt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·69 lines (62 loc) · 1.29 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/sh
CC=gcc
ARCH=`uname -m &> /dev/null`
case $ARCH in
x86_64 | amd64)
MACHINE="_x86_64";;
x86 | i*86 | pc)
MACHINE="_x86";;
*)
MACHINE="unknown";;
esac
if [ $MACHINE = "_x86" -o $MACHINE = "_x86_64" ]
then
$CC arch/cpuid.c -o cpuid
ARCH=`./cpuid &> /dev/null`
case $ARCH in
k10)
EXTS="_k10 _k8";;
k8)
EXTS="_k8";;
atom)
EXTS="_atom";;
nehalem)
EXTS="_nehalem _core2";;
core2)
EXTS="_core2";;
p4)
EXTS="_p4";;
* | x86)
EXTS="";;
esac
for file in *.c
do
name=${file%\.*}
echo "#ifndef ${name}_H" > ${name}_arch.h
echo "#define ${name}_H" >> ${name}_arch.h
for ext in $EXTS
do
hname=arch/$name$MACHINE$ext.h
if [ -f $hname ]
then
echo "#include \"${hname}\"" >> ${name}_arch.h
fi
hname=arch/$name$MACHINE.h
if [ -f $hname ]
then
echo "#include \"${hname}\"" >> ${name}_arch.h
fi
done
echo "#endif" >> ${name}_arch.h
done
fi
if [ $MACHINE = "unknown" ]
then
for file in nn*.c
do
name=${file%\.*}
echo "#ifndef ${name}_H" > ${name}_arch.h
echo "#define ${name}_H" >> ${name}_arch.h
echo "#endif" >> ${name}_arch.h
done
fi