annotate build-aux/mk-octave-config-h.sh @ 29357:bbbe4dcc7200 stable

use the same comment style for copyright headers in .m files and shell scripts In files that use '#' for comments, use '##' at the beginning of lines in copyright headers.
author John W. Eaton <jwe@octave.org>
date Wed, 10 Feb 2021 09:44:29 -0500
parents bd51beb6205e
children 0a5b15007766
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
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
3 ########################################################################
29357
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
4 ##
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
5 ## Copyright (C) 2016-2020 The Octave Project Developers
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
6 ##
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
7 ## See the file COPYRIGHT.md in the top-level directory of this
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
8 ## distribution or <https://octave.org/copyright/>.
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
9 ##
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
10 ## This file is part of Octave.
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
11 ##
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
12 ## Octave is free software: you can redistribute it and/or modify it
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
13 ## under the terms of the GNU General Public License as published by
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
14 ## the Free Software Foundation, either version 3 of the License, or
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
15 ## (at your option) any later version.
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
16 ##
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
17 ## Octave is distributed in the hope that it will be useful, but
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
18 ## WITHOUT ANY WARRANTY; without even the implied warranty of
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
19 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
20 ## GNU General Public License for more details.
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
21 ##
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
22 ## You should have received a copy of the GNU General Public License
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
23 ## along with Octave; see the file COPYING. If not, see
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
24 ## <https://www.gnu.org/licenses/>.
bbbe4dcc7200 use the same comment style for copyright headers in .m files and shell scripts
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
25 ##
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
26 ########################################################################
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27
21240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
28 # 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
29 # 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
30 # 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
31
22468
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
32 SED=${SED:-sed}
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
33
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 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
35 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
36 exit 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 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
40
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 cat << EOF
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
42 // DO NOT EDIT! Generated by mk-octave-config-h.sh.
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
44 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
45 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
46 // Copyright (C) 2016-2020 The Octave Project Developers
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
47 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
48 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
49 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
50 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
51 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
52 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
53 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
54 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
55 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
56 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
57 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
58 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
59 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
60 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
61 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
62 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
63 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
64 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
65 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
66 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
67 ////////////////////////////////////////////////////////////////////////
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68
21240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
69 /*
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 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
72
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
73 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21287
diff changeset
74 # include "config.h"
21240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
75 #endif
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 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
78
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
79 #if ! defined (INCLUSION_GUARD_SYMBOL)
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
80 #define INCLUSION_GUARD_SYMBOL 1
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
81
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
82 #include "octave-config.h"
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
83
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
84 // Contents of header file.
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
85
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
86 #endif
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 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
89
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
90 octave_NAME_h
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
91
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
92 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
93
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
94 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
95 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
96 autoconf-generated config.h file.
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
97
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
98 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
99 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
100
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
101 */
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
102
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 #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
104 #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
105
21240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
106 #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
107
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
108 # if defined (__cplusplus)
27850
8384125d6f5f Include header that defines the macros with format constants.
Markus Mützel <markus.muetzel@gmx.de>
parents: 27737
diff changeset
109 # include <cinttypes>
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
110 # else
27850
8384125d6f5f Include header that defines the macros with format constants.
Markus Mützel <markus.muetzel@gmx.de>
parents: 27737
diff changeset
111 # include <inttypes.h>
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
112 # endif
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
114 # if defined (__GNUC__)
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
115 # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
23615
be7b884ac589 use version number in OCTAVE_DEPRECATED macro
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
116 # define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__ ("[" #ver "]: " msg)))
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
117 # else
23615
be7b884ac589 use version number in OCTAVE_DEPRECATED macro
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
118 # define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
119 # endif
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
120 # define OCTAVE_NORETURN __attribute__ ((__noreturn__))
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
121 # define OCTAVE_UNUSED __attribute__ ((__unused__))
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
122
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
123 # define HAVE_OCTAVE_DEPRECATED_ATTR 1
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
124 # define HAVE_OCTAVE_NORETURN_ATTR 1
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
125 # define HAVE_OCTAVE_UNUSED_ATTR 1
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
126 # else
23615
be7b884ac589 use version number in OCTAVE_DEPRECATED macro
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
127 # define OCTAVE_DEPRECATED(ver, msg)
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
128 # define OCTAVE_NORETURN
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
129 # define OCTAVE_UNUSED
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
130
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
131 /* # undef HAVE_OCTAVE_DEPRECATED_ATTR */
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
132 /* # undef HAVE_OCTAVE_NORETURN_ATTR */
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
133 /* # undef HAVE_OCTAVE_UNUSED_ATTR */
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
134 # endif
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
135
26164
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
136 # if defined (__MINGW32__)
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
137 /* MinGW requires special handling due to different format specifiers
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
138 * on different platforms. The macro __MINGW_PRINTF_FORMAT maps to
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
139 * either gnu_printf or ms_printf depending on where we are compiling
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
140 * to avoid warnings on format specifiers that are legal.
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
141 * See: https://bugzilla.mozilla.org/show_bug.cgi?id=1331349 */
27737
527e25f7ee38 Add missing header for compile time format check for MinGW (bug #57270).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27486
diff changeset
142 # if defined (__cplusplus)
527e25f7ee38 Add missing header for compile time format check for MinGW (bug #57270).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27486
diff changeset
143 # include <cstdio>
527e25f7ee38 Add missing header for compile time format check for MinGW (bug #57270).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27486
diff changeset
144 # else
527e25f7ee38 Add missing header for compile time format check for MinGW (bug #57270).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27486
diff changeset
145 # include <stdio.h>
527e25f7ee38 Add missing header for compile time format check for MinGW (bug #57270).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27486
diff changeset
146 # endif
527e25f7ee38 Add missing header for compile time format check for MinGW (bug #57270).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27486
diff changeset
147
26164
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
148 # define OCTAVE_FORMAT_PRINTF(stringIndex, firstToCheck) \
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
149 __attribute__ ((format (__MINGW_PRINTF_FORMAT, stringIndex, firstToCheck)))
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
150
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
151 # define HAVE_OCTAVE_FORMAT_PRINTF_ATTR 1
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
152 # elif defined (__GNUC__)
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
153 /* The following attributes are used with gcc and clang compilers. */
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
154 # define OCTAVE_FORMAT_PRINTF(index, first) \
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
155 __attribute__ ((__format__(printf, index, first)))
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
156
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
157 # define HAVE_OCTAVE_FORMAT_PRINTF_ATTR 1
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
158 # else
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
159 # define OCTAVE_FORMAT_PRINTF(index, first)
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
160
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
161 /* # undef HAVE_OCTAVE_FORMAT_PRINTF_ATTR */
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
162 # endif
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
163
23826
d69021d58a61 avoid fallthrough warnings
John W. Eaton <jwe@octave.org>
parents: 23615
diff changeset
164 # if ! defined (OCTAVE_FALLTHROUGH)
d69021d58a61 avoid fallthrough warnings
John W. Eaton <jwe@octave.org>
parents: 23615
diff changeset
165 # if defined (__cplusplus) && __cplusplus > 201402L
d69021d58a61 avoid fallthrough warnings
John W. Eaton <jwe@octave.org>
parents: 23615
diff changeset
166 # define OCTAVE_FALLTHROUGH [[fallthrough]]
d69021d58a61 avoid fallthrough warnings
John W. Eaton <jwe@octave.org>
parents: 23615
diff changeset
167 # elif defined (__GNUC__) && __GNUC__ < 7
d69021d58a61 avoid fallthrough warnings
John W. Eaton <jwe@octave.org>
parents: 23615
diff changeset
168 # define OCTAVE_FALLTHROUGH ((void) 0)
d69021d58a61 avoid fallthrough warnings
John W. Eaton <jwe@octave.org>
parents: 23615
diff changeset
169 # else
d69021d58a61 avoid fallthrough warnings
John W. Eaton <jwe@octave.org>
parents: 23615
diff changeset
170 # define OCTAVE_FALLTHROUGH __attribute__ ((__fallthrough__))
d69021d58a61 avoid fallthrough warnings
John W. Eaton <jwe@octave.org>
parents: 23615
diff changeset
171 # endif
d69021d58a61 avoid fallthrough warnings
John W. Eaton <jwe@octave.org>
parents: 23615
diff changeset
172 # endif
d69021d58a61 avoid fallthrough warnings
John W. Eaton <jwe@octave.org>
parents: 23615
diff changeset
173
22118
17c59e33b236 * oct-conf-post.in.h, mk-octave-config-h.sh: Revert unintended changes from previous changeset.
John W. Eaton <jwe@octave.org>
parents: 22117
diff changeset
174 # define OCTAVE_USE_DEPRECATED_FUNCTIONS 1
21726
f05a00e611ff use namespace for glob and fnmatch wrapper functions
John W. Eaton <jwe@octave.org>
parents: 21691
diff changeset
175
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
176 # if defined (__cplusplus)
21691
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
177 template <typename T>
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
178 static inline void
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
179 octave_unused_parameter (const T&)
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
180 { }
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
181 # else
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
182 # define octave_unused_parameter(param) (void) param;
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
183 # endif
21691
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
184
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
185 # if defined (_MSC_VER)
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
186 # define OCTAVE_EXPORT __declspec(dllexport)
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
187 # define OCTAVE_IMPORT __declspec(dllimport)
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
188 # else
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
189 /* All other compilers, at least for now. */
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
190 # define OCTAVE_EXPORT
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
191 # define OCTAVE_IMPORT
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
192 # endif
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
193
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
194 # define OCTAVE_API OCTAVE_IMPORT
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
195 # define OCTINTERP_API 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
196 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
197
22468
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
198 octave_idx_type="`$SED -n 's/#define OCTAVE_IDX_TYPE \([_a-zA-Z][_a-zA-Z0-9]*\)/\1/p' $config_h_file`"
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
199
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
200 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
201 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
202 exit 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
203 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
204
22867
78f1d359dd8f define octave_f77_int_type in octave-config.h (bug #49776)
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
205 octave_f77_int_type="`$SED -n 's/#define OCTAVE_F77_INT_TYPE \([_a-zA-Z][_a-zA-Z0-9]*\)/\1/p' $config_h_file`"
78f1d359dd8f define octave_f77_int_type in octave-config.h (bug #49776)
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
206
78f1d359dd8f define octave_f77_int_type in octave-config.h (bug #49776)
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
207 if test -z "$octave_f77_int_type"; then
78f1d359dd8f define octave_f77_int_type in octave-config.h (bug #49776)
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
208 echo "mk-octave-config-h.sh: failed to find OCTAVE_F77_INT_TYPE in $config_h_file" 1>&2
78f1d359dd8f define octave_f77_int_type in octave-config.h (bug #49776)
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
209 exit 1
78f1d359dd8f define octave_f77_int_type in octave-config.h (bug #49776)
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
210 fi
78f1d359dd8f define octave_f77_int_type in octave-config.h (bug #49776)
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
211
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
212 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
213
21239
ffc9806bb300 mk-octave-config-h.sh: Correct typdef for octave_idx_type.
John W. Eaton <jwe@octave.org>
parents: 21229
diff changeset
214 typedef $octave_idx_type octave_idx_type;
22867
78f1d359dd8f define octave_f77_int_type in octave-config.h (bug #49776)
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
215 typedef $octave_f77_int_type octave_f77_int_type;
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
216
22990
f71191aea679 provide macro declaring existence of f77 integer type
John W. Eaton <jwe@octave.org>
parents: 22867
diff changeset
217 # define OCTAVE_HAVE_F77_INT_TYPE 1
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
218
24538
2b273df71aa0 allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
219
2b273df71aa0 allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
220 # if defined (__cplusplus) && ! defined (OCTAVE_THREAD_LOCAL)
2b273df71aa0 allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
221 # define OCTAVE_THREAD_LOCAL
2b273df71aa0 allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
222 # endif
2b273df71aa0 allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
223
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
224 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
225
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
226 if grep "#define OCTAVE_ENABLE_FLOAT_TRUNCATE 1" $config_h_file > /dev/null; then
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
227 echo "# define OCTAVE_FLOAT_TRUNCATE volatile"
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
228 else
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
229 echo "# define OCTAVE_FLOAT_TRUNCATE"
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
230 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
231
22144
469a4142c4cf * mk-octave-config-h.sh: Improve readability of output.
John W. Eaton <jwe@octave.org>
parents: 22143
diff changeset
232 echo ""
469a4142c4cf * mk-octave-config-h.sh: Improve readability of output.
John W. Eaton <jwe@octave.org>
parents: 22143
diff changeset
233
22468
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
234 $SED -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_64.*$\)/# \1/p' $config_h_file
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
235 $SED -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_BOUNDS_CHECK.*$\)/# \1/p' $config_h_file
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
236 $SED -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_OPENMP.*$\)/# \1/p' $config_h_file
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
237 $SED -n 's/#\(\(undef\|define\) OCTAVE_HAVE_LONG_LONG_INT.*$\)/# \1/p' $config_h_file
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
238 $SED -n 's/#\(\(undef\|define\) OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT.*$\)/# \1/p' $config_h_file
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
239 $SED -n 's/#\(\(undef\|define\) OCTAVE_HAVE_OVERLOAD_CHAR_INT8_TYPES.*$\)/# \1/p' $config_h_file
23014
7a9313d27cea define macros for size of idx_type and f77_int_type
John W. Eaton <jwe@octave.org>
parents: 22990
diff changeset
240 $SED -n 's/#\(\(undef\|define\) OCTAVE_SIZEOF_F77_INT_TYPE.*$\)/# \1/p' $config_h_file
7a9313d27cea define macros for size of idx_type and f77_int_type
John W. Eaton <jwe@octave.org>
parents: 22990
diff changeset
241 $SED -n 's/#\(\(undef\|define\) OCTAVE_SIZEOF_IDX_TYPE.*$\)/# \1/p' $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
242
26164
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
243 cat << EOF
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
244
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
245 # if defined (OCTAVE_ENABLE_64)
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
246 # define OCTAVE_IDX_TYPE_FORMAT PRId64
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
247 # else
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
248 # define OCTAVE_IDX_TYPE_FORMAT PRId32
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
249 # endif
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
250
7f6a50f73625 Silence compiler warnings about format identifier for octave_idx_type (bug #55046).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26147
diff changeset
251 EOF
22144
469a4142c4cf * mk-octave-config-h.sh: Improve readability of output.
John W. Eaton <jwe@octave.org>
parents: 22143
diff changeset
252
22468
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
253 $SED -n 's/#\(\(undef\|define\) gid_t.*$\)/# \1/p' $config_h_file
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
254 $SED -n 's/#\(\(undef\|define\) uid_t.*$\)/# \1/p' $config_h_file
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
255 $SED -n 's/#\(\(undef\|define\) nlink_t.*$\)/# \1/p' $config_h_file
22000
f471f513ffd0 also define gid_t, uid_t, and nlink_t in octave-config.h (bug #48332)
John W. Eaton <jwe@octave.org>
parents: 21850
diff changeset
256
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
257 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
258 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
259 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
260 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
261 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
262 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
263 /* 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
264 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
265 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
266
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
267 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
268 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
269 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
270 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
271 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
272 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
273 /* 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
274 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
275 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
276
22144
469a4142c4cf * mk-octave-config-h.sh: Improve readability of output.
John W. Eaton <jwe@octave.org>
parents: 22143
diff changeset
277 echo ""
469a4142c4cf * mk-octave-config-h.sh: Improve readability of output.
John W. Eaton <jwe@octave.org>
parents: 22143
diff changeset
278
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
279 have_roundl=no
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
280 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
281 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
282 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
283
22468
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
284 sizeof_long_double="`$SED -n 's/#define SIZEOF_LONG_DOUBLE \([0-9]*\)/\1/p' $config_h_file`"
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
285
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
286 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
287 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
288 exit 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
289 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
290
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
291 if test $sizeof_long_double -ge 10 && test $have_roundl = yes; then
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
292 echo "# define OCTAVE_INT_USE_LONG_DOUBLE 1"
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
293 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
294 cat << EOF
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
295 # if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__)
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
296 # define OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED 1
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
297 # endif
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
298 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
299 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
300 cat << EOF
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
301 /* # undef OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED */
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
302 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
303 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
304 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
305 cat << EOF
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
306 /* # undef OCTAVE_INT_USE_LONG_DOUBLE */
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
307 /* # undef OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED */
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
308 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
309 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
310
22144
469a4142c4cf * mk-octave-config-h.sh: Improve readability of output.
John W. Eaton <jwe@octave.org>
parents: 22143
diff changeset
311 echo ""
469a4142c4cf * mk-octave-config-h.sh: Improve readability of output.
John W. Eaton <jwe@octave.org>
parents: 22143
diff changeset
312
22468
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
313 $SED -n 's/#\(\(undef\|define\) F77_USES_.*$\)/# \1/p' $config_h_file
22144
469a4142c4cf * mk-octave-config-h.sh: Improve readability of output.
John W. Eaton <jwe@octave.org>
parents: 22143
diff changeset
314
469a4142c4cf * mk-octave-config-h.sh: Improve readability of output.
John W. Eaton <jwe@octave.org>
parents: 22143
diff changeset
315 echo ""
469a4142c4cf * mk-octave-config-h.sh: Improve readability of output.
John W. Eaton <jwe@octave.org>
parents: 22143
diff changeset
316
22468
6f5cde55e225 build: ensure GNU sed is used in mk-octave-config-h.sh
Mike Miller <mtmiller@octave.org>
parents: 22144
diff changeset
317 $SED -n 's/#\(\(undef\|define\) F77_FUNC.*$\)/# \1/p' $config_h_file
21357
d00efda9bb92 Insert F77_FUNC defines into octave-config.h (Bug #47250)
John D
parents: 21354
diff changeset
318
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
319 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
320
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
321 #endif
21240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
322
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
323 #endif
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
324 EOF