diff --git a/.gitignore b/.gitignore index 36d439fb..8a69d327 100644 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,9 @@ build-*-Debug build-*-Release libtool ptrans +**/Makefile.in src/Makefile -src/Makefile.in +src/rclgrep/Makefile src/TAGS src/aclocal.m4 src/autom4te.cache @@ -77,7 +78,6 @@ src/recollq src/sampleconf/rclmon.sh src/sampleconf/recoll.conf src/testmains/Makefile -src/testmains/Makefile.in src/xadump stamp-h1 tests/casediac/aspdict.en.rws diff --git a/src/Makefile.am b/src/Makefile.am index 1844e466..8cced3eb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,7 +4,11 @@ if COND_TESTMAINS MAYBE_TESTMAINS = testmains endif -SUBDIRS = . $(MAYBE_TESTMAINS) +if COND_RCLGREP + MAYBE_RCLGREP = rclgrep +endif +SUBDIRS = . $(MAYBE_TESTMAINS) $(MAYBE_RCLGREP) + DIST_SUBDIRS = . CXXFLAGS ?= @CXXFLAGS@ @@ -306,7 +310,7 @@ PicStatic: $(librecoll_la_OBJECTS) $(LIBTOOL) --tag=LD --mode=link gcc -g -O -o librecoll.la \ $(librecoll_la_OBJECTS) -bin_PROGRAMS = recollindex rclgrep +bin_PROGRAMS = recollindex if MAKECMDLINE bin_PROGRAMS += recollq endif @@ -330,11 +334,6 @@ recollindex_SOURCES = \ recollindex_LDADD = librecoll.la -rclgrep_SOURCES = \ - index/rclgrep.cpp - -rclgrep_LDADD = librecoll.la - recollq_SOURCES = query/recollqmain.cpp recollq_LDADD = librecoll.la diff --git a/src/configure.ac b/src/configure.ac index f29ebb5f..1f1b8b9b 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -206,6 +206,11 @@ AC_ARG_ENABLE(testmains, buildtestmains=$enableval, buildtestmains=no) AM_CONDITIONAL([COND_TESTMAINS], [test "$buildtestmains" = yes]) +AC_ARG_ENABLE(rclgrep, + AS_HELP_STRING([--enable-rclgrep],[Enable building the index-less search tool.]), + buildrclgrep=$enableval, buildrclgrep=no) +AM_CONDITIONAL([COND_RCLGREP], [test "$buildrclgrep" = yes]) + # Enable CamelCase word splitting. This is optional because it causes # problems with phrases: with camelcase enabled, "MySQL manual" # will be matched by "MySQL manual" and "my sql manual" but not @@ -558,5 +563,8 @@ AC_CONFIG_FILES([Makefile python/recoll/setup.py if test X$buildtestmains = Xyes ; then AC_CONFIG_FILES([testmains/Makefile]) fi +if test X$buildrclgrep = Xyes ; then + AC_CONFIG_FILES([rclgrep/Makefile]) +fi AC_OUTPUT diff --git a/src/rclgrep/Makefile.am b/src/rclgrep/Makefile.am new file mode 100644 index 00000000..fa47f391 --- /dev/null +++ b/src/rclgrep/Makefile.am @@ -0,0 +1,95 @@ +CXXFLAGS ?= @CXXFLAGS@ +XSLT_CFLAGS=@XSLT_CFLAGS@ +XSLT_LINKADD=@XSLT_LINKADD@ +LIBICONV=@LIBICONV@ +INCICONV=@INCICONV@ +DEFS=@DEFS@ + +COMMONCPPFLAGS = -I. \ + -I$(top_srcdir)/aspell \ + -I$(top_srcdir)/bincimapmime \ + -I$(top_srcdir)/common \ + -I$(top_srcdir)/index \ + -I$(top_srcdir)/internfile \ + -I$(top_srcdir)/query \ + -I$(top_srcdir)/rcldb \ + -I$(top_srcdir)/unac \ + -I$(top_srcdir)/utils \ + -I$(top_srcdir)/xaposix \ + -DBUILDING_RECOLL + +AM_CPPFLAGS = -Wall -Wno-unused -std=c++11 \ + $(COMMONCPPFLAGS) \ + $(INCICONV) \ + $(XSLT_CFLAGS) \ + -DRECOLL_DATADIR=\"${pkgdatadir}\" \ + -DREADFILE_ENABLE_ZLIB -DREADFILE_ENABLE_MINIZ -DREADFILE_ENABLE_MD5 \ + -D_GNU_SOURCE \ + $(DEFS) + +bin_PROGRAMS = rclgrep + +rclgrep_SOURCES = \ + rclgrep.cpp \ + ../bincimapmime/convert.cc \ + ../bincimapmime/mime-parsefull.cc \ + ../bincimapmime/mime-parseonlyheader.cc \ + ../bincimapmime/mime-printbody.cc \ + ../bincimapmime/mime.cc \ + ../common/cstr.cpp \ + ../common/rclconfig.cpp \ + ../common/rclinit.cpp \ + ../common/textsplit.cpp \ + ../common/textsplitko.cpp \ + ../common/webstore.cpp \ + ../index/exefetcher.cpp \ + ../index/fetcher.cpp \ + ../index/fsfetcher.cpp \ + ../index/idxdiags.cpp \ + ../index/mimetype.cpp \ + ../index/webqueuefetcher.cpp \ + ../internfile/extrameta.cpp \ + ../internfile/htmlparse.cpp \ + ../internfile/internfile.cpp \ + ../internfile/mh_exec.cpp \ + ../internfile/mh_execm.cpp \ + ../internfile/mh_html.cpp \ + ../internfile/mh_mail.cpp \ + ../internfile/mh_mbox.cpp \ + ../internfile/mh_text.cpp \ + ../internfile/mh_xslt.cpp \ + ../internfile/mimehandler.cpp \ + ../internfile/myhtmlparse.cpp \ + ../internfile/txtdcode.cpp \ + ../internfile/uncomp.cpp \ + ../rcldb/rcldoc.cpp \ + ../unac/unac.cpp \ + ../utils/base64.cpp \ + ../utils/cancelcheck.cpp \ + ../utils/chrono.cpp \ + ../utils/circache.cpp \ + ../utils/closefrom.cpp \ + ../utils/cmdtalk.cpp \ + ../utils/conftree.cpp \ + ../utils/copyfile.cpp \ + ../utils/cpuconf.cpp \ + ../utils/execmd.cpp \ + ../utils/fileudi.cpp \ + ../utils/fstreewalk.cpp \ + ../utils/idfile.cpp \ + ../utils/log.cpp \ + ../utils/md5.cpp \ + ../utils/md5ut.cpp \ + ../utils/mimeparse.cpp \ + ../utils/miniz.cpp \ + ../utils/netcon.cpp \ + ../utils/pathut.cpp \ + ../utils/pxattr.cpp \ + ../utils/rclutil.cpp \ + ../utils/readfile.cpp \ + ../utils/smallut.cpp \ + ../utils/transcode.cpp \ + ../utils/wipedir.cpp \ + ../utils/zlibut.cpp + +rclgrep_LDADD = $(XSLT_LIBS) $(LIBICONV) $(LIBTHREADS) diff --git a/src/index/rclgrep.cpp b/src/rclgrep/rclgrep.cpp similarity index 99% rename from src/index/rclgrep.cpp rename to src/rclgrep/rclgrep.cpp index df4611f1..fc43af38 100644 --- a/src/index/rclgrep.cpp +++ b/src/rclgrep/rclgrep.cpp @@ -96,6 +96,12 @@ int g_reflags = SimpleRegexp::SRE_NOSUB; static RclConfig *config; +namespace Rcl { +std::string version_string() +{ + return string("rclgrep ") + string(PACKAGE_VERSION); +} +} // Working directory before we change: it's simpler to change early // but some options need the original for computing absolute paths. static std::string orig_cwd;