
Ubuntu日本語フォーラム
ログインしていません。
i以下で環境でarm7用python2.7.13のmakeを行っています(それ以降はバージョンはarm用pacthを見つけられなかったので)
cat
root@v133-18-200-119:~/dd-wrt/Python-2.7.13# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
python2.7のソースを取得して、展開して./configureしてmakeします。
成功の後、作成さいた実行体の名前を変更します。
mv python hostpython
mv Parser/pgen Parser/hostpgen
arm用pacthをmake環境にあてます
patch -p1 < ../Python-2.7.13-xcompile.patch
config.siteを作成して以下設定を書き込む
ac_cv_file__dev_ptmx=no
ac_cv_file__dev_ptc=no
CONFIG_SITE=config.site ./configure --build=x86_64-linux-gnu --host=arm-linux-gnueabihf --disable-ipv6 --prefix=/root/dd-wrt/INSTALL/
makeすると正常に完了します。ただし、make installするとmake
PYTHONPATH=/root/dd-wrt/INSTALL/lib/python2.7 \
-Wi -tt /root/dd-wrt/INSTALL/lib/python2.7/compileall.py \
-d /root/dd-wrt/INSTALL/lib/python2.7 -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
/root/dd-wrt/INSTALL/lib/python2.7
/bin/sh: 1: -Wi: not found
Makefile:1082: recipe for target 'libinstall' failed
make: *** [libinstall] Error 127
root@v133-18-200-119:~/dd-wrt/Python-2.7.13#
Makeファイルを修正すべきだと思うのですが、詳しくないので、識者のアドバイスにすがらせて下さい
オフライン
makeすると正常に完了します。ただし、make installするとmake
PYTHONPATH=/root/dd-wrt/INSTALL/lib/python2.7 \
-Wi -tt /root/dd-wrt/INSTALL/lib/python2.7/compileall.py \
-d /root/dd-wrt/INSTALL/lib/python2.7 -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
/root/dd-wrt/INSTALL/lib/python2.7
/bin/sh: 1: -Wi: not found
Makefile:1082: recipe for target 'libinstall' failed
make: *** [libinstall による投稿:Error 127
root@v133-18-200-119:~/dd-wrt/Python-2.7.13#
Makeファイルを修正すべきだと思うのですが、詳しくないので、識者のアドバイスにすがらせて下さい
MakeFileの一部です。
# Generated automatically from Makefile.pre by makesetup.
# Top-level Makefile for Python
#
# As distributed, this file is called Makefile.pre.in; it is processed
# into the real Makefile by running the script ./configure, which
# replaces things like @spam@ with values appropriate for your system.
# This means that if you edit Makefile, your changes get lost the next
# time you run the configure script. Ideally, you can do:
#
# ./configure
# make
# make test
# make install
#
# If you have a previous version of Python installed that you don't
# want to overwrite, you can use "make altinstall" instead of "make
# install". Refer to the "Installing" section in the README file for
# additional details.
#
# See also the section "Build instructions" in the README file.
# === Variables set by makesetup ===
MODOBJS= Modules/threadmodule.o Modules/signalmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_
codecsmodule.o Modules/_weakref.o Modules/zipimport.o Modules/symtablemodule.o Modules/xxsubtype.o
MODLIBS= $(LOCALMODLIBS) $(BASEMODLIBS)
# === Variables set by configure
VERSION= 2.7
srcdir= .
abs_srcdir= /root/dd-wrt/Python-2.7.13
abs_builddir= /root/dd-wrt/Python-2.7.13
build= x86_64-pc-linux-gnu
host= arm-unknown-linux-gnueabihf
CC= arm-linux-gnueabihf-gcc
CXX= arm-linux-gnueabihf-g++
MAINCC= $(CC)
LINKCC= $(PURIFY) $(MAINCC)
AR= arm-linux-gnueabihf-ar
RANLIB= arm-linux-gnueabihf-ranlib
SVNVERSION= echo Unversioned directory
HGVERSION=
HGTAG=
HGBRANCH=
PGO_PROF_GEN_FLAG=-fprofile-generate
PGO_PROF_USE_FLAG=-fprofile-use -fprofile-correction
LLVM_PROF_MERGER=true
LLVM_PROF_FILE=
LLVM_PROF_ERR=no
GNULD= yes
# Shell used by make (some versions default to the login shell, which is bad)
SHELL= /bin/sh
# Use this to make a link between python$(VERSION) and python in $(BINDIR)
LN= ln
# Portable install script (configure doesn't always guess right)
INSTALL= /usr/bin/install -c
INSTALL_PROGRAM=${INSTALL}
INSTALL_SCRIPT= ${INSTALL}
INSTALL_DATA= ${INSTALL} -m 644
# Shared libraries must be installed with executable mode on some systems;
# rather than figuring out exactly which, we always give them executable mode.
# Also, making them read-only seems to be a good idea...
INSTALL_SHARED= ${INSTALL} -m 555
MKDIR_P= /bin/mkdir -p
MAKESETUP= $(srcdir)/Modules/makesetup
# Compiler options
OPT= -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
BASECFLAGS= -fno-strict-aliasing
CFLAGS= $(BASECFLAGS) -g -O2 $(OPT) $(EXTRA_CFLAGS)
# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
# be able to build extension modules using the directories specified in the
# environment variables
CPPFLAGS= -I. -IInclude -I$(srcdir)/Include
LDFLAGS=
LDLAST=
SGI_ABI=
CCSHARED= -fPIC
LINKFORSHARED= -Xlinker -export-dynamic
ARFLAGS= rc
# Extra C flags added for building the interpreter object files.
CFLAGSFORSHARED=
# C flags used for building the interpreter object files
PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
# Machine-dependent subdirectories
MACHDEP= linux2
# Multiarch directory (may be empty)
MULTIARCH= arm-linux-gnueabihf
# Install prefix for architecture-independent files
prefix= /root/dd-wrt/INSTALL
# Install prefix for architecture-dependent files
exec_prefix= ${prefix}
# Install prefix for data files
datarootdir= ${prefix}/share
# Expanded directories
BINDIR= ${exec_prefix}/bin
LIBDIR= ${exec_prefix}/lib
MANDIR= ${datarootdir}/man
INCLUDEDIR= ${prefix}/include
CONFINCLUDEDIR= $(exec_prefix)/include
SCRIPTDIR= $(prefix)/lib
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
LIBP= $(LIBDIR)/python$(VERSION)
# Symbols used for using shared libraries
SO= .so
LDSHARED= $(CC) -shared $(LDFLAGS)
BLDSHARED= $(CC) -shared $(LDFLAGS)
LDCXXSHARED= $(CXX) -shared
DESTSHARED= $(BINLIBDEST)/lib-dynload
# Executable suffix (.exe on Windows and Mac OS X)
EXE=
BUILDEXE=
省略
libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
@for i in $(SCRIPTDIR) $(LIBDEST); \
do \
if test ! -d $(DESTDIR)$$i; then \
echo "Creating directory $$i"; \
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
else true; \
fi; \
done
@for d in $(LIBSUBDIRS); \
do \
a=$(srcdir)/Lib/$$d; \
if test ! -d $$a; then continue; else true; fi; \
b=$(LIBDEST)/$$d; \
if test ! -d $(DESTDIR)$$b; then \
echo "Creating directory $$b"; \
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
else true; \
fi; \
done
@for i in $(srcdir)/Lib/*.py `cat pybuilddir.txt`/_sysconfigdata.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
do \
if test -x $$i; then \
$(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
else \
$(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
echo $(INSTALL_DATA) $$i $(LIBDEST); \
fi; \
done
@for d in $(LIBSUBDIRS); \
do \
a=$(srcdir)/Lib/$$d; \
if test ! -d $$a; then continue; else true; fi; \
if test `ls $$a | wc -l` -lt 1; then continue; fi; \
b=$(LIBDEST)/$$d; \
for i in $$a/*; \
do \
case $$i in \
*CVS) ;; \
*.py[co]) ;; \
*.orig) ;; \
*~) ;; \
*) \
if test -d $$i; then continue; fi; \
if test -x $$i; then \
echo $(INSTALL_SCRIPT) $$i $$b; \
$(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
else \
echo $(INSTALL_DATA) $$i $$b; \
$(INSTALL_DATA) $$i $(DESTDIR)$$b; \
fi;; \
esac; \
done; \
done
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
fi
PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
$(DESTDIR)$(LIBDEST)
PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
$(DESTDIR)$(LIBDEST)
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
オフライン
どうも
$HOSTPYTHONが設定されていないようです。
もう少し悩んでみます
オフライン