Skip to content

Commit b03179e

Browse files
sumit-bosejhrozek
authored andcommitted
sbus: dectect python binary for sbus_generate.sh
We already detect python2 and python3 binaries during configure. With this patch PYTHON_EXEC is set to the python3 binary if python3 bindings are generated and to the python2 binary otherwise. With the help of an environment variable sbus_generate.sh is made aware of it. Related to https://pagure.io/SSSD/sssd/issue/3807 Reviewed-by: Pavel Březina <[email protected]>
1 parent 1e23988 commit b03179e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -1020,14 +1020,14 @@ libsss_cert_la_LDFLAGS = \
10201020
$(NULL)
10211021

10221022
generate-sbus-code:
1023-
$(srcdir)/sbus_generate.sh $(abs_srcdir)
1023+
$(builddir)/sbus_generate.sh $(abs_srcdir)
10241024

10251025
.PHONY: generate-sbus-code
10261026

10271027
BUILT_SOURCES += generate-sbus-code
10281028

10291029
EXTRA_DIST += \
1030-
sbus_generate.sh \
1030+
sbus_generate.sh.in \
10311031
src/sbus/codegen/dbus.xml \
10321032
src/sbus/codegen/sbus_CodeGen.py \
10331033
src/sbus/codegen/sbus_DataType.py \

configure.ac

+8
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,13 @@ them please use argument --without-python3-bindings when running configure.])])
373373
SSS_CLEAN_PYTHON_VARIABLES
374374
fi
375375

376+
if test x$HAVE_PYTHON3_BINDINGS = x1; then
377+
PYTHON_EXEC=$PYTHON3
378+
else
379+
PYTHON_EXEC=$PYTHON2
380+
fi
381+
AC_SUBST(PYTHON_EXEC)
382+
376383
AM_CONDITIONAL([BUILD_PYTHON_BINDINGS],
377384
[test x"$with_python2_bindings" = xyes \
378385
-o x"$with_python3_bindings" = xyes])
@@ -524,4 +531,5 @@ AC_CONFIG_FILES([Makefile contrib/sssd.spec src/examples/rwtab src/doxy.config
524531
src/config/setup.py
525532
src/systemtap/sssd.stp
526533
src/config/SSSDConfig/__init__.py])
534+
AC_CONFIG_FILES([sbus_generate.sh], [chmod +x sbus_generate.sh])
527535
AC_OUTPUT

sbus_generate.sh sbus_generate.sh.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ generate() {
1313

1414
echo "Generating sbus code for: $XML"
1515

16-
python $CODEGEN --sbus sbus --util util \
16+
@PYTHON_EXEC@ $CODEGEN --sbus sbus --util util \
1717
--headers "$HEADERS" \
1818
--dest "$SRCDIR/src/$DEST" \
1919
--fileprefix "sbus_${PREFIX}_" \

0 commit comments

Comments
 (0)