From c3c425bdfa3184eac6344882f085c63c0a3bf48b Mon Sep 17 00:00:00 2001
From: Alberto Bertogli <albertito@blitiri.com.ar>
Date: Tue, 22 Feb 2011 23:52:56 +0000
Subject: [PATCH 05/24] 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 |    2 +-
 libjio/Makefile          |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

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
-- 
1.6.2.2.646.gb214

