gcin (1.4.6-3) ld_only_link_needed.diff

Summary

 configure       |    4 ++--
 qt-im/Makefile  |    2 +-
 qt4-im/Makefile |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

    
download this patch

Patch contents

Add -Wl,--as-needed
---
 configure      |    5 +++--
 qt-im/Makefile |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

--- a/configure
+++ b/configure
@@ -213,7 +213,7 @@
 
 OPTFLAGS="-g"
 if [ $prefix = /usr ]; then
-  OPTFLAGS="-O"
+  OPTFLAGS="-g -O2"
 fi
 
 if [ -z $CC ]; then
@@ -236,7 +236,7 @@
 echo "libdir=\$(DESTDIR)$libdir" >> config.mak
 echo "gcinlibdir=\$(libdir)/gcin" >> config.mak
 echo "includedir=\$(DESTDIR)$includedir" >> config.mak
-echo "LDFLAGS=$GTKLDFLAGS -lX11" >> config.mak
+echo "LDFLAGS=-Wl,--as-needed $GTKLDFLAGS -lX11" >> config.mak
 echo "GCIN_VERSION=$GCIN_VERSION" >> config.mak
 echo "GCIN_TABLE_DIR=\$(datadir_r)/gcin/table" >> config.mak
 echo "GCIN_OGG_DIR=\$(datadir_r)/gcin/ogg" >> config.mak
--- a/qt-im/Makefile
+++ b/qt-im/Makefile
@@ -6,7 +6,7 @@
 CXXFLAGS=$(OPTFLAGS) $(INCS) -Wall -D_REENTRANT -fPIC  -DQT_THREAD_SUPPORT -DQT_PLUGIN -DQT_SHARED -DQT_NO_DEBUG
 OBJS=qgcininputcontextplugin.o qgcininputcontextplugin_my.o qgcininputcontext.o qgcininputcontext_x11.o
 .SUFFIXES:	.c .cpp .a .so .E .h
-LDFLAGS=-L../im-client -lgcin-im-client -Wl,-rpath,$(gcinlibdir)
+LDFLAGS=-Wl,--as-needed -L../im-client -lgcin-im-client -Wl,-rpath,$(gcinlibdir)
 all:	libqgcin.so
 
 .cpp.E:
--- a/qt4-im/Makefile
+++ b/qt4-im/Makefile
@@ -8,7 +8,7 @@
 -DQT_IMMODULE -DPIC
 OBJS= moc_gcin-qt.o gcin-qt.o im-gcin-qt.o gcin-imcontext-qt.o
 .SUFFIXES:	.c .cpp .a .so .E .h
-LDFLAGS=-L../im-client -lgcin-im-client -Wl,-rpath,$(gcinlibdir)
+LDFLAGS=-Wl,--as-needed -L../im-client -lgcin-im-client -Wl,-rpath,$(gcinlibdir)
 all:    im-gcin.so
 
 .cpp.E: