From 75bf8f0a205d734659d155381f645488d4a778d4 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Wed, 26 Sep 2012 15:46:23 +0000 Subject: [PATCH] Allow passing compiler flags (CFLAGS, LDFLAGS) (closes issue PRI-144) Reported by: Tzafrir Cohen Patches: flags.diff (license #5035) patch uploaded by Tzafrir Cohen git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@2300 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3b91a94..4f5316c 100644 --- a/Makefile +++ b/Makefile @@ -66,18 +66,20 @@ STATIC_OBJS= \ version.o DYNAMIC_OBJS= \ $(STATIC_OBJS) -CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_OPT) $(COVERAGE_CFLAGS) +CFLAGS ?= -g +CFLAGS += -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes +CFLAGS += -fPIC $(ALERTING) $(LIBPRI_OPT) $(COVERAGE_CFLAGS) INSTALL_PREFIX=$(DESTDIR) INSTALL_BASE=/usr libdir?=$(INSTALL_BASE)/lib ifneq ($(findstring Darwin,$(OSARCH)),) - SOFLAGS=-dynamic -bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace + SOFLAGS=$(LDFLAGS) -dynamic -bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace ifeq ($(shell /usr/bin/sw_vers -productVersion | cut -c1-4),10.6) SOFLAGS+=/usr/lib/bundle1.o endif LDCONFIG=/usr/bin/true else - SOFLAGS=-shared -Wl,-h$(DYNAMIC_LIBRARY) $(COVERAGE_LDFLAGS) + SOFLAGS=$(LDFLAGS) -shared -Wl,-h$(DYNAMIC_LIBRARY) $(COVERAGE_LDFLAGS) LDCONFIG = /sbin/ldconfig endif ifneq (,$(findstring X$(OSARCH)X, XLinuxX XGNU/kFreeBSDX XGNUX))