Mercurial > octave-nkf
comparison libinterp/config-features.sh @ 16170:2a4f83826024
new way to test for features in Octave scripts
* __have_feature__.m: New file.
* test.m, geometryimages.m, sparseimages.m: Use it. Delete tests for
testif and xfail.
* config-features.sh: New file.
* libinterp/Makefile.am (EXTRA_DIST): Include config-features.sh in
the list.
(oct-conf-features.h): New target.
(BUILT_NODISTFILES, nodist_liboctinterp_la_SOURCES): Include
oct-conf-features.h in the list.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 02 Mar 2013 07:41:50 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
16169:0303fda3e929 | 16170:2a4f83826024 |
---|---|
1 #! /bin/sh | |
2 | |
3 set -e | |
4 AWK=${AWK:-awk} | |
5 | |
6 conffile=$1 | |
7 | |
8 cat << EOF | |
9 // DO NOT EDIT! Generated automatically from $conffile by Make." | |
10 | |
11 #include "oct-map.h" | |
12 #include "ov.h" | |
13 | |
14 octave_scalar_map | |
15 octave_config_features (void) | |
16 { | |
17 octave_scalar_map m; | |
18 | |
19 EOF | |
20 | |
21 $AWK \ | |
22 '/#define HAVE_/ { | |
23 sub (/HAVE_/, "", $2); | |
24 printf (" m.assign (\"%s\", octave_value (true));\n", $2); | |
25 } | |
26 /\/\* #undef HAVE_/ { | |
27 sub (/HAVE_/, "", $3); | |
28 printf (" m.assign (\"%s\", octave_value (false));\n", $3); | |
29 } { | |
30 }' $conffile | |
31 | |
32 cat << EOF | |
33 | |
34 return m; | |
35 } | |
36 EOF |