]> arthur.barton.de Git - bup.git/commitdiff
Makefile: build module using python distutils instead of manually.
authorAvery Pennarun <apenwarr@gmail.com>
Sun, 24 Jan 2010 22:44:19 +0000 (17:44 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 24 Jan 2010 22:59:28 +0000 (17:59 -0500)
This makes it work with fink's version of python, among possibly other
things.

So now we can build chashsplit.so even on MacOS X tiger, even though tiger's
python 2.3 is too old, by installing fink's python24 package first.

.gitignore
Makefile
csetup.py [new file with mode: 0644]

index 6c135e3e852993a3b145cf92d5bc427d3ebca356..88644b65598835c20cd63934e63e62a2591669c7 100644 (file)
@@ -13,3 +13,4 @@ tags2[tc]
 out[12]
 out2[tc]
 *.tmp
+/build
index a8f82ff26df50c78d06cf30a908a90b6aaddaab4..9393fb0bc2716d7e913ab498835d10de82cd4439 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,3 @@
-PYINCLUDE:=$(shell python2.5-config --includes)
-PYLIB:=$(shell python2.5-config --lib)
 OS:=$(shell uname | sed 's/[-_].*//')
 MACHINE:=$(shell uname -m)
 CFLAGS=-Wall -g -O2 -Werror $(PYINCLUDE) -g
@@ -27,8 +25,10 @@ all: bup-split bup-join bup-save bup-init bup-server bup-index bup-tick \
 randomgen$(EXT): randomgen.o
        $(CC) $(CFLAGS) -o $@ $<
 
-chashsplit$(SOEXT): chashsplitmodule.o
-       $(CC) $(CFLAGS) $(LDFLAGS) $(SHARED) -o $@ $< $(PYLIB)
+chashsplit$(SOEXT): chashsplitmodule.c csetup.py
+       @rm -f $@
+       python csetup.py build
+       cp build/*/chashsplit.so .
        
 runtests: all runtests-python runtests-cmdline
 
@@ -68,6 +68,6 @@ bup-%: cmd-%.sh
 
 clean:
        rm -f *.o *.so *.dll *.exe *~ .*~ *.pyc */*.pyc */*~ \
-               bup bup-* randomgen \
+               bup bup-* randomgen memtest \
                out[12] out2[tc] tags[12] tags2[tc]
-       rm -rf *.tmp
+       rm -rf *.tmp build
diff --git a/csetup.py b/csetup.py
new file mode 100644 (file)
index 0000000..2590557
--- /dev/null
+++ b/csetup.py
@@ -0,0 +1,8 @@
+from distutils.core import setup, Extension
+
+chashsplit_mod = Extension('chashsplit', sources=['chashsplitmodule.c'])
+
+setup(name='chashsplit',
+      version='0.1',
+      description='hashsplit helper library for bup',
+      ext_modules=[chashsplit_mod])