Commit 5f82e7d2 authored by Tomeu Vizoso's avatar Tomeu Vizoso

Allow building pygobject without introspection support by providing

--disable-introspection to configure.
parent cc3ea773
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = 1.7
SUBDIRS = docs codegen glib gobject gio gi examples tests
SUBDIRS = docs codegen glib gobject gio examples tests
if ENABLE_INTROSPECTION
SUBDIRS += gi
endif
PLATFORM_VERSION = 2.0
......
......@@ -177,7 +177,6 @@ if test x"$have_libffi" = xyes; then
AC_DEFINE(HAVE_FFI_H,1,[Have libffi include files])
LIBFFI_PC=libffi
fi
AC_MSG_RESULT([$have_libffi])
AM_CONDITIONAL(HAVE_LIBFFI, test "$have_libffi" = "yes")
AC_SUBST(FFI_CFLAGS)
AC_SUBST(FFI_LIBS)
......@@ -203,12 +202,12 @@ if test -n "$export_dynamic"; then
GIOUNIX_LIBS=`echo $GIOUNIX_LIBS | sed -e "s/$export_dynamic//"`
fi
AC_ARG_ENABLE(pygi,
AC_HELP_STRING([--enable-pygi], [Use PyGI to create wrappers for introspection-enabled types]),
enable_pygi=$enableval,
enable_pygi=no)
if test "$enable_pygi" != no; then
AC_DEFINE(ENABLE_PYGI,1,Use PyGI to create wrappers for introspection-enabled types)
AC_ARG_ENABLE(introspection,
AC_HELP_STRING([--enable-introspection], [Use introspection information]),
enable_introspection=$enableval,
enable_introspection=yes)
if test "$enable_introspection" != no; then
AC_DEFINE(ENABLE_INTROSPECTION,1,Use introspection information)
PKG_CHECK_MODULES(GI,
glib-2.0 >= 2.22.4
gobject-introspection-1.0 >= 0.6.14
......@@ -216,6 +215,7 @@ if test "$enable_pygi" != no; then
pycairo >= 1.0.2
)
fi
AM_CONDITIONAL(ENABLE_INTROSPECTION, test "$enable_introspection" = "yes")
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
......@@ -260,4 +260,5 @@ AC_OUTPUT
echo
echo "libffi support: $have_libffi"
echo "introspection support: $enable_introspection"
echo
......@@ -17,7 +17,7 @@ static struct PyGI_API *PyGI_API = NULL;
static int
_pygi_import (void)
{
#if ENABLE_PYGI
#if ENABLE_INTROSPECTION
PyObject *module;
PyObject *api;
......@@ -52,7 +52,7 @@ _pygi_import (void)
return 0;
#else
return -1;
#endif /* ENABLE_PYGI */
#endif /* ENABLE_INTROSPECTION */
}
static inline PyObject *
......
......@@ -33,10 +33,14 @@ tests = \
test_signal.py \
test_subprocess.py \
test_unknown.py \
test_source.py \
test_source.py
if ENABLE_INTROSPECTION
tests += \
test_everything.py \
test_gi.py \
test_overrides.py
endif
# This is a hack to make sure a shared library is built
testhelper.la: $(testhelper_la_OBJECTS) $(testhelper_la_DEPENDENCIES)
......@@ -48,7 +52,7 @@ check-local: $(top_srcdir)/glib/__init__.py $(top_srcdir)/gobject/__init__.py $(
cp $(top_srcdir)/gobject/*.py $(top_builddir)/gobject; \
cp $(top_srcdir)/gio/*.py $(top_builddir)/gio; \
fi
$(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py $(top_builddir) $(top_srcdir)
$(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py $(top_builddir) $(top_srcdir) $(tests)
@if test "$(top_builddir)" != "$(top_srcdir)"; then \
rm -f $(top_builddir)/glib/*.py; \
rm -f $(top_builddir)/gobject/*.py; \
......
......@@ -7,29 +7,22 @@ import unittest
import common
program = None
if len(sys.argv) == 3:
buildDir = sys.argv[1]
srcDir = sys.argv[2]
else:
if len(sys.argv) == 2:
program = sys.argv[1]
if program.endswith('.py'):
program = program[:-3]
buildDir = '..'
srcDir = '.'
if len(sys.argv) < 3:
raise ValueError('Need at least 3 parameters: runtests.py <build-dir> '
'<src-dir> <test-module-1> <test-module-2> ...')
buildDir = sys.argv[1]
srcDir = sys.argv[2]
files = sys.argv[3:]
common.importModules(buildDir=buildDir,
srcDir=srcDir)
SKIP_FILES = ['common', 'runtests']
dir = os.path.split(os.path.abspath(__file__))[0]
os.chdir(dir)
def gettestnames():
files = glob.glob('*.py')
names = map(lambda x: x[:-3], files)
map(names.remove, SKIP_FILES)
return names
suite = unittest.TestSuite()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment