Build fix for linux (Fedora 11 on x86_64).
The malloc_test unit uses dlsym with RTLD_NEXT to find the libc's malloc
function and substitute if no replacement is linked in. However, this
define is a GNU extension, and so the source must define _GNU_SOURCE
before including dlfcn.h.
The dlsym function and friends also require linking with -ldl on Linux.
diff --git a/Makefile b/Makefile
index 40d6885..b5880cc 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
OPT_FLAGS=-O0
OPT_FLAGS=
CFLAGS=-Wall $(OPT_FLAGS) $(COVERAGE_FLAGS) -Wdeclaration-after-statement -ggdb `pkg-config --cflags lcms`
-LDFLAGS=`pkg-config --libs lcms`
+LDFLAGS=`pkg-config --libs lcms` -ldl
QCMS_SRC=iccread.c transform.c
QCMS_OBJS=iccread.o transform.o
diff --git a/malloc-fail.c b/malloc-fail.c
index a196a00..ed93b1e 100644
--- a/malloc-fail.c
+++ b/malloc-fail.c
@@ -1,3 +1,5 @@
+#define _GNU_SOURCE
+
#include <stdlib.h>
#include <assert.h>
#include <dlfcn.h>