Re: build systems



On Nov 12, 2007 2:15 AM, Nicolas Trangez <eikke eikke com> wrote:
> Anyway, some thoughts:
> - Waf also needs *major* documentation work, on the user side (ie not
> internals, as I hope I shouldn't ever see them...). I've been reading
> quite a lot of the waf source code to be able to get everything working.
> - Being able to use Python in your configure script natively is A Good
> Thing (except if you hate Python, obviously). It allows to do real
> programming in your configure stage, which is also possible in autoconf
> but sometimes somewhat more challenging.

Indeed it does. There is the demos directory in the svn repository,
but some actual documentation would be nice.

> - Several autoconf macro's have no waf equivalent, which forces you to
> write several lines of code. An examples:
> AC_C_CONST becomes
>
>     const_code = '''
>     int main() { const char a = 'a'; return 0; }
>     '''
>     const = conf.try_build(const_code)
>     conf.check_message('C keyword', 'const', not (const is False))
>     if not const:
>         fatal('C compiler doesn\'t support \'const\' keyword')
>
> AC_CHECK_HEADERS:
>
>     headers = []
>     for header in ['fcntl.h', 'stdlib.h', 'string.h', 'unistd.h',
> 'sys/mman.h']:
>         if not conf.check_header(header):
>             fatal('Header file %s is necessary to build %s' % (header,
> CLUTTER_NAME))
>         else:
>             headers.append(header)
> AC_FUNC_* and AC_CHECK_FUNCS:
>
>     for function in ['malloc', 'mmap', 'memset', 'munmap', 'strcasecmp',
> 'strdup']:
>         e = conf.create_function_enumerator()
>         e.mandatory = True
>         e.headers = headers
>         e.function = function
>         e.define = "HAVE_%s" % function.upper()
>         e.run()

Aren't the above examples of checks superflous? Files that everybody
without a broken system have? Or is it used to support some special
platform? What platforms do they provide support for, and do the
program work on that platform? or is it just sanity check in a
commonly sane world? Why the const check? Is it to help supporting
some other compiler? Is the code to be compiled portable to other
compilers than gcc, lets say MSVC, and free from strange GNU macros?
And maybe I'm talking out of my ass.

> - I had to add all source files in one big string in the main
> wscript_build file, unable to add them per-directory and in the end link
> in la's from subdirectories. It is possible waf does support this, I
> just did not find how to do this.

Subdirectories can (and usually) have wscript files, and not wscript_build.
In your build(bld) method you add a call to
bld.add_subdirs(listofsubdirs) and for config you use
[conf.sub_config(s) for s in subdirs] (should probably be fixed to
look identical).

> - Waf does not detect when you changed your some of your wscript or
> wscript_build files, at least in my testing.

http://code.google.com/p/waf/wiki/AutoReconfiguration

> - Built-in .so versioning would be nice

obj = bld.create_obj('cc', 'shlib')
....
obj.vnum = '2.0.0'  <-- like this

> I did not implement file generation yet (glib-genmarshal stuff), and
> obviously non-glx backend support is a must too.

You can check PackageKit for examples on glib-genmarshal.

-- 
Daniel Svensson, <dsvensson gmail com>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]