Mercurial > octave
annotate build-aux/mk-octave-config-h.sh @ 21277:1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
* mk-octave-config-h.sh: Keep if-then on a single line.
* move-if-change: Insert a space in interpreter directive for consistency.
* build-env-features.sh, config-images.sh, config-module.sh, config-ops.sh,
find-defun-files.sh, find-files-with-tests.sh, mk-errno-list,
libinterp/mk-pkg-add, scripts/mk-pkg-add, mkbuiltins, mkdefs, mkdocs,
mkf77def.in, mkops: Initialize environment variable defaults consistently.
Use shift only when the argument list is not empty. Remove unnecessary
quotes and semicolons on variable assignments. Insert/remove blank lines for
consistency.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Tue, 16 Feb 2016 18:36:00 -0800 |
parents | 7af5ca01ecac |
children | c4b9567f9405 |
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) |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
61 # include <config.h> |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
62 #endif |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
63 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
64 All public Octave header files should have the form |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
65 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
66 #if ! defined (INCLUSION_GUARD_SYMBOL) |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
67 #define INCLUSION_GUARD_SYMBOL 1 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
68 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
69 #include "octave-config.h" |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
70 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
71 // Contents of header file. |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
72 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
73 #endif |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
74 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
75 In Octave source files, INCLUSION_GUARD_SYMBOL should have the form |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
76 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
77 octave_NAME_h |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
78 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
79 with NAME formed from the header file name with '-' replaced by '_'. |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
80 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
81 It is safe to include octave-config.h unconditionally since it will |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
82 expand to an empty file if it is included after Octave's |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
83 autoconf-generated config.h file. |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
84 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
85 Users of Octave's libraries should not need to include octave-config.h |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
86 since all of Octave's header files already include it. |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
87 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
88 */ |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
89 |
21229
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
90 #if ! defined (octave_octave_config_h) |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
91 #define octave_octave_config_h 1 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
92 |
21240
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
93 #if ! defined (OCTAVE_AUTOCONFIG_H_INCLUDED) |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
94 |
21229
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
95 #include <stdint.h> |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
96 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
97 #if defined (__GNUC__) |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
98 # define OCTAVE_DEPRECATED(msg) __attribute__ ((__deprecated__ (msg))) |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
99 # define OCTAVE_NORETURN __attribute__ ((__noreturn__)) |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
100 # define OCTAVE_UNUSED __attribute__ ((__unused__)) |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
101 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
102 # define HAVE_OCTAVE_DEPRECATED_ATTR 1 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
103 # define HAVE_OCTAVE_NORETURN_ATTR 1 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
104 # define HAVE_OCTAVE_UNUSED_ATTR 1 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
105 #else |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
106 # define OCTAVE_DEPRECATED(msg) |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
107 # define OCTAVE_NORETURN |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
108 # define OCTAVE_UNUSED |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
109 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
110 /* # undef HAVE_OCTAVE_DEPRECATED_ATTR */ |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
111 /* # undef HAVE_OCTAVE_NORETURN_ATTR */ |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
112 /* # undef HAVE_OCTAVE_UNUSED_ATTR */ |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
113 #endif |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
114 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
115 #if defined (_MSC_VER) |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
116 # define OCTAVE_API __declspec(dllimport) |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
117 # define OCTINTERP_API __declspec(dllimport) |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
118 #else |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
119 # define OCTAVE_API |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
120 # define OCTINTERP_API |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
121 #endif |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
122 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
123 #include <stdint.h> |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
124 EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
125 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
126 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
|
127 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
128 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
|
129 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
|
130 exit 1 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
131 fi |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
132 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
133 cat << EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
134 |
21239
ffc9806bb300
mk-octave-config-h.sh: Correct typdef for octave_idx_type.
John W. Eaton <jwe@octave.org>
parents:
21229
diff
changeset
|
135 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
|
136 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
137 EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
138 |
21277
1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents:
21240
diff
changeset
|
139 if grep "#define OCTAVE_ENABLE_FLOAT_TRUNCATE 1" $config_h_file > /dev/null; then |
21229
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
140 echo "#define OCTAVE_FLOAT_TRUNCATE volatile" |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
141 else |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
142 echo "#define OCTAVE_FLOAT_TRUNCATE" |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
143 fi |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
144 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
145 grep "#\(undef\|define\) OCTAVE_ENABLE_64" $config_h_file |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
146 grep "#\(undef\|define\) OCTAVE_ENABLE_ATOMIC_REFCOUNT" $config_h_file |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
147 grep "#\(undef\|define\) OCTAVE_ENABLE_BOUNDS_CHECK" $config_h_file |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
148 grep "#\(undef\|define\) OCTAVE_ENABLE_OPENMP" $config_h_file |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
149 |
21277
1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents:
21240
diff
changeset
|
150 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
|
151 cat << EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
152 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
153 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
|
154 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
155 EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
156 else |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
157 cat << EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
158 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
159 /* 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
|
160 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
161 EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
162 fi |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
163 |
21277
1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents:
21240
diff
changeset
|
164 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
|
165 cat << EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
166 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
167 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
|
168 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
169 EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
170 else |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
171 cat << EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
172 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
173 /* 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
|
174 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
175 EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
176 fi |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
177 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
178 have_roundl=no |
21277
1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents:
21240
diff
changeset
|
179 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
|
180 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
|
181 fi |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
182 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
183 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
|
184 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
185 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
|
186 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
|
187 exit 1 |
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 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
190 if test $sizeof_long_double -ge 10 && test $have_roundl = yes; then |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
191 echo "#define OCTAVE_INT_USE_LONG_DOUBLE 1" |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
192 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
|
193 cat << EOF |
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 #if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__) |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
196 # define OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED 1 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
197 #endif |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
198 EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
199 else |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
200 cat << EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
201 /* #undef OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED */ |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
202 EOF |
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 else |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
205 cat << EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
206 /* #undef OCTAVE_INT_USE_LONG_DOUBLE */ |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
207 /* #undef OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED */ |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
208 EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
209 fi |
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 cat << EOF |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
212 |
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
213 #endif |
21240
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
214 |
7af5ca01ecac
allow octave-config.h to be included unconditionally
John W. Eaton <jwe@octave.org>
parents:
21239
diff
changeset
|
215 #endif |
21229
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
216 EOF |