annotate build-aux/mk-octave-config-h.sh @ 21726:f05a00e611ff

use namespace for glob and fnmatch wrapper functions * oct-glob.h, oct-glob.cc: Put fnmatch and glob in octave::sys namespace. (octave_fnmatch, octave_glob): Now deprecated aliases for functions in octave::sys namespace. * glob-match.cc: Use new names. * oct-conf-post.in.h, mk-octave-config-h.sh: Define OCTAVE_USE_DEPRECATED_FUNCTIONS.
author John W. Eaton <jwe@octave.org>
date Wed, 18 May 2016 15:17:00 -0400
parents 263d18409fdf
children 0507f0d2135d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 #! /bin/sh
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 #
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 # Copyright (C) 2016 John W. Eaton
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 #
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 # This file is part of Octave.
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 #
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 # Octave is free software; you can redistribute it and/or modify it
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 # under the terms of the GNU General Public License as published by the
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 # Free Software Foundation; either version 3 of the License, or (at
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 # your option) any later version.
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 #
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 # Octave is distributed in the hope that it will be useful, but WITHOUT
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 # for more details.
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 #
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 # You should have received a copy of the GNU General Public License
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 # along with Octave; see the file COPYING. If not, see
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 # <http://www.gnu.org/licenses/>.
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20
21240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
21 # Generate a header file that provides the public symbols from Octave's
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
22 # autoconf-generated config.h file. See the notes at the top of the
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
23 # generated octave-config.h file for more details.
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
24
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 if [ $# -ne 1 ]; then
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 echo "usage: mk-octave-config-h.sh CONFIG-FILE" 1>&2
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 exit 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 config_h_file=$1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 /* DO NOT EDIT! Generated by mk-octave-config-h.sh. */
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 /*
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 Copyright (C) 2016 John W. Eaton
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 This file is part of Octave.
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 Octave is free software; you can redistribute it and/or modify it
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 under the terms of the GNU General Public License as published by the
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 Free Software Foundation; either version 3 of the License, or (at your
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 option) any later version.
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 Octave is distributed in the hope that it will be useful, but WITHOUT
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 for more details.
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 You should have received a copy of the GNU General Public License
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 along with Octave; see the file COPYING. If not, see
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 <http://www.gnu.org/licenses/>.
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 */
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55
21240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
56 /*
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
57
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
58 All Octave source files should begin with
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
59
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
60 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21287
diff changeset
61 # include "config.h"
21240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
62 #endif
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
63
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
64 All public Octave header files should have the form
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
65
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
66 #if ! defined (INCLUSION_GUARD_SYMBOL)
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
67 #define INCLUSION_GUARD_SYMBOL 1
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
68
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
69 #include "octave-config.h"
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
70
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
71 // Contents of header file.
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
72
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
73 #endif
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
74
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
75 In Octave source files, INCLUSION_GUARD_SYMBOL should have the form
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
76
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
77 octave_NAME_h
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
78
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
79 with NAME formed from the header file name with '-' replaced by '_'.
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
80
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
81 It is safe to include octave-config.h unconditionally since it will
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
82 expand to an empty file if it is included after Octave's
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
83 autoconf-generated config.h file.
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
84
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
85 Users of Octave's libraries should not need to include octave-config.h
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
86 since all of Octave's header files already include it.
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
87
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
88 */
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
89
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 #if ! defined (octave_octave_config_h)
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 #define octave_octave_config_h 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92
21240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
93 #if ! defined (OCTAVE_AUTOCONFIG_H_INCLUDED)
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
94
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 #include <stdint.h>
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 #if defined (__GNUC__)
21325
64be7d374f86 Make OCTAVE_DEPRECATED macro compatible with older gcc
Mike Miller <mtmiller@octave.org>
parents: 21302
diff changeset
98 # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
64be7d374f86 Make OCTAVE_DEPRECATED macro compatible with older gcc
Mike Miller <mtmiller@octave.org>
parents: 21302
diff changeset
99 # define OCTAVE_DEPRECATED(msg) __attribute__ ((__deprecated__ (msg)))
64be7d374f86 Make OCTAVE_DEPRECATED macro compatible with older gcc
Mike Miller <mtmiller@octave.org>
parents: 21302
diff changeset
100 # else
64be7d374f86 Make OCTAVE_DEPRECATED macro compatible with older gcc
Mike Miller <mtmiller@octave.org>
parents: 21302
diff changeset
101 # define OCTAVE_DEPRECATED(msg) __attribute__ ((__deprecated__))
64be7d374f86 Make OCTAVE_DEPRECATED macro compatible with older gcc
Mike Miller <mtmiller@octave.org>
parents: 21302
diff changeset
102 # endif
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 # define OCTAVE_NORETURN __attribute__ ((__noreturn__))
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104 # define OCTAVE_UNUSED __attribute__ ((__unused__))
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106 # define HAVE_OCTAVE_DEPRECATED_ATTR 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107 # define HAVE_OCTAVE_NORETURN_ATTR 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 # define HAVE_OCTAVE_UNUSED_ATTR 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109 #else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110 # define OCTAVE_DEPRECATED(msg)
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 # define OCTAVE_NORETURN
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112 # define OCTAVE_UNUSED
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114 /* # undef HAVE_OCTAVE_DEPRECATED_ATTR */
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115 /* # undef HAVE_OCTAVE_NORETURN_ATTR */
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
116 /* # undef HAVE_OCTAVE_UNUSED_ATTR */
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117 #endif
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118
21726
f05a00e611ff use namespace for glob and fnmatch wrapper functions
John W. Eaton <jwe@octave.org>
parents: 21691
diff changeset
119 #define OCTAVE_USE_DEPRECATED_FUNCTIONS 1
f05a00e611ff use namespace for glob and fnmatch wrapper functions
John W. Eaton <jwe@octave.org>
parents: 21691
diff changeset
120
21691
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
121 #if defined (__cplusplus)
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
122 template <typename T>
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
123 static inline void
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
124 octave_unused_parameter (const T&)
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
125 { }
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
126 #else
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
127 # define octave_unused_parameter(param) (void) param;
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
128 #endif
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
129
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
130 #if defined (_MSC_VER)
21287
c4b9567f9405 fix building .oct files that include oct.h
John W. Eaton <jwe@octave.org>
parents: 21277
diff changeset
131 # define OCTAVE_EXPORT __declspec(dllexport)
c4b9567f9405 fix building .oct files that include oct.h
John W. Eaton <jwe@octave.org>
parents: 21277
diff changeset
132 # define OCTAVE_IMPORT __declspec(dllimport)
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
133 #else
21287
c4b9567f9405 fix building .oct files that include oct.h
John W. Eaton <jwe@octave.org>
parents: 21277
diff changeset
134 /* All other compilers, at least for now. */
c4b9567f9405 fix building .oct files that include oct.h
John W. Eaton <jwe@octave.org>
parents: 21277
diff changeset
135 # define OCTAVE_EXPORT
c4b9567f9405 fix building .oct files that include oct.h
John W. Eaton <jwe@octave.org>
parents: 21277
diff changeset
136 # define OCTAVE_IMPORT
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
137 #endif
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
138
21344
32651c9a1235 Fix typo from changeset 8376de2eaf00 (Bug #47250)
John Donoghue
parents: 21325
diff changeset
139 #define OCTAVE_API OCTAVE_IMPORT
21287
c4b9567f9405 fix building .oct files that include oct.h
John W. Eaton <jwe@octave.org>
parents: 21277
diff changeset
140 #define OCTINTERP_API OCTAVE_IMPORT
c4b9567f9405 fix building .oct files that include oct.h
John W. Eaton <jwe@octave.org>
parents: 21277
diff changeset
141
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
142 #include <stdint.h>
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
143 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
144
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
145 octave_idx_type="`sed -n 's/#define OCTAVE_IDX_TYPE \([_a-zA-Z][_a-zA-Z0-9]*\)/\1/p' $config_h_file`"
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
146
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
147 if test -z "$octave_idx_type"; then
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
148 echo "mk-octave-config-h.sh: failed to find OCTAVE_IDX_TYPE in $config_h_file" 1>&2
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
149 exit 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
150 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
151
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
152 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
153
21239
ffc9806bb300 mk-octave-config-h.sh: Correct typdef for octave_idx_type.
John W. Eaton <jwe@octave.org>
parents: 21229
diff changeset
154 typedef $octave_idx_type octave_idx_type;
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
155
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
156 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
157
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
158 if grep "#define OCTAVE_ENABLE_FLOAT_TRUNCATE 1" $config_h_file > /dev/null; then
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
159 echo "#define OCTAVE_FLOAT_TRUNCATE volatile"
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
160 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
161 echo "#define OCTAVE_FLOAT_TRUNCATE"
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
162 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
163
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
164 grep "#\(undef\|define\) OCTAVE_ENABLE_64" $config_h_file
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
165 grep "#\(undef\|define\) OCTAVE_ENABLE_ATOMIC_REFCOUNT" $config_h_file
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
166 grep "#\(undef\|define\) OCTAVE_ENABLE_BOUNDS_CHECK" $config_h_file
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
167 grep "#\(undef\|define\) OCTAVE_ENABLE_OPENMP" $config_h_file
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
168
21302
8376de2eaf00 define OCTAVE_HAVE_FAST_INT_OPS in octave-config.h
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
169 grep "#\(undef\|define\) OCTAVE_HAVE_FAST_INT_OPS" $config_h_file
21354
06d15e4e611a move public data type macros to octave-config.h
John W. Eaton <jwe@octave.org>
parents: 21344
diff changeset
170 grep "#\(undef\|define\) OCTAVE_HAVE_LONG_LONG_INT" $config_h_file
06d15e4e611a move public data type macros to octave-config.h
John W. Eaton <jwe@octave.org>
parents: 21344
diff changeset
171 grep "#\(undef\|define\) OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT" $config_h_file
06d15e4e611a move public data type macros to octave-config.h
John W. Eaton <jwe@octave.org>
parents: 21344
diff changeset
172 grep "#\(undef\|define\) OCTAVE_HAVE_OVERLOAD_CHAR_INT8_TYPES" $config_h_file
21302
8376de2eaf00 define OCTAVE_HAVE_FAST_INT_OPS in octave-config.h
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
173
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
174 if grep "#undef HAVE_DEV_T" $config_h_file > /dev/null; then
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
175 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
176
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
177 typedef short dev_t;
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
178
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
179 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
180 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
181 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
182
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
183 /* typedef short dev_t; */
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
184
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
185 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
186 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
187
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
188 if grep "#undef HAVE_INO_T" $config_h_file > /dev/null; then
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
189 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
190
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
191 typedef unsigned long ino_t;
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
192
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
193 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
194 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
195 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
196
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
197 /* typedef unsigned long ino_t; */
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
198
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
199 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
200 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
201
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
202 have_roundl=no
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
203 if grep "#define HAVE_ROUNDL" $config_h_file > /dev/null; then
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
204 have_roundl=yes
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
205 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
206
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
207 sizeof_long_double="`sed -n 's/#define SIZEOF_LONG_DOUBLE \([0-9]*\)/\1/p' $config_h_file`"
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
208
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
209 if test -z "$sizeof_long_double"; then
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
210 echo "mk-octave-config-h.sh: failed to find SIZEOF_LONG_DOUBLE in $config_h_file" 1>&2
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
211 exit 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
212 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
213
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
214 if test $sizeof_long_double -ge 10 && test $have_roundl = yes; then
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
215 echo "#define OCTAVE_INT_USE_LONG_DOUBLE 1"
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
216 if test $sizeof_long_double -lt 16; then
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
217 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
218
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
219 #if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__)
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
220 # define OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
221 #endif
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
222 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
223 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
224 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
225 /* #undef OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED */
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
226 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
227 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
228 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
229 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
230 /* #undef OCTAVE_INT_USE_LONG_DOUBLE */
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
231 /* #undef OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED */
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
232 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
233 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
234
21357
d00efda9bb92 Insert F77_FUNC defines into octave-config.h (Bug #47250)
John D
parents: 21354
diff changeset
235 grep "#\(undef\|define\) F77_FUNC" $config_h_file
d00efda9bb92 Insert F77_FUNC defines into octave-config.h (Bug #47250)
John D
parents: 21354
diff changeset
236
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
237 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
238
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
239 #endif
21240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
241 #endif
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
242 EOF