summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-02-27 10:42:27 +0000
committerChris Wilson <cpwilson@src.gnome.org>2007-02-27 10:42:27 +0000
commit226bb59731c29dd2e08c20f54d64db9e97d3549b (patch)
treed281064749332adb441b03b4d327d59241ef70f0
parent854cc5c5038cdabf73e8898a5c0b25364b01a03a (diff)
downloadvte-226bb59731c29dd2e08c20f54d64db9e97d3549b.tar.gz
Bug 410986 – Fails to build with -z defs
2007-02-27 Chris Wilson <chris@chris-wilson.co.uk> Bug 410986 – Fails to build with -z defs If you link the vtemodule.so to libpython, then programs importing vte will have the symbols twice in memory: one set from python and the other from libpython. * configure.in: * python/Makefile.am: Remove PYTHON_LIBS from linking vtemodule.so. Convert unresolved symbol errors into warnings so that building with -Wl,-z,defs continues to work. This is a *hack* as it hides real errors if you are updating vte.{def,override}. svn path=/trunk/; revision=1767
-rw-r--r--ChangeLog17
-rw-r--r--configure.in23
-rw-r--r--python/Makefile.am6
3 files changed, 45 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c54018a8..5076af6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
2007-02-27 Chris Wilson <chris@chris-wilson.co.uk>
+ Bug 410986 – Fails to build with -z defs
+
+ If you link the vtemodule.so to libpython, then programs importing
+ vte will have the symbols twice in memory: one set from python and
+ the other from libpython.
+
+ * configure.in:
+ * python/Makefile.am:
+ Remove PYTHON_LIBS from linking vtemodule.so.
+ Convert unresolved symbol errors into warnings so that
+ building with -Wl,-z,defs continues to work. This is a
+ *hack* as it hides real errors if you are updating
+ vte.{def,override}.
+
+
+2007-02-27 Chris Wilson <chris@chris-wilson.co.uk>
+
* src/vtexft.c (_vte_xft_open_font_for_char),
(_vte_xft_font_for_char), (_vte_xft_compute_char_width),
(_vte_xft_char_width), (_vte_xft_start), (_vte_xft_get_char_width),
diff --git a/configure.in b/configure.in
index e9c428dd..647d627a 100644
--- a/configure.in
+++ b/configure.in
@@ -87,6 +87,23 @@ AC_DEFUN([VTE_CC_TRY_FLAG], [
fi
AC_MSG_RESULT([$vte_cc_flag])
])
+AC_DEFUN([VTE_LD_TRY_FLAG], [
+ AC_MSG_CHECKING([whether $CC supports $1 when linking])
+
+ vte_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $1"
+
+ AC_LINK_IFELSE([int main(void) {return 0;}],
+ [vte_ld_flag=yes], [vte_ld_flag=no])
+ LDFLAGS="$vte_save_LDFLAGS"
+
+ if test "x$vte_ld_flag" = "xyes"; then
+ ifelse([$2], , :, [$2])
+ else
+ ifelse([$3], , :, [$3])
+ fi
+ AC_MSG_RESULT([$vte_ld_flag])
+])
dnl Note: if you change the following variable, the cache is automatically
@@ -139,6 +156,12 @@ WARN_CFLAGS=$vte_cv_warn_cflags
AC_SUBST(WARN_CFLAGS)
CFLAGS="$CFLAGS $WARN_CFLAGS"
+PYTHON_LDFLAGS=""
+for W in "-Wl,--warn-unresolved-symbols"; do
+ VTE_LD_TRY_FLAG([$W], [PYTHON_LDFLAGS="$PYTHON_LDFLAGS $W"])
+done
+AC_SUBST(PYTHON_LDFLAGS)
+
# Enable debugging messages and additional run-time checks.
AC_ARG_ENABLE(debugging,
[AS_HELP_STRING([--enable-debugging],
diff --git a/python/Makefile.am b/python/Makefile.am
index edad74e1..c223d9c9 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -8,9 +8,13 @@ pythonsiteexec_LTLIBRARIES = $(PYTHON_MODULES)
CLEANFILES = vte.c
+# we do this to suport building with -Wl,-z,defs which errors on
+# vtemodule.so as we cannot include $(PYTHON_LIBS) due to bug 410986.
+LDFLAGS += $(PYTHON_LDFLAGS)
+
vtemodule_la_CFLAGS = $(VTE_CFLAGS) $(X_CFLAGS) $(PYTHON_INCLUDES) $(PYGTK_CFLAGS)
vtemodule_la_SOURCES = vtemodule.c
-vtemodule_la_LIBADD = $(top_builddir)/src/libvte.la $(LIBS) $(PYGTK_LIBS) $(PYTHON_LIBS) $(VTE_LIBS) $(X_LIBS)
+vtemodule_la_LIBADD = $(top_builddir)/src/libvte.la $(LIBS) $(PYGTK_LIBS) $(VTE_LIBS) $(X_LIBS)
vtemodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex initvte
nodist_vtemodule_la_SOURCES = vte.c