From: Jorge Pereira Date: Wed, 11 Sep 2019 19:43:08 +0000 (-0300) Subject: rlm_python: Add hack to bypass bug with 'pythoh2.7-config' in the OSX (#2975) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fb8f5959ccf00e8fdecdf2d32bf7f1fbb86fc8e;p=thirdparty%2Ffreeradius-server.git rlm_python: Add hack to bypass bug with 'pythoh2.7-config' in the OSX (#2975) 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. --- diff --git a/src/modules/rlm_python/configure b/src/modules/rlm_python/configure index 4c22b355700..d15ba1a2079 100755 --- a/src/modules/rlm_python/configure +++ b/src/modules/rlm_python/configure @@ -2774,6 +2774,9 @@ test -n "$PYTHON_CONFIG_BIN" || PYTHON_CONFIG_BIN="not-found" 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;} @@ -2820,6 +2823,8 @@ $as_echo "$as_me: WARNING: FAILURE: rlm_python requires: $fail." >&2;}; fi fi +export CFLAGS="$old_CFLAGS" + diff --git a/src/modules/rlm_python/configure.ac b/src/modules/rlm_python/configure.ac index e1e2ade410a..23c8a57d200 100644 --- a/src/modules/rlm_python/configure.ac +++ b/src/modules/rlm_python/configure.ac @@ -32,6 +32,12 @@ if test x$with_[]modname != xno; then 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}\"]) @@ -83,6 +89,8 @@ if test x"$fail" != x""; then fi fi +export CFLAGS="$old_CFLAGS" + AC_SUBST(mod_ldflags) AC_SUBST(mod_cflags) AC_SUBST(targetname)