As discussed with Arran. the 'python2.7-config' has a weird bug on the
OSX that if you have CFLAGS="..." declared with whatever content you get
the below behavior.
$ python2.7-config --cflags | grep -o "\-arch [^ ]*"
$ CFLAGS='whatever' python2.7-config --cflags | grep -o "\-arch [^ ]*"
-arch x86_64
-arch i386
$
It results to break the build.
fail="python-config"
fi
+ old_CFLAGS="$CFLAGS"
+ unset CFLAGS
+
python_cflags=`${PYTHON_CONFIG_BIN} --cflags`
{ $as_echo "$as_me:${as_lineno-$LINENO}: ${PYTHON_CONFIG_BIN}'s cflags were \"${python_cflags}\"" >&5
$as_echo "$as_me: ${PYTHON_CONFIG_BIN}'s cflags were \"${python_cflags}\"" >&6;}
fi
fi
+export CFLAGS="$old_CFLAGS"
+
fail="python-config"
fi
+ dnl #
+ dnl # It is necessary due to a weird behavior with 'python-config'
+ dnl #
+ old_CFLAGS="$CFLAGS"
+ unset CFLAGS
+
python_cflags=`${PYTHON_CONFIG_BIN} --cflags`
AC_MSG_NOTICE([${PYTHON_CONFIG_BIN}'s cflags were \"${python_cflags}\"])
fi
fi
+export CFLAGS="$old_CFLAGS"
+
AC_SUBST(mod_ldflags)
AC_SUBST(mod_cflags)
AC_SUBST(targetname)