diff options
author | lloyd <[email protected]> | 2014-01-07 00:30:03 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-01-07 00:30:03 +0000 |
commit | 52d3fd79aac9decf6cb0ef617e7638abe7ebd053 (patch) | |
tree | cdc9079db267ff5eea72f609cbd82f9985c631bc | |
parent | 76efeb142e5da153bd6d98939754f714a5ecd550 (diff) |
Move python to src, add to main makefile
-rwxr-xr-x | configure.py | 34 | ||||
-rw-r--r-- | doc/building.rst | 23 | ||||
-rw-r--r-- | src/build-data/makefile/python.in | 18 | ||||
-rw-r--r-- | src/build-data/makefile/unix.in | 4 | ||||
-rw-r--r-- | src/build-data/makefile/unix_shr.in | 13 | ||||
-rw-r--r-- | src/contrib/perl-xs/Botan.pm (renamed from lib/wrap/perl-xs/Botan.pm) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/Botan.xs (renamed from lib/wrap/perl-xs/Botan.xs) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/Changes (renamed from lib/wrap/perl-xs/Changes) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/MANIFEST (renamed from lib/wrap/perl-xs/MANIFEST) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/Makefile.PL (renamed from lib/wrap/perl-xs/Makefile.PL) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/data/ca.cert.der (renamed from lib/wrap/perl-xs/data/ca.cert.der) | bin | 712 -> 712 bytes | |||
-rw-r--r-- | src/contrib/perl-xs/data/ca.cert.pem (renamed from lib/wrap/perl-xs/data/ca.cert.pem) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/t/base64.t (renamed from lib/wrap/perl-xs/t/base64.t) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/t/filt.t (renamed from lib/wrap/perl-xs/t/filt.t) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/t/hex.t (renamed from lib/wrap/perl-xs/t/hex.t) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/t/oid.t (renamed from lib/wrap/perl-xs/t/oid.t) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/t/pipe.t (renamed from lib/wrap/perl-xs/t/pipe.t) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/t/testutl.pl (renamed from lib/wrap/perl-xs/t/testutl.pl) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/t/x509cert.t (renamed from lib/wrap/perl-xs/t/x509cert.t) | 0 | ||||
-rw-r--r-- | src/contrib/perl-xs/typemap (renamed from lib/wrap/perl-xs/typemap) | 0 | ||||
-rw-r--r-- | src/contrib/sqlite/codec.cpp (renamed from lib/wrap/sqlite/codec.cpp) | 0 | ||||
-rw-r--r-- | src/contrib/sqlite/codec.h (renamed from lib/wrap/sqlite/codec.h) | 0 | ||||
-rw-r--r-- | src/contrib/sqlite/codec_c_interface.h (renamed from lib/wrap/sqlite/codec_c_interface.h) | 0 | ||||
-rw-r--r-- | src/contrib/sqlite/codecext.c (renamed from lib/wrap/sqlite/codecext.c) | 0 | ||||
-rw-r--r-- | src/contrib/sqlite/readme.txt (renamed from lib/wrap/sqlite/readme.txt) | 0 | ||||
-rw-r--r-- | src/contrib/sqlite/sqlite3-amalgamation.patch (renamed from lib/wrap/sqlite/sqlite3-amalgamation.patch) | 0 | ||||
-rw-r--r-- | src/contrib/sqlite/test_sqlite.cpp (renamed from lib/wrap/sqlite/test_sqlite.cpp) | 0 | ||||
-rw-r--r-- | src/python/__init__.py (renamed from lib/wrap/python/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/core.cpp (renamed from lib/wrap/python/core.cpp) | 0 | ||||
-rw-r--r-- | src/python/filter.cpp (renamed from lib/wrap/python/filter.cpp) | 0 | ||||
-rw-r--r-- | src/python/python_botan.h (renamed from lib/wrap/python/python_botan.h) | 0 | ||||
-rw-r--r-- | src/python/rsa.cpp (renamed from lib/wrap/python/rsa.cpp) | 0 | ||||
-rw-r--r-- | src/python/x509.cpp (renamed from lib/wrap/python/x509.cpp) | 0 |
33 files changed, 40 insertions, 52 deletions
diff --git a/configure.py b/configure.py index b6ab6e814..0874220e4 100755 --- a/configure.py +++ b/configure.py @@ -135,25 +135,24 @@ class BuildConfigurationInformation(object): self.public_headers = sorted(flatten([m.public_headers() for m in modules])) - self.apps_dir = os.path.join(options.base_dir, 'src/') + self.apps_dir = os.path.join(options.base_dir, 'src') - def find_sources_in(srcdir): - for (dirpath, dirnames, filenames) in os.walk(srcdir): - for filename in filenames: - if filename.endswith('.cpp'): - yield os.path.join(dirpath, filename) + def find_sources_in(basedir, srcdirs): + for srcdir in srcdirs: + for (dirpath, dirnames, filenames) in os.walk(os.path.join(basedir, srcdir)): + for filename in filenames: + if filename.endswith('.cpp'): + yield os.path.join(dirpath, filename) + + self.app_sources = [os.path.join(self.apps_dir, 'main.cpp')] + \ + list(find_sources_in(self.apps_dir, ['apps', 'tests'])) - self.app_sources = list(find_sources_in(self.apps_dir)) + self.python_sources = list(find_sources_in(self.apps_dir, ['python'])) self.boost_python = options.boost_python - self.python_dir = os.path.join(options.lib_dir, 'wrap', 'python') + self.python_dir = os.path.join(options.src_dir, 'python') self.pyobject_dir = os.path.join(self.build_dir, 'python') - self.python_sources = sorted( - [os.path.join(self.python_dir, file) - for file in os.listdir(self.python_dir) - if file.endswith('.cpp')]) - self.manual_dir = os.path.join(self. doc_output_dir, 'manual') def build_doc_commands(): @@ -1125,7 +1124,7 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo): logging.warn('Unknown arch in innosetup_arch %s' % (arch)) return None - return { + vars = { 'version_major': build_config.version_major, 'version_minor': build_config.version_minor, 'version_patch': build_config.version_patch, @@ -1245,6 +1244,10 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo): 'python_version': options.python_version } + vars["python_makefile"] = process_template('src/build-data/makefile/python.in', vars) + + return vars + """ Determine which modules to load based on options, target, etc """ @@ -1511,9 +1514,6 @@ def setup_build(build_config, options, template_vars): if options.os == 'windows': yield (options.build_data, 'innosetup.in', 'botan.iss') - if options.boost_python: - yield (options.makefile_dir, 'python.in', 'Makefile.python') - for (template_dir, template, sink) in templates_to_use(): source = os.path.join(template_dir, template) if template_dir == options.build_data: diff --git a/doc/building.rst b/doc/building.rst index a2ac46840..07f6383f9 100644 --- a/doc/building.rst +++ b/doc/building.rst @@ -132,7 +132,7 @@ not support ``LD_LIBRARY_PATH``. Thomas Keller suggests instead running ``install_name_tool`` between building and running the self-test program:: - $ VERSION=1.10.0 # or whatever the current version is + $ VERSION=1.11.11 # or whatever the current version is $ install_name_tool -change $(otool -X -D libbotan-$VERSION.dylib) \ $PWD/libbotan-$VERSION.dylib check @@ -409,11 +409,11 @@ Botan also by default installs a file for ``pkg-config``, namespaced by the major and minor versions. So it can be used, for instance, as:: - $ pkg-config botan-1.10 --modversion - 1.10.0 - $ pkg-config botan-1.10 --cflags + $ pkg-config botan-1.11 --modversion + 1.11.0 + $ pkg-config botan-1.11 --cflags -I/usr/local/include - $ pkg-config botan-1.10 --libs + $ pkg-config botan-1.11 --libs -L/usr/local/lib -lbotan -lm -lbz2 -lpthread -lrt MS Windows @@ -433,17 +433,10 @@ Building the Python wrappers The Python wrappers for Botan use Boost.Python, so you must have Boost installed. To build the wrappers, pass the flag -``--with-boost-python`` to ``configure.py``. This will create a second -makefile, ``Makefile.python``, with instructions for building the -Python module. After building the library, execute:: +``--with-boost-python`` to ``configure.py`` and build the ``python`` +target with ``make``. - $ make -f Makefile.python - -to build the module. Currently only Unix systems are supported, and -the Makefile assumes that the version of Python you want to build -against is the same one you used to run ``configure.py``. - -To install the module, use the ``install`` target. +To install the module, use the ``install_python`` target. See :doc:`Python Bindings <python>` for more information about the binding. diff --git a/src/build-data/makefile/python.in b/src/build-data/makefile/python.in index 17d1015d2..5b1d2379d 100644 --- a/src/build-data/makefile/python.in +++ b/src/build-data/makefile/python.in @@ -1,9 +1,3 @@ -CXX = %{cc} -CFLAGS = -Os %{lang_flags} -LDFLAGS = -WARN_FLAGS = -Wall -Wextra - -SERIES = %{version_major}.%{version_minor} PYTHON_ROOT = /usr/lib/python%{python_version}/config PYTHON_INC = -I/usr/include/python%{python_version} @@ -15,19 +9,17 @@ BOTAN_PYTHON_MODDIR = %{python_obj_dir} PYTHON_OBJS = %{python_objs} -all: $(BOTAN_PYTHON_MODDIR)/_botan.so +python: $(BOTAN_PYTHON_MODDIR)/_botan.so + +PYTHON_FLAGS = $(LANG_FLAGS) $(WARN_FLAGS) $(SO_OBJ_FLAGS) -Os -ftemplate-depth=255 $(PYTHON_INC) -Wno-error %{python_build_cmds} $(BOTAN_PYTHON_MODDIR)/_botan.so: $(PYTHON_OBJS) cp %{python_dir}/*.py $(BOTAN_PYTHON_MODDIR) - $(CXX) -shared -Wl,-soname,$@ $(PYTHON_OBJS) -L. -L$(PYTHON_ROOT) $(LDFLAGS) -lbotan-$(SERIES) -lboost_python -o $@ - -clean: - rm -rf $(BOTAN_PYTHON_MODDIR)/* - rm -f $(PYTHON_OBJS) + $(CXX) -shared -Wl,-soname,$@ $(PYTHON_OBJS) -L. -L$(PYTHON_ROOT) $(LDFLAGS) -lbotan-$(SERIES) -lboost_python-%{python_version} -o $@ -install: +install_python: mkdir -p $(PYTHON_SITE_PACKAGE_DIR)/botan cp $(BOTAN_PYTHON_MODDIR)/_botan.so $(BOTAN_PYTHON_MODDIR)/*.py $(PYTHON_SITE_PACKAGE_DIR)/botan chmod -R u=rwX,go=rX $(PYTHON_SITE_PACKAGE_DIR)/botan diff --git a/src/build-data/makefile/unix.in b/src/build-data/makefile/unix.in index bdf8a98bf..a32cd30b3 100644 --- a/src/build-data/makefile/unix.in +++ b/src/build-data/makefile/unix.in @@ -1,7 +1,7 @@ # Compiler Options CXX = %{cc} LIB_OPT = %{lib_opt} -APP_OPT = %{app_opt} +APP_OPT = %{app_opt} LANG_FLAGS = %{lang_flags} WARN_FLAGS = %{warn_flags} LINK_TO = %{link_to} @@ -71,6 +71,8 @@ $(STATIC_LIB): $(LIBOBJS) $(AR) $(STATIC_LIB) $(LIBOBJS) $(RANLIB) $(STATIC_LIB) +%{python_makefile} + # Fake Targets .PHONY = docs clean distclean install static diff --git a/src/build-data/makefile/unix_shr.in b/src/build-data/makefile/unix_shr.in index ccbbd6706..cf4fd7fec 100644 --- a/src/build-data/makefile/unix_shr.in +++ b/src/build-data/makefile/unix_shr.in @@ -1,7 +1,7 @@ # Compiler Options CXX = %{cc} LIB_OPT = %{lib_opt} -APP_OPT = %{app_opt} +APP_OPT = %{app_opt} LANG_FLAGS = %{lang_flags} WARN_FLAGS = %{warn_flags} SO_OBJ_FLAGS = %{shared_flags} @@ -49,11 +49,6 @@ LIBRARIES = $(STATIC_LIB) $(SHARED_LIB) LIBNAME = %{lib_prefix}libbotan STATIC_LIB = $(LIBNAME)-$(SERIES).a -SONAME = $(LIBNAME)-$(SERIES).%{so_suffix}.%{so_abi_rev} -SHARED_LIB = $(SONAME).%{version_patch} - -SYMLINK = $(LIBNAME)-$(SERIES).%{so_suffix} - all: $(APP) # File Lists @@ -77,11 +72,17 @@ $(STATIC_LIB): $(LIBOBJS) $(AR) $(STATIC_LIB) $(LIBOBJS) $(RANLIB) $(STATIC_LIB) +SONAME = $(LIBNAME)-$(SERIES).%{so_suffix}.%{so_abi_rev} +SHARED_LIB = $(SONAME).%{version_patch} +SYMLINK = $(LIBNAME)-$(SERIES).%{so_suffix} + $(SHARED_LIB): $(LIBOBJS) $(SO_LINK_CMD) $(LDFLAGS) $(LIBOBJS) -o $(SHARED_LIB) $(LINK_TO) $(LN) $(SHARED_LIB) $(SONAME) $(LN) $(SHARED_LIB) $(SYMLINK) +%{python_makefile} + # Fake Targets .PHONY = docs clean distclean install static shared diff --git a/lib/wrap/perl-xs/Botan.pm b/src/contrib/perl-xs/Botan.pm index ac4ad91fb..ac4ad91fb 100644 --- a/lib/wrap/perl-xs/Botan.pm +++ b/src/contrib/perl-xs/Botan.pm diff --git a/lib/wrap/perl-xs/Botan.xs b/src/contrib/perl-xs/Botan.xs index 135da0d5d..135da0d5d 100644 --- a/lib/wrap/perl-xs/Botan.xs +++ b/src/contrib/perl-xs/Botan.xs diff --git a/lib/wrap/perl-xs/Changes b/src/contrib/perl-xs/Changes index 5f32b0c63..5f32b0c63 100644 --- a/lib/wrap/perl-xs/Changes +++ b/src/contrib/perl-xs/Changes diff --git a/lib/wrap/perl-xs/MANIFEST b/src/contrib/perl-xs/MANIFEST index b9d8454d6..b9d8454d6 100644 --- a/lib/wrap/perl-xs/MANIFEST +++ b/src/contrib/perl-xs/MANIFEST diff --git a/lib/wrap/perl-xs/Makefile.PL b/src/contrib/perl-xs/Makefile.PL index 5a3276aec..5a3276aec 100644 --- a/lib/wrap/perl-xs/Makefile.PL +++ b/src/contrib/perl-xs/Makefile.PL diff --git a/lib/wrap/perl-xs/data/ca.cert.der b/src/contrib/perl-xs/data/ca.cert.der Binary files differindex d6ed8aeaf..d6ed8aeaf 100644 --- a/lib/wrap/perl-xs/data/ca.cert.der +++ b/src/contrib/perl-xs/data/ca.cert.der diff --git a/lib/wrap/perl-xs/data/ca.cert.pem b/src/contrib/perl-xs/data/ca.cert.pem index 012913b26..012913b26 100644 --- a/lib/wrap/perl-xs/data/ca.cert.pem +++ b/src/contrib/perl-xs/data/ca.cert.pem diff --git a/lib/wrap/perl-xs/t/base64.t b/src/contrib/perl-xs/t/base64.t index f0973e13e..f0973e13e 100644 --- a/lib/wrap/perl-xs/t/base64.t +++ b/src/contrib/perl-xs/t/base64.t diff --git a/lib/wrap/perl-xs/t/filt.t b/src/contrib/perl-xs/t/filt.t index 2a7b4c8ba..2a7b4c8ba 100644 --- a/lib/wrap/perl-xs/t/filt.t +++ b/src/contrib/perl-xs/t/filt.t diff --git a/lib/wrap/perl-xs/t/hex.t b/src/contrib/perl-xs/t/hex.t index 6f447b25c..6f447b25c 100644 --- a/lib/wrap/perl-xs/t/hex.t +++ b/src/contrib/perl-xs/t/hex.t diff --git a/lib/wrap/perl-xs/t/oid.t b/src/contrib/perl-xs/t/oid.t index 66204541f..66204541f 100644 --- a/lib/wrap/perl-xs/t/oid.t +++ b/src/contrib/perl-xs/t/oid.t diff --git a/lib/wrap/perl-xs/t/pipe.t b/src/contrib/perl-xs/t/pipe.t index f850d8519..f850d8519 100644 --- a/lib/wrap/perl-xs/t/pipe.t +++ b/src/contrib/perl-xs/t/pipe.t diff --git a/lib/wrap/perl-xs/t/testutl.pl b/src/contrib/perl-xs/t/testutl.pl index add6f6a45..add6f6a45 100644 --- a/lib/wrap/perl-xs/t/testutl.pl +++ b/src/contrib/perl-xs/t/testutl.pl diff --git a/lib/wrap/perl-xs/t/x509cert.t b/src/contrib/perl-xs/t/x509cert.t index 2a943aeac..2a943aeac 100644 --- a/lib/wrap/perl-xs/t/x509cert.t +++ b/src/contrib/perl-xs/t/x509cert.t diff --git a/lib/wrap/perl-xs/typemap b/src/contrib/perl-xs/typemap index d7403d40d..d7403d40d 100644 --- a/lib/wrap/perl-xs/typemap +++ b/src/contrib/perl-xs/typemap diff --git a/lib/wrap/sqlite/codec.cpp b/src/contrib/sqlite/codec.cpp index 70519ccfa..70519ccfa 100644 --- a/lib/wrap/sqlite/codec.cpp +++ b/src/contrib/sqlite/codec.cpp diff --git a/lib/wrap/sqlite/codec.h b/src/contrib/sqlite/codec.h index 2f94bcc59..2f94bcc59 100644 --- a/lib/wrap/sqlite/codec.h +++ b/src/contrib/sqlite/codec.h diff --git a/lib/wrap/sqlite/codec_c_interface.h b/src/contrib/sqlite/codec_c_interface.h index 1d8c8706f..1d8c8706f 100644 --- a/lib/wrap/sqlite/codec_c_interface.h +++ b/src/contrib/sqlite/codec_c_interface.h diff --git a/lib/wrap/sqlite/codecext.c b/src/contrib/sqlite/codecext.c index e32d60dc2..e32d60dc2 100644 --- a/lib/wrap/sqlite/codecext.c +++ b/src/contrib/sqlite/codecext.c diff --git a/lib/wrap/sqlite/readme.txt b/src/contrib/sqlite/readme.txt index 4971fd44b..4971fd44b 100644 --- a/lib/wrap/sqlite/readme.txt +++ b/src/contrib/sqlite/readme.txt diff --git a/lib/wrap/sqlite/sqlite3-amalgamation.patch b/src/contrib/sqlite/sqlite3-amalgamation.patch index 1c2a5c69d..1c2a5c69d 100644 --- a/lib/wrap/sqlite/sqlite3-amalgamation.patch +++ b/src/contrib/sqlite/sqlite3-amalgamation.patch diff --git a/lib/wrap/sqlite/test_sqlite.cpp b/src/contrib/sqlite/test_sqlite.cpp index a516fd82b..a516fd82b 100644 --- a/lib/wrap/sqlite/test_sqlite.cpp +++ b/src/contrib/sqlite/test_sqlite.cpp diff --git a/lib/wrap/python/__init__.py b/src/python/__init__.py index 2df9a456f..2df9a456f 100644 --- a/lib/wrap/python/__init__.py +++ b/src/python/__init__.py diff --git a/lib/wrap/python/core.cpp b/src/python/core.cpp index 6dcceee74..6dcceee74 100644 --- a/lib/wrap/python/core.cpp +++ b/src/python/core.cpp diff --git a/lib/wrap/python/filter.cpp b/src/python/filter.cpp index e329ed708..e329ed708 100644 --- a/lib/wrap/python/filter.cpp +++ b/src/python/filter.cpp diff --git a/lib/wrap/python/python_botan.h b/src/python/python_botan.h index 501f4b9eb..501f4b9eb 100644 --- a/lib/wrap/python/python_botan.h +++ b/src/python/python_botan.h diff --git a/lib/wrap/python/rsa.cpp b/src/python/rsa.cpp index 770082945..770082945 100644 --- a/lib/wrap/python/rsa.cpp +++ b/src/python/rsa.cpp diff --git a/lib/wrap/python/x509.cpp b/src/python/x509.cpp index 57beb7e4a..57beb7e4a 100644 --- a/lib/wrap/python/x509.cpp +++ b/src/python/x509.cpp |