CentOS 7 编译安装Python2.6.1

编译安装步骤很简单,如下:

# wget https://www.python.org/ftp/python/2.6.1/Python-2.6.1.tgz
# tar zxvf Python-2.6.1.tgz
# cd Python-2.6.1
# ./configure --prefix=/usr/local --enable-shared
# make && make install

编译的过程中遇到以下报错信息:

gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
  -I. -IInclude -I./Include   -DPy_BUILD_CORE -DSVNVERSION=\"`LC_ALL=C svnversion .`\"
  -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c

gcc: error: directory": No such file or directory
make: *** [Modules/getbuildinfo.o] Error 1

这个是configure的一个BUG,修改生成的Makefile文件,找到以下内容:

CC=     gcc -pthread
CXX=        g++ -pthread
MAINCC=     $(CC)
LINKCC=     $(PURIFY) $(MAINCC)
AR=     ar
RANLIB=     ranlib
SVNVERSION= svnversion $(srcdir)

将最后一行的SVNVERSION变量值改为空,然后重新make && make install即可
SVNVERSION=""

猜你喜欢

转载自blog.csdn.net/lusyoe/article/details/70196912