build with Python 3.7 and newest external from source on Linux ok now.

pull/111/head
Apex Lu 2018-09-23 17:38:13 +08:00
parent df13355e44
commit 2e876a5cfe
19 changed files with 274 additions and 129 deletions

View File

@ -6,7 +6,8 @@
VER_PYTHON="3.7.0"
VER_PYTHON_SHORT="3.7"
VER_OPENSSL="1.0.2p"
# VER_SQLITE="3250000"
VER_SQLITE="3250000"
VER_ZLIB="1.2.11"
VER_PYTHON_LIB="${VER_PYTHON_SHORT}m"
################################################################
@ -24,9 +25,8 @@ PATH_RELEASE=${PATH_EXT}/linux/release
PY_PATH_SRC=${PATH_TMP}/Python-${VER_PYTHON}
#PATH_SRC=${PATH_TMP}/${VER_PYTHON}
#PATH_INST=${PATH_RELEASE}/python
OSSL_PATH_SRC=${PATH_TMP}/openssl-${VER_OPENSSL}
PATH_SRC_SQLITE=${PATH_TMP}/sqlite-autoconf-${VER_SQLITE}
function on_error()
{
@ -77,7 +77,8 @@ function step_download_files()
dlfile "python source tarball" "https://www.python.org/ftp/python/${VER_PYTHON}/" "Python-${VER_PYTHON}.tgz" ${PATH_DOWNLOAD}
dlfile "openssl source tarball" "https://www.openssl.org/source/" "openssl-${VER_OPENSSL}.tar.gz" ${PATH_DOWNLOAD}
# dlfile "sqlite source tarball" "http://sqlite.org/2018/" "sqlite-autoconf-${VER_SQLITE}.tar.gz" ${PATH_DOWNLOAD}
dlfile "sqlite source tarball" "http://sqlite.org/2018/" "sqlite-autoconf-${VER_SQLITE}.tar.gz" ${PATH_DOWNLOAD}
dlfile "zlib source tarball" "https://www.zlib.net/" "zlib-${VER_ZLIB}.tar.gz" ${PATH_DOWNLOAD}
}
@ -100,13 +101,32 @@ function step_prepare_source()
tar -zxvf "${PATH_DOWNLOAD}/openssl-${VER_OPENSSL}.tar.gz" -C "${PATH_TMP}"
fi
if [ ! -d "${PATH_TMP}/Python-${VER_PYTHON}/Modules/_sqlite/sqlite3" ]; then
tar -zxvf "${PATH_DOWNLOAD}/sqlite-autoconf-${VER_SQLITE}.tar.gz" -C "${PATH_TMP}"
mv "${PATH_TMP}/sqlite-autoconf-${VER_SQLITE}" "${PATH_TMP}/Python-${VER_PYTHON}/Modules/_sqlite/sqlite3"
fi
# if [ ! -d "${PATH_TMP}/sqlite-autoconf-${VER_SQLITE}" ]; then
# tar -zxvf "${PATH_DOWNLOAD}/sqlite-autoconf-${VER_SQLITE}.tar.gz" -C "${PATH_TMP}"
# fi
if [ ! -d "${PATH_TMP}/Python-${VER_PYTHON}/Modules/zlib" ]; then
tar -zxvf "${PATH_DOWNLOAD}/zlib-${VER_ZLIB}.tar.gz" -C "${PATH_TMP}"
mv "${PATH_TMP}/zlib-${VER_ZLIB}" "${PATH_TMP}/Python-${VER_PYTHON}/Modules/zlib"
fi
# cp -r "${PATH_TMP}/sqlite-autoconf-${VER_SQLITE}" "${PATH_TMP}/Python-${VER_PYTHON}/Modules/_sqlite/sqlite3"
# cp -r "${PATH_FIX}/Python-${VER_PYTHON}" "${PATH_TMP}"
if [ ! -d "${PATH_TMP}/Python-${VER_PYTHON}" ]; then
on_error "Can not prepare source code for build Python."
fi
if [ ! -d "${PATH_TMP}/openssl-${VER_OPENSSL}" ]; then
on_error "Can not prepare source code for build OpenSSL."
fi
if [ ! -d "${PATH_TMP}/Python-${VER_PYTHON}/Modules/_sqlite/sqlite3" ]; then
on_error "Can not prepare source code for build sqlite3 module for Python."
fi
cp "${PATH_FIX}/Python-${VER_PYTHON}/Modules/Setup.dist" "${PY_PATH_SRC}/Modules/Setup.dist"
cp "${PATH_FIX}/Python-${VER_PYTHON}/Modules/Setup.dist" "${PY_PATH_SRC}/Modules/Setup"
cp "${PATH_FIX}/Python-${VER_PYTHON}/Modules/_sqlite/cache.h" "${PY_PATH_SRC}/Modules/_sqlite/cache.h"
cp "${PATH_FIX}/Python-${VER_PYTHON}/Modules/_sqlite/prepare_protocol.h" "${PY_PATH_SRC}/Modules/_sqlite/prepare_protocol.h"
echo "prepare source done"
}
function step_build_openssl()
@ -130,16 +150,25 @@ function step_build_openssl()
fi
}
function step_build_python()
{
echo -n "build python static library ..."
if [ ! -f "${PATH_RELEASE}/lib/${FILE_PYTHON_STATIC_LIB}" ]; then
echo ""
echo " ... configure zlib..."
cd "${PY_PATH_SRC}/Modules/zlib"
./configure --prefix=${PATH_RELEASE}
cd "${PY_PATH_SRC}"
# cp "${PY_PATH_SRC}/Modules/Setup.dist" "${PY_PATH_SRC}/Modules/Setup"
LDFLAGS=-lrt ./configure --disable-shared --prefix=${PATH_RELEASE}
echo " ... configure python..."
LDFLAGS=-lrt ./configure --prefix=${PATH_RELEASE} --disable-shared --enable-optimizations --with-openssl=${PATH_RELEASE}
echo " ... build python..."
make
echo " ... install python..."
make altinstall
cd "${PATH_ROOT}"

View File

@ -322,19 +322,23 @@ class BuilderLinux(BuilderBase):
if os.path.exists(os.path.join(self.PATH_RELEASE, 'include', 'python', 'Python.h')):
cc.w(' - header file already exists, skip.')
else:
utils.ensure_file_exists(os.path.join(env.path_py_inc, 'Python.h'))
utils.makedirs(os.path.join(self.PATH_RELEASE, 'include'))
utils.copy_ex(env.path_py_inc, os.path.join(self.PATH_RELEASE, 'include', 'python'))
utils.ensure_file_exists(os.path.join(self.PATH_RELEASE, 'include', 'python{}m'.format(ctx.py_dot_ver), 'Python.h'))
# utils.makedirs(os.path.join(self.PATH_RELEASE, 'include'))
# utils.copy_ex(env.path_py_inc, os.path.join(self.PATH_RELEASE, 'include', 'python'))
utils.sys_exec('ln -s "{}" "{}"'.format(
os.path.join(self.PATH_RELEASE, 'include', 'python{}m'.format(ctx.py_dot_ver)),
os.path.join(self.PATH_RELEASE, 'include', 'python')
))
lib_file = 'libpython{}m.a'.format(env.py_ver_dot)
if os.path.exists(os.path.join(self.PATH_RELEASE, 'lib', lib_file)):
cc.w(' - lib file already exists, skip.')
else:
utils.ensure_file_exists(os.path.join(env.path_py_lib, lib_file))
utils.makedirs(os.path.join(self.PATH_RELEASE, 'lib'))
utils.copy_file(env.path_py_lib, os.path.join(self.PATH_RELEASE, 'lib'), lib_file)
utils.copy_file(env.path_py_lib, os.path.join(self.PATH_RELEASE, 'lib'), 'libcrypto.a')
utils.copy_file(env.path_py_lib, os.path.join(self.PATH_RELEASE, 'lib'), 'libssl.a')
utils.ensure_file_exists(os.path.join(self.PATH_RELEASE, 'lib', lib_file))
# if os.path.exists(os.path.join(self.PATH_RELEASE, 'lib', lib_file)):
# cc.w(' - lib file already exists, skip.')
# else:
# utils.makedirs(os.path.join(self.PATH_RELEASE, 'lib'))
# utils.copy_file(env.path_py_lib, os.path.join(self.PATH_RELEASE, 'lib'), lib_file)
# utils.copy_file(env.path_py_lib, os.path.join(self.PATH_RELEASE, 'lib'), 'libcrypto.a')
# utils.copy_file(env.path_py_lib, os.path.join(self.PATH_RELEASE, 'lib'), 'libssl.a')
def _build_jsoncpp(self, file_name):
cc.n('prepare jsoncpp source code...', end='')
@ -379,6 +383,12 @@ class BuilderLinux(BuilderBase):
os.system('make install')
os.chdir(old_p)
files = os.listdir(os.path.join(self.PATH_RELEASE, 'lib'))
for i in files:
if i.startswith('libuv.so') or i.startswith('libuv.la'):
# use os.unlink() because some file should be a link.
os.unlink(os.path.join(self.PATH_RELEASE, 'lib', i))
def _build_mbedtls(self, file_name):
if not os.path.exists(self.MBEDTLS_PATH_SRC):
# os.system('tar -zxvf "{}/{}" -C "{}"'.format(PATH_DOWNLOAD, file_name, PATH_TMP))
@ -465,78 +475,50 @@ class BuilderLinux(BuilderBase):
def _build_libssh(self, file_name):
if not os.path.exists(self.LIBSSH_PATH_SRC):
# os.system('tar -zxvf "{}/{}" -C "{}"'.format(PATH_DOWNLOAD, file_name, PATH_TMP))
os.system('unzip "{}/{}" -d "{}"'.format(PATH_DOWNLOAD, file_name, self.PATH_TMP))
# os.rename(os.path.join(self.PATH_TMP, 'master'), os.path.join(self.PATH_TMP, 'libssh-{}'.format(LIBSSH_VER)))
cc.n('build libssh...', end='')
if os.path.exists(os.path.join(self.PATH_RELEASE, 'lib', 'libssh.a')) and os.path.exists(os.path.join(self.PATH_RELEASE, 'lib', 'libssh_threads.a')):
if os.path.exists(os.path.join(self.PATH_RELEASE, 'lib', 'libssh.a')):
cc.w('already exists, skip.')
return
cc.v('')
build_path = os.path.join(self.LIBSSH_PATH_SRC, 'build')
# utils.makedirs(build_path)
# here is a bug in cmake v2.8.11 (default on ubuntu14), in FindOpenSSL.cmake,
# it parse opensslv.h, use regex like this:
# REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
# but in openssl-1.0.2h, the version define line is:
# # define OPENSSL_VERSION_NUMBER 0x1000208fL
# notice there is a space char between # and define, so find openssl always fail.
# old_p = os.getcwd()
# os.chdir(build_path)
# cmd = 'cmake' \
# ' -DCMAKE_INSTALL_PREFIX={}' \
# ' -D_OPENSSL_VERSION={}' \
# ' -DOPENSSL_INCLUDE_DIR={}/include' \
# ' -DOPENSSL_LIBRARIES={}/lib' \
# ' -DCMAKE_BUILD_TYPE=Release' \
# ' -DWITH_GSSAPI=OFF' \
# ' -DWITH_ZLIB=OFF' \
# ' -DWITH_STATIC_LIB=ON' \
# ' -DWITH_PCAP=OFF' \
# ' -DWITH_EXAMPLES=OFF' \
# ' -DWITH_NACL=OFF' \
# ' ..'.format(self.PATH_RELEASE, OPENSSL_VER, self.PATH_RELEASE, self.PATH_RELEASE)
# cc.n(cmd)
# os.system(cmd)
# # os.system('make ssh_static ssh_threads_static')
# os.system('make ssh_static')
# # os.system('make install')
# os.chdir(old_p)
cmake_define = ' -DCMAKE_INSTALL_PREFIX={prefix}' \
' -D_OPENSSL_VERSION={ossl_ver}' \
' -DOPENSSL_INCLUDE_DIR={ossl_inc}' \
' -DOPENSSL_LIBRARIES={ossl_lib}' \
' -DWITH_SSH1=ON' \
cmake_define = ' -DCMAKE_INSTALL_PREFIX={path_release}' \
' -DOPENSSL_INCLUDE_DIR={path_release}/include' \
' -DOPENSSL_LIBRARIES={path_release}/lib' \
' -DWITH_SFTP=ON' \
' -DWITH_SERVER=ON' \
' -DWITH_STATIC_LIB=ON' \
' -DWITH_GSSAPI=OFF' \
' -DWITH_ZLIB=OFF' \
' -DWITH_PCAP=OFF' \
' -DWITH_TESTING=OFF' \
' -DWITH_CLIENT_TESTING=OFF' \
' -DUNIT_TESTING=OFF' \
' -DWITH_EXAMPLES=OFF' \
' -DWITH_BENCHMARKS=OFF' \
' -DWITH_NACL=OFF' \
' ..'.format(prefix=self.PATH_RELEASE, ossl_ver=env.ver_ossl_number, ossl_inc=env.path_ossl_inc, ossl_lib=env.path_ossl_lib)
' ..'.format(path_release=self.PATH_RELEASE)
old_p = os.getcwd()
try:
utils.cmake(build_path, 'Release', False, cmake_define)
os.chdir(build_path)
utils.sys_exec('make install')
except:
pass
os.chdir(old_p)
# because make install will fail because we can not disable ssh_shared target,
# so we copy necessary files ourselves.
utils.ensure_file_exists(os.path.join(self.LIBSSH_PATH_SRC, 'build', 'src', 'libssh.a'))
utils.ensure_file_exists(os.path.join(self.LIBSSH_PATH_SRC, 'build', 'src', 'threads', 'libssh_threads.a'))
utils.copy_file(os.path.join(self.LIBSSH_PATH_SRC, 'build', 'src'), os.path.join(self.PATH_RELEASE, 'lib'), 'libssh.a')
utils.copy_file(os.path.join(self.LIBSSH_PATH_SRC, 'build', 'src', 'threads'), os.path.join(self.PATH_RELEASE, 'lib'), 'libssh_threads.a')
utils.copy_ex(os.path.join(self.LIBSSH_PATH_SRC, 'include'), os.path.join(self.PATH_RELEASE, 'include'), 'libssh')
# utils.ensure_file_exists(os.path.join(self.LIBSSH_PATH_SRC, 'build', 'src', 'libssh.a'))
# utils.copy_file(os.path.join(self.LIBSSH_PATH_SRC, 'build', 'src'), os.path.join(self.PATH_RELEASE, 'lib'), 'libssh.a')
# utils.copy_ex(os.path.join(self.LIBSSH_PATH_SRC, 'include'), os.path.join(self.PATH_RELEASE, 'include'), 'libssh')
utils.ensure_file_exists(os.path.join(self.PATH_RELEASE, 'lib', 'libssh.a'))
files = os.listdir(os.path.join(self.PATH_RELEASE, 'lib'))
for i in files:
if i.startswith('libssh.so'):
# use os.unlink() because some file should be a link.
os.unlink(os.path.join(self.PATH_RELEASE, 'lib', i))
# def _build_sqlite(self, file_name):
# if not os.path.exists(self.SQLITE_PATH_SRC):
@ -556,13 +538,14 @@ class BuilderLinux(BuilderBase):
# os.chdir(old_p)
def fix_output(self):
pass
# remove .so files, otherwise will link to .so but not .a in default.
# rm = ['libsqlite3.la', 'libsqlite3.so.0', 'libsqlite3.so', 'libsqlite3.so.0.8.6', 'libuv.la', 'libuv.so.1', 'libuv.so', 'libuv.so.1.0.0']
rm = ['libuv.la', 'libuv.so.1', 'libuv.so', 'libuv.so.1.0.0']
for i in rm:
_path = os.path.join(self.PATH_RELEASE, 'lib', i)
if os.path.exists(_path):
utils.remove(_path)
# rm = ['libuv.la', 'libuv.so.1', 'libuv.so', 'libuv.so.1.0.0']
# for i in rm:
# _path = os.path.join(self.PATH_RELEASE, 'lib', i)
# if os.path.exists(_path):
# utils.remove(_path)
class BuilderMacOS(BuilderBase):

View File

@ -20,13 +20,14 @@ PY_LIB_REMOVE_WIN = ['ctypes/test', 'curses', 'dbm', 'distutils', 'email/test',
'this.py', 'wave.py', 'webbrowser.py', 'zipapp.py']
PY_LIB_REMOVE_LINUX = ['ctypes/test', 'curses', 'dbm', 'distutils', 'ensurepip', 'idlelib', 'lib2to3',
'lib-dynload', 'pydoc_data', 'site-packages', 'sqlite3/test', 'test', 'tkinter', 'turtledemo', 'unittest', 'venv',
'wsgiref', 'dis.py', 'doctest.py', 'pdb.py', 'py_compile.py', 'pydoc_data', 'pydoc.py', 'this.py', 'wave.py',
'webbrowser.py', 'zipapp.py']
'wsgiref', 'dis.py', 'doctest.py', 'pdb.py', 'py_compile.py', 'pydoc.py', 'this.py', 'wave.py', 'webbrowser.py', 'zipapp.py']
PY_MODULE_REMOVE_LINUX = ['_ctypes_test', '_testbuffer', '_testcapi', '_testimportmultiple', '_testmultiphase', '_xxtestfuzz']
class PYSBase:
def __init__(self):
self.base_path = os.path.join(env.root_path, 'out', 'pysrt', ctx.dist_path)
self.modules_path = os.path.join(self.base_path, 'modules')
self.py_dll_path = ''
self.py_lib_path = ''
@ -60,8 +61,7 @@ class PYSBase:
def _copy_modules(self):
cc.n('copy python extension dll...')
mod_path = os.path.join(self.base_path, 'modules')
utils.makedirs(mod_path)
utils.makedirs(self.modules_path)
ext = utils.extension_suffixes()
cc.v('extension ext:', ext)
@ -70,8 +70,8 @@ class PYSBase:
s = os.path.join(self.py_dll_path, m) + n
if os.path.exists(s):
cc.v('copy %s' % s)
cc.v(' -> %s' % os.path.join(mod_path, m) + n)
shutil.copy(s, os.path.join(mod_path, m) + n)
cc.v(' -> %s' % os.path.join(self.modules_path, m) + n)
shutil.copy(s, os.path.join(self.modules_path, m) + n)
def _make_python_zip(self):
cc.n('make python.zip...')
@ -188,7 +188,7 @@ class PYSLinux(PYSBase):
def __init__(self):
super().__init__()
self.PATH_PYTHON_ROOT = env.path_miniconda # os.path.abspath(os.path.join(os.path.dirname(sys.executable), '..'))
self.PATH_PYTHON_ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.executable), '..'))
if not os.path.exists(self.PATH_PYTHON_ROOT):
raise RuntimeError('can not locate py-static release folder.')
@ -220,7 +220,18 @@ class PYSLinux(PYSBase):
utils.makedirs(self.base_path)
cc.n('copy python extension dll...')
utils.copy_ex(self.py_dll_path, os.path.join(self.base_path, 'modules'))
utils.copy_ex(self.py_dll_path, self.modules_path)
cc.v('remove useless modules...')
for i in PY_MODULE_REMOVE_LINUX:
utils.remove(self.modules_path, '{}.cpython-{}m-x86_64-linux-gnu.so'.format(i, ctx.py_ver))
ext = utils.extension_suffixes()
files = os.listdir(self.modules_path)
for i in files:
for n in ext:
if i.find('_failed{}'.format(n)) != -1:
utils.remove(self.modules_path, i)
def _make_py_ver_file(self):
# do nothing.

View File

@ -30,15 +30,19 @@ class Builder:
if l.startswith('TP_SERVER '):
x = l.split(' ')
self.VER_TP_SERVER = x[1].strip()
# self.VER_TP_SERVER += '.0'
elif l.startswith('TP_TPCORE '):
x = l.split(' ')
self.VER_TP_TPCORE = x[1].strip()
# self.VER_TP_TPCORE += '.0'
elif l.startswith('TP_TPWEB '):
x = l.split(' ')
self.VER_TP_TPWEB = x[1].strip()
# self.VER_TP_TPWEB += '.0'
elif l.startswith('TP_ASSIST '):
x = l.split(' ')
self.VER_TP_ASSIST = x[1].strip()
# self.VER_TP_ASSIST += '.0'
cc.v('new version:')
cc.v(' Server : ', self.VER_TP_SERVER)
@ -182,7 +186,10 @@ class Builder:
""" update rc file version info """
t_ver = ver.split('.')
if len(t_ver) != 4:
while len(t_ver) < 4:
t_ver.append('0')
if len(t_ver) > 4:
raise RuntimeError('Invalid version for .rc file.')
bOK = False
@ -292,7 +299,10 @@ class Builder:
def _update_ver_nsi(self, nsiFilePath, ver):
""" update nsis file version info """
t_ver = ver.split('.')
if len(t_ver) != 4:
while len(t_ver) < 4:
t_ver.append('0')
if len(t_ver) > 4:
raise RuntimeError('Invalid version for nsis file.')
bOK = False
@ -365,7 +375,7 @@ class Builder:
def _update_ver_plist(self, plist_file, ver):
""" update plist file version info for MacOS app."""
t_ver = ver.split('.')
if len(t_ver) != 4:
if len(t_ver) < 3:
raise RuntimeError('Invalid version for plist file.')
bOK = False

View File

@ -1,3 +1,3 @@
# -*- coding: utf8 -*-
VER_TP_SERVER = "3.1.0.10"
VER_TP_ASSIST = "3.0.1.6"
VER_TP_SERVER = "3.1.0"
VER_TP_ASSIST = "3.1.0"

View File

@ -1,6 +1,6 @@
#ifndef __TS_ASSIST_VER_H__
#define __TS_ASSIST_VER_H__
#define TP_ASSIST_VER L"3.0.1.6"
#endif // __TS_ASSIST_VER_H__
#ifndef __TS_ASSIST_VER_H__
#define __TS_ASSIST_VER_H__
#define TP_ASSIST_VER L"3.1.0"
#endif // __TS_ASSIST_VER_H__

View File

@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.0.1.6</string>
<string>3.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>3.0.1.6</string>
<string>3.1.0</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>

Binary file not shown.

View File

@ -1,6 +1,6 @@
#ifndef __TS_ASSIST_VER_H__
#define __TS_ASSIST_VER_H__
#define TP_ASSIST_VER L"3.0.1.6"
#endif // __TS_ASSIST_VER_H__
#ifndef __TS_ASSIST_VER_H__
#define __TS_ASSIST_VER_H__
#define TP_ASSIST_VER L"3.1.0"
#endif // __TS_ASSIST_VER_H__

Binary file not shown.

View File

@ -179,7 +179,7 @@ _struct _struct.c # binary structure packing/unpacking
_weakref _weakref.c # basic weak reference support
#_testcapi _testcapimodule.c # Python C API test module
_random _randommodule.c # Random number generator
#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
_pickle _pickle.c # pickle accelerator
_datetime _datetimemodule.c # datetime accelerator
_bisect _bisectmodule.c # Bisection algorithms
@ -373,16 +373,13 @@ _codecs_tw cjkcodecs/_codecs_tw.c
########################################################################
# add extra-module by apex.
# add extra-builtin-module by Apex Liu.
########################################################################
zlib zlibmodule.c -I$(srcdir)/Modules/zlib \
zlib/adler32.c zlib/crc32.c zlib/deflate.c zlib/infback.c zlib/inffast.c zlib/inflate.c zlib/inftrees.c zlib/trees.c zlib/zutil.c \
zlib/compress.c zlib/uncompr.c zlib/gzclose.c zlib/gzlib.c zlib/gzread.c zlib/gzwrite.c
#_psutil_linux psutil/_psutil_linux.c
#_psutil_posix psutil/_psutil_posix.c
_json _json.c
_sqlite3 -I$(srcdir)/Modules/_sqlite/sqlite3 -I$(srcdir)/Modules/_sqlite \
@ -390,11 +387,6 @@ _sqlite3 -I$(srcdir)/Modules/_sqlite/sqlite3 -I$(srcdir)/Modules/_sqlite \
_sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c \
_sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c
# EXTRA_CFLAGS=-DMODULE_NAME='"sqlite3"' -DPSUTIL_VERSION=420
#EXTRA_CFLAGS=-DPSUTIL_VERSION=420
# Uncommenting the following line tells makesetup that all following modules
# are not built (see above for more detail).
#
@ -402,3 +394,7 @@ _sqlite3 -I$(srcdir)/Modules/_sqlite/sqlite3 -I$(srcdir)/Modules/_sqlite \
#
#_sqlite3 _tkinter _curses pyexpat
#_codecs_jp _codecs_kr _codecs_tw unicodedata
*disabled*
_tkinter _curses

View File

@ -0,0 +1,75 @@
/* cache.h - definitions for the LRU cache
*
* Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
#ifndef PYSQLITE_CACHE_H
#define PYSQLITE_CACHE_H
#include "Python.h"
#define MODULE_NAME "sqlite3"
/* The LRU cache is implemented as a combination of a doubly-linked with a
* dictionary. The list items are of type 'Node' and the dictionary has the
* nodes as values. */
typedef struct _pysqlite_Node
{
PyObject_HEAD
PyObject* key;
PyObject* data;
long count;
struct _pysqlite_Node* prev;
struct _pysqlite_Node* next;
} pysqlite_Node;
typedef struct
{
PyObject_HEAD
int size;
/* a dictionary mapping keys to Node entries */
PyObject* mapping;
/* the factory callable */
PyObject* factory;
pysqlite_Node* first;
pysqlite_Node* last;
/* if set, decrement the factory function when the Cache is deallocated.
* this is almost always desirable, but not in the pysqlite context */
int decref_factory;
} pysqlite_Cache;
extern PyTypeObject pysqlite_NodeType;
extern PyTypeObject pysqlite_CacheType;
int pysqlite_node_init(pysqlite_Node* self, PyObject* args, PyObject* kwargs);
void pysqlite_node_dealloc(pysqlite_Node* self);
int pysqlite_cache_init(pysqlite_Cache* self, PyObject* args, PyObject* kwargs);
void pysqlite_cache_dealloc(pysqlite_Cache* self);
PyObject* pysqlite_cache_get(pysqlite_Cache* self, PyObject* args);
int pysqlite_cache_setup_types(void);
#endif

View File

@ -0,0 +1,43 @@
/* prepare_protocol.h - the protocol for preparing values for SQLite
*
* Copyright (C) 2005-2010 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
#ifndef PYSQLITE_PREPARE_PROTOCOL_H
#define PYSQLITE_PREPARE_PROTOCOL_H
#include "Python.h"
#define MODULE_NAME "sqlite3"
typedef struct
{
PyObject_HEAD
} pysqlite_PrepareProtocol;
extern PyTypeObject pysqlite_PrepareProtocolType;
int pysqlite_prepare_protocol_init(pysqlite_PrepareProtocol* self, PyObject* args, PyObject* kwargs);
void pysqlite_prepare_protocol_dealloc(pysqlite_PrepareProtocol* self);
int pysqlite_prepare_protocol_setup_types(void);
#define UNKNOWN (-1)
#endif

Binary file not shown.

View File

@ -1,6 +1,6 @@
#ifndef __TS_SERVER_VER_H__
#define __TS_SERVER_VER_H__
#define TP_SERVER_VER L"3.0.4.16"
#define TP_SERVER_VER L"3.1.0"
#endif // __TS_SERVER_VER_H__

Binary file not shown.

View File

@ -1,6 +1,6 @@
#ifndef __TS_SERVER_VER_H__
#define __TS_SERVER_VER_H__
#define TP_SERVER_VER L"3.1.0.10"
#define TP_SERVER_VER L"3.1.0"
#endif // __TS_SERVER_VER_H__

View File

@ -1,2 +1,2 @@
# -*- coding: utf8 -*-
TP_SERVER_VER = "3.1.0.10"
TP_SERVER_VER = "3.1.0"

View File

@ -1,19 +1,17 @@
版本号说明Major.Minor.Revision.Build
例如:2.12.1027.7
例如:3.1.0
Major 主版本号。不同主版本号的程序集不可互换。
例如,这适用于对产品的大量重写,这些重写使得无法实现向后兼容性。
Major: 主版本号。不同主版本号的程序集不可互换。
例如,这适用于对产品的大量重写,这些重写使得无法实现向后兼容性。
Minor 次版本号。如果两个程序集的名称和主版本号相同,而次版本号不同,这指示显著增强,但照顾到了向后兼容性。
例如,这适用于产品的修正版或完全向后兼容的新版本,但不保证可以降级使用。
Minor: 次版本号。如果两个程序集的名称和主版本号相同,而次版本号不同,这指示显著增强,但照顾到了向后兼容性。
例如,这适用于产品的修正版或完全向后兼容的新版本,但不保证可以降级使用。
Revision 修订号。主版本号和次版本号都相同但修订号不同的程序集应是完全可互换的。
这适用于修复以前发布的程序集中的错误或安全漏洞。修订号总是递增的,是唯一的。
Revision: 修订号。主版本号和次版本号都相同但修订号不同的程序集应是完全可互换的。
这适用于修复以前发布的程序集中的错误或安全漏洞。
Build 构建号。构建号用于表明此版本发布之前进行了多少次构建及测试。某些情况下此版本号可以省略。
TP_SERVER 3.1.0 # 整个服务端打包的版本
TP_TPCORE 3.1.0 # 核心服务 tp_core 的版本
TP_TPWEB 3.1.0 # web服务 tp_web 的版本一般除非升级Python否则不会变化
TP_ASSIST 3.1.0 # 助手版本
TP_SERVER 3.1.0.10 # 整个服务端打包的版本
TP_TPCORE 3.0.4.16 # 核心服务 tp_core 的版本
TP_TPWEB 3.1.0.10 # web服务 tp_web 的版本一般除非升级Python否则不会变化
TP_ASSIST 3.0.1.6 # 助手版本