annotate m4/acinclude.m4 @ 18976:dcb260e7a648

maint: Periodic merge of gui-release to default.
author John W. Eaton <jwe@octave.org>
date Fri, 01 Aug 2014 12:10:05 -0400
parents 2b82d2f29a7b c59745865c7f
children
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
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 17661
diff changeset
3 dnl Copyright (C) 1995-2013 John W. Eaton
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
4 dnl
1232
5f1bb459e99c [project @ 1995-04-10 05:20:52 by jwe]
jwe
parents:
diff changeset
5 dnl This file is part of Octave.
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
6 dnl
1232
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.
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
11 dnl
1232
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.
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
16 dnl
1232
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
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
40
2813
d45d48b3dcde [project @ 1997-03-13 22:39:15 by jwe]
jwe
parents: 2641
diff changeset
41 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
42 dnl Alphabetical list of macros in the OCTAVE_ namespace
4360
1d7180ab9df1 [project @ 2003-02-24 02:57:24 by jwe]
jwe
parents: 4192
diff changeset
43 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
44
4366
ad851d04b396 [project @ 2003-03-05 09:49:18 by jwe]
jwe
parents: 4360
diff changeset
45 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
46 dnl Check if the Carbon Framework defines CGDisplayBitsPerPixel.
10380
60acc47c203f configure checks for complex element setter/reference accessor methods
John W. Eaton <jwe@octave.org>
parents: 10331
diff changeset
47 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
48 AC_DEFUN([OCTAVE_CARBON_CGDISPLAYBITSPERPIXEL], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
49 AC_CACHE_CHECK([whether CGDisplayBitsPerPixel is defined in the Carbon Framework],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
50 [octave_cv_func_carbon_cgdisplaybitsperpixel],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
51 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
52 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
53 #include <Carbon/Carbon.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
54 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
55 CGDirectDisplayID display = CGMainDisplayID ();
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
56 size_t depth = CGDisplayBitsPerPixel (display);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
57 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
58 octave_cv_func_carbon_cgdisplaybitsperpixel=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
59 octave_cv_func_carbon_cgdisplaybitsperpixel=no)
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
60 AC_LANG_POP(C++)
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
61 ])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
62 if test $octave_cv_func_carbon_cgdisplaybitsperpixel = yes; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
63 AC_DEFINE(HAVE_CARBON_CGDISPLAYBITSPERPIXEL, 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
64 [Define to 1 if Carbon Framework has CGDisplayBitsPerPixel.])
3107
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
65 fi
a8dcfbf87ea3 [project @ 1997-11-19 22:34:59 by jwe]
jwe
parents: 3089
diff changeset
66 ])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
67 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
68 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
69 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
70 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
71 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
72 AC_DEFUN([OCTAVE_CC_FLAG], [
17661
1978a6c76aa9 Use user-specified SED during build process (bug #40273).
Rik <rik@octave.org>
parents: 17615
diff changeset
73 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
74 AC_MSG_CHECKING([whether ${CC-cc} accepts $1])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
75 AC_CACHE_VAL([octave_cv_cc_flag_$ac_safe],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
76 [AC_LANG_PUSH(C)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
77 ac_octave_save_CFLAGS="$CFLAGS"
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
78 CFLAGS="$CFLAGS $1"
5177
86fa011d6404 [project @ 2005-03-03 00:32:34 by jwe]
jwe
parents: 5094
diff changeset
79 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
80 [eval "octave_cv_cc_flag_$ac_safe=yes"],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
81 [eval "octave_cv_cc_flag_$ac_safe=no"])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
82 CFLAGS="$ac_octave_save_CFLAGS"
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
83 AC_LANG_POP(C)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
84 ])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
85 if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
86 AC_MSG_RESULT([yes])
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
87 ifelse([$2], ,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
88 [CFLAGS="$CFLAGS $1"
3131
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3130
diff changeset
89 AC_MSG_RESULT([adding $1 to CFLAGS])], [$2])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
90 else
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
91 AC_MSG_RESULT([no])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
92 ifelse([$3], , , [$3])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
93 fi
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
94 ])
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
95 dnl
17965
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
96 dnl Check for broken stl_algo.h header file in gcc versions 4.8.0, 4.8.1, 4.8.2
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
97 dnl which leads to failures in nth_element.
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
98 dnl
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
99 AC_DEFUN([OCTAVE_CHECK_BROKEN_STL_ALGO_H], [
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
100 AC_CACHE_CHECK([whether stl_algo.h is broken],
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
101 [octave_cv_broken_stl_algo_h],
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
102 [AC_LANG_PUSH(C++)
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
103 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
104 // Based on code from a GCC test program.
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
105
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
106 // Copyright (C) 2013 Free Software Foundation, Inc.
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
107 //
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
108 // This file is part of the GNU ISO C++ Library. This library is free
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
109 // software; you can redistribute it and/or modify it under the
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
110 // terms of the GNU General Public License as published by the
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
111 // Free Software Foundation; either version 3, or (at your option)
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
112 // any later version.
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
113
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
114 // This library is distributed in the hope that it will be useful,
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
115 // but WITHOUT ANY WARRANTY; without even the implied warranty of
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
116 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
117 // GNU General Public License for more details.
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
118
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
119 // You should have received a copy of the GNU General Public License along
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
120 // with this library; see the file COPYING3. If not see
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
121 // <http://www.gnu.org/licenses/>.
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
122
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
123 // 25.3.2 [lib.alg.nth.element]
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
124
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
125 // { dg-options "-std=gnu++11" }
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
126
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
127 #include <algorithm>
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
128 #include <vector>
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
129 ]], [[
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
130 std::vector<int> v (7);
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
131
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
132 v[0] = 207089;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
133 v[1] = 202585;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
134 v[2] = 180067;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
135 v[3] = 157549;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
136 v[4] = 211592;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
137 v[5] = 216096;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
138 v[6] = 207089;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
139
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
140 std::nth_element (v.begin (), v.begin () + 3, v.end ());
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
141
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
142 return v[3] == 207089 ? 0 : 1;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
143 ]])],
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
144 octave_cv_broken_stl_algo_h=no,
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
145 octave_cv_broken_stl_algo_h=yes,
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
146 [case "$GXX_VERSION" in
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
147 *4.8.2*)
17967
303157af491f acinclude.m4: Fix undefined value in macro CHECK_BROKEN_STL_ALGO_H when cross-compiling.
Rik <rik@octave.org>
parents: 17965
diff changeset
148 octave_cv_broken_stl_algo_h=yes
303157af491f acinclude.m4: Fix undefined value in macro CHECK_BROKEN_STL_ALGO_H when cross-compiling.
Rik <rik@octave.org>
parents: 17965
diff changeset
149 ;;
303157af491f acinclude.m4: Fix undefined value in macro CHECK_BROKEN_STL_ALGO_H when cross-compiling.
Rik <rik@octave.org>
parents: 17965
diff changeset
150 *)
303157af491f acinclude.m4: Fix undefined value in macro CHECK_BROKEN_STL_ALGO_H when cross-compiling.
Rik <rik@octave.org>
parents: 17965
diff changeset
151 octave_cv_broken_stl_algo_h=no
17965
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
152 ;;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
153 esac
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
154 ])
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
155 AC_LANG_POP(C++)
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
156 ])
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
157 if test "$GXX" = yes; then
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
158 if test $octave_cv_broken_stl_algo_h = yes; then
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
159 case "$GXX_VERSION" in
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
160 4.8.[[012]])
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
161 ;;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
162 *)
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
163 octave_cv_broken_stl_algo_h=no
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
164 warn_stl_algo_h="UNEXPECTED: found nth_element broken in g++ $GXX_VERSION. Refusing to fix except for g++ 4.8.0, 4.8.1, or 4.8.2. You appear to have g++ $GXX_VERSION."
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
165 OCTAVE_CONFIGURE_WARNING([warn_stl_algo_h])
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
166 ;;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
167 esac
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
168 else
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
169 case "$GXX_VERSION" in
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
170 4.8.2)
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
171 warn_stl_algo_h="UNEXPECTED: found nth_element working in g++ 4.8.2. Has it been patched on your system?"
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
172 OCTAVE_CONFIGURE_WARNING([warn_stl_algo_h])
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
173 ;;
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
174 esac
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
175 fi
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
176 else
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
177 octave_cv_broken_stl_algo_h=no
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
178 warn_stl_algo_h="UNEXPECTED: nth_element test failed. Refusing to fix except for g++ 4.8.2."
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
179 OCTAVE_CONFIGURE_WARNING([warn_stl_algo_h])
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
180 fi
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
181 ])
1d58abc740c0 acinclude.m4: Place new macro CHECK_BROKEN_STL_ALGO_H in alphabetical ordering.
Rik <rik@octave.org>
parents: 17888
diff changeset
182 dnl
15969
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
183 dnl Check whether the FFTW library supports multi-threading. This macro
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
184 dnl should be called once per FFTW precision passing in the library
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
185 dnl variant (e.g. "fftw3") and a function in the thread support API
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
186 dnl (e.g. "fftw_plan_with_nthreads"). Depending on how FFTW was built,
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
187 dnl the thread functions could be compiled into the main FFTW library or
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
188 dnl could be a separate add-on library that is passed to the linker
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
189 dnl ahead of the main FFTW library.
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
190 dnl
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
191 AC_DEFUN([OCTAVE_CHECK_FFTW_THREADS], [
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
192 ac_octave_save_CPPFLAGS="$CPPFLAGS"
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
193 ac_octave_save_LDFLAGS="$LDFLAGS"
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
194 ac_octave_save_LIBS="$LIBS"
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
195 CPPFLAGS="$m4_toupper([$1])_CPPFLAGS $CPPFLAGS"
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
196 LDFLAGS="$m4_toupper([$1])_LDFLAGS $LDFLAGS"
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
197 LIBS="$m4_toupper([$1])_LIBS $LIBS"
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
198 AC_CACHE_CHECK([for $1 multi-threading support],
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
199 [octave_cv_[$1]_threads_lib],
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
200 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
201 #include <fftw3.h>
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
202 ]], [[
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
203 $2 (2);
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
204 ]])],
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
205 [octave_cv_[$1]_threads_lib=yes],
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
206 [LIBS="-l[$1]_threads $LIBS"
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
207 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
208 #include <fftw3.h>
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
209 ]], [[
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
210 $2 (2);
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
211 ]])],
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
212 [octave_cv_[$1]_threads_lib="-l[$1]_threads"],
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
213 [octave_cv_[$1]_threads_lib=no])
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
214 ])
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
215 ])
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
216 case $octave_cv_[$1]_threads_lib in
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
217 -l*)
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
218 m4_toupper([$1])_LIBS="$octave_cv_[$1]_threads_lib $m4_toupper([$1])_LIBS"
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
219 ;;
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
220 no)
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
221 AC_MSG_WARN([No $1 multi-threading support found.])
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
222 AC_MSG_WARN([The single-threaded library will be used instead.])
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
223 ;;
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
224 esac
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
225 if test $octave_cv_[$1]_threads_lib != no; then
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
226 AC_DEFINE([HAVE_]m4_toupper([$1])[_THREADS], 1,
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
227 [Define to 1 if ]m4_toupper([$1])[ has multi-threading support.])
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
228 fi
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
229 CPPFLAGS="$ac_octave_save_CPPFLAGS"
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
230 LDFLAGS="$ac_octave_save_LDFLAGS"
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
231 LIBS="$ac_octave_save_LIBS"
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
232 ])
139f4b19a3ac build: Improve detection of FFTW multi-threading
Mike Miller <mtmiller@ieee.org>
parents: 15863
diff changeset
233 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
234 dnl Check whether a math mapper function is available in <cmath>.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
235 dnl Will define HAVE_CMATH_FUNC if there is a double variant and
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
236 dnl HAVE_CMATH_FUNCF if there is a float variant.
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
237 dnl Currently capable of checking for functions with single
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
238 dnl argument and returning bool/int/real.
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
239 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
240 AC_DEFUN([OCTAVE_CHECK_FUNC_CMATH], [
17661
1978a6c76aa9 Use user-specified SED during build process (bug #40273).
Rik <rik@octave.org>
parents: 17615
diff changeset
241 ac_safe=`echo "$1" | $SED 'y% ./+-:=%___p___%'`
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
242
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
243 AC_CACHE_CHECK([for std::$1 in <cmath>],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
244 [octave_cv_func_cmath_$ac_safe],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
245 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
246 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
247 #include <cmath>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
248 void take_func (bool (*func) (double x));
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
249 void take_func (int (*func) (double x));
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
250 void take_func (double (*func) (double x));
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
251 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
252 take_func(std::$1);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
253 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
254 [eval "octave_cv_func_cmath_$ac_safe=yes"],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
255 [eval "octave_cv_func_cmath_$ac_safe=no"])
3888
70ebd3d672a1 [project @ 2002-04-04 01:05:53 by jwe]
jwe
parents: 3887
diff changeset
256 AC_LANG_POP(C++)
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
257 ])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
258 if eval "test \"`echo '$octave_cv_func_cmath_'$ac_safe`\" = yes"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
259 AC_DEFINE(AS_TR_CPP([[HAVE_CMATH_][$1]]), 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
260 [Define to 1 if <cmath> provides $1.])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
261 fi
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
262
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
263 AC_CACHE_CHECK([for std::$1 (float variant) in <cmath>],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
264 [octave_cv_func_cmath_f$ac_safe],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
265 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
266 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
267 #include <cmath>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
268 void take_func (bool (*func) (float x));
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
269 void take_func (int (*func) (float x));
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
270 void take_func (float (*func) (float x));
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
271 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
272 take_func(std::$1);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
273 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
274 [eval "octave_cv_func_cmath_f$ac_safe=yes"],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
275 [eval "octave_cv_func_cmath_f$ac_safe=no"])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
276 AC_LANG_POP(C++)
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
277 ])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
278 if eval "test \"`echo '$octave_cv_func_cmath_f'$ac_safe`\" = yes"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
279 AC_DEFINE(AS_TR_CPP([[HAVE_CMATH_][$1][F]]), 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
280 [Define to 1 if <cmath> provides float variant of $1.])
3126
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
281 fi
0f6ec7b761a6 [project @ 1998-01-16 05:15:43 by jwe]
jwe
parents: 3107
diff changeset
282 ])
3130
02766207b74c [project @ 1998-01-25 08:27:23 by jwe]
jwe
parents: 3126
diff changeset
283 dnl
16733
2723d1144f11 added test for qscintilla version 2.6.0
Torsten <ttl@justmail.de>
parents: 16663
diff changeset
284 dnl Check whether Qscintilla has version 2.6.0 or later
15291
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
285 dnl FIXME: This test uses a version number. It potentially could
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
286 dnl be re-written to actually call the function, but is it worth it?
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
287 dnl
16733
2723d1144f11 added test for qscintilla version 2.6.0
Torsten <ttl@justmail.de>
parents: 16663
diff changeset
288 AC_DEFUN([OCTAVE_CHECK_VERSION_2_6_0], [
2723d1144f11 added test for qscintilla version 2.6.0
Torsten <ttl@justmail.de>
parents: 16663
diff changeset
289 AC_CACHE_CHECK([whether Qscintilla has version 2.6.0 or later],
2723d1144f11 added test for qscintilla version 2.6.0
Torsten <ttl@justmail.de>
parents: 16663
diff changeset
290 [octave_cv_version_2_6_0],
15291
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
291 [AC_LANG_PUSH(C++)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
292 ac_octave_save_CPPFLAGS="$CPPFLAGS"
15596
5f031158c693 Use pkg-config to discover Qt (pkg-config is already a requirement anyway).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15360
diff changeset
293 CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS"
15291
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
294 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
295 #include <Qsci/qsciglobal.h>
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
296 ]], [[
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
297 #if QSCINTILLA_VERSION < 0x020600
15295
43e484fa7e42 build: Clean up configure macros for building GUI.
Rik <rik@octave.org>
parents: 15294
diff changeset
298 #error Old FindFirst function found.
15291
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
299 #endif
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
300 ]])],
16733
2723d1144f11 added test for qscintilla version 2.6.0
Torsten <ttl@justmail.de>
parents: 16663
diff changeset
301 octave_cv_version_2_6_0=yes,
2723d1144f11 added test for qscintilla version 2.6.0
Torsten <ttl@justmail.de>
parents: 16663
diff changeset
302 octave_cv_version_2_6_0=no)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
303 CPPFLAGS="$ac_octave_save_CPPFLAGS"
15291
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
304 AC_LANG_POP(C++)
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
305 ])
16733
2723d1144f11 added test for qscintilla version 2.6.0
Torsten <ttl@justmail.de>
parents: 16663
diff changeset
306 if test $octave_cv_version_2_6_0 = yes; then
2723d1144f11 added test for qscintilla version 2.6.0
Torsten <ttl@justmail.de>
parents: 16663
diff changeset
307 AC_DEFINE(HAVE_QSCI_VERSION_2_6_0, 1,
2723d1144f11 added test for qscintilla version 2.6.0
Torsten <ttl@justmail.de>
parents: 16663
diff changeset
308 [Define to 1 if Qscintilla is of Version 2.6.0 or later.])
5076
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
309 fi
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
310 ])
dc5f6082aa74 [project @ 2004-11-12 03:49:26 by jwe]
jwe
parents: 4853
diff changeset
311 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
312 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
313 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
314 AC_DEFUN([OCTAVE_CHECK_FUNC_FORTRAN_ISNAN], [
14550
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
315 AC_CACHE_CHECK([whether $F77 has the intrinsic function ISNAN],
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
316 [octave_cv_func_fortran_isnan],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
317 [AC_LANG_PUSH(Fortran 77)
17978
86846ce0371a acinclude.m4: Clean up indentation of Fortran code tests.
Rik <rik@octave.org>
parents: 17967
diff changeset
318 AC_COMPILE_IFELSE([[
86846ce0371a acinclude.m4: Clean up indentation of Fortran code tests.
Rik <rik@octave.org>
parents: 17967
diff changeset
319 program foo
14550
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
320 implicit none
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
321 real x
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
322 double precision y
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
323 if (isnan(x)) then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
324 print *, 'x is NaN'
14550
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
325 end if
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
326 if (isnan(y)) then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
327 print *, 'y is NaN'
14550
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
328 end if
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
329 end program
17978
86846ce0371a acinclude.m4: Clean up indentation of Fortran code tests.
Rik <rik@octave.org>
parents: 17967
diff changeset
330 ]],
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
331 octave_cv_func_fortran_isnan=yes, octave_cv_func_fortran_isnan=no)
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
332 AC_LANG_POP(Fortran 77)
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
333 ])
14550
bc4c574ab3b6 Add configure check for isnan in fortran.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14419
diff changeset
334 ])
9596
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
335 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
336 dnl Check if function gluTessCallback is called with "(...)".
9596
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
337 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
338 AC_DEFUN([OCTAVE_CHECK_FUNC_GLUTESSCALLBACK_THREEDOTS], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
339 AC_CACHE_CHECK([whether gluTessCallback is called with "(...)"],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
340 [octave_cv_func_glutesscallback_threedots],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
341 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
342 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
343 #ifdef HAVE_GL_GLU_H
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
344 # include <GL/glu.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
345 #elif defined HAVE_OPENGL_GLU_H || defined HAVE_FRAMEWORK_OPENGL
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
346 # include <OpenGL/glu.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
347 #endif
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
348 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
349 GLvoid (*func)(...);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
350 gluTessCallback(0, 0, func);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
351 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
352 octave_cv_func_glutesscallback_threedots=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
353 octave_cv_func_glutesscallback_threedots=no)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
354 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
355 ])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
356 if test $octave_cv_func_glutesscallback_threedots = yes; then
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
357 AC_DEFINE(HAVE_GLUTESSCALLBACK_THREEDOTS, 1,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
358 [Define to 1 if gluTessCallback is called with (...).])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
359 fi
9596
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
360 ])
f26229391ea1 configure.in, aclocal.m4: check fortran integer size
John W. Eaton <jwe@octave.org>
parents: 9577
diff changeset
361 dnl
18036
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
362 dnl Check whether Qt provides QFont::Monospace
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
363 dnl
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
364 AC_DEFUN([OCTAVE_CHECK_QFONT_MONOSPACE], [
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
365 AC_CACHE_CHECK([whether Qt provides QFont::Monospace],
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
366 [octave_cv_decl_qfont_monospace],
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
367 [AC_LANG_PUSH(C++)
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
368 ac_octave_save_CPPFLAGS="$CPPFLAGS"
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
369 CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS"
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
370 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
371 #include <QFont>
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
372 ]], [[
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
373 QFont::StyleHint hint = QFont::Monospace;
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
374 ]])],
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
375 octave_cv_decl_qfont_monospace=yes,
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
376 octave_cv_decl_qfont_monospace=no)
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
377 CPPFLAGS="$ac_octave_save_CPPFLAGS"
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
378 AC_LANG_POP(C++)
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
379 ])
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
380 if test $octave_cv_decl_qfont_monospace = yes; then
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
381 AC_DEFINE(HAVE_QFONT_MONOSPACE, 1,
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
382 [Define to 1 if Qt provides QFont::Monospace.])
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
383 fi
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
384 ])
c97ee13f1027 fix build for systems without QFont::Monospace
John W. Eaton <jwe@octave.org>
parents: 17978
diff changeset
385 dnl
18973
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
386 dnl Check whether Qt provides QFont::ForceIntegerMetrics
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
387 dnl
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
388 AC_DEFUN([OCTAVE_CHECK_QFONT_FORCE_INTEGER_METRICS], [
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
389 AC_CACHE_CHECK([whether Qt provides QFont::ForceIntegerMetrics],
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
390 [octave_cv_decl_qfont_force_integer_metrics],
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
391 [AC_LANG_PUSH(C++)
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
392 ac_octave_save_CPPFLAGS="$CPPFLAGS"
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
393 CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS"
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
394 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
395 #include <QFont>
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
396 ]], [[
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
397 QFont::StyleStrategy strategy = QFont::ForceIntegerMetrics;
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
398 ]])],
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
399 octave_cv_decl_qfont_force_integer_metrics=yes,
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
400 octave_cv_decl_qfont_force_integer_metrics=no)
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
401 CPPFLAGS="$ac_octave_save_CPPFLAGS"
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
402 AC_LANG_POP(C++)
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
403 ])
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
404 if test $octave_cv_decl_qfont_force_integer_metrics = yes; then
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
405 AC_DEFINE(HAVE_QFONT_FORCE_INTEGER_METRICS, 1,
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
406 [Define to 1 if Qt provides QFont::ForceIntegerMetrics.])
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
407 fi
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
408 ])
625e3bb65885 don't require Qt 4.7 (bug #42657)
John W. Eaton <jwe@octave.org>
parents: 18141
diff changeset
409 dnl
15291
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
410 dnl Check whether Qscintilla SetPlaceholderText function exists.
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
411 dnl FIXME: This test uses a version number. It potentially could
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
412 dnl be re-written to actually call the function, but is it worth it?
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
413 dnl
15291
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
414 AC_DEFUN([OCTAVE_CHECK_FUNC_SETPLACEHOLDERTEXT], [
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
415 AC_CACHE_CHECK([whether Qt has SetPlaceholderText function],
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
416 [octave_cv_func_setplaceholdertext],
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
417 [AC_LANG_PUSH(C++)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
418 ac_octave_save_CPPFLAGS="$CPPFLAGS"
15596
5f031158c693 Use pkg-config to discover Qt (pkg-config is already a requirement anyway).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15360
diff changeset
419 CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS"
15291
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
420 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
421 #include <Qt/qglobal.h>
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
422 ]], [[
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
423 #if QT_VERSION < 0x040700
15295
43e484fa7e42 build: Clean up configure macros for building GUI.
Rik <rik@octave.org>
parents: 15294
diff changeset
424 #error No SetPlacholderText function available.
15291
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
425 #endif
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
426 ]])],
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
427 octave_cv_func_setplaceholdertext=yes,
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
428 octave_cv_func_setplaceholdertext=no)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
429 CPPFLAGS="$ac_octave_save_CPPFLAGS"
15291
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
430 AC_LANG_POP(C++)
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
431 ])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
432 if test $octave_cv_func_setplaceholdertext = yes; then
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
433 AC_DEFINE(HAVE_SETPLACEHOLDERTEXT, 1,
15291
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
434 [Define to 1 if you have the Qt SetPlaceholderText function.])
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
435 fi
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
436 ])
7ae14907ae43 build: Add tests for specific Qt functions to configure.ac
Rik <rik@octave.org>
parents: 15250
diff changeset
437 dnl
17111
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
438 dnl Check whether the Qt QAbstractItemModel::beginResetModel() function exists.
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
439 dnl Also checks for QAbstractItemModel::endResetModel(). These are two of the
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
440 dnl newest Qt functions that the Octave GUI depends on, added in Qt 4.6.
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
441 dnl
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
442 AC_DEFUN([OCTAVE_CHECK_FUNC_QABSTRACTITEMMODEL_BEGINRESETMODEL], [
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
443 AC_CACHE_CHECK([whether Qt has the QAbstractItemModel::beginResetModel() function],
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
444 [octave_cv_func_qabstractitemmodel_beginresetmodel],
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
445 [AC_LANG_PUSH(C++)
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
446 ac_octave_save_CPPFLAGS="$CPPFLAGS"
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
447 CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS"
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
448 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
449 #include <QAbstractItemModel>
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
450 class item_model : public QAbstractItemModel
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
451 {
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
452 public:
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
453 item_model (QObject *parent = 0) : QAbstractItemModel (parent) {}
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
454 ~item_model () {}
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
455 QModelIndex index (int, int, const QModelIndex& m) const { return m; }
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
456 QModelIndex parent (const QModelIndex& m) const { return m; }
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
457 int columnCount (const QModelIndex&) const { return 0; }
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
458 int rowCount (const QModelIndex&) const { return 0; }
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
459 QVariant data (const QModelIndex&, int) const { return QVariant(); }
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
460 void update_model ()
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
461 {
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
462 this->beginResetModel ();
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
463 this->endResetModel ();
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
464 }
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
465 };
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
466 ]], [[
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
467 item_model model;
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
468 model.update_model ();
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
469 ]])],
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
470 octave_cv_func_qabstractitemmodel_beginresetmodel=yes,
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
471 octave_cv_func_qabstractitemmodel_beginresetmodel=no)
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
472 CPPFLAGS="$ac_octave_save_CPPFLAGS"
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
473 AC_LANG_POP(C++)
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
474 ])
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
475 if test $octave_cv_func_qabstractitemmodel_beginresetmodel = yes; then
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
476 AC_DEFINE(HAVE_QABSTRACTITEMMODEL_BEGINRESETMODEL, 1,
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
477 [Define to 1 if Qt has the QAbstractItemModel::beginResetModel() function.])
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
478 fi
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
479 ])
bb713af2e1d9 build: detect Qt functions required for building the gui
Mike Miller <mtmiller@ieee.org>
parents: 17034
diff changeset
480 dnl
18216
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
481 dnl Check whether the Qt QTabWidget::setMovable() function exists.
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
482 dnl This function was added in Qt 4.5.
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
483 dnl
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
484 AC_DEFUN([OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE], [
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
485 AC_CACHE_CHECK([whether Qt has the QTabWidget::setMovable() function],
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
486 [octave_cv_func_qtabwidget_setmovable],
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
487 [AC_LANG_PUSH(C++)
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
488 ac_octave_save_CPPFLAGS="$CPPFLAGS"
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
489 CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS"
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
490 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
491 #include <QTabWidget>
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
492 class tab_widget : public QTabWidget
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
493 {
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
494 public:
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
495 tab_widget (QWidget *parent = 0) : QTabWidget (parent) { this->setMovable (true); }
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
496 ~tab_widget () {}
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
497 };
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
498 ]], [[
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
499 tab_widget tw;
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
500 ]])],
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
501 octave_cv_func_qtabwidget_setmovable=yes,
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
502 octave_cv_func_qtabwidget_setmovable=no)
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
503 CPPFLAGS="$ac_octave_save_CPPFLAGS"
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
504 AC_LANG_POP(C++)
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
505 ])
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
506 if test $octave_cv_func_qtabwidget_setmovable = yes; then
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
507 AC_DEFINE(HAVE_QTABWIDGET_SETMOVABLE, 1,
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
508 [Define to 1 if Qt has the QTabWidget::setMovable() function.])
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
509 fi
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
510 ])
e54cfaae830b Make editor tabs draggable if feature is available
Richard Crozier richard dot crozier(at)yahoo.co.uk
parents: 18141
diff changeset
511 dnl
18854
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
512 dnl Check whether the QsciScintilla::findFirstInSelection () function exists.
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
513 dnl This function was added in QScintilla 2.7.
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
514 dnl
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
515 AC_DEFUN([OCTAVE_CHECK_FUNC_QSCI_FINDSELECTION], [
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
516 AC_CACHE_CHECK([whether QSci has the QsciScintilla::findFirstInSelection () function],
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
517 [octave_cv_func_qsci_findfirstinselection],
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
518 [AC_LANG_PUSH(C++)
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
519 ac_octave_save_CPPFLAGS="$CPPFLAGS"
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
520 CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS"
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
521 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
522 #include <Qsci/qsciscintilla.h>
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
523 class qsci : public QsciScintilla
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
524 {
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
525 public:
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
526 qsci (QWidget *parent = 0) : QsciScintilla (parent)
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
527 { this->findFirstInSelection (QString ("x"),true,true,true,true,true); }
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
528 ~qsci () {}
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
529 };
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
530 ]], [[
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
531 qsci edit;
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
532 ]])],
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
533 octave_cv_func_qsci_findfirstinselection=yes,
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
534 octave_cv_func_qsci_findfirstinselection=no)
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
535 CPPFLAGS="$ac_octave_save_CPPFLAGS"
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
536 AC_LANG_POP(C++)
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
537 ])
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
538 if test $octave_cv_func_qsci_findfirstinselection = yes; then
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
539 AC_DEFINE(HAVE_QSCI_FINDSELECTION, 1,
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
540 [Define to 1 if Qsci has the QsciScintilla::findFirstInSelection () function.])
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
541 fi
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
542 ])
0a66861d8069 implementation of search in selection in gui editor (bbug #41196)
Torsten <ttl@justmail.de>
parents: 18216
diff changeset
543 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
544 dnl Check whether HDF5 library has version 1.6 API functions.
14605
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
545 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
546 AC_DEFUN([OCTAVE_CHECK_HDF5_HAS_VER_16_API], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
547 AC_CACHE_CHECK([whether HDF5 library has enforced version 1.6 API],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
548 [octave_cv_hdf5_has_ver_16_api],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
549 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
550 #include <hdf5.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
551 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
552 H5Eset_auto (0, 0);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
553 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
554 octave_cv_hdf5_has_ver_16_api=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
555 octave_cv_hdf5_has_ver_16_api=no)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
556 ])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
557 if test $octave_cv_hdf5_has_ver_16_api != yes; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
558 AC_DEFINE(HAVE_HDF5_18, 1, [Define to 1 if >=HDF5-1.8 is available.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
559 fi
14605
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
560 ])
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
561 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
562 dnl Usage:
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
563 dnl OCTAVE_CHECK_LIB(LIBRARY, DOC-NAME, WARN-MSG, HEADER, FUNC,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
564 dnl LANG, DOC-STRING, EXTRA-CHECK)
14605
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
565 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
566 AC_DEFUN([OCTAVE_CHECK_LIB], [
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
567 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
568 [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
569 [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
570 [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
571 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
572
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
573 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
574 [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
575 [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
576 [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
577 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
578
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
579 AC_ARG_WITH([$1],
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
580 [m4_ifblank([$7],
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
581 [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
582 [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
583 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
584
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
585 m4_toupper([$1])_LIBS=
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
586 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
587 no)
41a74dcd14df Clear QHULL_LIBS etc on errors. Interpret --without-qhull etc correctly.
David Grundberg <individ@acc.umu.se>
parents: 9531
diff changeset
588 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
589 ;;
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
590 yes | "")
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
591 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
592 ;;
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
593 -* | */* | *.a | *.so | *.so.* | *.o)
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
594 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
595 ;;
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
596 *)
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
597 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
598 ;;
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
599 esac
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
600
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
601 [TEXINFO_]m4_toupper([$1])=
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
602 warn_$1="$3"
14605
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
603 m4_set_add([summary_warning_list], [warn_$1])
28e53daab1f8 Cleanup on autoconf warnings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14550
diff changeset
604
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
605 if test -n "$m4_toupper([$1])_LIBS"; then
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
606 ac_octave_save_CPPFLAGS="$CPPFLAGS"
15350
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
607 ac_octave_save_LDFLAGS="$LDFLAGS"
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
608 ac_octave_save_LIBS="$LIBS"
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
609 CPPFLAGS="$m4_toupper([$1])_CPPFLAGS $CPPFLAGS"
15350
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
610 LDFLAGS="$m4_toupper([$1])_LDFLAGS $LDFLAGS"
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
611 LIBS="$m4_toupper([$1])_LIBS $LIBS"
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
612 m4_ifnblank([$6], [AC_LANG_PUSH($6)])
16068
b309a5da17f5 use yes/no instead of true/false in confgure scripts
John W. Eaton <jwe@octave.org>
parents: 16012
diff changeset
613 ac_octave_$1_check_for_lib=no
b309a5da17f5 use yes/no instead of true/false in confgure scripts
John W. Eaton <jwe@octave.org>
parents: 16012
diff changeset
614 m4_ifblank([$4], [ac_octave_$1_check_for_lib=yes],
b309a5da17f5 use yes/no instead of true/false in confgure scripts
John W. Eaton <jwe@octave.org>
parents: 16012
diff changeset
615 [AC_CHECK_HEADERS([$4], [ac_octave_$1_check_for_lib=yes; break])])
b309a5da17f5 use yes/no instead of true/false in confgure scripts
John W. Eaton <jwe@octave.org>
parents: 16012
diff changeset
616 if test $ac_octave_$1_check_for_lib = yes; then
15350
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
617 AC_CACHE_CHECK([for $5 in $m4_toupper([$1])_LIBS],
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
618 [octave_cv_lib_$1],
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
619 [AC_LINK_IFELSE([AC_LANG_CALL([], [$5])],
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
620 [octave_cv_lib_$1=yes], [octave_cv_lib_$1=no])
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
621 ])
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
622 if test "$octave_cv_lib_$1" = yes; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
623 m4_ifblank([$8], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
624 warn_$1=
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
625 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
626 [Define to 1 if $2 is available.])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
627 [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
628 fi
9568
d3fccc4c4b9e use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents: 9543
diff changeset
629 fi
9523
0ce82753dd72 more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents: 9520
diff changeset
630 m4_ifnblank([$6], [AC_LANG_POP($6)])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
631 CPPFLAGS="$ac_octave_save_CPPFLAGS"
15350
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
632 LDFLAGS="$ac_octave_save_LDFLAGS"
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
633 LIBS="$ac_octave_save_LIBS"
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
634 fi
15350
6a0c0d3d60b6 build: Implement some caching for OCTAVE_CHECK_LIB macro.
Rik <rik@octave.org>
parents: 15338
diff changeset
635
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
636 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
637 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
638 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
639 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
640 m4_toupper([$1])_LIBS=
9519
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
641 fi
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
642 ])
ee99f9f37505 improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
643 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
644 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
645 dnl
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
646 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
647 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
648 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
649 dnl allocated arrays in Fortran does not?
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
650 dnl
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
651 dnl FIXME: it would be nice to avoid the duplication of F77 macros
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
652 dnl and typedefs here and in the f77-fcn.h header file.
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
653 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
654 AC_DEFUN([OCTAVE_CHECK_LIB_ARPACK_OK], [
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
655 AC_CACHE_CHECK([whether the arpack library works],
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
656 [octave_cv_lib_arpack_ok],
15294
d1751eee9a42 acinclude.m4: Use AC_LANG_PUSH macro with AC_CACHE_CHECK for greater efficiency.
Rik <rik@octave.org>
parents: 15293
diff changeset
657 [AC_LANG_PUSH(C++)
d1751eee9a42 acinclude.m4: Use AC_LANG_PUSH macro with AC_CACHE_CHECK for greater efficiency.
Rik <rik@octave.org>
parents: 15293
diff changeset
658 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
659
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
660 #include <cfloat>
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
661
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
662 #include <stdint.h>
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
663
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
664 typedef OCTAVE_IDX_TYPE octave_idx_type;
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
665 typedef int F77_RET_T;
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
666
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
667 #define F77_CHAR_ARG2(x, l) x
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
668 #define F77_CONST_CHAR_ARG2(x, l) F77_CHAR_ARG2 (x, l)
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
669
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
670 #define F77_CHAR_ARG_LEN(l) , l
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
671
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
672 #define F77_CONST_CHAR_ARG_DECL const char *
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
673 #define F77_CHAR_ARG_LEN_DECL , long
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
674
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
675 extern "C"
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
676 {
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
677 F77_RET_T
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
678 F77_FUNC (dnaupd, DNAUPD) (octave_idx_type&,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
679 F77_CONST_CHAR_ARG_DECL,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
680 const octave_idx_type&,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
681 F77_CONST_CHAR_ARG_DECL,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
682 octave_idx_type&, const double&,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
683 double*, const octave_idx_type&, double*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
684 const octave_idx_type&, octave_idx_type*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
685 octave_idx_type*, double*, double*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
686 const octave_idx_type&, octave_idx_type&
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
687 F77_CHAR_ARG_LEN_DECL
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
688 F77_CHAR_ARG_LEN_DECL);
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
689
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
690 F77_RET_T
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
691 F77_FUNC (dneupd, DNEUPD) (const octave_idx_type&,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
692 F77_CONST_CHAR_ARG_DECL,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
693 octave_idx_type*, double*, double*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
694 double*, const octave_idx_type&, const double&,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
695 const double&, double*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
696 F77_CONST_CHAR_ARG_DECL,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
697 const octave_idx_type&,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
698 F77_CONST_CHAR_ARG_DECL,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
699 octave_idx_type&, const double&, double*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
700 const octave_idx_type&, double*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
701 const octave_idx_type&, octave_idx_type*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
702 octave_idx_type*, double*, double*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
703 const octave_idx_type&, octave_idx_type&
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
704 F77_CHAR_ARG_LEN_DECL
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
705 F77_CHAR_ARG_LEN_DECL
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
706 F77_CHAR_ARG_LEN_DECL);
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
707
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
708 F77_RET_T
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
709 F77_FUNC (dgemv, DGEMV) (F77_CONST_CHAR_ARG_DECL,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
710 const octave_idx_type&, const octave_idx_type&,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
711 const double&, const double*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
712 const octave_idx_type&, const double*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
713 const octave_idx_type&, const double&, double*,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
714 const octave_idx_type&
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
715 F77_CHAR_ARG_LEN_DECL);
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
716 }
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
717
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
718 void
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
719 doit (void)
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
720 {
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
721 // 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
722
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
723 // Problem matrix. See bug #31479
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
724 octave_idx_type n = 4;
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
725 double *m = new double [n * n];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
726 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
727 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
728 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
729 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
730
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
731 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
732
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
733 resid[0] = 0.960966;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
734 resid[1] = 0.741195;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
735 resid[2] = 0.150143;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
736 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
737
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
738 octave_idx_type *ip = new octave_idx_type [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
739
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
740 ip[0] = 1; // ishift
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
741 ip[1] = 0; // ip[1] not referenced
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
742 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
743 ip[3] = 1; // NB blocksize in recurrence
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
744 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
745 ip[5] = 0; // ip[5] not referenced
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
746 ip[6] = 1; // mode
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
747 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
748 ip[8] = 0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
749 ip[9] = 0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
750 ip[10] = 0;
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
751
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
752 octave_idx_type *ipntr = new octave_idx_type [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
753
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
754 octave_idx_type k = 1;
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
755 octave_idx_type p = 3;
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
756 octave_idx_type lwork = 3 * p * (p + 2);
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
757
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
758 double *v = new double [n * (p + 1)];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
759 double *workl = new double [lwork + 1];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
760 double *workd = new double [3 * n + 1];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
761
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
762 octave_idx_type ido = 0;
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
763 octave_idx_type 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
764
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
765 double tol = DBL_EPSILON;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
766
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
767 do
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
768 {
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
769 F77_FUNC (dnaupd, DNAUPD) (ido, F77_CONST_CHAR_ARG2 ("I", 1),
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
770 n, F77_CONST_CHAR_ARG2 ("LM", 2),
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
771 k, tol, resid, p, v, n, ip, ipntr,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
772 workd, workl, lwork, info
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
773 F77_CHAR_ARG_LEN (1)
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
774 F77_CHAR_ARG_LEN (2));
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
775
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
776 if (ido == -1 || ido == 1 || ido == 2)
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
777 {
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
778 double *x = workd + ipntr[0] - 1;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
779 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
780
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
781 F77_FUNC (dgemv, DGEMV) (F77_CONST_CHAR_ARG2 ("N", 1),
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
782 n, n, 1.0, m, n, x, 1, 0.0, y, 1
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
783 F77_CHAR_ARG_LEN (1));
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
784 }
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
785 else
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
786 {
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
787 if (info < 0)
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
788 {
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
789 return; // Error
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
790 }
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
791
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
792 break;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
793 }
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
794 }
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
795 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
796
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
797 octave_idx_type *sel = new octave_idx_type [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
798
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
799 // 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
800 double *dr = new double [k + 1];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
801 double *di = new double [k + 1];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
802 double *workev = new double [3 * p];
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
803
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
804 for (octave_idx_type i = 0; i < k + 1; i++)
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
805 dr[i] = di[i] = 0.;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
806
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
807 octave_idx_type 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
808
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
809 double sigmar = 0.0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
810 double sigmai = 0.0;
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
811
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
812 // In Octave, this is n*(k+1), but n*(k+2) avoids segfault
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
813 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
814
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
815 F77_FUNC (dneupd, DNEUPD) (rvec, F77_CONST_CHAR_ARG2 ("A", 1),
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
816 sel, dr, di, z, n, sigmar, sigmai, workev,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
817 F77_CONST_CHAR_ARG2 ("I", 1), n,
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
818 F77_CONST_CHAR_ARG2 ("LM", 2), k, tol,
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
819 resid, p, v, n, ip, ipntr, workd,
18058
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
820 workl, lwork, info
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
821 F77_CHAR_ARG_LEN (1)
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
822 F77_CHAR_ARG_LEN (1)
46ca76f194cb make arpack check work with --enable-64
John W. Eaton <jwe@octave.org>
parents: 18036
diff changeset
823 F77_CHAR_ARG_LEN (2));
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
824 }
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
825
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
826 ]], [[
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
827
14147
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
828 for (int i = 0; i < 10; i++)
71e28fda7be9 use C++ program to test ARPACK
John W. Eaton <jwe@octave.org>
parents: 14144
diff changeset
829 doit ();
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
830 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
831 octave_cv_lib_arpack_ok=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
832 octave_cv_lib_arpack_ok=no,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
833 octave_cv_lib_arpack_ok=yes)
15294
d1751eee9a42 acinclude.m4: Use AC_LANG_PUSH macro with AC_CACHE_CHECK for greater efficiency.
Rik <rik@octave.org>
parents: 15293
diff changeset
834 AC_LANG_POP(C++)
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
835 ])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
836 if test $octave_cv_lib_arpack_ok = yes; then
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
837 $1
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
838 :
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
839 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
840 $2
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
841 :
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
842 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
843 ])
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
844 dnl
17241
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
845 dnl Check whether GLPK provides the latest API functions required
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
846 dnl for the glpk function. The glp_iptcp structure was introduced
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
847 dnl in GLPK version 4.38.
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
848 dnl
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
849 AC_DEFUN([OCTAVE_CHECK_LIB_GLPK_OK], [
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
850 AC_CACHE_CHECK([whether the glpk library has glp_interior(glp_prob*, glp_iptcp*)],
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
851 [octave_cv_lib_glpk_ok],
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
852 [AC_LANG_PUSH(C++)
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
853 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
854 extern "C"
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
855 {
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
856 #if defined (HAVE_GLPK_GLPK_H)
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
857 #include <glpk/glpk.h>
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
858 #else
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
859 #include <glpk.h>
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
860 #endif
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
861 }
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
862 ]], [[
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
863 glp_prob *lp = glp_create_prob ();
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
864 glp_iptcp iptcp;
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
865 glp_init_iptcp (&iptcp);
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
866 int retval = glp_interior (lp, &iptcp);
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
867 ]])],
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
868 octave_cv_lib_glpk_ok=yes,
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
869 octave_cv_lib_glpk_ok=no)
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
870 AC_LANG_POP(C++)
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
871 ])
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
872 if test $octave_cv_lib_glpk_ok = yes; then
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
873 $1
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
874 :
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
875 else
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
876 $2
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
877 :
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
878 fi
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
879 ])
03a666018e0f build: Detect new GLPK API features required since changeset 54e251e699bb
Mike Miller <mtmiller@ieee.org>
parents: 17197
diff changeset
880 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
881 dnl Check whether using HDF5 DLL under Windows. This is done by
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
882 dnl testing for a data symbol in the HDF5 library, which would
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
883 dnl require the definition of _HDF5USEDL_ under MSVC compiler.
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
884 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
885 AC_DEFUN([OCTAVE_CHECK_LIB_HDF5_DLL], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
886 AC_CACHE_CHECK([if _HDF5USEDLL_ needs to be defined],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
887 [octave_cv_lib_hdf5_dll],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
888 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
889 #include <hdf5.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
890 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
891 hid_t x = H5T_NATIVE_DOUBLE;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
892 return x
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
893 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
894 [octave_cv_lib_hdf5_dll=no],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
895 [save_CFLAGS="$CFLAGS"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
896 CFLAGS="$CFLAGS -DWIN32 -D_HDF5USEDLL_"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
897 save_LIBS="$LIBS"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
898 LIBS="$HDF5_LIBS $LIBS"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
899 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
900 #include <hdf5.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
901 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
902 hid_t x = H5T_NATIVE_DOUBLE;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
903 return x
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
904 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
905 octave_cv_lib_hdf5_dll=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
906 octave_cv_lib_hdf5_dll=no)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
907 CFLAGS="$save_CFLAGS"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
908 LIBS="$save_LIBS"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
909 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
910 ])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
911 if test $octave_cv_lib_hdf5_dll = yes; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
912 AC_DEFINE(_HDF5USEDLL_, 1, [Define to 1 if using HDF5 dll (Win32).])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
913 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
914 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
915 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
916 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
917 dnl
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
918 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
919 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
920 dnl
15063
36cbcc37fdb8 Refactor configure.ac to make it more understandable.
Rik <rik@octave.org>
parents: 15013
diff changeset
921 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
922 dnl libraries and header files?
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
923 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
924 AC_DEFUN([OCTAVE_CHECK_LIB_OPENGL], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
925 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
926
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
927 ## On MacOSX systems the OpenGL framework can be used
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
928 OCTAVE_HAVE_FRAMEWORK(OpenGL, [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
929 #include <OpenGL/gl.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
930 #include <OpenGL/glu.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
931 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
932 GLint par; glGetIntegerv (GL_VIEWPORT, &par);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
933 ]],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
934 have_framework_opengl=yes, have_framework_opengl=no)
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
935
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
936 if test $have_framework_opengl = yes; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
937 AC_DEFINE(HAVE_FRAMEWORK_OPENGL, 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
938 [Define to 1 if framework OPENGL is available.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
939 OPENGL_LIBS="-Wl,-framework -Wl,OpenGL"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
940 AC_MSG_NOTICE([adding -Wl,-framework -Wl,OpenGL to OPENGL_LIBS])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
941 OCTAVE_CHECK_FUNC_GLUTESSCALLBACK_THREEDOTS
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
942 else
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
943 case $canonical_host_type in
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
944 *-*-mingw32* | *-*-msdosmsvc)
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
945 AC_CHECK_HEADERS([windows.h])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
946 ;;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
947 esac
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
948 have_opengl_incs=no
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
949 AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
950 [AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
951 [have_opengl_incs=yes; break], [], [
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
952 #ifdef HAVE_WINDOWS_H
7954
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
953 #include <windows.h>
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
954 #endif
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
955 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
956 break
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
957 ], [], [
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
958 #ifdef HAVE_WINDOWS_H
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
959 # include <windows.h>
7954
3ffc34caec65 configure fixes
John W. Eaton <jwe@octave.org>
parents: 7945
diff changeset
960 #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
961 ])
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
962
17197
fbee0d312af5 acinclude.m4: Remove some unnecessary double quotes around variables.
Rik <rik@octave.org>
parents: 17196
diff changeset
963 if test $have_opengl_incs = yes; then
18866
95b69b880b19 Allow conpile of gl-render.cc under mingw.
John Donoghue
parents: 18854
diff changeset
964 AC_CHECK_HEADERS([GL/glext.h OpenGL/glext.h], [], [], [
95b69b880b19 Allow conpile of gl-render.cc under mingw.
John Donoghue
parents: 18854
diff changeset
965 #ifdef HAVE_WINDOWS_H
95b69b880b19 Allow conpile of gl-render.cc under mingw.
John Donoghue
parents: 18854
diff changeset
966 # include <windows.h>
95b69b880b19 Allow conpile of gl-render.cc under mingw.
John Donoghue
parents: 18854
diff changeset
967 #endif
95b69b880b19 Allow conpile of gl-render.cc under mingw.
John Donoghue
parents: 18854
diff changeset
968 #if defined (HAVE_GL_GL_H)
95b69b880b19 Allow conpile of gl-render.cc under mingw.
John Donoghue
parents: 18854
diff changeset
969 # include <GL/gl.h>
95b69b880b19 Allow conpile of gl-render.cc under mingw.
John Donoghue
parents: 18854
diff changeset
970 #elif defined (HAVE_OPENGL_GL_H)
95b69b880b19 Allow conpile of gl-render.cc under mingw.
John Donoghue
parents: 18854
diff changeset
971 # include <OpenGL/gl.h>
95b69b880b19 Allow conpile of gl-render.cc under mingw.
John Donoghue
parents: 18854
diff changeset
972 #endif
95b69b880b19 Allow conpile of gl-render.cc under mingw.
John Donoghue
parents: 18854
diff changeset
973 ])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
974 case $canonical_host_type in
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
975 *-*-mingw32* | *-*-msdosmsvc)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
976 save_LIBS="$LIBS"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
977 LIBS="$LIBS -lopengl32"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
978 AC_MSG_CHECKING([for glEnable in -lopengl32])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
979 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
980 #if HAVE_WINDOWS_H
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
981 # include <windows.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
982 #endif
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
983 #if defined (HAVE_GL_GL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
984 # include <GL/gl.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
985 #elif defined (HAVE_OPENGL_GL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
986 # include <OpenGL/gl.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
987 #endif
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
988 ]], [[
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
989 glEnable(GL_SMOOTH);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
990 ]])], [OPENGL_LIBS="-lopengl32 -lglu32"])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
991
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
992 LIBS="$save_LIBS"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
993 if test "x$OPENGL_LIBS" != "x"; then
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
994 AC_MSG_RESULT([yes])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
995 else
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
996 AC_MSG_RESULT([no])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
997 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
998 ;;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
999 *)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1000 ## Non-Mac, Non-Windows systems use this check
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
1001 AC_CHECK_LIB([GL], [glEnable], [OPENGL_LIBS="-lGL -lGLU"])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1002 ;;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1003 esac
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1004 fi
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
1005 fi
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1006 AC_SUBST(OPENGL_LIBS)
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1007 ])
7834
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1008 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1009 dnl Check whether Qhull works (does not crash).
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
1010 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1011 AC_DEFUN([OCTAVE_CHECK_LIB_QHULL_OK], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1012 AC_CACHE_CHECK([whether the qhull library works],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1013 [octave_cv_lib_qhull_ok],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1014 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1015 #include <stdio.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1016 #if defined (HAVE_LIBQHULL_LIBQHULL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1017 # include <libqhull/libqhull.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1018 # include <libqhull/qset.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1019 # include <libqhull/geom.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1020 # include <libqhull/poly.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1021 # include <libqhull/io.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1022 #elif defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1023 # if defined (HAVE_QHULL_LIBQHULL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1024 # include <qhull/libqhull.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1025 # else
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1026 # include <qhull/qhull.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1027 # endif
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1028 # include <qhull/qset.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1029 # include <qhull/geom.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1030 # include <qhull/poly.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1031 # include <qhull/io.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1032 #elif defined (HAVE_LIBQHULL_H) || defined (HAVE_QHULL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1033 # if defined (HAVE_LIBQHULL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1034 # include <libqhull.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1035 # else
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1036 # include <qhull.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1037 # endif
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1038 # include <qset.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1039 # include <geom.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1040 # include <poly.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1041 # include <io.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1042 #endif
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1043 #ifdef NEED_QHULL_VERSION
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1044 char *qh_version = "version";
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1045 #endif
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1046 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1047 int dim = 2;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1048 int n = 4;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1049 coordT points[8] = { -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5 };
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1050 boolT ismalloc = 0;
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1051 return qh_new_qhull (dim, n, points, ismalloc, "qhull ", 0, stderr);
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1052 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1053 octave_cv_lib_qhull_ok=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1054 octave_cv_lib_qhull_ok=no,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1055 octave_cv_lib_qhull_ok=yes)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1056 ])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1057 if test $octave_cv_lib_qhull_ok = yes; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1058 $1
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1059 :
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1060 else
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1061 $2
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1062 :
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1063 fi
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
1064 ])
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
1065 dnl
15302
a8cfbc1911e4 build: Set TERM_LIBS before checking for READLINE.
Rik <rik@octave.org>
parents: 15295
diff changeset
1066 dnl Find a suitable termlib to use.
a8cfbc1911e4 build: Set TERM_LIBS before checking for READLINE.
Rik <rik@octave.org>
parents: 15295
diff changeset
1067 dnl
a8cfbc1911e4 build: Set TERM_LIBS before checking for READLINE.
Rik <rik@octave.org>
parents: 15295
diff changeset
1068 AC_DEFUN([OCTAVE_CHECK_LIB_TERMLIB], [
a8cfbc1911e4 build: Set TERM_LIBS before checking for READLINE.
Rik <rik@octave.org>
parents: 15295
diff changeset
1069 TERM_LIBS=
15338
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1070 ac_octave_save_LIBS="$LIBS"
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1071 AC_SEARCH_LIBS([tputs],
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1072 [ncurses curses termcap terminfo termlib],
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1073 [], [])
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1074 LIBS="$ac_octave_save_LIBS"
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1075 case "$ac_cv_search_tputs" in
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1076 -l*)
15338
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1077 TERM_LIBS="$ac_cv_search_tputs"
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1078 ;;
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1079 no)
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1080 warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, or -ltermlib!"
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1081 AC_MSG_WARN([$warn_termlibs])
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1082 ;;
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1083 esac
15302
a8cfbc1911e4 build: Set TERM_LIBS before checking for READLINE.
Rik <rik@octave.org>
parents: 15295
diff changeset
1084
15338
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1085 dnl Old code (9/9/2012). Delete when new code is definitely proven.
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1086 dnl
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1087 dnl for _termlib in ncurses curses termcap terminfo termlib; do
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1088 dnl AC_CHECK_LIB([${_termlib}], [tputs], [
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1089 dnl TERM_LIBS="-l${termlib}"
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1090 dnl octave_cv_lib_found_termlib=yes
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1091 dnl break])
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1092 dnl done
dc39c1d84c5b build: Use caching on more intermediate results to speed up configure.
Rik <rik@octave.org>
parents: 15336
diff changeset
1093
15302
a8cfbc1911e4 build: Set TERM_LIBS before checking for READLINE.
Rik <rik@octave.org>
parents: 15295
diff changeset
1094 AC_SUBST(TERM_LIBS)
7825
13871b7de124 Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7361
diff changeset
1095 ])
7834
caab78e7e377 added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents: 7825
diff changeset
1096 dnl
15133
f91eac1bc66d m4/acinclude.m4: Correct typos, use consistent style for describing macros.
Rik <rik@octave.org>
parents: 15126
diff changeset
1097 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
1098 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
1099 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
1100 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1101 AC_DEFUN([OCTAVE_CHECK_OPENMP], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1102 AC_MSG_CHECKING([for support of OpenMP])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1103 ac_octave_save_CFLAGS="$CFLAGS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1104 CFLAGS="$CFLAGS $1"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1105 AC_CACHE_VAL([octave_cv_check_openmp],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1106 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1107 #include <omp.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1108 #include <stdio.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1109 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1110 int main(int argc, char* argv[])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1111 {
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1112 _Pragma("omp parallel")
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1113 printf("Hello, world.\n");
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1114 return 0;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1115 }
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1116 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1117 octave_cv_openmp=yes, octave_cv_openmmp=no, octave_cv_openmp=no)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1118 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1119 AC_MSG_RESULT([$octave_cv_openmp])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1120 if test $octave_cv_openmp = yes; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1121 AC_DEFINE(HAVE_OPENMP, 1, [Define to 1 if compiler supports OpenMP.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1122 CXXFLAGS="$CXXFLAGS $1"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1123 else
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1124 CFLAGS="$ac_octave_save_CFLAGS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1125 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1126 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1127 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1128 dnl Check for the Qhull version.
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
1129 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1130 AC_DEFUN([OCTAVE_CHECK_QHULL_VERSION], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1131 AC_CACHE_CHECK([for qh_version in $QHULL_LIBS],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1132 [octave_cv_lib_qhull_version],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1133 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1134 #include <stdio.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1135 #if defined (HAVE_LIBQHULL_LIBQHULL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1136 # include <libqhull/libqhull.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1137 # include <libqhull/qset.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1138 # include <libqhull/geom.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1139 # include <libqhull/poly.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1140 # include <libqhull/io.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1141 #elif defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1142 # if defined (HAVE_QHULL_LIBQHULL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1143 # include <qhull/libqhull.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1144 # else
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1145 # include <qhull/qhull.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1146 # endif
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1147 # include <qhull/qset.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1148 # include <qhull/geom.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1149 # include <qhull/poly.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1150 # include <qhull/io.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1151 #elif defined (HAVE_LIBQHULL_H) || defined (HAVE_QHULL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1152 # if defined (HAVE_LIBQHULL_H)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1153 # include <libqhull.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1154 # else
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1155 # include <qhull.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1156 # endif
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1157 # include <qset.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1158 # include <geom.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1159 # include <poly.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1160 # include <io.h>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1161 #endif
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1162 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1163 const char *tmp = qh_version;
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1164 ]])],
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1165 octave_cv_lib_qhull_version=yes, octave_cv_lib_qhull_version=no)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1166 ])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1167 if test $octave_cv_lib_qhull_version = no; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1168 AC_DEFINE(NEED_QHULL_VERSION, 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1169 [Define to 1 if the Qhull library needs a qh_version variable defined.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1170 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1171 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1172 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1173 dnl Check if the default Fortran INTEGER is 64 bits wide.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1174 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1175 AC_DEFUN([OCTAVE_CHECK_SIZEOF_FORTRAN_INTEGER], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1176 AC_CACHE_CHECK([whether $F77 generates correct size integers],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1177 [octave_cv_sizeof_fortran_integer],
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1178 [ac_octave_save_FFLAGS="$FFLAGS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1179 FFLAGS="$FFLAGS $F77_INTEGER_8_FLAG"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1180 AC_LANG_PUSH(Fortran 77)
17978
86846ce0371a acinclude.m4: Clean up indentation of Fortran code tests.
Rik <rik@octave.org>
parents: 17967
diff changeset
1181 AC_COMPILE_IFELSE([[
86846ce0371a acinclude.m4: Clean up indentation of Fortran code tests.
Rik <rik@octave.org>
parents: 17967
diff changeset
1182 subroutine foo(n, in, out)
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1183 integer n, in(n), out(n)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1184 integer i
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1185 do 10 i = 1, n
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1186 out(i) = in(i)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1187 10 continue
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1188 return
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1189 end
17978
86846ce0371a acinclude.m4: Clean up indentation of Fortran code tests.
Rik <rik@octave.org>
parents: 17967
diff changeset
1190 ]],
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1191 [mv conftest.$ac_objext fintsize.$ac_objext
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1192 ac_octave_save_LIBS="$LIBS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1193 LIBS="fintsize.$ac_objext $[]_AC_LANG_PREFIX[]LIBS"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1194 AC_LANG_PUSH(C)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1195 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
16313
6aafe87a3144 use int64_t for idx type if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16202
diff changeset
1196 #include <assert.h>
17978
86846ce0371a acinclude.m4: Clean up indentation of Fortran code tests.
Rik <rik@octave.org>
parents: 17967
diff changeset
1197 #include <stdint.h>
86846ce0371a acinclude.m4: Clean up indentation of Fortran code tests.
Rik <rik@octave.org>
parents: 17967
diff changeset
1198 ]], [[
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1199 #ifdef USE_64_BIT_IDX_T
16313
6aafe87a3144 use int64_t for idx type if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16202
diff changeset
1200 typedef int64_t octave_idx_type;
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1201 #else
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1202 typedef int octave_idx_type;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1203 #endif
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1204 octave_idx_type n = 2;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1205 octave_idx_type in[2];
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1206 octave_idx_type out[2];
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1207 in[0] = 13;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1208 in[0] = 42;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1209 F77_FUNC(foo,FOO) (&n, &in, &out);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1210 assert (in[0] == out[0] && in[1] == out[1]);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1211 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1212 octave_cv_sizeof_fortran_integer=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1213 octave_cv_sizeof_fortran_integer=no,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1214 octave_cv_sizeof_fortran_integer=yes)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1215 AC_LANG_POP(C)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1216 LIBS="$ac_octave_save_LIBS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1217 rm -f conftest.$ac_objext fintsize.$ac_objext],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1218 [rm -f conftest.$ac_objext
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1219 AC_MSG_FAILURE([cannot compile a simple Fortran program])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1220 octave_cv_sizeof_fortran_integer=no])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1221 AC_LANG_POP(Fortran 77)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1222 FFLAGS="$ac_octave_save_FFLAGS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1223 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1224 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1225 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1226 dnl Add warning to final summary.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1227 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1228 AC_DEFUN([OCTAVE_CONFIGURE_WARNING], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1229 AC_MSG_WARN([$][$1])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1230 m4_set_add([summary_warning_list], [$1])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1231 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1232 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1233 dnl Print final summary.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1234 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1235 AC_DEFUN([OCTAVE_CONFIGURE_WARNING_SUMMARY], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1236 m4_set_foreach([summary_warning_list], [elt], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1237 if test -n "[$]elt"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1238 AC_MSG_WARN([$]elt)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1239 warn_msg_printed=true
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1240 fi])
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
1241 ])
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
1242 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1243 dnl Check if the C++ library has the bit_and, bit_or, and bit_xor
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1244 dnl templates defined.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1245 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1246 AC_DEFUN([OCTAVE_CXX_BITWISE_OP_TEMPLATES], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1247 AC_CACHE_CHECK([whether bit_and, bit_or, bit_xor are defined in the C++ library],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1248 [octave_cv_cxx_bitwise_op_templates],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1249 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1250 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1251 #include <functional>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1252 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1253 int x = 0;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1254 int y = 1;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1255 int z1 = std::bit_and<int>() (x, y);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1256 int z2 = std::bit_or<int>() (x, y);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1257 int z3 = std::bit_xor<int>() (x, y);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1258 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1259 octave_cv_cxx_bitwise_op_templates=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1260 octave_cv_cxx_bitwise_op_templates=no)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1261 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1262 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1263 if test $octave_cv_cxx_bitwise_op_templates = yes; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1264 AC_DEFINE(HAVE_CXX_BITWISE_OP_TEMPLATES, 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1265 [Define to 1 if C++ library has templated bitwise operators.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1266 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1267 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1268 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1269 dnl Check if C++ reinterpret cast works for function pointers.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1270 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1271 AC_DEFUN([OCTAVE_CXX_BROKEN_REINTERPRET_CAST],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1272 [AC_REQUIRE([AC_PROG_CXX])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1273 AC_CACHE_CHECK([for broken C++ reinterpret_cast],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1274 [octave_cv_cxx_broken_reinterpret_cast],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1275 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1276 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1277 #include <cmath> ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1278 typedef double (*fptr) (double);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1279 fptr psin = sin;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1280 void *vptr = reinterpret_cast<void *> (psin);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1281 psin = reinterpret_cast<fptr> (vptr);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1282 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1283 octave_cv_cxx_broken_reinterpret_cast=no,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1284 octave_cv_cxx_broken_reinterpret_cast=yes)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1285 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1286 ])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1287 if test $octave_cv_cxx_broken_reinterpret_cast = yes; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1288 AC_DEFINE(CXX_BROKEN_REINTERPRET_CAST, 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1289 [Define to 1 if C++ reinterpret_cast fails for function pointers.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1290 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1291 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1292 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1293 dnl Check if the C++ library has functions to access real and imaginary
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1294 dnl parts of complex numbers independently via references.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1295 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1296 AC_DEFUN([OCTAVE_CXX_COMPLEX_REFERENCE_ACCESSORS], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1297 AC_CACHE_CHECK([whether complex class can reference components independently],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1298 [octave_cv_cxx_complex_reference_accessors],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1299 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1300 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1301 #include <complex>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1302 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1303 std::complex<double> x;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1304 x.real () = 1.0;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1305 x.imag () = 1.0;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1306 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1307 octave_cv_cxx_complex_reference_accessors=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1308 octave_cv_cxx_complex_reference_accessors=no)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1309 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1310 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1311 if test $octave_cv_cxx_complex_reference_accessors = yes; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1312 AC_DEFINE(HAVE_CXX_COMPLEX_REFERENCE_ACCESSORS, 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1313 [Define to 1 if C++ complex class has T& real (void) and T& imag (void) methods.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1314 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1315 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1316 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1317 dnl Check if the C++ library has functions to set real and imaginary
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1318 dnl parts of complex numbers independently.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1319 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1320 AC_DEFUN([OCTAVE_CXX_COMPLEX_SETTERS], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1321 AC_CACHE_CHECK([whether complex class can set components independently],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1322 [octave_cv_cxx_complex_setters],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1323 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1324 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1325 #include <complex>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1326 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1327 std::complex<double> x;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1328 x.real (1.0);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1329 x.imag (2.0);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1330 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1331 octave_cv_cxx_complex_setters=yes, octave_cv_cxx_complex_setters=no)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1332 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1333 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1334 if test $octave_cv_cxx_complex_setters = yes; then
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1335 AC_DEFINE(HAVE_CXX_COMPLEX_SETTERS, 1,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1336 [Define to 1 if C++ complex class has void real (T) and void imag (T) methods.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1337 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1338 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1339 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1340 dnl Check if the compiler supports dynamic auto arrays.
10471
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1341 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1342 AC_DEFUN([OCTAVE_CXX_DYNAMIC_AUTO_ARRAYS], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1343 AC_CACHE_CHECK([whether C++ supports dynamic auto arrays],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1344 [octave_cv_cxx_dynamic_auto_arrays],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1345 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1346 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1347 void test(char *);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1348 int length();
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1349 char x[length()];
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1350 test(x);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1351 ]])],
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1352 octave_cv_cxx_dynamic_auto_arrays=yes,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1353 octave_cv_cxx_dynamic_auto_arrays=no)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1354 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1355 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1356 if test $octave_cv_cxx_dynamic_auto_arrays = yes; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1357 AC_DEFINE(HAVE_DYNAMIC_AUTO_ARRAYS, 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1358 [Define to 1 if C++ supports dynamic auto arrays.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1359 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1360 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1361 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1362 dnl Check if C++ compiler handles FLAG command line option. If two
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1363 dnl arguments are specified, execute the second arg as shell commands.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1364 dnl Otherwise, add FLAG to CXXFLAGS if the compiler accepts the flag.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1365 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1366 AC_DEFUN([OCTAVE_CXX_FLAG], [
17661
1978a6c76aa9 Use user-specified SED during build process (bug #40273).
Rik <rik@octave.org>
parents: 17615
diff changeset
1367 ac_safe=`echo "$1" | $SED 'y%./+-:=%__p___%'`
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1368 AC_MSG_CHECKING([whether ${CXX-g++} accepts $1])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1369 AC_CACHE_VAL([octave_cv_cxx_flag_$ac_safe],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1370 [AC_LANG_PUSH(C++)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1371 ac_octave_save_CXXFLAGS="$CXXFLAGS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1372 CXXFLAGS="$CXXFLAGS $1"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1373 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1374 eval "octave_cv_cxx_flag_$ac_safe=yes",
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1375 eval "octave_cv_cxx_flag_$ac_safe=no")
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1376 CXXFLAGS="$ac_octave_save_CXXFLAGS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1377 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1378 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1379 if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
1380 AC_MSG_RESULT([yes])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1381 ifelse([$2], ,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1382 [CXXFLAGS="$CXXFLAGS $1"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1383 AC_MSG_RESULT([adding $1 to CXXFLAGS])], [$2])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1384 else
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
1385 AC_MSG_RESULT([no])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1386 ifelse([$3], , , [$3])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1387 fi
10471
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1388 ])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1389 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1390 dnl Check if the C++ library is ISO compliant.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1391 dnl FIXME: This is obviously very simplistic, and trivially fooled.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1392 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1393 AC_DEFUN([OCTAVE_CXX_ISO_COMPLIANT_LIBRARY], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1394 AC_REQUIRE([AC_PROG_CXX])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1395 AC_MSG_CHECKING([if C++ library is ISO compliant])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1396 AC_CACHE_VAL([octave_cv_cxx_iso_compliant_library],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1397 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1398 rm -f conftest.h
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1399 ## Omitting cwctype for now, since it is broken with gcc-3.0.x and
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1400 ## possibly other versions...
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1401 for inc in algorithm bitset cassert cctype cerrno cfloat ciso646 \
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1402 climits clocale cmath complex csetjmp csignal cstdarg cstddef \
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1403 cstdio cstdlib cstring ctime cwchar deque exception \
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1404 fstream functional iomanip ios iosfwd iostream istream iterator \
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1405 limits list locale map memory new numeric ostream queue set \
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1406 sstream stack stdexcept streambuf string strstream typeinfo \
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1407 utility valarray vector; do
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1408 echo "#include <$inc>" >> conftest.h
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1409 done
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1410 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1411 #include "conftest.h"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1412 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1413 std::bitset<50> flags;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1414 flags.set();
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1415 int digits = std::numeric_limits<unsigned long>::digits;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1416 digits = 0;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1417 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1418 octave_cv_cxx_iso_compliant_library=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1419 octave_cv_cxx_iso_compliant_library=no)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1420 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1421 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1422 AC_MSG_RESULT([$octave_cv_cxx_iso_compliant_library])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1423 if test $octave_cv_cxx_iso_compliant_library = yes; then
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1424 AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY, 1,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1425 [Define to 1 if your C++ runtime library is ISO compliant.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1426 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1427 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1428 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1429 dnl Check if C++ compiler needs the new friend template declaration
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1430 dnl syntax.
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1431 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1432 AC_DEFUN([OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1433 AC_REQUIRE([AC_PROG_CXX])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1434 AC_MSG_CHECKING([for C++ support for new friend template declaration])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1435 AC_CACHE_VAL([octave_cv_cxx_new_friend_template_decl],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1436 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1437 rm -f conftest.h
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1438 cat > conftest.h <<EOB
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1439 struct A {
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1440 friend int operator== (const A&, const A&);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1441 A (int) { }
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1442 };
8169
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1443
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1444 template <class T> int
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1445 operator== (const T&, const T&)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1446 {
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1447 return 0;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1448 }
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1449 EOB
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1450 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1451 #include "conftest.h"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1452 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1453 A a (1);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1454 return a == A(1);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1455 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1456 octave_cv_cxx_new_friend_template_decl=no,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1457 octave_cv_cxx_new_friend_template_decl=yes)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1458 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1459 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1460 AC_MSG_RESULT([$octave_cv_cxx_new_friend_template_decl])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1461 if test $octave_cv_cxx_new_friend_template_decl = yes; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1462 AC_DEFINE(CXX_NEW_FRIEND_TEMPLATE_DECL, 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1463 [Define to 1 if your compiler supports `<>' stuff for template friends.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1464 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1465 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1466 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1467 dnl Check if the compiler supports placement delete.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1468 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1469 AC_DEFUN([OCTAVE_CXX_PLACEMENT_DELETE], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1470 AC_CACHE_CHECK([whether <new> defines placement delete operator],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1471 [octave_cv_cxx_placement_delete],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1472 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1473 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1474 #include <new>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1475 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1476 operator delete((void *)0, (void *)0);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1477 ]])],
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1478 octave_cv_cxx_placement_delete=yes,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1479 octave_cv_cxx_placement_delete=no)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1480 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1481 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1482 if test $octave_cv_cxx_placement_delete = yes; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1483 AC_DEFINE(HAVE_PLACEMENT_DELETE, 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1484 [Define to 1 if C++ supports operator delete(void *, void *).])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1485 fi
8998
a48fba01e4ac optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
1486 ])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1487 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1488 dnl Allow the user disable support for command line editing using GNU
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1489 dnl readline.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1490 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1491 AC_DEFUN([OCTAVE_ENABLE_READLINE], [
16068
b309a5da17f5 use yes/no instead of true/false in confgure scripts
John W. Eaton <jwe@octave.org>
parents: 16012
diff changeset
1492 USE_READLINE=yes
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1493 READLINE_LIBS=
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
1494 AC_ARG_ENABLE([readline],
15238
c4779a180134 avoid confusing --disable-foo (default is yes) configure help messages
John W. Eaton <jwe@octave.org>
parents: 15166
diff changeset
1495 [AS_HELP_STRING([--disable-readline],
18141
5e72998000fb acinclude.m4 (OCTAVE_ENABLE_READLINE): correct the help for --disable-readline
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 18058
diff changeset
1496 [do not use readline library])],
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1497 [if test "$enableval" = no; then
16068
b309a5da17f5 use yes/no instead of true/false in confgure scripts
John W. Eaton <jwe@octave.org>
parents: 16012
diff changeset
1498 USE_READLINE=no
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1499 warn_readline="command editing and history features require GNU Readline"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1500 fi])
16068
b309a5da17f5 use yes/no instead of true/false in confgure scripts
John W. Eaton <jwe@octave.org>
parents: 16012
diff changeset
1501 if test $USE_READLINE = yes; then
15302
a8cfbc1911e4 build: Set TERM_LIBS before checking for READLINE.
Rik <rik@octave.org>
parents: 15295
diff changeset
1502 dnl RHEL 5 and older systems require termlib set before enabling readline
a8cfbc1911e4 build: Set TERM_LIBS before checking for READLINE.
Rik <rik@octave.org>
parents: 15295
diff changeset
1503 AC_REQUIRE([OCTAVE_CHECK_LIB_TERMLIB])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1504 ac_octave_save_LIBS="$LIBS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1505 LIBS="$TERM_LIBS"
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
1506 AC_CHECK_LIB([readline], [rl_set_keyboard_input_timeout],
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1507 [READLINE_LIBS="-lreadline"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1508 AC_DEFINE(USE_READLINE, 1, [Define to 1 to use the readline library.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1509 ],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1510 [AC_MSG_WARN([I need GNU Readline 4.2 or later])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1511 AC_MSG_ERROR([this is fatal unless you specify --disable-readline])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1512 ])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1513 LIBS="$ac_octave_save_LIBS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1514 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1515 AC_SUBST(READLINE_LIBS)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1516 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1517 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1518 dnl Check if Fortran compiler handles FLAG command line option. If
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1519 dnl two arguments are specified, execute the second arg as shell
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1520 dnl commands. Otherwise, add FLAG to FFLAGS if the compiler accepts
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1521 dnl the flag.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1522 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1523 AC_DEFUN([OCTAVE_F77_FLAG], [
17661
1978a6c76aa9 Use user-specified SED during build process (bug #40273).
Rik <rik@octave.org>
parents: 17615
diff changeset
1524 ac_safe=`echo "$1" | $SED 'y%./+-:=%__p___%'`
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1525 AC_MSG_CHECKING([whether ${F77-g77} accepts $1])
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
1526 AC_CACHE_VAL([octave_cv_f77_flag_$ac_safe], [
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1527 AC_LANG_PUSH(Fortran 77)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1528 ac_octave_save_FFLAGS="$FFLAGS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1529 FFLAGS="$FFLAGS $1"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1530 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1531 eval "octave_cv_f77_flag_$ac_safe=yes",
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1532 eval "octave_cv_f77_flag_$ac_safe=no")
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1533 FFLAGS="$ac_octave_save_FFLAGS"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1534 AC_LANG_POP(Fortran 77)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1535 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1536 if eval "test \"`echo '$octave_cv_f77_flag_'$ac_safe`\" = yes"; then
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
1537 AC_MSG_RESULT([yes])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1538 ifelse([$2], ,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1539 [FFLAGS="$FFLAGS $1"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1540 AC_MSG_RESULT([adding $1 to FFLAGS])], [$2])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1541 else
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
1542 AC_MSG_RESULT([no])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1543 ifelse([$3], , , [$3])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1544 fi
10471
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1545 ])
bcabc1c4f20c Add detection of OpenMP support to configure. Disabled by default
David Bateman <dbateman@free.fr>
parents: 10380
diff changeset
1546 dnl
8169
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1547 dnl Check whether fast signed integer arithmetics using bit tricks
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1548 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
1549 dnl the following conditions hold:
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1550 dnl 1. Signed numbers are represented by twos complement
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1551 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
1552 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
1553 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
1554 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
1555 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
1556 dnl need for things like -ftrapv).
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1557 dnl 4. Bit operations on signed integers work like on unsigned integers,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1558 dnl except for the shifts. Shifts are arithmetic.
8169
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1559 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1560 AC_DEFUN([OCTAVE_FAST_INT_OPS], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1561 AC_CACHE_CHECK([whether fast integer arithmetics is usable],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1562 [octave_cv_fast_int_ops],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1563 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1564 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1565 #include <limits>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1566 template<class UT, class ST>
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1567 static bool
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1568 do_test (UT, ST)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1569 {
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1570 volatile ST s = std::numeric_limits<ST>::min () / 3;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1571 volatile UT u = static_cast<UT> (s);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1572 if (*(reinterpret_cast<volatile ST *> (&u)) != s) return true;
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1573
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1574 u = 0; u = ~u;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1575 if (*(reinterpret_cast<volatile ST *> (&u)) != -1) return true;
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1576
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1577 ST sx, sy;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1578 sx = std::numeric_limits<ST>::max () / 2 + 1;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1579 sy = std::numeric_limits<ST>::max () / 2 + 2;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1580 if (static_cast<ST> (static_cast<UT> (sx) + static_cast<UT> (sy))
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1581 != std::numeric_limits<ST>::min () + 1) return true;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1582 if (static_cast<ST> (static_cast<UT> (sx) - static_cast<UT> (sy))
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1583 != -1) return true;
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1584
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1585 if ((sx & sy) != (static_cast<UT> (sx) & static_cast<UT> (sy)))
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1586 return true;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1587 if ((sx | sy) != (static_cast<UT> (sx) | static_cast<UT> (sy)))
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1588 return true;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1589 if ((sx ^ sy) != (static_cast<UT> (sx) ^ static_cast<UT> (sy)))
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1590 return true;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1591 if ((-1 >> 1) != -1) return true;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1592 return false;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1593 }
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1594
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1595 #define DO_TEST(T) \
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1596 if (do_test (static_cast<unsigned T> (0), static_cast<signed T> (0)))\
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1597 return sizeof (T);
8169
66bc6f9b4f72 rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents: 8019
diff changeset
1598
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1599 ]],[[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1600
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1601 DO_TEST(char)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1602 DO_TEST(short)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1603 DO_TEST(int)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1604 DO_TEST(long)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1605 #if (defined(HAVE_LONG_LONG_INT) && defined(HAVE_UNSIGNED_LONG_LONG_INT))
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1606 DO_TEST(long long)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1607 #endif
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1608 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1609 octave_cv_fast_int_ops=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1610 octave_cv_fast_int_ops=no,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1611 octave_cv_fast_int_ops=yes)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1612 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1613 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1614 if test $octave_cv_fast_int_ops = yes; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1615 AC_DEFINE(HAVE_FAST_INT_OPS, 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1616 [Define to 1 if signed integers use two's complement.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1617 fi
13957
c510048901cc set cross compile defaults for AC_RUN_IFELSE
John W. Eaton <jwe@octave.org>
parents: 13728
diff changeset
1618 ])
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1619 dnl
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1620 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
1621 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
1622 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
1623 dnl Add options (lower case letters $1) "--with-framework-$1" and
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1624 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
1625 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
1626 dnl
9654
a307a6f77fb3 aclocal.m4: consistently quote first arg to AC_DEFUN
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
1627 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
1628 AC_MSG_CHECKING([whether ${LD-ld} accepts -framework $1])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1629 AC_CACHE_VAL([octave_cv_framework_$1],
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1630 [ac_octave_save_LDFLAGS="$LDFLAGS"
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1631 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
1632 AC_LANG_PUSH(C++)
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1633 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
1634 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
1635 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
1636 AC_LANG_POP(C++)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1637 LDFLAGS="$ac_octave_save_LDFLAGS"
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1638 ])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1639 if test "$octave_cv_framework_$1" = yes; then
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
1640 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
1641 AC_ARG_WITH(framework-m4_tolower($1),
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1642 [AS_HELP_STRING([--without-framework-m4_tolower($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
1643 [don't use framework $1])],
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1644 with_have_framework=$withval, with_have_framework=yes)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1645 if test "$with_have_framework" = yes; then
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
1646 [$4]
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1647 :
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
1648 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
1649 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
1650 [$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
1651 fi
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1652 else
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
1653 AC_MSG_RESULT([no])
8595
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1654 [$5]
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1655 fi
dee5d60257e4 Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents: 8169
diff changeset
1656 ])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1657 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1658 dnl Figure out the hardware-vendor-os info.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1659 dnl
15863
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1660 AC_DEFUN([OCTAVE_CANONICAL_HOST], [
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1661 AC_CANONICAL_HOST
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1662 if test -z "$host"; then
15863
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1663 host=unknown-unknown-unknown
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1664 AC_MSG_WARN([configuring Octave for unknown system type])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1665 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1666 canonical_host_type=$host
15863
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1667 AC_SUBST(canonical_host_type)
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1668 if test -z "$host_cpu"; then
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1669 host_cpu=unknown
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1670 fi
15863
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1671 if test -z "$host_vendor"; then
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1672 host_vendor=unknown
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1673 fi
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1674 if test -z "$host_os"; then
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1675 host_os=unknown
b316429bfa89 build: Use $host_os variable to clarify configure.ac
Rik <rik@octave.org>
parents: 15834
diff changeset
1676 fi
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1677 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1678 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1679 dnl Check for IEEE 754 data format.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1680 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1681 AC_DEFUN([OCTAVE_IEEE754_DATA_FORMAT], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1682 AC_MSG_CHECKING([for IEEE 754 data format])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1683 AC_CACHE_VAL([octave_cv_ieee754_data_format],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1684 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1685 int
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1686 main (void)
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1687 {
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1688 typedef union { unsigned char c[8]; double d; } ieeebytes;
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1689
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1690 ieeebytes l = {0x1c, 0xbc, 0x6e, 0xf2, 0x54, 0x8b, 0x11, 0x43};
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1691 ieeebytes b = {0x43, 0x11, 0x8b, 0x54, 0xf2, 0x6e, 0xbc, 0x1c};
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1692
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1693 return l.d != 1234567891234567.0 && b.d != 1234567891234567.0;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1694 }
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1695 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1696 octave_cv_ieee754_data_format=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1697 octave_cv_ieee754_data_format=no,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1698 octave_cv_ieee754_data_format=yes)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1699 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1700 if test "$cross_compiling" = yes; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1701 AC_MSG_RESULT([$octave_cv_ieee754_data_format assumed for cross compilation])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1702 else
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1703 AC_MSG_RESULT([$octave_cv_ieee754_data_format])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1704 fi
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
1705 if test $octave_cv_ieee754_data_format = yes; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1706 AC_DEFINE(HAVE_IEEE754_DATA_FORMAT, 1,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1707 [Define to 1 if your system uses IEEE 754 data format.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1708 else
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1709 ## If the format is unknown, then you will probably not have a
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1710 ## useful system, so we will abort here. Anyone wishing to
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1711 ## experiment with building Octave on a system without IEEE
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1712 ## floating point should be capable of removing this check and
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1713 ## the one in the octave_ieee_init function in liboctave/lo-ieee.cc.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1714 AC_MSG_ERROR([IEEE 754 data format required for building Octave])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1715 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1716 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1717 dnl
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1718 dnl Check for CallInst::addAttribute API
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1719 dnl
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1720 AC_DEFUN([OCTAVE_LLVM_CALLINST_ADDATTRIBUTE_API], [
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1721 AC_CACHE_CHECK([check LLVM::CallInst::addAttribute arg type is llvm::Attributes],
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1722 [octave_cv_callinst_addattribute_arg_is_attributes],
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1723 [AC_LANG_PUSH(C++)
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1724 AC_COMPILE_IFELSE(
17615
3a7d5d655749 Fix typos in configure tests for LLVM methods (bug #39973)
Mike Miller <mtmiller@ieee.org>
parents: 17241
diff changeset
1725 [AC_LANG_PROGRAM([[
17164
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1726 #ifdef HAVE_LLVM_IR_FUNCTION_H
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1727 #include <llvm/IR/Instructions.h>
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1728 #include <llvm/IR/Attributes.h>
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1729 #else
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1730 #include <llvm/Instructions.h>
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1731 #include <llvm/Attributes.h>
17164
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1732 #endif
17615
3a7d5d655749 Fix typos in configure tests for LLVM methods (bug #39973)
Mike Miller <mtmiller@ieee.org>
parents: 17241
diff changeset
1733 ]], [[
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1734 llvm::CallInst *callinst;
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1735 llvm::AttrBuilder attr_builder;
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1736 attr_builder.addAttribute(llvm::Attributes::StructRet);
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1737 llvm::Attributes attrs = llvm::Attributes::get(llvm::getGlobalContext(), attr_builder);
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1738 callinst->addAttribute (1, attrs);
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1739 ]])],
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1740 octave_cv_callinst_addattribute_arg_is_attributes=yes,
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1741 octave_cv_callinst_addattribute_arg_is_attributes=no)
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1742 AC_LANG_POP(C++)
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1743 ])
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1744 if test $octave_cv_callinst_addattribute_arg_is_attributes = yes; then
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1745 AC_DEFINE(CALLINST_ADDATTRIBUTE_ARG_IS_ATTRIBUTES, 1,
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1746 [Define to 1 if llvm::CallInst:addAttribute arg type is llvm::Attributes.])
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1747 fi
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1748 ])
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1749 dnl
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1750 dnl Check for Function::addAttribute API
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1751 dnl
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1752 AC_DEFUN([OCTAVE_LLVM_FUNCTION_ADDATTRIBUTE_API], [
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1753 AC_CACHE_CHECK([check llvm::Function::addAttribute arg type is llvm::Attributes],
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1754 [octave_cv_function_addattribute_arg_is_attributes],
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1755 [AC_LANG_PUSH(C++)
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1756 AC_COMPILE_IFELSE(
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1757 [AC_LANG_PROGRAM([[
17164
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1758 #ifdef HAVE_LLVM_IR_FUNCTION_H
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1759 #include <llvm/IR/Function.h>
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1760 #include <llvm/IR/Attributes.h>
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1761 #include <llvm/IR/LLVMContext.h>
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1762 #else
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1763 #include <llvm/Function.h>
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1764 #include <llvm/Attributes.h>
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1765 #include <llvm/LLVMContext.h>
17164
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1766 #endif
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1767 ]], [[
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1768 llvm::Function *llvm_function;
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1769 llvm::AttrBuilder attr_builder;
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1770 attr_builder.addAttribute(llvm::Attributes::StructRet);
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1771 llvm::Attributes attrs = llvm::Attributes::get(llvm::getGlobalContext(), attr_builder);
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1772 llvm_function->addAttribute (1, attrs);
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1773 ]])],
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1774 octave_cv_function_addattribute_arg_is_attributes=yes,
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1775 octave_cv_function_addattribute_arg_is_attributes=no)
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1776 AC_LANG_POP(C++)
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1777 ])
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1778 if test $octave_cv_function_addattribute_arg_is_attributes = yes; then
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1779 AC_DEFINE(FUNCTION_ADDATTRIBUTE_ARG_IS_ATTRIBUTES, 1,
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1780 [Define to 1 if llvm::Function:addAttribute arg type is llvm::Attributes.])
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1781 fi
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1782 ])
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1783 dnl
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1784 dnl Check for Function::addFnAttr API
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1785 dnl
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1786 AC_DEFUN([OCTAVE_LLVM_FUNCTION_ADDFNATTR_API], [
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1787 AC_CACHE_CHECK([check LLVM::Function::addFnAttr arg type is llvm::Attributes],
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1788 [octave_cv_function_addfnattr_arg_is_attributes],
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1789 [AC_LANG_PUSH(C++)
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1790 AC_COMPILE_IFELSE(
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1791 [AC_LANG_PROGRAM([[
17615
3a7d5d655749 Fix typos in configure tests for LLVM methods (bug #39973)
Mike Miller <mtmiller@ieee.org>
parents: 17241
diff changeset
1792 #ifdef HAVE_LLVM_IR_FUNCTION_H
3a7d5d655749 Fix typos in configure tests for LLVM methods (bug #39973)
Mike Miller <mtmiller@ieee.org>
parents: 17241
diff changeset
1793 #include <llvm/IR/Function.h>
3a7d5d655749 Fix typos in configure tests for LLVM methods (bug #39973)
Mike Miller <mtmiller@ieee.org>
parents: 17241
diff changeset
1794 #include <llvm/IR/Attributes.h>
17164
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1795 #else
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1796 #include <llvm/Function.h>
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1797 #include <llvm/Attributes.h>
36fd98b9ce48 Add support for llvm 3.3
Max Brister <max@2bass.com>
parents: 17111
diff changeset
1798 #endif
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1799 ]], [[
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1800 llvm::Function *llvm_function;
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1801 llvm_function->addFnAttr (llvm::Attributes::AlwaysInline);
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1802 ]])],
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1803 octave_cv_function_addfnattr_arg_is_attributes=yes,
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1804 octave_cv_function_addfnattr_arg_is_attributes=no)
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1805 AC_LANG_POP(C++)
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1806 ])
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1807 if test $octave_cv_function_addfnattr_arg_is_attributes = yes; then
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1808 AC_DEFINE(FUNCTION_ADDFNATTR_ARG_IS_ATTRIBUTES, 1,
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1809 [Define to 1 if llvm::Function:addFnAttr arg type is llvm::Attributes.])
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1810 fi
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1811 ])
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
1812 dnl
18831
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1813 dnl Check for raw_fd_ostream API
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1814 dnl
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1815 AC_DEFUN([OCTAVE_LLVM_RAW_FD_OSTREAM_API], [
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1816 AC_CACHE_CHECK([check LLVM::raw_fd_ostream arg type is llvm::sys:fs],
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1817 [octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs],
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1818 [AC_LANG_PUSH(C++)
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1819 AC_COMPILE_IFELSE(
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1820 [AC_LANG_PROGRAM([[
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1821 #include <llvm/Support/raw_os_ostream.h>
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1822 ]], [[
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1823 std::string str;
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1824 llvm::raw_fd_ostream fout ("", str, llvm::sys::fs::F_Binary);
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1825 ]])],
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1826 octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs=yes,
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1827 octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs=no)
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1828 AC_LANG_POP(C++)
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1829 ])
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1830 if test $octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs = yes; then
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1831 AC_DEFINE(RAW_FD_OSTREAM_ARG_IS_LLVM_SYS_FS, 1,
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1832 [Define to 1 if LLVM::raw_fd_ostream arg type is llvm::sys:fs.])
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1833 fi
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1834 ])
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1835 dnl
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1836 dnl Check for legacy::PassManager API
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1837 dnl
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1838 AC_DEFUN([OCTAVE_LLVM_LEGACY_PASSMANAGER_API], [
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1839 AC_CACHE_CHECK([check for LLVM::legacy::PassManager],
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1840 [octave_cv_legacy_passmanager],
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1841 [AC_LANG_PUSH(C++)
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1842 save_LIBS="$LIBS"
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1843 LIBS="$LLVM_LIBS $LIBS"
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1844 AC_LINK_IFELSE(
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1845 [AC_LANG_PROGRAM([[
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1846 #include <llvm/IR/LegacyPassManager.h>
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1847 ]], [[
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1848 llvm::Module *module;
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1849 llvm::legacy::PassManager *module_pass_manager;
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1850 llvm::legacy::FunctionPassManager *pass_manager;
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1851 module_pass_manager = new llvm::legacy::PassManager ();
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1852 pass_manager = new llvm::legacy::FunctionPassManager (module);
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1853 ]])],
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1854 octave_cv_legacy_passmanager=yes,
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1855 octave_cv_legacy_passmanager=no)
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1856 LIBS="$save_LIBS"
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1857 AC_LANG_POP(C++)
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1858 ])
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1859 if test $octave_cv_legacy_passmanager = yes; then
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1860 AC_DEFINE(LEGACY_PASSMANAGER, 1,
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1861 [Define to 1 if LLVM::legacy::PassManager exists.])
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1862 fi
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1863 ])
4a4edf0f2077 fix LLVM 3.4 build (bug #41061)
Stefan Mahr <dac922@gmx.de>
parents: 18216
diff changeset
1864 dnl
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1865 dnl Check for ar.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1866 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1867 AC_DEFUN([OCTAVE_PROG_AR], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1868 if test -z "$AR"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1869 AR=ar
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1870 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1871 AC_SUBST(AR)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1872
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1873 if test -z "$ARFLAGS"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1874 ARFLAGS="rc"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1875 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1876 AC_SUBST(ARFLAGS)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1877 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1878 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1879 dnl Check for bison.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1880 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1881 AC_DEFUN([OCTAVE_PROG_BISON], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1882 AC_PROG_YACC
16784
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
1883
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
1884 case "`$YACC --version`" in
17197
fbee0d312af5 acinclude.m4: Remove some unnecessary double quotes around variables.
Rik <rik@octave.org>
parents: 17196
diff changeset
1885 *bison*) tmp_have_bison=yes ;;
16784
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
1886 *) tmp_have_bison=no ;;
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
1887 esac
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
1888
17197
fbee0d312af5 acinclude.m4: Remove some unnecessary double quotes around variables.
Rik <rik@octave.org>
parents: 17196
diff changeset
1889 if test $tmp_have_bison = yes; then
18974
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1890 AC_CACHE_CHECK([syntax of bison api.prefix (or name-prefix) declaration],
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1891 [octave_cv_bison_api_prefix_decl_style], [
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1892 style="api name"
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1893 for s in $style; do
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1894 if test $s = "api"; then
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1895 def='%define api.prefix "foo_"'
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1896 else
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1897 def='%name-prefix="foo_"'
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1898 fi
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1899 cat << EOF > conftest.yy
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1900 $def
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1901 %start input
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1902 %%
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1903 input:;
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1904 %%
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1905 EOF
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1906 $YACC conftest.yy > /dev/null 2>&1
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1907 ac_status=$?
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1908 if test $ac_status -eq 0; then
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1909 octave_cv_bison_api_prefix_decl_style="$s"
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1910 break
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1911 fi
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1912 if test $ac_status -eq 0; then
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1913 break
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1914 fi
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1915 done
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1916 rm -f conftest.yy y.tab.h y.tab.c
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1917 ])
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1918 fi
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1919
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1920 AC_SUBST(BISON_API_PREFIX_DECL_STYLE, $octave_cv_bison_api_prefix_decl_style)
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1921
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1922 if test -z "$octave_cv_bison_api_prefix_decl_style"; then
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1923 YACC=
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1924 warn_bison_api_prefix_decl_style="
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1925
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1926 I wasn't able to find a suitable style for declaring the api prefix
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1927 in a bison input file so I'm disabling bison.
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1928 "
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1929 OCTAVE_CONFIGURE_WARNING([warn_bison_api_prefix_decl_style])
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1930 fi
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1931
d8abf813c69f handle changes in bison 3.x
John W. Eaton <jwe@octave.org>
parents: 18973
diff changeset
1932 if test $tmp_have_bison = yes; then
16174
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1933 AC_CACHE_CHECK([syntax of bison push/pull declaration],
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1934 [octave_cv_bison_push_pull_decl_style], [
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1935 style="dash underscore"
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1936 quote="noquote quote"
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1937 for s in $style; do
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1938 for q in $quote; do
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1939 if test $s = "dash"; then
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1940 def="%define api.push-pull"
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1941 else
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1942 def="%define api.push_pull"
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1943 fi
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1944 if test $q = "quote"; then
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1945 def="$def \"both\""
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1946 else
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1947 def="$def both"
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1948 fi
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1949 cat << EOF > conftest.yy
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1950 $def
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1951 %start input
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1952 %%
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1953 input:;
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1954 %%
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1955 EOF
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1956 $YACC conftest.yy > /dev/null 2>&1
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1957 ac_status=$?
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1958 if test $ac_status -eq 0; then
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1959 if test $q = noquote; then
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1960 q=
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1961 fi
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1962 octave_cv_bison_push_pull_decl_style="$s $q"
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1963 break
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1964 fi
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1965 done
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1966 if test $ac_status -eq 0; then
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1967 break
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1968 fi
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1969 done
16202
7ce484126bb2 Remove temporary y.tab.c file used by configure script.
Rik <rik@octave.org>
parents: 16174
diff changeset
1970 rm -f conftest.yy y.tab.h y.tab.c
16174
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1971 ])
16784
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
1972 fi
16174
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1973
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1974 AC_SUBST(BISON_PUSH_PULL_DECL_STYLE, $octave_cv_bison_push_pull_decl_style)
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1975
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1976 if test -z "$octave_cv_bison_push_pull_decl_style"; then
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1977 YACC=
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1978 warn_bison_push_pull_decl_style="
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1979
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1980 I wasn't able to find a suitable style for declaring a push-pull
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1981 parser in a bison input file so I'm disabling bison.
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1982 "
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1983 OCTAVE_CONFIGURE_WARNING([warn_bison_push_pull_decl_style])
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1984 fi
39096b290a2f check syntax used to enable bison push/pull parser
John W. Eaton <jwe@octave.org>
parents: 16068
diff changeset
1985
17197
fbee0d312af5 acinclude.m4: Remove some unnecessary double quotes around variables.
Rik <rik@octave.org>
parents: 17196
diff changeset
1986 if test $tmp_have_bison = no; then
16784
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
1987 YACC='$(top_srcdir)/build-aux/missing bison'
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
1988 warn_bison="
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1989
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1990 I didn't find bison, but it's only a problem if you need to
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1991 reconstruct parse.cc, which is the case if you're building from VCS
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1992 sources.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1993 "
16784
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
1994 OCTAVE_CONFIGURE_WARNING([warn_bison])
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
1995 fi
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1996 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1997 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1998 dnl Find desktop-file-install program.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
1999 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2000 AC_DEFUN([OCTAVE_PROG_DESKTOP_FILE_INSTALL], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2001 AC_CHECK_PROG(DESKTOP_FILE_INSTALL, desktop-file-install, desktop-file-install, [])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2002 AC_SUBST(DESKTOP_FILE_INSTALL)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2003 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2004 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2005 dnl Find find program.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2006 dnl
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2007 ## Prefer GNU find if found.
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2008 AN_MAKEVAR([FIND], [OCTAVE_PROG_FIND])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2009 AN_PROGRAM([gfind], [OCTAVE_PROG_FIND])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2010 AN_PROGRAM([find], [OCTAVE_PROG_FIND])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2011 AC_DEFUN([OCTAVE_PROG_FIND], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2012 AC_CHECK_PROGS(FIND, [gfind find])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2013 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2014 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2015 dnl Check for flex.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2016 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2017 AC_DEFUN([OCTAVE_PROG_FLEX], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2018 ## For now, don't define LEXLIB to be -lfl -- we don't use anything in
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2019 ## it, and it might not be installed.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2020 ##
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2021 ## Also make sure that we generate an interactive scanner if we are
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2022 ## using flex.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2023 AC_PROG_LEX
16784
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
2024 case "`$LEX --version`" in
0fabe0f49f38 use better method to determine whether we are using flex and bison
John W. Eaton <jwe@octave.org>
parents: 16733
diff changeset
2025 *flex*)
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2026 LFLAGS="-I"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2027 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2028 LEXLIB=
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2029 ;;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2030 *)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2031 LEX='$(top_srcdir)/build-aux/missing flex'
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2032 warn_flex="
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2033
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2034 I didn't find flex, but it's only a problem if you need to reconstruct
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2035 lex.cc, which is the case if you're building from VCS sources.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2036 "
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2037 OCTAVE_CONFIGURE_WARNING([warn_flex])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2038 ;;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2039 esac
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2040 AC_SUBST(LFLAGS)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2041 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2042 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2043 dnl Check for ghostscript.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2044 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2045 AC_DEFUN([OCTAVE_PROG_GHOSTSCRIPT], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2046 case "$canonical_host_type" in
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2047 *-*-mingw* | *-*-msdosmsvc)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2048 ac_octave_gs_names="gswin32c gs mgs"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2049 ;;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2050 *)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2051 ac_octave_gs_names="gs"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2052 ;;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2053 esac
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2054 AC_CHECK_PROGS(GHOSTSCRIPT, [$ac_octave_gs_names])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2055 if test -z "$GHOSTSCRIPT"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2056 GHOSTSCRIPT='$(top_srcdir)/build-aux/missing gs'
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2057 warn_ghostscript="
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2058
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2059 I didn't find ghostscript, so reconstructing figures for the manual
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2060 will fail, and saving graphics in some output formats will fail when
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2061 using Octave
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2062 "
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2063 OCTAVE_CONFIGURE_WARNING([warn_ghostscript])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2064 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2065 AC_SUBST(GHOSTSCRIPT)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2066 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2067 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2068 dnl Check for gnuplot.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2069 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2070 AC_DEFUN([OCTAVE_PROG_GNUPLOT], [
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2071 ac_octave_gp_names="gnuplot"
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2072 ac_octave_gp_default="gnuplot"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2073 if test "$cross_compiling" = yes; then
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2074 GNUPLOT="$ac_octave_gp_default"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2075 AC_MSG_RESULT([assuming $GNUPLOT exists on $canonical_host_type host])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2076 else
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2077 AC_CHECK_PROGS(GNUPLOT, [$ac_octave_gp_names])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2078 if test -z "$GNUPLOT"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2079 GNUPLOT="$gp_default"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2080 warn_gnuplot="
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2081
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2082 gnuplot not found. It isn't necessary to have gnuplot installed, but
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2083 without native graphics or gnuplot you won't be able to use any of
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2084 Octave's plotting commands.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2085 "
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2086 OCTAVE_CONFIGURE_WARNING([warn_gnuplot])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2087 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2088 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2089 AC_SUBST(GNUPLOT)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2090 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2091 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2092 dnl Check for gperf.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2093 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2094 AC_DEFUN([OCTAVE_PROG_GPERF], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2095 AC_CHECK_PROG(GPERF, gperf, gperf, [])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2096 if test -z "$GPERF"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2097 GPERF='$(top_srcdir)/build-aux/missing gperf'
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2098 warn_gperf="
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2099
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2100 I didn't find gperf, but it's only a problem if you need to
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
2101 reconstruct oct-gperf.h
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2102 "
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2103 OCTAVE_CONFIGURE_WARNING([warn_gperf])
16663
e380d1317c72 use missing script for gperf
John W. Eaton <jwe@octave.org>
parents: 16318
diff changeset
2104 GPERF='$(top_srcdir)/build-aux/missing gperf'
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2105 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2106 AC_SUBST(GPERF)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2107 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2108 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2109 dnl Check for makeinfo.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2110 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2111 AC_DEFUN([OCTAVE_PROG_MAKEINFO], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2112 dnl use MKINFO, not MAKEINFO, for variable name because Automake
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2113 dnl automatically defines a value for MAKEINFO even when it does not
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2114 dnl exist which will then fool the 'test -z' line.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2115 AC_CHECK_PROG(MKINFO, makeinfo, makeinfo, [])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2116 if test -z "$MKINFO"; then
16012
ca37c6023a79 don't abort configure if makeinfo is missing
John W. Eaton <jwe@octave.org>
parents: 15969
diff changeset
2117 warn_makeinfo="
ca37c6023a79 don't abort configure if makeinfo is missing
John W. Eaton <jwe@octave.org>
parents: 15969
diff changeset
2118
ca37c6023a79 don't abort configure if makeinfo is missing
John W. Eaton <jwe@octave.org>
parents: 15969
diff changeset
2119 I didn't find makeinfo, which is required for reading documentation.
ca37c6023a79 don't abort configure if makeinfo is missing
John W. Eaton <jwe@octave.org>
parents: 15969
diff changeset
2120 You may install a copy later for Octave to use.
ca37c6023a79 don't abort configure if makeinfo is missing
John W. Eaton <jwe@octave.org>
parents: 15969
diff changeset
2121 "
ca37c6023a79 don't abort configure if makeinfo is missing
John W. Eaton <jwe@octave.org>
parents: 15969
diff changeset
2122 OCTAVE_CONFIGURE_WARNING([warn_makeinfo])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2123 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2124 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2125 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2126 dnl What pager should we use?
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2127 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2128 AC_DEFUN([OCTAVE_PROG_PAGER], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2129 if test "$cross_compiling" = yes; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2130 DEFAULT_PAGER=less
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2131 AC_MSG_RESULT([assuming $DEFAULT_PAGER exists on $canonical_host_type host])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2132 AC_SUBST(DEFAULT_PAGER)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2133 else
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2134 ac_octave_possible_pagers="less more page pg"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2135 case "$canonical_host_type" in
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2136 *-*-cygwin* | *-*-mingw32* | *-*-msdosmsvc)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2137 ac_octave_possible_pagers="$ac_octave_possible_pagers more.com"
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2138 ;;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2139 esac
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2140
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2141 AC_CHECK_PROGS(DEFAULT_PAGER, [$ac_octave_possible_pagers], [])
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2142 if test -z "$DEFAULT_PAGER"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2143 warn_less="I couldn't find \`less', \`more', \`page', or \`pg'"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2144 OCTAVE_CONFIGURE_WARNING([warn_less])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2145 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2146 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2147 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2148 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2149 dnl Find Perl program.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2150 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2151 AC_DEFUN([OCTAVE_PROG_PERL], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2152 AC_CHECK_PROG(PERL, perl, perl, [])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2153 AC_SUBST(PERL)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2154 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2155 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2156 dnl Find Python program.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2157 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2158 AC_DEFUN([OCTAVE_PROG_PYTHON], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2159 AC_CHECK_PROG(PYTHON, python, python, [])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2160 AC_SUBST(PYTHON)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2161 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2162 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2163 dnl Find sed program.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2164 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2165 # Check for a fully-functional sed program, that truncates
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2166 # as few characters as possible and that supports "\(X\|Y\)"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2167 # style regular expression alternation. Prefer GNU sed if found.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2168 AC_DEFUN([OCTAVE_PROG_SED], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2169 AC_MSG_CHECKING([for a usable sed])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2170 if test -z "$SED"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2171 AC_CACHE_VAL([octave_cv_prog_sed],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2172 [# Loop through the user's path and search for sed and gsed.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2173 # Next, test potential sed programs in list for truncation.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2174 _AS_PATH_WALK([$PATH],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2175 [for ac_prog in sed gsed; do
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2176 for ac_exec_ext in '' $ac_executable_extensions; do
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2177 if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2178 _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2179 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2180 done
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2181 done
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2182 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2183 AS_TMPDIR(sed)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2184 _max=0
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2185 _count=0
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2186 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2187 # along with /bin/sed that truncates output.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2188 for _sed in $_sed_list /usr/xpg4/bin/sed; do
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2189 test ! -f ${_sed} && break
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2190 cat /dev/null > "$tmp/sed.in"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2191 _count=0
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2192 echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2193 # Check for GNU sed and select it if it is found.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2194 if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2195 octave_cv_prog_sed=${_sed}
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2196 break;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2197 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2198 # Reject if RE alternation is not handled.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2199 if test "`echo 'this and that' | ${_sed} -n 's/\(this\|that\).*$/\1/p'`" != "this"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2200 continue;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2201 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2202 while true; do
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2203 cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2204 mv "$tmp/sed.tmp" "$tmp/sed.in"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2205 cp "$tmp/sed.in" "$tmp/sed.nl"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2206 echo >>"$tmp/sed.nl"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2207 ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2208 cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2209 # 10000 chars as input seems more than enough
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2210 test $_count -gt 10 && break
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2211 _count=`expr $_count + 1`
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2212 if test $_count -gt $_max; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2213 _max=$_count
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2214 octave_cv_prog_sed=$_sed
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2215 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2216 done
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2217 done
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2218 rm -rf "$tmp"
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2219 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2220 SED=$octave_cv_prog_sed
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2221 if test -z "$SED"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2222 AC_MSG_ERROR([no usable version of sed found])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2223 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2224 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2225 AC_SUBST(SED)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2226 AC_MSG_RESULT([$SED])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2227 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2228 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2229 dnl Check for texi2dvi.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2230 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2231 AC_DEFUN([OCTAVE_PROG_TEXI2DVI], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2232 AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, [])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2233 if test -z "$TEXI2DVI"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2234 TEXI2DVI='$(top_srcdir)/build-aux/missing texi2dvi'
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2235 warn_texi2dvi="
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2236
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2237 I didn't find texi2dvi, but it's only a problem if you need to
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2238 reconstruct the DVI version of the manual
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2239 "
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2240 OCTAVE_CONFIGURE_WARNING([warn_texi2dvi])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2241 fi
15250
87f337783d95 Cache texi2XXX intermediate results for faster builds.
Rik <rik@octave.org>
parents: 15247
diff changeset
2242 TEXI2DVI="$TEXI2DVI"' --build-dir=t2d_cache'
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2243 AC_SUBST(TEXI2DVI)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2244 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2245 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2246 dnl Check for texi2pdf.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2247 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2248 AC_DEFUN([OCTAVE_PROG_TEXI2PDF], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2249 AC_REQUIRE([OCTAVE_PROG_TEXI2DVI])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2250 AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, [])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2251 if test -z "$TEXI2PDF"; then
16068
b309a5da17f5 use yes/no instead of true/false in confgure scripts
John W. Eaton <jwe@octave.org>
parents: 16012
diff changeset
2252 ac_octave_texi2pdf_missing=yes;
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2253 if test -n "$TEXI2DVI"; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2254 TEXI2PDF="$TEXI2DVI --pdf"
16068
b309a5da17f5 use yes/no instead of true/false in confgure scripts
John W. Eaton <jwe@octave.org>
parents: 16012
diff changeset
2255 ac_octave_texi2pdf_missing=no;
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2256 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2257 else
16068
b309a5da17f5 use yes/no instead of true/false in confgure scripts
John W. Eaton <jwe@octave.org>
parents: 16012
diff changeset
2258 ac_octave_texi2pdf_missing=no;
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2259 fi
16068
b309a5da17f5 use yes/no instead of true/false in confgure scripts
John W. Eaton <jwe@octave.org>
parents: 16012
diff changeset
2260 if test $ac_octave_texi2pdf_missing = yes; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2261 TEXI2PDF='$(top_srcdir)/build-aux/missing texi2pdf'
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2262 warn_texi2pdf="
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2263
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2264 I didn't find texi2pdf, but it's only a problem if you need to
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2265 reconstruct the PDF version of the manual
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2266 "
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2267 OCTAVE_CONFIGURE_WARNING([warn_texi2pdf])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2268 fi
15250
87f337783d95 Cache texi2XXX intermediate results for faster builds.
Rik <rik@octave.org>
parents: 15247
diff changeset
2269 TEXI2PDF="$TEXI2PDF"' --build-dir=t2d_cache'
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2270 AC_SUBST(TEXI2PDF)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2271 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2272 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2273 dnl Set default value for a variable and substitute it.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2274 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2275 AC_DEFUN([OCTAVE_SET_DEFAULT], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2276 ifelse($#, 2, [: ${$1=$2}
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2277 ])dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2278 AC_MSG_RESULT([defining $1 to be $$1])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2279 AC_SUBST($1)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2280 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2281 dnl
15329
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2282 dnl Check whether SuiteSparse_time is required by UMFPACK.
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2283 dnl UMFPACK >= 4 requires linking in another library for SuiteSparse_time.
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2284 dnl
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2285 dnl Macro assumes that the check for umfpack has already been performed.
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2286 dnl
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2287 AC_DEFUN([OCTAVE_UMFPACK_NEED_SUITESPARSE_TIME], [
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
2288 AC_CACHE_CHECK([whether UMFPACK needs SuiteSparse_time function],
15329
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2289 [octave_cv_umfpack_need_suitesparse_time],
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2290 [AC_LANG_PUSH(C)
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2291 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2292 #if defined (HAVE_SUITESPARSE_UMFPACK_H)
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2293 # include <suitesparse/umfpack.h>
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2294 #elif defined (HAVE_UFSPARSE_UMFPACK_H)
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2295 # include <ufsparse/umfpack.h>
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2296 #elif defined (HAVE_UMFPACK_UMFPACK_H)
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2297 # include <umfpack/umfpack.h>
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2298 #elif defined (HAVE_UMFPACK_H)
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2299 # include <umfpack.h>
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2300 #endif
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2301 ]], [[
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2302 double stats [2];
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2303 umfpack_tic (stats);
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2304 ]])],
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2305 octave_cv_umfpack_need_suitesparse_time=no,
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2306 octave_cv_umfpack_need_suitesparse_time=yes)
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2307 AC_LANG_POP(C)
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2308 ])
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2309 ])
719ffb2f35a6 Fix Octave builds with SuiteSparse >=4.0 (bug #37031)
Rik <rik@octave.org>
parents: 15319
diff changeset
2310 dnl
15144
9cc337ced51a build: Update OCTAVE_UMFPACK_SEPARATE_SPLIT macro to look for SuiteSparse header file.
Rik <rik@octave.org>
parents: 15141
diff changeset
2311 dnl Check for UMFPACK separately split complex matrix and RHS.
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2312 dnl
15144
9cc337ced51a build: Update OCTAVE_UMFPACK_SEPARATE_SPLIT macro to look for SuiteSparse header file.
Rik <rik@octave.org>
parents: 15141
diff changeset
2313 dnl Macro assumes that the check for umfpack has already been performed.
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2314 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2315 AC_DEFUN([OCTAVE_UMFPACK_SEPARATE_SPLIT], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2316 AC_MSG_CHECKING([for UMFPACK separate complex matrix and rhs split])
15319
daf74ce2afdc m4/acinclude.m4: Use more consistent m4 quoting of arguments to macros.
Rik <rik@octave.org>
parents: 15302
diff changeset
2317 AC_CACHE_VAL([octave_cv_umfpack_separate_split],
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2318 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
16318
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2319 #include <stdint.h>
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2320 #include <stdlib.h>
15330
81cc4e5733b1 build: Silence compiler warning in config.log for OCTAVE_UMFPACK_SEPARATE_SPLIT.
Rik <rik@octave.org>
parents: 15329
diff changeset
2321 #include <math.h>
15144
9cc337ced51a build: Update OCTAVE_UMFPACK_SEPARATE_SPLIT macro to look for SuiteSparse header file.
Rik <rik@octave.org>
parents: 15141
diff changeset
2322 #if defined (HAVE_SUITESPARSE_UMFPACK_H)
9cc337ced51a build: Update OCTAVE_UMFPACK_SEPARATE_SPLIT macro to look for SuiteSparse header file.
Rik <rik@octave.org>
parents: 15141
diff changeset
2323 # include <suitesparse/umfpack.h>
9cc337ced51a build: Update OCTAVE_UMFPACK_SEPARATE_SPLIT macro to look for SuiteSparse header file.
Rik <rik@octave.org>
parents: 15141
diff changeset
2324 #elif defined (HAVE_UFSPARSE_UMFPACK_H)
9cc337ced51a build: Update OCTAVE_UMFPACK_SEPARATE_SPLIT macro to look for SuiteSparse header file.
Rik <rik@octave.org>
parents: 15141
diff changeset
2325 # include <ufsparse/umfpack.h>
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2326 #elif defined (HAVE_UMFPACK_UMFPACK_H)
15144
9cc337ced51a build: Update OCTAVE_UMFPACK_SEPARATE_SPLIT macro to look for SuiteSparse header file.
Rik <rik@octave.org>
parents: 15141
diff changeset
2327 # include <umfpack/umfpack.h>
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2328 #elif defined (HAVE_UMFPACK_H)
15144
9cc337ced51a build: Update OCTAVE_UMFPACK_SEPARATE_SPLIT macro to look for SuiteSparse header file.
Rik <rik@octave.org>
parents: 15141
diff changeset
2329 # include <umfpack.h>
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2330 #endif
16318
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2331 #ifdef USE_64_BIT_IDX_T
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2332 typedef uint64_t idx_type;
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2333 #define UMFPACK_NAME(name) umfpack_zl_ ## name
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2334 #else
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2335 typedef int idx_type;
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2336 #define UMFPACK_NAME(name) umfpack_zi_ ## name
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2337 #endif
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2338 idx_type n = 5;
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2339 idx_type Ap[] = {0, 2, 5, 9, 10, 12};
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2340 idx_type Ai[] = {0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4};
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
2341 double Ax[] = {2., 0., 3., 0., 3., 0., -1., 0., 4., 0., 4., 0.,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2342 -3., 0., 1., 0., 2., 0., 2., 0., 6., 0., 1., 0.};
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2343 double br[] = {8., 45., -3., 3., 19.};
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2344 double bi[] = {0., 0., 0., 0., 0.};
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2345 int main (void)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2346 {
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2347 double *null = (double *) NULL ;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2348 double *x = (double *)malloc (2 * n * sizeof(double));
16318
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2349 idx_type i ;
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2350 void *Symbolic, *Numeric ;
16318
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2351 (void) UMFPACK_NAME (symbolic) (n, n, Ap, Ai, Ax, null, &Symbolic, null, null) ;
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2352 (void) UMFPACK_NAME (numeric) (Ap, Ai, Ax, null, Symbolic, &Numeric, null, null) ;
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2353 UMFPACK_NAME (free_symbolic) (&Symbolic) ;
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
2354 (void) UMFPACK_NAME (solve) (0, Ap, Ai, Ax, null, x, null, br, bi,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2355 Numeric, null, null) ;
16318
eb572251b7c6 check for correct SuiteSparse functions if --enable-64
John W. Eaton <jwe@octave.org>
parents: 16313
diff changeset
2356 UMFPACK_NAME (free_numeric) (&Numeric) ;
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
2357 for (i = 0; i < n; i++, x+=2)
15330
81cc4e5733b1 build: Silence compiler warning in config.log for OCTAVE_UMFPACK_SEPARATE_SPLIT.
Rik <rik@octave.org>
parents: 15329
diff changeset
2358 if (fabs (*x - i - 1.) > 1.e-13)
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2359 return (1);
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2360 return (0) ;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2361 }
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2362 ]])],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2363 octave_cv_umfpack_separate_split=yes,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2364 octave_cv_umfpack_separate_split=no,
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2365 octave_cv_umfpack_separate_split=yes)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2366 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2367 if test "$cross_compiling" = yes; then
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2368 AC_MSG_RESULT([$octave_cv_umfpack_separate_split assumed for cross compilation])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2369 else
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2370 AC_MSG_RESULT([$octave_cv_umfpack_separate_split])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2371 fi
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2372 if test $octave_cv_umfpack_separate_split = yes; then
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
2373 AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2374 [Define to 1 if the UMFPACK Complex solver allows matrix and RHS to be split independently.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2375 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2376 ])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2377 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2378 dnl Check for unordered map headers and whether tr1 namespace is
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2379 dnl required.
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2380 dnl
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2381 AC_DEFUN([OCTAVE_UNORDERED_MAP_HEADERS], [
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2382 AC_CHECK_HEADERS([unordered_map], [],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2383 [AC_CHECK_HEADERS([tr1/unordered_map])])
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
2384 AC_CACHE_CHECK([whether unordered_map requires tr1 namespace],
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2385 [octave_cv_header_require_tr1_namespace],
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2386 [AC_LANG_PUSH(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2387 octave_cv_header_require_tr1_namespace=no
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2388 if test $ac_cv_header_unordered_map = yes; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2389 ## Have <unordered_map>, but still have to check whether
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2390 ## tr1 namespace is required (like MSVC, for instance).
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2391 AC_COMPILE_IFELSE(
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2392 [AC_LANG_PROGRAM([[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2393 #include <unordered_map>
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2394 ]], [[
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2395 std::unordered_map<int,int> m;
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2396 ]])],
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
2397 octave_cv_header_require_tr1_namespace=no,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2398 octave_cv_header_require_tr1_namespace=yes)
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2399 elif test $ac_cv_header_tr1_unordered_map = yes; then
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2400 octave_cv_header_require_tr1_namespace=yes
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2401 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2402 AC_LANG_POP(C++)
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2403 ])
15336
5fff79162342 acinclude.m4: Put temporary shell variables in macros into ac_octave namespace.
Rik <rik@octave.org>
parents: 15330
diff changeset
2404 if test $octave_cv_header_require_tr1_namespace = yes; then
17034
8d84dc5f5b5d acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR.
Rik <rik@octave.org>
parents: 17031
diff changeset
2405 AC_DEFINE(USE_UNORDERED_MAP_WITH_TR1, 1,
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2406 [Define to 1 if unordered_map requires the use of tr1 namespace.])
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2407 fi
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2408 ])
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9231
diff changeset
2409
15141
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2410 dnl End of macros written by Octave developers
4388f6518440 build: Overhaul acinclude.m4 macros.
Rik <rik@octave.org>
parents: 15134
diff changeset
2411 dnl ------------------------------------------------------------
9645
4531741e5236 configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9596
diff changeset
2412 dnl
4531741e5236 configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9596
diff changeset
2413