ports/136917: [patch] lang/python26: gettext detection
Anonymous
swell.k at gmail.com
Fri Aug 13 15:00:18 UTC 2010
The following reply was made to PR ports/136917; it has been noted by GNATS.
From: Anonymous <swell.k at gmail.com>
To: bf1783 at gmail.com
Cc: bug-followup at FreeBSD.org
Subject: Re: ports/136917: [patch] lang/python26: gettext detection
Date: Fri, 13 Aug 2010 18:57:27 +0400
"b. f." <bf1783 at googlemail.com> 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 <bsd.port.pre.mk>
@@ -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 ---
More information about the freebsd-python
mailing list