]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rlm_python: Add hack to bypass bug with 'pythoh2.7-config' in the OSX (#2975)
authorJorge Pereira <jpereira@users.noreply.github.com>
Wed, 11 Sep 2019 19:43:08 +0000 (16:43 -0300)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 11 Sep 2019 19:43:08 +0000 (14:43 -0500)
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.

src/modules/rlm_python/configure
src/modules/rlm_python/configure.ac

index 4c22b3557004ad2f6e751538cf08d5b1668386df..d15ba1a207997df1be48a48deee634c78438c5a1 100755 (executable)
@@ -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"
+
 
 
 
index e1e2ade410acb3143cc2b7b5faee6f3fb12b0a13..23c8a57d2007d04c6c4d68bde936eb45046c5b26 100644 (file)
@@ -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)