Mercurial > octave
annotate libinterp/build-env-features.sh @ 21220:d78e45987d6a
rename octave::build_env namespace from octave::config
* build-env-features.sh: Rename from ocgt-conf-features.sh.
Update for new names.
* build-env.h: Rename from oct-conf.h. Also declare features function.
* build-env.in.cc: Rename from oct-conf.in.cc.
* oct-conf-features.h: Delete.
* libinterp/module.mk: Update.
* toplev.cc, __init_gnuplot__.cc, octave.cc: Update for new names.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 07 Feb 2016 14:56:17 -0500 |
parents | libinterp/config-features.sh@82a44483dbff |
children | a55b8ece1ecd |
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. |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
4 LC_ALL="C" |
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 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 AWK=${AWK:-awk} |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 conffile=$1 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 cat << EOF |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 // 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
|
14 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
15 #ifdef HAVE_CONFIG_H |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
16 #include <config.h> |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
17 #endif |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
18 |
21220
d78e45987d6a
rename octave::build_env namespace from octave::config
John W. Eaton <jwe@octave.org>
parents:
21182
diff
changeset
|
19 #include "build-env.h" |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 #include "ov.h" |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
22 namespace octave |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 { |
21220
d78e45987d6a
rename octave::build_env namespace from octave::config
John W. Eaton <jwe@octave.org>
parents:
21182
diff
changeset
|
24 namespace build_env |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
25 { |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
26 octave_scalar_map |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
27 features (void) |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
28 { |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
29 static bool initialized = false; |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
31 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
|
32 |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
33 if (! initialized) |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
34 { |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 EOF |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 $AWK \ |
21181 | 38 '/#define (HAVE|ENABLE)_/ { |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
39 sub (/HAVE_/, "", $2); |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
40 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
|
41 } |
21181 | 42 /\/\* #undef (HAVE|ENABLE)_/ { |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
43 sub (/HAVE_/, "", $3); |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
44 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
|
45 } { |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
46 }' $conffile | sort |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 cat << EOF |
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 |
21182
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
50 initialized = true; |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
51 } |
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 return m; |
82a44483dbff
move octave_config_features function out of header file
John W. Eaton <jwe@octave.org>
parents:
21181
diff
changeset
|
54 } |
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 }; |
16170
2a4f83826024
new way to test for features in Octave scripts
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 EOF |