Implemented configure --enable-pic flag to build the main lib with position-independant objects.

This avoids having to edit localdefs by hand to build the new php extension,
and voids the need for the Python module to recompile Recoll source files.
This commit is contained in:
Jean-Francois Dockes
2010-01-29 17:22:31 +01:00
parent 7ef5e08f70
commit 74be06345a
10 changed files with 227 additions and 187 deletions
+9 -5
View File
@@ -93,6 +93,10 @@ for c in $SRC_CC;do
DEPS="$DEPS $s"
done
# The objects need to depend on the localdefs file in case it is
# changed by a re-configure (it has the local compile flags)
defs=\$\(depth\)/mk/localdefs
test -f $mk && chmod +w $mk
cat > $mk <<EOF
@@ -111,18 +115,18 @@ librcl.a : \$(DEPS) \$(OBJS) unac.o
ar ru librcl.a \$(OBJS) unac.o
\$(RANLIB) librcl.a
unac.o : \$(depth)/unac/unac.c \$(depth)/unac/unac.h
unac.o : \$(depth)/unac/unac.c \$(depth)/unac/unac.h $
\$(CC) \$(ALL_CXXFLAGS) -c \$(depth)/unac/unac.c
EOF
for c in $SRC_CPP;do
o=`basename $c .cpp`.o
echo "$o : $c" >> $mk
echo "$o : $c $defs" >> $mk
echo " \$(CXX) \$(ALL_CXXFLAGS) -c $c" >> $mk
done
for c in $SRC_CC;do
o=`basename $c .cc`.o
echo "$o : $c" >> $mk
echo "$o : $c $defs" >> $mk
echo " \$(CXX) \$(ALL_CXXFLAGS) -c $c" >> $mk
done
@@ -138,7 +142,7 @@ EOF
for c in $SRC_CPP;do
d=`basename $c .cpp`.dep
s=`basename $c .cpp`.dep.stamp
echo "$s : $c" >> $mk
echo "$s : $c $defs" >> $mk
echo " \$(CXX) -M \$(ALL_CXXFLAGS) $c > $d" >> $mk
echo " touch $s" >> $mk
done
@@ -149,7 +153,7 @@ done
for c in $SRC_CC;do
d=`basename $c .cc`.dep
s=`basename $c .cc`.dep.stamp
echo "$s : $c" >> $mk
echo "$s : $c $defs" >> $mk
echo " \$(CXX) -M \$(ALL_CXXFLAGS) $c > $d" >> $mk
echo " touch $s" >> $mk
done