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 |
2548
|
75 dnl See if struct group has a gr_passwd field. |
|
76 dnl |
|
77 AC_DEFUN(OCTAVE_STRUCT_GR_PASSWD, |
|
78 [AC_CACHE_CHECK([for gr_passwd in struct group], octave_cv_struct_gr_passwd, |
|
79 [AC_TRY_COMPILE([#include <sys/types.h> |
|
80 #include <grp.h>], [struct group s; s.gr_passwd;], |
|
81 octave_cv_struct_gr_passwd=yes, octave_cv_struct_gr_passwd=no)]) |
|
82 if test $octave_cv_struct_gr_passwd = yes; then |
3887
|
83 AC_DEFINE(HAVE_GR_PASSWD,1,[Define if your system's struct group has a gr_passwd field.]) |
2548
|
84 fi |
|
85 ]) |
|
86 dnl |
2574
|
87 dnl See if the standard string class has npos as a member. |
|
88 dnl |
|
89 AC_DEFUN(OCTAVE_STRING_NPOS, |
|
90 [AC_CACHE_CHECK([whether including <string> defines NPOS], |
|
91 octave_cv_string_npos, |
3888
|
92 [AC_LANG_PUSH(C++) |
2574
|
93 AC_TRY_COMPILE([#include <string>], |
|
94 [size_t foo = NPOS], |
|
95 octave_cv_string_npos=yes, octave_cv_string_npos=no)]) |
|
96 if test $octave_cv_string_npos = no; then |
3887
|
97 AC_DEFINE(NPOS, [std::string::npos], [Define (to string::npos) if <string> doesn't]) |
2574
|
98 fi |
3888
|
99 AC_LANG_POP(C++) |
2574
|
100 ]) |
|
101 dnl |
1707
|
102 dnl The following test is from Karl Berry's Kpathseach library. I'm |
|
103 dnl including it here in case we someday want to make the use of |
|
104 dnl kpathsea optional. |
1708
|
105 dnl |
|
106 dnl Some BSD putenv's, e.g., FreeBSD, do malloc/free's on the environment. |
|
107 dnl This test program is due to Mike Hibler <mike@cs.utah.edu>. |
|
108 dnl We don't actually need to run this if we don't have putenv, but it |
|
109 dnl doesn't hurt. |
|
110 AC_DEFUN(OCTAVE_SMART_PUTENV, |
|
111 [AC_MSG_CHECKING(whether putenv uses malloc) |
1707
|
112 AC_CACHE_VAL(octave_cv_func_putenv_malloc, |
|
113 [AC_TRY_RUN([ |
|
114 #define VAR "YOW_VAR" |
|
115 #define STRING1 "GabbaGabbaHey" |
|
116 #define STRING2 "Yow!!" /* should be shorter than STRING1 */ |
|
117 extern char *getenv (); /* in case char* and int don't mix gracefully */ |
|
118 main () |
|
119 { |
|
120 char *str1, *rstr1, *str2, *rstr2; |
|
121 str1 = getenv (VAR); |
|
122 if (str1) |
|
123 exit (1); |
|
124 str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1); |
|
125 if (str1 == 0) |
|
126 exit (2); |
|
127 strcpy (str1, VAR); |
|
128 strcat (str1, "="); |
|
129 strcat (str1, STRING1); |
|
130 if (putenv (str1) < 0) |
|
131 exit (3); |
|
132 rstr1 = getenv (VAR); |
|
133 if (rstr1 == 0) |
|
134 exit (4); |
|
135 rstr1 -= strlen (VAR) + 1; |
|
136 if (strncmp (rstr1, VAR, strlen (VAR))) |
|
137 exit (5); |
|
138 str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1); |
|
139 if (str2 == 0 || str1 == str2) |
|
140 exit (6); |
|
141 strcpy (str2, VAR); |
|
142 strcat (str2, "="); |
|
143 strcat (str2, STRING2); |
|
144 if (putenv (str2) < 0) |
|
145 exit (7); |
|
146 rstr2 = getenv (VAR); |
|
147 if (rstr2 == 0) |
|
148 exit (8); |
|
149 rstr2 -= strlen (VAR) + 1; |
|
150 #if 0 |
|
151 printf ("rstr1=0x%x, rstr2=0x%x\n", rstr1, rstr2); |
|
152 /* |
|
153 * If string from first call was reused for the second call, |
|
154 * you had better not do a free on the first string! |
|
155 */ |
|
156 if (rstr1 == rstr2) |
|
157 printf ("#define SMART_PUTENV\n"); |
|
158 else |
|
159 printf ("#undef SMART_PUTENV\n"); |
|
160 #endif |
|
161 exit (rstr1 == rstr2 ? 0 : 1); |
|
162 }], octave_cv_func_putenv_malloc=yes, octave_cv_func_putenv_malloc=no, |
|
163 octave_cv_func_putenv_malloc=no)])dnl |
|
164 AC_MSG_RESULT($octave_cv_func_putenv_malloc) |
|
165 if test $octave_cv_func_putenv_malloc = yes; then |
3887
|
166 AC_DEFINE(SMART_PUTENV,1,[To quiet autoheader.]) |
1708
|
167 fi]) |
1788
|
168 dnl |
2469
|
169 dnl These two checks for signal functions were originally part of the |
|
170 dnl aclocal.m4 file distributed with bash 2.0. |
|
171 dnl |
|
172 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) |
|
173 AC_DEFUN(OCTAVE_SIGNAL_CHECK, |
|
174 [AC_REQUIRE([AC_TYPE_SIGNAL]) |
|
175 AC_MSG_CHECKING(for type of signal functions) |
|
176 AC_CACHE_VAL(octave_cv_signal_vintage, |
|
177 [ |
|
178 AC_TRY_LINK([#include <signal.h>],[ |
|
179 sigset_t ss; |
|
180 struct sigaction sa; |
|
181 sigemptyset(&ss); sigsuspend(&ss); |
|
182 sigaction(SIGINT, &sa, (struct sigaction *) 0); |
|
183 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); |
|
184 ], octave_cv_signal_vintage=posix, |
|
185 [ |
|
186 AC_TRY_LINK([#include <signal.h>], [ |
|
187 int mask = sigmask(SIGINT); |
|
188 sigsetmask(mask); sigblock(mask); sigpause(mask); |
|
189 ], octave_cv_signal_vintage=4.2bsd, |
|
190 [ |
|
191 AC_TRY_LINK([ |
|
192 #include <signal.h> |
|
193 RETSIGTYPE foo() { }], [ |
|
194 int mask = sigmask(SIGINT); |
|
195 sigset(SIGINT, foo); sigrelse(SIGINT); |
|
196 sighold(SIGINT); sigpause(SIGINT); |
2491
|
197 ], octave_cv_signal_vintage=svr3, octave_cv_signal_vintage=v7 |
2469
|
198 )] |
|
199 )] |
|
200 ) |
|
201 ]) |
|
202 AC_MSG_RESULT($octave_cv_signal_vintage) |
2491
|
203 if test "$octave_cv_signal_vintage" = posix; then |
3887
|
204 AC_DEFINE(HAVE_POSIX_SIGNALS,1,[Define if you have POSIX style signals.]) |
2491
|
205 elif test "$octave_cv_signal_vintage" = "4.2bsd"; then |
3887
|
206 AC_DEFINE(HAVE_BSD_SIGNALS,1,[Define if you have BSD style signals.]) |
2491
|
207 elif test "$octave_cv_signal_vintage" = svr3; then |
3887
|
208 AC_DEFINE(HAVE_USG_SIGHOLD,1,[Define if you have System V Release 3 signals.]) |
2469
|
209 fi |
|
210 ]) |
|
211 dnl |
|
212 AC_DEFUN(OCTAVE_REINSTALL_SIGHANDLERS, |
|
213 [AC_REQUIRE([AC_TYPE_SIGNAL]) |
|
214 AC_REQUIRE([OCTAVE_SIGNAL_CHECK]) |
|
215 AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked]) |
|
216 AC_CACHE_VAL(octave_cv_must_reinstall_sighandlers, |
|
217 [AC_TRY_RUN([ |
|
218 #include <signal.h> |
|
219 #ifdef HAVE_UNISTD_H |
|
220 #include <unistd.h> |
|
221 #endif |
|
222 typedef RETSIGTYPE sigfunc(); |
|
223 int nsigint; |
|
224 #ifdef HAVE_POSIX_SIGNALS |
|
225 sigfunc * |
|
226 set_signal_handler(sig, handler) |
|
227 int sig; |
|
228 sigfunc *handler; |
|
229 { |
|
230 struct sigaction act, oact; |
|
231 act.sa_handler = handler; |
|
232 act.sa_flags = 0; |
|
233 sigemptyset (&act.sa_mask); |
|
234 sigemptyset (&oact.sa_mask); |
|
235 sigaction (sig, &act, &oact); |
|
236 return (oact.sa_handler); |
|
237 } |
|
238 #else |
|
239 #define set_signal_handler(s, h) signal(s, h) |
|
240 #endif |
|
241 RETSIGTYPE |
|
242 sigint(s) |
|
243 int s; |
|
244 { |
|
245 nsigint++; |
|
246 } |
|
247 main() |
|
248 { |
|
249 nsigint = 0; |
|
250 set_signal_handler(SIGINT, sigint); |
|
251 kill((int)getpid(), SIGINT); |
|
252 kill((int)getpid(), SIGINT); |
|
253 exit(nsigint != 2); |
|
254 } |
|
255 ], octave_cv_must_reinstall_sighandlers=no, octave_cv_must_reinstall_sighandlers=yes, |
3130
|
256 if test "$octave_cv_signal_vintage" = svr3; then |
|
257 octave_cv_must_reinstall_sighandlers=yes |
|
258 else |
|
259 octave_cv_must_reinstall_sighandlers=no |
|
260 fi)]) |
|
261 if test "$cross_compiling" = yes; then |
|
262 AC_MSG_RESULT([$octave_cv_must_reinstall_sighandlers assumed for cross compilation]) |
|
263 else |
|
264 AC_MSG_RESULT($octave_cv_must_reinstall_sighandlers) |
|
265 fi |
2491
|
266 if test "$octave_cv_must_reinstall_sighandlers" = yes; then |
3887
|
267 AC_DEFINE(MUST_REINSTALL_SIGHANDLERS,1,[Define if signal handlers must be reinstalled after they are called.]) |
2469
|
268 fi |
|
269 ]) |
2626
|
270 dnl |
|
271 dnl This check originally from bash 2.0. |
|
272 dnl |
|
273 dnl Check for typedef'd symbols in header files, but allow the caller to |
|
274 dnl specify the include files to be checked in addition to the default. |
|
275 dnl |
|
276 dnl OCTAVE_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND]) |
|
277 AC_DEFUN(OCTAVE_CHECK_TYPE, |
|
278 [AC_REQUIRE([AC_HEADER_STDC])dnl |
|
279 AC_MSG_CHECKING(for $1) |
|
280 AC_CACHE_VAL(octave_cv_type_$1, |
|
281 [AC_EGREP_CPP($1, [#include <sys/types.h> |
|
282 #if STDC_HEADERS |
|
283 #include <stdlib.h> |
|
284 #endif |
|
285 $2 |
|
286 ], octave_cv_type_$1=yes, octave_cv_type_$1=no)]) |
|
287 AC_MSG_RESULT($octave_cv_type_$1) |
|
288 ifelse($#, 4, [if test $octave_cv_type_$1 = yes; then |
3887
|
289 AC_DEFINE($4, 1, [Define if you have typedef $1.]) |
2626
|
290 fi]) |
|
291 if test $octave_cv_type_$1 = no; then |
3887
|
292 AC_DEFINE($1, $3, [Define to typedef for $1.]) |
2626
|
293 fi |
|
294 ]) |
3107
|
295 dnl |
|
296 dnl Check to see if C++ compiler needs the new friend template declaration |
|
297 dnl syntax. |
|
298 dnl |
|
299 dnl OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL |
|
300 AC_DEFUN(OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL, [ |
|
301 AC_REQUIRE([AC_PROG_CXX]) |
|
302 AC_MSG_CHECKING([for C++ support for new friend template declaration]) |
|
303 AC_CACHE_VAL(octave_cv_cxx_new_friend_template_decl, [ |
3888
|
304 AC_LANG_PUSH(C++) |
3107
|
305 rm -f conftest.h |
|
306 cat > conftest.h <<EOB |
|
307 struct A { |
|
308 friend int operator== (const A&, const A&); |
|
309 A (int) { } |
|
310 }; |
|
311 |
|
312 template <class T> int |
|
313 operator== (const T&, const T&) |
|
314 { |
|
315 return 0; |
|
316 } |
|
317 EOB |
|
318 AC_TRY_LINK([#include "conftest.h"], [ |
|
319 A a (1); |
|
320 return a == A(1); |
|
321 ], |
|
322 octave_cv_cxx_new_friend_template_decl=no, |
|
323 octave_cv_cxx_new_friend_template_decl=yes |
|
324 ) |
3888
|
325 AC_LANG_POP(C++) |
3107
|
326 ]) |
|
327 AC_MSG_RESULT($octave_cv_cxx_new_friend_template_decl) |
|
328 if test $octave_cv_cxx_new_friend_template_decl = yes; then |
3887
|
329 AC_DEFINE(CXX_NEW_FRIEND_TEMPLATE_DECL,1,[Define if your compiler supports `<>' stuff for template friends.]) |
3107
|
330 fi |
|
331 ]) |
3126
|
332 dnl |
3233
|
333 dnl Check to see if C compiler handles FLAG command line option. If |
|
334 dnl two arguments are specified, execute the second arg as shell |
|
335 dnl commands. Otherwise, add FLAG to CFLAGS if the compiler accepts |
|
336 dnl the flag. |
3126
|
337 dnl |
|
338 dnl OCTAVE_CC_FLAG |
|
339 AC_DEFUN(OCTAVE_CC_FLAG, [ |
|
340 ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` |
|
341 AC_MSG_CHECKING(whether ${CC-cc} accepts $1) |
|
342 AC_CACHE_VAL(octave_cv_cc_flag_$ac_safe, [ |
3888
|
343 AC_LANG_PUSH(C) |
3126
|
344 XCFLAGS="$CFLAGS" |
|
345 CFLAGS="$CFLAGS $1" |
|
346 AC_TRY_LINK([], [], |
|
347 eval "octave_cv_cc_flag_$ac_safe=yes", |
|
348 eval "octave_cv_cc_flag_$ac_safe=no") |
|
349 CFLAGS="$XCFLAGS" |
3888
|
350 AC_LANG_POP(C) |
3126
|
351 ]) |
|
352 if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then |
|
353 AC_MSG_RESULT(yes) |
3131
|
354 ifelse([$2], , [ |
|
355 CFLAGS="$CFLAGS $1" |
|
356 AC_MSG_RESULT([adding $1 to CFLAGS])], [$2]) |
3126
|
357 else |
|
358 AC_MSG_RESULT(no) |
|
359 ifelse([$3], , , [$3]) |
|
360 fi |
|
361 ]) |
|
362 dnl |
3233
|
363 dnl Check to see if C++ compiler handles FLAG command line option. If |
|
364 dnl two arguments are specified, execute the second arg as shell |
|
365 dnl commands. Otherwise, add FLAG to CXXFLAGS if the compiler accepts |
|
366 dnl the flag. |
3126
|
367 dnl |
|
368 dnl OCTAVE_CXX_FLAG |
|
369 AC_DEFUN(OCTAVE_CXX_FLAG, [ |
|
370 ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` |
3222
|
371 AC_MSG_CHECKING(whether ${CXX-g++} accepts $1) |
3126
|
372 AC_CACHE_VAL(octave_cv_cxx_flag_$ac_safe, [ |
3888
|
373 AC_LANG_PUSH(C++) |
3126
|
374 XCXXFLAGS="$CXXFLAGS" |
|
375 CXXFLAGS="$CXXFLAGS $1" |
|
376 AC_TRY_LINK([], [], |
|
377 eval "octave_cv_cxx_flag_$ac_safe=yes", |
|
378 eval "octave_cv_cxx_flag_$ac_safe=no") |
|
379 CXXFLAGS="$XCXXFLAGS" |
3888
|
380 AC_LANG_POP(C++) |
3126
|
381 ]) |
|
382 if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then |
|
383 AC_MSG_RESULT(yes) |
3131
|
384 ifelse([$2], , [ |
|
385 CXXFLAGS="$CXXFLAGS $1" |
|
386 AC_MSG_RESULT([adding $1 to CXXFLAGS])], [$2]) |
3126
|
387 else |
|
388 AC_MSG_RESULT(no) |
|
389 ifelse([$3], , , [$3]) |
|
390 fi |
|
391 ]) |
3130
|
392 dnl |
3729
|
393 dnl Check for flex |
|
394 dnl |
|
395 AC_DEFUN(OCTAVE_PROG_FLEX, [ |
|
396 ### For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
397 ### it, and it might not be installed. |
|
398 ### |
|
399 ### Also make sure that we generate an interactive scanner if we are |
|
400 ### using flex. |
|
401 AC_PROG_LEX |
|
402 case "$LEX" in |
|
403 flex*) |
|
404 LFLAGS="-t -I" |
|
405 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
|
406 LEXLIB= |
|
407 ;; |
|
408 *) |
|
409 LEX='$(top_srcdir)/missing flex' |
|
410 warn_flex="I didn't find flex, but it's only a problem if you need to reconstruct lex.cc" |
|
411 AC_MSG_WARN($warn_flex) |
|
412 ;; |
|
413 esac |
|
414 AC_SUBST(LFLAGS) |
|
415 ]) |
|
416 dnl |
|
417 dnl Check for bison |
|
418 dnl |
|
419 AC_DEFUN(OCTAVE_PROG_BISON, [ |
|
420 AC_PROG_YACC |
|
421 case "$YACC" in |
|
422 bison*) |
|
423 ;; |
|
424 *) |
|
425 YACC='$(top_srcdir)/missing bison' |
|
426 warn_bison="I didn't find bison, but it's only a problem if you need to reconstruct parse.cc" |
|
427 AC_MSG_WARN($warn_bison) |
|
428 ;; |
|
429 esac |
|
430 ]) |
|
431 dnl |
3130
|
432 dnl What pager should we use? |
|
433 dnl |
|
434 AC_DEFUN(OCTAVE_PROG_PAGER, |
|
435 [if test "$cross_compiling" = yes; then |
|
436 DEFAULT_PAGER=less |
|
437 AC_MSG_RESULT(assuming $DEFAULT_PAGER exists on $canonical_host_type host) |
|
438 AC_SUBST(DEFAULT_PAGER) |
|
439 else |
|
440 octave_possible_pagers="less more page pg" |
|
441 case "$canonical_host_type" in |
|
442 *-*-cygwin32) |
|
443 octave_possible_pagers="$octave_possible_pagers more.com" |
|
444 ;; |
|
445 esac |
|
446 |
|
447 AC_CHECK_PROGS(DEFAULT_PAGER, $octave_possible_pagers, []) |
|
448 if test -z "$DEFAULT_PAGER"; then |
|
449 warn_less="I couldn't find \`less', \`more', \`page', or \`pg'" |
|
450 AC_MSG_WARN($warn_less) |
|
451 fi |
|
452 fi |
|
453 ]) |
|
454 dnl |
|
455 dnl Does gnuplot exist? Is it a recent version? |
|
456 dnl |
|
457 AC_DEFUN(OCTAVE_PROG_GNUPLOT, |
|
458 [if test "$cross_compiling" = yes; then |
|
459 GNUPLOT_BINARY=gnuplot |
|
460 AC_MSG_RESULT(assuming $GNUPLOT_BINARY exists on $canonical_host_type host) |
|
461 AC_SUBST(DEFAULT_PAGER) |
|
462 AC_MSG_RESULT(assuming $GNUPLOT_BINARY supports multiplot mode) |
3887
|
463 AC_DEFINE(GNUPLOT_HAS_MULTIPLOT, 1, [Define if gnuplot has multiplot.]) |
3130
|
464 AC_MSG_RESULT(assuming $GNUPLOT_BINARY supports multiple frams) |
3887
|
465 AC_DEFINE(GNUPLOT_HAS_FRAMES, 1, [Define if gnuplot has frames.]) |
3130
|
466 else |
|
467 AC_CHECK_PROG(GNUPLOT_BINARY, gnuplot, gnuplot, []) |
|
468 if test -n "$GNUPLOT_BINARY"; then |
|
469 AC_MSG_CHECKING([to see if your gnuplot supports multiplot]) |
|
470 if test -z "`echo 'set term unknown; set multiplot' | \ |
|
471 $GNUPLOT_BINARY 2>&1`"; then |
|
472 AC_MSG_RESULT([yes]) |
|
473 AC_DEFINE(GNUPLOT_HAS_MULTIPLOT, 1) |
|
474 else |
|
475 AC_MSG_RESULT([no]) |
|
476 fi |
|
477 AC_MSG_CHECKING([to see if your gnuplot supports multiple plot windows]) |
|
478 if test -z "`echo 'set term x11 2' | $GNUPLOT_BINARY 2>&1`"; then |
|
479 AC_MSG_RESULT([yes]) |
|
480 AC_DEFINE(GNUPLOT_HAS_FRAMES, 1) |
|
481 else |
|
482 AC_MSG_RESULT([no]) |
|
483 fi |
|
484 else |
|
485 warn_gnuplot="yes" |
|
486 |
|
487 ## If you change this text, be sure to also copy it to the set of |
|
488 ## warnings at the end of the script |
|
489 |
|
490 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
491 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) |
|
492 AC_MSG_WARN([plotting commands without it.]) |
|
493 AC_MSG_WARN([]) |
|
494 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
495 AC_MSG_WARN([tell Octave where to find it by typing the command]) |
|
496 AC_MSG_WARN([]) |
|
497 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
498 AC_MSG_WARN([]) |
|
499 AC_MSG_WARN([at the Octave prompt.]) |
|
500 fi |
|
501 fi |
|
502 ]) |
|
503 dnl |
|
504 dnl Is DejaGNU installed? |
|
505 dnl |
3222
|
506 dnl OCTAVE_PROG_RUNTEST |
3130
|
507 AC_DEFUN(OCTAVE_PROG_RUNTEST, |
|
508 [if test "$cross_compiling" = yes; then |
|
509 RUNTEST=runtest |
|
510 AC_MSG_RESULT(assuming $RUNTEST exists on $canonical_host_type host) |
|
511 AC_SUBST(RUNTEST) |
|
512 else |
|
513 AC_CHECK_PROG(RUNTEST, runtest, runtest, []) |
|
514 if test -z "$RUNTEST"; then |
|
515 warn_runtest="I didn't find runtest -- install DejaGNU if you want to run \`make check'" |
|
516 AC_MSG_WARN($warn_runtest) |
|
517 fi |
|
518 AC_SUBST(RUNTEST) |
|
519 fi |
|
520 ]) |
3222
|
521 dnl |
3673
|
522 dnl Is gperf installed? |
|
523 dnl |
|
524 dnl OCTAVE_PROG_GPERF |
3731
|
525 AC_DEFUN(OCTAVE_PROG_GPERF, [ |
|
526 AC_CHECK_PROG(GPERF, gperf, gperf, []) |
|
527 if test -n "$GPERF"; then |
|
528 if echo "%{ |
|
529 %} |
|
530 %% |
3750
|
531 foo" | $GPERF -t -C -D -E -G -L ANSI-C -H octave_kw_hash -N octave_kw_lookup > /dev/null 2>&1; then |
3731
|
532 true |
|
533 else |
|
534 GPERF="" |
|
535 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" |
|
536 AC_MSG_WARN($warn_gperf) |
|
537 fi |
|
538 else |
|
539 GPERF='$(top_srcdir)/missing gperf' |
|
540 warn_gperf="I didn't find gperf, but it's only a problem if you need to reconstruct oct-gperf.h" |
|
541 AC_MSG_WARN($warn_gperf) |
|
542 fi |
|
543 AC_SUBST(GPERF) |
3673
|
544 ]) |
|
545 dnl |
3222
|
546 dnl Find nm. |
|
547 dnl |
|
548 dnl OCTAVE_PROG_NM |
|
549 AC_DEFUN(OCTAVE_PROG_NM, |
|
550 [if test "$cross_compiling" = yes; then |
|
551 NM=nm |
|
552 AC_MSG_RESULT(assuming $NM exists on $canonical_host_type host) |
|
553 AC_SUBST(NM) |
|
554 else |
|
555 AC_CHECK_PROG(NM, nm, nm, []) |
|
556 AC_SUBST(NM) |
|
557 fi |
|
558 ]) |
|
559 dnl |
|
560 dnl See if the C++ compiler prepends an underscore to external names. |
|
561 dnl |
|
562 dnl OCTAVE_CXX_PREPENDS_UNDERSCORE |
|
563 AC_DEFUN(OCTAVE_CXX_PREPENDS_UNDERSCORE, |
|
564 [AC_MSG_CHECKING([whether ${CXX-g++} prepends an underscore to external names]) |
|
565 AC_CACHE_VAL(octave_cv_cxx_prepends_underscore, |
|
566 [octave_cv_cxx_prepends_underscore=no |
3888
|
567 AC_LANG_PUSH(C++) |
3222
|
568 cat > conftest.$ac_ext <<EOF |
3842
|
569 bool FSmy_dld_fcn (void) { return false; } |
3222
|
570 EOF |
|
571 if AC_TRY_EVAL(ac_compile); then |
|
572 if test "`${NM-nm} conftest.o | grep _FSmy_dld_fcn`" != ""; then |
|
573 octave_cv_cxx_prepends_underscore=yes |
|
574 fi |
|
575 else |
3888
|
576 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD |
|
577 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD |
3222
|
578 fi |
3888
|
579 AC_LANG_POP(C++) |
3222
|
580 ]) |
|
581 AC_MSG_RESULT($octave_cv_cxx_prepends_underscore) |
|
582 if test $octave_cv_cxx_prepends_underscore = yes; then |
3887
|
583 AC_DEFINE(CXX_PREPENDS_UNDERSCORE, 1, [Define if your compiler prepends underscores to external names.]) |
3222
|
584 fi |
|
585 ]) |
3769
|
586 dnl |
|
587 dnl See if the C++ library is ISO compliant. |
|
588 dnl FIXME: This is obviously very simplistic, and trivially fooled. |
|
589 dnl |
|
590 dnl OCTAVE_CXX_ISO_COMPLIANT_LIBRARY |
|
591 AC_DEFUN(OCTAVE_CXX_ISO_COMPLIANT_LIBRARY, [ |
|
592 AC_REQUIRE([AC_PROG_CXX]) |
|
593 AC_MSG_CHECKING([if C++ library is ISO compliant]) |
|
594 AC_CACHE_VAL(octave_cv_cxx_iso_compliant_library, [ |
3888
|
595 AC_LANG_PUSH(C++) |
3769
|
596 rm -f conftest.h |
|
597 for inc in algorithm bitset cassert cctype cerrno cfloat ciso646 \ |
|
598 climits clocale cmath complex csetjmp csignal cstdarg cstddef \ |
|
599 cstdio cstdlib cstring ctime cwchar cwctype deque exception \ |
|
600 fstream functional iomanip ios iosfwd iostream istream iterator \ |
|
601 limits list locale map memory new numeric ostream queue set \ |
|
602 sstream stack stdexcept streambuf string strstream typeinfo \ |
|
603 utility valarray vector; do |
|
604 echo "#include <$inc>" >> conftest.h |
|
605 done |
|
606 AC_TRY_LINK([#include "conftest.h"], [ |
|
607 std::bitset<50> flags; |
|
608 flags.set(); |
|
609 int digits = std::numeric_limits<unsigned long>::digits; |
|
610 digits = 0; |
|
611 ], |
|
612 octave_cv_cxx_iso_compliant_library=yes, |
|
613 octave_cv_cxx_iso_compliant_library=no |
|
614 ) |
3888
|
615 AC_LANG_POP(C++) |
3769
|
616 ]) |
|
617 AC_MSG_RESULT($octave_cv_cxx_iso_compliant_library) |
|
618 if test $octave_cv_cxx_iso_compliant_library = yes; then |
3887
|
619 AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY, 1, [Define if your C++ runtime library is ISO compliant.]) |
3769
|
620 fi |
|
621 ]) |
3822
|
622 dnl |
|
623 dnl Allow the user disable support for command line editing using GNU |
|
624 dnl readline. |
|
625 dnl |
|
626 dnl OCTAVE_ENABLE_READLINE |
|
627 AC_DEFUN(OCTAVE_ENABLE_READLINE, [ |
|
628 USE_READLINE=true |
|
629 AC_ARG_ENABLE(readline, |
|
630 [ --enable-readline use readline library (default is yes)], |
|
631 [if test "$enableval" = no; then |
3824
|
632 USE_READLINE=false |
3825
|
633 warn_readline="command editing and history features require GNU Readline" |
3824
|
634 fi]) |
3822
|
635 if $USE_READLINE; then |
|
636 AC_CHECK_LIB(readline, rl_set_keyboard_input_timeout, [ |
|
637 LIBS="-lreadline $LIBS" |
3887
|
638 AC_DEFINE(USE_READLINE, 1, [Define to use the readline library.]) |
3822
|
639 ], [ |
3824
|
640 AC_MSG_WARN([I need GNU Readline 4.2 or later]) |
|
641 AC_MSG_ERROR([this is fatal unless you specify --disable-readline]) |
3822
|
642 ]) |
|
643 fi |
|
644 ]) |
3842
|
645 dnl |
|
646 dnl Determine the C++ compiler ABI. It sets the macro CXX_ABI to the |
|
647 dnl name of the ABI, and is used to mangle the C linkage loadable |
|
648 dnl functions to avoid ABI mismatch. GNU C++ currently uses gnu_v2 |
|
649 dnl (GCC versions <= 2.95.x) dnl or gnu_v3 (GCC versions >= 3.0). |
|
650 dnl Set to "unknown" is when we don't know enough about the ABI, which |
|
651 dnl will happen when using an unsupported C++ compiler. |
|
652 dnl |
|
653 dnl OCTAVE_CXX_ABI |
|
654 AC_DEFUN(OCTAVE_CXX_ABI, |
|
655 [AC_MSG_CHECKING([C++ ABI version used by ${CXX}]) |
|
656 AC_CACHE_VAL(octave_cv_cxx_abi, |
|
657 [octave_cv_cxx_abi='unknown' |
3888
|
658 AC_LANG_PUSH(C++) |
3842
|
659 cat > conftest.$ac_ext <<EOF |
|
660 bool FSmy_dld_fcn (void) { return false; } |
|
661 EOF |
|
662 if AC_TRY_EVAL(ac_compile); then |
|
663 if test "`${NM-nm} conftest.o | grep FSmy_dld_fcn__Fv`" != ""; then |
|
664 octave_cv_cxx_abi='gnu_v2' |
|
665 fi |
|
666 if test "`${NM-nm} conftest.o | grep _Z12FSmy_dld_fcnv`" != ""; then |
|
667 octave_cv_cxx_abi='gnu_v3' |
|
668 fi |
|
669 if test "`${NM-nm} conftest.o | grep __1cMFSmy_dld_fcn6F_b_`" != ""; then |
3843
|
670 octave_cv_cxx_abi='sun_v5' |
3842
|
671 fi |
|
672 else |
3888
|
673 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD |
|
674 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD |
3842
|
675 fi |
3888
|
676 AC_LANG_POP(C++) |
3842
|
677 ]) |
|
678 AC_MSG_RESULT($octave_cv_cxx_abi) |
3887
|
679 AC_DEFINE_UNQUOTED(CXX_ABI, $octave_cv_cxx_abi, [Define to the C++ ABI your compiler uses.]) |
3842
|
680 ]) |
|
681 |