[nautilus-actions] Define --enable-as-needed configure option
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Define --enable-as-needed configure option
- Date: Wed, 22 Dec 2010 22:55:48 +0000 (UTC)
commit a14342248bbb0c428f22ff205cdf519a1bddc1ca
Author: Pierre Wieser <pwieser trychlos org>
Date: Wed Dec 22 23:55:07 2010 +0100
Define --enable-as-needed configure option
This option is disable by default, enabled at 'make distcheck' time.
ChangeLog | 5 +++++
Makefile.am | 3 +--
configure.ac | 1 +
m4/na-compiler-flags.m4 | 22 ++++++++++++++++++++++
4 files changed, 29 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b0ee709..c606f2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2010-12-22 Pierre Wieser <pwieser trychlos org>
+ * Makefile.am: Enable '-Wl,--as-needed' link option at make distcheck.
+
+ * configure.ac:
+ * m4/na-compiler-flags.m4: Define --enable-as-needed configure option.
+
* src/core/Makefile.am: Build core library against its dependancies.
Fix #637797 - -Wl,--as-needed bug.
diff --git a/Makefile.am b/Makefile.am
index ac2ebdf..5e68869 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -45,13 +45,12 @@ DISTCHECK_CONFIGURE_FLAGS = \
# do not try to install schemas when making distcheck
DISTCHECK_CONFIGURE_FLAGS += \
--enable-silent-rules \
+ --enable-as-needed \
--disable-schemas-install \
--disable-scrollkeeper \
--enable-gtk-doc \
--enable-gtk-doc-pdf \
--enable-html-manuals \
- --without-db2html \
- --with-gdt \
--enable-pdf-manuals \
$(NULL)
diff --git a/configure.ac b/configure.ac
index 8d0bb95..bfd5b88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -94,6 +94,7 @@ AC_PROG_MAKE_SET
GNOME_COMMON_INIT
GNOME_DOC_INIT
GNOME_MAINTAINER_MODE_DEFINES
+NA_LINK_AS_NEEDED
NA_GNOME_COMPILE_WARNINGS([],[-ansi -Wno-overlength-strings -Wformat=2])
AC_SUBST([AM_CFLAGS],["${AM_CFLAGS} ${WARN_CFLAGS}"])
diff --git a/m4/na-compiler-flags.m4 b/m4/na-compiler-flags.m4
index f65751b..50baec7 100644
--- a/m4/na-compiler-flags.m4
+++ b/m4/na-compiler-flags.m4
@@ -155,3 +155,25 @@ AC_DEFUN([GNOME_CXX_WARNINGS],[
WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
AC_SUBST(WARN_CXXFLAGS)
])
+
+dnl Bug #637797
+dnl see also http://www.gentoo.org/proj/en/qa/asneeded.xml
+dnl the '-Wl,--as-needed' link option is forced in make distcheck
+
+AC_DEFUN([NA_LINK_AS_NEEDED],[
+ AC_ARG_ENABLE(
+ [as-needed],
+ AC_HELP_STRING(
+ [--enable-as-needed],
+ [Enable '-Wl,--as-needed' link option @<:@no@:>@]
+ ),
+ [enable_as_needed=$enableval],
+ [enable_as_needed=no])
+
+ AC_MSG_CHECKING([whether to only link with needed libraries])
+ AC_MSG_RESULT([$enable_as_needed])
+
+ if test "x${enable_as_needed}" = "xyes"; then
+ AC_SUBST([AM_LDFLAGS],["${AM_LDFLAGS} -Wl,--as-needed"])
+ fi
+])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]