Mercurial > octave
annotate libinterp/mk-build-env-features.sh @ 28020:eb46a9f47164 stable release-5-2-0
Avoid color changes in MS Windows GUI terminal (bug #57658).
* scripts/miscellaneous/mkoctfile.m: Add the gcc compiler flag
"-fdiagnostics-color=never" in case of MS Windows and the GUI is running.
For the MS Windows CLI version the output looks very nice. Update year.
author | Kai T. Ohlhus <k.ohlhus@gmail.com> |
---|---|
date | Tue, 28 Jan 2020 10:57:35 +0900 |
parents | 00f796120a6d |
children | b442ec6dda5c |
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 |
26376
00f796120a6d
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
3 ## Copyright (C) 2013-2019 John W. Eaton |
22799
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22516
diff
changeset
|
4 ## |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22516
diff
changeset
|
5 ## This file is part of Octave. |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22516
diff
changeset
|
6 ## |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23710
diff
changeset
|
7 ## 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
|
8 ## 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
|
9 ## 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
|
10 ## (at your option) any later version. |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22516
diff
changeset
|
11 ## |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22516
diff
changeset
|
12 ## 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
|
13 ## 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
|
14 ## 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
|
15 ## GNU General Public License for more details. |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22516
diff
changeset
|
16 ## |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22516
diff
changeset
|
17 ## 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
|
18 ## 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
|
19 ## <https://www.gnu.org/licenses/>. |
22799
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22516
diff
changeset
|
20 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
21 ## 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
|
22 LC_ALL=C |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
23 export LC_ALL |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
24 |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 set -e |
21277
1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents:
21226
diff
changeset
|
26 |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 AWK=${AWK:-awk} |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 cat << EOF |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 // 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
|
31 |
21302
8376de2eaf00
define OCTAVE_HAVE_FAST_INT_OPS in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
32 #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
|
33 # include "config.h" |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
34 #endif |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
35 |
21220
d78e45987d6a
rename octave::build_env namespace from octave::config
John W. Eaton <jwe@octave.org>
parents:
21182
diff
changeset
|
36 #include "build-env.h" |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 #include "ov.h" |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
39 namespace octave |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 { |
21220
d78e45987d6a
rename octave::build_env namespace from octave::config
John W. Eaton <jwe@octave.org>
parents:
21182
diff
changeset
|
41 namespace build_env |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
42 { |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
43 octave_scalar_map |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
44 features (void) |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
45 { |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
46 static bool initialized = false; |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
48 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
|
49 |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
50 if (! initialized) |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
51 { |
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
|
52 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
|
53 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
|
54 |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 EOF |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 |
23020
1dfbdd593c5b
also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents:
22799
diff
changeset
|
57 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
|
58 $AWK \ |
1dfbdd593c5b
also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents:
22799
diff
changeset
|
59 '/# *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
|
60 sub (/# *define */, "", $0); |
1dfbdd593c5b
also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents:
22799
diff
changeset
|
61 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
|
62 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
|
63 } |
1dfbdd593c5b
also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents:
22799
diff
changeset
|
64 /\/\* #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
|
65 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
|
66 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
|
67 } { |
1dfbdd593c5b
also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents:
22799
diff
changeset
|
68 }' $conffile |
1dfbdd593c5b
also read oct-conf-post.h for build environment info
John W. Eaton <jwe@octave.org>
parents:
22799
diff
changeset
|
69 done | sort |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
70 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 cat << EOF |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
72 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
73 initialized = true; |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
74 } |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
75 |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
76 return m; |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
77 } |
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 }; |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 EOF |