aboutsummaryrefslogtreecommitdiffstats
path: root/src/build-data/makefile
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-10-09 18:06:06 +0000
committerlloyd <[email protected]>2009-10-09 18:06:06 +0000
commit997e6c97b8ace857d00f9fd57f621ba9323c75df (patch)
treed5b65a4fc28a51a66a64fdf75055aab916c59db7 /src/build-data/makefile
parentc4264a0404cd9b0b9dcba66a2ca157174d934b09 (diff)
Add more or less functional integration with Boost.Python. Use
--use-boost-python to enable creating a second makefile, Makefile.python, which has targets for building and installing the Python module.
Diffstat (limited to 'src/build-data/makefile')
-rw-r--r--src/build-data/makefile/python.in29
-rw-r--r--src/build-data/makefile/unix.in2
-rw-r--r--src/build-data/makefile/unix_shr.in2
3 files changed, 31 insertions, 2 deletions
diff --git a/src/build-data/makefile/python.in b/src/build-data/makefile/python.in
new file mode 100644
index 000000000..ee95f8d78
--- /dev/null
+++ b/src/build-data/makefile/python.in
@@ -0,0 +1,29 @@
+CXX = g++
+
+PYTHON_ROOT = /usr/lib/python%{python_version}/config
+PYTHON_INC = -I/usr/include/python%{python_version}
+PYTHON_SITE_PACKAGE_DIR = /tmp/usr/lib/python%{python_version}/site-packages/
+
+PYTHON_FLAGS = -Isrc/wrap/python -Os -fPIC -ftemplate-depth-255 -Wall -Wno-unused $(PYTHON_INC)
+
+PYTHON_OBJS = %{python_objs}
+
+BOTAN_PYTHON_MODDIR = build/botan-python
+
+all: $(BOTAN_PYTHON_MODDIR)/_botan.so
+
+%{python_build_cmds}
+
+$(BOTAN_PYTHON_MODDIR)/_botan.so: $(PYTHON_OBJS)
+ rm -rf $(BOTAN_PYTHON_MODDIR)
+ mkdir $(BOTAN_PYTHON_MODDIR)
+ cp src/wrap/python/*.py $(BOTAN_PYTHON_MODDIR)
+ $(CXX) -shared -o $@ $(PYTHON_OBJS) -L. -L$(PYTHON_ROOT) -lbotan -lboost_python -Wl,-rpath-link,. -Wl,-soname,$@
+
+clean:
+ rm -f $(PYTHON_OBJS) $(BOTAN_PYTHON_MODDIR)
+
+install:
+ mkdir -p $(PYTHON_SITE_PACKAGE_DIR)/botan
+ cp $(BOTAN_PYTHON_MODDIR)/* $(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 a48a5a17e..8e0e35b87 100644
--- a/src/build-data/makefile/unix.in
+++ b/src/build-data/makefile/unix.in
@@ -101,7 +101,7 @@ clean:
distclean: clean
$(RM_R) %{build_dir}
$(RM_R) %{doc_src_dir}/doxygen %{doc_src_dir}/botan.doxy
- $(RM) Makefile $(CONFIG_SCRIPT) $(PKGCONFIG)
+ $(RM) Makefile* $(CONFIG_SCRIPT) $(PKGCONFIG)
install: $(LIBRARIES)
$(ECHO) "Installing Botan into $(DESTDIR)... "
diff --git a/src/build-data/makefile/unix_shr.in b/src/build-data/makefile/unix_shr.in
index f718d1160..cfc8e3223 100644
--- a/src/build-data/makefile/unix_shr.in
+++ b/src/build-data/makefile/unix_shr.in
@@ -115,7 +115,7 @@ clean:
distclean: clean
$(RM_R) %{build_dir}
$(RM_R) %{doc_src_dir}/doxygen %{doc_src_dir}/botan.doxy
- $(RM) Makefile $(CONFIG_SCRIPT) $(PKGCONFIG)
+ $(RM) Makefile* $(CONFIG_SCRIPT) $(PKGCONFIG)
install: $(LIBRARIES)
$(ECHO) "Installing Botan into $(DESTDIR)... "