annotate aclocal.m4 @ 3888:70ebd3d672a1

[project @ 2002-04-04 01:05:53 by jwe]
author jwe
date Thu, 04 Apr 2002 01:05:53 +0000
parents 7da18459c08b
children 56db014d8980
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
2548
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
19 dnl Software Foundation, 59 Temple Place - Suite 330, Boston, MA
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
20 dnl 02111-1307, USA.
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
2548
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
75 dnl See if struct group has a gr_passwd field.
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
76 dnl
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
77 AC_DEFUN(OCTAVE_STRUCT_GR_PASSWD,
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
78 [AC_CACHE_CHECK([for gr_passwd in struct group], octave_cv_struct_gr_passwd,
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
79 [AC_TRY_COMPILE([#include <sys/types.h>
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
80 #include <grp.h>], [struct group s; s.gr_passwd;],
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
81 octave_cv_struct_gr_passwd=yes, octave_cv_struct_gr_passwd=no)])
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
82 if test $octave_cv_struct_gr_passwd = yes; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
83 AC_DEFINE(HAVE_GR_PASSWD,1,[Define if your system's struct group has a gr_passwd field.])
2548
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
84 fi
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
85 ])
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
86 dnl
2574
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
87 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
88 dnl
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
89 AC_DEFUN(OCTAVE_STRING_NPOS,
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
90 [AC_CACHE_CHECK([whether including <string> defines NPOS],
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
91 octave_cv_string_npos,
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
92 [AC_LANG_PUSH(C++)
2574
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
93 AC_TRY_COMPILE([#include <string>],
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
94 [size_t foo = NPOS],
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
95 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
96 if test $octave_cv_string_npos = no; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
97 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
98 fi
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
99 AC_LANG_POP(C++)
2574
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
100 ])
cfa9f35fd407 [project @ 1996-12-09 17:30:39 by jwe]
jwe
parents: 2548
diff changeset
101 dnl
1707
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
102 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
103 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
104 dnl kpathsea optional.
1708
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
105 dnl
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
106 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
107 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
108 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
109 dnl doesn't hurt.
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
110 AC_DEFUN(OCTAVE_SMART_PUTENV,
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
111 [AC_MSG_CHECKING(whether putenv uses malloc)
1707
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
112 AC_CACHE_VAL(octave_cv_func_putenv_malloc,
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
113 [AC_TRY_RUN([
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
114 #define VAR "YOW_VAR"
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
115 #define STRING1 "GabbaGabbaHey"
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
116 #define STRING2 "Yow!!" /* should be shorter than STRING1 */
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
117 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
118 main ()
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
119 {
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
120 char *str1, *rstr1, *str2, *rstr2;
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
121 str1 = getenv (VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
122 if (str1)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
123 exit (1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
124 str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
125 if (str1 == 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
126 exit (2);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
127 strcpy (str1, VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
128 strcat (str1, "=");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
129 strcat (str1, STRING1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
130 if (putenv (str1) < 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
131 exit (3);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
132 rstr1 = getenv (VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
133 if (rstr1 == 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
134 exit (4);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
135 rstr1 -= strlen (VAR) + 1;
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
136 if (strncmp (rstr1, VAR, strlen (VAR)))
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
137 exit (5);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
138 str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
139 if (str2 == 0 || str1 == str2)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
140 exit (6);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
141 strcpy (str2, VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
142 strcat (str2, "=");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
143 strcat (str2, STRING2);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
144 if (putenv (str2) < 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
145 exit (7);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
146 rstr2 = getenv (VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
147 if (rstr2 == 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
148 exit (8);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
149 rstr2 -= strlen (VAR) + 1;
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
150 #if 0
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
151 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
152 /*
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
153 * 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
154 * 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
155 */
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
156 if (rstr1 == rstr2)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
157 printf ("#define SMART_PUTENV\n");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
158 else
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
159 printf ("#undef SMART_PUTENV\n");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
160 #endif
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
161 exit (rstr1 == rstr2 ? 0 : 1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
162 }], octave_cv_func_putenv_malloc=yes, octave_cv_func_putenv_malloc=no,
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
163 octave_cv_func_putenv_malloc=no)])dnl
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
164 AC_MSG_RESULT($octave_cv_func_putenv_malloc)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
165 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
166 AC_DEFINE(SMART_PUTENV,1,[To quiet autoheader.])
1708
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
167 fi])
1788
b7de2fd2be6b [project @ 1996-01-24 20:47:58 by jwe]
jwe
parents: 1708
diff changeset
168 dnl
2469
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
169 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
170 dnl aclocal.m4 file distributed with bash 2.0.
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
171 dnl
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
172 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
173 AC_DEFUN(OCTAVE_SIGNAL_CHECK,
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
174 [AC_REQUIRE([AC_TYPE_SIGNAL])
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
175 AC_MSG_CHECKING(for type of signal functions)
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
176 AC_CACHE_VAL(octave_cv_signal_vintage,
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
177 [
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
178 AC_TRY_LINK([#include <signal.h>],[
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
179 sigset_t ss;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
180 struct sigaction sa;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
181 sigemptyset(&ss); sigsuspend(&ss);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
182 sigaction(SIGINT, &sa, (struct sigaction *) 0);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
183 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
184 ], octave_cv_signal_vintage=posix,
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
185 [
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
186 AC_TRY_LINK([#include <signal.h>], [
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
187 int mask = sigmask(SIGINT);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
188 sigsetmask(mask); sigblock(mask); sigpause(mask);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
189 ], octave_cv_signal_vintage=4.2bsd,
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
190 [
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
191 AC_TRY_LINK([
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
192 #include <signal.h>
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
193 RETSIGTYPE foo() { }], [
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
194 int mask = sigmask(SIGINT);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
195 sigset(SIGINT, foo); sigrelse(SIGINT);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
196 sighold(SIGINT); sigpause(SIGINT);
2491
d47834a272c2 [project @ 1996-11-08 22:44:29 by jwe]
jwe
parents: 2469
diff changeset
197 ], octave_cv_signal_vintage=svr3, octave_cv_signal_vintage=v7
2469
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
198 )]
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
199 )]
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
200 )
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
201 ])
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
202 AC_MSG_RESULT($octave_cv_signal_vintage)
2491
d47834a272c2 [project @ 1996-11-08 22:44:29 by jwe]
jwe
parents: 2469
diff changeset
203 if test "$octave_cv_signal_vintage" = posix; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
204 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
205 elif test "$octave_cv_signal_vintage" = "4.2bsd"; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
206 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
207 elif test "$octave_cv_signal_vintage" = svr3; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
208 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
209 fi
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
210 ])
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
211 dnl
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
212 AC_DEFUN(OCTAVE_REINSTALL_SIGHANDLERS,
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
213 [AC_REQUIRE([AC_TYPE_SIGNAL])
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
214 AC_REQUIRE([OCTAVE_SIGNAL_CHECK])
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
215 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
216 AC_CACHE_VAL(octave_cv_must_reinstall_sighandlers,
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
217 [AC_TRY_RUN([
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
218 #include <signal.h>
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
219 #ifdef HAVE_UNISTD_H
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
220 #include <unistd.h>
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
221 #endif
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
222 typedef RETSIGTYPE sigfunc();
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
223 int nsigint;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
224 #ifdef HAVE_POSIX_SIGNALS
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
225 sigfunc *
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
226 set_signal_handler(sig, handler)
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
227 int sig;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
228 sigfunc *handler;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
229 {
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
230 struct sigaction act, oact;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
231 act.sa_handler = handler;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
232 act.sa_flags = 0;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
233 sigemptyset (&act.sa_mask);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
234 sigemptyset (&oact.sa_mask);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
235 sigaction (sig, &act, &oact);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
236 return (oact.sa_handler);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
237 }
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
238 #else
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
239 #define set_signal_handler(s, h) signal(s, h)
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
240 #endif
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
241 RETSIGTYPE
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
242 sigint(s)
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
243 int s;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
244 {
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
245 nsigint++;
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 main()
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
248 {
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
249 nsigint = 0;
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
250 set_signal_handler(SIGINT, sigint);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
251 kill((int)getpid(), SIGINT);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
252 kill((int)getpid(), SIGINT);
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
253 exit(nsigint != 2);
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 ], octave_cv_must_reinstall_sighandlers=no, octave_cv_must_reinstall_sighandlers=yes,
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
256 if test "$octave_cv_signal_vintage" = svr3; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
257 octave_cv_must_reinstall_sighandlers=yes
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
258 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
259 octave_cv_must_reinstall_sighandlers=no
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
260 fi)])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
261 if test "$cross_compiling" = yes; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
262 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
263 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
264 AC_MSG_RESULT($octave_cv_must_reinstall_sighandlers)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
265 fi
2491
d47834a272c2 [project @ 1996-11-08 22:44:29 by jwe]
jwe
parents: 2469
diff changeset
266 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
267 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
268 fi
f201716926bb [project @ 1996-11-05 19:39:33 by jwe]
jwe
parents: 2351
diff changeset
269 ])
2626
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
270 dnl
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
271 dnl This check originally from bash 2.0.
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
272 dnl
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
273 dnl Check for typedef'd symbols in header files, but allow the caller to
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
274 dnl specify the include files to be checked in addition to the default.
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
275 dnl
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
276 dnl OCTAVE_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND])
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
277 AC_DEFUN(OCTAVE_CHECK_TYPE,
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
278 [AC_REQUIRE([AC_HEADER_STDC])dnl
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
279 AC_MSG_CHECKING(for $1)
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
280 AC_CACHE_VAL(octave_cv_type_$1,
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
281 [AC_EGREP_CPP($1, [#include <sys/types.h>
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
282 #if STDC_HEADERS
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
283 #include <stdlib.h>
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
284 #endif
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
285 $2
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
286 ], octave_cv_type_$1=yes, octave_cv_type_$1=no)])
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
287 AC_MSG_RESULT($octave_cv_type_$1)
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
288 ifelse($#, 4, [if test $octave_cv_type_$1 = yes; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
289 AC_DEFINE($4, 1, [Define if you have typedef $1.])
2626
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
290 fi])
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
291 if test $octave_cv_type_$1 = no; then
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
292 AC_DEFINE($1, $3, [Define to typedef for $1.])
2626
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
293 fi
b35a5cd8107f [project @ 1997-01-27 01:41:30 by jwe]
jwe
parents: 2621
diff changeset
294 ])
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
295 dnl
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
296 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
297 dnl syntax.
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
298 dnl
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
299 dnl OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
300 AC_DEFUN(OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL, [
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
301 AC_REQUIRE([AC_PROG_CXX])
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
302 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
303 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
304 AC_LANG_PUSH(C++)
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
305 rm -f conftest.h
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
306 cat > conftest.h <<EOB
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
307 struct A {
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
308 friend int operator== (const A&, const A&);
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
309 A (int) { }
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
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
312 template <class T> int
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
313 operator== (const T&, const T&)
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
314 {
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
315 return 0;
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
316 }
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
317 EOB
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
318 AC_TRY_LINK([#include "conftest.h"], [
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
319 A a (1);
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
320 return a == A(1);
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
321 ],
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
322 octave_cv_cxx_new_friend_template_decl=no,
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
323 octave_cv_cxx_new_friend_template_decl=yes
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
324 )
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
325 AC_LANG_POP(C++)
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
326 ])
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
327 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
328 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
329 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
330 fi
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
331 ])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
332 dnl
3233
98d0ee053ba4 [project @ 1999-01-27 20:23:40 by jwe]
jwe
parents: 3222
diff changeset
333 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
334 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
335 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
336 dnl the flag.
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
337 dnl
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
338 dnl OCTAVE_CC_FLAG
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
339 AC_DEFUN(OCTAVE_CC_FLAG, [
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
340 ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
341 AC_MSG_CHECKING(whether ${CC-cc} accepts $1)
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
342 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
343 AC_LANG_PUSH(C)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
344 XCFLAGS="$CFLAGS"
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
345 CFLAGS="$CFLAGS $1"
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
346 AC_TRY_LINK([], [],
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
347 eval "octave_cv_cc_flag_$ac_safe=yes",
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
348 eval "octave_cv_cc_flag_$ac_safe=no")
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
349 CFLAGS="$XCFLAGS"
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
350 AC_LANG_POP(C)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
351 ])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
352 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
353 AC_MSG_RESULT(yes)
3131
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
354 ifelse([$2], , [
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
355 CFLAGS="$CFLAGS $1"
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
356 AC_MSG_RESULT([adding $1 to CFLAGS])], [$2])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
357 else
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
358 AC_MSG_RESULT(no)
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
359 ifelse([$3], , , [$3])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
360 fi
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
361 ])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
362 dnl
3233
98d0ee053ba4 [project @ 1999-01-27 20:23:40 by jwe]
jwe
parents: 3222
diff changeset
363 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
364 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
365 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
366 dnl the flag.
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
367 dnl
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
368 dnl OCTAVE_CXX_FLAG
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
369 AC_DEFUN(OCTAVE_CXX_FLAG, [
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
370 ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
371 AC_MSG_CHECKING(whether ${CXX-g++} accepts $1)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
372 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
373 AC_LANG_PUSH(C++)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
374 XCXXFLAGS="$CXXFLAGS"
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
375 CXXFLAGS="$CXXFLAGS $1"
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
376 AC_TRY_LINK([], [],
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
377 eval "octave_cv_cxx_flag_$ac_safe=yes",
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
378 eval "octave_cv_cxx_flag_$ac_safe=no")
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
379 CXXFLAGS="$XCXXFLAGS"
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
380 AC_LANG_POP(C++)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
381 ])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
382 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
383 AC_MSG_RESULT(yes)
3131
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
384 ifelse([$2], , [
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
385 CXXFLAGS="$CXXFLAGS $1"
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
386 AC_MSG_RESULT([adding $1 to CXXFLAGS])], [$2])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
387 else
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
388 AC_MSG_RESULT(no)
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
389 ifelse([$3], , , [$3])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
390 fi
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
391 ])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
392 dnl
3729
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
393 dnl Check for flex
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
394 dnl
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
395 AC_DEFUN(OCTAVE_PROG_FLEX, [
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
396 ### 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
397 ### it, and it might not be installed.
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
398 ###
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
399 ### 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
400 ### using flex.
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
401 AC_PROG_LEX
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
402 case "$LEX" in
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
403 flex*)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
404 LFLAGS="-t -I"
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
405 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS])
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
406 LEXLIB=
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
407 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
408 *)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
409 LEX='$(top_srcdir)/missing flex'
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
410 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
411 AC_MSG_WARN($warn_flex)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
412 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
413 esac
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
414 AC_SUBST(LFLAGS)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
415 ])
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 dnl Check for bison
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
418 dnl
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
419 AC_DEFUN(OCTAVE_PROG_BISON, [
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
420 AC_PROG_YACC
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
421 case "$YACC" in
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
422 bison*)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
423 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
424 *)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
425 YACC='$(top_srcdir)/missing bison'
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
426 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
427 AC_MSG_WARN($warn_bison)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
428 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
429 esac
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 dnl
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
432 dnl What pager should we use?
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
433 dnl
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
434 AC_DEFUN(OCTAVE_PROG_PAGER,
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
435 [if test "$cross_compiling" = yes; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
436 DEFAULT_PAGER=less
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
437 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
438 AC_SUBST(DEFAULT_PAGER)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
439 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
440 octave_possible_pagers="less more page pg"
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
441 case "$canonical_host_type" in
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
442 *-*-cygwin32)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
443 octave_possible_pagers="$octave_possible_pagers more.com"
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
444 ;;
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
445 esac
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
446
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
447 AC_CHECK_PROGS(DEFAULT_PAGER, $octave_possible_pagers, [])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
448 if test -z "$DEFAULT_PAGER"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
449 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
450 AC_MSG_WARN($warn_less)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
451 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
452 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
453 ])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
454 dnl
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
455 dnl Does gnuplot exist? Is it a recent version?
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
456 dnl
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
457 AC_DEFUN(OCTAVE_PROG_GNUPLOT,
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
458 [if test "$cross_compiling" = yes; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
459 GNUPLOT_BINARY=gnuplot
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
460 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
461 AC_SUBST(DEFAULT_PAGER)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
462 AC_MSG_RESULT(assuming $GNUPLOT_BINARY supports multiplot mode)
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
463 AC_DEFINE(GNUPLOT_HAS_MULTIPLOT, 1, [Define if gnuplot has multiplot.])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
464 AC_MSG_RESULT(assuming $GNUPLOT_BINARY supports multiple frams)
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
465 AC_DEFINE(GNUPLOT_HAS_FRAMES, 1, [Define if gnuplot has frames.])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
466 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
467 AC_CHECK_PROG(GNUPLOT_BINARY, gnuplot, gnuplot, [])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
468 if test -n "$GNUPLOT_BINARY"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
469 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
470 if test -z "`echo 'set term unknown; set multiplot' | \
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
471 $GNUPLOT_BINARY 2>&1`"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
472 AC_MSG_RESULT([yes])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
473 AC_DEFINE(GNUPLOT_HAS_MULTIPLOT, 1)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
474 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
475 AC_MSG_RESULT([no])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
476 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
477 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
478 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
479 AC_MSG_RESULT([yes])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
480 AC_DEFINE(GNUPLOT_HAS_FRAMES, 1)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
481 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
482 AC_MSG_RESULT([no])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
483 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
484 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
485 warn_gnuplot="yes"
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
486
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
487 ## 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
488 ## warnings at the end of the script
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
489
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
490 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
491 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
492 AC_MSG_WARN([plotting commands without it.])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
493 AC_MSG_WARN([])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
494 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
495 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
496 AC_MSG_WARN([])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
497 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
498 AC_MSG_WARN([])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
499 AC_MSG_WARN([at the Octave prompt.])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
500 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
501 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
502 ])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
503 dnl
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
504 dnl Is DejaGNU installed?
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
505 dnl
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
506 dnl OCTAVE_PROG_RUNTEST
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
507 AC_DEFUN(OCTAVE_PROG_RUNTEST,
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
508 [if test "$cross_compiling" = yes; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
509 RUNTEST=runtest
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
510 AC_MSG_RESULT(assuming $RUNTEST exists on $canonical_host_type host)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
511 AC_SUBST(RUNTEST)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
512 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
513 AC_CHECK_PROG(RUNTEST, runtest, runtest, [])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
514 if test -z "$RUNTEST"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
515 warn_runtest="I didn't find runtest -- install DejaGNU if you want to run \`make check'"
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
516 AC_MSG_WARN($warn_runtest)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
517 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
518 AC_SUBST(RUNTEST)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
519 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
520 ])
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
521 dnl
3673
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
522 dnl Is gperf installed?
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
523 dnl
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
524 dnl OCTAVE_PROG_GPERF
3731
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
525 AC_DEFUN(OCTAVE_PROG_GPERF, [
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
526 AC_CHECK_PROG(GPERF, gperf, gperf, [])
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
527 if test -n "$GPERF"; then
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
528 if echo "%{
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
529 %}
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
530 %%
3750
c922e2d23c8c [project @ 2000-12-09 07:34:11 by jwe]
jwe
parents: 3731
diff changeset
531 foo" | $GPERF -t -C -D -E -G -L ANSI-C -H octave_kw_hash -N octave_kw_lookup > /dev/null 2>&1; then
3731
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
532 true
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
533 else
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
534 GPERF=""
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
535 warn_gperf="I found gperf, but it does not support all of the following options: -t -C -D -E -G -L ANSI-C -H -N; you need gperf 2.7 or a more recent version"
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
536 AC_MSG_WARN($warn_gperf)
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
537 fi
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
538 else
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
539 GPERF='$(top_srcdir)/missing gperf'
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
540 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
541 AC_MSG_WARN($warn_gperf)
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
542 fi
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
543 AC_SUBST(GPERF)
3673
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
544 ])
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
545 dnl
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
546 dnl Find nm.
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
547 dnl
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
548 dnl OCTAVE_PROG_NM
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
549 AC_DEFUN(OCTAVE_PROG_NM,
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
550 [if test "$cross_compiling" = yes; then
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
551 NM=nm
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
552 AC_MSG_RESULT(assuming $NM exists on $canonical_host_type host)
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
553 AC_SUBST(NM)
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
554 else
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
555 AC_CHECK_PROG(NM, nm, nm, [])
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
556 AC_SUBST(NM)
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
557 fi
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
558 ])
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
559 dnl
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
560 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
561 dnl
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
562 dnl OCTAVE_CXX_PREPENDS_UNDERSCORE
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
563 AC_DEFUN(OCTAVE_CXX_PREPENDS_UNDERSCORE,
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
564 [AC_MSG_CHECKING([whether ${CXX-g++} prepends an underscore to external names])
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
565 AC_CACHE_VAL(octave_cv_cxx_prepends_underscore,
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
566 [octave_cv_cxx_prepends_underscore=no
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
567 AC_LANG_PUSH(C++)
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
568 cat > conftest.$ac_ext <<EOF
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
569 bool FSmy_dld_fcn (void) { return false; }
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
570 EOF
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
571 if AC_TRY_EVAL(ac_compile); then
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
572 if test "`${NM-nm} conftest.o | grep _FSmy_dld_fcn`" != ""; then
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
573 octave_cv_cxx_prepends_underscore=yes
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
574 fi
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
575 else
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
576 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
577 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
578 fi
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
579 AC_LANG_POP(C++)
3222
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
580 ])
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
581 AC_MSG_RESULT($octave_cv_cxx_prepends_underscore)
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
582 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
583 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
584 fi
dae85431bade [project @ 1998-11-19 22:14:06 by jwe]
jwe
parents: 3176
diff changeset
585 ])
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
586 dnl
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
587 dnl See if the C++ library is ISO compliant.
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
588 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
589 dnl
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
590 dnl OCTAVE_CXX_ISO_COMPLIANT_LIBRARY
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
591 AC_DEFUN(OCTAVE_CXX_ISO_COMPLIANT_LIBRARY, [
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
592 AC_REQUIRE([AC_PROG_CXX])
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
593 AC_MSG_CHECKING([if C++ library is ISO compliant])
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
594 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
595 AC_LANG_PUSH(C++)
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
596 rm -f conftest.h
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
597 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
598 climits clocale cmath complex csetjmp csignal cstdarg cstddef \
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
599 cstdio cstdlib cstring ctime cwchar cwctype deque exception \
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
600 fstream functional iomanip ios iosfwd iostream istream iterator \
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
601 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
602 sstream stack stdexcept streambuf string strstream typeinfo \
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
603 utility valarray vector; do
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
604 echo "#include <$inc>" >> conftest.h
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
605 done
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
606 AC_TRY_LINK([#include "conftest.h"], [
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
607 std::bitset<50> flags;
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
608 flags.set();
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
609 int digits = std::numeric_limits<unsigned long>::digits;
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
610 digits = 0;
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
611 ],
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
612 octave_cv_cxx_iso_compliant_library=yes,
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
613 octave_cv_cxx_iso_compliant_library=no
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
614 )
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
615 AC_LANG_POP(C++)
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
616 ])
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
617 AC_MSG_RESULT($octave_cv_cxx_iso_compliant_library)
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
618 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
619 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
620 fi
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
621 ])
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
622 dnl
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
623 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
624 dnl readline.
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
625 dnl
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
626 dnl OCTAVE_ENABLE_READLINE
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
627 AC_DEFUN(OCTAVE_ENABLE_READLINE, [
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
628 USE_READLINE=true
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
629 AC_ARG_ENABLE(readline,
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
630 [ --enable-readline use readline library (default is yes)],
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
631 [if test "$enableval" = no; then
3824
0ee55719541a [project @ 2001-04-26 17:07:21 by jwe]
jwe
parents: 3822
diff changeset
632 USE_READLINE=false
3825
74255bd05bdd [project @ 2001-04-26 19:50:03 by jwe]
jwe
parents: 3824
diff changeset
633 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
634 fi])
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
635 if $USE_READLINE; then
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
636 AC_CHECK_LIB(readline, rl_set_keyboard_input_timeout, [
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
637 LIBS="-lreadline $LIBS"
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
638 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
639 ], [
3824
0ee55719541a [project @ 2001-04-26 17:07:21 by jwe]
jwe
parents: 3822
diff changeset
640 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
641 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
642 ])
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
643 fi
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
644 ])
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
645 dnl
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
646 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
647 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
648 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
649 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
650 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
651 dnl will happen when using an unsupported C++ compiler.
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
652 dnl
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
653 dnl OCTAVE_CXX_ABI
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
654 AC_DEFUN(OCTAVE_CXX_ABI,
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
655 [AC_MSG_CHECKING([C++ ABI version used by ${CXX}])
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
656 AC_CACHE_VAL(octave_cv_cxx_abi,
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
657 [octave_cv_cxx_abi='unknown'
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
658 AC_LANG_PUSH(C++)
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
659 cat > conftest.$ac_ext <<EOF
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
660 bool FSmy_dld_fcn (void) { return false; }
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
661 EOF
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
662 if AC_TRY_EVAL(ac_compile); then
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
663 if test "`${NM-nm} conftest.o | grep FSmy_dld_fcn__Fv`" != ""; then
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
664 octave_cv_cxx_abi='gnu_v2'
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
665 fi
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
666 if test "`${NM-nm} conftest.o | grep _Z12FSmy_dld_fcnv`" != ""; then
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
667 octave_cv_cxx_abi='gnu_v3'
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
668 fi
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
669 if test "`${NM-nm} conftest.o | grep __1cMFSmy_dld_fcn6F_b_`" != ""; then
3843
f848bc60b927 [project @ 2001-06-29 21:10:21 by jwe]
jwe
parents: 3842
diff changeset
670 octave_cv_cxx_abi='sun_v5'
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
671 fi
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
672 else
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
673 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
674 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
675 fi
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
676 AC_LANG_POP(C++)
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
677 ])
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
678 AC_MSG_RESULT($octave_cv_cxx_abi)
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3843
diff changeset
679 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
680 ])
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
681