[pygobject] Refactor and clean Makefile.am files
- From: Dieter Verfaillie <dieterv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Refactor and clean Makefile.am files
- Date: Fri, 9 Sep 2011 17:32:28 +0000 (UTC)
commit 7e692ee061406e48e4862b98a0829650b1d6d585
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date: Fri Sep 9 14:57:46 2011 +0200
Refactor and clean Makefile.am files
https://bugzilla.gnome.org/show_bug.cgi?id=658652
Makefile.am | 2 -
gi/Makefile.am | 81 ++++++++++++++++++++++--------------
gi/_glib/Makefile.am | 100 +++++++++++++++++++++++++++++----------------
gi/_gobject/Makefile.am | 85 ++++++++++++++++++++------------------
gi/overrides/Makefile.am | 4 +-
gi/repository/Makefile.am | 4 +-
6 files changed, 162 insertions(+), 114 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index aa99d55..95c8b9e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -45,8 +45,6 @@ MAINTAINERCLEANFILES = \
BUILT_EXTRA_DIST = \
ChangeLog
-INCLUDES = -I$(top_srcdir)/gobject $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
-
# pkg-config files
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pygobject-$(PLATFORM_VERSION).pc
diff --git a/gi/Makefile.am b/gi/Makefile.am
index c2c81aa..4cc1d2f 100644
--- a/gi/Makefile.am
+++ b/gi/Makefile.am
@@ -1,31 +1,36 @@
-pkgincludedir = $(includedir)/pygtk-$(PLATFORM_VERSION)
-pkgpyexecdir = $(pyexecdir)
-
SUBDIRS = \
repository \
overrides \
_glib \
_gobject
-INCLUDES = -I$(top_srcdir)/gi/_gobject -I$(top_srcdir)/gi/_glib
+extension_cppflags = \
+ $(PYTHON_INCLUDES) \
+ -DPY_SSIZE_T_CLEAN
+
+extension_libadd = \
+ $(PYTHON_LIBS)
+
+extension_ldflags = \
+ -module \
+ -avoid-version
+
+if OS_WIN32
+extension_ldflags += \
+ -no-undefined \
+ -shrext ".pyd"
+endif
+
+pygidir = $(pyexecdir)/gi
-pygidir = $(pkgpyexecdir)/gi
pygi_PYTHON = \
+ __init__.py \
types.py \
module.py \
- importer.py \
- __init__.py
+ importer.py
+
+pygi_LTLIBRARIES = _gi.la
-_gi_la_CFLAGS = \
- $(PYTHON_INCLUDES) \
- $(GI_CFLAGS)
-_gi_la_LDFLAGS = \
- -module \
- -avoid-version \
- -export-symbols-regex "init_gi|PyInit__gi"
-_gi_la_LIBADD = \
- $(GI_LIBS) \
- $(top_builddir)/gi/_glib/libpyglib-gi-2 0- PYTHON_BASENAME@.la
_gi_la_SOURCES = \
pygi-repository.c \
pygi-repository.h \
@@ -66,33 +71,47 @@ _gi_la_SOURCES = \
pygi-marshal-out.h \
pygi-marshal-cleanup.c \
pygi-marshal-cleanup.h
+_gi_la_CFLAGS = \
+ $(GI_CFLAGS)
+_gi_la_CPPFLAGS = \
+ $(extension_cppflags) \
+ -I$(top_srcdir)/gi/_glib \
+ -I$(top_srcdir)/gi/_gobject
+_gi_la_LIBADD = \
+ $(extension_libadd) \
+ $(GI_LIBS) \
+ $(top_builddir)/gi/_glib/libpyglib-gi-2 0- PYTHON_BASENAME@.la
+_gi_la_LDFLAGS = \
+ $(extension_ldflags) \
+ -export-symbols-regex "init_gi|PyInit__gi"
+if ENABLE_CAIRO
+pygi_LTLIBRARIES += _gi_cairo.la
+endif
+
+_gi_cairo_la_SOURCES = \
+ pygi-foreign-cairo.c
_gi_cairo_la_CFLAGS = \
- $(PYTHON_INCLUDES) \
$(GI_CFLAGS) \
$(PYCAIRO_CFLAGS)
-_gi_cairo_la_LDFLAGS = \
- -module \
- -avoid-version \
- -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo"
+_gi_cairo_la_CPPFLAGS = \
+ $(extension_cppflags) \
+ -I$(top_srcdir)/gi/_glib \
+ -I$(top_srcdir)/gi/_gobject
_gi_cairo_la_LIBADD = \
+ $(extension_libadd) \
$(GI_LIBS) \
$(PYCAIRO_LIBS)
-_gi_cairo_la_SOURCES = pygi-foreign-cairo.c
-
-
-pygi_LTLIBRARIES = _gi.la
-
-if ENABLE_CAIRO
-pygi_LTLIBRARIES += _gi_cairo.la
-endif
+_gi_cairo_la_LDFLAGS = \
+ $(extension_ldflags) \
+ -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo"
# This is to ensure we have a symlink to the .so in the
# build directory, which the Python interpreter can load
# directly without having to know how to parse .la files.
.la.so:
- test -L $@ || $(LN_S) .libs/$@ $@
+ $(LN_S) .libs/$@ $@ || true
all-local: $(LTLIBRARIES:.la=.so)
check-local: $(LTLIBRARIES:.la=.so)
diff --git a/gi/_glib/Makefile.am b/gi/_glib/Makefile.am
index fcea61d..206740e 100644
--- a/gi/_glib/Makefile.am
+++ b/gi/_glib/Makefile.am
@@ -1,53 +1,82 @@
AUTOMAKE_OPTIONS = 1.7
-INCLUDES = $(PYTHON_INCLUDES) $(GLIB_CFLAGS) -DPY_SSIZE_T_CLEAN
-lib_LTLIBRARIES = libpyglib-gi-2 0- PYTHON_BASENAME@.la
+extension_cppflags = \
+ $(PYTHON_INCLUDES) \
+ -DPY_SSIZE_T_CLEAN
+
+extension_ldflags = \
+ -module \
+ -avoid-version
+
+if OS_WIN32
+extension_ldflags += \
+ -no-undefined \
+ -shrext ".pyd"
+endif
-pkgpyexecdir = $(pyexecdir)
-pyglibdir = $(pkgpyexecdir)/gi/_glib
-pyglib_PYTHON = \
- __init__.py \
+pyglibdir = $(pyexecdir)/gi/_glib
+
+pyglib_PYTHON = \
+ __init__.py \
option.py
-pyglib_LTLIBRARIES = _glib.la
-common_ldflags = -module -avoid-version
-if PLATFORM_WIN32
-common_ldflags += -no-undefined
-endif
+lib_LTLIBRARIES = libpyglib-gi-2 0- PYTHON_BASENAME@.la
-libpyglib_gi_2_0_ PYTHON_BASENAME@_la_CFLAGS = $(GLIB_CFLAGS)
-libpyglib_gi_2_0_ PYTHON_BASENAME@_la_LIBADD = $(GLIB_LIBS) $(FFI_LIBS)
-libpyglib_gi_2_0_ PYTHON_BASENAME@_la_SOURCES = \
- pyglib.c \
- pyglib.h \
- pyglib-private.h \
+libpyglib_gi_2_0_ PYTHON_BASENAME@_la_SOURCES = \
+ pyglib.c \
+ pyglib.h \
+ pyglib-private.h \
pyglib-python-compat.h
+libpyglib_gi_2_0_ PYTHON_BASENAME@_la_CPPFLAGS = \
+ $(extension_cppflags)
+libpyglib_gi_2_0_ PYTHON_BASENAME@_la_CFLAGS = \
+ $(GLIB_CFLAGS)
+libpyglib_gi_2_0_ PYTHON_BASENAME@_la_LIBADD = \
+ $(PYTHON_LIBS) \
+ $(FFI_LIBS) \
+ $(GLIB_LIBS)
+
+if OS_WIN32
+libpyglib_gi_2_0_ PYTHON_BASENAME@_la_LDFLAGS = \
+ -no-undefined
+endif
-_glib_la_CFLAGS = $(GLIB_CFLAGS)
-_glib_la_LDFLAGS = $(common_ldflags) -export-symbols-regex "_glib|PyInit__glib"
-_glib_la_LIBADD = $(GLIB_LIBS) $(PYTHON_LIBS) libpyglib-gi-2 0- PYTHON_BASENAME@.la
-_glib_la_SOURCES = \
- glibmodule.c \
- pygiochannel.c \
- pygiochannel.h \
- pygoptioncontext.c \
- pygoptioncontext.h \
- pygoptiongroup.c \
- pygoptiongroup.h \
- pygmaincontext.c \
- pygmaincontext.h \
- pygmainloop.c \
- pygmainloop.h \
- pygsource.c \
- pygsource.h \
- pygspawn.c \
+pyglib_LTLIBRARIES = _glib.la
+
+_glib_la_SOURCES = \
+ glibmodule.c \
+ pygiochannel.c \
+ pygiochannel.h \
+ pygoptioncontext.c \
+ pygoptioncontext.h \
+ pygoptiongroup.c \
+ pygoptiongroup.h \
+ pygmaincontext.c \
+ pygmaincontext.h \
+ pygmainloop.c \
+ pygmainloop.h \
+ pygsource.c \
+ pygsource.h \
+ pygspawn.c \
pygspawn.h
+_glib_la_CFLAGS = \
+ $(GLIB_CFLAGS)
+_glib_la_CPPFLAGS = \
+ $(extension_cppflags)
+_glib_la_LIBADD = \
+ $(PYTHON_LIBS) \
+ $(GLIB_LIBS) \
+ libpyglib-gi-2 0- PYTHON_BASENAME@.la
+_glib_la_LDFLAGS = \
+ $(extension_ldflags) \
+ -export-symbols-regex "_glib|PyInit__glib"
if PLATFORM_WIN32
_glib_la_CFLAGS += -DPLATFORM_WIN32
endif
+
all: $(pyglib_LTLIBRARIES:.la=.so)
check-local: $(pyglib_LTLIBRARIES:.la=.so)
clean-local:
@@ -55,4 +84,5 @@ clean-local:
.la.so:
$(LN_S) .libs/$@ $@ || true
+
-include $(top_srcdir)/git.mk
diff --git a/gi/_gobject/Makefile.am b/gi/_gobject/Makefile.am
index a31085f..695c851 100644
--- a/gi/_gobject/Makefile.am
+++ b/gi/_gobject/Makefile.am
@@ -4,65 +4,70 @@ PLATFORM_VERSION = 3.0
pkgincludedir = $(includedir)/pygobject-$(PLATFORM_VERSION)
pkginclude_HEADERS = pygobject.h
-pkgpyexecdir = $(pyexecdir)
+extension_cppflags = \
+ $(PYTHON_INCLUDES) \
+ -DPY_SSIZE_T_CLEAN
-# gobject python scripts
-pygobjectdir = $(pkgpyexecdir)/gi/_gobject
-pygobject_PYTHON = \
- __init__.py \
- constants.py \
- propertyhelper.py
-pygobject_LTLIBRARIES = _gobject.la
+extension_ldflags = \
+ -module \
+ -avoid-version
-common_ldflags = -module -avoid-version
-if PLATFORM_WIN32
-common_ldflags += -no-undefined
+if OS_WIN32
+extension_ldflags += \
+ -no-undefined \
+ -shrext ".pyd"
endif
+pygobjectdir = $(pyexecdir)/gi/_gobject
+
+pygobject_PYTHON = \
+ __init__.py \
+ constants.py \
+ propertyhelper.py
+
+pygobject_LTLIBRARIES = _gobject.la
+
+_gobject_la_SOURCES = \
+ gobjectmodule.c \
+ pygboxed.c \
+ pygboxed.h \
+ pygenum.c \
+ pygenum.h \
+ pygflags.c \
+ pygflags.h \
+ pyginterface.c \
+ pyginterface.h \
+ pygobject.c \
+ pygobject.h \
+ pygobject-private.h \
+ pygparamspec.c \
+ pygparamspec.h \
+ pygpointer.c \
+ pygpointer.h \
+ pygtype.c \
+ pygtype.h
_gobject_la_CFLAGS = \
+ $(extension_cppflags) \
-I$(top_srcdir)/gi/_glib \
-I$(top_srcdir)/gi \
- $(PYTHON_INCLUDES) \
$(FFI_CFLAGS) \
$(GLIB_CFLAGS) \
- $(GI_CFLAGS) \
- -DPY_SSIZE_T_CLEAN
-
-_gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex "_gobject|PyInit__gobject"
+ $(GI_CFLAGS)
+_gi_la_CPPFLAGS = \
+ $(extension_cppflags)
_gobject_la_LIBADD = \
$(GLIB_LIBS) \
$(FFI_LIBS) \
$(PYTHON_LIBS) \
$(top_builddir)/gi/_glib/libpyglib-gi-2 0- PYTHON_BASENAME@.la
-
-_gobject_la_SOURCES = \
- gobjectmodule.c \
- pygboxed.c \
- pygboxed.h \
- pygenum.c \
- pygenum.h \
- pygflags.c \
- pygflags.h \
- pyginterface.c \
- pyginterface.h \
- pygobject.c \
- pygobject.h \
- pygobject-private.h \
- pygparamspec.c \
- pygparamspec.h \
- pygpointer.c \
- pygpointer.h \
- pygtype.c \
- pygtype.h
+_gobject_la_LDFLAGS = \
+ $(extension_ldflags) \
+ -export-symbols-regex "_gobject|PyInit__gobject"
if HAVE_LIBFFI
_gobject_la_SOURCES += ffi-marshaller.c ffi-marshaller.h
endif
-if PLATFORM_WIN32
-_gobject_la_CFLAGS += -DPLATFORM_WIN32
-endif
-
all: $(pygobject_LTLIBRARIES:.la=.so)
check-local: $(pygobject_LTLIBRARIES:.la=.so)
diff --git a/gi/overrides/Makefile.am b/gi/overrides/Makefile.am
index 40c665c..2657eb3 100644
--- a/gi/overrides/Makefile.am
+++ b/gi/overrides/Makefile.am
@@ -1,7 +1,5 @@
+pygioverridesdir = $(pyexecdir)/gi/overrides
-pkgpyexecdir = $(pyexecdir)/gi
-
-pygioverridesdir = $(pkgpyexecdir)/overrides
pygioverrides_PYTHON = \
GLib.py \
Gtk.py \
diff --git a/gi/repository/Makefile.am b/gi/repository/Makefile.am
index f113d97..9326dc3 100644
--- a/gi/repository/Makefile.am
+++ b/gi/repository/Makefile.am
@@ -1,7 +1,5 @@
+pygirepositorydir = $(pyexecdir)/gi/repository
-pkgpyexecdir = $(pyexecdir)/gi
-
-pygirepositorydir = $(pkgpyexecdir)/repository
pygirepository_PYTHON = \
__init__.py
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]