ports/157918: Fix sysutils/tmux build when CFLAGS is set in /etc/make.conf
Grzegorz Blach
magik at roorback.net
Thu Jun 16 06:30:10 UTC 2011
>Number: 157918
>Category: ports
>Synopsis: Fix sysutils/tmux build when CFLAGS is set in /etc/make.conf
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Thu Jun 16 06:30:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Grzegorz Blach
>Release: 8.2 i386
>Organization:
>Environment:
FreeBSD komtech.roorback.net 8.2-RELEASE-p2 FreeBSD 8.2-RELEASE-p2 #0 r222496: Mon May 30 15:25:42 CEST 2011 magik at komtech.roorback.net:/usr/obj/usr/src/sys/KOMTECH i386
>Description:
Attached patch introduce new Makefile variable EXTRA-CPPFLAGS which don't override CFLAGS and CPPFLAGS variables from /etc/make.conf
>How-To-Repeat:
- In /etc/make.conf set CFLAGS=-O2 or any usefull value.
- cd /usr/ports/sysutils/tmux
- make
>Fix:
Apply attached patch
Patch attached with submission follows:
--- Makefile.orig 2011-05-26 09:57:23.000000000 +0000
+++ Makefile 2011-05-26 09:56:55.000000000 +0000
@@ -35,14 +35,14 @@
.include <bsd.port.pre.mk>
.if defined(WITH_LIBEVENT2)
-CFLAGS+= -I${LOCALBASE}/include/event2/compat -I${LOCALBASE}/include
+EXTRA_CPPFLAGS+= -I${LOCALBASE}/include/event2/compat -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib/event2
.else
-CFLAGS+= -I${LOCALBASE}/include
+EXTRA_CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
.endif
-MAKE_ENV+= LDFLAGS="${LDFLAGS}"
+MAKE_ENV+= EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}" LDFLAGS="${LDFLAGS}"
.if defined(WITH_LIBEVENT_STATIC)
. if defined(WITH_LIBEVENT2)
@@ -81,6 +81,7 @@
${WRKSRC}/tmux.1 ${WRKSRC}/tmux.h
@${REINPLACE_CMD} -e 's|-I/usr/local/include||g' \
-e 's|/usr/local|${LOCALBASE}|g' \
+ -e 's|$${CPPFLAGS}$$|${CPPFLAGS} ${EXTRA_CPPFLAGS}|g' \
-e 's|LDFLAGS+=|#LDFLAGS+=|g' \
${WRKSRC}/Makefile
@${REINPLACE_CMD} -e 's|-levent|${_LEVENT_LIB}|g' \
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list