git » libjio » commit c3c425b

Fix Python setup.py so that it uses the "new" build directory

author Alberto Bertogli
2011-02-22 23:52:56 UTC
committer Alberto Bertogli
2011-02-22 23:52:56 UTC
parent 8fe1ddfcf95efdab6075716978ef813fb0a166e6

Fix Python setup.py so that it uses the "new" build directory

Python's setup.py was looking for the library (for build purposes) in the
libjio directory, instead of libjio/build where it should reside.

This broke the Python build, but went unnoticed because in all my repositories
I had (purely by chance) a shared library in the libjio directory.

This commit fixes this by making it look in the appropriate place, and also
making libjio/Makefile to create a link to the library with the soname, so the
Python interpreter can find the library (we don't need to install it because
ldconfig will take care of creating it).

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

bindings/python/setup.py +1 -1
libjio/Makefile +2 -0

diff --git a/bindings/python/setup.py b/bindings/python/setup.py
index 78ba462..2c7f216 100644
--- a/bindings/python/setup.py
+++ b/bindings/python/setup.py
@@ -15,7 +15,7 @@ libjio = Extension("libjio",
 		# these two allow us to build without having libjio installed,
 		# assuming we're in the libjio source tree
 		include_dirs = ['../../libjio/'],
-		library_dirs=['../../libjio/']
+		library_dirs=['../../libjio/build/']
 	)
 
 setup(
diff --git a/libjio/Makefile b/libjio/Makefile
index c17eaae..a0f33a6 100644
--- a/libjio/Makefile
+++ b/libjio/Makefile
@@ -99,6 +99,7 @@ $O/libjio.so: $O/build-flags $(OBJS)
 		$(LIBS) $(OBJS) -o $O/libjio.so.$(LIB_VER)
 	@echo "  LN  libjio.so.$(LIB_VER)"
 	@ln -fs libjio.so.$(LIB_VER) $O/libjio.so
+	@ln -fs libjio.so.$(LIB_VER) $O/libjio.so.$(LIB_SO_VER)
 
 $O/libjio.a: $O/build-flags $(OBJS)
 	$(N_AR) cr $@ $(OBJS)
@@ -137,6 +138,7 @@ doxygen:
 
 clean:
 	rm -f $O/libjio.a $O/libjio.so $O/libjio.so.$(LIB_VER) $O/libjio.pc
+	rm -f $O/libjio.so.$(LIB_SO_VER)
 	rm -f $(OBJS) $O/jiofsck.o $O/jiofsck
 	rm -f $O/*.bb $O/*.bbg $O/*.da $O/*.gcov $O/*.gcno $O/*.gcda $O/gmon.out
 	rm -f $O/build-flags $O/*.o.mak