CentOS 7 compile and install Python2.6.1

The compilation and installation steps are very simple, as follows:

# 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

The following error message is encountered during compilation:

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

This is a bug in configure , modify the generated Makefile and find the following:

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

Change the value of the SVNVERSION variable in the last line to empty, and then make && make installrestart
SVNVERSION=""

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325957757&siteId=291194637