From 5e85f7d75c9a7902e1879d476110bfaaa7ed7f3b Mon Sep 17 00:00:00 2001 From: Denver Gingerich Date: Mon, 25 May 2009 14:54:44 -0400 Subject: [PATCH] add support for custom static libpcre When building, the Makefile now checks if ../pcre exists and uses it for the libpcre include and library files. It assumes that such a libpcre should be linked statically with libbitconvert. This option is useful on systems where a binary distributable that uses libbitconvert should contain both libbitconvert and libpcre, such as on Windows and Mac OS X. --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 93918ba..7d7c205 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,11 @@ # remove gcc-specific options in CFLAGS to use a different CC CC = gcc -CFLAGS = -ansi -pedantic -Wall -Wextra -Werror -LDFLAGS = -lpcre + +# if ../pcre exists, assume it contains a static libpcre and use it +CFLAGS = -ansi -pedantic -Wall -Wextra -Werror \ + $(shell test -d ../pcre && echo -I../pcre -DPCRE_STATIC=1) +LDFLAGS = $(shell test -d ../pcre && echo -L../pcre) -lpcre .PHONY: all clean