Subject: Re: CONFIGURE_ENV vs CFLAGS & CPPFLAGS et al (was: CVS commit: pkgsrc/mk)
To: Frederick Bruckman <fredb@immanent.net>
From: Greg A. Woods <woods@weird.com>
List: tech-pkg
Date: 06/15/2003 11:08:45
[ On Sunday, June 15, 2003 at 09:12:10 (-0500), Frederick Bruckman wrote: ]
> Subject: Re: CVS commit: pkgsrc/mk
>
> Does anyone know why these (CXX, CC, CFLAGS, CXXFLAGS) aren't all
> added to ${CONFIGURE_ENV} and ${BUILD_DEFS}? Especially ${CONFIGURE_ENV},
> because without that, they only work about half the time.

Indeed they should all be passed to configure too.

Note though that GNU Autoconf generated configure scripts won't always
make use of some of them.  For example the last time I checked I don't
believe Autoconf was creating scripts that made use of CPPFLAGS, so in
that case it is important to include the value of CPPFLAGS in the value
of CFLAGS as it is passed to 'configure' in CONFIGURE_ENV.  Note that I
still also pass CPPFLAGS separately as well just in case some script
does make proper use of it:

***************
*** 1880,1891 ****
  .  endif	# AUTOMAKE_OVERRIDE
  .endif		# USE_BUILDLINK != "no"
  
  .if !target(do-configure)
  do-configure: ${_CONFIGURE_PREREQ}
  .  if defined(HAS_CONFIGURE)
  .    for DIR in ${CONFIGURE_DIRS}
  	${_PKG_SILENT}${_PKG_DEBUG}${_ULIMIT_CMD}cd ${DIR} && ${SETENV} \
! 	    CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" \
  	    CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" FC="${FC}" F77="${FC}" FFLAGS="${FFLAGS}" \
  	    INSTALL="`${TYPE} ${INSTALL} | ${AWK} '{ print $$NF }'` -c -o ${BINOWN} -g ${BINGRP}" \
  	    ac_given_INSTALL="`${TYPE} ${INSTALL} | ${AWK} '{ print $$NF }'` -c -o ${BINOWN} -g ${BINGRP}" \
--- 2043,2056 ----
  .  endif	# AUTOMAKE_OVERRIDE
  .endif		# USE_BUILDLINK != "no"
  
+ # XXX at the moment Autoconf still doesn't use CPPFLAGS so include it in CFLAGS too....
+ #
  .if !target(do-configure)
  do-configure: ${_CONFIGURE_PREREQ}
  .  if defined(HAS_CONFIGURE)
  .    for DIR in ${CONFIGURE_DIRS}
  	${_PKG_SILENT}${_PKG_DEBUG}${_ULIMIT_CMD}cd ${DIR} && ${SETENV} \
! 	    CC="${CC}" CFLAGS="${CFLAGS} ${CPPFLAGS}" CPPFLAGS="${CPPFLAGS}" \
  	    CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" FC="${FC}" F77="${FC}" FFLAGS="${FFLAGS}" \
  	    INSTALL="`${TYPE} ${INSTALL} | ${AWK} '{ print $$NF }'` -c -o ${BINOWN} -g ${BINGRP}" \
  	    ac_given_INSTALL="`${TYPE} ${INSTALL} | ${AWK} '{ print $$NF }'` -c -o ${BINOWN} -g ${BINGRP}" \


-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>