diff -Nru grok-1.20110708.1/debian/patches/ld-as-needed.diff 
grok-1.20110708.1/debian/patches/ld-as-needed.diff
--- grok-1.20110708.1/debian/patches/ld-as-needed.diff  1970-01-01 
01:00:00.000000000 +0100
+++ grok-1.20110708.1/debian/patches/ld-as-needed.diff  2015-01-26 
11:34:34.000000000 +0100
@@ -0,0 +1,59 @@
+Description: Fix linking with ld --as-needed by moving the libraries from 
LDFLAGS to LIBS.
+Bug-Debian: http://bugs.debian.org/776287
+Author: Michael Bienia <ge...@ubuntu.com>,
+        Logan Rosen <lo...@ubuntu.com>
+Last-Update: 2015-01-26
+
+--- a/Makefile
++++ b/Makefile
+@@ -28,17 +28,17 @@
+ # For linux, we need libdl for dlopen()
+ # On FreeBSD, comment this line out.
+ ifeq ($(PLATFORM), GNULinux)
+-LDFLAGS+=-ldl
++LIBS+=-ldl
+ endif
+ 
+ # For GNU/kFreeBSD, we also need libdl
+ ifeq ($(PLATFORM), GNUkFreeBSD)
+-LDFLAGS+=-ldl
++LIBS+=-ldl
+ endif
+ 
+ # For GNU/Hurd, we need libdl for dlopen()
+ ifeq ($(PLATFORM), GNU)
+-LDFLAGS+=-ldl
++LIBS+=-ldl
+ endif
+ 
+ # #############################################
+@@ -52,7 +52,7 @@
+ #LDFLAGS+=-g
+ 
+ CFLAGS+=-pipe -fPIC -I. -O2
+-LDFLAGS+=-lpcre -levent -rdynamic -ltokyocabinet
++LIBS+=-lpcre -levent -rdynamic -ltokyocabinet
+ 
+ LIBSUFFIX=$(shell sh $(BASE)/platform.sh libsuffix)
+ VERLIBSUFFIX=$(shell sh $(BASE)/platform.sh libsuffix $(MAJOR))
+@@ -170,16 +170,16 @@
+       #$(MAKE) -C test test
+ 
+ # Binary creation
+-grok: LDFLAGS+=-levent
++grok: LIBS+=-levent
+ grok: $(GROKOBJ) conf.tab.o conf.yy.o main.o grok_config.o
+-      $(CC) $(LDFLAGS) $^ -o $@
++      $(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
+ 
+ discogrok: $(GROKOBJ) discover_main.o
+-      $(CC) $(LDFLAGS) $^ -o $@
++      $(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
+ 
+ libgrok.$(LIBSUFFIX): 
+ libgrok.$(LIBSUFFIX): $(GROKOBJ) 
+-      $(CC) $(LDFLAGS) -fPIC $(DYNLIBFLAG) $(LIBNAMEFLAG) $^ -o $@
++      $(CC) $(LDFLAGS) -fPIC $(DYNLIBFLAG) $(LIBNAMEFLAG) $^ -o $@ $(LIBS)
+ 
+ libgrok.$(VERLIBSUFFIX): libgrok.$(LIBSUFFIX);
+       ln -s $< $@
diff -Nru grok-1.20110708.1/debian/patches/series 
grok-1.20110708.1/debian/patches/series
--- grok-1.20110708.1/debian/patches/series     2015-01-16 23:04:43.000000000 
+0100
+++ grok-1.20110708.1/debian/patches/series     2015-01-26 10:57:27.000000000 
+0100
@@ -2,3 +2,4 @@
 0001-Support-GNU-kFreeBSD-add-necessary-linker-flag.patch
 0002-Support-GNU-Hurd-add-necessary-linker-flag.patch
 pcre-group-name.patch
+ld-as-needed.diff

Reply via email to