1232
|
1 dnl aclocal.m4 -- extra macros for configuring Octave |
|
2 dnl |
2847
|
3 dnl Copyright (C) 1996, 1997 John W. Eaton |
1232
|
4 dnl |
|
5 dnl This file is part of Octave. |
|
6 dnl |
|
7 dnl Octave is free software; you can redistribute it and/or modify it |
|
8 dnl under the terms of the GNU General Public License as published by the |
|
9 dnl Free Software Foundation; either version 2, or (at your option) any |
|
10 dnl later version. |
|
11 dnl |
|
12 dnl Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 dnl for more details. |
|
16 dnl |
|
17 dnl You should have received a copy of the GNU General Public License |
|
18 dnl along with Octave; see the file COPYING. If not, write to the Free |
2548
|
19 dnl Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
|
20 dnl 02111-1307, USA. |
|
21 dnl |
2813
|
22 dnl ---------------------------------------------------------------------- |
|
23 dnl |
|
24 dnl Figure out the hardware-vendor-os info. |
|
25 dnl |
|
26 dnl OCTAVE_HOST_TYPE |
|
27 AC_DEFUN(OCTAVE_HOST_TYPE, |
|
28 [AC_CANONICAL_HOST |
|
29 if test -z "$host"; then |
|
30 host=unknown |
|
31 fi |
|
32 canonical_host_type=$host |
|
33 if test "$host" = unknown; then |
|
34 AC_MSG_WARN([configuring Octave for unknown system type |
|
35 ]) |
|
36 fi |
3130
|
37 AC_SUBST(canonical_host_type)]) |
2813
|
38 dnl |
|
39 dnl Set default value for a variable and substitute it. |
|
40 dnl |
|
41 dnl OCTAVE_SET_DEFAULT |
|
42 AC_DEFUN(OCTAVE_SET_DEFAULT, |
3176
|
43 [ifelse($#, 2, [: ${$1=$2} |
2813
|
44 ])dnl |
|
45 AC_MSG_RESULT([defining $1 to be $$1]) |
|
46 AC_SUBST($1)]) |
|
47 dnl |
|
48 dnl |
|
49 dnl OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS |
|
50 AC_DEFUN(OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS, |
|
51 [if test "${with_$1+set}" = set; then |
|
52 if test "${with_$2+set}" = set; then |
|
53 if test "$with_$2" = no; then |
|
54 true |
|
55 else |
|
56 $3 |
|
57 fi |
|
58 fi |
|
59 fi]) |
|
60 dnl |
3130
|
61 dnl Check for ar. |
|
62 dnl |
|
63 AC_DEFUN(OCTAVE_PROG_AR, |
|
64 [if test -z "$AR"; then |
|
65 AR=ar |
|
66 fi |
|
67 AC_SUBST(AR) |
|
68 |
|
69 if test -z "$ARFLAGS"; then |
|
70 ARFLAGS="rc" |
|
71 fi |
|
72 AC_SUBST(ARFLAGS) |
|
73 ]) |
|
74 dnl |
|
75 dnl See if $F77 is the GNU Fortran compiler |
|
76 dnl |
|
77 AC_DEFUN(OCTAVE_PROG_G77, |
|
78 [AC_CACHE_CHECK([whether ${F77-f77} is the GNU Fortran compiler], |
|
79 octave_cv_f77_is_g77, |
|
80 [if $use_g77; then |
|
81 octave_cv_f77_is_g77=yes |
|
82 else |
3176
|
83 echo " END" > conftest.f |
3243
|
84 foutput=`${F77-f77} -v conftest.f 2>&1 | egrep "GNU F77|FSF-g77"` |
3176
|
85 if test -n "$foutput"; then |
3130
|
86 octave_cv_f77_is_g77=yes |
3141
|
87 else |
|
88 octave_cv_f77_is_g77=no |
3130
|
89 fi |
|
90 fi]) |
|
91 ]) |
|
92 dnl |
1232
|
93 dnl See what libraries are used by the Fortran compiler. |
|
94 dnl |
|
95 dnl Write a minimal program and compile it with -v. I don't know what |
|
96 dnl to do if your compiler doesn't have -v... |
|
97 dnl |
|
98 dnl OCTAVE_FLIBS() |
|
99 AC_DEFUN(OCTAVE_FLIBS, |
2039
|
100 [AC_MSG_CHECKING([for Fortran libraries]) |
2854
|
101 AC_REQUIRE([OCTAVE_HOST_TYPE]) |
1232
|
102 AC_CACHE_VAL(octave_cv_flibs, |
3835
|
103 [[ |
1232
|
104 echo " END" > conftest.f |
|
105 foutput=`${F77-f77} -v -o conftest conftest.f 2>&1` |
3835
|
106 |
|
107 ### The easiest thing to do for xlf output is to replace all the commas |
|
108 ### with spaces. Try to only do that if the output is really from xlf, |
|
109 ### since doing that causes problems on other systems. |
|
110 |
1232
|
111 xlf_p=`echo $foutput | grep xlfentry` |
|
112 if test -n "$xlf_p"; then |
|
113 foutput=`echo $foutput | sed 's/,/ /g'` |
|
114 fi |
3835
|
115 |
1232
|
116 ld_run_path=`echo $foutput | \ |
2638
|
117 sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'` |
3835
|
118 |
|
119 ### We are only supposed to find this on Solaris systems... |
|
120 ### Uh, the run path should be absolute, shouldn't it? |
|
121 |
3074
|
122 case "$ld_run_path" in |
|
123 /*) |
|
124 if test "$ac_cv_prog_gcc" = yes; then |
|
125 ld_run_path="-Xlinker -R -Xlinker $ld_run_path" |
|
126 else |
|
127 ld_run_path="-R $ld_run_path" |
|
128 fi |
|
129 ;; |
3143
|
130 *) |
|
131 ld_run_path= |
|
132 ;; |
3074
|
133 esac |
3835
|
134 |
1232
|
135 flibs= |
|
136 lflags= |
3835
|
137 |
|
138 ### If want_arg is set, we know we want the arg to be added to the list, |
|
139 ### so we don't have to examine it. |
|
140 |
1232
|
141 want_arg= |
3835
|
142 |
1232
|
143 for arg in $foutput; do |
|
144 old_want_arg=$want_arg |
|
145 want_arg= |
3835
|
146 |
|
147 ### None of the options that take arguments expect the argument to |
|
148 ### start with a -, so pretend we didn't see anything special. |
|
149 |
3069
|
150 if test -n "$old_want_arg"; then |
|
151 case "$arg" in |
|
152 -*) |
|
153 old_want_arg= |
|
154 ;; |
|
155 esac |
|
156 fi |
1232
|
157 case "$old_want_arg" in |
|
158 '') |
|
159 case $arg in |
2641
|
160 /*.a) |
1232
|
161 exists=false |
|
162 for f in $lflags; do |
|
163 if test x$arg = x$f; then |
|
164 exists=true |
|
165 fi |
|
166 done |
|
167 if $exists; then |
|
168 arg= |
|
169 else |
|
170 lflags="$lflags $arg" |
|
171 fi |
|
172 ;; |
2351
|
173 -bI:*) |
|
174 exists=false |
|
175 for f in $lflags; do |
|
176 if test x$arg = x$f; then |
|
177 exists=true |
|
178 fi |
|
179 done |
|
180 if $exists; then |
|
181 arg= |
|
182 else |
2600
|
183 if test "$ac_cv_prog_gcc" = yes; then |
|
184 lflags="$lflags -Xlinker $arg" |
|
185 else |
|
186 lflags="$lflags $arg" |
|
187 fi |
2351
|
188 fi |
|
189 ;; |
3089
|
190 -lang* | -lcrt0.o | -lc | -lgcc) |
1232
|
191 arg= |
|
192 ;; |
|
193 -[lLR]) |
|
194 want_arg=$arg |
|
195 arg= |
|
196 ;; |
|
197 -[lLR]*) |
|
198 exists=false |
|
199 for f in $lflags; do |
|
200 if test x$arg = x$f; then |
|
201 exists=true |
|
202 fi |
|
203 done |
2862
|
204 if $exists; then |
1232
|
205 arg= |
|
206 else |
2854
|
207 case "$arg" in |
|
208 -lkernel32) |
|
209 case "$canonical_host_type" in |
|
210 *-*-cygwin32) |
3174
|
211 arg= |
2854
|
212 ;; |
|
213 *) |
|
214 lflags="$lflags $arg" |
|
215 ;; |
|
216 esac |
|
217 ;; |
3089
|
218 -lm) |
2854
|
219 ;; |
|
220 *) |
|
221 lflags="$lflags $arg" |
|
222 ;; |
|
223 esac |
1232
|
224 fi |
|
225 ;; |
|
226 -u) |
|
227 want_arg=$arg |
3069
|
228 arg= |
1232
|
229 ;; |
|
230 -Y) |
|
231 want_arg=$arg |
|
232 arg= |
|
233 ;; |
|
234 *) |
|
235 arg= |
|
236 ;; |
|
237 esac |
|
238 ;; |
|
239 -[lLR]) |
|
240 arg="$old_want_arg $arg" |
|
241 ;; |
3069
|
242 -u) |
|
243 arg="-u $arg" |
|
244 ;; |
1232
|
245 -Y) |
3835
|
246 |
|
247 ### Should probably try to ensure unique directory options here too. |
|
248 ### This probably only applies to Solaris systems, and then will only |
|
249 ### work with gcc... |
|
250 |
1232
|
251 arg=`echo $arg | sed -e 's%^P,%%'` |
|
252 SAVE_IFS=$IFS |
|
253 IFS=: |
|
254 list= |
|
255 for elt in $arg; do |
2641
|
256 list="$list -L$elt" |
1232
|
257 done |
|
258 IFS=$SAVE_IFS |
|
259 arg="$list" |
|
260 ;; |
|
261 esac |
|
262 if test -n "$arg"; then |
|
263 flibs="$flibs $arg" |
|
264 fi |
|
265 done |
1953
|
266 if test -n "$ld_run_path"; then |
|
267 flibs_result="$ld_run_path $flibs" |
|
268 else |
|
269 flibs_result="$flibs" |
|
270 fi |
3835
|
271 ] |
1953
|
272 octave_cv_flibs="$flibs_result"]) |
1232
|
273 FLIBS="$octave_cv_flibs" |
|
274 AC_MSG_RESULT([$FLIBS])]) |
2548
|
275 dnl |
3130
|
276 dnl This is apparently needed on some Linux systems. |
|
277 dnl |
|
278 AC_DEFUN(OCTAVE_F77_MAIN_FLAG, |
|
279 [FORTRAN_MAIN_FLAG= |
|
280 case "$canonical_host_type" in |
|
281 *-linux-*) |
|
282 FORTRAN_MAIN_FLAG="-u MAIN__" |
|
283 ;; |
|
284 esac |
|
285 if test -n "$FORTRAN_MAIN_FLAG"; then |
|
286 AC_MSG_RESULT([defining FORTRAN_MAIN_FLAG to be $FORTRAN_MAIN_FLAG]) |
|
287 fi |
|
288 AC_SUBST(FORTRAN_MAIN_FLAG) |
|
289 ]) |
|
290 dnl |
1257
|
291 dnl See if the Fortran compiler uses uppercase external names. |
|
292 dnl |
|
293 dnl OCTAVE_F77_UPPERCASE_NAMES() |
|
294 AC_DEFUN(OCTAVE_F77_UPPERCASE_NAMES, |
3176
|
295 [AC_MSG_CHECKING([whether ${F77-f77} uses uppercase external names]) |
1257
|
296 AC_CACHE_VAL(octave_cv_f77_uppercase_names, |
|
297 [octave_cv_f77_uppercase_names=no |
|
298 cat > conftest.f <<EOF |
|
299 subroutine xxyyzz () |
|
300 return |
|
301 end |
|
302 EOF |
|
303 if ${F77-f77} -c conftest.f 1>&AC_FD_CC 2>&AC_FD_CC; then |
|
304 if test "`${NM-nm} conftest.o | grep XXYYZZ`" != ""; then |
|
305 octave_cv_f77_uppercase_names=yes |
|
306 fi |
|
307 fi]) |
|
308 AC_MSG_RESULT([$octave_cv_f77_uppercase_names]) |
|
309 if test "$octave_cv_f77_uppercase_names" = yes; then |
|
310 AC_DEFINE(F77_UPPERCASE_NAMES, 1) |
|
311 fi]) |
2548
|
312 dnl |
1232
|
313 dnl See if the Fortran compiler appends underscores to external names. |
|
314 dnl |
|
315 dnl OCTAVE_F77_APPEND_UNDERSCORE() |
|
316 AC_DEFUN(OCTAVE_F77_APPEND_UNDERSCORE, |
3176
|
317 [AC_MSG_CHECKING([whether ${F77-f77} appends underscores to external names]) |
1257
|
318 AC_REQUIRE([OCTAVE_F77_UPPERCASE_NAMES]) |
1232
|
319 AC_CACHE_VAL(octave_cv_f77_append_underscore, |
|
320 [octave_cv_f77_append_underscore=no |
|
321 cat > conftest.f <<EOF |
|
322 subroutine xxyyzz () |
|
323 return |
|
324 end |
|
325 EOF |
|
326 if ${F77-f77} -c conftest.f 1>&AC_FD_CC 2>&AC_FD_CC; then |
1257
|
327 if test "$octave_cv_f77_uppercase_names" = yes; then |
|
328 if test "`${NM-nm} conftest.o | grep XXYYZZ_`" != ""; then |
|
329 octave_cv_f77_append_underscore=yes |
|
330 fi |
|
331 else |
|
332 if test "`${NM-nm} conftest.o | grep xxyyzz_`" != ""; then |
|
333 octave_cv_f77_append_underscore=yes |
|
334 fi |
1232
|
335 fi |
|
336 fi]) |
|
337 AC_MSG_RESULT([$octave_cv_f77_append_underscore]) |
|
338 if test "$octave_cv_f77_append_underscore" = yes; then |
|
339 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
|
340 fi]) |
2548
|
341 dnl |
1232
|
342 dnl See if the Fortran compiler is compatible with f2c. |
|
343 dnl |
|
344 dnl Write a minimal program, compile it, and see if it works as |
|
345 dnl expected. |
|
346 dnl |
|
347 dnl OCTAVE_F2C_F77_COMPAT() |
|
348 AC_DEFUN(OCTAVE_F2C_F77_COMPAT, |
3130
|
349 [AC_REQUIRE([OCTAVE_PROG_G77]) |
|
350 AC_REQUIRE([OCTAVE_FLIBS]) |
1232
|
351 AC_REQUIRE([OCTAVE_F77_APPEND_UNDERSCORE]) |
3130
|
352 if test "$cross_compiling" = yes; then |
|
353 octave_cv_f2c_f77_compat=yes |
|
354 if test "$octave_cv_f77_is_g77" = yes; then |
|
355 AC_MSG_RESULT([assuming ${F77-f77} cross compiler is f2c compatible]) |
|
356 else |
|
357 AC_MSG_WARN([assuming ${F77-f77} cross compiler is f2c compatible]) |
|
358 fi |
|
359 else |
3176
|
360 AC_CACHE_CHECK([${F77-f77}/f2c compatibility], octave_cv_f2c_f77_compat, |
3130
|
361 [trap 'rm -f ftest* ctest* core; exit 1' 1 3 15 |
|
362 octave_cv_f2c_f77_compat=no |
|
363 cat > ftest.f <<EOF |
3162
|
364 SUBROUTINE FORSUB (C, I, D) |
1232
|
365 CHARACTER *(*) C |
3162
|
366 INTEGER L, I |
1232
|
367 DOUBLE PRECISION D |
|
368 L = LEN (C) |
|
369 WRITE (*, '(A,1X,I2)') C(1:L), INT (D) |
3162
|
370 I = 0 |
1232
|
371 RETURN |
|
372 END |
|
373 EOF |
3130
|
374 ${F77-f77} -c ftest.f 1>&AC_FD_CC 2>&AC_FD_CC |
|
375 changequote(, ) |
|
376 cat > ctest.c <<EOF |
1232
|
377 #include "confdefs.h" |
3162
|
378 #ifdef F77_APPEND_UNDERSCORE |
|
379 extern int forsub_ (const char*, int*, double*, long int); |
|
380 #else |
|
381 extern int forsub (const char*, int*, double*, long int); |
|
382 #endif |
1232
|
383 static char s[14]; |
|
384 int main () |
|
385 { |
|
386 double d = 10.0; |
3162
|
387 int len, i = 1; |
1232
|
388 strcpy (s, "FOO-I-HITHERE"); |
|
389 len = strlen (s); |
|
390 #ifdef F77_APPEND_UNDERSCORE |
3162
|
391 forsub_ (s, &i, &d, len); |
1232
|
392 #else |
3162
|
393 forsub (s, &i, &d, len); |
1232
|
394 #endif |
3162
|
395 return i; |
1232
|
396 } |
2218
|
397 #if defined (sun) |
1232
|
398 int MAIN_ () { return 0; } |
2126
|
399 #elif defined (linux) && defined (__ELF__) |
|
400 int MAIN__ () { return 0; } |
1232
|
401 #endif |
|
402 EOF |
3130
|
403 changequote([, ]) |
|
404 if ${CC-cc} -c ctest.c 1>&AC_FD_CC 2>&AC_FD_CC; then |
|
405 if ${CC-cc} -o ctest ctest.o ftest.o $FLIBS -lm 1>&AC_FD_CC 2>&AC_FD_CC; then |
|
406 ctest_output=`./ctest 2>&1` |
|
407 status=$? |
|
408 if test $status -eq 0 && test "$ctest_output" = "FOO-I-HITHERE 10"; then |
|
409 octave_cv_f2c_f77_compat=yes |
|
410 fi |
1232
|
411 fi |
3130
|
412 fi]) |
|
413 fi |
1232
|
414 rm -f ftest* ctest* core |
3130
|
415 ]) |
2548
|
416 dnl |
|
417 dnl See if struct group has a gr_passwd field. |
|
418 dnl |
|
419 AC_DEFUN(OCTAVE_STRUCT_GR_PASSWD, |
|
420 [AC_CACHE_CHECK([for gr_passwd in struct group], octave_cv_struct_gr_passwd, |
|
421 [AC_TRY_COMPILE([#include <sys/types.h> |
|
422 #include <grp.h>], [struct group s; s.gr_passwd;], |
|
423 octave_cv_struct_gr_passwd=yes, octave_cv_struct_gr_passwd=no)]) |
|
424 if test $octave_cv_struct_gr_passwd = yes; then |
|
425 AC_DEFINE(HAVE_GR_PASSWD) |
|
426 fi |
|
427 ]) |
|
428 dnl |
2574
|
429 dnl See if the standard string class has npos as a member. |
|
430 dnl |
|
431 AC_DEFUN(OCTAVE_STRING_NPOS, |
|
432 [AC_CACHE_CHECK([whether including <string> defines NPOS], |
|
433 octave_cv_string_npos, |
|
434 [AC_LANG_SAVE |
|
435 AC_LANG_CPLUSPLUS |
|
436 AC_TRY_COMPILE([#include <string>], |
|
437 [size_t foo = NPOS], |
|
438 octave_cv_string_npos=yes, octave_cv_string_npos=no)]) |
|
439 if test $octave_cv_string_npos = no; then |
3506
|
440 AC_DEFINE(NPOS, std::string::npos) |
2574
|
441 fi |
|
442 AC_LANG_RESTORE |
|
443 ]) |
|
444 dnl |
1707
|
445 dnl The following test is from Karl Berry's Kpathseach library. I'm |
|
446 dnl including it here in case we someday want to make the use of |
|
447 dnl kpathsea optional. |
1708
|
448 dnl |
|
449 dnl Some BSD putenv's, e.g., FreeBSD, do malloc/free's on the environment. |
|
450 dnl This test program is due to Mike Hibler <mike@cs.utah.edu>. |
|
451 dnl We don't actually need to run this if we don't have putenv, but it |
|
452 dnl doesn't hurt. |
|
453 AC_DEFUN(OCTAVE_SMART_PUTENV, |
|
454 [AC_MSG_CHECKING(whether putenv uses malloc) |
1707
|
455 AC_CACHE_VAL(octave_cv_func_putenv_malloc, |
|
456 [AC_TRY_RUN([ |
|
457 #define VAR "YOW_VAR" |
|
458 #define STRING1 "GabbaGabbaHey" |
|
459 #define STRING2 "Yow!!" /* should be shorter than STRING1 */ |
|
460 extern char *getenv (); /* in case char* and int don't mix gracefully */ |
|
461 main () |
|
462 { |
|
463 char *str1, *rstr1, *str2, *rstr2; |
|
464 str1 = getenv (VAR); |
|
465 if (str1) |
|
466 exit (1); |
|
467 str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1); |
|
468 if (str1 == 0) |
|
469 exit (2); |
|
470 strcpy (str1, VAR); |
|
471 strcat (str1, "="); |
|
472 strcat (str1, STRING1); |
|
473 if (putenv (str1) < 0) |
|
474 exit (3); |
|
475 rstr1 = getenv (VAR); |
|
476 if (rstr1 == 0) |
|
477 exit (4); |
|
478 rstr1 -= strlen (VAR) + 1; |
|
479 if (strncmp (rstr1, VAR, strlen (VAR))) |
|
480 exit (5); |
|
481 str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1); |
|
482 if (str2 == 0 || str1 == str2) |
|
483 exit (6); |
|
484 strcpy (str2, VAR); |
|
485 strcat (str2, "="); |
|
486 strcat (str2, STRING2); |
|
487 if (putenv (str2) < 0) |
|
488 exit (7); |
|
489 rstr2 = getenv (VAR); |
|
490 if (rstr2 == 0) |
|
491 exit (8); |
|
492 rstr2 -= strlen (VAR) + 1; |
|
493 #if 0 |
|
494 printf ("rstr1=0x%x, rstr2=0x%x\n", rstr1, rstr2); |
|
495 /* |
|
496 * If string from first call was reused for the second call, |
|
497 * you had better not do a free on the first string! |
|
498 */ |
|
499 if (rstr1 == rstr2) |
|
500 printf ("#define SMART_PUTENV\n"); |
|
501 else |
|
502 printf ("#undef SMART_PUTENV\n"); |
|
503 #endif |
|
504 exit (rstr1 == rstr2 ? 0 : 1); |
|
505 }], octave_cv_func_putenv_malloc=yes, octave_cv_func_putenv_malloc=no, |
|
506 octave_cv_func_putenv_malloc=no)])dnl |
|
507 AC_MSG_RESULT($octave_cv_func_putenv_malloc) |
|
508 if test $octave_cv_func_putenv_malloc = yes; then |
|
509 AC_DEFINE(SMART_PUTENV) |
1708
|
510 fi]) |
1788
|
511 dnl |
2469
|
512 dnl These two checks for signal functions were originally part of the |
|
513 dnl aclocal.m4 file distributed with bash 2.0. |
|
514 dnl |
|
515 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) |
|
516 AC_DEFUN(OCTAVE_SIGNAL_CHECK, |
|
517 [AC_REQUIRE([AC_TYPE_SIGNAL]) |
|
518 AC_MSG_CHECKING(for type of signal functions) |
|
519 AC_CACHE_VAL(octave_cv_signal_vintage, |
|
520 [ |
|
521 AC_TRY_LINK([#include <signal.h>],[ |
|
522 sigset_t ss; |
|
523 struct sigaction sa; |
|
524 sigemptyset(&ss); sigsuspend(&ss); |
|
525 sigaction(SIGINT, &sa, (struct sigaction *) 0); |
|
526 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); |
|
527 ], octave_cv_signal_vintage=posix, |
|
528 [ |
|
529 AC_TRY_LINK([#include <signal.h>], [ |
|
530 int mask = sigmask(SIGINT); |
|
531 sigsetmask(mask); sigblock(mask); sigpause(mask); |
|
532 ], octave_cv_signal_vintage=4.2bsd, |
|
533 [ |
|
534 AC_TRY_LINK([ |
|
535 #include <signal.h> |
|
536 RETSIGTYPE foo() { }], [ |
|
537 int mask = sigmask(SIGINT); |
|
538 sigset(SIGINT, foo); sigrelse(SIGINT); |
|
539 sighold(SIGINT); sigpause(SIGINT); |
2491
|
540 ], octave_cv_signal_vintage=svr3, octave_cv_signal_vintage=v7 |
2469
|
541 )] |
|
542 )] |
|
543 ) |
|
544 ]) |
|
545 AC_MSG_RESULT($octave_cv_signal_vintage) |
2491
|
546 if test "$octave_cv_signal_vintage" = posix; then |
2469
|
547 AC_DEFINE(HAVE_POSIX_SIGNALS) |
2491
|
548 elif test "$octave_cv_signal_vintage" = "4.2bsd"; then |
2469
|
549 AC_DEFINE(HAVE_BSD_SIGNALS) |
2491
|
550 elif test "$octave_cv_signal_vintage" = svr3; then |
2469
|
551 AC_DEFINE(HAVE_USG_SIGHOLD) |
|
552 fi |
|
553 ]) |
|
554 dnl |
|
555 AC_DEFUN(OCTAVE_REINSTALL_SIGHANDLERS, |
|
556 [AC_REQUIRE([AC_TYPE_SIGNAL]) |
|
557 AC_REQUIRE([OCTAVE_SIGNAL_CHECK]) |
|
558 AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked]) |
|
559 AC_CACHE_VAL(octave_cv_must_reinstall_sighandlers, |
|
560 [AC_TRY_RUN([ |
|
561 #include <signal.h> |
|
562 #ifdef HAVE_UNISTD_H |
|
563 #include <unistd.h> |
|
564 #endif |
|
565 typedef RETSIGTYPE sigfunc(); |
|
566 int nsigint; |
|
567 #ifdef HAVE_POSIX_SIGNALS |
|
568 sigfunc * |
|
569 set_signal_handler(sig, handler) |
|
570 int sig; |
|
571 sigfunc *handler; |
|
572 { |
|
573 struct sigaction act, oact; |
|
574 act.sa_handler = handler; |
|
575 act.sa_flags = 0; |
|
576 sigemptyset (&act.sa_mask); |
|
577 sigemptyset (&oact.sa_mask); |
|
578 sigaction (sig, &act, &oact); |
|
579 return (oact.sa_handler); |
|
580 } |
|
581 #else |
|
582 #define set_signal_handler(s, h) signal(s, h) |
|
583 #endif |
|
584 RETSIGTYPE |
|
585 sigint(s) |
|
586 int s; |
|
587 { |
|
588 nsigint++; |
|
589 } |
|
590 main() |
|
591 { |
|
592 nsigint = 0; |
|
593 set_signal_handler(SIGINT, sigint); |
|
594 kill((int)getpid(), SIGINT); |
|
595 kill((int)getpid(), SIGINT); |
|
596 exit(nsigint != 2); |
|
597 } |
|
598 ], octave_cv_must_reinstall_sighandlers=no, octave_cv_must_reinstall_sighandlers=yes, |
3130
|
599 if test "$octave_cv_signal_vintage" = svr3; then |
|
600 octave_cv_must_reinstall_sighandlers=yes |
|
601 else |
|
602 octave_cv_must_reinstall_sighandlers=no |
|
603 fi)]) |
|
604 if test "$cross_compiling" = yes; then |
|
605 AC_MSG_RESULT([$octave_cv_must_reinstall_sighandlers assumed for cross compilation]) |
|
606 else |
|
607 AC_MSG_RESULT($octave_cv_must_reinstall_sighandlers) |
|
608 fi |
2491
|
609 if test "$octave_cv_must_reinstall_sighandlers" = yes; then |
3130
|
610 AC_DEFINE(MUST_REINSTALL_SIGHANDLERS) |
2469
|
611 fi |
|
612 ]) |
2626
|
613 dnl |
|
614 dnl This check originally from bash 2.0. |
|
615 dnl |
|
616 dnl Check for typedef'd symbols in header files, but allow the caller to |
|
617 dnl specify the include files to be checked in addition to the default. |
|
618 dnl |
|
619 dnl OCTAVE_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND]) |
|
620 AC_DEFUN(OCTAVE_CHECK_TYPE, |
|
621 [AC_REQUIRE([AC_HEADER_STDC])dnl |
|
622 AC_MSG_CHECKING(for $1) |
|
623 AC_CACHE_VAL(octave_cv_type_$1, |
|
624 [AC_EGREP_CPP($1, [#include <sys/types.h> |
|
625 #if STDC_HEADERS |
|
626 #include <stdlib.h> |
|
627 #endif |
|
628 $2 |
|
629 ], octave_cv_type_$1=yes, octave_cv_type_$1=no)]) |
|
630 AC_MSG_RESULT($octave_cv_type_$1) |
|
631 ifelse($#, 4, [if test $octave_cv_type_$1 = yes; then |
|
632 AC_DEFINE($4) |
|
633 fi]) |
|
634 if test $octave_cv_type_$1 = no; then |
|
635 AC_DEFINE($1, $3) |
|
636 fi |
|
637 ]) |
3107
|
638 dnl |
|
639 dnl Check to see if C++ compiler needs the new friend template declaration |
|
640 dnl syntax. |
|
641 dnl |
|
642 dnl OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL |
|
643 AC_DEFUN(OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL, [ |
|
644 AC_REQUIRE([AC_PROG_CXX]) |
|
645 AC_MSG_CHECKING([for C++ support for new friend template declaration]) |
|
646 AC_CACHE_VAL(octave_cv_cxx_new_friend_template_decl, [ |
|
647 AC_LANG_SAVE |
|
648 AC_LANG_CPLUSPLUS |
|
649 rm -f conftest.h |
|
650 cat > conftest.h <<EOB |
|
651 struct A { |
|
652 friend int operator== (const A&, const A&); |
|
653 A (int) { } |
|
654 }; |
|
655 |
|
656 template <class T> int |
|
657 operator== (const T&, const T&) |
|
658 { |
|
659 return 0; |
|
660 } |
|
661 EOB |
|
662 AC_TRY_LINK([#include "conftest.h"], [ |
|
663 A a (1); |
|
664 return a == A(1); |
|
665 ], |
|
666 octave_cv_cxx_new_friend_template_decl=no, |
|
667 octave_cv_cxx_new_friend_template_decl=yes |
|
668 ) |
|
669 AC_LANG_RESTORE |
|
670 ]) |
|
671 AC_MSG_RESULT($octave_cv_cxx_new_friend_template_decl) |
|
672 if test $octave_cv_cxx_new_friend_template_decl = yes; then |
|
673 AC_DEFINE(CXX_NEW_FRIEND_TEMPLATE_DECL) |
|
674 fi |
|
675 ]) |
3126
|
676 dnl |
3233
|
677 dnl Check to see if C compiler handles FLAG command line option. If |
|
678 dnl two arguments are specified, execute the second arg as shell |
|
679 dnl commands. Otherwise, add FLAG to CFLAGS if the compiler accepts |
|
680 dnl the flag. |
3126
|
681 dnl |
|
682 dnl OCTAVE_CC_FLAG |
|
683 AC_DEFUN(OCTAVE_CC_FLAG, [ |
|
684 ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` |
|
685 AC_MSG_CHECKING(whether ${CC-cc} accepts $1) |
|
686 AC_CACHE_VAL(octave_cv_cc_flag_$ac_safe, [ |
|
687 AC_LANG_SAVE |
|
688 AC_LANG_C |
|
689 XCFLAGS="$CFLAGS" |
|
690 CFLAGS="$CFLAGS $1" |
|
691 AC_TRY_LINK([], [], |
|
692 eval "octave_cv_cc_flag_$ac_safe=yes", |
|
693 eval "octave_cv_cc_flag_$ac_safe=no") |
|
694 CFLAGS="$XCFLAGS" |
|
695 AC_LANG_RESTORE |
|
696 ]) |
|
697 if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then |
|
698 AC_MSG_RESULT(yes) |
3131
|
699 ifelse([$2], , [ |
|
700 CFLAGS="$CFLAGS $1" |
|
701 AC_MSG_RESULT([adding $1 to CFLAGS])], [$2]) |
3126
|
702 else |
|
703 AC_MSG_RESULT(no) |
|
704 ifelse([$3], , , [$3]) |
|
705 fi |
|
706 ]) |
|
707 dnl |
3233
|
708 dnl Check to see if C++ compiler handles FLAG command line option. If |
|
709 dnl two arguments are specified, execute the second arg as shell |
|
710 dnl commands. Otherwise, add FLAG to CXXFLAGS if the compiler accepts |
|
711 dnl the flag. |
3126
|
712 dnl |
|
713 dnl OCTAVE_CXX_FLAG |
|
714 AC_DEFUN(OCTAVE_CXX_FLAG, [ |
|
715 ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` |
3222
|
716 AC_MSG_CHECKING(whether ${CXX-g++} accepts $1) |
3126
|
717 AC_CACHE_VAL(octave_cv_cxx_flag_$ac_safe, [ |
|
718 AC_LANG_SAVE |
|
719 AC_LANG_CPLUSPLUS |
|
720 XCXXFLAGS="$CXXFLAGS" |
|
721 CXXFLAGS="$CXXFLAGS $1" |
|
722 AC_TRY_LINK([], [], |
|
723 eval "octave_cv_cxx_flag_$ac_safe=yes", |
|
724 eval "octave_cv_cxx_flag_$ac_safe=no") |
|
725 CXXFLAGS="$XCXXFLAGS" |
|
726 AC_LANG_RESTORE |
|
727 ]) |
|
728 if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then |
|
729 AC_MSG_RESULT(yes) |
3131
|
730 ifelse([$2], , [ |
|
731 CXXFLAGS="$CXXFLAGS $1" |
|
732 AC_MSG_RESULT([adding $1 to CXXFLAGS])], [$2]) |
3126
|
733 else |
|
734 AC_MSG_RESULT(no) |
|
735 ifelse([$3], , , [$3]) |
|
736 fi |
|
737 ]) |
3130
|
738 dnl |
3729
|
739 dnl Check for flex |
|
740 dnl |
|
741 AC_DEFUN(OCTAVE_PROG_FLEX, [ |
|
742 ### For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
743 ### it, and it might not be installed. |
|
744 ### |
|
745 ### Also make sure that we generate an interactive scanner if we are |
|
746 ### using flex. |
|
747 AC_PROG_LEX |
|
748 case "$LEX" in |
|
749 flex*) |
|
750 LFLAGS="-t -I" |
|
751 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
|
752 LEXLIB= |
|
753 ;; |
|
754 *) |
|
755 LEX='$(top_srcdir)/missing flex' |
|
756 warn_flex="I didn't find flex, but it's only a problem if you need to reconstruct lex.cc" |
|
757 AC_MSG_WARN($warn_flex) |
|
758 ;; |
|
759 esac |
|
760 AC_SUBST(LFLAGS) |
|
761 ]) |
|
762 dnl |
|
763 dnl Check for bison |
|
764 dnl |
|
765 AC_DEFUN(OCTAVE_PROG_BISON, [ |
|
766 AC_PROG_YACC |
|
767 case "$YACC" in |
|
768 bison*) |
|
769 ;; |
|
770 *) |
|
771 YACC='$(top_srcdir)/missing bison' |
|
772 warn_bison="I didn't find bison, but it's only a problem if you need to reconstruct parse.cc" |
|
773 AC_MSG_WARN($warn_bison) |
|
774 ;; |
|
775 esac |
|
776 ]) |
|
777 dnl |
3130
|
778 dnl What pager should we use? |
|
779 dnl |
|
780 AC_DEFUN(OCTAVE_PROG_PAGER, |
|
781 [if test "$cross_compiling" = yes; then |
|
782 DEFAULT_PAGER=less |
|
783 AC_MSG_RESULT(assuming $DEFAULT_PAGER exists on $canonical_host_type host) |
|
784 AC_SUBST(DEFAULT_PAGER) |
|
785 else |
|
786 octave_possible_pagers="less more page pg" |
|
787 case "$canonical_host_type" in |
|
788 *-*-cygwin32) |
|
789 octave_possible_pagers="$octave_possible_pagers more.com" |
|
790 ;; |
|
791 esac |
|
792 |
|
793 AC_CHECK_PROGS(DEFAULT_PAGER, $octave_possible_pagers, []) |
|
794 if test -z "$DEFAULT_PAGER"; then |
|
795 warn_less="I couldn't find \`less', \`more', \`page', or \`pg'" |
|
796 AC_MSG_WARN($warn_less) |
|
797 fi |
|
798 fi |
|
799 ]) |
|
800 dnl |
|
801 dnl Does gnuplot exist? Is it a recent version? |
|
802 dnl |
|
803 AC_DEFUN(OCTAVE_PROG_GNUPLOT, |
|
804 [if test "$cross_compiling" = yes; then |
|
805 GNUPLOT_BINARY=gnuplot |
|
806 AC_MSG_RESULT(assuming $GNUPLOT_BINARY exists on $canonical_host_type host) |
|
807 AC_SUBST(DEFAULT_PAGER) |
|
808 AC_MSG_RESULT(assuming $GNUPLOT_BINARY supports multiplot mode) |
|
809 AC_DEFINE(GNUPLOT_HAS_MULTIPLOT, 1) |
|
810 AC_MSG_RESULT(assuming $GNUPLOT_BINARY supports multiple frams) |
|
811 AC_DEFINE(GNUPLOT_HAS_FRAMES, 1) |
|
812 else |
|
813 AC_CHECK_PROG(GNUPLOT_BINARY, gnuplot, gnuplot, []) |
|
814 if test -n "$GNUPLOT_BINARY"; then |
|
815 AC_MSG_CHECKING([to see if your gnuplot supports multiplot]) |
|
816 if test -z "`echo 'set term unknown; set multiplot' | \ |
|
817 $GNUPLOT_BINARY 2>&1`"; then |
|
818 AC_MSG_RESULT([yes]) |
|
819 AC_DEFINE(GNUPLOT_HAS_MULTIPLOT, 1) |
|
820 else |
|
821 AC_MSG_RESULT([no]) |
|
822 fi |
|
823 AC_MSG_CHECKING([to see if your gnuplot supports multiple plot windows]) |
|
824 if test -z "`echo 'set term x11 2' | $GNUPLOT_BINARY 2>&1`"; then |
|
825 AC_MSG_RESULT([yes]) |
|
826 AC_DEFINE(GNUPLOT_HAS_FRAMES, 1) |
|
827 else |
|
828 AC_MSG_RESULT([no]) |
|
829 fi |
|
830 else |
|
831 warn_gnuplot="yes" |
|
832 |
|
833 ## If you change this text, be sure to also copy it to the set of |
|
834 ## warnings at the end of the script |
|
835 |
|
836 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
837 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) |
|
838 AC_MSG_WARN([plotting commands without it.]) |
|
839 AC_MSG_WARN([]) |
|
840 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
841 AC_MSG_WARN([tell Octave where to find it by typing the command]) |
|
842 AC_MSG_WARN([]) |
|
843 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
844 AC_MSG_WARN([]) |
|
845 AC_MSG_WARN([at the Octave prompt.]) |
|
846 fi |
|
847 fi |
|
848 ]) |
|
849 dnl |
|
850 dnl Is DejaGNU installed? |
|
851 dnl |
3222
|
852 dnl OCTAVE_PROG_RUNTEST |
3130
|
853 AC_DEFUN(OCTAVE_PROG_RUNTEST, |
|
854 [if test "$cross_compiling" = yes; then |
|
855 RUNTEST=runtest |
|
856 AC_MSG_RESULT(assuming $RUNTEST exists on $canonical_host_type host) |
|
857 AC_SUBST(RUNTEST) |
|
858 else |
|
859 AC_CHECK_PROG(RUNTEST, runtest, runtest, []) |
|
860 if test -z "$RUNTEST"; then |
|
861 warn_runtest="I didn't find runtest -- install DejaGNU if you want to run \`make check'" |
|
862 AC_MSG_WARN($warn_runtest) |
|
863 fi |
|
864 AC_SUBST(RUNTEST) |
|
865 fi |
|
866 ]) |
3222
|
867 dnl |
3673
|
868 dnl Is gperf installed? |
|
869 dnl |
|
870 dnl OCTAVE_PROG_GPERF |
3731
|
871 AC_DEFUN(OCTAVE_PROG_GPERF, [ |
|
872 AC_CHECK_PROG(GPERF, gperf, gperf, []) |
|
873 if test -n "$GPERF"; then |
|
874 if echo "%{ |
|
875 %} |
|
876 %% |
3750
|
877 foo" | $GPERF -t -C -D -E -G -L ANSI-C -H octave_kw_hash -N octave_kw_lookup > /dev/null 2>&1; then |
3731
|
878 true |
|
879 else |
|
880 GPERF="" |
|
881 warn_gperf="I found gperf, but it does not support all of the following options: -t -C -D -E -G -L ANSI-C -H -N; you need gperf 2.7 or a more recent version" |
|
882 AC_MSG_WARN($warn_gperf) |
|
883 fi |
|
884 else |
|
885 GPERF='$(top_srcdir)/missing gperf' |
|
886 warn_gperf="I didn't find gperf, but it's only a problem if you need to reconstruct oct-gperf.h" |
|
887 AC_MSG_WARN($warn_gperf) |
|
888 fi |
|
889 AC_SUBST(GPERF) |
3673
|
890 ]) |
|
891 dnl |
3222
|
892 dnl Find nm. |
|
893 dnl |
|
894 dnl OCTAVE_PROG_NM |
|
895 AC_DEFUN(OCTAVE_PROG_NM, |
|
896 [if test "$cross_compiling" = yes; then |
|
897 NM=nm |
|
898 AC_MSG_RESULT(assuming $NM exists on $canonical_host_type host) |
|
899 AC_SUBST(NM) |
|
900 else |
|
901 AC_CHECK_PROG(NM, nm, nm, []) |
|
902 AC_SUBST(NM) |
|
903 fi |
|
904 ]) |
|
905 dnl |
|
906 dnl See if the C++ compiler prepends an underscore to external names. |
|
907 dnl |
|
908 dnl OCTAVE_CXX_PREPENDS_UNDERSCORE |
|
909 AC_DEFUN(OCTAVE_CXX_PREPENDS_UNDERSCORE, |
|
910 [AC_MSG_CHECKING([whether ${CXX-g++} prepends an underscore to external names]) |
|
911 AC_CACHE_VAL(octave_cv_cxx_prepends_underscore, |
|
912 [octave_cv_cxx_prepends_underscore=no |
|
913 AC_LANG_SAVE |
|
914 AC_LANG_CPLUSPLUS |
|
915 cat > conftest.$ac_ext <<EOF |
3842
|
916 bool FSmy_dld_fcn (void) { return false; } |
3222
|
917 EOF |
|
918 if AC_TRY_EVAL(ac_compile); then |
|
919 if test "`${NM-nm} conftest.o | grep _FSmy_dld_fcn`" != ""; then |
|
920 octave_cv_cxx_prepends_underscore=yes |
|
921 fi |
|
922 else |
|
923 echo "configure: failed program was:" >&AC_FD_CC |
|
924 cat conftest.$ac_ext >&AC_FD_CC |
|
925 fi |
|
926 AC_LANG_RESTORE |
|
927 ]) |
|
928 AC_MSG_RESULT($octave_cv_cxx_prepends_underscore) |
|
929 if test $octave_cv_cxx_prepends_underscore = yes; then |
|
930 AC_DEFINE(CXX_PREPENDS_UNDERSCORE) |
|
931 fi |
|
932 ]) |
3769
|
933 dnl |
|
934 dnl See if the C++ library is ISO compliant. |
|
935 dnl FIXME: This is obviously very simplistic, and trivially fooled. |
|
936 dnl |
|
937 dnl OCTAVE_CXX_ISO_COMPLIANT_LIBRARY |
|
938 AC_DEFUN(OCTAVE_CXX_ISO_COMPLIANT_LIBRARY, [ |
|
939 AC_REQUIRE([AC_PROG_CXX]) |
|
940 AC_MSG_CHECKING([if C++ library is ISO compliant]) |
|
941 AC_CACHE_VAL(octave_cv_cxx_iso_compliant_library, [ |
|
942 AC_LANG_SAVE |
|
943 AC_LANG_CPLUSPLUS |
|
944 rm -f conftest.h |
|
945 for inc in algorithm bitset cassert cctype cerrno cfloat ciso646 \ |
|
946 climits clocale cmath complex csetjmp csignal cstdarg cstddef \ |
|
947 cstdio cstdlib cstring ctime cwchar cwctype deque exception \ |
|
948 fstream functional iomanip ios iosfwd iostream istream iterator \ |
|
949 limits list locale map memory new numeric ostream queue set \ |
|
950 sstream stack stdexcept streambuf string strstream typeinfo \ |
|
951 utility valarray vector; do |
|
952 echo "#include <$inc>" >> conftest.h |
|
953 done |
|
954 AC_TRY_LINK([#include "conftest.h"], [ |
|
955 std::bitset<50> flags; |
|
956 flags.set(); |
|
957 int digits = std::numeric_limits<unsigned long>::digits; |
|
958 digits = 0; |
|
959 ], |
|
960 octave_cv_cxx_iso_compliant_library=yes, |
|
961 octave_cv_cxx_iso_compliant_library=no |
|
962 ) |
|
963 AC_LANG_RESTORE |
|
964 ]) |
|
965 AC_MSG_RESULT($octave_cv_cxx_iso_compliant_library) |
|
966 if test $octave_cv_cxx_iso_compliant_library = yes; then |
|
967 AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY) |
|
968 fi |
|
969 ]) |
3822
|
970 dnl |
|
971 dnl Allow the user disable support for command line editing using GNU |
|
972 dnl readline. |
|
973 dnl |
|
974 dnl OCTAVE_ENABLE_READLINE |
|
975 AC_DEFUN(OCTAVE_ENABLE_READLINE, [ |
|
976 USE_READLINE=true |
|
977 AC_ARG_ENABLE(readline, |
|
978 [ --enable-readline use readline library (default is yes)], |
|
979 [if test "$enableval" = no; then |
3824
|
980 USE_READLINE=false |
3825
|
981 warn_readline="command editing and history features require GNU Readline" |
3824
|
982 fi]) |
3822
|
983 if $USE_READLINE; then |
|
984 AC_CHECK_LIB(readline, rl_set_keyboard_input_timeout, [ |
|
985 LIBS="-lreadline $LIBS" |
|
986 AC_DEFINE(USE_READLINE, 1) |
|
987 ], [ |
3824
|
988 AC_MSG_WARN([I need GNU Readline 4.2 or later]) |
|
989 AC_MSG_ERROR([this is fatal unless you specify --disable-readline]) |
3822
|
990 ]) |
|
991 fi |
|
992 ]) |
3842
|
993 dnl |
|
994 dnl Determine the C++ compiler ABI. It sets the macro CXX_ABI to the |
|
995 dnl name of the ABI, and is used to mangle the C linkage loadable |
|
996 dnl functions to avoid ABI mismatch. GNU C++ currently uses gnu_v2 |
|
997 dnl (GCC versions <= 2.95.x) dnl or gnu_v3 (GCC versions >= 3.0). |
|
998 dnl Set to "unknown" is when we don't know enough about the ABI, which |
|
999 dnl will happen when using an unsupported C++ compiler. |
|
1000 dnl |
|
1001 dnl OCTAVE_CXX_ABI |
|
1002 AC_DEFUN(OCTAVE_CXX_ABI, |
|
1003 [AC_MSG_CHECKING([C++ ABI version used by ${CXX}]) |
|
1004 AC_CACHE_VAL(octave_cv_cxx_abi, |
|
1005 [octave_cv_cxx_abi='unknown' |
|
1006 AC_LANG_SAVE |
|
1007 AC_LANG_CPLUSPLUS |
|
1008 cat > conftest.$ac_ext <<EOF |
|
1009 bool FSmy_dld_fcn (void) { return false; } |
|
1010 EOF |
|
1011 if AC_TRY_EVAL(ac_compile); then |
|
1012 if test "`${NM-nm} conftest.o | grep FSmy_dld_fcn__Fv`" != ""; then |
|
1013 octave_cv_cxx_abi='gnu_v2' |
|
1014 fi |
|
1015 if test "`${NM-nm} conftest.o | grep _Z12FSmy_dld_fcnv`" != ""; then |
|
1016 octave_cv_cxx_abi='gnu_v3' |
|
1017 fi |
|
1018 if test "`${NM-nm} conftest.o | grep __1cMFSmy_dld_fcn6F_b_`" != ""; then |
|
1019 octave_cv_cxx_abi='sun' |
|
1020 fi |
|
1021 else |
|
1022 echo "configure: failed program was:" >&AC_FD_CC |
|
1023 cat conftest.$ac_ext >&AC_FD_CC |
|
1024 fi |
|
1025 AC_LANG_RESTORE |
|
1026 ]) |
|
1027 AC_MSG_RESULT($octave_cv_cxx_abi) |
|
1028 AC_DEFINE_UNQUOTED(CXX_ABI, $octave_cv_cxx_abi) |
|
1029 ]) |
|
1030 |