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 target_host_type=$host |
|
33 canonical_host_type=$host |
|
34 if test "$host" = unknown; then |
|
35 AC_MSG_WARN([configuring Octave for unknown system type |
|
36 ]) |
|
37 fi |
|
38 AC_SUBST(target_host_type)]) |
|
39 dnl |
|
40 dnl Set default value for a variable and substitute it. |
|
41 dnl |
|
42 dnl OCTAVE_SET_DEFAULT |
|
43 AC_DEFUN(OCTAVE_SET_DEFAULT, |
|
44 [ifelse($#, 2, [$1=$2 |
|
45 ])dnl |
|
46 AC_MSG_RESULT([defining $1 to be $$1]) |
|
47 AC_SUBST($1)]) |
|
48 dnl |
|
49 dnl |
|
50 dnl OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS |
|
51 AC_DEFUN(OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS, |
|
52 [if test "${with_$1+set}" = set; then |
|
53 if test "${with_$2+set}" = set; then |
|
54 if test "$with_$2" = no; then |
|
55 true |
|
56 else |
|
57 $3 |
|
58 fi |
|
59 fi |
|
60 fi]) |
|
61 dnl |
1232
|
62 dnl See what libraries are used by the Fortran compiler. |
|
63 dnl |
|
64 dnl Write a minimal program and compile it with -v. I don't know what |
|
65 dnl to do if your compiler doesn't have -v... |
|
66 dnl |
|
67 dnl OCTAVE_FLIBS() |
|
68 AC_DEFUN(OCTAVE_FLIBS, |
2039
|
69 [AC_MSG_CHECKING([for Fortran libraries]) |
2854
|
70 AC_REQUIRE([OCTAVE_HOST_TYPE]) |
1232
|
71 AC_CACHE_VAL(octave_cv_flibs, |
|
72 [changequote(, )dnl |
|
73 echo " END" > conftest.f |
|
74 foutput=`${F77-f77} -v -o conftest conftest.f 2>&1` |
|
75 dnl |
|
76 dnl The easiest thing to do for xlf output is to replace all the commas |
|
77 dnl with spaces. Try to only do that if the output is really from xlf, |
|
78 dnl since doing that causes problems on other systems. |
|
79 dnl |
|
80 xlf_p=`echo $foutput | grep xlfentry` |
|
81 if test -n "$xlf_p"; then |
|
82 foutput=`echo $foutput | sed 's/,/ /g'` |
|
83 fi |
|
84 dnl |
|
85 ld_run_path=`echo $foutput | \ |
2638
|
86 sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'` |
1232
|
87 dnl |
|
88 dnl We are only supposed to find this on Solaris systems, and this |
|
89 dnl substitution is probably only going to work with gcc on those |
|
90 dnl systems... |
|
91 dnl |
|
92 if test -n "$ld_run_path"; then |
2600
|
93 if test "$ac_cv_prog_gcc" = yes; then |
|
94 ld_run_path="-Xlinker -R -Xlinker $ld_run_path" |
|
95 else |
|
96 ld_run_path="-R $ld_run_path" |
|
97 fi |
1232
|
98 fi |
|
99 dnl |
|
100 flibs= |
|
101 lflags= |
|
102 dnl |
|
103 dnl If want_arg is set, we know we want the arg to be added to the list, |
|
104 dnl so we don't have to examine it. |
|
105 dnl |
|
106 want_arg= |
|
107 dnl |
|
108 for arg in $foutput; do |
|
109 old_want_arg=$want_arg |
|
110 want_arg= |
|
111 case "$old_want_arg" in |
|
112 '') |
|
113 case $arg in |
2641
|
114 /*.a) |
1232
|
115 exists=false |
|
116 for f in $lflags; do |
|
117 if test x$arg = x$f; then |
|
118 exists=true |
|
119 fi |
|
120 done |
|
121 if $exists; then |
|
122 arg= |
|
123 else |
|
124 lflags="$lflags $arg" |
|
125 fi |
|
126 ;; |
2351
|
127 -bI:*) |
|
128 exists=false |
|
129 for f in $lflags; do |
|
130 if test x$arg = x$f; then |
|
131 exists=true |
|
132 fi |
|
133 done |
|
134 if $exists; then |
|
135 arg= |
|
136 else |
2600
|
137 if test "$ac_cv_prog_gcc" = yes; then |
|
138 lflags="$lflags -Xlinker $arg" |
|
139 else |
|
140 lflags="$lflags $arg" |
|
141 fi |
2351
|
142 fi |
|
143 ;; |
1232
|
144 -lang*) |
|
145 arg= |
|
146 ;; |
|
147 -[lLR]) |
|
148 want_arg=$arg |
|
149 arg= |
|
150 ;; |
|
151 -[lLR]*) |
|
152 exists=false |
|
153 for f in $lflags; do |
|
154 if test x$arg = x$f; then |
|
155 exists=true |
|
156 fi |
|
157 done |
2854
|
158 if $exists |
1232
|
159 arg= |
|
160 else |
2854
|
161 case "$arg" in |
|
162 -lkernel32) |
|
163 case "$canonical_host_type" in |
|
164 *-*-cygwin32) |
|
165 ;; |
|
166 *) |
|
167 lflags="$lflags $arg" |
|
168 ;; |
|
169 esac |
|
170 ;; |
|
171 -lm | -lc) |
|
172 ;; |
|
173 *) |
|
174 lflags="$lflags $arg" |
|
175 ;; |
|
176 esac |
1232
|
177 fi |
|
178 ;; |
|
179 -u) |
|
180 want_arg=$arg |
|
181 ;; |
|
182 -Y) |
|
183 want_arg=$arg |
|
184 arg= |
|
185 ;; |
|
186 *) |
|
187 arg= |
|
188 ;; |
|
189 esac |
|
190 ;; |
|
191 -[lLR]) |
|
192 arg="$old_want_arg $arg" |
|
193 ;; |
|
194 -Y) |
|
195 dnl |
|
196 dnl Should probably try to ensure unique directory options here too. |
|
197 dnl This probably only applies to Solaris systems, and then will only |
|
198 dnl work with gcc... |
|
199 dnl |
|
200 arg=`echo $arg | sed -e 's%^P,%%'` |
|
201 SAVE_IFS=$IFS |
|
202 IFS=: |
|
203 list= |
|
204 for elt in $arg; do |
2641
|
205 list="$list -L$elt" |
1232
|
206 done |
|
207 IFS=$SAVE_IFS |
|
208 arg="$list" |
|
209 ;; |
|
210 esac |
|
211 dnl |
|
212 if test -n "$arg"; then |
|
213 flibs="$flibs $arg" |
|
214 fi |
|
215 done |
1953
|
216 if test -n "$ld_run_path"; then |
|
217 flibs_result="$ld_run_path $flibs" |
|
218 else |
|
219 flibs_result="$flibs" |
|
220 fi |
1232
|
221 changequote([, ])dnl |
1953
|
222 octave_cv_flibs="$flibs_result"]) |
1232
|
223 FLIBS="$octave_cv_flibs" |
|
224 AC_MSG_RESULT([$FLIBS])]) |
2548
|
225 dnl |
1257
|
226 dnl See if the Fortran compiler uses uppercase external names. |
|
227 dnl |
|
228 dnl OCTAVE_F77_UPPERCASE_NAMES() |
|
229 AC_DEFUN(OCTAVE_F77_UPPERCASE_NAMES, |
|
230 [AC_MSG_CHECKING([whether $F77 uses uppercase external names]) |
|
231 AC_CACHE_VAL(octave_cv_f77_uppercase_names, |
|
232 [octave_cv_f77_uppercase_names=no |
|
233 cat > conftest.f <<EOF |
|
234 subroutine xxyyzz () |
|
235 return |
|
236 end |
|
237 EOF |
|
238 if ${F77-f77} -c conftest.f 1>&AC_FD_CC 2>&AC_FD_CC; then |
|
239 if test "`${NM-nm} conftest.o | grep XXYYZZ`" != ""; then |
|
240 octave_cv_f77_uppercase_names=yes |
|
241 fi |
|
242 fi]) |
|
243 AC_MSG_RESULT([$octave_cv_f77_uppercase_names]) |
|
244 if test "$octave_cv_f77_uppercase_names" = yes; then |
|
245 AC_DEFINE(F77_UPPERCASE_NAMES, 1) |
|
246 fi]) |
2548
|
247 dnl |
1232
|
248 dnl See if the Fortran compiler appends underscores to external names. |
|
249 dnl |
|
250 dnl OCTAVE_F77_APPEND_UNDERSCORE() |
|
251 AC_DEFUN(OCTAVE_F77_APPEND_UNDERSCORE, |
|
252 [AC_MSG_CHECKING([whether $F77 appends underscores to external names]) |
1257
|
253 AC_REQUIRE([OCTAVE_F77_UPPERCASE_NAMES]) |
1232
|
254 AC_CACHE_VAL(octave_cv_f77_append_underscore, |
|
255 [octave_cv_f77_append_underscore=no |
|
256 cat > conftest.f <<EOF |
|
257 subroutine xxyyzz () |
|
258 return |
|
259 end |
|
260 EOF |
|
261 if ${F77-f77} -c conftest.f 1>&AC_FD_CC 2>&AC_FD_CC; then |
1257
|
262 if test "$octave_cv_f77_uppercase_names" = yes; then |
|
263 if test "`${NM-nm} conftest.o | grep XXYYZZ_`" != ""; then |
|
264 octave_cv_f77_append_underscore=yes |
|
265 fi |
|
266 else |
|
267 if test "`${NM-nm} conftest.o | grep xxyyzz_`" != ""; then |
|
268 octave_cv_f77_append_underscore=yes |
|
269 fi |
1232
|
270 fi |
|
271 fi]) |
|
272 AC_MSG_RESULT([$octave_cv_f77_append_underscore]) |
|
273 if test "$octave_cv_f77_append_underscore" = yes; then |
|
274 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
|
275 fi]) |
2548
|
276 dnl |
1232
|
277 dnl See if the Fortran compiler is compatible with f2c. |
|
278 dnl |
|
279 dnl Write a minimal program, compile it, and see if it works as |
|
280 dnl expected. |
|
281 dnl |
|
282 dnl OCTAVE_F2C_F77_COMPAT() |
|
283 AC_DEFUN(OCTAVE_F2C_F77_COMPAT, |
|
284 [AC_REQUIRE([OCTAVE_FLIBS]) |
|
285 AC_REQUIRE([OCTAVE_F77_APPEND_UNDERSCORE]) |
|
286 AC_MSG_CHECKING([$F77/f2c compatibility]) |
|
287 AC_CACHE_VAL(octave_cv_f2c_f77_compat, |
|
288 [trap 'rm -f ftest* ctest* core; exit 1' 1 3 15 |
|
289 octave_cv_f2c_f77_compat=no |
|
290 cat > ftest.f <<EOF |
|
291 INTEGER FUNCTION FORSUB (C, D) |
|
292 CHARACTER *(*) C |
|
293 INTEGER L |
|
294 DOUBLE PRECISION D |
|
295 L = LEN (C) |
|
296 WRITE (*, '(A,1X,I2)') C(1:L), INT (D) |
|
297 FORSUB = 1 |
|
298 RETURN |
|
299 END |
|
300 EOF |
|
301 ${F77-f77} -c ftest.f 1>&AC_FD_CC 2>&AC_FD_CC |
|
302 dnl |
|
303 changequote(, ) |
|
304 cat > ctest.c <<EOF |
|
305 #include "confdefs.h" |
|
306 static char s[14]; |
|
307 int main () |
|
308 { |
|
309 double d = 10.0; |
|
310 int len; |
|
311 strcpy (s, "FOO-I-HITHERE"); |
|
312 len = strlen (s); |
|
313 #ifdef F77_APPEND_UNDERSCORE |
|
314 return (! forsub_ (s, &d, len)); |
|
315 #else |
|
316 return (! forsub (s, &d, len)); |
|
317 #endif |
|
318 } |
2218
|
319 #if defined (sun) |
1232
|
320 int MAIN_ () { return 0; } |
2126
|
321 #elif defined (linux) && defined (__ELF__) |
|
322 int MAIN__ () { return 0; } |
1232
|
323 #endif |
|
324 EOF |
|
325 changequote([, ]) |
|
326 dnl |
|
327 if ${CC-cc} -c ctest.c 1>&AC_FD_CC 2>&AC_FD_CC; then |
|
328 if ${CC-cc} -o ctest ctest.o ftest.o $FLIBS -lm 1>&AC_FD_CC 2>&AC_FD_CC; then |
|
329 ctest_output=`./ctest 2>&1` |
|
330 status=$? |
|
331 if test $status -eq 0 && test "$ctest_output" = "FOO-I-HITHERE 10"; then |
|
332 octave_cv_f2c_f77_compat=yes |
|
333 fi |
|
334 fi |
|
335 fi]) |
|
336 rm -f ftest* ctest* core |
|
337 AC_MSG_RESULT([$octave_cv_f2c_f77_compat])]) |
2548
|
338 dnl |
|
339 dnl See if struct group has a gr_passwd field. |
|
340 dnl |
|
341 AC_DEFUN(OCTAVE_STRUCT_GR_PASSWD, |
|
342 [AC_CACHE_CHECK([for gr_passwd in struct group], octave_cv_struct_gr_passwd, |
|
343 [AC_TRY_COMPILE([#include <sys/types.h> |
|
344 #include <grp.h>], [struct group s; s.gr_passwd;], |
|
345 octave_cv_struct_gr_passwd=yes, octave_cv_struct_gr_passwd=no)]) |
|
346 if test $octave_cv_struct_gr_passwd = yes; then |
|
347 AC_DEFINE(HAVE_GR_PASSWD) |
|
348 fi |
|
349 ]) |
|
350 dnl |
2574
|
351 dnl See if the standard string class has npos as a member. |
|
352 dnl |
|
353 AC_DEFUN(OCTAVE_STRING_NPOS, |
|
354 [AC_CACHE_CHECK([whether including <string> defines NPOS], |
|
355 octave_cv_string_npos, |
|
356 [AC_LANG_SAVE |
|
357 AC_LANG_CPLUSPLUS |
|
358 AC_TRY_COMPILE([#include <string>], |
|
359 [size_t foo = NPOS], |
|
360 octave_cv_string_npos=yes, octave_cv_string_npos=no)]) |
|
361 if test $octave_cv_string_npos = no; then |
|
362 AC_DEFINE(NPOS, string::npos) |
|
363 fi |
|
364 AC_LANG_RESTORE |
|
365 ]) |
|
366 dnl |
1707
|
367 dnl The following test is from Karl Berry's Kpathseach library. I'm |
|
368 dnl including it here in case we someday want to make the use of |
|
369 dnl kpathsea optional. |
1708
|
370 dnl |
|
371 dnl Some BSD putenv's, e.g., FreeBSD, do malloc/free's on the environment. |
|
372 dnl This test program is due to Mike Hibler <mike@cs.utah.edu>. |
|
373 dnl We don't actually need to run this if we don't have putenv, but it |
|
374 dnl doesn't hurt. |
|
375 AC_DEFUN(OCTAVE_SMART_PUTENV, |
|
376 [AC_MSG_CHECKING(whether putenv uses malloc) |
1707
|
377 AC_CACHE_VAL(octave_cv_func_putenv_malloc, |
|
378 [AC_TRY_RUN([ |
|
379 #define VAR "YOW_VAR" |
|
380 #define STRING1 "GabbaGabbaHey" |
|
381 #define STRING2 "Yow!!" /* should be shorter than STRING1 */ |
|
382 extern char *getenv (); /* in case char* and int don't mix gracefully */ |
|
383 main () |
|
384 { |
|
385 char *str1, *rstr1, *str2, *rstr2; |
|
386 str1 = getenv (VAR); |
|
387 if (str1) |
|
388 exit (1); |
|
389 str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1); |
|
390 if (str1 == 0) |
|
391 exit (2); |
|
392 strcpy (str1, VAR); |
|
393 strcat (str1, "="); |
|
394 strcat (str1, STRING1); |
|
395 if (putenv (str1) < 0) |
|
396 exit (3); |
|
397 rstr1 = getenv (VAR); |
|
398 if (rstr1 == 0) |
|
399 exit (4); |
|
400 rstr1 -= strlen (VAR) + 1; |
|
401 if (strncmp (rstr1, VAR, strlen (VAR))) |
|
402 exit (5); |
|
403 str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1); |
|
404 if (str2 == 0 || str1 == str2) |
|
405 exit (6); |
|
406 strcpy (str2, VAR); |
|
407 strcat (str2, "="); |
|
408 strcat (str2, STRING2); |
|
409 if (putenv (str2) < 0) |
|
410 exit (7); |
|
411 rstr2 = getenv (VAR); |
|
412 if (rstr2 == 0) |
|
413 exit (8); |
|
414 rstr2 -= strlen (VAR) + 1; |
|
415 #if 0 |
|
416 printf ("rstr1=0x%x, rstr2=0x%x\n", rstr1, rstr2); |
|
417 /* |
|
418 * If string from first call was reused for the second call, |
|
419 * you had better not do a free on the first string! |
|
420 */ |
|
421 if (rstr1 == rstr2) |
|
422 printf ("#define SMART_PUTENV\n"); |
|
423 else |
|
424 printf ("#undef SMART_PUTENV\n"); |
|
425 #endif |
|
426 exit (rstr1 == rstr2 ? 0 : 1); |
|
427 }], octave_cv_func_putenv_malloc=yes, octave_cv_func_putenv_malloc=no, |
|
428 octave_cv_func_putenv_malloc=no)])dnl |
|
429 AC_MSG_RESULT($octave_cv_func_putenv_malloc) |
|
430 if test $octave_cv_func_putenv_malloc = yes; then |
|
431 AC_DEFINE(SMART_PUTENV) |
1708
|
432 fi]) |
1788
|
433 dnl |
|
434 dnl This is a GNU libc invention, and this check is also from Karl |
|
435 dnl Berry's kpathsea library. |
|
436 dnl |
|
437 AC_DEFUN(OCTAVE_PROGRAM_INVOCATION_NAME, |
|
438 [AC_MSG_CHECKING(whether program_invocation_name is predefined) |
|
439 AC_CACHE_VAL(octave_cv_var_program_inv_name, |
|
440 [AC_TRY_LINK(, [main() { program_invocation_name = "love"; }], |
|
441 octave_cv_var_program_inv_name=yes, octave_cv_var_program_inv_name=no)])dnl |
|
442 AC_MSG_RESULT($octave_cv_var_program_inv_name) |
|
443 if test $octave_cv_var_program_inv_name = yes; then |
|
444 AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME) |
|
445 fi]) |
2469
|
446 dnl |
|
447 dnl These two checks for signal functions were originally part of the |
|
448 dnl aclocal.m4 file distributed with bash 2.0. |
|
449 dnl |
|
450 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) |
|
451 AC_DEFUN(OCTAVE_SIGNAL_CHECK, |
|
452 [AC_REQUIRE([AC_TYPE_SIGNAL]) |
|
453 AC_MSG_CHECKING(for type of signal functions) |
|
454 AC_CACHE_VAL(octave_cv_signal_vintage, |
|
455 [ |
|
456 AC_TRY_LINK([#include <signal.h>],[ |
|
457 sigset_t ss; |
|
458 struct sigaction sa; |
|
459 sigemptyset(&ss); sigsuspend(&ss); |
|
460 sigaction(SIGINT, &sa, (struct sigaction *) 0); |
|
461 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); |
|
462 ], octave_cv_signal_vintage=posix, |
|
463 [ |
|
464 AC_TRY_LINK([#include <signal.h>], [ |
|
465 int mask = sigmask(SIGINT); |
|
466 sigsetmask(mask); sigblock(mask); sigpause(mask); |
|
467 ], octave_cv_signal_vintage=4.2bsd, |
|
468 [ |
|
469 AC_TRY_LINK([ |
|
470 #include <signal.h> |
|
471 RETSIGTYPE foo() { }], [ |
|
472 int mask = sigmask(SIGINT); |
|
473 sigset(SIGINT, foo); sigrelse(SIGINT); |
|
474 sighold(SIGINT); sigpause(SIGINT); |
2491
|
475 ], octave_cv_signal_vintage=svr3, octave_cv_signal_vintage=v7 |
2469
|
476 )] |
|
477 )] |
|
478 ) |
|
479 ]) |
|
480 AC_MSG_RESULT($octave_cv_signal_vintage) |
2491
|
481 if test "$octave_cv_signal_vintage" = posix; then |
2469
|
482 AC_DEFINE(HAVE_POSIX_SIGNALS) |
2491
|
483 elif test "$octave_cv_signal_vintage" = "4.2bsd"; then |
2469
|
484 AC_DEFINE(HAVE_BSD_SIGNALS) |
2491
|
485 elif test "$octave_cv_signal_vintage" = svr3; then |
2469
|
486 AC_DEFINE(HAVE_USG_SIGHOLD) |
|
487 fi |
|
488 ]) |
|
489 dnl |
|
490 AC_DEFUN(OCTAVE_REINSTALL_SIGHANDLERS, |
|
491 [AC_REQUIRE([AC_TYPE_SIGNAL]) |
|
492 AC_REQUIRE([OCTAVE_SIGNAL_CHECK]) |
|
493 AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked]) |
|
494 AC_CACHE_VAL(octave_cv_must_reinstall_sighandlers, |
|
495 [AC_TRY_RUN([ |
|
496 #include <signal.h> |
|
497 #ifdef HAVE_UNISTD_H |
|
498 #include <unistd.h> |
|
499 #endif |
|
500 typedef RETSIGTYPE sigfunc(); |
|
501 int nsigint; |
|
502 #ifdef HAVE_POSIX_SIGNALS |
|
503 sigfunc * |
|
504 set_signal_handler(sig, handler) |
|
505 int sig; |
|
506 sigfunc *handler; |
|
507 { |
|
508 struct sigaction act, oact; |
|
509 act.sa_handler = handler; |
|
510 act.sa_flags = 0; |
|
511 sigemptyset (&act.sa_mask); |
|
512 sigemptyset (&oact.sa_mask); |
|
513 sigaction (sig, &act, &oact); |
|
514 return (oact.sa_handler); |
|
515 } |
|
516 #else |
|
517 #define set_signal_handler(s, h) signal(s, h) |
|
518 #endif |
|
519 RETSIGTYPE |
|
520 sigint(s) |
|
521 int s; |
|
522 { |
|
523 nsigint++; |
|
524 } |
|
525 main() |
|
526 { |
|
527 nsigint = 0; |
|
528 set_signal_handler(SIGINT, sigint); |
|
529 kill((int)getpid(), SIGINT); |
|
530 kill((int)getpid(), SIGINT); |
|
531 exit(nsigint != 2); |
|
532 } |
|
533 ], octave_cv_must_reinstall_sighandlers=no, octave_cv_must_reinstall_sighandlers=yes, |
|
534 AC_MSG_ERROR(cannot check signal handling if cross compiling))]) |
|
535 AC_MSG_RESULT($octave_cv_must_reinstall_sighandlers) |
2491
|
536 if test "$octave_cv_must_reinstall_sighandlers" = yes; then |
2469
|
537 AC_DEFINE(MUST_REINSTALL_SIGHANDLERS) |
|
538 fi |
|
539 ]) |
2626
|
540 dnl |
|
541 dnl This check originally from bash 2.0. |
|
542 dnl |
|
543 dnl Check for typedef'd symbols in header files, but allow the caller to |
|
544 dnl specify the include files to be checked in addition to the default. |
|
545 dnl |
|
546 dnl OCTAVE_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND]) |
|
547 AC_DEFUN(OCTAVE_CHECK_TYPE, |
|
548 [AC_REQUIRE([AC_HEADER_STDC])dnl |
|
549 AC_MSG_CHECKING(for $1) |
|
550 AC_CACHE_VAL(octave_cv_type_$1, |
|
551 [AC_EGREP_CPP($1, [#include <sys/types.h> |
|
552 #if STDC_HEADERS |
|
553 #include <stdlib.h> |
|
554 #endif |
|
555 $2 |
|
556 ], octave_cv_type_$1=yes, octave_cv_type_$1=no)]) |
|
557 AC_MSG_RESULT($octave_cv_type_$1) |
|
558 ifelse($#, 4, [if test $octave_cv_type_$1 = yes; then |
|
559 AC_DEFINE($4) |
|
560 fi]) |
|
561 if test $octave_cv_type_$1 = no; then |
|
562 AC_DEFINE($1, $3) |
|
563 fi |
|
564 ]) |