Mercurial > octave
annotate libinterp/build-env-features.sh @ 21305:46284491ffc5
* build-env-features.sh: Fix awk extended regexp syntax (fixes bug in 8376de2eaf00)
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Thu, 18 Feb 2016 15:20:06 -0800 |
parents | 8376de2eaf00 |
children | 7b48be706e28 |
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 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
3 ## 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
|
4 LC_ALL=C |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
5 export LC_ALL |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
6 |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 set -e |
21277
1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents:
21226
diff
changeset
|
8 |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 AWK=${AWK:-awk} |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 conffile=$1 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 cat << EOF |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 // 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
|
15 |
21302
8376de2eaf00
define OCTAVE_HAVE_FAST_INT_OPS in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
16 #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
|
17 # include "config.h" |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
18 #endif |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
19 |
21220
d78e45987d6a
rename octave::build_env namespace from octave::config
John W. Eaton <jwe@octave.org>
parents:
21182
diff
changeset
|
20 #include "build-env.h" |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 #include "ov.h" |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
23 namespace octave |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 { |
21220
d78e45987d6a
rename octave::build_env namespace from octave::config
John W. Eaton <jwe@octave.org>
parents:
21182
diff
changeset
|
25 namespace build_env |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
26 { |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
27 octave_scalar_map |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
28 features (void) |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
29 { |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
30 static bool initialized = false; |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
32 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
|
33 |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
34 if (! initialized) |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
35 { |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 EOF |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 $AWK \ |
21305
46284491ffc5
* build-env-features.sh: Fix awk extended regexp syntax (fixes bug in 8376de2eaf00)
Mike Miller <mtmiller@octave.org>
parents:
21302
diff
changeset
|
39 '/#define (OCTAVE_|)HAVE_/ { |
46284491ffc5
* build-env-features.sh: Fix awk extended regexp syntax (fixes bug in 8376de2eaf00)
Mike Miller <mtmiller@octave.org>
parents:
21302
diff
changeset
|
40 sub (/(OCTAVE_|)HAVE_/, "", $2); |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
41 printf (" m.assign (\"%s\", octave_value (true));\n", $2); |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 } |
21305
46284491ffc5
* build-env-features.sh: Fix awk extended regexp syntax (fixes bug in 8376de2eaf00)
Mike Miller <mtmiller@octave.org>
parents:
21302
diff
changeset
|
43 /\/\* #undef (OCTAVE_|)HAVE_/ { |
46284491ffc5
* build-env-features.sh: Fix awk extended regexp syntax (fixes bug in 8376de2eaf00)
Mike Miller <mtmiller@octave.org>
parents:
21302
diff
changeset
|
44 sub (/(OCTAVE_|)HAVE_/, "", $3); |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
45 printf (" m.assign (\"%s\", octave_value (false));\n", $3); |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 } { |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
47 }' $conffile | sort |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 cat << EOF |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
51 initialized = true; |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
52 } |
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 return m; |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
55 } |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
56 }; |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
57 }; |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 EOF |