annotate aclocal.m4 @ 6469:a848b846cb3a ss-2-9-10

[project @ 2007-03-27 18:42:11 by jwe]
author jwe
date Tue, 27 Mar 2007 18:42:11 +0000
parents d26c558691cd
children 388747e3d96b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1232
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
1 dnl aclocal.m4 -- extra macros for configuring Octave
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
2 dnl
2847
8b262e771614 [project @ 1997-03-27 16:18:26 by jwe]
jwe
parents: 2831
diff changeset
3 dnl Copyright (C) 1996, 1997 John W. Eaton
1232
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
4 dnl
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
5 dnl This file is part of Octave.
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
6 dnl
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
7 dnl Octave is free software; you can redistribute it and/or modify it
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
8 dnl under the terms of the GNU General Public License as published by the
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
9 dnl Free Software Foundation; either version 2, or (at your option) any
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
10 dnl later version.
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
11 dnl
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
12 dnl Octave is distributed in the hope that it will be useful, but WITHOUT
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
13 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
14 dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
15 dnl for more details.
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
16 dnl
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
17 dnl You should have received a copy of the GNU General Public License
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
18 dnl along with Octave; see the file COPYING. If not, write to the Free
5307
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 5177
diff changeset
19 dnl Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 5177
diff changeset
20 dnl 02110-1301, USA.
2548
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
21 dnl
2813
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
22 dnl ----------------------------------------------------------------------
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
23 dnl
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
24 dnl Figure out the hardware-vendor-os info.
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
25 dnl
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
26 dnl OCTAVE_HOST_TYPE
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
27 AC_DEFUN(OCTAVE_HOST_TYPE,
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
28 [AC_CANONICAL_HOST
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
29 if test -z "$host"; then
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
30 host=unknown
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
31 fi
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
32 canonical_host_type=$host
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
33 if test "$host" = unknown; then
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
34 AC_MSG_WARN([configuring Octave for unknown system type
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
35 ])
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
36 fi
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
37 AC_SUBST(canonical_host_type)])
2813
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
38 dnl
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
39 dnl Set default value for a variable and substitute it.
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
40 dnl
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
41 dnl OCTAVE_SET_DEFAULT
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
42 AC_DEFUN(OCTAVE_SET_DEFAULT,
3176
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3174
diff changeset
43 [ifelse($#, 2, [: ${$1=$2}
2813
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
44 ])dnl
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
45 AC_MSG_RESULT([defining $1 to be $$1])
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
46 AC_SUBST($1)])
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
47 dnl
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
48 dnl
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
49 dnl OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
50 AC_DEFUN(OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS,
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
51 [if test "${with_$1+set}" = set; then
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
52 if test "${with_$2+set}" = set; then
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
53 if test "$with_$2" = no; then
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
54 true
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
55 else
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
56 $3
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
57 fi
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
58 fi
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
59 fi])
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
60 dnl
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
61 dnl Check for ar.
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
62 dnl
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
63 AC_DEFUN(OCTAVE_PROG_AR,
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
64 [if test -z "$AR"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
65 AR=ar
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
66 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
67 AC_SUBST(AR)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
68
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
69 if test -z "$ARFLAGS"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
70 ARFLAGS="rc"
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
71 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
72 AC_SUBST(ARFLAGS)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
73 ])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
74 dnl
2574
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
75 dnl See if the standard string class has npos as a member.
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
76 dnl
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
77 AC_DEFUN(OCTAVE_STRING_NPOS,
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
78 [AC_CACHE_CHECK([whether including <string> defines NPOS],
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
79 octave_cv_string_npos,
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
80 [AC_LANG_PUSH(C++)
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
81 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string>]],
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
82 [[size_t foo = NPOS]])],
2574
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
83 octave_cv_string_npos=yes, octave_cv_string_npos=no)])
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
84 if test $octave_cv_string_npos = no; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
85 AC_DEFINE(NPOS, [std::string::npos], [Define (to string::npos) if <string> doesn't])
2574
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
86 fi
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
87 AC_LANG_POP(C++)
2574
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
88 ])
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
89 dnl
4360
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
90 dnl See if the compiler supports placement delete
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
91 dnl
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
92 AC_DEFUN(OCTAVE_PLACEMENT_DELETE,
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
93 [AC_CACHE_CHECK([whether <new> defines placement delete operator],
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
94 octave_cv_placement_delete,
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
95 [AC_LANG_PUSH(C++)
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
96 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <new>]],
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
97 [[operator delete((void *)0, (void *)0);]])],
4360
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
98 octave_cv_placement_delete=yes, octave_cv_placement_delete=no)])
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
99 if test $octave_cv_placement_delete = yes; then
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
100 AC_DEFINE(HAVE_PLACEMENT_DELETE,1,[Define if C++ supports operator delete(void *, void *)])
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
101 fi
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
102 AC_LANG_POP(C++)
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
103 ])
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
104 dnl
4366
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
105 dnl See if the compiler dynamic auto arrays
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
106 dnl
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
107 AC_DEFUN(OCTAVE_DYNAMIC_AUTO_ARRAYS,
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
108 [AC_CACHE_CHECK([whether C++ supports dynamic auto arrays],
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
109 octave_cv_dynamic_auto_arrays,
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
110 [AC_LANG_PUSH(C++)
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
111 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
112 [[void test(char *); int length(); char x[length()]; test(x);]])],
4366
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
113 octave_cv_dynamic_auto_arrays=yes, octave_cv_dynamic_auto_arrays=no)])
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
114 if test $octave_cv_dynamic_auto_arrays = yes; then
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
115 AC_DEFINE(HAVE_DYNAMIC_AUTO_ARRAYS,1,[Define if C++ supports dynamic auto arrays])
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
116 fi
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
117 AC_LANG_POP(C++)
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
118 ])
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
119 dnl
1707
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
120 dnl The following test is from Karl Berry's Kpathseach library. I'm
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
121 dnl including it here in case we someday want to make the use of
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
122 dnl kpathsea optional.
1708
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
123 dnl
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
124 dnl Some BSD putenv's, e.g., FreeBSD, do malloc/free's on the environment.
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
125 dnl This test program is due to Mike Hibler <mike@cs.utah.edu>.
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
126 dnl We don't actually need to run this if we don't have putenv, but it
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
127 dnl doesn't hurt.
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
128 AC_DEFUN(OCTAVE_SMART_PUTENV,
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
129 [AC_MSG_CHECKING(whether putenv uses malloc)
1707
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
130 AC_CACHE_VAL(octave_cv_func_putenv_malloc,
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
131 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
1707
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
132 #define VAR "YOW_VAR"
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
133 #define STRING1 "GabbaGabbaHey"
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
134 #define STRING2 "Yow!!" /* should be shorter than STRING1 */
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
135 extern char *getenv (); /* in case char* and int don't mix gracefully */
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
136 main ()
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
137 {
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
138 char *str1, *rstr1, *str2, *rstr2;
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
139 str1 = getenv (VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
140 if (str1)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
141 exit (1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
142 str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
143 if (str1 == 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
144 exit (2);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
145 strcpy (str1, VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
146 strcat (str1, "=");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
147 strcat (str1, STRING1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
148 if (putenv (str1) < 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
149 exit (3);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
150 rstr1 = getenv (VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
151 if (rstr1 == 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
152 exit (4);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
153 rstr1 -= strlen (VAR) + 1;
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
154 if (strncmp (rstr1, VAR, strlen (VAR)))
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
155 exit (5);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
156 str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
157 if (str2 == 0 || str1 == str2)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
158 exit (6);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
159 strcpy (str2, VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
160 strcat (str2, "=");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
161 strcat (str2, STRING2);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
162 if (putenv (str2) < 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
163 exit (7);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
164 rstr2 = getenv (VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
165 if (rstr2 == 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
166 exit (8);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
167 rstr2 -= strlen (VAR) + 1;
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
168 #if 0
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
169 printf ("rstr1=0x%x, rstr2=0x%x\n", rstr1, rstr2);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
170 /*
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
171 * If string from first call was reused for the second call,
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
172 * you had better not do a free on the first string!
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
173 */
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
174 if (rstr1 == rstr2)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
175 printf ("#define SMART_PUTENV\n");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
176 else
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
177 printf ("#undef SMART_PUTENV\n");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
178 #endif
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
179 exit (rstr1 == rstr2 ? 0 : 1);
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
180 }]])], octave_cv_func_putenv_malloc=yes, octave_cv_func_putenv_malloc=no,
1707
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
181 octave_cv_func_putenv_malloc=no)])dnl
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
182 AC_MSG_RESULT($octave_cv_func_putenv_malloc)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
183 if test $octave_cv_func_putenv_malloc = yes; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
184 AC_DEFINE(SMART_PUTENV,1,[To quiet autoheader.])
1708
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
185 fi])
1788
b7de2fd2be6b [project @ 1996-01-24 20:47:58 by jwe]
jwe
parents: 1708
diff changeset
186 dnl
2469
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
187 dnl These two checks for signal functions were originally part of the
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
188 dnl aclocal.m4 file distributed with bash 2.0.
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
189 dnl
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
190 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
191 AC_DEFUN(OCTAVE_SIGNAL_CHECK,
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
192 [AC_REQUIRE([AC_TYPE_SIGNAL])
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
193 AC_MSG_CHECKING(for type of signal functions)
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
194 AC_CACHE_VAL(octave_cv_signal_vintage,
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
195 [
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
196 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
197 [[sigset_t ss;
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
198 struct sigaction sa;
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
199 sigemptyset (&ss);
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
200 sigsuspend (&ss);
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
201 sigaction (SIGINT, &sa, (struct sigaction *) 0);
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
202 sigprocmask (SIG_BLOCK, &ss, (sigset_t *) 0);]])],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
203 [octave_cv_signal_vintage=posix],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
204 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
205 [[int mask = sigmask (SIGINT);
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
206 sigsetmask (mask);
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
207 sigblock (mask);
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
208 sigpause (mask);]])],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
209 [octave_cv_signal_vintage=4.2bsd],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
210 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
211 RETSIGTYPE foo() { }]],
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
212 [[int mask = sigmask (SIGINT);
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
213 sigset (SIGINT, foo);
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
214 sigrelse (SIGINT);
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
215 sighold (SIGINT);
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
216 sigpause (SIGINT);]])],
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
217 [octave_cv_signal_vintage=svr3],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
218 [octave_cv_signal_vintage=v7])])])])
2469
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
219 AC_MSG_RESULT($octave_cv_signal_vintage)
2491
d47834a272c2 [project @ 1996-11-08 22:44:29 by jwe]
jwe
parents: 2469
diff changeset
220 if test "$octave_cv_signal_vintage" = posix; then
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
221 AC_DEFINE(HAVE_POSIX_SIGNALS, 1, [Define if you have POSIX style signals.])
2491
d47834a272c2 [project @ 1996-11-08 22:44:29 by jwe]
jwe
parents: 2469
diff changeset
222 elif test "$octave_cv_signal_vintage" = "4.2bsd"; then
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
223 AC_DEFINE(HAVE_BSD_SIGNALS, 1, [Define if you have BSD style signals.])
2491
d47834a272c2 [project @ 1996-11-08 22:44:29 by jwe]
jwe
parents: 2469
diff changeset
224 elif test "$octave_cv_signal_vintage" = svr3; then
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
225 AC_DEFINE(HAVE_USG_SIGHOLD, 1, [Define if you have System V Release 3 signals.])
2469
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
226 fi
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
227 ])
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
228 dnl
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
229 AC_DEFUN(OCTAVE_REINSTALL_SIGHANDLERS,
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
230 [AC_REQUIRE([AC_TYPE_SIGNAL])
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
231 AC_REQUIRE([OCTAVE_SIGNAL_CHECK])
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
232 AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked])
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
233 AC_CACHE_VAL(octave_cv_must_reinstall_sighandlers,
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
234 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
2469
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
235 #include <signal.h>
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
236 #ifdef HAVE_UNISTD_H
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
237 #include <unistd.h>
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
238 #endif
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
239 typedef RETSIGTYPE sigfunc();
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
240 int nsigint;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
241 #ifdef HAVE_POSIX_SIGNALS
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
242 sigfunc *
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
243 set_signal_handler(sig, handler)
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
244 int sig;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
245 sigfunc *handler;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
246 {
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
247 struct sigaction act, oact;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
248 act.sa_handler = handler;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
249 act.sa_flags = 0;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
250 sigemptyset (&act.sa_mask);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
251 sigemptyset (&oact.sa_mask);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
252 sigaction (sig, &act, &oact);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
253 return (oact.sa_handler);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
254 }
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
255 #else
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
256 #define set_signal_handler(s, h) signal(s, h)
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
257 #endif
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
258 RETSIGTYPE
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
259 sigint(s)
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
260 int s;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
261 {
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
262 nsigint++;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
263 }
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
264 main()
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
265 {
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
266 nsigint = 0;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
267 set_signal_handler(SIGINT, sigint);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
268 kill((int)getpid(), SIGINT);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
269 kill((int)getpid(), SIGINT);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
270 exit(nsigint != 2);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
271 }
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
272 ]])],
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
273 octave_cv_must_reinstall_sighandlers=no,
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
274 octave_cv_must_reinstall_sighandlers=yes,
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
275 if test "$octave_cv_signal_vintage" = svr3; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
276 octave_cv_must_reinstall_sighandlers=yes
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
277 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
278 octave_cv_must_reinstall_sighandlers=no
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
279 fi)])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
280 if test "$cross_compiling" = yes; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
281 AC_MSG_RESULT([$octave_cv_must_reinstall_sighandlers assumed for cross compilation])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
282 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
283 AC_MSG_RESULT($octave_cv_must_reinstall_sighandlers)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
284 fi
2491
d47834a272c2 [project @ 1996-11-08 22:44:29 by jwe]
jwe
parents: 2469
diff changeset
285 if test "$octave_cv_must_reinstall_sighandlers" = yes; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
286 AC_DEFINE(MUST_REINSTALL_SIGHANDLERS,1,[Define if signal handlers must be reinstalled after they are called.])
2469
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
287 fi
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
288 ])
2626
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
289 dnl
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
290 dnl Check to see if C++ compiler needs the new friend template declaration
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
291 dnl syntax.
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
292 dnl
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
293 dnl OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
294 AC_DEFUN(OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL, [
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
295 AC_REQUIRE([AC_PROG_CXX])
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
296 AC_MSG_CHECKING([for C++ support for new friend template declaration])
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
297 AC_CACHE_VAL(octave_cv_cxx_new_friend_template_decl, [
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
298 AC_LANG_PUSH(C++)
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
299 rm -f conftest.h
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
300 cat > conftest.h <<EOB
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
301 struct A {
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
302 friend int operator== (const A&, const A&);
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
303 A (int) { }
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
304 };
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
305
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
306 template <class T> int
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
307 operator== (const T&, const T&)
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
308 {
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
309 return 0;
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
310 }
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
311 EOB
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
312 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "conftest.h"]],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
313 [[A a (1);
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
314 return a == A(1);]])],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
315 [octave_cv_cxx_new_friend_template_decl=no],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
316 [octave_cv_cxx_new_friend_template_decl=yes])
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
317 AC_LANG_POP(C++)
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
318 ])
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
319 AC_MSG_RESULT($octave_cv_cxx_new_friend_template_decl)
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
320 if test $octave_cv_cxx_new_friend_template_decl = yes; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
321 AC_DEFINE(CXX_NEW_FRIEND_TEMPLATE_DECL,1,[Define if your compiler supports `<>' stuff for template friends.])
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
322 fi
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
323 ])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
324 dnl
3233
98d0ee053ba4 [project @ 1999-01-27 20:23:40 by jwe]
jwe
parents: 3222
diff changeset
325 dnl Check to see if C compiler handles FLAG command line option. If
98d0ee053ba4 [project @ 1999-01-27 20:23:40 by jwe]
jwe
parents: 3222
diff changeset
326 dnl two arguments are specified, execute the second arg as shell
98d0ee053ba4 [project @ 1999-01-27 20:23:40 by jwe]
jwe
parents: 3222
diff changeset
327 dnl commands. Otherwise, add FLAG to CFLAGS if the compiler accepts
98d0ee053ba4 [project @ 1999-01-27 20:23:40 by jwe]
jwe
parents: 3222
diff changeset
328 dnl the flag.
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
329 dnl
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
330 dnl OCTAVE_CC_FLAG
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
331 AC_DEFUN(OCTAVE_CC_FLAG, [
3908
90dc5c9a9a21 [project @ 2002-04-24 19:53:35 by jwe]
jwe
parents: 3892
diff changeset
332 ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'`
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
333 AC_MSG_CHECKING(whether ${CC-cc} accepts $1)
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
334 AC_CACHE_VAL(octave_cv_cc_flag_$ac_safe, [
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
335 AC_LANG_PUSH(C)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
336 XCFLAGS="$CFLAGS"
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
337 CFLAGS="$CFLAGS $1"
5177
86fa011d6404 [project @ 2005-03-03 00:32:34 by jwe]
jwe
parents: 5094
diff changeset
338 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
339 eval "octave_cv_cc_flag_$ac_safe=yes",
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
340 eval "octave_cv_cc_flag_$ac_safe=no")
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
341 CFLAGS="$XCFLAGS"
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
342 AC_LANG_POP(C)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
343 ])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
344 if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
345 AC_MSG_RESULT(yes)
3131
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
346 ifelse([$2], , [
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
347 CFLAGS="$CFLAGS $1"
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
348 AC_MSG_RESULT([adding $1 to CFLAGS])], [$2])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
349 else
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
350 AC_MSG_RESULT(no)
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
351 ifelse([$3], , , [$3])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
352 fi
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
353 ])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
354 dnl
3233
98d0ee053ba4 [project @ 1999-01-27 20:23:40 by jwe]
jwe
parents: 3222
diff changeset
355 dnl Check to see if C++ compiler handles FLAG command line option. If
98d0ee053ba4 [project @ 1999-01-27 20:23:40 by jwe]
jwe
parents: 3222
diff changeset
356 dnl two arguments are specified, execute the second arg as shell
98d0ee053ba4 [project @ 1999-01-27 20:23:40 by jwe]
jwe
parents: 3222
diff changeset
357 dnl commands. Otherwise, add FLAG to CXXFLAGS if the compiler accepts
98d0ee053ba4 [project @ 1999-01-27 20:23:40 by jwe]
jwe
parents: 3222
diff changeset
358 dnl the flag.
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
359 dnl
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
360 dnl OCTAVE_CXX_FLAG
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
361 AC_DEFUN(OCTAVE_CXX_FLAG, [
3908
90dc5c9a9a21 [project @ 2002-04-24 19:53:35 by jwe]
jwe
parents: 3892
diff changeset
362 ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'`
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
363 AC_MSG_CHECKING(whether ${CXX-g++} accepts $1)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
364 AC_CACHE_VAL(octave_cv_cxx_flag_$ac_safe, [
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
365 AC_LANG_PUSH(C++)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
366 XCXXFLAGS="$CXXFLAGS"
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
367 CXXFLAGS="$CXXFLAGS $1"
5177
86fa011d6404 [project @ 2005-03-03 00:32:34 by jwe]
jwe
parents: 5094
diff changeset
368 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
369 eval "octave_cv_cxx_flag_$ac_safe=yes",
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
370 eval "octave_cv_cxx_flag_$ac_safe=no")
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
371 CXXFLAGS="$XCXXFLAGS"
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
372 AC_LANG_POP(C++)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
373 ])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
374 if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
375 AC_MSG_RESULT(yes)
3131
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
376 ifelse([$2], , [
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
377 CXXFLAGS="$CXXFLAGS $1"
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
378 AC_MSG_RESULT([adding $1 to CXXFLAGS])], [$2])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
379 else
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
380 AC_MSG_RESULT(no)
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
381 ifelse([$3], , , [$3])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
382 fi
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
383 ])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
384 dnl
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
385 dnl Check to see if Fortran compiler handles FLAG command line option. If
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
386 dnl two arguments are specified, execute the second arg as shell
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
387 dnl commands. Otherwise, add FLAG to FFLAGS if the compiler accepts
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
388 dnl the flag.
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
389 dnl
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
390 dnl OCTAVE_F77_FLAG
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
391 AC_DEFUN(OCTAVE_F77_FLAG, [
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
392 ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'`
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
393 AC_MSG_CHECKING(whether ${F77-g77} accepts $1)
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
394 AC_CACHE_VAL(octave_cv_f77_flag_$ac_safe, [
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
395 AC_LANG_PUSH(Fortran 77)
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
396 XFFLAGS="$FFLAGS"
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
397 FFLAGS="$FFLAGS $1"
5177
86fa011d6404 [project @ 2005-03-03 00:32:34 by jwe]
jwe
parents: 5094
diff changeset
398 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
399 eval "octave_cv_f77_flag_$ac_safe=yes",
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
400 eval "octave_cv_f77_flag_$ac_safe=no")
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
401 FFLAGS="$XFFLAGS"
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
402 AC_LANG_POP(Fortran 77)
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
403 ])
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
404 if eval "test \"`echo '$octave_cv_f77_flag_'$ac_safe`\" = yes"; then
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
405 AC_MSG_RESULT(yes)
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
406 ifelse([$2], , [
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
407 FFLAGS="$FFLAGS $1"
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
408 AC_MSG_RESULT([adding $1 to FFLAGS])], [$2])
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
409 else
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
410 AC_MSG_RESULT(no)
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
411 ifelse([$3], , , [$3])
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
412 fi
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
413 ])
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
414 dnl
3729
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
415 dnl Check for flex
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
416 dnl
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
417 AC_DEFUN(OCTAVE_PROG_FLEX, [
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
418 ### For now, don't define LEXLIB to be -lfl -- we don't use anything in
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
419 ### it, and it might not be installed.
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
420 ###
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
421 ### Also make sure that we generate an interactive scanner if we are
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
422 ### using flex.
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
423 AC_PROG_LEX
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
424 case "$LEX" in
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
425 flex*)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
426 LFLAGS="-t -I"
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
427 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS])
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
428 LEXLIB=
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
429 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
430 *)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
431 LEX='$(top_srcdir)/missing flex'
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
432 warn_flex="I didn't find flex, but it's only a problem if you need to reconstruct lex.cc"
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
433 AC_MSG_WARN($warn_flex)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
434 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
435 esac
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
436 AC_SUBST(LFLAGS)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
437 ])
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
438 dnl
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
439 dnl Check for bison
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
440 dnl
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
441 AC_DEFUN(OCTAVE_PROG_BISON, [
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
442 AC_PROG_YACC
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
443 case "$YACC" in
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
444 bison*)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
445 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
446 *)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
447 YACC='$(top_srcdir)/missing bison'
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
448 warn_bison="I didn't find bison, but it's only a problem if you need to reconstruct parse.cc"
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
449 AC_MSG_WARN($warn_bison)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
450 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
451 esac
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
452 ])
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
453 dnl
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
454 dnl What pager should we use?
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
455 dnl
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
456 AC_DEFUN(OCTAVE_PROG_PAGER,
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
457 [if test "$cross_compiling" = yes; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
458 DEFAULT_PAGER=less
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
459 AC_MSG_RESULT(assuming $DEFAULT_PAGER exists on $canonical_host_type host)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
460 AC_SUBST(DEFAULT_PAGER)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
461 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
462 octave_possible_pagers="less more page pg"
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
463 case "$canonical_host_type" in
6103
a2fdc87184cf [project @ 2006-10-26 21:32:17 by jwe]
jwe
parents: 6061
diff changeset
464 *-*-cygwin* | *-*-mingw32* | *-*-msdosmsvc)
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
465 octave_possible_pagers="$octave_possible_pagers more.com"
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
466 ;;
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
467 esac
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
468
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
469 AC_CHECK_PROGS(DEFAULT_PAGER, $octave_possible_pagers, [])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
470 if test -z "$DEFAULT_PAGER"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
471 warn_less="I couldn't find \`less', \`more', \`page', or \`pg'"
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
472 AC_MSG_WARN($warn_less)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
473 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
474 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
475 ])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
476 dnl
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
477 dnl Does gnuplot exist? Is it a recent version?
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
478 dnl
4098
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
479 AC_DEFUN(OCTAVE_PROG_GNUPLOT, [
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
480 case "$canonical_host_type" in
6103
a2fdc87184cf [project @ 2006-10-26 21:32:17 by jwe]
jwe
parents: 6061
diff changeset
481 *-*-cygwin* | *-*-mingw32* | *-*-msdosmsvc)
4098
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
482 gp_names="pgnuplot pipe-gnuplot gnuplot"
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
483 gp_default=pgnuplot
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
484 ;;
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
485 *)
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
486 gp_names=gnuplot
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
487 gp_default=gnuplot
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
488 ;;
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
489 esac
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
490 GNUPLOT_HAS_FRAMES=1
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
491 if test "$cross_compiling" = yes; then
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
492 AC_MSG_RESULT(assuming $GNUPLOT_BINARY exists on $canonical_host_type host)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
493 AC_MSG_RESULT(assuming $GNUPLOT_BINARY supports multiple frams)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
494 else
4098
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
495 AC_CHECK_PROGS(GNUPLOT_BINARY, $gp_names)
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
496 if test -n "$GNUPLOT_BINARY"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
497 AC_MSG_CHECKING([to see if your gnuplot supports multiplot])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
498 if test -z "`echo 'set term unknown; set multiplot' | \
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
499 $GNUPLOT_BINARY 2>&1`"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
500 AC_MSG_RESULT([yes])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
501 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
502 AC_MSG_RESULT([no])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
503 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
504 AC_MSG_CHECKING([to see if your gnuplot supports multiple plot windows])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
505 if test -z "`echo 'set term x11 2' | $GNUPLOT_BINARY 2>&1`"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
506 AC_MSG_RESULT([yes])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
507 else
4098
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
508 GNUPLOT_HAS_FRAMES=
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
509 AC_MSG_RESULT([no])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
510 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
511 else
5513
843fa0a80229 [project @ 2005-10-27 02:43:36 by jwe]
jwe
parents: 5512
diff changeset
512 warn_gnuplot=yes
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
513
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
514 GNUPLOT_BINARY="$gp_default"
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
515
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
516 ## If you change this text, be sure to also copy it to the set of
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
517 ## warnings at the end of the script
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
518
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
519 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
520 AC_MSG_WARN([installed, but you won't be able to use any of Octave's])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
521 AC_MSG_WARN([plotting commands without it.])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
522 AC_MSG_WARN([])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
523 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
524 AC_MSG_WARN([tell Octave where to find it by typing the command])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
525 AC_MSG_WARN([])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
526 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
527 AC_MSG_WARN([])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
528 AC_MSG_WARN([at the Octave prompt.])
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
529 AC_MSG_WARN([])
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
530 AC_MSG_WARN([Setting default value to $GNUPLOT_BINARY])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
531 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
532 fi
4098
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
533 AC_DEFINE_UNQUOTED(GNUPLOT_BINARY, "$GNUPLOT_BINARY", [Name of gnuplot program.])
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
534 AC_DEFINE_UNQUOTED(GNUPLOT_HAS_FRAMES, $GNUPLOT_HAS_FRAMES, [Define if your gnuplot program supports multiple plot windows.])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
535 ])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
536 dnl
3673
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
537 dnl Is gperf installed?
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
538 dnl
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
539 dnl OCTAVE_PROG_GPERF
3731
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
540 AC_DEFUN(OCTAVE_PROG_GPERF, [
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
541 AC_CHECK_PROG(GPERF, gperf, gperf, [])
3731
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
542 if test -n "$GPERF"; then
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
543 if echo "%{
4416
de2bc66c709f [project @ 2003-05-16 21:36:02 by jwe]
jwe
parents: 4366
diff changeset
544 enum octave_kw_id { a_kw };
3731
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
545 %}
4416
de2bc66c709f [project @ 2003-05-16 21:36:02 by jwe]
jwe
parents: 4366
diff changeset
546 struct octave_kw { const char *name; int tok; octave_kw_id kw_id; };
3731
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
547 %%
5094
1dbe2c93af51 [project @ 2004-12-03 13:40:28 by jwe]
jwe
parents: 5076
diff changeset
548 foo" | $GPERF -t -C -D -E -G -L C++ -H octave_kw_hash -N octave_kw_lookup > /dev/null 2>&1; then
3731
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
549 true
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
550 else
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
551 GPERF=""
5094
1dbe2c93af51 [project @ 2004-12-03 13:40:28 by jwe]
jwe
parents: 5076
diff changeset
552 warn_gperf="I found gperf, but it does not support all of the following options: -t -C -D -E -G -L C++ -H -N; you need gperf 3.0.1 or a more recent version"
3731
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
553 AC_MSG_WARN($warn_gperf)
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
554 fi
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
555 else
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
556 GPERF='$(top_srcdir)/missing gperf'
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
557 warn_gperf="I didn't find gperf, but it's only a problem if you need to reconstruct oct-gperf.h"
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
558 AC_MSG_WARN($warn_gperf)
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
559 fi
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
560 AC_SUBST(GPERF)
3673
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
561 ])
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
562 dnl
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
563 dnl Is ghostscript installed?
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
564 dnl
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
565 dnl OCTAVE_PROG_GHOSTSCRIPT
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
566 AC_DEFUN(OCTAVE_PROG_GHOSTSCRIPT, [
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
567 case "$canonical_host_type" in
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
568 *-*-cygwin* | *-*-mingw32* | *-*-msdosmsvc)
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
569 gs_names="gs gswin32"
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
570 ;;
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
571 *)
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
572 gs_names=gs
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
573 ;;
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
574 esac
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
575 AC_CHECK_PROGS(GHOSTSCRIPT, $gs_names)
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
576 if test -z "$GHOSTSCRIPT"; then
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
577 GHOSTSCRIPT='$(top_srcdir)/missing gs'
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
578 warn_ghostscript="I didn't find ghostscript, but it's only a problem if you need to reconstruct figures for the manual"
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
579 AC_MSG_WARN($warn_ghostscript)
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
580 fi
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
581 AC_SUBST(GHOSTSCRIPT)
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
582 ])
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
583 dnl
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
584 dnl Is makeinfo installed?
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
585 dnl
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
586 dnl OCTAVE_PROG_MAKEINFO
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
587 AC_DEFUN(OCTAVE_PROG_MAKEINFO, [
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
588 AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, [])
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
589 if test -z "$MAKEINFO"; then
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
590 MAKEINFO='$(top_srcdir)/missing makeinfo'
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
591 warn_makeinfo="I didn't find makeinfo, but it's only a problem if you need to reconstruct the Info version of the manual"
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
592 AC_MSG_WARN($warn_makeinfo)
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
593 fi
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
594 AC_SUBST(MAKEINFO)
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
595 ])
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
596 dnl
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
597 dnl Is texi2dvi installed?
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
598 dnl
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
599 dnl OCTAVE_PROG_TEXI2DVI
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
600 AC_DEFUN(OCTAVE_PROG_TEXI2DVI, [
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
601 AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, [])
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
602 if test -z "$TEXI2DVI"; then
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
603 TEXI2DVI='$(top_srcdir)/missing texi2dvi'
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
604 warn_texi2dvi="I didn't find texi2dvi, but it's only a problem if you need to reconstruct the DVI version of the manual"
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
605 AC_MSG_WARN($warn_texi2dvi)
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
606 fi
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
607 AC_SUBST(TEXI2DVI)
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
608 ])
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
609 dnl
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
610 dnl Is texi2pdf installed?
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
611 dnl
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
612 dnl OCTAVE_PROG_TEXI2PDF
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
613 AC_DEFUN(OCTAVE_PROG_TEXI2PDF, [
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
614 AC_REQUIRE([OCTAVE_PROG_TEXI2DVI])
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
615 AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, [])
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
616 if test -z "$TEXI2PDF"; then
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
617 missing=true;
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
618 if test -n "$TEXI2DVI"; then
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
619 TEXI2PDF="$TEXI2DVI --pdf"
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
620 missing=false;
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
621 fi
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
622 else
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
623 missing=false;
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
624 fi
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
625 if $missing; then
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
626 TEXI2PDF='$(top_srcdir)/missing texi2pdf'
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
627 warn_texi2pdf="I didn't find texi2pdf, but it's only a problem if you need to reconstruct the PDF version of the manual"
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
628 AC_MSG_WARN($warn_texi2pdf)
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
629 fi
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
630 AC_SUBST(TEXI2PDF)
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
631 ])
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
632 dnl
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
633 dnl Find nm.
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
634 dnl
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
635 dnl OCTAVE_PROG_NM
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
636 AC_DEFUN(OCTAVE_PROG_NM,
4093
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 4084
diff changeset
637 [AC_CHECK_PROG(NM, ${ac_tool_prefix}nm, ${ac_tool_prefix}nm, [])
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
638 AC_SUBST(NM)
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
639 ])
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
640 dnl
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
641 dnl See if the C++ compiler prepends an underscore to external names.
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
642 dnl
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
643 dnl OCTAVE_CXX_PREPENDS_UNDERSCORE
4093
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 4084
diff changeset
644 AC_DEFUN(OCTAVE_CXX_PREPENDS_UNDERSCORE, [
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 4084
diff changeset
645 AC_REQUIRE([OCTAVE_PROG_NM])
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 4084
diff changeset
646 AC_MSG_CHECKING([whether ${CXX-g++} prepends an underscore to external names])
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
647 AC_CACHE_VAL(octave_cv_cxx_prepends_underscore,
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
648 [octave_cv_cxx_prepends_underscore=no
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
649 AC_LANG_PUSH(C++)
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
650 cat > conftest.$ac_ext <<EOF
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
651 bool FSmy_dld_fcn (void) { return false; }
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
652 EOF
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
653 if AC_TRY_EVAL(ac_compile); then
6057
0cc5f8afba3f [project @ 2006-10-18 02:02:36 by jwe]
jwe
parents: 5934
diff changeset
654 if test "`${NM-nm} conftest.$ac_objext | grep _FSmy_dld_fcn`" != ""; then
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
655 octave_cv_cxx_prepends_underscore=yes
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
656 fi
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
657 else
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
658 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
659 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
660 fi
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
661 AC_LANG_POP(C++)
5775
ace8d8d26933 [project @ 2006-04-24 19:13:06 by jwe]
jwe
parents: 5590
diff changeset
662 ### FIXME -- Ignore test result on Windows. Yes it prepends
4105
92f4552ea359 [project @ 2002-10-16 14:55:38 by jwe]
jwe
parents: 4102
diff changeset
663 ### underscore, but LoadLibrary ignores it automatically. The
4102
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4098
diff changeset
664 ### correct test is to build the shared library then try to grab the
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4098
diff changeset
665 ### symbol from it with and without underscore.
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4098
diff changeset
666 case "$canonical_host_type" in
4105
92f4552ea359 [project @ 2002-10-16 14:55:38 by jwe]
jwe
parents: 4102
diff changeset
667 *-*-cygwin* | *-*-mingw*)
4102
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4098
diff changeset
668 octave_cv_cxx_prepends_underscore=no
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4098
diff changeset
669 ;;
5775
ace8d8d26933 [project @ 2006-04-24 19:13:06 by jwe]
jwe
parents: 5590
diff changeset
670 ### FIXME -- Ignore test result on OS X. Yes it prepends
4162
bcdf1c264e08 [project @ 2002-11-10 00:34:37 by jwe]
jwe
parents: 4125
diff changeset
671 ### underscore, but also messes with the name so test fails (incorrectly).
4685
14a1c9f42f67 [project @ 2004-01-06 17:20:02 by jwe]
jwe
parents: 4423
diff changeset
672 *-*-darwin*)
4162
bcdf1c264e08 [project @ 2002-11-10 00:34:37 by jwe]
jwe
parents: 4125
diff changeset
673 octave_cv_cxx_prepends_underscore=yes
bcdf1c264e08 [project @ 2002-11-10 00:34:37 by jwe]
jwe
parents: 4125
diff changeset
674 ;;
4102
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4098
diff changeset
675 esac
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
676 ])
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
677 AC_MSG_RESULT($octave_cv_cxx_prepends_underscore)
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
678 if test $octave_cv_cxx_prepends_underscore = yes; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
679 AC_DEFINE(CXX_PREPENDS_UNDERSCORE, 1, [Define if your compiler prepends underscores to external names.])
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
680 fi
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
681 ])
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
682 dnl
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
683 dnl See if the C++ library is ISO compliant.
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
684 dnl FIXME: This is obviously very simplistic, and trivially fooled.
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
685 dnl
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
686 dnl OCTAVE_CXX_ISO_COMPLIANT_LIBRARY
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
687 AC_DEFUN(OCTAVE_CXX_ISO_COMPLIANT_LIBRARY, [
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
688 AC_REQUIRE([AC_PROG_CXX])
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
689 AC_MSG_CHECKING([if C++ library is ISO compliant])
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
690 AC_CACHE_VAL(octave_cv_cxx_iso_compliant_library, [
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
691 AC_LANG_PUSH(C++)
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
692 rm -f conftest.h
3943
a10df4059532 [project @ 2002-05-16 22:31:35 by jwe]
jwe
parents: 3908
diff changeset
693 ### Omitting cwctype for now, since it is broken with gcc-3.0.x and
a10df4059532 [project @ 2002-05-16 22:31:35 by jwe]
jwe
parents: 3908
diff changeset
694 ### possibly other versions...
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
695 for inc in algorithm bitset cassert cctype cerrno cfloat ciso646 \
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
696 climits clocale cmath complex csetjmp csignal cstdarg cstddef \
3943
a10df4059532 [project @ 2002-05-16 22:31:35 by jwe]
jwe
parents: 3908
diff changeset
697 cstdio cstdlib cstring ctime cwchar deque exception \
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
698 fstream functional iomanip ios iosfwd iostream istream iterator \
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
699 limits list locale map memory new numeric ostream queue set \
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
700 sstream stack stdexcept streambuf string strstream typeinfo \
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
701 utility valarray vector; do
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
702 echo "#include <$inc>" >> conftest.h
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
703 done
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
704 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "conftest.h"]],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
705 [[std::bitset<50> flags;
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
706 flags.set();
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
707 int digits = std::numeric_limits<unsigned long>::digits;
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
708 digits = 0;]])],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
709 [octave_cv_cxx_iso_compliant_library=yes],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
710 [octave_cv_cxx_iso_compliant_library=no])
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
711 AC_LANG_POP(C++)
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
712 ])
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
713 AC_MSG_RESULT($octave_cv_cxx_iso_compliant_library)
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
714 if test $octave_cv_cxx_iso_compliant_library = yes; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
715 AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY, 1, [Define if your C++ runtime library is ISO compliant.])
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
716 fi
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
717 ])
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
718 dnl
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
719 dnl Allow the user disable support for command line editing using GNU
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
720 dnl readline.
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
721 dnl
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
722 dnl OCTAVE_ENABLE_READLINE
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
723 AC_DEFUN(OCTAVE_ENABLE_READLINE, [
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
724 USE_READLINE=true
4102
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4098
diff changeset
725 LIBREADLINE=
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
726 AC_ARG_ENABLE(readline,
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
727 [ --enable-readline use readline library (default is yes)],
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
728 [if test "$enableval" = no; then
3824
0ee55719541a [project @ 2001-04-26 17:07:21 by jwe]
jwe
parents: 3822
diff changeset
729 USE_READLINE=false
3825
74255bd05bdd [project @ 2001-04-26 19:50:03 by jwe]
jwe
parents: 3824
diff changeset
730 warn_readline="command editing and history features require GNU Readline"
3824
0ee55719541a [project @ 2001-04-26 17:07:21 by jwe]
jwe
parents: 3822
diff changeset
731 fi])
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
732 if $USE_READLINE; then
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
733 AC_CHECK_LIB(readline, rl_set_keyboard_input_timeout, [
4102
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4098
diff changeset
734 LIBREADLINE="-lreadline"
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4098
diff changeset
735 LIBS="$LIBREADLINE $LIBS"
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
736 AC_DEFINE(USE_READLINE, 1, [Define to use the readline library.])
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
737 ], [
3824
0ee55719541a [project @ 2001-04-26 17:07:21 by jwe]
jwe
parents: 3822
diff changeset
738 AC_MSG_WARN([I need GNU Readline 4.2 or later])
0ee55719541a [project @ 2001-04-26 17:07:21 by jwe]
jwe
parents: 3822
diff changeset
739 AC_MSG_ERROR([this is fatal unless you specify --disable-readline])
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
740 ])
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
741 fi
4102
cbac6756967e [project @ 2002-10-14 20:16:44 by jwe]
jwe
parents: 4098
diff changeset
742 AC_SUBST(LIBREADLINE)
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
743 ])
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
744 dnl
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
745 dnl Determine the C++ compiler ABI. It sets the macro CXX_ABI to the
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
746 dnl name of the ABI, and is used to mangle the C linkage loadable
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
747 dnl functions to avoid ABI mismatch. GNU C++ currently uses gnu_v2
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
748 dnl (GCC versions <= 2.95.x) dnl or gnu_v3 (GCC versions >= 3.0).
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
749 dnl Set to "unknown" is when we don't know enough about the ABI, which
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
750 dnl will happen when using an unsupported C++ compiler.
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
751 dnl
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
752 dnl OCTAVE_CXX_ABI
4093
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 4084
diff changeset
753 AC_DEFUN(OCTAVE_CXX_ABI, [
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 4084
diff changeset
754 AC_REQUIRE([OCTAVE_PROG_NM])
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 4084
diff changeset
755 AC_MSG_CHECKING([C++ ABI version used by ${CXX}])
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
756 AC_CACHE_VAL(octave_cv_cxx_abi,
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
757 [octave_cv_cxx_abi='unknown'
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
758 AC_LANG_PUSH(C++)
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
759 cat > conftest.$ac_ext <<EOF
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
760 bool FSmy_dld_fcn (void) { return false; }
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
761 EOF
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
762 if AC_TRY_EVAL(ac_compile); then
6057
0cc5f8afba3f [project @ 2006-10-18 02:02:36 by jwe]
jwe
parents: 5934
diff changeset
763 if test "`${NM-nm} conftest.$ac_objext | grep FSmy_dld_fcn__Fv`" != ""; then
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
764 octave_cv_cxx_abi='gnu_v2'
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
765 fi
6057
0cc5f8afba3f [project @ 2006-10-18 02:02:36 by jwe]
jwe
parents: 5934
diff changeset
766 if test "`${NM-nm} conftest.$ac_objext | grep _Z12FSmy_dld_fcnv`" != ""; then
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
767 octave_cv_cxx_abi='gnu_v3'
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
768 fi
6057
0cc5f8afba3f [project @ 2006-10-18 02:02:36 by jwe]
jwe
parents: 5934
diff changeset
769 if test "`${NM-nm} conftest.$ac_objext | grep __1cMFSmy_dld_fcn6F_b_`" != ""; then
3843
f848bc60b927 [project @ 2001-06-29 21:10:21 by jwe]
jwe
parents: 3842
diff changeset
770 octave_cv_cxx_abi='sun_v5'
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
771 fi
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
772 else
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
773 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
774 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
775 fi
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
776 AC_LANG_POP(C++)
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
777 ])
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
778 AC_MSG_RESULT($octave_cv_cxx_abi)
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
779 AC_DEFINE_UNQUOTED(CXX_ABI, $octave_cv_cxx_abi, [Define to the C++ ABI your compiler uses.])
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
780 ])
4067
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
781 dnl
5854
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
782 dnl Check to see if C++ reintrepret cast works for function pointers.
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
783 dnl
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
784 dnl OCTAVE_CXX_BROKEN_REINTERPRET_CAST
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
785 dnl
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
786 AC_DEFUN(OCTAVE_CXX_BROKEN_REINTERPRET_CAST, [
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
787 AC_REQUIRE([AC_PROG_CXX])
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
788 AC_LANG_PUSH(C++)
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
789 AC_CACHE_CHECK([for broken C++ reinterpret_cast],
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
790 octave_cv_cxx_broken_reinterpret_cast, [
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
791 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cmath>]], [[
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
792 typedef double (*fptr) (double);
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
793 fptr psin = sin;
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
794 void *vptr = reinterpret_cast<void *> (psin);
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
795 psin = reinterpret_cast<fptr> (vptr);]])],
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
796 octave_cv_cxx_broken_reinterpret_cast=no,
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
797 octave_cv_cxx_broken_reinterpret_cast=yes)])
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
798 if test $octave_cv_cxx_broken_reinterpret_cast = yes ; then
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
799 AC_DEFINE(CXX_BROKEN_REINTERPRET_CAST, 1, [Define if C++ reinterpret_cast fails for function pointers.])
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
800 fi
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
801 AC_LANG_POP(C++)])
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
802 dnl
4067
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
803 dnl Determine if mkdir accepts only one argument instead dnl of the usual 2.
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
804 dnl
6104
a334206512b9 [project @ 2006-10-26 21:41:39 by jwe]
jwe
parents: 6103
diff changeset
805 AC_DEFUN(OCTAVE_MKDIR_TAKES_ONE_ARG, [
a334206512b9 [project @ 2006-10-26 21:41:39 by jwe]
jwe
parents: 6103
diff changeset
806 AC_LANG_PUSH(C++)
a334206512b9 [project @ 2006-10-26 21:41:39 by jwe]
jwe
parents: 6103
diff changeset
807 AC_CACHE_CHECK([if mkdir takes one argument], octave_cv_mkdir_takes_one_arg,
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
808 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
4067
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
809 #ifdef HAVE_SYS_STAT_H
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
810 # include <sys/stat.h>
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
811 #endif
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
812 #ifdef HAVE_UNISTD_H
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
813 # include <unistd.h>
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
814 #endif
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
815 #ifdef HAVE_DIRECT_H
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
816 # include <direct.h>
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
817 #endif]], [[mkdir ("foo", 0);]])],
4067
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
818 octave_cv_mkdir_takes_one_arg=no, octave_cv_mkdir_takes_one_arg=yes)])
6104
a334206512b9 [project @ 2006-10-26 21:41:39 by jwe]
jwe
parents: 6103
diff changeset
819 AC_LANG_POP(C++)
4067
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
820 if test $octave_cv_mkdir_takes_one_arg = yes ; then
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
821 AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single argument.])
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
822 fi
e97fb79fc1d5 [project @ 2002-09-26 22:43:25 by jwe]
jwe
parents: 3971
diff changeset
823 ])
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
824 # OCTAVE_PROG_SED
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
825 # --------------
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
826 # Check for a fully-functional sed program, that truncates
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
827 # as few characters as possible. Prefer GNU sed if found.
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
828 AC_DEFUN([OCTAVE_PROG_SED],
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
829 [AC_MSG_CHECKING([for a sed that does not truncate output])
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
830 if test -z "$SED"; then
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
831 AC_CACHE_VAL(ac_cv_path_sed,
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
832 [# Loop through the user's path and test for sed and gsed.
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
833 # Then use that list of sed's as ones to test for truncation.
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
834 _AS_PATH_WALK([$PATH],
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
835 [for ac_prog in sed gsed; do
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
836 for ac_exec_ext in '' $ac_executable_extensions; do
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
837 if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
838 _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
839 fi
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
840 done
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
841 done
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
842 ])
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
843 AS_TMPDIR(sed)
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
844 _max=0
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
845 _count=0
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
846 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
847 # along with /bin/sed that truncates output.
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
848 for _sed in $_sed_list /usr/xpg4/bin/sed; do
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
849 test ! -f ${_sed} && break
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
850 cat /dev/null > "$tmp/sed.in"
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
851 _count=0
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
852 echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in"
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
853 # Check for GNU sed and select it if it is found.
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
854 if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null;
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
855 then
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
856 octave_cv_path_sed=${_sed}
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
857 break;
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
858 fi
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
859 while true; do
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
860 cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
861 mv "$tmp/sed.tmp" "$tmp/sed.in"
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
862 cp "$tmp/sed.in" "$tmp/sed.nl"
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
863 echo >>"$tmp/sed.nl"
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
864 ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
865 cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
866 # 10000 chars as input seems more than enough
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
867 test $_count -gt 10 && break
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
868 _count=`expr $_count + 1`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
869 if test $_count -gt $_max; then
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
870 _max=$_count
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
871 octave_cv_path_sed=$_sed
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
872 fi
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
873 done
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
874 done
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
875 rm -rf "$tmp"
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
876 ])
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
877 fi
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
878 AC_SUBST([SED], $octave_cv_path_sed)
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
879 AC_MSG_RESULT([$SED])
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
880 ])
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents: 5307
diff changeset
881 dnl
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents: 5307
diff changeset
882 dnl Find Perl.
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents: 5307
diff changeset
883 dnl
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents: 5307
diff changeset
884 dnl OCTAVE_PROG_PERL
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents: 5307
diff changeset
885 AC_DEFUN(OCTAVE_PROG_PERL,
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
886 [AC_CHECK_PROG(PERL, perl, perl, [])
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents: 5307
diff changeset
887 AC_SUBST(PERL)
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents: 5307
diff changeset
888 ])
5468
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
889 dnl
5495
71c9d4a6a843 [project @ 2005-10-14 07:29:26 by jwe]
jwe
parents: 5468
diff changeset
890 dnl Find Python.
71c9d4a6a843 [project @ 2005-10-14 07:29:26 by jwe]
jwe
parents: 5468
diff changeset
891 dnl
71c9d4a6a843 [project @ 2005-10-14 07:29:26 by jwe]
jwe
parents: 5468
diff changeset
892 dnl OCTAVE_PROG_PYTHON
71c9d4a6a843 [project @ 2005-10-14 07:29:26 by jwe]
jwe
parents: 5468
diff changeset
893 AC_DEFUN(OCTAVE_PROG_PYTHON,
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
894 [AC_CHECK_PROG(PYTHON, python, python, [])
5495
71c9d4a6a843 [project @ 2005-10-14 07:29:26 by jwe]
jwe
parents: 5468
diff changeset
895 AC_SUBST(PYTHON)
71c9d4a6a843 [project @ 2005-10-14 07:29:26 by jwe]
jwe
parents: 5468
diff changeset
896 ])
71c9d4a6a843 [project @ 2005-10-14 07:29:26 by jwe]
jwe
parents: 5468
diff changeset
897 dnl
5468
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
898 dnl Find desktop-file-install.
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
899 dnl
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
900 dnl OCTAVE_PROG_DESKTOP_FILE_INSTALL
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
901 AC_DEFUN(OCTAVE_PROG_DESKTOP_FILE_INSTALL,
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
902 [AC_CHECK_PROG(DESKTOP_FILE_INSTALL, desktop-file-install, desktop-file-install, [])
5468
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
903 AC_SUBST(DESKTOP_FILE_INSTALL)
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
904 ])
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
905 dnl
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
906 dnl Check for IEEE 754 data format.
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
907 dnl
4853
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
908 AC_DEFUN([OCTAVE_IEEE754_DATA_FORMAT],
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
909 [AC_MSG_CHECKING([for IEEE 754 data format])
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
910 AC_CACHE_VAL(octave_cv_ieee754_data_format,
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
911 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
4853
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
912 int
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
913 main (void)
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
914 {
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
915 typedef union { unsigned char c[8]; double d; } ieeebytes;
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
916
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
917 ieeebytes l = {0x1c, 0xbc, 0x6e, 0xf2, 0x54, 0x8b, 0x11, 0x43};
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
918 ieeebytes b = {0x43, 0x11, 0x8b, 0x54, 0xf2, 0x6e, 0xbc, 0x1c};
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
919
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
920 return l.d != 1234567891234567.0 && b.d != 1234567891234567.0;
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
921 }]])],
4853
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
922 octave_cv_ieee754_data_format=yes,
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
923 octave_cv_ieee754_data_format=no,
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
924 octave_cv_ieee754_data_format=no)])
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
925 if test "$cross_compiling" = yes; then
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
926 AC_MSG_RESULT([$octave_cv_ieee754_data_format assumed for cross compilation])
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
927 else
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
928 AC_MSG_RESULT($octave_cv_ieee754_data_format)
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
929 fi
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
930 if test "$octave_cv_ieee754_data_format" = yes; then
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
931 AC_DEFINE(HAVE_IEEE754_DATA_FORMAT, 1, [Define if your system uses IEEE 754 data format.])
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
932 fi
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
933 ])
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
934 dnl
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
935 dnl Check for UMFPACK seperately split complex matrix and RHS. Note
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
936 dnl that as umfpack.h can be in three different places, rather than
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
937 dnl include it, just declare the functions needed.
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
938 dnl
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
939 dnl Assumes that the check for umfpack has already been performed.
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
940 dnl
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
941 AC_DEFUN([OCTAVE_UMFPACK_SEPERATE_SPLIT],
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
942 [AC_MSG_CHECKING([for UMFPACK seperate complex matrix and rhs split])
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
943 AC_CACHE_VAL(octave_cv_umfpack_seperate_split,
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
944 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
945 #include <stdlib.h>
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
946 #if defined (HAVE_UFSPARSE_UMFPACK_h)
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
947 #include <ufsparse/umfpack.h>
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
948 #elif defined (HAVE_UMFPACK_UMFPACK_H)
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
949 #include <umfpack/umfpack.h>
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
950 #elif defined (HAVE_UMFPACK_H)
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
951 #include <umfpack.h>
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
952 #endif
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
953 int n = 5;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
954 int Ap[] = {0, 2, 5, 9, 10, 12};
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
955 int Ai[] = {0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4};
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
956 double Ax[] = {2., 0., 3., 0., 3., 0., -1., 0., 4., 0., 4., 0.,
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
957 -3., 0., 1., 0., 2., 0., 2., 0., 6., 0., 1., 0.};
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
958 double br[] = {8., 45., -3., 3., 19.};
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
959 double bi[] = {0., 0., 0., 0., 0.};
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
960 int main (void)
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
961 {
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
962 double *null = (double *) NULL ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
963 double *x = (double *)malloc (2 * n * sizeof(double));
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
964 int i ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
965 void *Symbolic, *Numeric ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
966 (void) umfpack_zi_symbolic (n, n, Ap, Ai, Ax, null, &Symbolic, null, null) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
967 (void) umfpack_zi_numeric (Ap, Ai, Ax, null, Symbolic, &Numeric, null, null) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
968 umfpack_zi_free_symbolic (&Symbolic) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
969 (void) umfpack_zi_solve (0, Ap, Ai, Ax, null, x, null, br, bi,
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
970 Numeric, null, null) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
971 umfpack_zi_free_numeric (&Numeric) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
972 for (i = 0; i < n; i++, x+=2)
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
973 if (fabs(*x - i - 1.) > 1.e-13)
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
974 return (1);
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
975 return (0) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
976 }
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
977 ]])],
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
978 octave_cv_umfpack_seperate_split=yes,
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
979 octave_cv_umfpack_seperate_split=no,
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
980 octave_cv_umfpack_seperate_split=no)])
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
981 if test "$cross_compiling" = yes; then
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
982 AC_MSG_RESULT([$octave_cv_umfpack_seperate_split assumed for cross compilation])
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
983 else
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
984 AC_MSG_RESULT($octave_cv_umfpack_seperate_split)
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
985 fi
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
986 if test "$octave_cv_umfpack_seperate_split" = yes; then
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
987 AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1, [Define if the UMFPACK Complex solver allow matrix and RHS to be split independently])
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
988 fi
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
989 ])
6276
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
990 dnl
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
991 dnl Check whether using HDF5 DLL under Windows. This is done by
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
992 dnl testing for a data symbol in the HDF5 library, which would
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
993 dnl requires the definition of _HDF5USEDL_ under MSVC compiler.
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
994 dnl
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
995 AC_DEFUN([OCTAVE_HDF5_DLL], [
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
996 AC_CACHE_CHECK([if _HDF5USEDLL_ needs to be defined],octave_cv_hdf5_dll, [
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
997 AC_TRY_LINK([#include <hdf5.h>], [hid_t x = H5T_NATIVE_DOUBLE;],
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
998 octave_cv_hdf5_dll=no, [
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
999 CFLAGS_old=$CFLAGS
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1000 CFLAGS="$CFLAGS -DWIN32 -D_HDF5USEDLL_"
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1001 AC_TRY_LINK([#include <hdf5.h>], [hid_t x = H5T_NATIVE_DOUBLE;],
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1002 octave_cv_hdf5_dll=yes,
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1003 octave_cv_hdf5_dll=no)
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1004 CFLAGS=$CFLAGS_old])])
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1005 if test "$octave_cv_hdf5_dll" = yes; then
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1006 AC_DEFINE(_HDF5USEDLL_, 1, [Define if using HDF5 dll (Win32)])
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1007 fi])