summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2018-12-10 11:59:23 +0000
committerJoshua M. Clulow <josh@sysmgr.org>2020-04-08 12:30:39 -0700
commit5bbe7d1e9f312861ee789d5a8dc75436fdc8bed2 (patch)
treea4ca4ea268be3478f029c7403bafa88c1e7826b5
parent33119c8b2ee152d0614d09fb413393430a97a6bf (diff)
downloadillumos-gate-5bbe7d1e9f312861ee789d5a8dc75436fdc8bed2.tar.gz
10056 9894 broke PYTHON_VERSION
Reviewed by: Dan McDonald <danmcd@joyent.com> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/Makefile.master9
-rw-r--r--usr/src/lib/pylibbe/Makefile.com8
-rw-r--r--usr/src/lib/pylibbe/amd64/Makefile4
-rw-r--r--usr/src/lib/pylibbe/i386/Makefile4
-rw-r--r--usr/src/lib/pylibbe/py3/Makefile7
-rw-r--r--usr/src/lib/pysolaris/Makefile.com6
-rw-r--r--usr/src/lib/pysolaris/amd64/Makefile3
-rw-r--r--usr/src/lib/pysolaris/i386/Makefile3
-rw-r--r--usr/src/lib/pysolaris/py3/Makefile8
-rw-r--r--usr/src/lib/pyzfs/Makefile.com6
-rw-r--r--usr/src/lib/pyzfs/amd64/Makefile3
-rw-r--r--usr/src/lib/pyzfs/i386/Makefile3
-rw-r--r--usr/src/lib/pyzfs/py3/Makefile8
13 files changed, 49 insertions, 23 deletions
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master
index 2827914be6..a63c36d53f 100644
--- a/usr/src/Makefile.master
+++ b/usr/src/Makefile.master
@@ -263,6 +263,11 @@ INSLINKTARGET= $<
INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@
INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
+# The path to python that will be used for the shebang line when installing
+# python scripts to the proto area. This is overridden by makefiles to
+# select to the correct version.
+PYSHEBANG= $(PYTHON)
+
#
# Python bakes the mtime of the .py file into the compiled .pyc and
# rebuilds if the baked-in mtime != the mtime of the source file
@@ -270,7 +275,7 @@ INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
# files we must make certain to not adjust the mtime of the source
# (.py) file.
#
-INS.pyfile= $(RM) $@; $(SED) -e "1s:^\#!@PYTHON@:\#!$(PYTHON):" < $< > $@; $(CHMOD) $(FILEMODE) $@; $(TOUCH) -r $< $@
+INS.pyfile= $(RM) $@; $(SED) -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" < $< > $@; $(CHMOD) $(FILEMODE) $@; $(TOUCH) -r $< $@
# MACH must be set in the shell environment per uname -p on the build host
# More specific architecture variables should be set in lower makefiles.
@@ -1120,7 +1125,7 @@ PKGPUBLISHER_NONREDIST= on-extra
$(CHMOD) +x $@
.py:
- $(RM) $@; $(SED) -e "1s:^\#!@PYTHON@:\#!$(PYTHON):" < $< > $@; $(CHMOD) +x $@
+ $(RM) $@; $(SED) -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" < $< > $@; $(CHMOD) +x $@
.py.pyc:
$(RM) $@
diff --git a/usr/src/lib/pylibbe/Makefile.com b/usr/src/lib/pylibbe/Makefile.com
index 431bcfea1c..0776d0dea6 100644
--- a/usr/src/lib/pylibbe/Makefile.com
+++ b/usr/src/lib/pylibbe/Makefile.com
@@ -33,8 +33,8 @@ include ../../Makefile.lib
LIBLINKS =
SRCDIR = ../common
-ROOTLIBDIR= $(ROOT)/usr/lib/python$(PYTHON_VERSION)/vendor-packages
-ROOTLIBDIR64= $(ROOT)/usr/lib/python$(PYTHON_VERSION)/vendor-packages/64
+ROOTLIBDIR= $(ROOT)/usr/lib/python$(PYVER)/vendor-packages
+ROOTLIBDIR64= $(ROOT)/usr/lib/python$(PYVER)/vendor-packages/64
PYFILES= $(PYSRCS)
ROOTPYBEFILES= $(PYFILES:%=$(ROOTLIBDIR)/%)
@@ -44,11 +44,11 @@ LIBS = $(DYNLIB)
LDLIBS += -lbe -lnvpair -lc
CFLAGS += $(CCVERBOSE)
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I../../libbe/common \
- -I$(ADJUNCT_PROTO)/usr/include/python$(PYTHON_VERSION)$(PYTHON_SUFFIX)
+ -I$(ADJUNCT_PROTO)/usr/include/python$(PYVER)$(PYSUFFIX)
.KEEP_STATE:
-all install := LDLIBS += -lpython$(PYTHON_VERSION)$(PYTHON_SUFFIX)
+all install := LDLIBS += -lpython$(PYVER)$(PYSUFFIX)
all: $(PYOBJS) $(LIBS)
diff --git a/usr/src/lib/pylibbe/amd64/Makefile b/usr/src/lib/pylibbe/amd64/Makefile
index 32e9e54ca4..9209b53492 100644
--- a/usr/src/lib/pylibbe/amd64/Makefile
+++ b/usr/src/lib/pylibbe/amd64/Makefile
@@ -21,8 +21,12 @@
#
# Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
#
+PYVER = $(PYTHON_VERSION)
+PYSUFFIX = $(PYTHON_SUFFIX)
+
include ../Makefile.com
include ../../Makefile.lib.64
diff --git a/usr/src/lib/pylibbe/i386/Makefile b/usr/src/lib/pylibbe/i386/Makefile
index 5a771c0816..decc45d4f6 100644
--- a/usr/src/lib/pylibbe/i386/Makefile
+++ b/usr/src/lib/pylibbe/i386/Makefile
@@ -21,8 +21,12 @@
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
#
+PYVER = $(PYTHON_VERSION)
+PYSUFFIX = $(PYTHON_SUFFIX)
+
include ../Makefile.com
install: all $(ROOTLIBS)
diff --git a/usr/src/lib/pylibbe/py3/Makefile b/usr/src/lib/pylibbe/py3/Makefile
index d146f8c62c..f797ad5dd3 100644
--- a/usr/src/lib/pylibbe/py3/Makefile
+++ b/usr/src/lib/pylibbe/py3/Makefile
@@ -15,9 +15,10 @@
include ../Makefile.com
include ../../Makefile.lib.64
-PYTHON = $(PYTHON3)
-PYTHON_VERSION = $(PYTHON3_VERSION)
-PYTHON_SUFFIX = $(PYTHON3_SUFFIX)
+PYSHEBANG = $(PYTHON3)
+PYVER = $(PYTHON3_VERSION)
+PYSUFFIX = $(PYTHON3_SUFFIX)
+
LDLIBS64 += -L$(ADJUNCT_PROTO)/usr/lib/$(MACH64)
MAPFILES = $(SRCDIR)/mapfile-py3
$(ROOTLIBDIR)/$(DYNLIB) := FILEMODE= 755
diff --git a/usr/src/lib/pysolaris/Makefile.com b/usr/src/lib/pysolaris/Makefile.com
index 69769ae544..31165206c7 100644
--- a/usr/src/lib/pysolaris/Makefile.com
+++ b/usr/src/lib/pysolaris/Makefile.com
@@ -33,7 +33,7 @@ include ../../Makefile.lib
LIBLINKS =
SRCDIR = ../common
-ROOTLIBDIR= $(ROOT)/usr/lib/python$(PYTHON_VERSION)/vendor-packages/solaris
+ROOTLIBDIR= $(ROOT)/usr/lib/python$(PYVER)/vendor-packages/solaris
ROOTLIBDIR64= $(ROOTLIBDIR)/64
PYOBJS= $(PYSRCS:%.py=$(SRCDIR)/%.pyc)
PYFILES= $(PYSRCS) $(PYSRCS:%.py=%.pyc)
@@ -43,11 +43,11 @@ CSTD= $(CSTD_GNU99)
C99LMODE= -Xc99=%all
LIBS = $(DYNLIB)
-LDLIBS += -lc -lsec -lidmap -lpython$(PYTHON_VERSION)$(PYTHON_SUFFIX)
+LDLIBS += -lc -lsec -lidmap -lpython$(PYVER)$(PYSUFFIX)
CFLAGS += $(CCVERBOSE)
CERRWARN += -_gcc=-Wno-unused-variable
CPPFLAGS += \
- -I$(ADJUNCT_PROTO)/usr/include/python$(PYTHON_VERSION)$(PYTHON_SUFFIX)
+ -I$(ADJUNCT_PROTO)/usr/include/python$(PYVER)$(PYSUFFIX)
all:
diff --git a/usr/src/lib/pysolaris/amd64/Makefile b/usr/src/lib/pysolaris/amd64/Makefile
index 4fa33a90bd..91c7fbd58b 100644
--- a/usr/src/lib/pysolaris/amd64/Makefile
+++ b/usr/src/lib/pysolaris/amd64/Makefile
@@ -16,6 +16,9 @@
# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
#
+PYVER = $(PYTHON_VERSION)
+PYSUFFIX = $(PYTHON_SUFFIX)
+
include ../Makefile.com
include ../../Makefile.lib.64
diff --git a/usr/src/lib/pysolaris/i386/Makefile b/usr/src/lib/pysolaris/i386/Makefile
index 926da3004e..c34c0504de 100644
--- a/usr/src/lib/pysolaris/i386/Makefile
+++ b/usr/src/lib/pysolaris/i386/Makefile
@@ -23,6 +23,9 @@
# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
#
+PYVER = $(PYTHON_VERSION)
+PYSUFFIX = $(PYTHON_SUFFIX)
+
include ../Makefile.com
all: $(PYOBJS) $(LIBS)
diff --git a/usr/src/lib/pysolaris/py3/Makefile b/usr/src/lib/pysolaris/py3/Makefile
index 700cc16ca5..12abf943c4 100644
--- a/usr/src/lib/pysolaris/py3/Makefile
+++ b/usr/src/lib/pysolaris/py3/Makefile
@@ -16,9 +16,9 @@
include ../Makefile.com
include ../../Makefile.lib.64
-PYTHON = $(PYTHON3)
-PYTHON_VERSION = $(PYTHON3_VERSION)
-PYTHON_SUFFIX = $(PYTHON3_SUFFIX)
+PYSHEBANG = $(PYTHON3)
+PYVER = $(PYTHON3_VERSION)
+PYSUFFIX = $(PYTHON3_SUFFIX)
LDLIBS64 += -L$(ADJUNCT_PROTO)/usr/lib/$(MACH64)
MAPFILES= $(SRCDIR)/mapfile-py3
@@ -33,5 +33,5 @@ $(ROOTLIBDIR)/%.so: %.so
$(ROOTLIBDIR)/%: ../common/%
$(INS.pyfile)
- $(PYTHON) -mpy_compile $@
+ $(PYTHON3) -mpy_compile $@
diff --git a/usr/src/lib/pyzfs/Makefile.com b/usr/src/lib/pyzfs/Makefile.com
index 347b4316eb..fd6218e2c4 100644
--- a/usr/src/lib/pyzfs/Makefile.com
+++ b/usr/src/lib/pyzfs/Makefile.com
@@ -35,7 +35,7 @@ include ../../Makefile.lib
LIBLINKS =
SRCDIR = ../common
-ROOTLIBDIR= $(ROOT)/usr/lib/python$(PYTHON_VERSION)/vendor-packages/zfs
+ROOTLIBDIR= $(ROOT)/usr/lib/python$(PYVER)/vendor-packages/zfs
ROOTLIBDIR64= $(ROOTLIBDIR)/64
PYOBJS= $(PYSRCS:%.py=$(SRCDIR)/%.pyc)
PYFILES= $(PYSRCS) $(PYSRCS:%.py=%.pyc)
@@ -45,11 +45,11 @@ CSTD= $(CSTD_GNU99)
C99LMODE= -Xc99=%all
LIBS = $(DYNLIB)
-LDLIBS += -lc -lnvpair -lpython$(PYTHON_VERSION)$(PYTHON_SUFFIX) -lzfs
+LDLIBS += -lc -lnvpair -lpython$(PYVER)$(PYSUFFIX) -lzfs
CFLAGS += $(CCVERBOSE)
CERRWARN += -_gcc=-Wno-unused-variable
CPPFLAGS += \
- -I$(ADJUNCT_PROTO)/usr/include/python$(PYTHON_VERSION)$(PYTHON_SUFFIX)
+ -I$(ADJUNCT_PROTO)/usr/include/python$(PYVER)$(PYSUFFIX)
CPPFLAGS += -I../../../uts/common/fs/zfs
CPPFLAGS += -I../../../common/zfs
diff --git a/usr/src/lib/pyzfs/amd64/Makefile b/usr/src/lib/pyzfs/amd64/Makefile
index f3fde27d22..11141ef969 100644
--- a/usr/src/lib/pyzfs/amd64/Makefile
+++ b/usr/src/lib/pyzfs/amd64/Makefile
@@ -14,6 +14,9 @@
# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
#
+PYVER = $(PYTHON_VERSION)
+PYSUFFIX = $(PYTHON_SUFFIX)
+
include ../Makefile.com
include ../../Makefile.lib.64
diff --git a/usr/src/lib/pyzfs/i386/Makefile b/usr/src/lib/pyzfs/i386/Makefile
index 82d8120e69..3c870131dc 100644
--- a/usr/src/lib/pyzfs/i386/Makefile
+++ b/usr/src/lib/pyzfs/i386/Makefile
@@ -23,6 +23,9 @@
# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
#
+PYVER = $(PYTHON_VERSION)
+PYSUFFIX = $(PYTHON_SUFFIX)
+
include ../Makefile.com
all: $(PBOJECT) $(LIBS)
diff --git a/usr/src/lib/pyzfs/py3/Makefile b/usr/src/lib/pyzfs/py3/Makefile
index 27e04f084e..8d9c82dcfb 100644
--- a/usr/src/lib/pyzfs/py3/Makefile
+++ b/usr/src/lib/pyzfs/py3/Makefile
@@ -18,9 +18,9 @@
include ../Makefile.com
include ../../Makefile.lib.64
-PYTHON = $(PYTHON3)
-PYTHON_VERSION = $(PYTHON3_VERSION)
-PYTHON_SUFFIX = $(PYTHON3_SUFFIX)
+PYSHEBANG = $(PYTHON3)
+PYVER = $(PYTHON3_VERSION)
+PYSUFFIX = $(PYTHON3_SUFFIX)
LDLIBS64 += -L$(ADJUNCT_PROTO)/usr/lib/$(MACH64)
MAPFILES= $(SRCDIR)/mapfile-py3
@@ -35,5 +35,5 @@ $(ROOTLIBDIR)/%.so: %.so
$(ROOTLIBDIR)/%: ../common/%
$(INS.pyfile)
- $(PYTHON) -mpy_compile $@
+ $(PYTHON3) -mpy_compile $@