annotate m4/acinclude.m4 @ 15133:f91eac1bc66d

m4/acinclude.m4: Correct typos, use consistent style for describing macros. * m4/acinclude.m4: Correct typos, use consistent style for describing macros.
author Rik <rik@octave.org>
date Wed, 08 Aug 2012 21:51:23 -0700
parents 25200c04bc25
children edae65062740
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
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 14043
diff changeset
3 dnl Copyright (C) 1995-2012 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
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6955
diff changeset
9 dnl Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6955
diff changeset
10 dnl your option) any later version.
1232
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
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6955
diff changeset
18 dnl along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6955
diff changeset
19 dnl <http://www.gnu.org/licenses/>.
2548
b50cc31aa0cd [project @ 1996-11-20 06:43:26 by jwe]
jwe
parents: 2491
diff changeset
20 dnl
9525
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
21 dnl
9577
b03062e16c6f copyirght & FIXME in aclocal.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 9568
diff changeset
22 dnl Copyright (C) 2008 - 2009 Free Software Foundation, Inc.
b03062e16c6f copyirght & FIXME in aclocal.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 9568
diff changeset
23 dnl
9525
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
24 dnl If needed, define the m4_ifblank and m4_ifnblank macros from autoconf 2.64
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
25 dnl This allows us to run with earlier Autoconfs as well.
9577
b03062e16c6f copyirght & FIXME in aclocal.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 9568
diff changeset
26 dnl FIXME: these should go away once Autoconf 2.64 is required or ubiquitous.
b03062e16c6f copyirght & FIXME in aclocal.m4
Jaroslav Hajek <highegg@gmail.com>
parents: 9568
diff changeset
27 dnl
9525
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
28 ifdef([m4_ifblank],[],[
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
29 m4_define([m4_ifblank],
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
30 [m4_if(m4_translit([[$1]], [ ][ ][
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
31 ]), [], [$2], [$3])])])
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
32 dnl
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
33 ifdef([m4_ifnblank],[],[
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
34 m4_define([m4_ifnblank],
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
35 [m4_if(m4_translit([[$1]], [ ][ ][
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
36 ]), [], [$3], [$2])])])
691545147aca compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents: 9523
diff changeset
37 dnl
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
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
40 dnl Figure out the hardware-vendor-os info.
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
41 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
42 AC_DEFUN([OCTAVE_HOST_TYPE],
2813
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
43 [AC_CANONICAL_HOST
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
44 if test -z "$host"; then
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
45 host=unknown
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
46 fi
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
47 canonical_host_type=$host
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
48 if test "$host" = unknown; then
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
49 AC_MSG_WARN([configuring Octave for unknown system type
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
50 ])
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
51 fi
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
52 AC_SUBST(canonical_host_type)])
2813
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
53 dnl
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
54 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
55 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
56 AC_DEFUN([OCTAVE_SET_DEFAULT],
3176
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3174
diff changeset
57 [ifelse($#, 2, [: ${$1=$2}
2813
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
58 ])dnl
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
59 AC_MSG_RESULT([defining $1 to be $$1])
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
60 AC_SUBST($1)])
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
61 dnl
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
62 dnl Check for ar.
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
63 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
64 AC_DEFUN([OCTAVE_PROG_AR],
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
65 [if test -z "$AR"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
66 AR=ar
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
67 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
68 AC_SUBST(AR)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
69
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
70 if test -z "$ARFLAGS"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
71 ARFLAGS="rc"
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
72 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
73 AC_SUBST(ARFLAGS)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
74 ])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
75 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
76 dnl Check if the compiler supports placement delete.
4360
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
77 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
78 AC_DEFUN([OCTAVE_PLACEMENT_DELETE],
4360
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
79 [AC_CACHE_CHECK([whether <new> defines placement delete operator],
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
80 octave_cv_placement_delete,
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
81 [AC_LANG_PUSH(C++)
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
82 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <new>]],
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
83 [[operator delete((void *)0, (void *)0);]])],
4360
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
84 octave_cv_placement_delete=yes, octave_cv_placement_delete=no)])
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
85 if test $octave_cv_placement_delete = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
86 AC_DEFINE(HAVE_PLACEMENT_DELETE,1,[Define to 1 if C++ supports operator delete(void *, void *).])
4360
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
87 fi
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
88 AC_LANG_POP(C++)
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
89 ])
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
90 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
91 dnl Check if the compiler dynamic auto arrays.
4366
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
92 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
93 AC_DEFUN([OCTAVE_DYNAMIC_AUTO_ARRAYS],
4366
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
94 [AC_CACHE_CHECK([whether C++ supports dynamic auto arrays],
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
95 octave_cv_dynamic_auto_arrays,
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
96 [AC_LANG_PUSH(C++)
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
97 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
98 [[void test(char *); int length(); char x[length()]; test(x);]])],
4366
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
99 octave_cv_dynamic_auto_arrays=yes, octave_cv_dynamic_auto_arrays=no)])
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
100 if test $octave_cv_dynamic_auto_arrays = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
101 AC_DEFINE(HAVE_DYNAMIC_AUTO_ARRAYS,1,[Define to 1 if C++ supports dynamic auto arrays.])
4366
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
102 fi
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
103 AC_LANG_POP(C++)
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
104 ])
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
105 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
106 dnl Check if the C++ library has the bit_and, bit_or, and bit_xor
14725
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
107 dnl templates defined.
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
108 dnl
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
109 AC_DEFUN([OCTAVE_CXX_BITWISE_OP_TEMPLATES],
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
110 [AC_CACHE_CHECK([whether bit_and, bit_or, bit_xor are defined in the C++ library],
14725
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
111 octave_cv_cxx_bitwise_op_templates,
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
112 [AC_LANG_PUSH(C++)
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
113 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <functional>]],
14735
295bd3efc065 fix configure test for bit functions
John W. Eaton <jwe@octave.org>
parents: 14725
diff changeset
114 [[int x = 0;
295bd3efc065 fix configure test for bit functions
John W. Eaton <jwe@octave.org>
parents: 14725
diff changeset
115 int y = 1;
295bd3efc065 fix configure test for bit functions
John W. Eaton <jwe@octave.org>
parents: 14725
diff changeset
116 int z1 = std::bit_and<int>() (x, y);
295bd3efc065 fix configure test for bit functions
John W. Eaton <jwe@octave.org>
parents: 14725
diff changeset
117 int z2 = std::bit_or<int>() (x, y);
295bd3efc065 fix configure test for bit functions
John W. Eaton <jwe@octave.org>
parents: 14725
diff changeset
118 int z3 = std::bit_xor<int>() (x, y);]])],
14725
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
119 octave_cv_cxx_bitwise_op_templates=yes, octave_cv_cxx_bitwise_op_templates=no)])
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
120 if test $octave_cv_cxx_bitwise_op_templates = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
121 AC_DEFINE(HAVE_CXX_BITWISE_OP_TEMPLATES,1,[Define to 1 if C++ library has templated bitwise operators.])
14725
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
122 fi
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
123 AC_LANG_POP(C++)
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
124 ])
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
125
fa48fd0f160f Add configure check for templated bitwise operators.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14657
diff changeset
126 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
127 dnl Check if the C++ library has functions to set real and imaginary
10380
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
128 dnl parts of complex numbers independently.
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
129 dnl
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
130 AC_DEFUN([OCTAVE_CXX_COMPLEX_SETTERS],
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
131 [AC_CACHE_CHECK([whether complex class can set components independently],
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
132 octave_cv_cxx_complex_setters,
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
133 [AC_LANG_PUSH(C++)
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
134 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <complex>]],
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
135 [[std::complex<double> x; x.real (1.0); x.imag (2.0);]])],
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
136 octave_cv_cxx_complex_setters=yes, octave_cv_cxx_complex_setters=no)])
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
137 if test $octave_cv_cxx_complex_setters = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
138 AC_DEFINE(HAVE_CXX_COMPLEX_SETTERS,1,[Define to 1 if C++ complex class has void real (T) and void imag (T) methods.])
10380
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
139 fi
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
140 AC_LANG_POP(C++)
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
141 ])
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
142 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
143 dnl Check if the C++ library has functions to access real and imaginary
10380
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
144 dnl parts of complex numbers independently via references.
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
145 dnl
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
146 AC_DEFUN([OCTAVE_CXX_COMPLEX_REFERENCE_ACCESSORS],
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
147 [AC_CACHE_CHECK([whether complex class can reference components independently],
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
148 octave_cv_cxx_complex_reference_accessors,
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
149 [AC_LANG_PUSH(C++)
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
150 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <complex>]],
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
151 [[std::complex<double> x; x.real () = 1.0; x.imag () = 1.0;]])],
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
152 octave_cv_cxx_complex_reference_accessors=yes, octave_cv_cxx_complex_reference_accessors=no)])
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
153 if test $octave_cv_cxx_complex_reference_accessors = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
154 AC_DEFINE(HAVE_CXX_COMPLEX_REFERENCE_ACCESSORS,1,[Define to 1 if C++ complex class has T& real (void) and T& imag (void) methods.])
10380
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
155 fi
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
156 AC_LANG_POP(C++)
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
157 ])
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
158 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
159 dnl Check if the Carbon Framework defines CGDisplayBitsPerPixel.
14776
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
160 dnl
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
161 AC_DEFUN([OCTAVE_CARBON_CGDISPLAYBITSPERPIXEL],
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
162 [AC_CACHE_CHECK([whether CGDisplayBitsPerPixel is defined in the Carbon Framework],
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
163 octave_cv_carbon_cgdisplaybitsperpixel,
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
164 [AC_LANG_PUSH(C++)
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
165 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
166 #include <Carbon/Carbon.h>
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
167 ]], [[
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
168 CGDirectDisplayID display = CGMainDisplayID ();
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
169 size_t depth = CGDisplayBitsPerPixel (display);
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
170 ]])],
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
171 octave_cv_carbon_cgdisplaybitsperpixel=yes, octave_cv_carbon_cgdisplaybitsperpixel=no)])
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
172 if test $octave_cv_carbon_cgdisplaybitsperpixel = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
173 AC_DEFINE(HAVE_CARBON_CGDISPLAYBITSPERPIXEL,1,[Define to 1 if Carbon Framework has CGDisplayBitsPerPixel.])
14776
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
174 fi
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
175 AC_LANG_POP(C++)
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
176 ])
0eb1b1eb2c76 Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present.
Ben Abbott <bpabbott@mac.com>
parents: 14735
diff changeset
177 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
178 dnl The following test is from Karl Berry's Kpathsearch library. I'm
1707
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
179 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
180 dnl kpathsea optional.
1708
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
181 dnl
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
182 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
183 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
184 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
185 dnl doesn't hurt.
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
186 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
187 AC_DEFUN([OCTAVE_SMART_PUTENV],
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
188 [AC_MSG_CHECKING([whether putenv uses malloc])
1707
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
189 AC_CACHE_VAL(octave_cv_func_putenv_malloc,
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
190 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
1707
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
191 #define VAR "YOW_VAR"
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
192 #define STRING1 "GabbaGabbaHey"
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
193 #define STRING2 "Yow!!" /* should be shorter than STRING1 */
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
194 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
195 main ()
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
196 {
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
197 char *str1, *rstr1, *str2, *rstr2;
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
198 str1 = getenv (VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
199 if (str1)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
200 exit (1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
201 str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
202 if (str1 == 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
203 exit (2);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
204 strcpy (str1, VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
205 strcat (str1, "=");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
206 strcat (str1, STRING1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
207 if (putenv (str1) < 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
208 exit (3);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
209 rstr1 = getenv (VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
210 if (rstr1 == 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
211 exit (4);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
212 rstr1 -= strlen (VAR) + 1;
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
213 if (strncmp (rstr1, VAR, strlen (VAR)))
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
214 exit (5);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
215 str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
216 if (str2 == 0 || str1 == str2)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
217 exit (6);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
218 strcpy (str2, VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
219 strcat (str2, "=");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
220 strcat (str2, STRING2);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
221 if (putenv (str2) < 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
222 exit (7);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
223 rstr2 = getenv (VAR);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
224 if (rstr2 == 0)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
225 exit (8);
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
226 rstr2 -= strlen (VAR) + 1;
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
227 #if 0
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
228 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
229 /*
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
230 * 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
231 * 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
232 */
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
233 if (rstr1 == rstr2)
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
234 printf ("#define SMART_PUTENV\n");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
235 else
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
236 printf ("#undef SMART_PUTENV\n");
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
237 #endif
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
238 exit (rstr1 == rstr2 ? 0 : 1);
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
239 }]])], octave_cv_func_putenv_malloc=yes, octave_cv_func_putenv_malloc=no,
1707
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
240 octave_cv_func_putenv_malloc=no)])dnl
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
241 AC_MSG_RESULT([$octave_cv_func_putenv_malloc])
1707
5ddae4c13f80 [project @ 1996-01-08 00:39:59 by jwe]
jwe
parents: 1315
diff changeset
242 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
243 AC_DEFINE(SMART_PUTENV,1,[To quiet autoheader.])
1708
0d952cd2ea74 [project @ 1996-01-08 00:45:34 by jwe]
jwe
parents: 1707
diff changeset
244 fi])
1788
b7de2fd2be6b [project @ 1996-01-24 20:47:58 by jwe]
jwe
parents: 1708
diff changeset
245 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
246 dnl Check if C++ compiler needs the new friend template declaration
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
247 dnl syntax.
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
248 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
249 AC_DEFUN([OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL], [
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
250 AC_REQUIRE([AC_PROG_CXX])
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
251 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
252 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
253 AC_LANG_PUSH(C++)
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
254 rm -f conftest.h
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
255 cat > conftest.h <<EOB
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
256 struct A {
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
257 friend int operator== (const A&, const A&);
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
258 A (int) { }
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
259 };
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
260
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
261 template <class T> int
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
262 operator== (const T&, const T&)
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
263 {
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
264 return 0;
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
265 }
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
266 EOB
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
267 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "conftest.h"]],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
268 [[A a (1);
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
269 return a == A(1);]])],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
270 [octave_cv_cxx_new_friend_template_decl=no],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
271 [octave_cv_cxx_new_friend_template_decl=yes])
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
272 AC_LANG_POP(C++)
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
273 ])
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
274 AC_MSG_RESULT([$octave_cv_cxx_new_friend_template_decl])
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
275 if test $octave_cv_cxx_new_friend_template_decl = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
276 AC_DEFINE(CXX_NEW_FRIEND_TEMPLATE_DECL,1,[Define to 1 if your compiler supports `<>' stuff for template friends.])
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
277 fi
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
278 ])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
279 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
280 dnl Check if C compiler handles FLAG command line option. If two
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
281 dnl arguments are specified, execute the second arg as shell commands.
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
282 dnl Otherwise, add FLAG to CFLAGS if the compiler accepts the flag.
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
283 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
284 AC_DEFUN([OCTAVE_CC_FLAG], [
14994
bbc825cb2ea0 Use -I instead of -isystem if -isystem is not avaiable
Max Brister <max@2bass.com>
parents: 14776
diff changeset
285 ac_safe=`echo "$1" | sed 'y% ./+-:=%___p___%'`
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
286 AC_MSG_CHECKING([whether ${CC-cc} accepts $1])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
287 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
288 AC_LANG_PUSH(C)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
289 XCFLAGS="$CFLAGS"
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
290 CFLAGS="$CFLAGS $1"
5177
86fa011d6404 [project @ 2005-03-03 00:32:34 by jwe]
jwe
parents: 5094
diff changeset
291 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
292 eval "octave_cv_cc_flag_$ac_safe=yes",
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
293 eval "octave_cv_cc_flag_$ac_safe=no")
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
294 CFLAGS="$XCFLAGS"
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
295 AC_LANG_POP(C)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
296 ])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
297 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
298 AC_MSG_RESULT(yes)
3131
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
299 ifelse([$2], , [
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
300 CFLAGS="$CFLAGS $1"
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
301 AC_MSG_RESULT([adding $1 to CFLAGS])], [$2])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
302 else
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
303 AC_MSG_RESULT(no)
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
304 ifelse([$3], , , [$3])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
305 fi
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
306 ])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
307 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
308 dnl Check if C++ compiler handles FLAG command line option. If two
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
309 dnl arguments are specified, execute the second arg as shell commands.
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
310 dnl Otherwise, add FLAG to CXXFLAGS if the compiler accepts the flag.
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
311 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
312 AC_DEFUN([OCTAVE_CXX_FLAG], [
3908
90dc5c9a9a21 [project @ 2002-04-24 19:53:35 by jwe]
jwe
parents: 3892
diff changeset
313 ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'`
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
314 AC_MSG_CHECKING([whether ${CXX-g++} accepts $1])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
315 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
316 AC_LANG_PUSH(C++)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
317 XCXXFLAGS="$CXXFLAGS"
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
318 CXXFLAGS="$CXXFLAGS $1"
5177
86fa011d6404 [project @ 2005-03-03 00:32:34 by jwe]
jwe
parents: 5094
diff changeset
319 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
320 eval "octave_cv_cxx_flag_$ac_safe=yes",
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
321 eval "octave_cv_cxx_flag_$ac_safe=no")
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
322 CXXFLAGS="$XCXXFLAGS"
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
323 AC_LANG_POP(C++)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
324 ])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
325 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
326 AC_MSG_RESULT(yes)
3131
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
327 ifelse([$2], , [
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
328 CXXFLAGS="$CXXFLAGS $1"
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
329 AC_MSG_RESULT([adding $1 to CXXFLAGS])], [$2])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
330 else
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
331 AC_MSG_RESULT(no)
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
332 ifelse([$3], , , [$3])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
333 fi
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
334 ])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
335 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
336 dnl Check if Fortran compiler handles FLAG command line option. If
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
337 dnl two arguments are specified, execute the second arg as shell
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
338 dnl commands. Otherwise, add FLAG to FFLAGS if the compiler accepts
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
339 dnl the flag.
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
340 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
341 AC_DEFUN([OCTAVE_F77_FLAG], [
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
342 ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'`
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
343 AC_MSG_CHECKING([whether ${F77-g77} accepts $1])
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
344 AC_CACHE_VAL(octave_cv_f77_flag_$ac_safe, [
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
345 AC_LANG_PUSH(Fortran 77)
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
346 XFFLAGS="$FFLAGS"
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
347 FFLAGS="$FFLAGS $1"
5177
86fa011d6404 [project @ 2005-03-03 00:32:34 by jwe]
jwe
parents: 5094
diff changeset
348 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
349 eval "octave_cv_f77_flag_$ac_safe=yes",
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
350 eval "octave_cv_f77_flag_$ac_safe=no")
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
351 FFLAGS="$XFFLAGS"
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
352 AC_LANG_POP(Fortran 77)
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
353 ])
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
354 if eval "test \"`echo '$octave_cv_f77_flag_'$ac_safe`\" = yes"; then
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
355 AC_MSG_RESULT(yes)
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
356 ifelse([$2], , [
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
357 FFLAGS="$FFLAGS $1"
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
358 AC_MSG_RESULT([adding $1 to FFLAGS])], [$2])
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
359 else
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
360 AC_MSG_RESULT(no)
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
361 ifelse([$3], , , [$3])
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
362 fi
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
363 ])
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
364 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
365 dnl Check if Fortran compiler has the intrinsic function ISNAN.
14550
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
366 dnl
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
367 AC_DEFUN([OCTAVE_CHECK_FORTRAN_HAVE_ISNAN], [
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
368 AC_LANG_PUSH(Fortran 77)
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
369 AC_CACHE_CHECK([whether $F77 has the intrinsic function ISNAN],
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
370 [octave_cv_fortran_have_isnan],
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
371 [AC_COMPILE_IFELSE(
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
372 [ program foo
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
373 implicit none
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
374 real x
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
375 double precision y
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
376 if (isnan(x)) then
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
377 print *, 'x is NaN'
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
378 end if
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
379 if (isnan(y)) then
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
380 print *, 'y is NaN'
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
381 end if
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
382 end program], [octave_cv_fortran_have_isnan=yes], [octave_cv_fortran_have_isnan=no]
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
383 )])
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
384 AC_LANG_POP(Fortran 77)
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
385 ])
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
386 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
387 dnl Check if the default Fortran INTEGER is 64 bits wide.
9596
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
388 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
389 AC_DEFUN([OCTAVE_CHECK_FORTRAN_INTEGER_SIZE], [
10331
6a50aa2cdf00 never compile ranlib with 8-byte integers
John W. Eaton <jwe@octave.org>
parents: 10257
diff changeset
390 octave_fintsize_save_FFLAGS="$FFLAGS"
6a50aa2cdf00 never compile ranlib with 8-byte integers
John W. Eaton <jwe@octave.org>
parents: 10257
diff changeset
391 FFLAGS="$FFLAGS $F77_INTEGER_8_FLAG"
9596
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
392 AC_LANG_PUSH(Fortran 77)
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
393 AC_CACHE_CHECK([whether $F77 generates correct size integers],
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
394 [octave_cv_fortran_integer_size],
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
395 [AC_COMPILE_IFELSE(
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
396 [ subroutine foo(n, in, out)
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
397 integer n, in(n), out(n)
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
398 integer i
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
399 do 10 i = 1, n
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
400 out(i) = in(i)
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
401 10 continue
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
402 return
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
403 end],
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
404 [mv conftest.$ac_objext fintsize.$ac_objext
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
405
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
406 octave_fintsize_save_LIBS="$LIBS"
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
407 LIBS="fintsize.$ac_objext $[]_AC_LANG_PREFIX[]LIBS"
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
408 AC_LANG_PUSH(C)dnl
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
409 AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <assert.h>]], [[
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
410 #ifdef USE_64_BIT_IDX_T
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
411 #if IDX_TYPE_LONG
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
412 typedef long octave_idx_type;
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
413 #else
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
414 typedef int octave_idx_type;
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
415 #endif
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
416 #else
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
417 typedef int octave_idx_type;
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
418 #endif
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
419 octave_idx_type n = 2;
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
420 octave_idx_type in[2];
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
421 octave_idx_type out[2];
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
422 in[0] = 13;
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
423 in[0] = 42;
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
424 F77_FUNC(foo,FOO) (&n, &in, &out);
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
425 assert (in[0] == out[0] && in[1] == out[1]);
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
426 ]])],
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
427 [octave_cv_fortran_integer_size=yes],
13957
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
428 [octave_cv_fortran_integer_size=no],
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
429 [octave_cv_fortran_integer_size=yes])
9596
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
430 AC_LANG_POP(C)dnl
10331
6a50aa2cdf00 never compile ranlib with 8-byte integers
John W. Eaton <jwe@octave.org>
parents: 10257
diff changeset
431 LIBS="$octave_fintsize_save_LIBS"
9596
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
432 rm -f conftest.$ac_objext fintsize.$ac_objext
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
433 ], [
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
434 rm -f conftest.$ac_objext
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
435 AC_MSG_FAILURE([cannot compile a simple Fortran program])
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
436 octave_cv_fortran_integer_size=no])])
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
437 AC_LANG_POP(Fortran 77)
10331
6a50aa2cdf00 never compile ranlib with 8-byte integers
John W. Eaton <jwe@octave.org>
parents: 10257
diff changeset
438 FFLAGS="$octave_fintsize_save_FFLAGS"
9596
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
439 ])
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
440 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
441 dnl Add warning to final summary.
14605
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
442 dnl
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
443 AC_DEFUN([OCTAVE_CONFIGURE_WARNING], [
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
444 AC_MSG_WARN([$][$1])
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
445 m4_set_add([summary_warning_list], [$1])
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
446 ])
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
447 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
448 dnl Print final summary.
14605
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
449 dnl
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
450 AC_DEFUN([OCTAVE_CONFIGURE_WARNING_SUMMARY], [
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
451 m4_set_foreach([summary_warning_list], [elt], [
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
452 if test -n "[$]elt"; then
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
453 AC_MSG_WARN([$]elt)
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
454 warn_msg_printed=true
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
455 fi])
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
456 ])
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
457 dnl
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
458 dnl OCTAVE_CHECK_LIBRARY(LIBRARY, DOC-NAME, WARN-MSG, HEADER, FUNC,
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
459 dnl LANG, DOC-STRING, EXTRA-CHECK)
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
460 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
461 AC_DEFUN([OCTAVE_CHECK_LIBRARY], [
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
462 AC_ARG_WITH([$1-includedir],
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
463 [AS_HELP_STRING([--with-$1-includedir=DIR],
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
464 [look for $2 include files in DIR])],
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
465 [m4_toupper([$1])_CPPFLAGS="-I$withval"])
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
466 AC_SUBST(m4_toupper([$1])_CPPFLAGS)
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
467
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
468 AC_ARG_WITH([$1-libdir],
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
469 [AS_HELP_STRING([--with-$1-libdir=DIR],
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
470 [look for $2 libraries in DIR])],
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
471 [m4_toupper([$1])_LDFLAGS="-L$withval"])
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
472 AC_SUBST(m4_toupper([$1])_LDFLAGS)
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
473
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
474 AC_ARG_WITH([$1],
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
475 [m4_ifblank([$7],
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
476 [AS_HELP_STRING([--without-$1], [don't use $2 library])],
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
477 [AS_HELP_STRING([--without-$1], [$7])])],
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
478 with_$1=$withval, with_$1=yes)
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
479
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
480 m4_toupper([$1])_LIBS=
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
481 case $with_$1 in
9539
41a74dcd14df Clear QHULL_LIBS etc on errors. Interpret --without-qhull etc correctly.
David Grundberg <individ@acc.umu.se>
parents: 9531
diff changeset
482 no)
41a74dcd14df Clear QHULL_LIBS etc on errors. Interpret --without-qhull etc correctly.
David Grundberg <individ@acc.umu.se>
parents: 9531
diff changeset
483 m4_toupper([$1])_LIBS=
41a74dcd14df Clear QHULL_LIBS etc on errors. Interpret --without-qhull etc correctly.
David Grundberg <individ@acc.umu.se>
parents: 9531
diff changeset
484 ;;
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
485 yes | "")
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
486 m4_toupper([$1])_LIBS="-l$1"
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
487 ;;
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
488 -* | */* | *.a | *.so | *.so.* | *.o)
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
489 m4_toupper([$1])_LIBS="$with_$1"
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
490 ;;
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
491 *)
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
492 m4_toupper([$1])_LIBS="-l$with_$1"
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
493 ;;
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
494 esac
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
495
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
496 [TEXINFO_]m4_toupper([$1])=
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
497 warn_$1="$3"
14605
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
498 m4_set_add([summary_warning_list], [warn_$1])
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
499
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
500 if test -n "$m4_toupper([$1])_LIBS"; then
9540
79b5fe2d5646 use Z_LIBS in checks for curl and glpk libraries
John W. Eaton <jwe@octave.org>
parents: 9539
diff changeset
501 octave_check_library_save_CPPFLAGS="$CPPFLAGS"
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
502 CPPFLAGS="$m4_toupper([$1])_CPPFLAGS $CPPFLAGS"
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
503 m4_ifnblank([$6], [AC_LANG_PUSH($6)])
9568
d3fccc4c4b9e use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents: 9543
diff changeset
504 octave_$1_check_for_lib=false
d3fccc4c4b9e use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents: 9543
diff changeset
505 m4_ifblank([$4], [octave_$1_check_for_lib=true],
d3fccc4c4b9e use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents: 9543
diff changeset
506 [AC_CHECK_HEADERS($4, [octave_$1_check_for_lib=true; break])])
d3fccc4c4b9e use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents: 9543
diff changeset
507 if $octave_$1_check_for_lib; then
9540
79b5fe2d5646 use Z_LIBS in checks for curl and glpk libraries
John W. Eaton <jwe@octave.org>
parents: 9539
diff changeset
508 octave_check_library_save_LDFLAGS="$LDFLAGS"
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
509 LDFLAGS="$m4_toupper([$1])_LDFLAGS $LDFLAGS"
9540
79b5fe2d5646 use Z_LIBS in checks for curl and glpk libraries
John W. Eaton <jwe@octave.org>
parents: 9539
diff changeset
510 octave_check_library_save_LIBS="$LIBS"
9520
bd5909b89457 fix OCTAVE_CHECK_LIBRARY
Jaroslav Hajek <highegg@gmail.com>
parents: 9519
diff changeset
511 LIBS="$m4_toupper([$1])_LIBS $LIBS"
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
512 octave_$1_ok=no
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
513 AC_MSG_CHECKING([for $5 in $m4_toupper([$1])_LIBS])
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
514 AC_LINK_IFELSE([AC_LANG_CALL([], [$5])],
9539
41a74dcd14df Clear QHULL_LIBS etc on errors. Interpret --without-qhull etc correctly.
David Grundberg <individ@acc.umu.se>
parents: 9531
diff changeset
515 [octave_$1_ok=yes])
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
516 AC_MSG_RESULT([$octave_$1_ok])
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
517 if test $octave_$1_ok = yes; then
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
518 m4_ifblank([$8], [
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
519 warn_$1=
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
520 AC_DEFINE([HAVE_]m4_toupper([$1]), 1,
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
521 [Define to 1 if $2 is available.])
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
522 [TEXINFO_]m4_toupper([$1])="@set [HAVE_]m4_toupper([$1])"], [$8])
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
523 fi
9540
79b5fe2d5646 use Z_LIBS in checks for curl and glpk libraries
John W. Eaton <jwe@octave.org>
parents: 9539
diff changeset
524 LIBS="$octave_check_library_save_LIBS"
9568
d3fccc4c4b9e use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents: 9543
diff changeset
525 LDFLAGS="$octave_check_library_save_LDFLAGS"
d3fccc4c4b9e use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents: 9543
diff changeset
526 fi
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
527 m4_ifnblank([$6], [AC_LANG_POP($6)])
9540
79b5fe2d5646 use Z_LIBS in checks for curl and glpk libraries
John W. Eaton <jwe@octave.org>
parents: 9539
diff changeset
528 CPPFLAGS="$octave_check_library_save_CPPFLAGS"
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
529 fi
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
530 AC_SUBST(m4_toupper([$1])_LIBS)
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
531 AC_SUBST([TEXINFO_]m4_toupper([$1]))
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
532 if test -n "$warn_$1"; then
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
533 AC_MSG_WARN([$warn_$1])
9539
41a74dcd14df Clear QHULL_LIBS etc on errors. Interpret --without-qhull etc correctly.
David Grundberg <individ@acc.umu.se>
parents: 9531
diff changeset
534 m4_toupper([$1])_LIBS=
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
535 fi
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
536 ])
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
537 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
538 dnl Check for flex.
3729
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
539 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
540 AC_DEFUN([OCTAVE_PROG_FLEX], [
3729
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
541 ### 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
542 ### it, and it might not be installed.
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
543 ###
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
544 ### 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
545 ### using flex.
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
546 AC_PROG_LEX
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
547 case "$LEX" in
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
548 flex*)
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9654
diff changeset
549 LFLAGS="-I"
3729
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
550 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS])
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
551 LEXLIB=
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
552 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
553 *)
14419
2258a0b73eb8 Fix path to missing helper script
Mike Miller <mtmiller@ieee.org>
parents: 14315
diff changeset
554 LEX='$(top_srcdir)/build-aux/missing flex'
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
555 warn_flex="
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
556
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
557 I didn't find flex, but it's only a problem if you need to reconstruct
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
558 lex.cc, which is the case if you're building from VCS sources.
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
559 "
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
560 OCTAVE_CONFIGURE_WARNING([warn_flex])
3729
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
561 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
562 esac
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
563 AC_SUBST(LFLAGS)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
564 ])
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
565 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
566 dnl Check for bison.
3729
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
567 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
568 AC_DEFUN([OCTAVE_PROG_BISON], [
3729
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
569 AC_PROG_YACC
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
570 case "$YACC" in
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
571 bison*)
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
572 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
573 *)
14419
2258a0b73eb8 Fix path to missing helper script
Mike Miller <mtmiller@ieee.org>
parents: 14315
diff changeset
574 YACC='$(top_srcdir)/build-aux/missing bison'
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
575 warn_bison="
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
576
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
577 I didn't find bison, but it's only a problem if you need to
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
578 reconstruct parse.cc, which is the case if you're building from VCS
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
579 sources.
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
580
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
581 "
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
582 OCTAVE_CONFIGURE_WARNING([warn_bison])
3729
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
583 ;;
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
584 esac
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
585 ])
ea62136d86e8 [project @ 2000-10-31 17:17:26 by jwe]
jwe
parents: 3673
diff changeset
586 dnl
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
587 dnl What pager should we use?
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
588 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
589 AC_DEFUN([OCTAVE_PROG_PAGER],
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
590 [if test "$cross_compiling" = yes; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
591 DEFAULT_PAGER=less
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
592 AC_MSG_RESULT([assuming $DEFAULT_PAGER exists on $canonical_host_type host])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
593 AC_SUBST(DEFAULT_PAGER)
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
594 else
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
595 octave_possible_pagers="less more page pg"
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
596 case "$canonical_host_type" in
6103
a2fdc87184cf [project @ 2006-10-26 21:32:17 by jwe]
jwe
parents: 6061
diff changeset
597 *-*-cygwin* | *-*-mingw32* | *-*-msdosmsvc)
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
598 octave_possible_pagers="$octave_possible_pagers more.com"
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
599 ;;
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
600 esac
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
601
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
602 AC_CHECK_PROGS(DEFAULT_PAGER, $octave_possible_pagers, [])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
603 if test -z "$DEFAULT_PAGER"; then
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
604 warn_less="I couldn't find \`less', \`more', \`page', or \`pg'"
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
605 OCTAVE_CONFIGURE_WARNING([warn_less])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
606 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
607 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
608 ])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
609 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
610 dnl Check for gnuplot.
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
611 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
612 AC_DEFUN([OCTAVE_PROG_GNUPLOT], [
9865
763906db555e acinclude.m4: update gnuplot and ghostscript program checks for Windows
Tatsu@Inspiron6000
parents: 9805
diff changeset
613 gp_names="gnuplot"
763906db555e acinclude.m4: update gnuplot and ghostscript program checks for Windows
Tatsu@Inspiron6000
parents: 9805
diff changeset
614 gp_default="gnuplot"
4098
8496ae60db8a [project @ 2002-10-10 05:20:20 by jwe]
jwe
parents: 4095
diff changeset
615 if test "$cross_compiling" = yes; then
7361
a2870fd8ac58 [project @ 2008-01-12 07:50:54 by jwe]
jwe
parents: 7244
diff changeset
616 GNUPLOT="$gp_default"
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
617 AC_MSG_RESULT([assuming $GNUPLOT exists on $canonical_host_type host])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
618 else
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
619 AC_CHECK_PROGS(GNUPLOT, [$gp_names])
7361
a2870fd8ac58 [project @ 2008-01-12 07:50:54 by jwe]
jwe
parents: 7244
diff changeset
620 if test -z "$GNUPLOT"; then
a2870fd8ac58 [project @ 2008-01-12 07:50:54 by jwe]
jwe
parents: 7244
diff changeset
621 GNUPLOT="$gp_default"
15013
c753ee228708 acinclude.m4: generate gnuplot warning message correctly (fixing bug from revision 8a84849ad986)
Carnë Draug <carandraug+dev@gmail.com>
parents: 14994
diff changeset
622 warn_gnuplot="
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
623
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
624 gnuplot not found. It isn't necessary to have gnuplot installed, but
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
625 without native graphics or gnuplot you won't be able to use any of
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
626 Octave's plotting commands.
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
627 "
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
628 OCTAVE_CONFIGURE_WARNING([warn_gnuplot])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
629 fi
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
630 fi
7361
a2870fd8ac58 [project @ 2008-01-12 07:50:54 by jwe]
jwe
parents: 7244
diff changeset
631 AC_SUBST(GNUPLOT)
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
632 ])
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
633 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
634 dnl Check for gperf.
3673
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
635 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
636 AC_DEFUN([OCTAVE_PROG_GPERF], [
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
637 AC_CHECK_PROG(GPERF, gperf, gperf, [])
8775
a2a9dc5e8565 octave.gperf: eliminate whitespace to allow gperf 2.7.2 to work
John W. Eaton <jwe@octave.org>
parents: 8724
diff changeset
638 if test -z "$GPERF"; then
14419
2258a0b73eb8 Fix path to missing helper script
Mike Miller <mtmiller@ieee.org>
parents: 14315
diff changeset
639 GPERF='$(top_srcdir)/build-aux/missing gperf'
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
640 warn_gperf="
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
641
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
642 I didn't find gperf, but it's only a problem if you need to
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
643 reconstruct oct-gperf.h
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
644 "
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
645 OCTAVE_CONFIGURE_WARNING([warn_gperf])
3731
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
646 fi
c06bae7229cf [project @ 2000-10-31 20:03:19 by jwe]
jwe
parents: 3729
diff changeset
647 AC_SUBST(GPERF)
3673
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
648 ])
e0b46234555e [project @ 2000-06-05 18:28:54 by jwe]
jwe
parents: 3506
diff changeset
649 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
650 dnl Check for ghostscript.
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
651 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
652 AC_DEFUN([OCTAVE_PROG_GHOSTSCRIPT], [
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
653 case "$canonical_host_type" in
9865
763906db555e acinclude.m4: update gnuplot and ghostscript program checks for Windows
Tatsu@Inspiron6000
parents: 9805
diff changeset
654 *-*-mingw* | *-*-msdosmsvc)
13728
47f803279384 Allow to use MiKTeX ghostscript.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 12733
diff changeset
655 gs_names="gswin32c gs mgs"
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
656 ;;
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
657 *)
9865
763906db555e acinclude.m4: update gnuplot and ghostscript program checks for Windows
Tatsu@Inspiron6000
parents: 9805
diff changeset
658 gs_names="gs"
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
659 ;;
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
660 esac
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
661 AC_CHECK_PROGS(GHOSTSCRIPT, [$gs_names])
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
662 if test -z "$GHOSTSCRIPT"; then
14419
2258a0b73eb8 Fix path to missing helper script
Mike Miller <mtmiller@ieee.org>
parents: 14315
diff changeset
663 GHOSTSCRIPT='$(top_srcdir)/build-aux/missing gs'
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
664 warn_ghostscript="
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
665
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
666 I didn't find ghostscript, so reconstructing figures for the manual
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
667 will fail, and saving graphics in some output formats will fail when
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
668 using Octave
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
669 "
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
670
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
671 OCTAVE_CONFIGURE_WARNING([warn_ghostscript])
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
672 fi
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
673 AC_SUBST(GHOSTSCRIPT)
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
674 ])
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
675 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
676 dnl Check for makeinfo.
15126
25200c04bc25 configure.ac: Require makeinfo to be present before building Octave.
Rik <rik@octave.org>
parents: 15063
diff changeset
677 dnl
25200c04bc25 configure.ac: Require makeinfo to be present before building Octave.
Rik <rik@octave.org>
parents: 15063
diff changeset
678 AC_DEFUN([OCTAVE_PROG_MAKEINFO],
25200c04bc25 configure.ac: Require makeinfo to be present before building Octave.
Rik <rik@octave.org>
parents: 15063
diff changeset
679 dnl use MKINFO, not MAKEINFO, for variable name because Automake automatically
25200c04bc25 configure.ac: Require makeinfo to be present before building Octave.
Rik <rik@octave.org>
parents: 15063
diff changeset
680 dnl defines a value for MAKEINFO even when it does not exist which will then
25200c04bc25 configure.ac: Require makeinfo to be present before building Octave.
Rik <rik@octave.org>
parents: 15063
diff changeset
681 dnl fool the 'test -z' line.
25200c04bc25 configure.ac: Require makeinfo to be present before building Octave.
Rik <rik@octave.org>
parents: 15063
diff changeset
682 [AC_CHECK_PROG(MKINFO, makeinfo, makeinfo, [])
25200c04bc25 configure.ac: Require makeinfo to be present before building Octave.
Rik <rik@octave.org>
parents: 15063
diff changeset
683 if test -z "$MKINFO"; then
25200c04bc25 configure.ac: Require makeinfo to be present before building Octave.
Rik <rik@octave.org>
parents: 15063
diff changeset
684 AC_MSG_ERROR([makeinfo program required for reading documentation])
25200c04bc25 configure.ac: Require makeinfo to be present before building Octave.
Rik <rik@octave.org>
parents: 15063
diff changeset
685 fi
25200c04bc25 configure.ac: Require makeinfo to be present before building Octave.
Rik <rik@octave.org>
parents: 15063
diff changeset
686 ])
25200c04bc25 configure.ac: Require makeinfo to be present before building Octave.
Rik <rik@octave.org>
parents: 15063
diff changeset
687 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
688 dnl Check for texi2dvi.
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
689 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
690 AC_DEFUN([OCTAVE_PROG_TEXI2DVI], [
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
691 AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, [])
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
692 if test -z "$TEXI2DVI"; then
14419
2258a0b73eb8 Fix path to missing helper script
Mike Miller <mtmiller@ieee.org>
parents: 14315
diff changeset
693 TEXI2DVI='$(top_srcdir)/build-aux/missing texi2dvi'
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
694 warn_texi2dvi="
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
695
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
696 I didn't find texi2dvi, but it's only a problem if you need to
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
697 reconstruct the DVI version of the manual
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
698 "
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
699 OCTAVE_CONFIGURE_WARNING([warn_texi2dvi])
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
700 fi
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
701 AC_SUBST(TEXI2DVI)
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
702 ])
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
703 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
704 dnl Check for texi2pdf.
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
705 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
706 AC_DEFUN([OCTAVE_PROG_TEXI2PDF], [
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
707 AC_REQUIRE([OCTAVE_PROG_TEXI2DVI])
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
708 AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, [])
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
709 if test -z "$TEXI2PDF"; then
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
710 missing=true;
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
711 if test -n "$TEXI2DVI"; then
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
712 TEXI2PDF="$TEXI2DVI --pdf"
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
713 missing=false;
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
714 fi
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
715 else
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
716 missing=false;
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
717 fi
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6104
diff changeset
718 if $missing; then
14419
2258a0b73eb8 Fix path to missing helper script
Mike Miller <mtmiller@ieee.org>
parents: 14315
diff changeset
719 TEXI2PDF='$(top_srcdir)/build-aux/missing texi2pdf'
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
720 warn_texi2pdf="
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
721
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
722 I didn't find texi2pdf, but it's only a problem if you need to
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
723 reconstruct the PDF version of the manual
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
724 "
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
725 OCTAVE_CONFIGURE_WARNING([warn_texi2pdf])
5934
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
726 fi
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
727 AC_SUBST(TEXI2PDF)
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
728 ])
8702f00329bf [project @ 2006-08-17 20:29:51 by jwe]
jwe
parents: 5854
diff changeset
729 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
730 dnl Check if the C++ library is ISO compliant.
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
731 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
732 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
733 AC_DEFUN([OCTAVE_CXX_ISO_COMPLIANT_LIBRARY], [
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
734 AC_REQUIRE([AC_PROG_CXX])
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
735 AC_MSG_CHECKING([if C++ library is ISO compliant])
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
736 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
737 AC_LANG_PUSH(C++)
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
738 rm -f conftest.h
3943
a10df4059532 [project @ 2002-05-16 22:31:35 by jwe]
jwe
parents: 3908
diff changeset
739 ### Omitting cwctype for now, since it is broken with gcc-3.0.x and
a10df4059532 [project @ 2002-05-16 22:31:35 by jwe]
jwe
parents: 3908
diff changeset
740 ### possibly other versions...
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
741 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
742 climits clocale cmath complex csetjmp csignal cstdarg cstddef \
3943
a10df4059532 [project @ 2002-05-16 22:31:35 by jwe]
jwe
parents: 3908
diff changeset
743 cstdio cstdlib cstring ctime cwchar deque exception \
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
744 fstream functional iomanip ios iosfwd iostream istream iterator \
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
745 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
746 sstream stack stdexcept streambuf string strstream typeinfo \
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
747 utility valarray vector; do
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
748 echo "#include <$inc>" >> conftest.h
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
749 done
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
750 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "conftest.h"]],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
751 [[std::bitset<50> flags;
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
752 flags.set();
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
753 int digits = std::numeric_limits<unsigned long>::digits;
5842
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
754 digits = 0;]])],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
755 [octave_cv_cxx_iso_compliant_library=yes],
ecb61a521d5b [project @ 2006-06-06 15:03:33 by jwe]
jwe
parents: 5775
diff changeset
756 [octave_cv_cxx_iso_compliant_library=no])
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
757 AC_LANG_POP(C++)
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
758 ])
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
759 AC_MSG_RESULT([$octave_cv_cxx_iso_compliant_library])
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
760 if test $octave_cv_cxx_iso_compliant_library = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
761 AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY, 1, [Define to 1 if your C++ runtime library is ISO compliant.])
3769
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
762 fi
7c8e3c42ed04 [project @ 2001-01-31 22:15:51 by jwe]
jwe
parents: 3750
diff changeset
763 ])
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
764 dnl
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
765 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
766 dnl readline.
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
767 dnl
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
768 dnl OCTAVE_ENABLE_READLINE
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
769 AC_DEFUN([OCTAVE_ENABLE_READLINE], [
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
770 USE_READLINE=true
9515
eee9b3150446 more configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9403
diff changeset
771 READLINE_LIBS=
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
772 AC_ARG_ENABLE(readline,
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
773 [ --enable-readline use readline library (default is yes)],
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
774 [if test "$enableval" = no; then
3824
0ee55719541a [project @ 2001-04-26 17:07:21 by jwe]
jwe
parents: 3822
diff changeset
775 USE_READLINE=false
3825
74255bd05bdd [project @ 2001-04-26 19:50:03 by jwe]
jwe
parents: 3824
diff changeset
776 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
777 fi])
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
778 if $USE_READLINE; then
9515
eee9b3150446 more configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9403
diff changeset
779 save_LIBS="$LIBS"
eee9b3150446 more configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9403
diff changeset
780 LIBS="$TERM_LIBS"
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
781 AC_CHECK_LIB(readline, rl_set_keyboard_input_timeout, [
9515
eee9b3150446 more configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9403
diff changeset
782 READLINE_LIBS="-lreadline"
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
783 AC_DEFINE(USE_READLINE, 1, [Define to 1 to use the readline library.])
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
784 ], [
3824
0ee55719541a [project @ 2001-04-26 17:07:21 by jwe]
jwe
parents: 3822
diff changeset
785 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
786 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
787 ])
9515
eee9b3150446 more configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9403
diff changeset
788 LIBS="$save_LIBS"
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
789 fi
9515
eee9b3150446 more configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9403
diff changeset
790 AC_SUBST(READLINE_LIBS)
3822
1a809dae77db [project @ 2001-04-26 16:07:17 by jwe]
jwe
parents: 3769
diff changeset
791 ])
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3835
diff changeset
792 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
793 dnl Check if C++ reinterpret cast works for function pointers.
5854
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
794 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
795 AC_DEFUN([OCTAVE_CXX_BROKEN_REINTERPRET_CAST], [
5854
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
796 AC_REQUIRE([AC_PROG_CXX])
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
797 AC_LANG_PUSH(C++)
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
798 AC_CACHE_CHECK([for broken C++ reinterpret_cast],
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
799 octave_cv_cxx_broken_reinterpret_cast, [
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
800 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cmath>]], [[
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
801 typedef double (*fptr) (double);
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
802 fptr psin = sin;
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
803 void *vptr = reinterpret_cast<void *> (psin);
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
804 psin = reinterpret_cast<fptr> (vptr);]])],
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
805 octave_cv_cxx_broken_reinterpret_cast=no,
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
806 octave_cv_cxx_broken_reinterpret_cast=yes)])
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
807 if test $octave_cv_cxx_broken_reinterpret_cast = yes ; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
808 AC_DEFINE(CXX_BROKEN_REINTERPRET_CAST, 1, [Define to 1 if C++ reinterpret_cast fails for function pointers.])
5854
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
809 fi
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
810 AC_LANG_POP(C++)])
68f8017ef077 [project @ 2006-06-12 15:54:27 by jwe]
jwe
parents: 5844
diff changeset
811 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
812 dnl Find find program.
7244
5a9561046b89 [project @ 2007-12-04 02:27:27 by jwe]
jwe
parents: 7063
diff changeset
813 dnl
5a9561046b89 [project @ 2007-12-04 02:27:27 by jwe]
jwe
parents: 7063
diff changeset
814 # Prefer GNU find if found.
5a9561046b89 [project @ 2007-12-04 02:27:27 by jwe]
jwe
parents: 7063
diff changeset
815 AN_MAKEVAR([FIND], [OCTAVE_PROG_FIND])
5a9561046b89 [project @ 2007-12-04 02:27:27 by jwe]
jwe
parents: 7063
diff changeset
816 AN_PROGRAM([gfind], [OCTAVE_PROG_FIND])
5a9561046b89 [project @ 2007-12-04 02:27:27 by jwe]
jwe
parents: 7063
diff changeset
817 AN_PROGRAM([find], [OCTAVE_PROG_FIND])
5a9561046b89 [project @ 2007-12-04 02:27:27 by jwe]
jwe
parents: 7063
diff changeset
818 AC_DEFUN([OCTAVE_PROG_FIND],
5a9561046b89 [project @ 2007-12-04 02:27:27 by jwe]
jwe
parents: 7063
diff changeset
819 [AC_CHECK_PROGS(FIND, gfind find, )])
5a9561046b89 [project @ 2007-12-04 02:27:27 by jwe]
jwe
parents: 7063
diff changeset
820 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
821 dnl Find sed program.
7244
5a9561046b89 [project @ 2007-12-04 02:27:27 by jwe]
jwe
parents: 7063
diff changeset
822 dnl
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
823 # Check for a fully-functional sed program, that truncates
6955
4aef2ca14cf9 [project @ 2007-10-04 16:38:11 by jwe]
jwe
parents: 6941
diff changeset
824 # as few characters as possible and that supports "\(X\|Y\)"
4aef2ca14cf9 [project @ 2007-10-04 16:38:11 by jwe]
jwe
parents: 6941
diff changeset
825 # style regular expression alternation. Prefer GNU sed if found.
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
826 AC_DEFUN([OCTAVE_PROG_SED],
6955
4aef2ca14cf9 [project @ 2007-10-04 16:38:11 by jwe]
jwe
parents: 6941
diff changeset
827 [AC_MSG_CHECKING([for a usable sed])
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
828 if test -z "$SED"; then
6822
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
829 AC_CACHE_VAL(ac_cv_path_sed, [
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
830 # Loop through the user's path and test for sed and gsed.
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
831 # Then use that list of sed's as ones to test for truncation.
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
832 _AS_PATH_WALK([$PATH],
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
833 [for ac_prog in sed gsed; do
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
834 for ac_exec_ext in '' $ac_executable_extensions; do
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
835 if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
836 _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
837 fi
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
838 done
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
839 done
6822
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
840 ])
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
841 AS_TMPDIR(sed)
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
842 _max=0
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
843 _count=0
6822
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
844 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
845 # along with /bin/sed that truncates output.
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
846 for _sed in $_sed_list /usr/xpg4/bin/sed; do
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
847 test ! -f ${_sed} && break
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
848 cat /dev/null > "$tmp/sed.in"
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
849 _count=0
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
850 echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in"
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
851 # Check for GNU sed and select it if it is found.
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
852 if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
853 octave_cv_path_sed=${_sed}
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
854 break;
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
855 fi
6955
4aef2ca14cf9 [project @ 2007-10-04 16:38:11 by jwe]
jwe
parents: 6941
diff changeset
856 # Reject if RE alternation is not handled.
4aef2ca14cf9 [project @ 2007-10-04 16:38:11 by jwe]
jwe
parents: 6941
diff changeset
857 if test "`echo 'this and that' | ${_sed} -n 's/\(this\|that\).*$/\1/p'`" != "this"; then
4aef2ca14cf9 [project @ 2007-10-04 16:38:11 by jwe]
jwe
parents: 6941
diff changeset
858 continue;
4aef2ca14cf9 [project @ 2007-10-04 16:38:11 by jwe]
jwe
parents: 6941
diff changeset
859 fi
6822
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
860 while true; do
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
861 cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
862 mv "$tmp/sed.tmp" "$tmp/sed.in"
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
863 cp "$tmp/sed.in" "$tmp/sed.nl"
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
864 echo >>"$tmp/sed.nl"
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
865 ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
866 cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
867 # 10000 chars as input seems more than enough
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
868 test $_count -gt 10 && break
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
869 _count=`expr $_count + 1`
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
870 if test $_count -gt $_max; then
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
871 _max=$_count
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
872 octave_cv_path_sed=$_sed
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
873 fi
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
874 done
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
875 done
6822
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
876 rm -rf "$tmp"
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
877 ])
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
878 SED=$octave_cv_path_sed
8004
4363bc94171a aclocal.m4 (OCTAVE_PROG_SED): fail if no usable sed is found
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
879 if test -z "$SED"; then
4363bc94171a aclocal.m4 (OCTAVE_PROG_SED): fail if no usable sed is found
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
880 AC_MSG_ERROR([no usable version of sed found])
4363bc94171a aclocal.m4 (OCTAVE_PROG_SED): fail if no usable sed is found
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
881 fi
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
882 fi
6822
5c4702203cc4 [project @ 2007-08-23 19:43:07 by jwe]
jwe
parents: 6821
diff changeset
883 AC_SUBST(SED)
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
884 AC_MSG_RESULT([$SED])
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 4067
diff changeset
885 ])
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents: 5307
diff changeset
886 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
887 dnl Find Perl program.
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents: 5307
diff changeset
888 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
889 AC_DEFUN([OCTAVE_PROG_PERL],
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
890 [AC_CHECK_PROG(PERL, perl, perl, [])
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents: 5307
diff changeset
891 AC_SUBST(PERL)
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents: 5307
diff changeset
892 ])
5468
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
893 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
894 dnl Find Python program.
5495
71c9d4a6a843 [project @ 2005-10-14 07:29:26 by jwe]
jwe
parents: 5468
diff changeset
895 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
896 AC_DEFUN([OCTAVE_PROG_PYTHON],
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
897 [AC_CHECK_PROG(PYTHON, python, python, [])
5495
71c9d4a6a843 [project @ 2005-10-14 07:29:26 by jwe]
jwe
parents: 5468
diff changeset
898 AC_SUBST(PYTHON)
71c9d4a6a843 [project @ 2005-10-14 07:29:26 by jwe]
jwe
parents: 5468
diff changeset
899 ])
71c9d4a6a843 [project @ 2005-10-14 07:29:26 by jwe]
jwe
parents: 5468
diff changeset
900 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
901 dnl Find desktop-file-install program.
5468
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
902 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
903 AC_DEFUN([OCTAVE_PROG_DESKTOP_FILE_INSTALL],
6119
fabb1be5fd84 [project @ 2006-10-28 00:13:58 by jwe]
jwe
parents: 6116
diff changeset
904 [AC_CHECK_PROG(DESKTOP_FILE_INSTALL, desktop-file-install, desktop-file-install, [])
5468
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
905 AC_SUBST(DESKTOP_FILE_INSTALL)
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
906 ])
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
907 dnl
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
908 dnl Check for IEEE 754 data format.
41943dd8d7d8 [project @ 2005-09-23 18:34:46 by jwe]
jwe
parents: 5465
diff changeset
909 dnl
4853
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
910 AC_DEFUN([OCTAVE_IEEE754_DATA_FORMAT],
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
911 [AC_MSG_CHECKING([for IEEE 754 data format])
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
912 AC_CACHE_VAL(octave_cv_ieee754_data_format,
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
913 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
4853
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
914 int
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
915 main (void)
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
916 {
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
917 typedef union { unsigned char c[8]; double d; } ieeebytes;
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
918
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
919 ieeebytes l = {0x1c, 0xbc, 0x6e, 0xf2, 0x54, 0x8b, 0x11, 0x43};
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
920 ieeebytes b = {0x43, 0x11, 0x8b, 0x54, 0xf2, 0x6e, 0xbc, 0x1c};
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
921
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
922 return l.d != 1234567891234567.0 && b.d != 1234567891234567.0;
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
923 }]])],
4853
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
924 octave_cv_ieee754_data_format=yes,
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
925 octave_cv_ieee754_data_format=no,
13957
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
926 octave_cv_ieee754_data_format=yes)])
4853
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
927 if test "$cross_compiling" = yes; then
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
928 AC_MSG_RESULT([$octave_cv_ieee754_data_format assumed for cross compilation])
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
929 else
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
930 AC_MSG_RESULT([$octave_cv_ieee754_data_format])
4853
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
931 fi
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
932 if test "$octave_cv_ieee754_data_format" = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
933 AC_DEFINE(HAVE_IEEE754_DATA_FORMAT, 1, [Define to 1 if your system uses IEEE 754 data format.])
9805
bb70d16cca3b fail at configure time if IEEE floating point format is not detected
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
934 else
bb70d16cca3b fail at configure time if IEEE floating point format is not detected
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
935 ## If the format is unknown, then you will probably not have a
bb70d16cca3b fail at configure time if IEEE floating point format is not detected
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
936 ## useful system, so we will abort here. Anyone wishing to
bb70d16cca3b fail at configure time if IEEE floating point format is not detected
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
937 ## experiment with building Octave on a system without IEEE
bb70d16cca3b fail at configure time if IEEE floating point format is not detected
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
938 ## floating point should be capable of removing this check and
bb70d16cca3b fail at configure time if IEEE floating point format is not detected
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
939 ## the one in the octave_ieee_init function in liboctave/lo-ieee.cc.
bb70d16cca3b fail at configure time if IEEE floating point format is not detected
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
940 AC_MSG_ERROR([IEEE 754 data format required for building Octave])
4853
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
941 fi
66b3cce2bf37 [project @ 2004-04-06 18:11:52 by jwe]
jwe
parents: 4685
diff changeset
942 ])
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
943 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
944 dnl Check for UMFPACK separately split complex matrix and RHS. Note
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
945 dnl that as umfpack.h can be in three different places, rather than
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
946 dnl include it, just declare the functions needed.
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
947 dnl
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
948 dnl Assumes that the check for umfpack has already been performed.
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
949 dnl
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
950 AC_DEFUN([OCTAVE_UMFPACK_SEPERATE_SPLIT],
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
951 [AC_MSG_CHECKING([for UMFPACK seperate complex matrix and rhs split])
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
952 AC_CACHE_VAL(octave_cv_umfpack_seperate_split,
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
953 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
954 #include <stdlib.h>
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
955 #if defined (HAVE_UFSPARSE_UMFPACK_h)
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
956 #include <ufsparse/umfpack.h>
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
957 #elif defined (HAVE_UMFPACK_UMFPACK_H)
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
958 #include <umfpack/umfpack.h>
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
959 #elif defined (HAVE_UMFPACK_H)
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
960 #include <umfpack.h>
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5505
diff changeset
961 #endif
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
962 int n = 5;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
963 int Ap[] = {0, 2, 5, 9, 10, 12};
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
964 int Ai[] = {0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4};
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
965 double Ax[] = {2., 0., 3., 0., 3., 0., -1., 0., 4., 0., 4., 0.,
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
966 -3., 0., 1., 0., 2., 0., 2., 0., 6., 0., 1., 0.};
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
967 double br[] = {8., 45., -3., 3., 19.};
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
968 double bi[] = {0., 0., 0., 0., 0.};
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
969 int main (void)
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
970 {
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
971 double *null = (double *) NULL ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
972 double *x = (double *)malloc (2 * n * sizeof(double));
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
973 int i ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
974 void *Symbolic, *Numeric ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
975 (void) umfpack_zi_symbolic (n, n, Ap, Ai, Ax, null, &Symbolic, null, null) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
976 (void) umfpack_zi_numeric (Ap, Ai, Ax, null, Symbolic, &Numeric, null, null) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
977 umfpack_zi_free_symbolic (&Symbolic) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
978 (void) umfpack_zi_solve (0, Ap, Ai, Ax, null, x, null, br, bi,
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
979 Numeric, null, null) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
980 umfpack_zi_free_numeric (&Numeric) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
981 for (i = 0; i < n; i++, x+=2)
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
982 if (fabs(*x - i - 1.) > 1.e-13)
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
983 return (1);
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
984 return (0) ;
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
985 }
5844
034cdbd34c0a [project @ 2006-06-07 15:38:58 by jwe]
jwe
parents: 5842
diff changeset
986 ]])],
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
987 octave_cv_umfpack_seperate_split=yes,
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
988 octave_cv_umfpack_seperate_split=no,
13957
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
989 octave_cv_umfpack_seperate_split=yes)])
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
990 if test "$cross_compiling" = yes; then
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
991 AC_MSG_RESULT([$octave_cv_umfpack_seperate_split assumed for cross compilation])
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
992 else
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
993 AC_MSG_RESULT([$octave_cv_umfpack_seperate_split])
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
994 fi
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
995 if test "$octave_cv_umfpack_seperate_split" = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
996 AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1, [Define to 1 if the UMFPACK Complex solver allow matrix and RHS to be split independently.])
5505
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
997 fi
17682e3fba2a [project @ 2005-10-21 12:30:29 by jwe]
jwe
parents: 5495
diff changeset
998 ])
6276
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
999 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1000 dnl Check whether using HDF5 DLL under Windows. This is done by
6276
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1001 dnl testing for a data symbol in the HDF5 library, which would
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1002 dnl require the definition of _HDF5USEDL_ under MSVC compiler.
6276
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1003 dnl
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1004 AC_DEFUN([OCTAVE_HDF5_DLL], [
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1005 AC_CACHE_CHECK([if _HDF5USEDLL_ needs to be defined],octave_cv_hdf5_dll, [
6724
388747e3d96b [project @ 2007-06-14 17:04:52 by jwe]
jwe
parents: 6276
diff changeset
1006 AC_TRY_LINK([#include <hdf5.h>], [hid_t x = H5T_NATIVE_DOUBLE; return x],
6276
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1007 octave_cv_hdf5_dll=no, [
9531
b859079d1644 configure and Makefile fixes for Windows
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9525
diff changeset
1008 save_CFLAGS="$CFLAGS"
6276
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1009 CFLAGS="$CFLAGS -DWIN32 -D_HDF5USEDLL_"
9531
b859079d1644 configure and Makefile fixes for Windows
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9525
diff changeset
1010 save_LIBS="$LIBS"
b859079d1644 configure and Makefile fixes for Windows
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9525
diff changeset
1011 LIBS="$HDF5_LIBS $LIBS"
6724
388747e3d96b [project @ 2007-06-14 17:04:52 by jwe]
jwe
parents: 6276
diff changeset
1012 AC_TRY_LINK([#include <hdf5.h>], [hid_t x = H5T_NATIVE_DOUBLE; return x],
6276
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1013 octave_cv_hdf5_dll=yes,
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1014 octave_cv_hdf5_dll=no)
9531
b859079d1644 configure and Makefile fixes for Windows
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9525
diff changeset
1015 CFLAGS="$save_CFLAGS"
b859079d1644 configure and Makefile fixes for Windows
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9525
diff changeset
1016 LIBS="$save_LIBS"])])
6276
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1017 if test "$octave_cv_hdf5_dll" = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1018 AC_DEFINE(_HDF5USEDLL_, 1, [Define to 1 if using HDF5 dll (Win32).])
6276
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6119
diff changeset
1019 fi])
6823
9fddcc586065 [project @ 2007-08-24 08:27:27 by dbateman]
dbateman
parents: 6822
diff changeset
1020 dnl
8676
22462fd58e66 require HDF5 v1.6 API
John W. Eaton <jwe@octave.org>
parents: 8659
diff changeset
1021 dnl Check whether HDF5 library has version 1.6 API functions.
22462fd58e66 require HDF5 v1.6 API
John W. Eaton <jwe@octave.org>
parents: 8659
diff changeset
1022 dnl
9892
ac69e6f4b33d Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents: 9865
diff changeset
1023 AC_DEFUN([OCTAVE_HDF5_HAS_ENFORCED_16_API], [
ac69e6f4b33d Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents: 9865
diff changeset
1024 AC_CACHE_CHECK([whether HDF5 library has enforced version 1.6 API],
ac69e6f4b33d Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents: 9865
diff changeset
1025 octave_cv_hdf5_has_enforced_16_api, [
8676
22462fd58e66 require HDF5 v1.6 API
John W. Eaton <jwe@octave.org>
parents: 8659
diff changeset
1026 AC_TRY_LINK([
22462fd58e66 require HDF5 v1.6 API
John W. Eaton <jwe@octave.org>
parents: 8659
diff changeset
1027 #include <hdf5.h>
22462fd58e66 require HDF5 v1.6 API
John W. Eaton <jwe@octave.org>
parents: 8659
diff changeset
1028 ], [
22462fd58e66 require HDF5 v1.6 API
John W. Eaton <jwe@octave.org>
parents: 8659
diff changeset
1029 H5Eset_auto (0, 0);], [
9892
ac69e6f4b33d Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents: 9865
diff changeset
1030 octave_cv_hdf5_has_enforced_16_api=yes], [
ac69e6f4b33d Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents: 9865
diff changeset
1031 octave_cv_hdf5_has_enforced_16_api=no])])
ac69e6f4b33d Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents: 9865
diff changeset
1032 if test "$octave_cv_hdf5_has_enforced_16_api" != "yes"; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1033 AC_DEFINE(HAVE_HDF5_18, 1, [Define to 1 if >=HDF5-1.8 is available.])
8676
22462fd58e66 require HDF5 v1.6 API
John W. Eaton <jwe@octave.org>
parents: 8659
diff changeset
1034 fi
22462fd58e66 require HDF5 v1.6 API
John W. Eaton <jwe@octave.org>
parents: 8659
diff changeset
1035 ])
22462fd58e66 require HDF5 v1.6 API
John W. Eaton <jwe@octave.org>
parents: 8659
diff changeset
1036 dnl
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1037 dnl Check for the Qhull version.
6823
9fddcc586065 [project @ 2007-08-24 08:27:27 by dbateman]
dbateman
parents: 6822
diff changeset
1038 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
1039 AC_DEFUN([OCTAVE_CHECK_QHULL_VERSION],
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1040 [AC_CACHE_CHECK([for qh_version in $QHULL_LIBS],
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1041 octave_cv_lib_qhull_version, [
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1042 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
14043
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1043 #include <stdio.h>
14315
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1044 #if defined (HAVE_LIBQHULL_LIBQHULL_H)
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1045 # include <libqhull/libqhull.h>
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1046 # include <libqhull/qset.h>
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1047 # include <libqhull/geom.h>
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1048 # include <libqhull/poly.h>
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1049 # include <libqhull/io.h>
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1050 #elif defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
14043
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1051 # if defined (HAVE_QHULL_LIBQHULL_H)
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1052 # include <qhull/libqhull.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1053 # else
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1054 # include <qhull/qhull.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1055 # endif
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1056 # include <qhull/qset.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1057 # include <qhull/geom.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1058 # include <qhull/poly.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1059 # include <qhull/io.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1060 #elif defined (HAVE_LIBQHULL_H) || defined (HAVE_QHULL_H)
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1061 # if defined (HAVE_LIBQHULL_H)
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1062 # include <libqhull.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1063 # else
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1064 # include <qhull.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1065 # endif
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1066 # include <qset.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1067 # include <geom.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1068 # include <poly.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1069 # include <io.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1070 #endif
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1071 ]], [[
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1072 const char *tmp = qh_version;
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1073 ]])], [octave_cv_lib_qhull_version=yes], [octave_cv_lib_qhull_version=no])])
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1074 if test "$octave_cv_lib_qhull_version" = no; then
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1075 AC_DEFINE(NEED_QHULL_VERSION, 1,
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1076 [Define to 1 if the Qhull library needs a qh_version variable defined.])
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1077 fi
6823
9fddcc586065 [project @ 2007-08-24 08:27:27 by dbateman]
dbateman
parents: 6822
diff changeset
1078 ])
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1079 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1080 dnl Check whether Qhull works (does not crash).
8659
9792c26bffc7 configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents: 8635
diff changeset
1081 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
1082 AC_DEFUN([OCTAVE_CHECK_QHULL_OK],
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1083 [AC_CACHE_CHECK([whether the qhull library works],
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1084 octave_cv_lib_qhull_ok, [
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1085 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
8659
9792c26bffc7 configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents: 8635
diff changeset
1086 #include <stdio.h>
14315
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1087 #if defined (HAVE_LIBQHULL_LIBQHULL_H)
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1088 # include <libqhull/libqhull.h>
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1089 # include <libqhull/qset.h>
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1090 # include <libqhull/geom.h>
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1091 # include <libqhull/poly.h>
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1092 # include <libqhull/io.h>
99428221b4e1 build: Add new location for Qhull2012 include files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14147
diff changeset
1093 #elif defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
14043
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1094 # if defined (HAVE_QHULL_LIBQHULL_H)
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1095 # include <qhull/libqhull.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1096 # else
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1097 # include <qhull/qhull.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1098 # endif
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1099 # include <qhull/qset.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1100 # include <qhull/geom.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1101 # include <qhull/poly.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1102 # include <qhull/io.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1103 #elif defined (HAVE_LIBQHULL_H) || defined (HAVE_QHULL_H)
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1104 # if defined (HAVE_LIBQHULL_H)
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1105 # include <libqhull.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1106 # else
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1107 # include <qhull.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1108 # endif
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1109 # include <qset.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1110 # include <geom.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1111 # include <poly.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1112 # include <io.h>
f913363318e0 handle new names and locations of qhull include files (bug #33712)
John W. Eaton <jwe@octave.org>
parents: 13957
diff changeset
1113 #endif
8659
9792c26bffc7 configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents: 8635
diff changeset
1114 #ifdef NEED_QHULL_VERSION
9792c26bffc7 configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents: 8635
diff changeset
1115 char *qh_version = "version";
9792c26bffc7 configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents: 8635
diff changeset
1116 #endif
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1117 ]], [[
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1118 int dim = 2;
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1119 int n = 4;
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1120 coordT points[8] = { -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5 };
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1121 boolT ismalloc = 0;
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1122 return qh_new_qhull (dim, n, points, ismalloc, "qhull ", 0, stderr);
13957
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1123 ]])],
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1124 [octave_cv_lib_qhull_ok=yes],
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1125 [octave_cv_lib_qhull_ok=no],
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1126 [octave_cv_lib_qhull_ok=yes])])
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1127 if test "$octave_cv_lib_qhull_ok" = "yes"; then
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1128 $1
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1129 else
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1130 $2
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
1131 fi
8659
9792c26bffc7 configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents: 8635
diff changeset
1132 ])
9792c26bffc7 configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents: 8635
diff changeset
1133 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1134 dnl Check whether ARPACK works (does not crash).
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1135 dnl
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1136 dnl Using a pure Fortran program doesn't seem to crash when linked
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1137 dnl with the buggy ARPACK library but the C++ program does. Maybe it
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1138 dnl is the memory allocation that exposes the bug and using statically
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1139 dnl allocated arrays in Fortran does not?
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1140 dnl
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1141 AC_DEFUN([OCTAVE_CHECK_ARPACK_OK], [
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1142 AC_LANG_PUSH(C++)
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1143 AC_CACHE_CHECK([whether the arpack library works],
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1144 [octave_cv_lib_arpack_ok], [
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1145 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1146 // External functions from ARPACK library
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1147 extern "C" int
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1148 F77_FUNC (dnaupd, DNAUPD) (int&, const char *, const int&, const char *,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1149 int&, const double&, double*, const int&,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1150 double*, const int&, int*, int*, double*,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1151 double*, const int&, int&, long int, long int);
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1152
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1153 extern "C" int
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1154 F77_FUNC (dneupd, DNEUPD) (const int&, const char *, int*, double*,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1155 double*, double*, const int&,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1156 const double&, const double&, double*,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1157 const char*, const int&, const char *,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1158 int&, const double&, double*, const int&,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1159 double*, const int&, int*, int*, double*,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1160 double*, const int&, int&, long int,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1161 long int, long int);
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1162
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1163 extern "C" int
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1164 F77_FUNC (dgemv, DGEMV) (const char *, const int&, const int&,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1165 const double&, const double*, const int&,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1166 const double*, const int&, const double&,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1167 double*, const int&, long int);
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1168
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1169 #include <cfloat>
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1170
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1171 void
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1172 doit (void)
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1173 {
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1174 // Based on function EigsRealNonSymmetricMatrix from liboctave/eigs-base.cc.
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1175
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1176 // Problem matrix. See bug #31479
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1177 int n = 4;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1178 double *m = new double [n * n];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1179 m[0] = 1, m[4] = 0, m[8] = 0, m[12] = -1;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1180 m[1] = 0, m[5] = 1, m[9] = 0, m[13] = 0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1181 m[2] = 0, m[6] = 0, m[10] = 1, m[14] = 0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1182 m[3] = 0, m[7] = 0, m[11] = 2, m[15] = 1;
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1183
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1184 double *resid = new double [4];
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1185
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1186 resid[0] = 0.960966;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1187 resid[1] = 0.741195;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1188 resid[2] = 0.150143;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1189 resid[3] = 0.868067;
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1190
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1191 int *ip = new int [11];
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1192
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1193 ip[0] = 1; // ishift
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1194 ip[1] = 0; // ip[1] not referenced
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1195 ip[2] = 300; // mxiter, maximum number of iterations
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1196 ip[3] = 1; // NB blocksize in recurrence
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1197 ip[4] = 0; // nconv, number of Ritz values that satisfy convergence
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1198 ip[5] = 0; // ip[5] not referenced
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1199 ip[6] = 1; // mode
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1200 ip[7] = 0; // ip[7] to ip[10] are return values
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1201 ip[8] = 0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1202 ip[9] = 0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1203 ip[10] = 0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1204
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1205 int *ipntr = new int [14];
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1206
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1207 int k = 1;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1208 int p = 3;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1209 int lwork = 3 * p * (p + 2);
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1210
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1211 double *v = new double [n * (p + 1)];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1212 double *workl = new double [lwork + 1];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1213 double *workd = new double [3 * n + 1];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1214
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1215 int ido = 0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1216 int info = 0;
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1217
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1218 double tol = DBL_EPSILON;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1219
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1220 do
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1221 {
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1222 F77_FUNC (dnaupd, DNAUPD) (ido, "I", n, "LM", k, tol, resid, p,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1223 v, n, ip, ipntr, workd, workl, lwork,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1224 info, 1L, 2L);
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1225
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1226 if (ido == -1 || ido == 1 || ido == 2)
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1227 {
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1228 double *x = workd + ipntr[0] - 1;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1229 double *y = workd + ipntr[1] - 1;
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1230
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1231 F77_FUNC (dgemv, DGEMV) ("N", n, n, 1.0, m, n, x, 1, 0.0,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1232 y, 1, 1L);
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1233 }
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1234 else
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1235 {
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1236 if (info < 0)
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1237 {
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1238 return; // Error
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1239 }
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1240
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1241 break;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1242 }
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1243 }
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1244 while (1);
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1245
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1246 int *sel = new int [p];
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1247
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1248 // In Octave, the dimensions of dr and di are k+1, but k+2 avoids segfault
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1249 double *dr = new double [k + 1];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1250 double *di = new double [k + 1];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1251 double *workev = new double [3 * p];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1252
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1253 for (int i = 0; i < k + 1; i++)
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1254 dr[i] = di[i] = 0.;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1255
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1256 int rvec = 1;
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1257
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1258 double sigmar = 0.0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1259 double sigmai = 0.0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1260
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1261 // In Octave, this is n*(k+1), but k+2 avoids segfault
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1262 double *z = new double [n * (k + 1)];
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1263
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1264 F77_FUNC (dneupd, DNEUPD) (rvec, "A", sel, dr, di, z, n, sigmar,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1265 sigmai, workev, "I", n, "LM", k, tol,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1266 resid, p, v, n, ip, ipntr, workd,
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1267 workl, lwork, info, 1L, 1L, 2L);
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1268 }
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1269 ]], [[
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1270 for (int i = 0; i < 10; i++)
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1271 doit ();
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1272 ]])],
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1273 [octave_cv_lib_arpack_ok=yes],
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1274 [octave_cv_lib_arpack_ok=no],
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1275 [octave_cv_lib_arpack_ok=yes])])
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
1276 AC_LANG_POP(C++)
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1277 if test "$octave_cv_lib_arpack_ok" = "yes"; then
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1278 $1
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1279 else
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1280 $2
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1281 fi
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1282 ])
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
1283 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1284 dnl Check for OpenGL. If found, define OPENGL_LIBS.
12166
eceacb78aa7f don't add -L/usr/X11R6/lib to LDFLAGS in check for OpenGL libraries
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
1285 dnl
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1286 dnl FIXME: The following tests should probably check for the
12166
eceacb78aa7f don't add -L/usr/X11R6/lib to LDFLAGS in check for OpenGL libraries
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
1287 dnl libraries separately.
eceacb78aa7f don't add -L/usr/X11R6/lib to LDFLAGS in check for OpenGL libraries
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
1288 dnl
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1289 dnl FIXME: Should we allow a way to specify a directory for OpenGL
12166
eceacb78aa7f don't add -L/usr/X11R6/lib to LDFLAGS in check for OpenGL libraries
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
1290 dnl libraries and header files?
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1291 dnl
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1292 AC_DEFUN([OCTAVE_OPENGL], [
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1293 OPENGL_LIBS=
8724
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1294
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1295 ### On MacOSX systems the OpenGL framework can be used
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1296 OCTAVE_HAVE_FRAMEWORK(OpenGL, [
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1297 #include <OpenGL/gl.h>
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1298 #include <OpenGL/glu.h> ], [GLint par; glGetIntegerv (GL_VIEWPORT, &par);],
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1299 [have_framework_opengl="yes"], [have_framework_opengl="no"])
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1300
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1301 if test $have_framework_opengl = "yes"; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1302 AC_DEFINE(HAVE_FRAMEWORK_OPENGL, 1, [Define to 1 if framework OPENGL is available.])
8724
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1303 OPENGL_LIBS="-Wl,-framework -Wl,OpenGL"
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1304 AC_MSG_NOTICE([adding -Wl,-framework -Wl,OpenGL to OPENGL_LIBS])
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1305 OCTAVE_GLUTESSCALLBACK_THREEDOTS
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1306 else
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1307 case $canonical_host_type in
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1308 *-*-mingw32* | *-*-msdosmsvc)
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1309 AC_CHECK_HEADERS(windows.h)
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1310 ;;
8724
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1311 esac
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1312 have_opengl_incs=no
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1313 AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h], [
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1314 AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h], [
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1315 have_opengl_incs=yes; break], [], [
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1316 #ifdef HAVE_WINDOWS_H
7954
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
1317 #include <windows.h>
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
1318 #endif
8724
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1319 ])
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1320 break
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1321 ], [], [
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1322 #ifdef HAVE_WINDOWS_H
7954
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
1323 #include <windows.h>
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
1324 #endif
8724
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1325 ])
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1326
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1327 if test "$have_opengl_incs" = "yes"; then
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1328 case $canonical_host_type in
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1329 *-*-mingw32* | *-*-msdosmsvc)
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1330 save_LIBS="$LIBS"
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1331 LIBS="$LIBS -lopengl32"
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1332 AC_MSG_CHECKING([for glEnable in -lopengl32])
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1333 AC_TRY_LINK([
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1334 #if HAVE_WINDOWS_H
7954
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
1335 #include <windows.h>
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1336 #endif
7954
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
1337 #if defined (HAVE_GL_GL_H)
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
1338 #include <GL/gl.h>
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
1339 #elif defined (HAVE_OPENGL_GL_H)
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
1340 #include <OpenGL/gl.h>
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
1341 #endif
8724
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1342 ], [glEnable(GL_SMOOTH);], OPENGL_LIBS="-lopengl32 -lglu32")
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1343 LIBS="$save_LIBS"
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1344 if test "x$OPENGL_LIBS" != "x"; then
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1345 AC_MSG_RESULT(yes)
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1346 else
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1347 AC_MSG_RESULT(no)
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1348 fi
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1349 ;;
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1350 *)
12166
eceacb78aa7f don't add -L/usr/X11R6/lib to LDFLAGS in check for OpenGL libraries
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
1351 AC_CHECK_LIB(GL, glEnable, OPENGL_LIBS="-lGL -lGLU")
8724
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1352 ;;
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1353 esac
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1354 fi
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1355 fi
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1356 AC_SUBST(OPENGL_LIBS)
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1357 ])
7834
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1358 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1359 dnl Check if function gluTessCallback is called with "(...)".
8724
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1360 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
1361 AC_DEFUN([OCTAVE_GLUTESSCALLBACK_THREEDOTS],
8724
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1362 [AC_CACHE_CHECK([whether gluTessCallback is called with "(...)"],
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1363 octave_cv_glutesscallback_threedots,
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1364 [AC_LANG_PUSH(C++)
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1365 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1366 #ifdef HAVE_GL_GLU_H
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1367 #include <GL/glu.h>
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1368 #elif defined HAVE_OPENGL_GLU_H || defined HAVE_FRAMEWORK_OPENGL
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1369 #include <OpenGL/glu.h>
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1370 #endif]],
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1371 [[GLvoid (*func)(...); gluTessCallback(0, 0, func);]])],
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1372 octave_cv_glutesscallback_threedots="yes", octave_cv_glutesscallback_threedots="no")])
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1373 AC_LANG_POP(C++)
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1374 if test $octave_cv_glutesscallback_threedots = "yes"; then
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1375 AC_DEFINE(HAVE_GLUTESSCALLBACK_THREEDOTS, 1,
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1376 [Define to 1 if gluTessCallback is called with (...).])
8724
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1377 fi
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1378 ])
a50228129dba Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents: 8676
diff changeset
1379 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1380 dnl Check for support of OpenMP with a given compiler flag.
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1381 dnl If found define HAVE_OPENMP and add the compile flag
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1382 dnl to CFLAGS and CXXFLAGS.
10471
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1383 dnl
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1384 AC_DEFUN([OCTAVE_CHECK_OPENMP],
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1385 [AC_MSG_CHECKING([for support of OpenMP])
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1386 XCFLAGS="$CFLAGS"
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1387 CFLAGS="$CFLAGS $1"
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1388 AC_CACHE_VAL(octave_cv_check_openmp,[
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1389 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1390 #include <omp.h>
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1391 #include <stdio.h>
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1392 ]], [[
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1393 int main(int argc, char* argv[])
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1394 {
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1395 _Pragma("omp parallel")
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1396 printf("Hello, world.\n");
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1397 return 0;
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1398 }
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1399 ]])],octave_cv_openmp=yes, octave_cv_openmmp=no, octave_cv_openmp=no)])
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1400 AC_MSG_RESULT($octave_cv_openmp)
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1401 if test "$octave_cv_openmp" = yes; then
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1402 AC_DEFINE(HAVE_OPENMP,1,[Define to 1 if compiler supports OpenMP.])
10471
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1403 CXXFLAGS="$CXXFLAGS $1"
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1404 else
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1405 CFLAGS="$XCFLAGS"
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1406 fi
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1407 ])
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1408 dnl
7834
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1409 dnl Configure paths for FreeType2
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1410 dnl Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1411 dnl
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1412 dnl Copyright 2001, 2003 by
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1413 dnl David Turner, Robert Wilhelm, and Werner Lemberg.
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1414 dnl
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1415 dnl This file is part of the FreeType project, and may only be used, modified,
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1416 dnl and distributed under the terms of the FreeType project license,
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1417 dnl LICENSE.TXT. By continuing to use, modify, or distribute this file you
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1418 dnl indicate that you have read the license and understand and accept it
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1419 dnl fully.
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1420 dnl
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1421 dnl As a special exception to the FreeType project license, this file may be
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1422 dnl distributed as part of a program that contains a configuration script
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1423 dnl generated by Autoconf, under the same distribution terms as the rest of
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1424 dnl that program.
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1425 dnl
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1426 dnl serial 2
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1427 dnl
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1428 dnl AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1429 dnl Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS.
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1430 dnl MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1431 dnl FreeType 2.0.4).
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1432 dnl
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1433 AC_DEFUN([AC_CHECK_FT2],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1434 [dnl Get the cflags and libraries from the freetype-config script
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1435 dnl
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1436 AC_ARG_WITH([ft-prefix],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1437 dnl don't quote AS_HELP_STRING!
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1438 AS_HELP_STRING([--with-ft-prefix=PREFIX],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1439 [Prefix where FreeType is installed (optional)]),
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1440 [ft_config_prefix="$withval"],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1441 [ft_config_prefix=""])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1442
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1443 AC_ARG_WITH([ft-exec-prefix],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1444 dnl don't quote AS_HELP_STRING!
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1445 AS_HELP_STRING([--with-ft-exec-prefix=PREFIX],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1446 [Exec prefix where FreeType is installed (optional)]),
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1447 [ft_config_exec_prefix="$withval"],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1448 [ft_config_exec_prefix=""])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1449
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1450 AC_ARG_ENABLE([freetypetest],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1451 dnl don't quote AS_HELP_STRING!
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1452 AS_HELP_STRING([--disable-freetypetest],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1453 [Do not try to compile and run a test FreeType program]),
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1454 [],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1455 [enable_fttest=yes])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1456
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1457 if test x$ft_config_exec_prefix != x ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1458 ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1459 if test x${FT2_CONFIG+set} != xset ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1460 FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1461 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1462 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1463
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1464 if test x$ft_config_prefix != x ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1465 ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1466 if test x${FT2_CONFIG+set} != xset ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1467 FT2_CONFIG=$ft_config_prefix/bin/freetype-config
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1468 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1469 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1470
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1471 AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1472
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1473 min_ft_version=m4_if([$1], [], [7.0.1], [$1])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1474 AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1475 no_ft=""
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1476 if test "$FT2_CONFIG" = "no" ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1477 no_ft=yes
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1478 else
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1479 FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1480 FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1481 ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1482 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1483 ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1484 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1485 ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1486 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1487 ft_min_major_version=`echo $min_ft_version | \
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1488 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1489 ft_min_minor_version=`echo $min_ft_version | \
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1490 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1491 ft_min_micro_version=`echo $min_ft_version | \
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1492 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1493 if test x$enable_fttest = xyes ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1494 ft_config_is_lt=""
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1495 if test $ft_config_major_version -lt $ft_min_major_version ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1496 ft_config_is_lt=yes
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1497 else
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1498 if test $ft_config_major_version -eq $ft_min_major_version ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1499 if test $ft_config_minor_version -lt $ft_min_minor_version ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1500 ft_config_is_lt=yes
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1501 else
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1502 if test $ft_config_minor_version -eq $ft_min_minor_version ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1503 if test $ft_config_micro_version -lt $ft_min_micro_version ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1504 ft_config_is_lt=yes
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1505 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1506 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1507 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1508 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1509 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1510 if test x$ft_config_is_lt = xyes ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1511 no_ft=yes
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1512 else
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1513 ac_save_CFLAGS="$CFLAGS"
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1514 ac_save_LIBS="$LIBS"
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1515 CFLAGS="$CFLAGS $FT2_CFLAGS"
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1516 LIBS="$FT2_LIBS $LIBS"
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1517
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1518 dnl
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1519 dnl Sanity checks for the results of freetype-config to some extent.
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1520 dnl
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1521 AC_RUN_IFELSE([
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1522 AC_LANG_SOURCE([[
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1523
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1524 #include <ft2build.h>
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1525 #include FT_FREETYPE_H
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1526 #include <stdio.h>
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1527 #include <stdlib.h>
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1528
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1529 int
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1530 main()
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1531 {
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1532 FT_Library library;
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1533 FT_Error error;
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1534
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1535 error = FT_Init_FreeType(&library);
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1536
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1537 if (error)
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1538 return 1;
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1539 else
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1540 {
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1541 FT_Done_FreeType(library);
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1542 return 0;
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1543 }
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1544 }
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1545
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1546 ]])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1547 ],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1548 [],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1549 [no_ft=yes],
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1550 [echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1551
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1552 CFLAGS="$ac_save_CFLAGS"
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1553 LIBS="$ac_save_LIBS"
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1554 fi dnl test $ft_config_version -lt $ft_min_version
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1555 fi dnl test x$enable_fttest = xyes
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1556 fi dnl test "$FT2_CONFIG" = "no"
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1557
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1558 if test x$no_ft = x ; then
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1559 AC_MSG_RESULT([yes])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1560 m4_if([$2], [], [:], [$2])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1561 else
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1562 AC_MSG_RESULT([no])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1563 if test "$FT2_CONFIG" = "no" ; then
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1564 warn_ft2_config = "
7834
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1565
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1566 The freetype-config script installed by FreeType 2 could not be found.
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1567 If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in your
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1568 path, or set the FT2_CONFIG environment variable to the full path to
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1569 freetype-config.
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1570 "
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1571 OCTAVE_CONFIGURE_WARNING([warn_ft2_config])
7834
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1572 else
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1573 if test x$ft_config_is_lt = xyes ; then
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1574 warn_ft2_too_old="
7834
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1575
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1576 Your installed version of the FreeType 2 library is too old. If you
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1577 have different versions of FreeType 2, make sure that correct values
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1578 for --with-ft-prefix or --with-ft-exec-prefix are used, or set the
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1579 FT2_CONFIG environment variable to the full path to freetype-config.
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1580 "
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1581 OCTAVE_CONFIGURE_WARNING([warn_ft2_too_old])
7834
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1582 else
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1583 warn_ft2_failed="
7834
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1584
14657
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1585 The FreeType test program failed to run. If your system uses shared
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1586 libraries and they are installed outside the normal system library
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1587 path, make sure the variable LD_LIBRARY_PATH (or whatever is
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1588 appropiate for your system) is correctly set.
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1589 "
8a84849ad986 build: Restore printing some summary ./configure warnings at the end
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14605
diff changeset
1590 OCTAVE_CONFIGURE_WARNING([warn_ft2_failed])
7834
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1591 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1592 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1593
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1594 FT2_CFLAGS=""
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1595 FT2_LIBS=""
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1596 m4_if([$3], [], [:], [$3])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1597 fi
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1598
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1599 AC_SUBST([FT2_CFLAGS])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1600 AC_SUBST([FT2_LIBS])])
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1601 dnl end of freetype2.m4
8169
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1602
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1603 dnl
8998
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1604 dnl Check whether a math mapper function is available in <cmath>.
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1605 dnl Will define HAVE_CMATH_FUNC if there is a double variant and
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1606 dnl HAVE_CMATH_FUNCF if there is a float variant.
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1607 dnl Currently capable of checking for functions with single
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1608 dnl argument and returning bool/int/real.
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1609 dnl
8998
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1610 AC_DEFUN([OCTAVE_CMATH_FUNC],[
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1611 AC_MSG_CHECKING([for std::$1 in <cmath>])
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1612 AC_LANG_PUSH(C++)
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1613 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1614 #include <cmath>
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1615 void take_func (bool (*func) (double x));
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1616 void take_func (int (*func) (double x));
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1617 void take_func (double (*func) (double x));
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1618 ]],
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1619 [[
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1620 take_func(std::$1);
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1621 ]])],
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1622 [AC_MSG_RESULT([yes])
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1623 AC_DEFINE(HAVE_CMATH_[]AS_TR_CPP($1),1,[Define to 1 if <cmath> provides $1.])],
8998
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1624 [AC_MSG_RESULT([no])])
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1625 AC_MSG_CHECKING([for std::$1 (float variant) in <cmath>])
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1626 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1627 #include <cmath>
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1628 void take_func (bool (*func) (float x));
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1629 void take_func (int (*func) (float x));
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1630 void take_func (float (*func) (float x));
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1631 ]],
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1632 [[
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1633 take_func(std::$1);
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1634 ]])],
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1635 [AC_MSG_RESULT([yes])
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1636 AC_DEFINE(HAVE_CMATH_[]AS_TR_CPP($1)F,1,[Define to 1 if <cmath> provides float variant of $1.])],
8998
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1637 [AC_MSG_RESULT([no])])
9049
56018fcd28b0 configure fixes
Jaroslav Hajek <highegg@gmail.com>
parents: 8998
diff changeset
1638 AC_LANG_POP(C++)
8998
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1639 ])
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1640
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1641 dnl
8169
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1642 dnl Check whether fast signed integer arithmetics using bit tricks
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1643 dnl can be used in oct-inttypes.h. Defines HAVE_FAST_INT_OPS if
8169
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1644 dnl the following conditions hold:
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1645 dnl 1. Signed numbers are represented by twos complement
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1646 dnl (see <http://en.wikipedia.org/wiki/Two%27s_complement>)
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1647 dnl 2. static_cast to unsigned int counterpart works like interpreting
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1648 dnl the signed bit pattern as unsigned (and is thus zero-cost).
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1649 dnl 3. Signed addition and subtraction yield the same bit results as unsigned.
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1650 dnl (We use casts to prevent optimization interference, so there is no
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1651 dnl need for things like -ftrapv).
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1652 dnl 4. Bit operations on signed integers work like on unsigned integers,
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1653 dnl except for the shifts. Shifts are arithmetic.
8169
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1654 dnl
13957
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1655 AC_DEFUN([OCTAVE_FAST_INT_OPS],
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1656 [AC_CACHE_CHECK([whether fast integer arithmetics is usable],
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1657 octave_cv_fast_int_ops,
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1658 [AC_LANG_PUSH(C++)
8169
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1659 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1660 #include <limits>
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1661 template<class UT, class ST>
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1662 static bool
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1663 do_test (UT, ST)
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1664 {
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1665 volatile ST s = std::numeric_limits<ST>::min () / 3;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1666 volatile UT u = static_cast<UT> (s);
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1667 if (*(reinterpret_cast<volatile ST *> (&u)) != s) return true;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1668
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1669 u = 0; u = ~u;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1670 if (*(reinterpret_cast<volatile ST *> (&u)) != -1) return true;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1671
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1672 ST sx, sy;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1673 sx = std::numeric_limits<ST>::max () / 2 + 1;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1674 sy = std::numeric_limits<ST>::max () / 2 + 2;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1675 if (static_cast<ST> (static_cast<UT> (sx) + static_cast<UT> (sy))
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1676 != std::numeric_limits<ST>::min () + 1) return true;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1677 if (static_cast<ST> (static_cast<UT> (sx) - static_cast<UT> (sy))
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1678 != -1) return true;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1679
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1680 if ((sx & sy) != (static_cast<UT> (sx) & static_cast<UT> (sy)))
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1681 return true;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1682 if ((sx | sy) != (static_cast<UT> (sx) | static_cast<UT> (sy)))
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1683 return true;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1684 if ((sx ^ sy) != (static_cast<UT> (sx) ^ static_cast<UT> (sy)))
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1685 return true;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1686 if ((-1 >> 1) != -1) return true;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1687 return false;
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1688 }
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1689
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1690 #define DO_TEST(T) \
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1691 if (do_test (static_cast<unsigned T> (0), static_cast<signed T> (0))) \
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1692 return sizeof (T);
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1693 ]],[[
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1694 DO_TEST(char)
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1695 DO_TEST(short)
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1696 DO_TEST(int)
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1697 DO_TEST(long)
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1698 #if (defined(HAVE_LONG_LONG_INT) && defined(HAVE_UNSIGNED_LONG_LONG_INT))
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1699 DO_TEST(long long)
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1700 #endif
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1701 ]])],
13957
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1702 [octave_cv_fast_int_ops=yes],
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1703 [octave_cv_fast_int_ops=no],
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1704 [octave_cv_fast_int_ops=yes])
8169
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1705 AC_LANG_POP(C++)])
13957
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1706 if test $octave_cv_fast_int_ops = yes; then
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1707 AC_DEFINE(HAVE_FAST_INT_OPS, 1,
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1708 [Define to 1 if signed integers use two's complement.])
13957
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1709 fi
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1710 ])
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1711 dnl
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1712 dnl Check to see if the compiler and the linker can handle the flags
8635
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1713 dnl "-framework $1" for the given prologue $2 and the given body $3 of
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1714 dnl a source file. Arguments 2 and 3 optionally can also be empty.
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1715 dnl Add options (lower case letters $1) "--with-framework-$1" and
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
1716 dnl "--without-framework-$1". If this test is successful then perform
8635
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1717 dnl $4, otherwise do $5.
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1718 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
1719 AC_DEFUN([OCTAVE_HAVE_FRAMEWORK], [
10012
2441327485a3 use m4 quating in aclocal.m4 autoconf macros with variable expansion
Rik <rdrider0-list@yahoo.com>
parents: 10011
diff changeset
1720 AC_MSG_CHECKING([whether ${LD-ld} accepts -framework $1])
8635
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1721 AC_CACHE_VAL(octave_cv_framework_$1, [
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1722 XLDFLAGS="$LDFLAGS"
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1723 LDFLAGS="$LDFLAGS -framework $1"
8635
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1724 AC_LANG_PUSH(C++)
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1725 AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], [$3])],
8635
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1726 eval "octave_cv_framework_$1=yes",
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1727 eval "octave_cv_framework_$1=no")
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1728 AC_LANG_POP(C++)
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1729 LDFLAGS="$XLDFLAGS"
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1730 ])
8635
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1731 if test "$octave_cv_framework_$1" = "yes"; then
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1732 AC_MSG_RESULT(yes)
8635
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1733 AC_ARG_WITH(framework-m4_tolower($1),
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1734 [AS_HELP_STRING([--without-framework-m4_tolower($1)],
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1735 [don't use framework $1])],
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1736 with_have_framework=$withval, with_have_framework="yes")
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1737 if test "$with_have_framework" = "yes"; then
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1738 [$4]
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1739 else
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1740 AC_MSG_NOTICE([framework rejected by --without-framework-m4_tolower($1)])
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1741 [$5]
bef8f001032f Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8595
diff changeset
1742 fi
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1743 else
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1744 AC_MSG_RESULT(no)
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1745 [$5]
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1746 fi
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1747 ])
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1748
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1749 ##############################################################################
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1750 ##############################################################################
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1751
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1752 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1753 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1754 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1755 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1756 # This program is free software; you can redistribute it and/or modify
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1757 # it under the terms of the GNU General Public License as published by
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1758 # the Free Software Foundation; either version 2 of the License, or
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1759 # (at your option) any later version.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1760 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1761 # This program is distributed in the hope that it will be useful, but
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1762 # WITHOUT ANY WARRANTY; without even the implied warranty of
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1763 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1764 # General Public License for more details.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1765 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1766 # You should have received a copy of the GNU General Public License
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1767 # along with this program; if not, write to the Free Software
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1768 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1769 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1770 # As a special exception to the GNU General Public License, if you
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1771 # distribute this file as part of a program that contains a
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1772 # configuration script generated by Autoconf, you may include it under
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1773 # the same distribution terms that you use for the rest of that program.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1774
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1775 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1776 # ----------------------------------
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1777 AC_DEFUN([PKG_PROG_PKG_CONFIG],
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1778 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1779 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1780 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1781 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1782 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1783 fi
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1784 if test -n "$PKG_CONFIG"; then
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1785 _pkg_min_version=m4_default([$1], [0.9.0])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1786 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1787 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1788 AC_MSG_RESULT([yes])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1789 else
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1790 AC_MSG_RESULT([no])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1791 PKG_CONFIG=""
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1792 fi
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1793
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1794 fi[]dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1795 ])# PKG_PROG_PKG_CONFIG
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1796
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1797 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1798 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1799 # Check to see whether a particular set of modules exists. Similar
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1800 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1801 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1802 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1803 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1804 # this or PKG_CHECK_MODULES is called, or make sure to call
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1805 # PKG_CHECK_EXISTS manually
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1806 # --------------------------------------------------------------
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1807 AC_DEFUN([PKG_CHECK_EXISTS],
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1808 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1809 if test -n "$PKG_CONFIG" && \
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1810 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1811 m4_ifval([$2], [$2], [:])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1812 m4_ifvaln([$3], [else
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1813 $3])dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1814 fi])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1815
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1816
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1817 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1818 # ---------------------------------------------
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1819 m4_define([_PKG_CONFIG],
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1820 [if test -n "$PKG_CONFIG"; then
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1821 if test -n "$$1"; then
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1822 pkg_cv_[]$1="$$1"
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1823 else
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1824 PKG_CHECK_EXISTS([$3],
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1825 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1826 [pkg_failed=yes])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1827 fi
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1828 else
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1829 pkg_failed=untried
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1830 fi[]dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1831 ])# _PKG_CONFIG
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1832
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1833 # _PKG_SHORT_ERRORS_SUPPORTED
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1834 # -----------------------------
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1835 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1836 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1837 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1838 _pkg_short_errors_supported=yes
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1839 else
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1840 _pkg_short_errors_supported=no
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1841 fi[]dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1842 ])# _PKG_SHORT_ERRORS_SUPPORTED
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1843
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1844
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1845 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1846 # [ACTION-IF-NOT-FOUND])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1847 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1848 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1849 # Note that if there is a possibility the first call to
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1850 # PKG_CHECK_MODULES might not happen, you should be sure to include an
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1851 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1852 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1853 #
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1854 # --------------------------------------------------------------
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1855 AC_DEFUN([PKG_CHECK_MODULES],
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1856 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1857 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1858 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1859
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1860 pkg_failed=no
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1861 AC_MSG_CHECKING([for $1])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1862
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1863 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1864 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1865
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1866 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1867 and $1[]_LIBS to avoid the need to call pkg-config.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1868 See the pkg-config man page for more details.])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1869
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1870 if test $pkg_failed = yes; then
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1871 _PKG_SHORT_ERRORS_SUPPORTED
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1872 if test $_pkg_short_errors_supported = yes; then
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1873 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1874 else
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1875 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1876 fi
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1877 # Put the nasty error message in config.log where it belongs
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1878 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1879
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1880 ifelse([$4], , [AC_MSG_ERROR(dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1881 [Package requirements ($2) were not met:
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1882
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1883 $$1_PKG_ERRORS
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1884
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1885 Consider adjusting the PKG_CONFIG_PATH environment variable if you
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1886 installed software in a non-standard prefix.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1887
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1888 _PKG_TEXT
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1889 ])],
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1890 [AC_MSG_RESULT([no])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1891 $4])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1892 elif test $pkg_failed = untried; then
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1893 ifelse([$4], , [AC_MSG_FAILURE(dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1894 [The pkg-config script could not be found or is too old. Make sure it
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1895 is in your PATH or set the PKG_CONFIG environment variable to the full
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1896 path to pkg-config.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1897
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1898 _PKG_TEXT
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1899
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1900 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1901 [$4])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1902 else
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1903 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1904 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1905 AC_MSG_RESULT([yes])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1906 ifelse([$3], , :, [$3])
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1907 fi[]dnl
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1908 ])# PKG_CHECK_MODULES
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
1909
9645
4531741e5236 configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9596
diff changeset
1910 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1911 dnl Include external macros.
9645
4531741e5236 configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9596
diff changeset
1912 dnl
4531741e5236 configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9596
diff changeset
1913
10951
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 10471
diff changeset
1914 m4_include([m4/ax_pthread.m4])
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 10471
diff changeset
1915 m4_include([m4/ax_blas.m4])
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 10471
diff changeset
1916 m4_include([m4/ax_blas_f77_func.m4])
97b8d462ef11 Update m4 macros.
Ben Abbott <bpabbott@mac.com>
parents: 10471
diff changeset
1917 m4_include([m4/ax_lapack.m4])