Changeset 307b324 in rtems-libbsd for waf_generator.py


Ignore:
Timestamp:
Aug 11, 2017, 5:27:12 AM (2 years ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
c1e05b9ea378b2971e3d7704779112b4bc4296da, 4a77611a223ea883fb548679b516d326a020d447
Children:
8d2dbd3
Parents:
097ccba
git-author:
Christian Mauderer <christian.mauderer@…> (08/11/17 05:27:12)
git-committer:
Chris Johns <chrisj@…> (08/19/17 22:35:04)
Message:

waf_generator: Copy headers if necessary.

There are some cases, where a header is installed into a directory with
a different name then it's source directory. In that case, the build
might fail because the header is not found. One example would be the
<openssl/opensslv.h>. The source for this file is in
freebsd/crypto/openssl/crypto/opensslv.h.

To allow the build to work in such cases too, copy such files into a
temporary location in the build tree.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waf_generator.py

    r097ccba r307b324  
    393393        self.add('        for i in %r:' % (builder.cpuIncludes()))
    394394        self.add('            includes += ["%s" % (i[2:].replace("@CPU@", "x86"))]')
    395         for i in builder.includes():
     395        for i in builder.includes() + ['-I' + builder.buildInclude()]:
    396396            self.add('    includes += ["%s"]' % (i[2:]))
    397397        self.add('')
     
    446446
    447447        #
     448        # Add a copy rule for all headers where the install path and the source
     449        # path are not the same.
     450        #
     451        self.add('    # copy headers if necessary')
     452        self.add('    header_build_copy_paths = [')
     453        for hp in builder.headerPaths():
     454            if hp[2] != '' and not hp[0].endswith(hp[2]):
     455                self.add('                               %s,' % (str(hp)))
     456        self.add('                              ]')
     457        self.add('    for headers in header_build_copy_paths:')
     458        self.add('        target = os.path.join("%s", headers[2])' % (builder.buildInclude()))
     459        self.add('        start_dir = bld.path.find_dir(headers[0])')
     460        self.add('        for header in start_dir.ant_glob(os.path.join("**/", headers[1])):')
     461        self.add('            relsourcepath = header.path_from(start_dir)')
     462        self.add('            targetheader = os.path.join(target, relsourcepath)')
     463        self.add('            bld(features = \'subst\',')
     464        self.add('                target = targetheader,')
     465        self.add('                source = header,')
     466        self.add('                is_copy = True)')
     467        self.add('')
     468
     469        #
    448470        # Add the specific rule based builders for generating files.
    449471        #
Note: See TracChangeset for help on using the changeset viewer.