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