misc small mods to help with building kio_recoll

This commit is contained in:
dockes
2006-01-19 12:01:43 +00:00
parent 4bcdb17480
commit 6e0ec42dad
25 changed files with 504 additions and 238 deletions
+29 -28
View File
@@ -1,3 +1,5 @@
depth = ..
include $(depth)/mk/sysconf
PROGS = trconftree wipedir smallut trfstreewalk trpathut \
transcode \
@@ -6,78 +8,77 @@ PROGS = trconftree wipedir smallut trfstreewalk trpathut \
all: $(PROGS) $(BIGLIB)
$(BIGLIB):
cd ../lib;$(MAKE)
cd $(depth)/lib;$(MAKE)
FSTREEWALK_OBJS= trfstreewalk.o fstreewalk.o pathut.o
FSTREEWALK_OBJS= trfstreewalk.o fstreewalk.o $(BIGLIB)
trfstreewalk : $(FSTREEWALK_OBJS)
$(CXX) -o trfstreewalk $(FSTREEWALK_OBJS)
trfstreewalk.o : fstreewalk.cpp fstreewalk.h
$(CXX) -o trfstreewalk.o -c $(CXXFLAGS) \
$(CXX) -o trfstreewalk.o -c $(ALL_CXXFLAGS) \
-DTEST_FSTREEWALK fstreewalk.cpp
PATHUT_OBJS= trpathut.o pathut.o $(BIGLIB)
trpathut : $(PATHUT_OBJS)
$(CXX) $(CXXFLAGS) -o trpathut $(PATHUT_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o trpathut $(PATHUT_OBJS)
trpathut.o : pathut.cpp pathut.h
$(CXX) -o trpathut.o -c $(CXXFLAGS) -DTEST_PATHUT pathut.cpp
$(CXX) -o trpathut.o -c $(ALL_CXXFLAGS) -DTEST_PATHUT pathut.cpp
EXECMD_OBJS= trexecmd.o $(BIGLIB)
trexecmd : $(EXECMD_OBJS)
$(CXX) $(CXXFLAGS) -o trexecmd $(EXECMD_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o trexecmd $(EXECMD_OBJS)
trexecmd.o : execmd.cpp execmd.h
$(CXX) -o trexecmd.o -c $(CXXFLAGS) -DTEST_EXECMD execmd.cpp
$(CXX) -o trexecmd.o -c $(ALL_CXXFLAGS) -DTEST_EXECMD execmd.cpp
TRANSCODE_OBJS= trtranscode.o $(BIGLIB)
transcode : $(TRANSCODE_OBJS)
$(CXX) $(CXXFLAGS) -o transcode $(TRANSCODE_OBJS) $(LIBICONV)
trtranscode.o : ../utils/transcode.cpp
$(CXX) $(CXXFLAGS) -DTEST_TRANSCODE -c -o trtranscode.o \
$(CXX) $(ALL_CXXFLAGS) -o transcode $(TRANSCODE_OBJS) $(LIBICONV)
trtranscode.o : transcode.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_TRANSCODE -c -o trtranscode.o \
transcode.cpp
IDFILE_OBJS= tridfile.o $(BIGLIB)
idfile : $(IDFILE_OBJS)
$(CXX) $(CXXFLAGS) -o idfile $(IDFILE_OBJS) $(LIBICONV)
tridfile.o : ../utils/idfile.cpp
$(CXX) $(CXXFLAGS) -DTEST_IDFILE -c -o tridfile.o \
$(CXX) $(ALL_CXXFLAGS) -o idfile $(IDFILE_OBJS) $(LIBICONV)
tridfile.o : idfile.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_IDFILE -c -o tridfile.o \
idfile.cpp
MIMEPARSE_OBJS= trmimeparse.o $(BIGLIB)
trmimeparse : $(MIMEPARSE_OBJS)
$(CXX) $(CXXFLAGS) -o trmimeparse $(MIMEPARSE_OBJS) $(LIBICONV)
$(CXX) $(ALL_CXXFLAGS) -o trmimeparse $(MIMEPARSE_OBJS) $(LIBICONV)
trmimeparse.o : mimeparse.cpp
$(CXX) $(CXXFLAGS) -DTEST_MIMEPARSE -c -o trmimeparse.o \
$(CXX) $(ALL_CXXFLAGS) -DTEST_MIMEPARSE -c -o trmimeparse.o \
mimeparse.cpp
SMALLUT_OBJS= trsmallut.o $(BIGLIB)
smallut : $(SMALLUT_OBJS)
$(CXX) $(CXXFLAGS) -o smallut $(SMALLUT_OBJS) $(LIBICONV)
trsmallut.o : ../utils/smallut.cpp
$(CXX) $(CXXFLAGS) -DTEST_SMALLUT -c -o trsmallut.o \
$(CXX) $(ALL_CXXFLAGS) -o smallut $(SMALLUT_OBJS) $(LIBICONV)
trsmallut.o : smallut.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_SMALLUT -c -o trsmallut.o \
smallut.cpp
WIPEDIR_OBJS= trwipedir.o $(BIGLIB)
wipedir : $(WIPEDIR_OBJS)
$(CXX) $(CXXFLAGS) -o wipedir $(WIPEDIR_OBJS) $(LIBICONV)
trwipedir.o : ../utils/wipedir.cpp
$(CXX) $(CXXFLAGS) -DTEST_WIPEDIR -c -o trwipedir.o \
$(CXX) $(ALL_CXXFLAGS) -o wipedir $(WIPEDIR_OBJS) $(LIBICONV)
trwipedir.o : wipedir.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_WIPEDIR -c -o trwipedir.o \
wipedir.cpp
UTF8ITER_OBJS= trutf8iter.o $(BIGLIB)
utf8iter : $(UTF8ITER_OBJS)
$(CXX) $(CXXFLAGS) -o utf8iter $(UTF8ITER_OBJS) $(LIBICONV)
trutf8iter.o : ../utils/utf8iter.cpp utf8iter.h
$(CXX) $(CXXFLAGS) -DTEST_UTF8ITER -c -o trutf8iter.o \
$(CXX) $(ALL_CXXFLAGS) -o utf8iter $(UTF8ITER_OBJS) $(LIBICONV)
trutf8iter.o : utf8iter.cpp utf8iter.h
$(CXX) $(ALL_CXXFLAGS) -DTEST_UTF8ITER -c -o trutf8iter.o \
utf8iter.cpp
CONFTREE_OBJS= trconftree.o $(BIGLIB)
trconftree : $(CONFTREE_OBJS)
$(CXX) $(CXXFLAGS) -o trconftree $(CONFTREE_OBJS)
trconftree.o : ../utils/conftree.cpp
$(CXX) $(CXXFLAGS) -DTEST_CONFTREE -c -o trconftree.o \
$(CXX) $(ALL_CXXFLAGS) -o trconftree $(CONFTREE_OBJS)
trconftree.o : conftree.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_CONFTREE -c -o trconftree.o \
conftree.cpp
clean:
rm -f *.o $(PROGS)
include ../mk/sysconf
+20 -1
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.12 2006-01-04 11:33:44 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.13 2006-01-19 12:01:43 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
#ifndef TEST_SMALLUT
#include <string>
@@ -311,6 +311,25 @@ void trimstring(string &s, const char *ws)
s.replace(pos+1, string::npos, "");
}
// Escape things that would look like markup
string escapeHtml(const string &in)
{
string out;
for (string::size_type pos = 0; pos < in.length(); pos++) {
switch(in.at(pos)) {
case '<':
out += "&lt;";
break;
case '&':
out += "&amp;";
break;
default:
out += in.at(pos);
}
}
return out;
}
#else
#include <string>
+3 -1
View File
@@ -1,6 +1,6 @@
#ifndef _SMALLUT_H_INCLUDED_
#define _SMALLUT_H_INCLUDED_
/* @(#$Id: smallut.h,v 1.11 2006-01-04 11:33:44 dockes Exp $ (C) 2004 J.F.Dockes */
/* @(#$Id: smallut.h,v 1.12 2006-01-19 12:01:43 dockes Exp $ (C) 2004 J.F.Dockes */
#include <string>
#include <list>
@@ -40,4 +40,6 @@ extern bool stringToBool(const string &s);
tab}) at beginning and end of input string */
extern void trimstring(string &s, const char *ws = " \t");
extern std::string escapeHtml(const std::string &in);
#endif /* _SMALLUT_H_INCLUDED_ */