annotate build-aux/mk-octave-config-h.sh @ 21850:0507f0d2135d

indent preprocessor directives in octave-config.h and oct-conf-post.h * build-aux/mk-octave-config-h.sh: Indent preprocessor directives in generated output. * oct-conf-post.in.h: Indent preprocessor directives.
author John W. Eaton <jwe@octave.org>
date Fri, 10 Jun 2016 13:57:17 -0400
parents f05a00e611ff
children f471f513ffd0
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
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
95 # if defined (__cplusplus)
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
96 # include <cstdint>
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
97 # else
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
98 # include <stdint.h>
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
99 # endif
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
100
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
101 # 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
102 # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
103 # define OCTAVE_DEPRECATED(msg) __attribute__ ((__deprecated__ (msg)))
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
104 # else
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
105 # define OCTAVE_DEPRECATED(msg) __attribute__ ((__deprecated__))
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
106 # endif
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
107 # 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
108 # 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
109
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 # 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
111 # 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
112 # 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
113 # else
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
114 # define OCTAVE_DEPRECATED(msg)
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
115 # 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
116 # 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
117
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
118 /* # 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
119 /* # 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
120 /* # 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
121 # endif
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 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
124
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
125 # if defined (__cplusplus)
21691
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
126 template <typename T>
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
127 static inline void
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
128 octave_unused_parameter (const T&)
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
129 { }
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
130 # else
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
131 # 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
132 # endif
21691
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21357
diff changeset
133
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
134 # 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
135 # 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
136 # 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
137 # else
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
138 /* 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
139 # 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
140 # 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
141 # endif
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
142
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
143 # 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
144 # 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
145 EOF
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 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
148
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
149 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
150 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
151 exit 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
152 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
153
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
154 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
155
21239
ffc9806bb300 mk-octave-config-h.sh: Correct typdef for octave_idx_type.
John W. Eaton <jwe@octave.org>
parents: 21229
diff changeset
156 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
157
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
158 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
159
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
160 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
161 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
162 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
163 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
164 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
165
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
166 sed -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_64.*$\)/# \1/p' $config_h_file
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
167 sed -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_ATOMIC_REFCOUNT.*$\)/# \1/p' $config_h_file
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
168 sed -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_BOUNDS_CHECK.*$\)/# \1/p' $config_h_file
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
169 sed -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_OPENMP.*$\)/# \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
170
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
171 sed -n 's/#\(\(undef\|define\) OCTAVE_HAVE_FAST_INT_OPS.*$\)/# \1/p' $config_h_file
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
172 sed -n 's/#\(\(undef\|define\) OCTAVE_HAVE_LONG_LONG_INT.*$\)/# \1/p' $config_h_file
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
173 sed -n 's/#\(\(undef\|define\) OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT.*$\)/# \1/p' $config_h_file
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
174 sed -n 's/#\(\(undef\|define\) OCTAVE_HAVE_OVERLOAD_CHAR_INT8_TYPES.*$\)/# \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
175
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
176 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
177 cat << EOF
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 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
180
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
181 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
182 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
183 cat << EOF
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 /* 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
186
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
187 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
188 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
189
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
190 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
191 cat << EOF
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 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
194
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
195 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
196 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
197 cat << EOF
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 /* 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
200
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
201 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
202 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
203
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=no
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21240
diff changeset
205 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
206 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
207 fi
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 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
210
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
211 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
212 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
213 exit 1
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
214 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
215
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 -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
217 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
218 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
219 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
220
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
221 # 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
222 # 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
223 # endif
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 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
226 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
227 /* # 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
228 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
229 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
230 else
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
231 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
232 /* # 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
233 /* # 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
234 EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
235 fi
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
236
21850
0507f0d2135d indent preprocessor directives in octave-config.h and oct-conf-post.h
John W. Eaton <jwe@octave.org>
parents: 21726
diff changeset
237 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
238
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
239 cat << EOF
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
240
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
241 #endif
21240
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
242
7af5ca01ecac allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents: 21239
diff changeset
243 #endif
21229
a83e7a384ee0 create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff changeset
244 EOF