annotate aclocal.m4 @ 3887:7da18459c08b

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