summaryrefslogtreecommitdiff
path: root/math/R/patches/patch-ac
blob: c542add0dabac08c2443dfd42f87c525e526eeb4 (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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
$NetBSD: patch-ac,v 1.35 2015/07/03 12:45:03 joerg Exp $

Do not include system paths in R_LD_LIBRARY_PATH.
FreeBSD 10 is not FreeBSD 1.
Fix texi2any version check.

--- configure.orig	2015-06-10 22:16:27.000000000 +0000
+++ configure
@@ -4012,7 +4012,7 @@ fi
 
 ## As from R 3.2.0 split up -L... and -lR
 if test "${want_R_shlib}" = yes; then
-  LIBR0="-L\$(R_HOME)/lib\$(R_ARCH)"
+  LIBR0="-Wl,-R${prefix}/lib/R/lib\$(R_ARCH) -L\$(R_HOME)/lib\$(R_ARCH)"
   LIBR1=-lR
 else
   LIBR0=
@@ -4078,7 +4078,7 @@ fi
 if test "x${want_lto}" != xno; then
   LTO=-flto
 fi
-if test "x${want_lto}" == xyes; then
+if test "x${want_lto}" = xyes; then
   LTOALL=-flto
 fi
 
@@ -5270,7 +5270,7 @@ if test -z "${texi2any_version_maj}" \
      || test -z "${texi2any_version_min}"; then
   r_cv_prog_texi2any_v5=no
 elif test ${texi2any_version_maj} -lt 5 \
-     || test ${texi2any_version_min} -lt 1; then
+     || test ${texi2any_version_maj} = 5 -a ${texi2any_version_min} -lt 1; then
   r_cv_prog_texi2any_v5=no
 else
   r_cv_prog_texi2any_v5=yes
@@ -19921,7 +19921,7 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
+freebsd1|freebsd1.*)
   dynamic_linker=no
   ;;
 
@@ -20514,7 +20514,7 @@ case "${host_os}" in
     ## look-up sequence. Such automatic override has proven to break things
     ## like system frameworks (e.g. ImageIO or OpenGL framework).
     ;;
-  *)
+  donotuse*)
     for arg in ${LDFLAGS}; do
       case "${arg}" in
         -L*)
@@ -23188,6 +23188,11 @@ fi
 	  done
 	  ;;
 	-[lLR]*)
+            case $ac_arg in
+            -R*)
+                ac_arg="${wl}$ac_arg"
+                ;;
+            esac
 	    ac_exists=false
   for ac_i in $ac_cv_f77_libs; do
     if test x"$ac_arg" = x"$ac_i"; then
@@ -24153,6 +24158,9 @@ cat > conftest.c <<EOF
 
 extern void F77_SYMBOL(cftest)(int *a, int *b, double *x, double *y);
 
+int MAIN_ () { return 0; }
+int MAIN__ () { return 0; }
+
 int main () {
   int a[3] = {17, 237, 2000000000}, b[2], res = 0;
   double x[3] = {3.14159265, 123.456789, 2.3e34}, z[3];
@@ -24248,6 +24256,9 @@ typedef struct {
 
 extern void F77_SYMBOL(cftest)(Rcomplex *x);
 
+int MAIN_ () { return 0; }
+int MAIN__ () { return 0; }
+
 int main () {
     Rcomplex z[3];
 
@@ -26452,12 +26463,12 @@ $as_echo "$as_me: WARNING: Use of flat n
       SHLIB_LIBADD="-lcc_dynamic"
     fi
     ;;
-  freebsd*)
-    main_ldflags="-export-dynamic"
+  freebsd*|dragonfly*)
+    main_ldflags="${wl}-export-dynamic"
     shlib_ldflags="-shared"
     ;;
   gnu*)				# GNU Hurd
-    main_ldflags="-export-dynamic"
+    main_ldflags="${wl}-export-dynamic"
     ;;
   hpux*)
     SHLIB_EXT=".sl"
@@ -26543,8 +26554,15 @@ $as_echo "$as_me: WARNING: Use of flat n
     fcpicflags=
     ;;
   netbsd*)
+     fpicflags="-fPIC"
+     case "${host_cpu}" in
+       powerpc*)
+        cpicflags="-fPIC"
+        ;;
+     esac
+
     if ${CPP} - -dM < /dev/null | grep __ELF__ >/dev/null ; then
-      main_ldflags="-export-dynamic"
+      main_ldflags="${wl}-export-dynamic"
       shlib_ldflags="-shared"
     else
       shlib_ldflags="-Bshareable"
@@ -26566,22 +26584,22 @@ $as_echo "$as_me: WARNING: Use of flat n
   solaris*)
 ## SPARC has only an 8k global object table, 1024 entries on 64-bit,
 ## so need PIC not pic.  They are the same on other Solaris platforms.
-    shlib_ldflags="-G"
-    shlib_cxxldflags="-G"
    if test "${GCC}" = yes; then
+      shlib_ldflags="-shared"
+      shlib_cxxldflags="-shared"
       cpicflags="-fPIC"
       ld=`${CC} -print-prog-name=ld`
       ldoutput=`${ld} -v 2>&1 | grep GNU`
       if test -n "${ldoutput}"; then
 	main_ldflags="-Wl,-export-dynamic"
-	shlib_ldflags="-shared"
-        shlib_cxxldflags="-shared"
       else
         ## it seems gcc c 4.6.2 needs this with Solaris linker
 	shlib_ldflags="-shared"
         shlib_cxxldflags="-shared"
       fi
     else
+      shlib_ldflags="-G"
+      shlib_cxxldflags="-G"
       cpicflags="-KPIC"
       if test "`basename ${CXX}`" = "CC" ; then
         ## Forte version 7 needs -lCstd: Forte 6 does not.
@@ -26642,7 +26660,7 @@ fi
 : ${CPICFLAGS="${cpicflags}"}
 if test -z "${CPICFLAGS}"; then
   case "${host_os}" in
-    aix*|cygwin*|irix*|mingw*|osf*)
+    aix*|cygwin*|irix*|mingw*|osf*|darwin*)
       ;;
     *)
       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: I could not determine CPICFLAGS." >&5
@@ -27338,6 +27356,14 @@ _ACEOF
 ## Cygwin has rintl but not nearbyintl
 for ac_func in expm1 hypot log1p log1pl log2 log10 nearbyint nearbyintl powl rint rintl
 do
+case $ac_func in
+expm1|log1p|log2|log10|nearbyint|nearbyintl|rint|rintl)
+    args="x"
+    ;;
+hypot|powl)
+    args="x,x"
+    ;;
+esac
 as_ac_Symbol=`$as_echo "ac_cv_have_decl_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_func exists and is declared" >&5
 $as_echo_n "checking whether $ac_func exists and is declared... " >&6; }
@@ -27347,24 +27373,12 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <math.h>
+volatile long double x;
 
-#ifdef F77_DUMMY_MAIN
-
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-
-#endif
 int
 main ()
 {
-#ifndef $ac_func
-  char *p = (char *) $ac_func;
-#endif
-
-  ;
-  return 0;
+  return $ac_func($args);
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
@@ -30274,6 +30288,15 @@ cat > conftest.c <<EOF
 #endif
 extern void F77_SYMBOL(test1)(int *iflag);
 
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+
 int main () {
   int iflag;
   F77_SYMBOL(test1)(&iflag);
@@ -30338,6 +30361,14 @@ else
 #else
 # define F77_SYMBOL(x)   x
 #endif
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
 void F77_SYMBOL(xerbla)(char *srname, int *info)
 {}
 void blas_set () {
@@ -38953,7 +38984,7 @@ case "${host_os}" in
     r_ld_library_defaults="/usr/lib64:/lib64:/usr/lib:/lib"
     ;;
   solaris*)
-    r_ld_library_defaults="/usr/lib:/lib"
+    r_ld_library_defaults="/usr/lib:/lib:/usr/lib/amd64:/lib/amd64:/usr/lib/64:/lib/64"
     ;;
   darwin*)
     r_ld_library_defaults="/usr/X11R6/lib"