packagekit/libpackagekit/wscript_build
2007-12-01 14:02:23 +00:00

88 lines
2.4 KiB
Python

#! /usr/bin/env python
# encoding: utf-8
#
# Copyright (C) 2007 Richard Hughes <richard@hughsie.com>
#
# Licensed under the GNU General Public License Version 2
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
import Common
obj = bld.create_obj('gnome', 'objects')
obj.includes = '. ../libgbus ../libselftest'
obj.target = 'libpkgkit_common_source'
obj.uselib = 'GLIB GOBJECT DBUS DBUS_GLIB'
obj.env.append_value('CCFLAGS', obj.env['shlib_CCFLAGS'])
obj.source = """
pk-debug.c
pk-connection.c
pk-package-id.c
pk-package-list.c
pk-enum-list.c
pk-enum.c
pk-common.c
pk-client.c
pk-task-list.c
pk-job-list.c
pk-polkit-client.c
"""
env = bld.env()
if env['HAVE_NETWORKMANAGER']:
obj.uselib += ' NM_GLIB'
obj.source += ' pk-network-nm.c'
else:
obj.source += ' pk-network-dummy.c'
obj.add_objects = 'libgbus libselftest'
obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--header')
obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--body')
#Marshall file
obj = bld.create_obj('gnome', 'shlib')
obj.uselib = 'GLIB GOBJECT DBUS DBUS_GLIB'
obj.add_objects = 'libpkgkit_common_source'
# libtool versioning - CURRENT.REVISION.AGE
# increment:
# CURRENT If the API or ABI interface has changed (reset REVISION to 0)
# REVISION If the API and ABI remains the same, but bugs are fixed.
# AGE If libpackagekit can be linked into executables which can be
# built with previous versions of this library. Don't use.
obj.vnum = '3.0.0'
obj.includes = '. ../libgbus ../libselftest'
obj.target = 'packagekit'
obj.name = 'libpackagekit'
# install headers to /usr/include/packagekit/
Common.install_files('PREFIX', os.path.join('include', 'packagekit'), """
pk-debug.h
pk-connection.h
pk-network.h
pk-package-id.h
pk-package-list.h
pk-enum-list.h
pk-enum.h
pk-common.h
pk-client.h
pk-task-list.h
pk-job-list.h
pk-polkit-client.h
""")
#TODO: do not install this file!!!
if env['HAVE_TESTS']:
obj = bld.create_obj('cc', 'program')
obj.source = 'pk-self-test.c'
obj.add_objects = 'libpkgkit_common_source'
obj.uselib = 'GLIB GOBJECT DBUS_GLIB POLKIT_DBUS GTHREAD'
obj.target = 'test-libpackagekit'
obj.includes = '. ../libselftest ../libgbus'
if env['HAVE_NETWORKMANAGER']:
obj.uselib += ' NM_GLIB'