view libinterp/build-env-features.sh @ 21302:8376de2eaf00

define OCTAVE_HAVE_FAST_INT_OPS in octave-config.h * acinclude.m4 (OCTAVE_FAST_INT_OPS): Define OCTAVE_HAVE_FAST_INT_OPS instead of HAVE_FAST_INT_OPS. * oct-inttypes.cc, oct-inttypes.h: Use new macro name. * mk-octave-config-h.sh: Emit definition of OCTAVE_HAVE_FAST_INT_OPS. * build-env-features.sh: Also include symbols beginning with "OCTAVE_HAVE_".
author John W. Eaton <jwe@octave.org>
date Thu, 18 Feb 2016 16:42:42 -0500
parents 40de9f8f23a6
children 46284491ffc5
line wrap: on
line source

#! /bin/sh

## Attempt to get traditional sort behavior based on byte values.
LC_ALL=C
export LC_ALL

set -e

AWK=${AWK:-awk}

conffile=$1

cat << EOF
// DO NOT EDIT!  Generated automatically from $conffile by Make."

#if defined (HAVE_CONFIG_H)
#  include "config.h"
#endif

#include "build-env.h"
#include "ov.h"

namespace octave
{
  namespace build_env
  {
    octave_scalar_map
    features (void)
    {
      static bool initialized = false;

      static octave_scalar_map m;

      if (! initialized)
        {
EOF

$AWK \
  '/#define \(OCTAVE_\|\)HAVE_/ {
     sub (/\(OCTAVE_\|\)HAVE_/, "", $2);
     printf ("          m.assign (\"%s\", octave_value (true));\n", $2);
   }
   /\/\* #undef \(OCTAVE_\|\)HAVE_/ {
     sub (/\(OCTAVE_\|\)HAVE_/, "", $3);
     printf ("          m.assign (\"%s\", octave_value (false));\n", $3);
   } {
   }' $conffile | sort

cat << EOF

          initialized = true;
        }

      return m;
    }
  };
};
EOF