midori/extensions/wscript_build

57 lines
2 KiB
Text
Raw Normal View History

2008-11-18 01:07:53 +00:00
#! /usr/bin/env python
# WAF build script for midori
# This file is licensed under the terms of the expat license, see the file EXPAT.
2013-10-24 03:45:02 +00:00
import Options
import os
2008-11-18 01:07:53 +00:00
extensions = os.listdir ('extensions')
for extension in extensions:
folder = 'extensions' + os.sep + extension
if os.path.isdir (folder):
2008-11-18 01:07:53 +00:00
files = os.listdir (folder)
target = extension
source = ''
for fila in files:
2013-10-24 03:45:02 +00:00
if fila[-2:] == '.c' or fila[-5:] == '.vala':
source += ' ' + extension + os.sep + fila
if not source:
Utils.pprint ('RED', folder + ': No source files found')
continue
else:
if extension[-2:] == '.c':
target = extension[:-2]
2013-10-24 03:45:02 +00:00
elif extension[-5:] == '.vala':
target = extension[:-5]
else:
2008-11-18 01:07:53 +00:00
continue
source = extension
2013-10-24 03:45:02 +00:00
# FIXME
if bld.env['HAVE_WEBKIT2'] and target in ['external-download-manager', 'nsplugin-manager', 'formhistory', 'adblock', 'cookie-permissions', 'addons', 'cookie-manager']:
continue
obj = bld.new_task_gen ('cc', 'shlib')
2008-11-18 01:07:53 +00:00
obj.target = target
2013-10-24 03:45:02 +00:00
obj.includes = '.. ../katze ../midori'
2008-11-18 01:07:53 +00:00
obj.source = source
2013-10-24 03:45:02 +00:00
obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML GRANITE'
if 'vala' in source:
obj.env.append_value ('CCFLAGS', '-w')
obj.vapi_dirs = '../midori ../katze'
obj.packages = 'glib-2.0 gio-2.0 libsoup-2.4 sqlite3 midori midori-core katze'
if bld.env['HAVE_GTK3']:
obj.packages += ' gtk+-3.0'
else:
obj.packages += ' gtk+-2.0'
if bld.env['HAVE_WEBKIT2']:
obj.packages += ' webkit2gtk-3.0'
else:
obj.packages += ' webkitgtk-3.0'
if bld.env['HAVE_GRANITE']:
obj.packages += ' granite'
obj.install_path = '${LIBDIR}/midori'
2013-10-24 03:45:02 +00:00
# See LINKFLAGS in wscript: w/ o it we get several "undefined reference" errors
if bld.env['platform'] == 'win32':
obj.uselib_local = 'midori'