Adds a new constant for this project.

        The constant will be available for use in Jamfile
        module for this project. If 'path' is true,
        the constant will be interpreted relatively
        to the location of project.

def add_constant(self, name, value, path=0):
        """Adds a new constant for this project.

        The constant will be available for use in Jamfile
        module for this project. If 'path' is true,
        the constant will be interpreted relatively
        to the location of project.
        """
        assert isinstance(name, basestring)
        assert is_iterable_typed(value, basestring)
        assert isinstance(path, int)  # will also match bools
        if path:
            l = self.location_
            if not l:
                # Project corresponding to config files do not have
                # 'location' attribute, but do have source location.
                # It might be more reasonable to make every project have
                # a location and use some other approach to prevent buildable
                # targets in config files, but that's for later.
                l = self.get('source-location')

            value = os.path.join(l, value[0])
            # Now make the value absolute path. Constants should be in
            # platform-native form.
            value = [os.path.normpath(os.path.join(os.getcwd(), value))]

        self.constants_[name] = value
        bjam.call("set-variable", self.project_module(), name, value)