Mercurial > octave
annotate libinterp/build-env-features.sh @ 21226:a55b8ece1ecd
reorganize octave_config_info again
* build-env-features.sh: Don't include ENABLE_ items in the output.
* toplev.cc (find_config_info): New static function.
(Foctave_config_info): Put Octave configuration info in the main
struct. Put the build system features and build environment info in
substructures. Allow searching of all elements by keyword.
* __have_feature__.m, doc/interpreter/testfun.txi:
Fix name of build features substructure element.
* geometryimages.m, interpimages.m, plotimages.m, sparseimages.m,
splineimages.m: Use __have_feature__ to check for OSMESA.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 08 Feb 2016 23:14:56 -0500 |
parents | d78e45987d6a |
children | 1bca6c72d2b1 |
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 \ |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
38 '/#define HAVE_/ { |
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 } |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
42 /\/\* #undef HAVE_/ { |
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 |