# -*- python -*-

import string

from Bee.Autoconf import compile, install, clean

multicompile = 1

description = ''' PicoGUI client Library '''

license = ''' GNU LGPL '''

depends = [ 'picoguiserver' ]

runtime = [
    SharedRuntime ('library', 'PicoGUI client shared library',
                   content = ['lib/libpgui.so.0.0.0',
                              'lib/libpgui.so.0',
                              'lib/libpgui.so'],

                   depends = [ 'picoguiserver/install' ])
    ]

def prepare (module, platform, project):
    command = [
        "../configure",
        "--prefix=%s" % module.path ['prefix'],
        "--enable-bee",
        "--with-pgserver=%s" % project ['module/picoguiserver'].path ['dfl'],
        ]

    if not platform.native:
        command = command + [
            "--with-prefix=%s" % platform.toolchain,
            "--host=%s" % platform.platform
            ]
        
    command = string.join (command)
    
    message  ("running: %s" % command)
    sequence ("rm -f config.status ; test ! -f ../autogen.sh || (cd .. ; ./autogen.sh || true)",
              command)
    return

def linkinfo (module, platform, project):

    cflags = '-I%s/include' % module.path ['dfl']
    libs   = '-L%s/lib -lpgui' % module.path ['dfl']
    
    return { 'library' : { 'cflags' : cflags,
                           'libs'   : libs} }
