summaryrefslogtreecommitdiff
path: root/dev-lang/polyml/files/polyml-5.5.0-configure.patch
blob: 1a2e114e65034ec4f6f2ae33a98479df44ca7d6b (plain)
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Index: polyml/configure
===================================================================
--- polyml/configure	(revision 1599)
+++ polyml/configure	(revision 1600)
@@ -20870,10 +20870,8 @@
 # Check whether --with-portable was given.
 if test "${with_portable+set}" = set; then :
   withval=$with_portable;
-    ac_cv_with_portable=yes
 else
-
-    ac_cv_with_portable=no
+  with_portable=check
 fi
 
 
@@ -20894,36 +20892,46 @@
 
 $as_echo "#define HOSTARCHITECTURE_SPARC 1" >>confdefs.h
 
-            ac_cv_with_portable=yes
+            polyarch=interpret
             ;;
       power* | ppc*)
 
 $as_echo "#define HOSTARCHITECTURE_PPC 1" >>confdefs.h
 
-            ac_cv_with_portable=yes
+            polyarch=interpret
             ;;
       arm*)
 
 $as_echo "#define HOSTARCHITECTURE_ARM 1" >>confdefs.h
 
-            ac_cv_with_portable=yes
+            polyarch=interpret
             ;;
       ia64*)
 
 $as_echo "#define HOSTARCHITECTURE_IA64 1" >>confdefs.h
 
-            ac_cv_with_portable=yes
+            polyarch=interpret
         ;;
       *) as_fn_error $? "Poly/ML is not supported for this architecture" "$LINENO" 5 ;;
 esac
 
-# If we have explicitly set --with-portable or we are on a machine without
-# a code-generator set to use the interpreter.
-if test "$ac_cv_with_portable" = "yes"; then
+# If we explicitly asked to use the interpreter set the architecture to interpreted.
+if test "x$with_portable" = "xyes" ; then
+    polyarch=interpret
+fi
 
+# If we asked not to use the interpreter check we have native code support.
+if test "x$with_portable" = "xno" ; then
+    if test "x$polyarch" = "xinterpret" ; then
+        as_fn_error $? "--without-portable was given but native code is not supported on this platform" "$LINENO" 5
+    fi
+fi
+
+# Set the define if this is the interpreter.  This is no longer actually used.
+if test "x$polyarch" = "xinterpret" ; then
+
 $as_echo "#define INTERPRETED 1" >>confdefs.h
 
-       polyarch=interpret
 fi
 
 # Put this test at the end where it's less likely to be missed.
Index: polyml/configure.ac
===================================================================
--- polyml/configure.ac	(revision 1599)
+++ polyml/configure.ac	(revision 1600)
@@ -368,10 +368,10 @@
 # Test the --with-portable option to build the interpreter even if
 # we have a code-generator.
 AC_ARG_WITH([portable],
-    [AS_HELP_STRING([--with-portable],
-              [Build the portable interpreter version of Poly/ML instead of native @<:@default=no@:>@])], [
-    ac_cv_with_portable=yes], [
-    ac_cv_with_portable=no])
+            [AS_HELP_STRING([--with-portable],
+              [Build the portable interpreter version of Poly/ML instead of native @<:@default=no@:>@])],
+            [],
+            [with_portable=check])
 
 case "${host_cpu}" in
       i[[3456]]86*)
@@ -384,28 +384,39 @@
             ;;
       sparc*)
             AC_DEFINE([HOSTARCHITECTURE_SPARC], [1], [Define if the host is a Sparc (32 bit)])
-            ac_cv_with_portable=yes
+            polyarch=interpret
             ;;
       power* | ppc*)
             AC_DEFINE([HOSTARCHITECTURE_PPC], [1], [Define if the host is a Power PC (32 bit)])
-            ac_cv_with_portable=yes
+            polyarch=interpret
             ;;
       arm*)
             AC_DEFINE([HOSTARCHITECTURE_ARM], [1], [Define if the host is an ARM (32 bit)])
-            ac_cv_with_portable=yes
+            polyarch=interpret
             ;;
       ia64*)
             AC_DEFINE([HOSTARCHITECTURE_IA64], [1], [Define if the host is Itanium])
-            ac_cv_with_portable=yes
+            polyarch=interpret
         ;;
       *) AC_MSG_ERROR([Poly/ML is not supported for this architecture]) ;;
 esac
 
-# If we have explicitly set --with-portable or we are on a machine without
-# a code-generator set to use the interpreter.
-if test "$ac_cv_with_portable" = "yes"; then
+# If we explicitly asked to use the interpreter set the architecture to interpreted.
+if test "x$with_portable" = "xyes" ; then
+    polyarch=interpret
+fi
+
+# If we asked not to use the interpreter check we have native code support.
+if test "x$with_portable" = "xno" ; then
+    if test "x$polyarch" = "xinterpret" ; then
+        AC_MSG_ERROR(
+            [--without-portable was given but native code is not supported on this platform])
+    fi
+fi
+
+# Set the define if this is the interpreter.  This is no longer actually used.
+if test "x$polyarch" = "xinterpret" ; then
        AC_DEFINE([INTERPRETED], [1], [Define if using the interpreter] )
-       polyarch=interpret
 fi
 
 # Put this test at the end where it's less likely to be missed.