diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 85e2806..4e92dcd 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!@PYTHON_EXECUTABLE@
 
 __doc__ = '''
 fsm-to-dot: convert FSM definitons to graph images
diff --git a/contrib/struct_endianess.py b/contrib/struct_endianess.py
index be73fbe..67f67cd 100755
--- a/contrib/struct_endianess.py
+++ b/contrib/struct_endianess.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!@PYTHON_EXECUTABLE@
 
 '''Using mad regexes, automatically make sure that all structs with sub-byte
 integers have matching big-endian definitions. The idea is to save a lot of
diff --git a/include/Makefile.am b/include/Makefile.am
index d76addd..dbe789b 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -186,7 +186,7 @@
 	$(AM_V_GEN)sed -e's/XX/$*/g' $< > $@
 
 osmocom/gsm/gsm0503.h: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py
-	$(AM_V_GEN)python3 $(top_srcdir)/utils/conv_gen.py gen_header gsm \
+	$(AM_V_GEN)@PYTHON_EXECUTABLE@ $(top_srcdir)/utils/conv_gen.py gen_header gsm \
 		--target-path $(builddir)/osmocom/gsm
 
 CLEANFILES = osmocom/gsm/gsm0503.h
diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am
index 4a1faca..7a7bfb9 100644
--- a/src/gsm/Makefile.am
+++ b/src/gsm/Makefile.am
@@ -49,6 +49,6 @@
 
 # Convolutional codes generation
 gsm0503_conv.c: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py
-	$(AM_V_GEN)python3 $(top_srcdir)/utils/conv_gen.py gen_codes gsm
+	$(AM_V_GEN)@PYTHON_EXECUTABLE@ $(top_srcdir)/utils/conv_gen.py gen_codes gsm
 
 CLEANFILES = gsm0503_conv.c
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3a3ea37..161d06f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -368,7 +368,7 @@
 	mv $@.tmp $@
 
 conv/gsm0503_test_vectors.c: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py
-	$(AM_V_GEN)python3 $(top_srcdir)/utils/conv_gen.py gen_vectors gsm \
+	$(AM_V_GEN)@PYTHON_EXECUTABLE@ $(top_srcdir)/utils/conv_gen.py gen_vectors gsm \
 		--target-path $(builddir)/conv
 
 if ENABLE_EXT_TESTS
diff --git a/utils/conv_codes_gsm.py b/utils/conv_codes_gsm.py
index e189985..48b161a 100644
--- a/utils/conv_codes_gsm.py
+++ b/utils/conv_codes_gsm.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!@PYTHON_EXECUTABLE@
 # -*- coding: utf-8 -*-
 
 from conv_gen import ConvolutionalCode
diff --git a/utils/conv_gen.py b/utils/conv_gen.py
index d2eda15..88968d3 100644
--- a/utils/conv_gen.py
+++ b/utils/conv_gen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!@PYTHON_EXECUTABLE@
 
 mod_license = """
 /*
diff --git a/utils/gsmtap.py b/utils/gsmtap.py
index b7211ad..b1a9365 100644
--- a/utils/gsmtap.py
+++ b/utils/gsmtap.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!@PYTHON_EXECUTABLE@
 # License: MIT
 # Copyright 2019 by Sysmocom s.f.m.c. GmbH
 # Author: Alexander Couzens <lynxis@fe80.eu>
diff --git a/utils/gsmtap_logread.py b/utils/gsmtap_logread.py
index a29f149..629c394 100644
--- a/utils/gsmtap_logread.py
+++ b/utils/gsmtap_logread.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!@PYTHON_EXECUTABLE@
 #
 # License: MIT
 # Copyright 2019 by Sysmocom s.f.m.c. GmbH
