From owner-freebsd-python@FreeBSD.ORG Fri Aug 13 15:00:18 2010 Return-Path: Delivered-To: freebsd-python@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AB6110656A3 for ; Fri, 13 Aug 2010 15:00:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2F3128FC20 for ; Fri, 13 Aug 2010 15:00:18 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o7DF0In8092534 for ; Fri, 13 Aug 2010 15:00:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7DF0IPP092533; Fri, 13 Aug 2010 15:00:18 GMT (envelope-from gnats) Date: Fri, 13 Aug 2010 15:00:18 GMT Message-Id: <201008131500.o7DF0IPP092533@freefall.freebsd.org> To: freebsd-python@FreeBSD.org From: Anonymous Cc: Subject: Re: ports/136917: [patch] lang/python26: gettext detection X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Anonymous List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Aug 2010 15:00:18 -0000 The following reply was made to PR ports/136917; it has been noted by GNATS. From: Anonymous To: bf1783@gmail.com Cc: bug-followup@FreeBSD.org Subject: Re: ports/136917: [patch] lang/python26: gettext detection Date: Fri, 13 Aug 2010 18:57:27 +0400 "b. f." writes: >> +.if defined(CPPFLAGS) >> +CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" >> +.endif >> +.if defined(LDFLAGS) >> +CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}" >> +.endif > > You need to perform these tests after all additions to CPPFLAGS and > LDFLAGS via OPTIONS, or add both of them unconditionally to the > CONFIGURE_ENV= ... line before the inclusion of bsd.port.pre.mk. The > latter is the usual approach. The way you have it now, if there > aren't user-defined CPPFLAGS or some other intervention, CPPFLAGS > won't be added to CONFIGURE_ENV, even if WITH_THREADS and > WITH_PTH=true, because CPPFLAGS won't have been defined when the test > is performed. Anyway, LDFLAGS is almost always defined, though it may > be empty, via /usr/share/mk/sys.mk. Yep, I've confused how variable expansion and flow control works in make(1). Adding CPPFLAGS/LDFLAGS to CONFIGURE_ENV looks simplier. The diff is regened. > And note that, although I don't think it matters for this port, > prepending a value to these flags (as in the current port Makefile) > may not have the same effect as appending a value with += (as in your > patched version) because, in general, search order matters. This can be addressed by properly ordering `+=', e.g. CPPFLAGS += -Dfoo=one CPPFLAGS += -Dfoo=two Prepending a value is usually more confusing, but can be done by `:='. --- a.diff begins here --- Index: lang/python26/Makefile =================================================================== RCS file: /a/.cvsup/ports/lang/python26/Makefile,v retrieving revision 1.167 diff -u -p -r1.167 Makefile --- lang/python26/Makefile 19 Jul 2010 21:59:27 -0000 1.167 +++ lang/python26/Makefile 13 Aug 2010 14:13:32 -0000 @@ -20,7 +20,8 @@ WRKSRC= ${PYTHON_WRKSRC}/portbld.static PATCH_WRKSRC= ${PYTHON_WRKSRC} GNU_CONFIGURE= yes CONFIGURE_SCRIPT= ../configure # must be relative -CONFIGURE_ENV= OPT="${CFLAGS}" SVNVERSION="echo freebsd" +CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" \ + OPT="${CFLAGS}" SVNVERSION="echo freebsd" MAKE_ENV= VPATH="${PYTHON_WRKSRC}" USE_LDCONFIG= yes MAKE_JOBS_SAFE= yes @@ -56,7 +57,8 @@ OPTIONS= THREADS "Enable thread support" UCS4 "Use UCS4 for unicode support" on \ PYMALLOC "Use python's internal malloc" on \ IPV6 "Enable IPv6 support" on \ - FPECTL "Enable floating point exception handling" off + FPECTL "Enable floating point exception handling" off \ + GETTEXT "Enable gettext support in locale module" off .include @@ -88,14 +90,12 @@ CFLAGS+= -D__wchar_t=wchar_t CONFIGURE_ARGS+= --with-pth EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-configure-pth LIB_DEPENDS+= pth:${PORTSDIR}/devel/pth -_PTH_CPPFLAGS= "-I${LOCALBASE}/include/pth" -_PTH_LDFLAGS= "-L${LOCALBASE}/lib/pth" -CONFIGURE_ENV+= CPPFLAGS="${_PTH_CPPFLAGS} ${CPPFLAGS}" -CONFIGURE_ENV+= LDFLAGS="${_PTH_LDFLAGS} ${LDFLAGS}" +CPPFLAGS+= -I${LOCALBASE}/include/pth +LDFLAGS+= -L${LOCALBASE}/lib/pth .else # !defined(WITH_PTH) CONFIGURE_ARGS+= --with-threads CFLAGS+= ${PTHREAD_CFLAGS} -CONFIGURE_ENV+= LDFLAGS="${PTHREAD_LIBS} ${LDFLAGS}" +LDFLAGS+= ${PTHREAD_LIBS} .endif # defined(WITH_PTH) .if defined(WITHOUT_HUGE_STACK_SIZE) CFLAGS+= -DTHREAD_STACK_SIZE=0x20000 @@ -104,9 +104,6 @@ CFLAGS+= -DTHREAD_STACK_SIZE=0x100000 .endif # defined(WITHOUT_HUGE_STACK_SIZE) .else # defined(WITHOUT_THREADS) CONFIGURE_ARGS+= --without-threads -.if defined(LDFLAGS) -CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}" -.endif # defined(LDFLAGS) .endif # !defined(WITHOUT_THREADS) .if !defined(WITHOUT_UCS4) && !defined(WITH_UCS2) @@ -147,6 +144,14 @@ CONFIGURE_ARGS+= --disable-ipv6 CONFIGURE_ARGS+= --with-fpectl .endif +.if defined(WITH_GETTEXT) +USE_GETTEXT= yes +LDFLAGS+= -L${LOCALBASE}/lib +CONFIGURE_ENV+= ac_cv_header_libintl_h=yes +.else +CONFIGURE_ENV+= ac_cv_header_libintl_h=no +.endif + pre-patch: ${CP} -r ${PATCH_WRKSRC}/Lib/plat-freebsd8 \ ${PATCH_WRKSRC}/Lib/plat-freebsd9 --- a.diff ends here ---