Changeset d18c643 in rtems-libbsd


Ignore:
Timestamp:
Oct 2, 2017, 7:57:04 AM (22 months ago)
Author:
Christian Mauderer <Christian.Mauderer@…>
Branches:
5283630d2c9d40deb0183696d278e02644fe4326, bc2ba9a9cdc7381c2a4f2ae6ee303be636f31368
Children:
67cbb9d
Parents:
a70edfc
git-author:
Christian Mauderer <Christian.Mauderer@…> (10/02/17 07:57:04)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/02/17 12:18:52)
Message:

Allow to set optimization level during configure.

This allows to set the optimization level for libbsd via a configure
switch. Useful for building with for example no optimization during
debug or with size optimization for space restricted targets.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • builder.py

    ra70edfc rd18c643  
    157157#
    158158def commonFlags():
    159     return ['-O2',
    160             '-g',
     159    return ['-g',
    161160            '-fno-strict-aliasing',
    162161            '-ffreestanding',
  • libbsd_waf.py

    ra70edfc rd18c643  
    3535    # C/C++ flags
    3636    common_flags = []
    37     common_flags += ["-O2"]
     37    common_flags += ["-O" + bld.env.OPTIMIZATION]
    3838    common_flags += ["-g"]
    3939    common_flags += ["-fno-strict-aliasing"]
  • waf_generator.py

    ra70edfc rd18c643  
    372372        self.add('    # C/C++ flags')
    373373        self.add('    common_flags = []')
     374        self.add('    common_flags += ["-O%s" % (bld.env.OPTIMIZATION)]')
    374375        for f in builder.commonFlags():
    375376            self.add('    common_flags += ["%s"]' % (f))
  • wscript

    ra70edfc rd18c643  
    6969                   dest = "freebsd_options",
    7070                   help = "Set FreeBSD options (developer option).")
     71    opt.add_option("--optimization",
     72                   action = "store",
     73                   default = "2",
     74                   dest = "optimization",
     75                   help = "Set optimization level to OPTIMIZATION (-On compiler flag). Default is 2 (-O2).")
    7176    libbsd_waf.options(opt)
    7277
     
    8994    conf.env.NET_CONFIG = conf.options.net_config
    9095    conf.env.FREEBSD_OPTIONS =conf.options.freebsd_options
     96    conf.env.OPTIMIZATION = conf.options.optimization
    9197    rtems.configure(conf, bsp_configure)
    9298    libbsd_waf.configure(conf)
Note: See TracChangeset for help on using the changeset viewer.