Browse Source

export buildflags from debian/rules; set soname for shared library

Cédric Boutillier 11 years ago
parent
commit
7ce668b3e0
2 changed files with 14 additions and 2 deletions
  1. 11 2
      debian/patches/use-ldflags.patch
  2. 3 0
      debian/rules

+ 11 - 2
debian/patches/use-ldflags.patch

@@ -9,7 +9,7 @@ Last-Update: 2013-06-13
  CFLAGS_DEBUG = $(CFLAGS) -O0 -g $(CFLAGS_DEBUG_EXTRA)
  CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA)
  CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
-+LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS)
++LDFLAGS +=-Wl,-soname,libhttp_parser.so.0
  
  test: test_g test_fast
  	./test_g
@@ -31,7 +31,16 @@ Last-Update: 2013-06-13
  
  library: libhttp_parser.o
 -	$(CC) -shared -o libhttp_parser.so libhttp_parser.o
-+	$(CC) $(LDFLAGS) -shared -o libhttp_parser.so libhttp_parser.o
++	$(CC) $(LDFLAGS) -shared -o libhttp_parser.so.0 libhttp_parser.o
  
  package: http_parser.o
  	$(AR) rcs libhttp_parser.a http_parser.o
+@@ -66,7 +67,7 @@
+ 
+ clean:
+ 	rm -f *.o *.a tags test test_fast test_g \
+-		http_parser.tar libhttp_parser.so \
++		http_parser.tar libhttp_parser.so.0 \
+ 		url_parser url_parser_g parsertrace parsertrace_g
+ 
+ contrib/url_parser.c:	http_parser.h

+ 3 - 0
debian/rules

@@ -9,6 +9,9 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
 %: