annotate libinterp/mk-build-env-features.sh @ 27919:1891570abac8

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2020.
author John W. Eaton <jwe@octave.org>
date Mon, 06 Jan 2020 22:29:51 -0500
parents b442ec6dda5c
children bd51beb6205e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16170
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 #! /bin/sh
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
27919
1891570abac8 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27918
diff changeset
3 ## Copyright (C) 2013-2020 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
4 ##
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
5 ## See the file COPYRIGHT.md in the top-level directory of this distribution
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
6 ## or <https://octave.org/COPYRIGHT.html/>.
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
7 ##
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
8 ##
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
9 ## This file is part of Octave.
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
10 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23710
diff changeset
11 ## Octave is free software: you can redistribute it and/or modify it
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
12 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23710
diff changeset
13 ## the Free Software Foundation, either version 3 of the License, or
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
14 ## (at your option) any later version.
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
15 ##
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
16 ## Octave is distributed in the hope that it will be useful, but
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
17 ## WITHOUT ANY WARRANTY; without even the implied warranty of
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
18 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
19 ## GNU General Public License for more details.
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
20 ##
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
21 ## You should have received a copy of the GNU General Public License
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
22 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23710
diff changeset
23 ## <https://www.gnu.org/licenses/>.
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22516
diff changeset
24
21182
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
25 ## Attempt to get traditional sort behavior based on byte values.
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21226
diff changeset
26 LC_ALL=C
21182
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
27 export LC_ALL
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
28
16170
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 set -e
21277
1bca6c72d2b1 maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents: 21226
diff changeset
30
16170
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 AWK=${AWK:-awk}
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 cat << EOF
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 // DO NOT EDIT! Generated automatically from $conffile by Make."
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35
21302
8376de2eaf00 define OCTAVE_HAVE_FAST_INT_OPS in octave-config.h
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
36 #if defined (HAVE_CONFIG_H)
8376de2eaf00 define OCTAVE_HAVE_FAST_INT_OPS in octave-config.h
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
37 # include "config.h"
21182
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
38 #endif
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
39
21220
d78e45987d6a rename octave::build_env namespace from octave::config
John W. Eaton <jwe@octave.org>
parents: 21182
diff changeset
40 #include "build-env.h"
16170
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 #include "ov.h"
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42
21182
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
43 namespace octave
16170
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 {
21220
d78e45987d6a rename octave::build_env namespace from octave::config
John W. Eaton <jwe@octave.org>
parents: 21182
diff changeset
45 namespace build_env
21182
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
46 {
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
47 octave_scalar_map
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
48 features (void)
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
49 {
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
50 static bool initialized = false;
16170
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51
21182
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
52 static octave_scalar_map m;
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
53
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
54 if (! initialized)
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
55 {
21665
7b48be706e28 * build-env-features.sh: Emit code to use static variables instead of repeatedly creating new octave_value objects for true and false.
John W. Eaton <jwe@octave.org>
parents: 21305
diff changeset
56 static octave_value ov_true = (true);
7b48be706e28 * build-env-features.sh: Emit code to use static variables instead of repeatedly creating new octave_value objects for true and false.
John W. Eaton <jwe@octave.org>
parents: 21305
diff changeset
57 static octave_value ov_false = (false);
7b48be706e28 * build-env-features.sh: Emit code to use static variables instead of repeatedly creating new octave_value objects for true and false.
John W. Eaton <jwe@octave.org>
parents: 21305
diff changeset
58
16170
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 EOF
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60
23020
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
61 for conffile in "$@"; do
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
62 $AWK \
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
63 '/# *define *(OCTAVE_HAVE|HAVE)_/ {
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
64 sub (/# *define */, "", $0);
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
65 sub (/(OCTAVE_HAVE|HAVE)_/, "", $1)
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
66 printf (" m.assign (\"%s\", ov_true);\n", $1);
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
67 }
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
68 /\/\* #undef (OCTAVE_HAVE|HAVE)_/ {
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
69 sub (/(OCTAVE_HAVE|HAVE)_/, "", $3);
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
70 printf (" m.assign (\"%s\", ov_false);\n", $3);
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
71 } {
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
72 }' $conffile
1dfbdd593c5b also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents: 22799
diff changeset
73 done | sort
16170
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75 cat << EOF
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76
21182
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
77 initialized = true;
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
78 }
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
79
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
80 return m;
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
81 }
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
82 };
82a44483dbff move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents: 21181
diff changeset
83 };
16170
2a4f83826024 new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 EOF