about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorLeonid Evdokimov <leon@darkk.net.ru>2014-07-22 13:41:24 +0400
committerEric Wong <normalperson@yhbt.net>2014-07-22 16:41:22 +0000
commit08d82638ff092e7c050c7b05ee5069aaa894c590 (patch)
tree67ea0231c0bc4f6d14472164b704c23e4f1d9739
parentc42a0324e4f2fa036f0fc6da785faad4b4d6714e (diff)
downloadlibnodelay-08d82638ff092e7c050c7b05ee5069aaa894c590.tar.gz
reorder cc args for proper linking with libdl
That's required on Ubuntu 14.04 with gcc 4.8.2-19ubuntu1.
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 4e44277..bc57764 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ CFLAGS = -O2 -Wall -g
 
 all: libnodelay.so
 libnodelay.so: nodelay.c
-        $(CC) $(CFLAGS) -fPIC -Wall -W -o $@ -shared -ldl $<
+        $(CC) $(CFLAGS) -fPIC -Wall -W -o $@ -shared $< -ldl
 clean:
         $(RM) $(shell cat .gitignore)
 install: libnodelay.so
@@ -14,6 +14,7 @@ install: libnodelay.so
         $(INSTALL) -m 644 $< $(DESTDIR)$(libdir)
 
 test: libnodelay.so
+        ! ldd -r $^ | grep -q undefined
         test -n "$(TEST_PORT)" || { echo TEST_PORT not set; exit 1; }
         if [ -e test-server.pid ]; then echo test-server.pid exists; exit 1; fi
         if [ -e test-client.pid ]; then echo test-client.pid exists; exit 1; fi