let the preprocessor work its magic rather than executing the code https://bugs.gentoo.org/432120 make sure to use -P here https://bugs.gentoo.org/546636 --- a/Configure +++ b/Configure @@ -2730,20 +2730,17 @@ LOCKF_OWNER4 rm -f ${LSOF_TMPC}.* cat > $LSOF_TMPC.c << .LSOF_END_HERE_DOC1 #include -main() { +#undef XXX #if defined(__GLIBC__) && defined(__GLIBC_MINOR__) -printf("-DGLIBCV=%d\n",__GLIBC__*100+__GLIBC_MINOR__); +XXX: __GLIBC__ * 100 + __GLIBC_MINOR__ #elif defined(__GLIBC__) -printf("-DGLIBCV=%d00\n",__GLIBC__); -#else -printf("\n"); +XXX: __GLIBC__ * 100 #endif -return(0); } .LSOF_END_HERE_DOC1 - $LINUX_CONF_CC ${LSOF_TMPC}.c -I$LSOF_INCLUDE -o ${LSOF_TMPC}.x > /dev/null 2>&1 + $LINUX_CONF_CC ${LSOF_TMPC}.c -E -P -I$LSOF_INCLUDE 2>/dev/null | sed -n '/^XXX:/s|.*:||p' > ${LSOF_TMPC}.x - if test -x ${LSOF_TMPC}.x # { + if test -s ${LSOF_TMPC}.x # { then - LINUX_CLIB=`${LSOF_TMPC}.x` + LINUX_CLIB="-DGLIBCV=$(( `cat ${LSOF_TMPC}.x` ))" LSOF_TMP=$? else LINUX_CLIB=""