Commit d2f7f117 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

Use dynamic lib for shared recoll code

parent 5725194a
......@@ -75,10 +75,12 @@ src/index/alldeps.stamp
src/index/recollindex
src/kde/kioslave/kio_recoll/builddir
src/lib/alldeps
src/lib/librcl.a
src/lib/librecoll.a
src/lib/librecoll.so*
src/mk/localdefs
src/mk/sysconf
src/python/recoll/build
src/python/recoll/recoll/__init__.pyc
src/python/recoll/setup.py
src/python/samples/recollgui/rclmain.py
src/python/samples/recollgui/rclmain.pyc
......
......@@ -17,7 +17,7 @@ all: mk/sysconf
@NOQTMAKE@(cd $(QTGUI); ${QMAKE} recoll.pro)
@NOQTMAKE@${MAKE} -C $(QTGUI) depth=..
@NOPYTHON@${MAKE} -C python/recoll
${MAKE} -C query recollq
${MAKE} -C query recollq xadump
mk/sysconf:
@echo "You need to run configure first" ; exit 1
......
......@@ -4,28 +4,16 @@ include $(depth)/mk/sysconf
PROGS = rclaspell
SRCS = rclaspell.cpp
all: depend $(BIGLIB) $(PROGS)
all: depend $(PROGS) librecoll
RCLASPELL_OBJS= trrclaspell.o $(BIGLIB)
RCLASPELL_OBJS= trrclaspell.o
rclaspell : $(RCLASPELL_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o rclaspell $(RCLASPELL_OBJS) \
$(LIBXAPIAN) $(LIBICONV)
$(LIBRECOLL) $(LIBXAPIAN) $(LIBICONV)
trrclaspell.o : rclaspell.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_RCLASPELL -c -o trrclaspell.o \
rclaspell.cpp
$(BIGLIB): force
cd $(depth)/lib;$(MAKE)
force:
depend: alldeps.stamp
alldeps.stamp : $(SRCS)
$(CXX) -M $(ALL_CXXFLAGS) $(SRCS) > alldeps
touch alldeps.stamp
clean:
cp /dev/null alldeps
rm -f alldeps.stamp
rm -f *.o $(PROGS)
include $(depth)/mk/commontargets
include alldeps
......@@ -26,14 +26,6 @@ TRBINCOBJS = trbinc.o
trbinc: trbinc.o
$(CXX) -o trbinc trbinc.o libmime.a
depend: alldeps.stamp
alldeps.stamp : $(SRCS)
$(CXX) -M $(ALL_CXXFLAGS) $(SRCS) > alldeps
touch alldeps.stamp
clean:
cp /dev/null alldeps
rm -f alldeps.stamp
rm -f ${LIBS} ${PROGS} ${OBJS}
include $(depth)/mk/commontargets
include alldeps
# @(#$Id: Makefile,v 1.16 2008-12-17 14:26:49 dockes Exp $ (C) 2005 J.F.Dockes
depth = ..
include $(depth)/mk/sysconf
# Only test executables get build in here
PROGS = unacpp textsplit rclconfig
all: $(BIGLIB) $(PROGS)
all: librecoll $(PROGS)
$(BIGLIB): force
cd $(depth)/lib;$(MAKE)
force:
UNACPP_OBJS= trunacpp.o $(BIGLIB)
UNACPP_OBJS= trunacpp.o
unacpp : $(UNACPP_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o unacpp $(UNACPP_OBJS) \
$(LIBICONV)
$(LIBRECOLL) $(LIBICONV)
trunacpp.o : unacpp.cpp unacpp.h
$(CXX) $(ALL_CXXFLAGS) -DTEST_UNACPP -c -o trunacpp.o unacpp.cpp
TEXTSPLIT_OBJS= trtextsplit.o $(BIGLIB)
TEXTSPLIT_OBJS= trtextsplit.o
textsplit : $(TEXTSPLIT_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o textsplit $(TEXTSPLIT_OBJS) $(LIBICONV)
$(CXX) $(ALL_CXXFLAGS) -o textsplit $(TEXTSPLIT_OBJS) \
$(LIBRECOLL) $(LIBICONV)
trtextsplit.o : textsplit.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_TEXTSPLIT -c -o trtextsplit.o \
textsplit.cpp
RCLCONFIG_OBJS= trrclconfig.o $(BIGLIB)
RCLCONFIG_OBJS= trrclconfig.o
rclconfig : $(RCLCONFIG_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o rclconfig $(RCLCONFIG_OBJS) \
$(LIBICONV) $(LIBSYS)
$(LIBRECOLL) $(LIBICONV) $(LIBSYS)
trrclconfig.o : rclconfig.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_RCLCONFIG -c -o trrclconfig.o \
rclconfig.cpp
clean:
rm -f *.o $(PROGS)
include $(depth)/mk/commontargets
......@@ -1383,7 +1383,7 @@ int main(int argc, char **argv)
// List mime types not in mimeview
for (vector<string>::const_iterator it = mtypes.begin();
it != mtypes.end(); it++) {
if (config->getMimeViewerDef(*it, "").empty()) {
if (config->getMimeViewerDef(*it, "", false).empty()) {
cout << "No viewer: [" << *it << "]" << endl;
}
}
......@@ -1399,7 +1399,7 @@ int main(int argc, char **argv)
// Check that each mime type has a defined icon
for (vector<string>::const_iterator it = mtypes.begin();
it != mtypes.end(); it++) {
if (config->getMimeIconName(*it) == "document") {
if (config->getMimeIconPath(*it, "") == "document") {
cout << "No or generic icon: [" << *it << "]" << endl;
}
}
......
......@@ -837,10 +837,12 @@ bool TextSplit::stringToStrings(const string &s, vector<string> &tokens)
#else // TEST driver ->
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
......
......@@ -121,6 +121,8 @@ bool unachasaccents(const string& in)
#else // not testing
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
......
......@@ -621,6 +621,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
RCLLIBVERSION
RCLVERSION
NOPYTHON
NOTHREADS
......@@ -5719,6 +5720,8 @@ m_datadir=${m_prefix}/share
QTRECOLL_DATADIR=${m_datadir}/recoll
RCLVERSION=`cat VERSION`
RCLLIBVERSION=$RCLVERSION
......@@ -5769,7 +5772,7 @@ do
cp -f /dev/null $d/alldeps
done
(cd lib;test -f Makefile && chmod +w Makefile;sh mkMake)
(cd lib;RCLLIBVERSION=$RCLLIBVERSION sh mkMake)
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
......
......@@ -533,6 +533,7 @@ m_datadir=${m_prefix}/share
QTRECOLL_DATADIR=${m_datadir}/recoll
RCLVERSION=`cat VERSION`
RCLLIBVERSION=$RCLVERSION
AC_SUBST(X_CFLAGS)
AC_SUBST(X_PRE_LIBS)
......@@ -561,6 +562,7 @@ AC_SUBST(NOPIC)
AC_SUBST(NOTHREADS)
AC_SUBST(NOPYTHON)
AC_SUBST(RCLVERSION)
AC_SUBST(RCLLIBVERSION)
# All object files depend on localdefs which has the cc flags. Avoid
# changing it unless necessary
......@@ -577,7 +579,7 @@ do
cp -f /dev/null $d/alldeps
done
(cd lib;test -f Makefile && chmod +w Makefile;sh mkMake)
(cd lib;RCLLIBVERSION=$RCLLIBVERSION sh mkMake)
AC_OUTPUT
......
......@@ -2542,7 +2542,7 @@ text/html [file:///Users/uncrypted-dockes/projets/bateaux/ilur/factEtCie/r
<replaceable>dc:title:grandet</replaceable> </para>
<para>The colon, if present, means "contains". Xesam defines other
relations, which are mostly supported for now (except in special
relations, which are mostly unsupported for now (except in special
cases, described further down).</para>
<para>All elements in the search entry are normally combined
......
......@@ -4,12 +4,13 @@ include $(depth)/mk/sysconf
PROGS = recollindex
SRCS = recollindex.cpp rclmonrcv.cpp rclmonprc.cpp
all: depend $(PROGS) $(BIGLIB)
all: depend $(PROGS) librecoll
RECOLLINDEX_OBJS= recollindex.o rclmonrcv.o rclmonprc.o $(BIGLIB)
recollindex : $(RECOLLINDEX_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o recollindex $(RECOLLINDEX_OBJS) \
$(BSTATIC) $(LIBXAPIAN) $(LIBXAPIANSTATICEXTRA) \
RECOLLINDEX_OBJS= recollindex.o rclmonrcv.o rclmonprc.o
recollindex : $(RECOLLINDEX_OBJS) librecoll
$(CXX) $(ALL_CXXFLAGS) $(RECOLL_LDFLAGS) -o recollindex \
$(RECOLLINDEX_OBJS) \
$(BSTATIC) $(LIBRECOLL) $(LIBXAPIAN) $(LIBXAPIANSTATICEXTRA) \
$(LIBICONV) $(BDYNAMIC) \
$(LIBFAM) \
$(X_LIBS) $(X_PRE_LIBS) $(X_LIBX11) $(X_EXTRA_LIBS) \
......@@ -21,33 +22,21 @@ rclmonrcv.o : rclmonrcv.cpp
rclmonprc.o : rclmonprc.cpp
$(CXX) $(ALL_CXXFLAGS) -c -o rclmonprc.o $<
SUBTREELIST_OBJS= subtreelist.o $(BIGLIB)
SUBTREELIST_OBJS= subtreelist.o
subtreelist : $(SUBTREELIST_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o subtreelist $(SUBTREELIST_OBJS) \
$(LIBICONV) $(LIBXAPIAN) $(LIBSYS)
$(LIBRECOLL) $(LIBICONV) $(LIBXAPIAN) $(LIBSYS)
subtreelist.o : subtreelist.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_SUBTREELIST -c subtreelist.cpp
MIMETYPE_OBJS= trmimetype.o $(BIGLIB)
mimetype : $(MIMETYPE_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o mimetype $(MIMETYPE_OBJS) \
$(LIBICONV) $(LIBSYS)
$(LIBRECOLL) $(LIBICONV) $(LIBSYS)
trmimetype.o : mimetype.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_MIMETYPE -c -o trmimetype.o \
mimetype.cpp
$(BIGLIB): force
cd $(depth)/lib;$(MAKE)
force:
depend: alldeps.stamp
alldeps.stamp : $(SRCS)
$(CXX) -M $(ALL_CXXFLAGS) $(SRCS) > alldeps
touch alldeps.stamp
clean:
cp /dev/null alldeps
rm -f alldeps.stamp
rm -f *.o $(PROGS)
include $(depth)/mk/commontargets
include alldeps
# @(#$Id: Makefile,v 1.4 2008-11-24 15:47:40 dockes Exp $ (C) 2005 J.F.Dockes
depth = ..
include $(depth)/mk/sysconf
# Only test executables get build in here
PROGS = mh_mbox internfile
all: $(BIGLIB) $(PROGS)
$(BIGLIB): force
cd $(depth)/lib;$(MAKE)
force:
all: librecoll $(PROGS)
INTERNFILE_OBJS= trinternfile.o $(BIGLIB)
internfile : $(INTERNFILE_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o internfile $(INTERNFILE_OBJS) \
$(LIBICONV) $(LIBSYS)
$(LIBRECOLL) $(LIBICONV) $(LIBSYS)
trinternfile.o : internfile.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_INTERNFILE -c -o trinternfile.o \
internfile.cpp
......@@ -22,12 +17,9 @@ trinternfile.o : internfile.cpp
MH_MBOX_OBJS= trmh_mbox.o $(BIGLIB)
mh_mbox : $(MH_MBOX_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o mh_mbox $(MH_MBOX_OBJS) \
$(LIBICONV) $(LIBSYS)
$(LIBRECOLL) $(LIBICONV) $(LIBSYS)
trmh_mbox.o : mh_mbox.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_MH_MBOX -c -o trmh_mbox.o \
mh_mbox.cpp
clean:
rm -f *.o $(PROGS)
include $(depth)/mk/commontargets
......@@ -1216,7 +1216,8 @@ int main(int argc, char **argv)
perror("stat");
exit(1);
}
FileInterner interner(fn, &st, config, "/tmp", 0);
TempDir tmp;
FileInterner interner(fn, &st, config, tmp, 0);
Rcl::Doc doc;
FileInterner::Status status = interner.internfile(doc, ipath);
switch (status) {
......
......@@ -54,7 +54,7 @@ add_custom_target(rcllib
)
add_dependencies(kio_recoll rcllib)
target_link_libraries(kio_recoll rcl xapian z ${EXTRA_LIBS} ${KDE4_KIO_LIBS})
target_link_libraries(kio_recoll recoll xapian z ${EXTRA_LIBS} ${KDE4_KIO_LIBS})
install(TARGETS kio_recoll DESTINATION ${PLUGIN_INSTALL_DIR})
......
......@@ -2,21 +2,25 @@
depth = ..
include $(depth)/mk/sysconf
LIBS = librcl.a
LIBRECOLL=librecoll.so.$(RCLLIBVERSION)
LIBS = librecoll.a $(LIBRECOLL)
all: $(LIBS)
OBJS = rclaspell.o beaglequeuecache.o cstr.o rclconfig.o rclinit.o textsplit.o unacpp.o beaglequeue.o bglfetcher.o fetcher.o fsfetcher.o fsindexer.o indexer.o mimetype.o subtreelist.o htmlparse.o internfile.o mh_exec.o mh_execm.o mh_html.o mh_mail.o mh_mbox.o mh_text.o mimehandler.o myhtmlparse.o txtdcode.o docseq.o docseqdb.o docseqhist.o filtseq.o dynconf.o plaintorich.o recollq.o reslistpager.o sortseq.o wasastringtoquery.o wasatorcl.o daterange.o expansiondbs.o rclabstract.o rcldb.o rcldoc.o rclquery.o searchdata.o searchdataxml.o stemdb.o stoplist.o synfamily.o unac.o base64.o circache.o closefrom.o conftree.o copyfile.o debuglog.o ecrontab.o execmd.o fstreewalk.o idfile.o fileudi.o md5.o mimeparse.o netcon.o pathut.o pxattr.o rclionice.o readfile.o smallut.o transcode.o wipedir.o x11mon.o mime-parsefull.o mime-parseonlyheader.o mime-printbody.o mime.o convert.o iodevice.o iofactory.o
DEPS = rclaspell.dep.stamp beaglequeuecache.dep.stamp cstr.dep.stamp rclconfig.dep.stamp rclinit.dep.stamp textsplit.dep.stamp unacpp.dep.stamp beaglequeue.dep.stamp bglfetcher.dep.stamp fetcher.dep.stamp fsfetcher.dep.stamp fsindexer.dep.stamp indexer.dep.stamp mimetype.dep.stamp subtreelist.dep.stamp htmlparse.dep.stamp internfile.dep.stamp mh_exec.dep.stamp mh_execm.dep.stamp mh_html.dep.stamp mh_mail.dep.stamp mh_mbox.dep.stamp mh_text.dep.stamp mimehandler.dep.stamp myhtmlparse.dep.stamp txtdcode.dep.stamp docseq.dep.stamp docseqdb.dep.stamp docseqhist.dep.stamp filtseq.dep.stamp dynconf.dep.stamp plaintorich.dep.stamp recollq.dep.stamp reslistpager.dep.stamp sortseq.dep.stamp wasastringtoquery.dep.stamp wasatorcl.dep.stamp daterange.dep.stamp expansiondbs.dep.stamp rclabstract.dep.stamp rcldb.dep.stamp rcldoc.dep.stamp rclquery.dep.stamp searchdata.dep.stamp searchdataxml.dep.stamp stemdb.dep.stamp stoplist.dep.stamp synfamily.dep.stamp unac.dep.stamp base64.dep.stamp circache.dep.stamp closefrom.dep.stamp conftree.dep.stamp copyfile.dep.stamp debuglog.dep.stamp ecrontab.dep.stamp execmd.dep.stamp fstreewalk.dep.stamp idfile.dep.stamp fileudi.dep.stamp md5.dep.stamp mimeparse.dep.stamp netcon.dep.stamp pathut.dep.stamp pxattr.dep.stamp rclionice.dep.stamp readfile.dep.stamp smallut.dep.stamp transcode.dep.stamp wipedir.dep.stamp x11mon.dep.stamp mime-parsefull.dep.stamp mime-parseonlyheader.dep.stamp mime-printbody.dep.stamp mime.dep.stamp convert.dep.stamp iodevice.dep.stamp iofactory.dep.stamp
librcl.a : $(DEPS) $(OBJS)
ar ru librcl.a $(OBJS)
$(RANLIB) librcl.a
librecoll.a : $(DEPS) $(OBJS)
ar ru librecoll.a $(OBJS)
$(RANLIB) librecoll.a
# Future
#all: librecoll.so
#librecoll.so : $(DEPS) $(OBJS)
# g++ -shared -Wl,--no-undefined # -Wl,-soname=librecoll.so.1 -o librecoll.so $(OBJS) # -lxapian -lz -lX11 -lpthread -ldl
# Note that we are using the Recoll release number in the soname. There is
# no effort whatsoever to maintain any kind of ABI compat in this lib. Only
# programs or modules from the same Recoll release can be compatible.
$(LIBRECOLL): $(DEPS) $(OBJS)
g++ -shared -Wl,--no-undefined -Wl,-rpath=$(libdir) -Wl,-soname=$(LIBRECOLL) -o $(LIBRECOLL) $(OBJS) -lxapian -lz -lX11 -lpthread -ldl
rm -f librecoll.so
ln -s $(LIBRECOLL) librecoll.so
rclaspell.o : ../aspell/rclaspell.cpp $(depth)/mk/localdefs
$(CXX) $(ALL_CXXFLAGS) -c ../aspell/rclaspell.cpp
......
......@@ -115,23 +115,27 @@ cat > $mk <<EOF
depth = ${depth}
include \$(depth)/mk/sysconf
LIBS = librcl.a
LIBRECOLL=librecoll.so.\$(RCLLIBVERSION)
LIBS = librecoll.a \$(LIBRECOLL)
all: \$(LIBS)
OBJS = $OBJS
DEPS = $DEPS
librcl.a : \$(DEPS) \$(OBJS)
ar ru librcl.a \$(OBJS)
\$(RANLIB) librcl.a
# Future
#all: librecoll.so
#librecoll.so : \$(DEPS) \$(OBJS)
# g++ -shared -Wl,--no-undefined \
# -Wl,-soname=librecoll.so.1 -o librecoll.so \$(OBJS) \
# -lxapian -lz -lX11 -lpthread -ldl
librecoll.a : \$(DEPS) \$(OBJS)
ar ru librecoll.a \$(OBJS)
\$(RANLIB) librecoll.a
# Note that we are using the Recoll release number in the soname. There is
# no effort whatsoever to maintain any kind of ABI compat in this lib. Only
# programs or modules from the same Recoll release can be compatible.
\$(LIBRECOLL): \$(DEPS) \$(OBJS)
g++ -shared -Wl,--no-undefined -Wl,-rpath=\$(libdir) \
-Wl,-soname=\$(LIBRECOLL) -o \$(LIBRECOLL) \$(OBJS) \
-lxapian -lz -lX11 -lpthread -ldl
rm -f librecoll.so
ln -s \$(LIBRECOLL) librecoll.so
EOF
......
......@@ -15,8 +15,7 @@ COMMONCXXFLAGS = -I. \
# the sys file or localdefs
SYSPICFLAGS = -fPIC -DPIC
BIGLIB = $(depth)/lib/librcl.a
LIBRECOLL = -L $(depth)/lib -lrecoll -Wl,-rpath=$(libdir)
RANLIB = test -f
AR=ar
librecoll:
make -C $(depth)/lib
depend: alldeps.stamp
alldeps.stamp : $(SRCS)
$(CXX) -M $(ALL_CXXFLAGS) $(SRCS) > alldeps
touch alldeps.stamp
clean:
cp /dev/null alldeps
rm -f alldeps.stamp
rm -f *.o ${LIBS} ${PROGS} ${OBJS}
......@@ -10,6 +10,8 @@ INCICONV=@INCICONV@
LIBFAM = @LIBFAM@
RCLLIBVERSION=@RCLLIBVERSION@
X_CFLAGS=@X_CFLAGS@
X_PRE_LIBS=@X_PRE_LIBS@
X_LIBS=@X_LIBS@
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment