File: mit_scheme_native_code.m4

package info (click to toggle)
mit-scheme 10.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 84,732 kB
  • sloc: lisp: 476,370; xml: 133,758; ansic: 70,366; sh: 8,696; makefile: 2,239; asm: 2,109
file content (118 lines) | stat: -rw-r--r-- 2,429 bytes parent folder | download | duplicates (4)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# MIT_SCHEME_NATIVE_CODE(SPEC, HOST_CPU)
# --------------------------------------
AC_DEFUN([MIT_SCHEME_NATIVE_CODE],[
_mit_scheme_native_code_spec=$1
_mit_scheme_native_code_host_cpu=$2

AC_MSG_CHECKING([for native-code support])
MIT_SCHEME_ARCHITECTURE([${_mit_scheme_native_code_spec}])

case ${mit_scheme_architecture} in
yes)
    case ${_mit_scheme_native_code_host_cpu} in
    i?86)
	AC_CHECK_DECL([__x86_64__],
		      [_mit_scheme_native_code_host_cpu=x86_64],
		      [_mit_scheme_native_code_host_cpu=i386])
	;;
    esac
    ;;
esac

case ${mit_scheme_architecture} in
yes)
    case ${_mit_scheme_native_code_host_cpu} in
    i386)
	mit_scheme_native_code=i386
	;;
    x86_64)
	mit_scheme_native_code=x86-64
	;;
    *)
	AC_MSG_ERROR([unable to determine host architecture])
	;;
    esac
    ;;
*)
    mit_scheme_native_code=${mit_scheme_architecture}
    ;;
esac

case ${mit_scheme_native_code} in
none)
    AC_MSG_RESULT([no])
    ;;
c)
    AC_MSG_RESULT([yes, using portable C code])
    ;;
svm1)
    AC_MSG_RESULT([yes, using portable SVM code])
    ;;
*)
    AC_MSG_RESULT([yes, for ${mit_scheme_native_code}])
    ;;
esac
])

# MIT_SCHEME_COMPILER_TARGET(SPEC)
# --------------------------------
AC_DEFUN([MIT_SCHEME_COMPILER_TARGET],[
_mit_scheme_compiler_target_spec=$1

AC_MSG_CHECKING([for compiler target])
MIT_SCHEME_ARCHITECTURE([${with_compiler_target}])

case ${mit_scheme_architecture} in
yes)
    mit_scheme_compiler_target=${mit_scheme_native_code}
    ;;
*)
    mit_scheme_compiler_target=${mit_scheme_architecture}
    ;;
esac

case ${mit_scheme_compiler_target} in
none)
    AC_MSG_RESULT([none])
    ;;
c)
    AC_MSG_RESULT([yes, using portable C code])
    ;;
svm1)
    AC_MSG_RESULT([yes, using portable SVM code])
    ;;
*)
    AC_MSG_RESULT([yes, for ${mit_scheme_compiler_target}])
    ;;
esac
])

# MIT_SCHEME_ARCHITECTURE(SPEC)
# -----------------------------
AC_DEFUN([MIT_SCHEME_ARCHITECTURE],[
_mit_scheme_architecture_spec=$1

case ${_mit_scheme_architecture_spec} in
yes|YES|y|Y)
    mit_scheme_architecture=yes
    ;;
c|C)
    mit_scheme_architecture=c
    ;;
svm|svm1)
    mit_scheme_architecture=svm1
    ;;
no|NO|none|NONE|n|N)
    mit_scheme_architecture=none
    ;;
i?86|x86)
    mit_scheme_architecture=i386
    ;;
x86-64|x86_64|amd64)
    mit_scheme_architecture=x86-64
    ;;
*)
    AC_MSG_ERROR([unknown compiler architecture: ${_mit_scheme_architecture_spec}])
    ;;
esac
])