Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pkg-config to detect system-provided PCRE library #41

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions build/make/Makefile.GNU
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ ifeq ($(shell pkg-config --exists libcurl && echo 1),1)
CURL_LIBS = `pkg-config libcurl --libs`
endif

# libpcre support
ifeq ($(shell pkg-config --exists libpcre && echo 1),1)
PCRE_CFLAGS = `pkg-config libpcre --cflags`
PCRE_LIBS = `pkg-config libpcre --libs`
endif

USE_ASM=-Did386
ifeq ($(WITH_OPTIMIZED_CFLAGS),YES)
ifeq ($(ARCH),x86)
Expand Down Expand Up @@ -67,6 +73,13 @@ ifdef CURL_CFLAGS
LDFLAGS += $(CURL_LIBS)
endif

ifdef PCRE_CFLAGS
CFLAGS += $(PCRE_CFLAGS)
LDFLAGS += $(PCRE_LIBS)
else
CFLAGS += -I$(SV_DIR)/pcre
endif

ifeq ($(CC_BASEVERSION),4) # if gcc4 then build universal binary
ifeq ($(UNAME),Darwin)
CFLAGS+= -arch ppc -arch i386
Expand Down Expand Up @@ -126,15 +139,18 @@ SV_OBJS += \
$(SV_DIR)/sha1.o \
$(SV_DIR)/build.o \
$(SV_DIR)/world.o \
$(SV_DIR)/zone.o \
\
$(SV_DIR)/pcre/get.o \
$(SV_DIR)/pcre/pcre.o \
$(SV_DIR)/zone.o

ifdef CURL_CFLAGS
SV_WEB_INTEGRATION = $(SV_DIR)/central.o
endif

ifndef PCRE_CFLAGS
SV_OBJS += \
$(SV_DIR)/pcre/get.o \
$(SV_DIR)/pcre/pcre.o
endif

ifeq ($(USE_ASM),$(ASM))
SV_ASM_OBJS = \
$(SV_DIR)/bothtoolsa.o \
Expand Down Expand Up @@ -172,4 +188,4 @@ mvdsv : $(SV_WEB_INTEGRATION) $(SV_OBJS) $(SV_ASM_OBJS)

clean :
$(E) [CLEAN]
$(Q)-rm -f $(SV_DIR)/core $(SV_DIR)/*.o $(SV_DIR)/pcre/*.o mvdsv
$(Q)-rm -f $(SV_DIR)/core $(SV_OBJS) mvdsv
2 changes: 1 addition & 1 deletion src/qwsvdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#include "version.h"

#include "pcre/pcre.h"
#include <pcre.h>

//=============================================================================

Expand Down
2 changes: 1 addition & 1 deletion src/sv_demo_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#include "qwsvdef.h"
#ifndef SERVERONLY
#include "pcre.h"
#include <pcre.h>
#endif

static char chartbl[256];
Expand Down
2 changes: 1 addition & 1 deletion src/sv_mod_frags.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#include "qwsvdef.h"
#ifndef SERVERONLY
#include "pcre.h"
#include <pcre.h>
#endif
#include "sv_mod_frags.h"

Expand Down